Skip to content

Instantly share code, notes, and snippets.

😎
¯\_(ツ)_/¯

Viktor Petersson vpetersson

😎
¯\_(ツ)_/¯
Block or report user

Report or block vpetersson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View spro-flash.md

Check the status of the SD card before we begin:

$ sudo fdisk -l /dev/sdc

Disk /dev/sdc: 7948 MB, 7948206080 bytes
240 heads, 32 sectors/track, 2021 cylinders, total 15523840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
View fetch_or_build.py
import time
import sys
import os
import dateutil.parser
from docker import Client
"""
Helper script to determine if you should rebuild the image or use the upstream image
using the modification timestamp of the Dockerfile.
View gist:6346d67c8466ed513c3adb716a054cdd
#!/bin/bash
set -e
RELEASEPATH="$HOME/Downloads/"
SD_DISK=$(mount | grep msdos | awk {'print $1'})
DISK_NO=$(echo $SD_DISK | awk '{print substr($0,length-2,1)}')
RDISK_BASE="/dev/rdisk"
RDISK=$RDISK_BASE$DISK_NO
@vpetersson
vpetersson / burn_screenly_pro.sh
Created Jan 26, 2016
An experimental script to burn Screenly Pro's disk image on Mac OS X.
View burn_screenly_pro.sh
#!/bin/bash
# Replace RELEASEPATH with the path to where you download the disk image
RELEASEPATH="$HOME/Downloads"
SD_DISK=$(mount | grep msdos | awk {'print $1'})
DISK_NO=$(echo $SD_DISK | awk '{print substr($0,length-2,1)}')
RDISK_BASE="/dev/rdisk"
RDISK=$RDISK_BASE$DISK_NO
clear
@vpetersson
vpetersson / lh_skype.py
Last active Sep 8, 2015
Infinite loop to call Lufthansa's customer service line.
View lh_skype.py
import Skype4Py
import random
from time import sleep
"""
A script to keep recalling Lufthansa's customer support until you get through.
You will need Skype4Py installed. I couldn't get it working on Mac OS X, so had
run it in an Ubuntu 14.04 VM.
View gist:e9965d8e27aa0a2a71c7
-----BEGIN CERTIFICATE-----
MIIERDCCAyygAwIBAgIDAjp4MA0GCSqGSIb3DQEBCwUAMEIxCzAJBgNVBAYTAlVT
MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i
YWwgQ0EwHhcNMTQwODI5MjIyNDU4WhcNMjIwNTIwMjIyNDU4WjBmMQswCQYDVQQG
EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UECxMURG9tYWluIFZh
bGlkYXRlZCBTU0wxIDAeBgNVBAMTF0dlb1RydXN0IERWIFNTTCBDQSAtIEc0MIIB
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA30GUetr35DFDtuoBG1zOY+r6
baPZau4tmnX51ZxbvTTf2BzJbdgEiNputbe18DCuQNZd+sRTwdQinQROEaaV1UV8
QQVY4Ezd+e5VvV9G3K0TCJ0s5PeC5gcrng6MNKHOxKHggXCGAAY/Lep8myiuGyiL
OQnT5/BFpLG6EWeQVXuP3u04XKHh44PEw3KRT5juHMKAqmSlPoNiHMzgnvhawBMS
View gist:dfd17083c39fb37ad80b
$ tail -f /var/log/syslog
[...]
Jul 20 08:45:13 vagrant-ubuntu-trusty-64 watchdog[3831]: still alive after 17 interval(s)
Jul 20 08:45:13 vagrant-ubuntu-trusty-64 watchdog[3831]: still alive after 18 interval(s)
Jul 20 08:45:14 vagrant-ubuntu-trusty-64 watchdog[3831]: still alive after 19 interval(s)
Jul 20 08:45:14 vagrant-ubuntu-trusty-64 watchdog[3831]: still alive after 20 interval(s)
Jul 20 08:45:15 vagrant-ubuntu-trusty-64 watchdog[3831]: still alive after 21 interval(s)
Jul 20 08:45:15 vagrant-ubuntu-trusty-64 watchdog[3831]: still alive after 22 interval(s)
Jul 20 08:45:16 vagrant-ubuntu-trusty-64 watchdog[3831]: still alive after 23 interval(s)
Jul 20 08:45:16 vagrant-ubuntu-trusty-64 watchdog[3831]: still alive after 24 interval(s)
View gist:ec59baaa583e7e25e86b
vagrant@vagrant-ubuntu-trusty-64:~$ uptime
13:58:19 up 6 min, 1 user, load average: 1.87, 0.88, 0.36
vagrant@vagrant-ubuntu-trusty-64:~$ sudo tail -n 10 /var/log/syslog
Jul 19 13:58:16 vagrant-ubuntu-trusty-64 watchdog[1406]: still alive after 342 interval(s)
Jul 19 13:58:17 vagrant-ubuntu-trusty-64 watchdog[1406]: still alive after 343 interval(s)
Jul 19 13:58:17 vagrant-ubuntu-trusty-64 watchdog[1406]: still alive after 344 interval(s)
Jul 19 13:58:18 vagrant-ubuntu-trusty-64 watchdog[1406]: still alive after 345 interval(s)
Jul 19 13:58:18 vagrant-ubuntu-trusty-64 watchdog[1406]: still alive after 346 interval(s)
Jul 19 13:58:19 vagrant-ubuntu-trusty-64 watchdog[1406]: still alive after 347 interval(s)
View gist:8487f45826216f556e89
$ grep -v "^#" /etc/watchdog.conf
max-load-1 = 0.5
realtime = yes
priority = 1
@vpetersson
vpetersson / gist:6654b0579775605ece9c
Created Jul 9, 2015
This is what you can expect from BT Wi-Fi.
View gist:6654b0579775605ece9c
Request timeout for icmp_seq 1176
Request timeout for icmp_seq 1177
64 bytes from 216.58.208.78: icmp_seq=1178 ttl=50 time=589.522 ms
64 bytes from 216.58.208.78: icmp_seq=1179 ttl=50 time=135.608 ms
64 bytes from 216.58.208.78: icmp_seq=1180 ttl=50 time=59.023 ms
64 bytes from 216.58.208.78: icmp_seq=1181 ttl=50 time=89.568 ms
64 bytes from 216.58.208.78: icmp_seq=1182 ttl=50 time=336.301 ms
64 bytes from 216.58.208.78: icmp_seq=1183 ttl=50 time=356.849 ms
64 bytes from 216.58.208.78: icmp_seq=1184 ttl=50 time=136.502 ms
64 bytes from 216.58.208.78: icmp_seq=1185 ttl=50 time=131.593 ms
You can’t perform that action at this time.