1. Create device: How to edit crontab with favourite editor.. Connect to a samba share on another computer... Connect to a domain... Patching Q: How do I remove or access a file that has a filename that begins with special characters? Q: How do I use find to locate files and run a command on the found files? Q: I get this LILO warning when booting up: "Error: Duplicated Volume Id" Q: How do you create and use a swapfile in Linux 2.6? Q: Why doesn't my computer (Soekris, EPIA box) boot via PXE after a warm reboot?Software Raid
root@host:/# mknod /dev/md0 b 9 0 root@host:/# mknod /dev/md1 b 9 1 [...]
2. Create partitions:root@host:/# fdisk /dev/sda root@host:/# fdisk /dev/sdb
3. Create filesystem:root@host:/# mkreiserfs /dev/sda1 root@host:/# mkreiserfs /dev/sdb1 [...]
4. Cretate RAID:root@host:/# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1 root@host:/# mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2 [...]
Crontab
root@host:/# export VISUAL="nano -w"
Samba
root@host:/# smbmount //192.168.78.5/share /local/share -o rw,username=piggy,password=XXXXXXXX
root@host:/# net rpc join MEMBER -S server -U user%password
Linux Kernel
root@host:/# cd /usr/src/linux root@host:/# patch -p1
Basic commands
A: Use ./ before the filenameroot@host:/# rm ./--bad-filename
A: Use the the -exec find ./ -name "*.$$$" -exec chmod +w '{}' \;
LILO
A: Run lilo and clear the volume serial number on the boot deviceroot@host:/# lilo -z -M /dev/hda
Swapfile - not swap partition - in Linux 2.6.x
A: Well look below, make the swapfile as big as the internal memory.root@host:/# dd if=/dev/zero of=/swapfile bs=1M count=256 root@host:/# mkswap /swapfile Edit /etc/fstab, add: /swapfile none swap defaults 0 0 root@host:/# swapon -a Be sure to mount the swapfile after regular file systems is mounted (in your startup scripts): /bin/mount -n -o remount,rw /bin/rm -f /etc/mtab* /bin/mount -a -O no_netdev swapon -a
No pxe boot after doing a warm boot
A: Apparently a problem with Linux/Wake On Lan. Get ethtool and run this command in a startup or shutdown script:ethtool -s eth0 wol d
Count unique rows in httpd access file
grep sakerhetsbesiktning/index2.html assa.access |sed 's/\([0-9.]*\).*/\1/g'|sort|uniq|wc -l
Convert several images in a folder
for img in `ls *.JPG` ; do for> convert $img -resize 640x480 thumb-$img for> done
Find large folders
du -h | egrep -e [0-9\.]+G
SSH without login
Wednesday, October 21, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment