Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexander Dahl LeSpocky

View GitHub Profile
@LeSpocky
LeSpocky / rounded_corner.scad
Last active Nov 17, 2020
rounded square in openscad
View rounded_corner.scad
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 / 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 / collectip.sh
Created Jul 3, 2013
Get outside IPv4 address and echo a line for adding to some poor mans database for later analyzation.
View collectip.sh
#!/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 Dec 18, 2015
in cronjob tun und die webcam-bilder ablegen mit zeitstempel
View flut.sh
#!/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
@LeSpocky
LeSpocky / check-domain-connect.sh
Last active Dec 17, 2015
Little shell script to check if a domain is still connected. Run with cron job!
View check-domain-connect.sh
#!/bin/sh
if whois $1 | grep -i status | grep -q connect
then
echo "$1 still connected" >/dev/null
else
echo "*** The domain $1 is not connected! ***"
fi
changed=$(whois $1 | grep -i changed)
old_changed=$(cat ~/var/domain_changed_${1})
@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