Scripting unter Linux
Perl
-
echo "Vorname;Name;adresse@mail.de" | sed -e 's/^\([^;]\+\);\([^;]\+\);\([^;]\+\)/"\1" und "\2" und "\3" /g';
Bash
-
cat export.csv | sed -e 's/\([0-9]\+\);\([0-9]\+\)/UPDATE vandalen SET leibvater=\1 where id=\2;/g'| grep UPDATE > tmp.sql
-
for f in *.tex; do pdflatex f; done
-
for i in *.jpg; do j=`echo $i | sed 's/jpg/JPG/g'`; mv "$i" "$j"; done
$INTERNAL_OUTPUT = "LVDS"
$EXTERNAL_OUTPUT = "DisplayPort-0"
$EXTERNAL_LOCATION = "right"
xrandr |grep $EXTERNAL_OUTPUT | grep " connected "
if [ $? -eq 0 ]; then
xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --auto $EXTERNAL_LOCATION
# Alternative command in case of trouble:
# (sleep 2; xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --auto $EXTERNAL_LOCATION) &
else
xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --off
fi
PHP
Skript, um Seitenzugriff von best. IPs zu sperren:
<?
$banned[0]="xxx.xxx.xxx.xxx"; // IP in the form of "127.0.0.1" or whatever
$banned[1]="yyy.yyy.yyy.yyy";
$banned[2]="zzz.zzz.zzz.zzz";
// add as many as you wish
if (in_array($_SERVER['REMOTE_ADDR'],$banned)) header("HTTP/1.1 403 Forbidden");
?>
Alternativ auch als
.htaccess:
# Deny 69.60.114.0 - 69.60.115.255 (512 addresses)
Deny from 69.60.114
# Deny 69.60.116.0 - 69.60.119.255 (1024 addresses)
Deny from 69.60.116.0/22
# Deny 69.60.120.0 - 69.60.121.255 (512 addresses)
Deny from 69.60.120.0/255.255.254.0
-or-
Setenvif Remote-Addr "^69\.60\.1(1[4-9]¦2[0-5])\." getout
Deny from getout
Nettes Download-Skript für das
Google Art Project 
:
gap_download.php
Aufruf z.B. mit
-
nohup ./gap_download.php http://www.googleartproject.com/museums/tate/no-woman-no-cry &