Skip to content

Instantly share code, notes, and snippets.

View j0inty's full-sized avatar
🐧

Steffen Stollfuß j0inty

🐧
  • Rostock, M-V, Germany
View GitHub Profile
@j0inty
j0inty / get_ethernet_addresses.php
Last active September 8, 2016 14:00 — forked from JunaidQadirB/get_mac.php
* added the php tag to activate the syntax highlight
<?php
/**
* Get the all interface mac addresses.
*
* @return array|integer Return the MAC adresses as an array OR if the exec() call failed the return will be the error code from "ipconfig /all".
*/
function get_ethernet_addresses()
{
$physicalAddresses = array();
$ipconfig_output = array();
// Remember: This is a very simple example. enum's with gaps will not work as expected ...
enum JobStatsIdx
{
None = 0,
First = 1,
Second = 2,
Third = First | Second,
Eight = 8,
Nine = 9
};
@j0inty
j0inty / .vimrc
Created September 12, 2016 15:21
my .vimrc
"""
"
""
" Sets how many lines of history VIM has to remember
set history=500
" With a map leader it's possible to do extra key combinations
" like <leader>w saves the current file
let mapleader = ","
let g:mapleader = ","
/**
* Guarantueed that the memory will set with c through the volatile instruction to the compiler.
*/
void *guaranteed_memset(void *v,int c,size_t n)
{
volatile char *p=v;
while (n--)
{
*p++=c;
}

Keybase proof

I hereby claim:

  • I am j0inty on github.
  • I am j0inty (https://keybase.io/j0inty) on keybase.
  • I have a public key whose fingerprint is 6E61 ACB2 F2C0 3352 78AD ECE4 9377 DE38 420D 6F41

To claim this, I am signing this object:

@j0inty
j0inty / debug_vars.php
Created September 30, 2016 11:21
PHP: quick method to debug multiple variables in php easiely
<?php
$count = 1;
$cols = 42;
$rows = ["col_0" => "val_0", "col_1" => &$cols, "col_2" => 4711];
print_r(compact(explode(' ', 'count acw cols rows')));
/**
Array
(
[count] => 1
@j0inty
j0inty / etc_init.d_ezstream
Last active October 7, 2016 11:57
Icecast2 Streaming Client init.d for OpenRC
#!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
RUNAS_USER="${RUNAS_USER:-icecast}"
RUNAS_GROUP="${RUNAS_GROUP:-nogroup}"
CONFIG_FILE="${CONFIG_FILE:-/etc/icecast2/ezstream.xml}"
LOG_FILE="${LOG_FILE:-/var/log/icecast2/ezstream.log}"
@j0inty
j0inty / etc_conf.d_ezstream
Last active October 7, 2016 11:56
Icecast2 Streaming Client conf.d File for OpenRC
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# Config location
CONFIG_FILE="/etc/icecast2/ezstream.xml"
# Should be the same as setup in CONFIG_FILE
# Be sure the user setup under RUNAS has read access on it
FILES_DIR="/home/j0inty/Traktor/Public/Exercises"
@j0inty
j0inty / etc_init.d_icecast
Last active May 30, 2018 06:16
Icecast2 Streaming Daemon init.d for OpenRC
#!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
RUNAS="${RUNAS:-icecast}"
RUNGROUP="${RUNGROUP:-nogroup}"
CONFIG_FILE="${CONFIG_FILE:-/etc/icecast2/icecast.xml}"
pidfile="${PIDFILE:-/run/icecast2/server.pid}"
@j0inty
j0inty / etcinit.damavisd-milter
Created October 8, 2016 15:35
/etc/init.d/amavisd-milter
#!/sbin/openrc-run
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
NAME="amavisd-milter"
DAEMON="/usr/sbin/${NAME}"
depend() {
before postfix