RIGO.INFO TechBlog

Eventually I get into producing something I think is useful for others. You'll find random technical knowledge in this Blog so please be patient and use the search function. Some of these software are rather lame and old, the list is ordered by the approximate age (newest first). Unfortunately my older stuff are lost or scattered around my old CDs, not readable anymore 8(.

SpyShell

This is a shell wrapper for the script program from bsdutils that can be used in /etc/passwd as a login shell to log everything an user does.

#!/bin/bash
#
# spy shell by mcree@tricon.hu
#
# This is a shell wrapper for the script program from bsdutils
# that can be used in /etc/passwd as a login shell to log
# everything an user does.
#
# Protected by the General Public License v2
#
 
export SHELL="/bin/bash"
script="/usr/bin/script"
 
mydir="/var/log/spyshell"
whoami=`/usr/bin/whoami`
date=`/bin/date +%s.%N`
mytty=`/bin/ps hTotty | head -n1 | tr '/' '_'`
 
myprefix="$mydir/$whoami/$date.$mytty.$$"
mkdir -p "$mydir/$whoami"
 
mycompress() {
    gzip -9 "$myprefix".* 2>/dev/null
    exit 0
}
trap mycompress 0
 
if [ "$TERM" = "dumb" ]; then    #noninteractive
    #set > $myprefix.dumb.env
    #echo "$*" > $myprefix.dumb.params
    #gzip "$myprefix".*
    ##strace -f -o $myprefix.strace /bin/bash "$@"
    exec $SHELL "$@"
else			         #interactive
    if [ -z "$SPYSHELL" ]; then
	export SPYSHELL=yes
	set > $myprefix.env
        echo "$*" > $myprefix.params
	$script -f -q -t $myprefix.log 2>$myprefix.timing
    else
	#set > $myprefix.dumber.env
	#echo "$*" > $myprefix.dumber.params
	#gzip "$myprefix".*
	exec $SHELL "$@"
    fi
fi
2010-05-02 20:06 · 0 Linkbacks

SevenSeas

sevenseas-0.1.tar.gz - My first KDevelop project. This is a remake of the old turn based table game, often called „robots” or „tron” with a pirate theme (an idea stolen from astraware). In the you must use the obstacles of the level to kill pirate ships that try follow your every move. The game supports (but not requies) a trivial networked high score server which is not included.

2010-05-02 20:06 · 0 Linkbacks

reversi

reversi.pas.zip - An old reversi table game clone written in Turbo Pascal. Comments and game controls are in hungarian.

2010-05-02 20:06 · 0 Linkbacks

Rename digital camera files based on EXIF header

I use this scriptlet to have my digicam files in order.

#!/bin/bash
jhead -nf"%Y%m%d_%H%M%S" *
jhead -cmd "jpegtran -progressive &i > &o" *.jpg
exiftran -ai *.jpg
#jhead -cmd "mogrify -quality 90 &i" *.jpg
chmod ugo-x *.jpg
jhead -ft *.jpg
2010-05-02 20:06 · 0 Linkbacks

Removing accents from filenames in a directory tree

The following shell script can be used to remove accents from filenames in a directory and all subdirectories.

#!/bin/bash
 
function dodir() {
    pushd "$1" >> /dev/null
    for x in *; do
        trans=`echo "$x" | tr "éáóüűúöóíÉÁÓÜŰÚÖÓÍ" "eaouuuooiEAOUUUOOI" | tr -c "[:alnum:]!@#$%^&_,' ()[].\n-" "#"`
        if [ "$trans" != "$x" ]; then
            echo "must rename $x to $trans"
            mv "$x" "$trans"
            if [ -d "$trans" ]; then
                dodir "$trans"
            fi
        else
            if [ -d "$x" ]; then
                dodir "$x"
            fi
        fi
    done
    popd >> /dev/null
};
 
dodir "$1"
2010-05-02 20:06 · 0 Linkbacks

Linkbacks

Use the following URL for manually sending trackbacks: https://rigo.info/lib/plugins/linkback/exe/trackback.php/en:blog
en/blog.txt · Utolsó módosítás: 2009-05-15 00:00 (külső szerkesztés)
CC Attribution-Noncommercial-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0