V
10  
Tags
Attachments
Dobrica Pavlinušić's random unstructured stuff
Shell

Welcome to scratch pad of usefull shell snippets



remove all php4 packages with apt-get

dpkg -l | grep php4 | awk '{ print $2 }' | xargs apt-get remove -y

use socat as simple serial program

socat - /dev/ttyS0,b9600,echo=0,raw

list first ten files from srchives

ls *.tar.gz *.tgz | xargs -i sh -c "ls -hs '{}' ; echo ; tar tvfz '{}' | head -10 ; echo"

ls *.tar.bz2 *.tbz | xargs -i sh -c "ls -hs '{}' ; echo ; tar tvfj '{}' | head -10 ; echo"

Yes, it sucks that tar doesn't know how to handle compression formats automatically...

tail recent logs and put output in file

Useful to take a quick view into last lines, reload page (and capture newly created errors/infos) and store that in single file for easy review (in vim :-)

tail -f /var/log/apache2/*.log | tee ~/log

port forwarder using socat

socat -d -d TCP4-LISTEN:1280,fork TCP4:192.168.212.5:80

remove all filesystem cache

echo 3 > /proc/sys/vm/drop_caches

 

Upload Files

Click "Browse" to find the file you want to upload. When you click "Upload file" your file will be uploaded and added to the list of attachments for this page.

Maximum file size: 50MB

 
 
 
File Name Author Date Uploaded Size

Save Page As

Enter a meaningful and distinctive title for your page.

Page Title:

Tip: You'll be able to find this page later by using the title you choose.

Page Already Exists

There is already a page named XXX. Would you like to:

Save with a different name:

Save the page with the name "XXX"

Append your text to the bottom of the existing page named: "XXX"

Upload Files

Click "Browse" to find the file you want to upload. When you click "Add file" this file will be added to the list of attachments for this page, and uploaded when you save the page.

 
 
 
Add Tags

Enter a tag and click "Add tag". The tag will be saved when you save the page.

Tag: 

Suggestions: