From: yomguy Date: Thu, 25 Nov 2010 13:20:51 +0000 (+0000) Subject: update tips X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=153eb9f949f4a1df4ffe8fb12358c732498b6b2a;p=tools.git update tips git-svn-id: http://svn.parisson.org/svn/tools/trunk@124 457c0346-1240-4656-8a5a-9edca8063506 --- diff --git a/tips/tips.html b/tips/tips.html index c68cc81..a1276cc 100644 --- a/tips/tips.html +++ b/tips/tips.html @@ -3,283 +3,230 @@ - + # YomGuy's Linux Ultra Fast Tips @@ -288,6 +235,11 @@ ul.auto-toc {

# YomGuy's Linux Ultra Fast Tips

YomGuy's Linux Ultra Fast Tips (1/1)

+

♫♪♫♪ ╔╦╦╦═╦╗╔═╦═╦══╦═╗ ♫♪♫♪♫♪ +♫♪♫♪ ║║║║╩╣╚╣═╣║║║║║╩╣ ♫♪♫♪♫♪ +♫♪♫♪ ╚══╩═╩═╩═╩═╩╩╩╩═╝ ♫♪♫♪♫♪

+

This is a list of my short command line tips to get some various, +sometimes advanced, functions on GNU/Linux systems, especially on Debian.

RENAME

rename more than 1 file

@@ -311,6 +263,7 @@ sed -i -e 's/cellar/deefuzz/g' deefuzz_cellar_mp3_234.xml find ./ -iname "*.pyc" -exec rm {} \; find . -name ".svn" -type d -exec rm -rf {} \; find . -name 'test*' -mtime +30 -type f -print0 |xargs -0 rm -f +sudo find . -mtime +480 -exec rm {} \;
@@ -396,6 +349,7 @@ for i in *.pbm; do ocrad --charset=iso-8859-15 -o $i.txt $i; done

_:

 for i in *.wav; do sox $i -s -w $i.wav; mv $i.wav converted/$i; done
+sox Jano_B-Homosapiens.mp3 -r 44100 -b 16 -s -t wav - | flac - -o Jano_B-Homosapiens.flac
 
@@ -405,6 +359,11 @@ for i in *.wav; do sox $i -s -w $i.wav; mv $i.wav converted/$i; done convert -density 150x150 telecaster_video01.eps telecaster_video01.png for i in `ls *.eps`; do convert -density 200x200 $i $i.png; done +
+
crop::
+
convert waveform_homosapiens.png -crop 100x50% waveform_homosapiens2.png +http://www.imagemagick.org/Usage/crop/#crop_percent
+

GCC

@@ -536,7 +495,7 @@ mysql> QUIT

-

System Message: WARNING/2 (tips.txt, line 262)

+

System Message: WARNING/2 (tips.txt, line 278)

Definition list ends without a blank line; unexpected unindent.

mysql> FLUSH PRIVILEGES;

@@ -570,6 +529,7 @@ ffmpeg -ss 80 -t 10 -i test_xvid.avi -f flv -vcodec flv -vb 500k -ab 96k -ar 441

KERNEL CUSTOM

+

apt-get install kernel-package libncurses5-dev fakeroot wget bzip2

patch:

 diff -uprN linux-2.6.15 linux-2.6.15-rt1 > patch-2.6.15-rt1-1
@@ -578,6 +538,15 @@ patch -p0 linux-2.6.15 > patch-2.6.15-rt1-1
 api linux-source-2....
 cd /usr/src/linux/
 
+

ou:

+

bzip2 -dc /usr/src/patch-2.6.31.4-rt14.bz2 | patch -p1 --dry-run

+

If you didn’t get any errors (which you shouldn’t) then do: +bzip2 -dc /usr/src/patch-2.6.31.4-rt14.bz2 | patch -p1

+

Now the kernel source is patched with the real time preemption code by Ingo Molnar.

+

Next is the M-Audio USB Fast Track Pro patch: +patch -p1 /usr/src/linux/sound/usb/usbaudio.c < /usr/src/usbaudio-ftp-2.6.31.4.patch

+

MT : +export CONCURRENCY_LEVEL=4

Then run the following commands (please note that make dep is not needed any more for kernel 2.6):

 make-kpkg clean
