View feedrarbg.php
<?php
error_reporting (E_ALL);
ini_set ("display_errors", true);
$BASE = strtok (basename ($_SERVER["SCRIPT_NAME"], ".php"), "-");
libxml_use_internal_errors (false);
function clear_dates ($str) {
return preg_replace ("/(\<updated\>)[0-9]{4}\-[0-9]{2}\-[0-9]{2}T[0-9]{2}\:[0-9]{2}\:[0-9]{2}\+[0-9]{2}\:[0-9]{2}(\<\/updated\>)/m", "\\1\\2", $str);
View feedimdb.php
<?php
error_reporting (E_ALL);
ini_set ("display_errors", true);
$BASE = strtok (basename ($_SERVER["SCRIPT_NAME"], ".php"), "-");
function clear_dates ($str) {
return preg_replace ("/(\<updated\>)[0-9]{4}\-[0-9]{2}\-[0-9]{2}T[0-9]{2}\:[0-9]{2}\:[0-9]{2}\+[0-9]{2}\:[0-9]{2}(\<\/updated\>)/m", "\\1\\2", $str);
}
View crontab.php
<?php
#run on a remote machine's crontab:
#13 * * * * curl --silent http://example.com/crontab.php
#and run on the server's crontab:
#*/5 * * * * cd ~/public_html && php crontab.php
if (PHP_SAPI == "cli") {
file_put_contents ("crontab" . (!empty ($_SERVER["argv"][1]) && preg_match ("/^[a-z_][a-z0-9_]{0,30}$/i", $_SERVER["argv"][1]) ? "-{$_SERVER["argv"][1]}" : "") . ".date", time (), LOCK_EX);
} else {
header ("content-type: text/plain", true);
View logchk.php
<?php
ini_set ("display_errors", true);
if (!empty ($_SERVER["argv"][1])) $name = $_SERVER["argv"][1];
if (empty ($name)) $name = substr ($_SERVER["PWD"], strrpos($_SERVER["PWD"], "/")+1);
define ("datepath", "/var/log/user/logchk-$name.date");
$last = 0;
if (file_exists (datepath)) {
View ddns-curl.sh
#!/bin/bash
#run from crontab:
#*/5 * * * * ~/bin/ddns-curl.sh
host="example.myvnc.com"
if [ $EUID -ne 0 ] ; then echo 'you are not root' >&2 ; exit 1 ; fi
oldip=$(cat /var/cache/user/ip.txt 2>/dev/null)
View imdb-export.php
<?php
define ("id", 'secretkey');
$USER="123456789";
$curl = curl_init ("http://www.imdb.com/list/export?list_id=ratings&author_id=ur$USER");
curl_setopt_array ($curl, array (
CURLOPT_ENCODING => "",
CURLOPT_COOKIE => "id=".constant("id"),
CURLOPT_RETURNTRANSFER => true,
View sorozatbarat-export.php
<?php
$DOMAIN="www.sorozat-barat.club";
$USER="user";
$PASSWORD="secret";
$curl = curl_init ("https://$DOMAIN/login");
curl_setopt_array ($curl, array (
CURLOPT_ENCODING => "",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => true,
View qr.sh
#!/bin/bash
echo 'INFO usage syntax: qr.sh "*foobar*"' >&2
path=.
if [ -n "$1" ] ; then path="$1" ; fi
find $path -name '*.url' | while read -r file ; do
urls.sh "$file" 2>/dev/null | grep 'imdb.com/title/tt' | qrencode --size=3 --level=L --margin=8 --output=- | convert - +level 0%,50% "$(dirname "$file")/$(basename "$file" .url).png"
done
View sync-devices.sh
#!/bin/bash
#run from crontab
#* * * * * runlock -t1 -f /var/run/rsync/cronutils-rsync_sync-devices.pid ~/bin/sync-devices.sh
for dev in $(cat /proc/mounts | grep -Po '^([^ ]+)(?= /media/)') ; do
labelorig=$(/sbin/blkid -s LABEL -o value "$dev" 2>/dev/null)
label=$(echo -n "$labelorig" | tr [:upper:] [:lower:])
last=$(cat "/var/run/rsync/sync-devices-$label.date" 2>/dev/null)
now=$(date +%s)
View fancontrol-emergency.sh
#!/bin/bash
emergency=0
if data=$(hddtemp --numeric --unit=C /dev/sdb) \
&& [ "$data" -eq "$data" -a "$data" -gt 1 -a "$data" -le 70 ] 2>/dev/null
then if [ "$data" -gt 40 ] ; then
echo -e "$(date '+%Y-%m-%d %H:%M:%S')\tNOTICE\temergency temp hdd:$data" | tee -a "/var/log/moli/fancontrol.log" 1>&2
emergency=1
fi