Skip to content

Instantly share code, notes, and snippets.

View LeSpocky's full-sized avatar

Alexander Dahl LeSpocky

View GitHub Profile
@LeSpocky
LeSpocky / bash_colours
Created January 25, 2016 12:40 — forked from ian128K/bash_colours
Shell script colours
## Colours and font styles
## Syntax: echo -e "${FOREGROUND_COLOUR}${BACKGROUND_COLOUR}${STYLE}Hello world!${RESET_ALL}"
# Escape sequence and resets
ESC_SEQ="\x1b["
RESET_ALL="${ESC_SEQ}0m"
RESET_BOLD="${ESC_SEQ}21m"
RESET_UL="${ESC_SEQ}24m"
# Foreground colours
@LeSpocky
LeSpocky / .gitconfig
Created July 29, 2015 07:00
git config für ptxdist
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "upstream"]
url = http://git.pengutronix.de/git/ptxdist.git
fetch = +refs/heads/*:refs/remotes/upstream/*
[branch "master"]
remote = origin
#!/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 <[email protected]>
* @date Created: 2014-02-21
*
* Copyright 2014 Alexander Dahl
**********************************************************************/
@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() {