Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexander Dahl LeSpocky

View GitHub Profile
@LeSpocky
LeSpocky / sample_output
Last active Jun 25, 2020 — forked from JonathonReinhart/sample_output
Show Ethernet drivers on Linux
View sample_output
% what_eth_drivers.sh
br0 [ac:22:0b:c3:cd:2a]: (up)
docker0 [02:42:6b:bb:b4:67]: (down)
enp3s0 [ac:22:0b:c3:cd:2a]: r8169 (up)
enp5s0 [00:01:02:d8:91:07]: 3c59x (unknown)
enx00e04c6800e5 [00:e0:4c:68:00:e5]: r8152 (down)
lo [00:00:00:00:00:00]: (unknown)
vmnet1 [00:50:56:c0:00:01]: (unknown)
vmnet8 [00:50:56:c0:00:08]: (unknown)
View throbber.c
#include <stdio.h>
#include <unistd.h>
int main( int argc, char *argv[] )
{
char c = '-';
printf( "throbber: [-]" );
while ( 1 )
{
@LeSpocky
LeSpocky / check_session.txt
Created Nov 12, 2018
asciio example output
View check_session.txt
.-----------------. no
| session exists |-----------------.
'-----------------' |
| yes |
v v
.-----------------. yes .-------------------.
| session expired |------>| redirect to login |
'-----------------' '-------------------'
| no ^
View sh_colors.inc
# ----------------------------------------------------------------------
# quick and dirty color helping stuff
# ----------------------------------------------------------------------
ESC_START='\033['
ESC_SEP=';'
ESC_END='m'
COL_RST="${ESC_START}0${ESC_END}"
COL_BOLD='1'
@LeSpocky
LeSpocky / bash_colours
Created Jan 25, 2016 — forked from ian128K/bash_colours
Shell script colours
View bash_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 Jul 29, 2015
git config für ptxdist
View .gitconfig
[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
View ffmd-to-ffapi.pl
#!/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;
View keybase.md

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:

View ffmap-stat-panel.pl
#!/usr/bin/perl -w
use strict;
use warnings;
use Data::Dumper;
use JSON;
use LWP::Simple;
# init variables
@LeSpocky
LeSpocky / backup.sh
Last active Aug 29, 2015
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
View backup.sh
#!/bin/sh
set -e
set +x
# set paths here
DATE='/bin/date'
RSYNC='/usr/bin/rsync'
SSH='/usr/bin/ssh'
ZFSNAP='/usr/sbin/zfSnap'