Skip to content

Instantly share code, notes, and snippets.

View LeSpocky's full-sized avatar

Alexander Dahl LeSpocky

View GitHub Profile
#!/usr/bin/perl -w
# on debian install packages:
# libjson-perl, libwww-perl, perl-modules, perl-base
use strict;
use warnings;
use Carp;
#use Data::Dumper;

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:

#!/usr/bin/perl -w
use strict;
use warnings;
use Data::Dumper;
use JSON;
use LWP::Simple;
# init variables
@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'
@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
#!/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 / 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 <post@lespocky.de>
* @date Created: 2014-02-21
*
* Copyright 2014 Alexander Dahl
**********************************************************************/
@LeSpocky
LeSpocky / rounded_corner.scad
Last active March 4, 2024 21:50
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 / 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 / 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