@@ -587,6 +556,9 @@ fakeroot make-kpkg --revision=custom.1.0 --append-to-version=rt9.yomguy --initrd
 
 fakeroot make-kpkg --append-to-version=.rt8-yomguy --initrd kernel_image kernel_headers modules_image
 
+

ou:

+
+fakeroot make-kpkg --initrd --append-to-version=-yomguy kernel_image kernel_headers

If the compilation stops with an error, run:

 make clean
@@ -616,11 +588,13 @@ Install your new kernel:

 dpkg -i kernel-image-2.6.8.1_custom.1.0_i386.deb
 
+

OPTION:

Create a ramdisk of your new kernel (otherwise your system will most likely not boot):

 cd /boot/
 mkinitrd -o /boot/initrd.img-2.6.8.1 2.6.8.1
 
+

LILO:

We are almost finished now. Edit the image=/vmlinuz stanza of your /etc/lilo.conf and add the line initrd=/boot/initrd.img-2.6.8.1:

 ###
@@ -673,7 +647,7 @@ wget http://ftp-master.debian.org/ziyi_key_2006.asc
 
 # apt-get install debmirror
 
-

Pour crᅵer / mettre ᅵ jour le miroir (pour les 3 distribs, par exemple) : +

Pour creer / mettre a jour le miroir (pour les 3 distribs, par exemple) : $ debmirror /mnt/mirror --arch=i386 --dist=woody,sarge,sid -h ftp.fr.debian.org --nosource --verbose --progress Ensuite, dans /etc/apt/sources.list : deb file:/mnt/mirror sid main non-free contrib @@ -681,7 +655,8 @@ Et ᅵvidemment faire un apt-get update pour mettre ᅵ jour.

WIFI

-

kismet airsnort aircrack wmwave wpasupplicant kwirelessmonitor macchanger swscanner wavemon wireless-tools wifi-radar iwconfig iwlist

+

kismet airsnort aircrack wmwave wpasupplicant kwirelessmonitor macchanger swscanner wavemon wireless-tools +wifi-radar iwconfig iwlist

ZOPE

@@ -1046,7 +1021,11 @@ i.save()

_:

 svn propdel svn:executable mp3player.swf
-svn merge -r 119:head http://svn.parisson.org/svn/deefuzz/trunk/
+svn merge -r 119:head http://svn.parisson.org/svn/deefuzzer/trunk/
+svn merge -r174:175 trunk/ tags/telecaster-0.4.0+rc1/
+svn propedit svn:externals .
+
+    deefuzzer http://svn.parisson.org/svn/deefuzzer/trunk
 
@@ -1117,6 +1096,7 @@ dvgrab --format raw - | ffmpeg2theora -f dv -x 320 -y 240 --deinterlace -v 4 -a sudo dvgrab - | vlc --no-sub-autodetect-file - :demux=rawdv ":sout=#transcode{vcodec=mp4v,vb=256,scale=1,deinterlace}:duplicate{dst=display,dst=std{access=http,mux=ts,dst=:1234}}" dvgrab -buffers 1 - | ffmpeg -f dv -i - -f jack -i ffmpeg -vcodec libtheora -b 400k -s 768x480 -aspect 16:9 -acodec libvorbis -ab 64000 -f ogg - -map 0.0 -map 1.0 | oggfwd -d "pb_video_live" -g "Teaching" -n "pb_video_live" localhost 8000 source2parisson /pb_video_live.ogg & + sleep 3 jack_connect jack_rack:out_1 ffmpeg:input_1 jack_connect jack_rack:out_2 ffmpeg:input_2 @@ -1168,7 +1148,7 @@ sudo su - postgres -c "createuser -q --createdb --adduser parisson"
-

System Message: WARNING/2 (tips.txt, line 889)

+

System Message: WARNING/2 (tips.txt, line 940)

Option list ends without a blank line; unexpected unindent.

/ 20 GB /home 136.7 GB @@ -1176,33 +1156,63 @@ swap 3 GB

CLONING

-

# On the MASTER machine

-

# boot 300 Mo -mkdir /mnt/sdb1 -# root 20 Go -mkdir /mnt/sdb2 -# home 130 Go -mkdir /mnt/sdb3

-
-
_::
-

mount /dev/sdb1 /mnt/sdb1 -mount /dev/sdb2 /mnt/sdb2 -mount /dev/sdb3 /mnt/sdb3

-

