Skip to content

Instantly share code, notes, and snippets.

View LeSpocky's full-sized avatar

Alexander Dahl LeSpocky

View GitHub Profile
@LeSpocky
LeSpocky / check-domain-connect.sh
Last active December 17, 2015 08:49
Little shell script to check if a domain is still connected. Run with cron job!
#!/bin/sh
if whois $1 | grep -i status | grep -q connect
then
echo "$1 still connected" >/dev/null
else
echo "*** The domain $1 is not connected! ***"
fi
changed=$(whois $1 | grep -i changed)
old_changed=$(cat ~/var/domain_changed_${1})
@LeSpocky
LeSpocky / flut.sh
Last active December 18, 2015 03:59
in cronjob tun und die webcam-bilder ablegen mit zeitstempel
#!/bin/sh
sleep 84
cd /home/alex/public_html/flut
wget -q http://www.eulenspiegel-multimedia.de/images/flut/flut_aktuell.jpg -O flut_aktuell_$(date +'%Y-%m-%d_%H:%M').jpg
@LeSpocky
LeSpocky / collectip.sh
Created July 3, 2013 11:40
Get outside IPv4 address and echo a line for adding to some poor mans database for later analyzation.
#!/bin/sh
UTCNOW=$(date -u +%s)
CURRENTIP=$(wget -q -O - checkip.dyndns.com | sed -e 's/^.*<body>\(.*\)<\/body>.*$/\1/' | cut -f2 -d: | tr -d [:space:])
echo "${UTCNOW},${CURRENTIP}"
exit 0
@LeSpocky
LeSpocky / rounded_corner.scad
Last active September 24, 2024 18:39
rounded square in openscad
module rounded_square( width, radius_corner ) {
translate( [ radius_corner, radius_corner, 0 ] )
minkowski() {
square( width - 2 * radius_corner );
circle( radius_corner );
}
}
module alternative_square( width, r_c ) {
hull() {
@LeSpocky
LeSpocky / tlue_tar.cpp
Created February 21, 2014 17:59
an example for a complete zlib wrapper for libtar using C++ vectors for associating zlib file handles to libtar file descriptors
/*******************************************************************//**
* @file tlue_tar.cpp
*
* Test libtar.
*
* @author Alexander Dahl <[email protected]>
* @date Created: 2014-02-21
*
* Copyright 2014 Alexander Dahl
**********************************************************************/
#!/bin/sh
for KEYID in `gpg --list-keys --fixed-list-mode --with-colons | grep "^pub" | cut -f5 -d":"`
do
gpg --batch --refresh-keys $KEYID
sleep 3
gpg --batch --edit-key $KEYID clean save
echo "---------- ---------- ----------"
sleep 3
done
@LeSpocky
LeSpocky / backup-nettworks-svn.sh
Last active August 29, 2015 13:58
Shell-Skript, das von cron ausgeführt wird auf einem Debian GNU/kFreeBSD um meine Subversion-Repository-Mirrors auf den aktuellen Stand zu bringen.
#!/bin/sh
# get new svn revisions
echo '> syncing fli4l repository'
/usr/bin/svnsync sync file:///tank/backup/nettworks/svn/fli4l
echo ''
# get new svn revisions
echo '> syncing eisfair repository'
/usr/bin/svnsync sync file:///tank/backup/nettworks/svn/eisfair
@LeSpocky
LeSpocky / backup.sh
Last active August 29, 2015 13:59
Backup file system from remote server. Copy changed stuff with rsync. Create ZFS snapshots with zfSnap. Rotation is done by another cron job deleting expired snaphosts. Moved to https://github.com/LeSpocky/rzfsnapup
#!/bin/sh
set -e
set +x
# set paths here
DATE='/bin/date'
RSYNC='/usr/bin/rsync'
SSH='/usr/bin/ssh'
ZFSNAP='/usr/sbin/zfSnap'
#!/usr/bin/perl -w
use strict;
use warnings;
use Data::Dumper;
use JSON;
use LWP::Simple;
# init variables

Keybase proof

I hereby claim:

  • I am LeSpocky on github.
  • I am lespocky (https://keybase.io/lespocky) on keybase.
  • I have a public key whose fingerprint is 02C8 A590 7FE5 CA5F 3601 D1D5 8FBA 7744 CC87 10D0

To claim this, I am signing this object: