Misc howto use notes for describing commands that I often use Download photos from my canon powershot S50For that purpose I use gphoto2. The Canon S50 talks PTP in a generic fashion but is now natively supported by gphoto2. In order to retreive all the files I use the following command:gphoto2 --camera "Canon PowerShot S50 (normal mode)" --get-all-files For using the default PTP mode you can try instead: gphoto2 --camera "USB PTP Class Camera"
In order to retreive a special range of photos:
Spam immunity: spamassassin
PATH=/usr/local/bin:/bin:/usr/bin SHELL=/bin/sh LOGFILE=/dev/null SPAMDIR=$HOME/mail/spam # perform before all the filtering for mailing lists here # only process if message under 250*1024 bytes :0fw
* < 256000
| spamassassin # reroute tagged as spam emails to your spam mbox # if score is higher than 15 it is almost sure that it is a spam :0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
$SPAMDIR/spamassassin-sure # others are probable spams :0:
* ^X-Spam-Flag: (Yes|YES)
$SPAMDIR/spamassassin-pehaps
# mark as spam and delete macro index S "|sa-learn --spam --no-rebuild --single\n; <delete-message>\n\n" macro index S "|sa-learn --spam --no-rebuild --single\n; <delete-message>\n\n" # mark as ham and save to some folder macro pager H "|sa-learn --ham --no-rebuild --single\n; <save-message>\n" macro pager H "|sa-learn --ham --no-rebuild --single\n; <save-message>\n" # rebuild the spamassassin bayes filter db macro index R "!/usr/bin/sa-learn --rebuild"
required_hits 3.0 rewrite_subject 0 whitelist_from "*.courville.org", "*.crm.mot.com", "*.motorola.com", "*.enst.fr" # Bloody spammers faking my whitelist!! blacklist_fromno from@email.mot.com *@motgate*.mot.com *@ftpbox.mot.com skip_rbl_checks 1 check_mx_attempts 0 ok_languages fr en use_bayes 1
auto_learn 1 # If Bayesian filter says its spam, I trust it. Up the scores. score BAYES_60 0 0 2.000 2.100 score BAYES_70 0 0 4.000 4.100 score BAYES_80 0 0 5.300 5.400 score BAYES_90 0 0 7.000 7.100 score BAYES_99 0 0 10.200 10.300 # HABEAS warrants are now useless as spammers are forging them score HABEAS_SWE 0
install full directory content on your palmI use either jpilot (gui) or directly pilot-link commands:pilot-xfer -p /dev/usb/tts/1 -i *.prc *.pdb rebuild index for damaged avi file
convert your vhs family tapes into divx movies
#!/bin/sh filein=$1 fileout=$2 sizex=$3 sizey=$4 bitrate=$5 rm -f frameno.avi mencoder $filein -ovc frameno -oac mp3lame -lameopts vbr=3 -o frameno.avi echo potentially refine bitrate variable based on above inputs mencoder $filein -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:vbitrate=$bitrate:vqscale=3:vhq:v4mv:trell -o $fileout -vf scale=$sizex:$sizey -sws 2 echo potentially refine bitrate variable based on above inputs mencoder $filein -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:vbitrate=$bitrate:vqscale=3:vhq:v4mv:trell -o $fileout -vf scale=$sizex:$sizey -sws 2
Printing with gimp/cups/turboprint
smbclient and french charsetWhat I use for displaying correctly the filenames (avoiding the alternate command) when using a smbclient:smbclient //windaube/docs -t iso8859-15 CVS update commandalias cup='cvs -qz3 up -PAd' cdrecord -v -dao -eject dev=0,0,0 speed=52 driveropts=burnfree fs=4049k timeout=20 -overburn -isosize sarge-i386-netinst.iso Euro symbol with latexapt-get install tetex-eurosym \usepackage{eurosym}
\euro{10.00} Create your xface
echo -n "X-Face:" > my_image.face convert -despeckle -geometry 48x48 my_image.jpg xbm:- | compface >> my_image.face
./quote-x-face my_image.face > muttrc.face cat quote-x-face #!/usr/bin/perl -w # perl script to quote my_hdr commands for Mutt. # mainly useful for X-Face. headers. # (c) 2004 Christoph Berg, GNU GPL. # 2004-06-13 cb: initial version @f = <>;
foreach (@f) {
chomp;
s/( \\;'"`\$# )/\\$1/g;
}
print "my_hdr ";
print join '\n', @f;
print "\n"; List open portsecho "Open Ports:"; netstat -anp | grep LISTEN | grep tcp | awk '{print $4, "\t", $7}' | less Multimedia file informationJust use mediainfoList HEVC mkv files that do not have a mp4 counterpart: find . -print0 -name \*mkv -exec mediainfo --Output=file://./template.txt {} \; | grep HEVC | sed -E 's;(.*)\.mkv HEVC;\1.mp4;g' | xargs -0 ls 2>&1 >/dev/null | sed -E 's;^.*(\./.*mp4).*$;\1;g' find . -name \*mkv -exec mediainfo --Output=file://./template.txt {} \; | grep HEVC | sed -E 's;(.*)\.mkv HEVC;\1.mp4;g' | while read f; do ls ${f} 2>&1 >/dev/null | sed -E 's;^.*(\./.*mp4).*$;\1;g'; done cat template.txt General;%CompleteName% * %FileSize/String3% * %Duration/String% Video; |Video: %Width%x%Height% * %DisplayAspectRatio/String% * %Format% %Format_Profile% Audio; |Audio: %Language/String% * %Channel(s)% CH * %Codec/String% Text; |Sub: %Language/String% * %Codec% File_End;\n Count number of unique number of approvalscat ggapproved.mbox | grep "Final Approval" | sed 's/.* \([^ ]*\)$/\1/g' | sort -f -d -u | sort -u | wc -l Graph it: egrep -h "^(Date|.*-keys)" * | sed "s/^Date: //g" | paste -sd'|\n' | while read i;do date -d"$(cut -d '|' -f 1 <<<$i )" +%Y%m%d; cut -d'/' -f 3 <<<$(cut -d '|' -f 2 <<<$i ) | sed 's/:.*$//g' ; done | paste -sd',\n' | awk -F, '!a[$1]++' Clean inactive mosh sessionsps h --sort start_time -o pid,command -C mosh-server | head --lines=-1 | awk '{print $1}' | xargs --no-run-if-empty -n 1 --verbose kill Copy all jpeg files, delete empty dirs and delete duplicatesrsync -r --exclude="thumb/" --exclude="archive/" --exclude="deleted/" --exclude="temp/" --include="*/" --include="*.[Jj][Pp][Gg]" --exclude="*" ./ $HOME/tmp/ cd $HOME/tmp find . -type d -empty -delete OUTF=rem-duplicates.sh; echo "#! /bin/sh" > $OUTF; find "$@" -type f -print0 | xargs -0 -n1 md5sum | sort --key=1,32 | uniq -w 32 -d --all-repeated=separate | sed -r 's/^[0-9a-f]*( )*//;s/([^a-zA-Z0-9./_-])/\\\1/g;s/(.+)/#rm \1/' >> $OUTF; chmod a+x $OUTF; ls -l $OUTF EOF |
Main Page >