Skip to content

Instantly share code, notes, and snippets.

View h4cc's full-sized avatar

Julius Beckmann h4cc

  • ZENNER IoT Solutions
  • Hamburg, Germany
View GitHub Profile
@h4cc
h4cc / howto.md
Created March 15, 2016 12:21
Revert a Synology Diskstation from 6.0 beta back to 5.2

Activate SSH

Connect via SSH with either ssh root@IP or ssh admin@IP and sudo su

Change VERSION file as needed. vi /etc.defaults/VERSION Change:

@h4cc
h4cc / imgur_fetch_gallery.php
Created February 18, 2016 20:34
Downloading all images from a imgur gallery with a simple PHP Script.
@h4cc
h4cc / cyanogen-mod-11-htc-one-x-plus-readme.md
Created January 31, 2016 18:14
CyanogenMod 11 for HTC One X+
@h4cc
h4cc / die-mausestrategie.md
Created January 10, 2016 09:23
Inhaltliche Auszüge aus "Die Mäuse-Strategie für Manager" von Johnson - 978-3720521222

Zusammenfassung

In dem Buch wird eingebettet in der Rahmenhandlung eines Klassentreffens eine Geschichte von zwei Mäusen und zwei Zwergen in einem Labirynth erzählt. Die vier Wesen müssen Käse suchen und finden um zu überleben.

Als das aktuelle Käselager K alle wird, suchen die Mäuse direkt nach einem neuen Lager und finden auch sehr bald Käselager N welches größer und besser ausgestattet ist als K. Der Zwerg "Knobel" braucht einige Zeit um es den Mäusen nach zu machen und schreibt in diesem Prozess so einige Erkentnisse an Wände. Der zweite Zwerg "Grübel" macht hier keinen Prozess von sich aus, sondern ist in seiner Angst/Schuldzuweisungen gefangen.

@h4cc
h4cc / changeset.php
Created January 7, 2016 21:39
Using array_diff to calculate changesets by ids.
<?php
// Using array_diff to calculate changesets by ids.
// @author Julius Beckmann http://twitter.com/h4cc
$existingIds = [1, 2];
$newIds = [2, 3];
$addedIds = array_diff($newIds, $existingIds);
$removedIds = array_diff($existingIds, $newIds);
<?php
use Psr\Log\NullLogger;
use Psr\Log\LoggerInterface;
/**
* Helping trait for using Loggers.
*
* This on is more powerfull and offers only setLogger() and getLogger() as API methods.
* If no logger is set, a fallback to a NullLogger is used. Should be failsafe enough.
@h4cc
h4cc / CallablePsr3Logger.php
Last active December 30, 2015 14:19
Psr3 compliant logger that will forward all logs to a given closure.
<?php
use Psr\Log\AbstractLogger;
/**
* Psr3 compliant logger that will forward all logs to a given closure.
*
* @author Julius Beckmann twitter.com/h4cc
*/
class CallablePsr3Logger extends AbstractLogger
@h4cc
h4cc / apt-shortcuts.sh
Created December 21, 2015 08:55
apt-get Shortcuts for bash/dash/zsh
#--- apt-get
# Shortcuts for apt-get
alias apt-ud="sudo apt-fast update"
alias apt-ug="sudo apt-fast upgrade"
alias apt-in="sudo apt-fast install"
# Some auto apt-get magic.
alias apt-auto="sudo apt-get autoclean ; sudo apt-get autoremove"
@h4cc
h4cc / buzzwords.md
Last active September 17, 2015 12:10
My interpretation for some common Buzzwords.

Platform

Compared to Streets

  • Farm road
  • Federal highway
  • Freeway
  • Highway
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
# Maximum and minimum number of peers to connect to per torrent.
min_peers = 1
max_peers = 100
# Same as above but for seeding completed torrents (-1 = same as downloading)
min_peers_seed = 1