Howto resize multiple pictures, graphics, images
for k in $(ls *.jpg); do convert -resize 800 -quality 80 $k r800-$k; done
11285 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
for k in $(ls *.jpg); do convert -resize 800 -quality 80 $k r800-$k; done
# From: http://www.ntecs.de/blog/articles/2008/02/09/the-worlds-smallest-webserver # Author: Michael Neumann # ... point your browser to http://localhost:3125/etc/motd ruby -rsocket -e 's=TCPServer.new(5**5);loop{_=s.accept;_<<"HTTP/1.0 200 OK\r\n\r\n#{File.read(_.gets.split[1])rescue nil}";_.close}'
history 1000 | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
echo -n '<Image width="16" height="16">data:image/xicon,' ; perl -ne 's/(.)/"%".unpack("H2",$1)/egs; print' ~/Desktop/favicon.ico ; echo '</Image>'
export PS1="\n\u@\H>"
for img in $(ls *.png); do convert $img -resize 75% smaller-$img; done;
#!/bin/bash #******************************************************************************# # BlockManyUsers.sh - Block many users in a system using a text file # # as argument # # Copyright (C) 2008 - written by flynets - <flynets<at>autistici<dot>org> # # BlockManyUsers is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation, either version 3 of the License, or # # any later version. # # # # BlockManyUsers is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program. If not, see <http://www.gnu.org/licenses/>. # #******************************************************************************# # Checks if you have the right privileges if [ "$USER" = "root" ];then # Checks if there is an argument [ $# -eq 0 ] && { echo >&2 ERROR: You may enter as an argument a text file containing users, one per line. ; exit 1; } # checks if there a regular file [ -f "$1" ] || { echo >&2 ERROR: The input file does not exists. ; exit 1; } TMPIN=$(mktemp) # Remove blank lines and delete duplicates sed '/^$/d' "$1"| sort -g | uniq > "$TMPIN" NOW=$(date +"%Y-%m-%d-%X") LOGFILE="BMU-log-$NOW.log" for user in $(more "$TMPIN"); do # Checks if the user already exists. cut -d: -f1 /etc/passwd | grep "$user" > /dev/null OUT=$? if [ $OUT -eq 0 ];then # block selected user /usr/sbin/usermod -L "$user" # save user info in a file echo The user \"$user\" has been blocked. >> "$LOGFILE" else echo >&2 Error the user account \"$user\" doesnt exists! >> "$LOGFILE" fi done rm -f $TMPIN exit 0 else echo >&2 ERROR: You must be a root user to execute this script. exit 1 fi exit 0
for i in *.flv; do mencoder -ovc lavc -oac mp3lame -o "$i.avi" "$i"; done
echo $text\ | tr . 0 | sed -e {s/0----\ /1/g} -e {s/00---\ /2/g} -e {s/000--\ /3/g} -e {s/000-\ /4/g} -e {s/00000\ /5/g} -e {s/-0000\ /6/g} -e {s/--000\ /7/g} -e {s/---00\ /8/g} -e {s/----0\ /9/g} -e {s/-----\ /0/g} \ | sed -e {s/-0-0\ /c/g} -e {s/-000\ /b/g} -e {s/00-0\ /f/g} -e {s/0000\ /h/g} -e {s/0---\ /j/g} -e {s/0-00\ /l/g} -e {s/0--0\ /p/g} -e {s/--0-\ /q/g} -e {s/000-\ /v/g} -e {s/-00-\ /x/g} -e {s/-0--\ /y/g} -e {s/--00\ /z/g} \ | sed -e {s/0--\ /w/g} -e {s/-00\ /d/g} -e {s/--0\ /g/g} -e {s/-0-\ /k/g} -e {s/---\ /o/g} -e {s/0-0\ /r/g} -e {s/000\ /s/g} -e {s/00-\ /u/g} \ | sed -e {s/0-\ /a/g} -e {s/00\ /i/g} -e {s/--\ /m/g} -e {s/-0\ /n/g} \ | sed -e {s/0\ /e/g} -e {s/-\ /t/g}