rsync -a /boot/ /mnt/sdb1/ -rsync -a /home/ /mnt/sdb3/ -rsync -a --hard-links --one-file-system / /mnt/sdb2/

-
-
-

#On the CLONED machine : boot with Debian Install CD:

-
-mount /dev/sda2 /mnt
-mount /dev/sda1 /mnt/boot
-mount -o bind /dev /mnt/dev
-mount -t proc none /mnt/proc
-chroot /mnt
-grub install /dev/sdb
-exit
+

SSD on /dev/sda:

+
+root 10 Go XFS BOOTABLE
+home 35 Go XFS
+data 15 Go XFS
 
+

USB Disk on /dev/sdb:

+
+root 5 Go XFS
+home 10 Go XFS
+
+

# Master machine system /dev/sda to USB external Ghost /dev/sdb:

+
+su
+mkdir /mnt/root
+mount /dev/sdb1 /mnt/root
+mount /dev/sdb2 /mnt/root/home
+
+rsync -a --delete --hard-links --one-file-system / /mnt/root/
+rsync -a --delete /home/ /mnt/root/home/
+rm -rf /mnt/root/home/telecaster/archives/*
+rm -rf /mnt/root/home/telecaster/trash/*
+sync
+
+umount /mnt/root/home
+umount /mnt/root
+
+

# Live Install ISO on USB Disk /dev/sdb BOOT +# Ghost on USB Disk /dev/sdc +# Destination SSD /dev/sda

+
+

(AUTO) +mkdir /mnt/root +mount /dev/sda1 /mnt/root +mount /dev/sda2 /mnt/root/home +rsync -a /media/disk/ /mnt/root/ +rsync -a /media/disk-1/ /mnt/root/home/ +sync +umount /media/disk/ +umount /media/disk-1/ +mount -o bind /dev /mnt/root/dev +mount -t proc none /mnt/root/proc +chroot /mnt/root/ +ls /dev/disk/by-uuid

+

(MANU) +nano /etc/fstab +(edit to get right UUID, save)

+

(AUTO) +grub install /dev/sda +update-grub +exit +umount /mnt/root/proc +umount /mnt/root/dev +umount /mnt/root/home +umount /mnt/root +reboot

+
# or ?::
@@ -1212,7 +1222,7 @@ root (hd0,1) setup (hd0)
-

System Message: WARNING/2 (tips.txt, line 930)

+

System Message: WARNING/2 (tips.txt, line 1013)

Definition list ends without a blank line; unexpected unindent.

quit

@@ -1280,6 +1290,12 @@ $ python2.6 >>> droid.makeToast("Hello from my computer!") >>> droid.speak('Hello')
+
+
Proxy::
+
connect phone +$ sudo /etc/init.d/udev restart +$ adb forward tcp:8081 tcp:8081
+

CONEXTANT

@@ -1349,6 +1365,80 @@ rst2html -stg --stylesheet="lsr.css" --traceback tips.txt tips.html update media_items set filename = 'items/test.wav';
+
+

FUNIONFS

+

merge multiple dirs

+
+funionfs -o dirs=1001:mama -o allow_other NONE media
+
+
+
+

ICEDOVE

+
+

System Message: WARNING/2 (tips.txt, line 1171)

+

Title underline too short.

+
+ICEDOVE
+======
+
+
+

user_pref("network.protocol-handler.app.http", "/usr/bin/google-chrome"); +user_pref("network.protocol-handler.app.https", "/usr/bin/google-chrome");

+
+
+

POSTFIX

+
+

System Message: WARNING/2 (tips.txt, line 1177)

+

Title underline too short.

+
+POSTFIX
+======
+
+
+

postqueue -p +postcat -q 9DF7520804A

+
+
+

MAC ADDRESS (windows)

+

c:ping 192.168.0.2 +c:arp -a

+
+
+

Xorg

+

Xorg -configure +Xorg -config xorg.conf.new

+
+
+

GIT

+

$ cd /var/cache/git/

+

$ mkdir project.git

+

$ cd project.git

+

$ git init

+

$ echo "Short project's description" > .git/description

+

$ git config --global user.name "Your Name"

+

$ git config --global user.email "you@example.com"

+

$ git commit -a

+

$ git push upload master

+
+
+

SWAP (clean)

+
+

System Message: WARNING/2 (tips.txt, line 1214)

+

Title underline too short.

+
+SWAP (clean)
+===========
+
+
+

sudo swapoff -a && sudo swapon -a

+
+ + diff --git a/tips/tips.txt b/tips/tips.txt index 7f98a7b..3544aba 100644 --- a/tips/tips.txt +++ b/tips/tips.txt @@ -1,4 +1,7 @@ - +################################ +# YomGuy's Linux Ultra Fast Tips +################################ + ====================================== YomGuy's Linux Ultra Fast Tips (1/1) ====================================== @@ -11,6 +14,7 @@ This is a list of my short command line tips to get some various, sometimes advanced, functions on GNU/Linux systems, especially on Debian. + RENAME ====== rename more than 1 file :: @@ -301,6 +305,8 @@ _:: KERNEL CUSTOM ============= +apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 + patch:: diff -uprN linux-2.6.15 linux-2.6.15-rt1 > patch-2.6.15-rt1-1 @@ -309,6 +315,22 @@ patch:: api linux-source-2.... cd /usr/src/linux/ +ou: + +bzip2 -dc /usr/src/patch-2.6.31.4-rt14.bz2 | patch -p1 --dry-run + +If you didn’t get any errors (which you shouldn’t) then do: +bzip2 -dc /usr/src/patch-2.6.31.4-rt14.bz2 | patch -p1 + +Now the kernel source is patched with the real time preemption code by Ingo Molnar. + +Next is the M-Audio USB Fast Track Pro patch: +patch -p1 /usr/src/linux/sound/usb/usbaudio.c < /usr/src/usbaudio-ftp-2.6.31.4.patch + +MT : +export CONCURRENCY_LEVEL=4 + + Then run the following commands (please note that make dep is not needed any more for kernel 2.6):: make-kpkg clean @@ -318,6 +340,11 @@ ou:: fakeroot make-kpkg --append-to-version=.rt8-yomguy --initrd kernel_image kernel_headers modules_image +ou: + + fakeroot make-kpkg --initrd --append-to-version=-yomguy kernel_image kernel_headers + + If the compilation stops with an error, run:: make clean @@ -348,11 +375,15 @@ Install your new kernel:: dpkg -i kernel-image-2.6.8.1_custom.1.0_i386.deb +OPTION: + Create a ramdisk of your new kernel (otherwise your system will most likely not boot):: cd /boot/ mkinitrd -o /boot/initrd.img-2.6.8.1 2.6.8.1 +LILO: + We are almost finished now. Edit the image=/vmlinuz stanza of your /etc/lilo.conf and add the line initrd=/boot/initrd.img-2.6.8.1:: ### @@ -409,7 +440,7 @@ Avoir une partition avec de la place, par exemple /mnt/mirror (~20 Go):: # apt-get install debmirror -Pour crᅵer / mettre ᅵ jour le miroir (pour les 3 distribs, par exemple) : +Pour creer / mettre a jour le miroir (pour les 3 distribs, par exemple) : $ debmirror /mnt/mirror --arch=i386 --dist=woody,sarge,sid -h ftp.fr.debian.org --nosource --verbose --progress Ensuite, dans /etc/apt/sources.list : deb file:/mnt/mirror sid main non-free contrib @@ -419,7 +450,8 @@ Et ᅵvidemment faire un apt-get update pour mettre ᅵ jour. WIFI ==== -kismet airsnort aircrack wmwave wpasupplicant kwirelessmonitor macchanger swscanner wavemon wireless-tools wifi-radar iwconfig iwlist +kismet airsnort aircrack wmwave wpasupplicant kwirelessmonitor macchanger swscanner wavemon wireless-tools +wifi-radar iwconfig iwlist ZOPE @@ -805,8 +837,8 @@ SVN _:: svn propdel svn:executable mp3player.swf - svn merge -r 119:head http://svn.parisson.org/svn/deefuzz/trunk/ - + svn merge -r 119:head http://svn.parisson.org/svn/deefuzzer/trunk/ + svn merge -r174:175 trunk/ tags/telecaster-0.4.0+rc1/ svn propedit svn:externals . deefuzzer http://svn.parisson.org/svn/deefuzzer/trunk @@ -869,6 +901,7 @@ _:: sudo dvgrab - | vlc --no-sub-autodetect-file - :demux=rawdv ":sout=#transcode{vcodec=mp4v,vb=256,scale=1,deinterlace}:duplicate{dst=display,dst=std{access=http,mux=ts,dst=:1234}}" dvgrab -buffers 1 - | ffmpeg -f dv -i - -f jack -i ffmpeg -vcodec libtheora -b 400k -s 768x480 -aspect 16:9 -acodec libvorbis -ab 64000 -f ogg - -map 0.0 -map 1.0 | oggfwd -d "pb_video_live" -g "Teaching" -n "pb_video_live" localhost 8000 source2parisson /pb_video_live.ogg & + sleep 3 jack_connect jack_rack:out_1 ffmpeg:input_1 jack_connect jack_rack:out_2 ffmpeg:input_2 @@ -912,33 +945,65 @@ swap 3 GB CLONING ======= -# On the MASTER machine - -# boot 300 Mo -mkdir /mnt/sdb1 -# root 20 Go -mkdir /mnt/sdb2 -# home 130 Go -mkdir /mnt/sdb3 - -_:: - mount /dev/sdb1 /mnt/sdb1 - mount /dev/sdb2 /mnt/sdb2 - mount /dev/sdb3 /mnt/sdb3 - - rsync -a /boot/ /mnt/sdb1/ - rsync -a /home/ /mnt/sdb3/ - rsync -a --hard-links --one-file-system / /mnt/sdb2/ - -#On the CLONED machine : boot with Debian Install CD:: - - mount /dev/sda2 /mnt - mount /dev/sda1 /mnt/boot - mount -o bind /dev /mnt/dev - mount -t proc none /mnt/proc - chroot /mnt - grub install /dev/sdb +SSD on /dev/sda:: + + root 10 Go XFS BOOTABLE + home 35 Go XFS + data 15 Go XFS + +USB Disk on /dev/sdb:: + + root 5 Go XFS + home 10 Go XFS + +# Master machine system /dev/sda to USB external Ghost /dev/sdb:: + + su + mkdir /mnt/root + mount /dev/sdb1 /mnt/root + mount /dev/sdb2 /mnt/root/home + + rsync -a --delete --hard-links --one-file-system / /mnt/root/ + rsync -a --delete /home/ /mnt/root/home/ + rm -rf /mnt/root/home/telecaster/archives/* + rm -rf /mnt/root/home/telecaster/trash/* + sync + + umount /mnt/root/home + umount /mnt/root + +# Live Install ISO on USB Disk /dev/sdb BOOT +# Ghost on USB Disk /dev/sdc +# Destination SSD /dev/sda + + (AUTO) + mkdir /mnt/root + mount /dev/sda1 /mnt/root + mount /dev/sda2 /mnt/root/home + rsync -a /media/disk/ /mnt/root/ + rsync -a /media/disk-1/ /mnt/root/home/ + sync + umount /media/disk/ + umount /media/disk-1/ + mount -o bind /dev /mnt/root/dev + mount -t proc none /mnt/root/proc + chroot /mnt/root/ + ls /dev/disk/by-uuid + + (MANU) + nano /etc/fstab + (edit to get right UUID, save) + + (AUTO) + grub install /dev/sda + update-grub exit + umount /mnt/root/proc + umount /mnt/root/dev + umount /mnt/root/home + umount /mnt/root + reboot + # or ?:: grub-install /dev/sda @@ -1015,7 +1080,7 @@ Proxy:: $ sudo /etc/init.d/udev restart $ adb forward tcp:8081 tcp:8081 - + CONEXTANT ========= @@ -1108,7 +1173,46 @@ user_pref("network.protocol-handler.app.http", "/usr/bin/google-chrome"); user_pref("network.protocol-handler.app.https", "/usr/bin/google-chrome"); +POSTFIX +====== +postqueue -p +postcat -q 9DF7520804A + +MAC ADDRESS (windows) +===================== +c:\ping 192.168.0.2 +c:\arp -a + +Xorg +==== +Xorg -configure +Xorg -config xorg.conf.new + +GIT +=== + +$ cd /var/cache/git/ + +$ mkdir project.git + +$ cd project.git + +$ git init + +$ echo "Short project's description" > .git/description + +$ git config --global user.name "Your Name" +$ git config --global user.email "you@example.com" + +$ git commit -a + +$ git push upload master + + +SWAP (clean) +=========== +sudo swapoff -a && sudo swapon -a