Tëmike lëmatahpi

User Tools

Site Tools



My tech/computer how-tos.

I did have a number of older 'howto' documents, but most of them no longer apply. So I have not brought them over to this new site. Maybe I need to write some more :-)

One Liners

I always seem to “loose” those great little one-liners and such that I find very helpful. Then when I need them again, I find I spend just as much time (if not more time) Googling for the lost info, then actually applying the information. So below will just be a “junk drawer” of sorts. Simpy “howtos” that don't require their own page.

Mail Queue Stuff

Remove all mail from queue sent by a particular user:

mailq | grep "FOO@BAR.COM" | awk '{ print $1 }' | postsuper -d - 

Move all mail from a particular user to the “hold” queue:

mailq | grep "FOO@BAR.COM" | awk '{ print $1 }' | postsuper -h -

Move all mail from a particular user back to the incoming queue:

mailq | grep "FOO@BAR.COM" | awk '{ print $1 }' | sed 's/\!//' | postsuper -r -

Read an email in the mailq:

postcat -q 4E56B28283DE 

Check domain for dead links. Requires program “linkchecker” installed:

linkchecker --ignore-url=REGEX --no-warnings -ohtml http://WWW.FOO.BAR > output.html

Some FIND ideas

Zip up a bunch of PPT files in a directory, each to its own zip file:

find . -name "*.ppt" -exec zip {} \; -print

Create a list of 100 random songs (really any files) and output to a .m3u file.

find /opt/Multimedia/music/ogg/ -type f | bogosort -n | head -n100 > random-songs.m3u

Replace Text ideas

Revision to replace <H3>Contents</H3> (ignore the <nop>s) with *Contents* – note I had to escape the “/” and “*” characters:

for f in *.txt; do sed 's/<H3>Contents<\/H3>/\*Contents\*/' $f > x; mv x $f; done


Getting a list of installed packages in Debian (and their version number):

dpkg -l | egrep '^[hi]i'

chmod just “all files” recursively:

find ./ -type f -exec chmod 664 '{}' \;

chmod just “all directories” recursively:

find ./ -type d -exec chmod 775 '{}' \;

Check apache connections:

netstat -nt | grep :80 | wc -l

Check All connections:

netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

Check Memory in slots without looking inside:

dmidecode --type 17
howtos/start.txt · Last modified: 2016/04/13 12:52 by Kevin Squire