Rob linux
From ByteWiki
Reason for this Entry
As i am trying to gain an understanding of Linux during my IBL year i thought it would be a good idea to have a place where i could store all the information that think might be useful in the future. Originally this was a text file on my Ipod which i added to when needed but this became difficult to manage due to the fact that sometimes i forgot to bring my Ipod to work. This meant that i ended up with multipule versions of my file.
As a result it was suggested to me that i create an entry on the byteclub wiki, which as you can see i have done.
The Information
Rotate Logs
Default time for keeping logs is 4 weeks (it was suggested to me that this is quite a short time and it should be increased)
To change edit the rotate parameter in
/etc/logrotate.conf
Enabling DHCP server
To setup a DHCP server on an interface
for a once off use
dhclient ethX should do it.
for a permanent solution edit
edit /etc/sysconfig/network-scripts/ifcfg-ethX.
whatis
To get a short description of a command use
whatis [command]
Finding Files
To find a file use
locate [file_name]
Alternatives (in really bad description)
find [some/directory or . for current] -name or -iname '*something*' find [some/directory or . for current] -atime +n (older then n days, use -n for younger then n)
The locate database updates at 4am in a Cron job. If you manually need to be update the database use
updatedb
ifconfig
Location of ifconfig
/sbin/ifconfig
can be used to show interface info when not logged in as root
ethtool
ethtool gives information about ethernet card settings (can also change settings)
ethtool
Using SCP(Secure Copy Protocol)
scp filename.jpg user@host:/path/to/upload scp tables.txt rshaw@mercury.it.swin.edu.au:/home/rshaw
needs expansion
Make script executable
chmod +x swu.pl
needs expansion Have a look at the chmod page ;)
SSH login Banner
edit
/etc/ssh/sshd_config
edit Banner to use file e.g.
/tmp/ssh_banner
Example
****Test - rshaw-linux****
Change system HostName
Edit
/etc/sysconfig/network NETWORKING=yes HOSTNAME=localhost.localdomain
Running Load Grahps
ssh -X rshaw@venus -f /usr/X11R6/bin/xload
needs expansion
System Services
to update (and query) system service runlevels use
chkconfig
example
chkconfig named on
Edit IDE Hard disk performance
edit
/etc/sysconfig/harddisks
needs expansion
DVB Notes
Find out your dvb driver module, perhaps dvb-bt8xx or cx88-dvb
add a line to /etc/modprobe.conf
alias char-major-212 cx88-dvb
Edit /etc/rc.d/rc.sysinit
Find the line other=""
and change it to
other="char-major-212"
or
make an executable file called /etc/sysconfig/modules/dvb.modules
#!/bin/sh for i in char-major-212 ;do modprobe $i >/dev/null 2>&1 done
The scandata:
T 226500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE T 177500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE T 191625000 7MHz 3/4 NONE QAM64 8k 1/16 NONE T 219500000 7MHz 3/4 NONE QAM64 8k 1/16 NONE T 536500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
Run svandvb scandata > channels.conf
Installing from Source
Firstly, untar file
tar xvzf dvbstream-0.5.tar.gz
Secondly
./configure <- is this required??
Thirdly
make
Using dvbstream (in Australia)
Download source from http://sourceforge.net/projects/dvbtools/
Extract tar.gz
tar xvzf dvbstream-0.5.tar.gz
Type
make
test by using
./dvbstream
the example below records channel 7 to the file /tmp/test7.mpg for 10 seconds dvbstream -qam 64 -cr 3_4 -gi 16 -bw 7 -tm 8 -f 177500 -ps -n 10 -o 1025 1026 > /tmp/test7.mpg
Where
PID Video = 1025
PID Audio = 1026
Frequency = 177500
Time to record = -n 10
NOT CONFIRMED
FEC = 3_4
QAM = -qam 64
Bandwitch (MHZ) = -bw 7
Transmission Mode = -tm 8
refer http://www.dtvforum.info/lofiversion/index.php/t52.html
Using SMBclient
smbclient /\/\rshaw-linux/\gdm
http://learnlinux.tsf.org.za/courses/build/net-admin/ch08s02.html
smbclient -L 136.186.5.161
Domain=[IT-STUDENTS] OS=[Unix] Server=[Samba 3.0.10-1.4E.6]
Sharename Type Comment
--------- ---- -------
gdm Disk
IPC$ IPC IPC Service (Samba Server)
ADMIN$ IPC IPC Service (Samba Server)
ew101 Printer ew101
rshaw Disk Home Directories
Server Comment
--------- -------
RSHAW-LINUX Samba Server
Workgroup Master
--------- -------
IT-STUDENTS RSHAW-LINUX
Size of a Directory
use
du -sh
Free disk space
use
df -h
other examples
uasge of . (hidden) files excluding .. files
du -sh .[^.]*
usage of . (hidden) files as well as viewable files excluding .. files
du -sh .[^.]* *
Create Symbolic Link
use, without the []
ln -s [target directory] ./[shortcut]
IN PROGRESS
Using nmap
Stealth TCP SYN scan - Only sends a SYN packet - referred to as Half Open Scanning
nmap -sS 192.168.0.1
Tries to find what Operating System is running on 192.168.0.1
nmap -O 192.168.0.1
Mount an image on a Loopback device
[root@dalek tmp]# mkdir /mnt/img [root@dalek tmp]# mount -o loop -t iso9660 dvd.img /mnt/img
Transcode xvid to DVD - Linux
avimerge -c -o output1.avi -i input1a.avi input2a.avi ffmpeg -i output-avimerge.avi -target ntsc-dvd -aspect 4:3 DISK1.mpg dvdauthor -o dvd/ -t DISK1.mpg mkisofs -dvd-video -o dvd.img dvd/ mkdir /mnt/img mount -o loop -t iso9660 filename.iso /mnt/img lxdvdrip -dl=/mnt/img/ -st=vamps mk isofs -dvd-video -o dvd-finished.img film-dvd/ cdrecord dvd-finished.img
Locations
/media - Removeable media /mnt - System Resources
Burning ISO image
growisofs -dvd-compat -Z /dev/dvd1=FC-5-i386-DVD.iso
This example burned an ISO image to a external DVD Drive (note /dev/dvd1)
Mplayer ASCII
mplayer The\ Chaser\'s\ War\ on\ Everything\ -\ 1x11.pdtv.xvid.buddy.avi -vo caca -ao none -quiet
new
ffmpeg -i doug.avi -pass 1 -target pal-dvd -b 2000 -aspect 16:9 doug.mpg
currently trying approx 2 x original bitrate
Misc
cp -R Kanye\ West\ -\ The\ College\ Dropout/ ~pdealy/Kanye_West
getfattr -R -d /usr/ /var/
Play DVD Image with xine
xine dvd://home/ibl/rshaw/misc/video/pride-fc2006.img
could also be .iso
