Skip to content

Instantly share code, notes, and snippets.

View tim-peters's full-sized avatar

Tim J. Peters tim-peters

View GitHub Profile
@tim-peters
tim-peters / dyndns_update.sh
Last active January 22, 2019 16:10
Update SpDyn DynDNS (IPv6)
#!/bin/bash
HOSTNAME=[url]
DYNDNSUSER=[email]
DYNDNSPW=[SpDyn token]
DYNDNSURL=https://update.spdyn.de/nic/update
CURRENT_IP6=$(ip address show dev wlan0 | grep ff:fe | grep -v fe80: | awk '{print $2}' | sed 's/^\([0-9a-f:]*\).*/\1/g')
DNS_IP6=$(host -t AAAA ${HOSTNAME} | tr " " "\n" | grep ff:fe)
@tim-peters
tim-peters / jpeg_corrupt.py
Created December 17, 2016 22:47
Python Script to find corrupted image files
# Depends on
# * Python
# * Pillow (https://pypi.python.org/pypi/Pillow/3.4.2#downloads)
#
# Execute with
# http://superuser.com/questions/276154/automating-the-scanning-of-graphics-files-for-corruption
#
# Source
# http://superuser.com/questions/276154/automating-the-scanning-of-graphics-files-for-corruption
# --------------------

Keybase proof

I hereby claim:

  • I am tim-peters on github.
  • I am tipe (https://keybase.io/tipe) on keybase.
  • I have a public key whose fingerprint is 5BE9 C46D EE41 3015 DE57 8233 98AB F7A5 161C FAEF

To claim this, I am signing this object:

@tim-peters
tim-peters / pathFinder_v2.pde
Created December 20, 2015 16:51
A very simple path finding algorythm in processing
/*
* Processing 2.0 File
* Author: Tim J. Peters <tim-peters>
* Released under CC BY 3.0
*/
int dotSize = 100; // scale
int gridSize = 10; // size of the map (grid)
int[] waysToKnot;
@tim-peters
tim-peters / pathFinder_v1.pde
Last active December 13, 2015 21:24
A very simple path finding algorythm in processing
/*
* Processing 2.0 File
* Author: Tim J. Peters <tim-peters>
* Released under CC BY 3.0
*/
int dotSize = 100; // scale
int gridSize = 10; // size of the map (grid)
int[] waysToKnot;
@tim-peters
tim-peters / diagonal-lsd-art.pde
Last active December 28, 2015 18:59
A dirty, short test of how to create diagonal animations in processing, depending on a n*m matrix.
int width = 12; // Set amount of rectangles in a row
int height = 12; // Set amount of rectangles column
int outer_size = 70; // Set size of the (outer) rectangles
int inner_size = 100; // Set size of the rectangles/circles inside (must be smaller than outer_size!!!)
int marginX = 30; // Set margin between (outer) rectangles in a row (if you like)
int marginY = 30; // Set margin between (outer) rectangles in a column (if you like)
float animation_offset = -.48; // Set offset between rectangles anmiation
////////////////////////////////////
// List prime numbers with processing 2
// Simplified
// By: TiPE
int[] zahlen = new int[101]; // create an array width 101 "parts" called zahlen
int anzahl = 0; // create an int for counting the primes
for(int x=1;x<=100;x++) // count from 1 to 100...
{