Skip to content

Instantly share code, notes, and snippets.

View deadbok's full-sized avatar

Martin Bo Kristensen Grønholdt deadbok

  • Denmark
View GitHub Profile
#!/bin/sh
#Check periodicly if my YouSee supplied Netgear CG3000 router has had another nervous breakdown
#using this script and cron.
#Copyright 2014-2015 Martin Bo Kristensen Grønholdt
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
@deadbok
deadbok / dl_speed.py
Last active August 29, 2015 14:00
Simple tool to take some statistics of download speed.
import urllib.request
import time
#URL used for test download
URL = ('http://ftp.gnu.org/gnu/binutils/binutils-2.24.tar.gz')
#Times to download the file
NUMBER_OF_DL = 1
#File to save the staticts to
STATS_FILENAME = 'stats.csv'
@deadbok
deadbok / flac2mp3.sh
Created February 19, 2015 21:45
Covert FLAC files to MP3
#!/bin/bash
#Based on: https://wiki.archlinux.org/index.php/Convert_Flac_to_Mp3#Without_FFmpeg
for a in *.flac; do
# give output correct extension
OUTF="${a[@]/%flac/mp3}"
# get the tags
ARTIST=$(metaflac "$a" --show-tag=ARTIST | sed s/.*=//g)
#!/bin/sh
#
# dropBrute.sh by robzr
#
# minimalist OpenWRT/dropbear ssh brute force attack banning script
#
# Installation steps:
#
# 1) Optionally edit the variables in the header of this script to customise
# for your environment
@deadbok
deadbok / mem_usage.sh
Last active March 19, 2021 12:34 — forked from igrr/mem_usage.sh
#!/bin/bash
# Orinial work by Ivan Grokhotkov.
# https://gist.github.com/igrr/43f8b8c3c4f883f980e5
#
# This version modified by Martin Grønholdt
# https://gist.github.com/deadbok/1e9a3fd78bdb854fd9b2
#
# Print data, rodata, bss sizes in bytes
#
# Usage:

Keybase proof

I hereby claim:

  • I am deadbok on github.
  • I am deadbok (https://keybase.io/deadbok) on keybase.
  • I have a public key whose fingerprint is 900B 8B4A D311 11F6 F464 FD8A 4D8A BF24 E9FC 5F97

To claim this, I am signing this object:

@deadbok
deadbok / addbom.sh
Created January 5, 2016 19:59
Add Byte Orders Mark to subtitles
#!/bin/bash
# addbom.sh
FILE=$1
check()
{
if (( e = "$1" )); then
echo "ERROR: $ACTION failed!!"
exit $e
@deadbok
deadbok / build.prop
Last active January 8, 2016 15:57
Data for a cheap chinese tablet
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=JOP40D
ro.build.display.id=WonderMedia-MID-_130904.1546
ro.build.version.incremental=_130904.1546
ro.build.version.sdk=17
ro.build.version.codename=REL
ro.build.version.release=4.2.1
ro.build.date=Wed Sep 4 15:47:36 HKT 2013
@deadbok
deadbok / pinglist.py
Last active June 7, 2016 23:52
Script to ping a list of domains and IP's read from a file, and save status as csv
'''
Created on 06/06/2016
:copyright: (c) 2016 by Martin Grønholdt.
:license: GPLv3, see LICENSE for more details.
'''
import shlex
import locale
from subprocess import Popen, PIPE
import argparse
#!/bin/sh
#
# Try to dertermine if a site is driven by WordPress
#
# 2016 by Martin Bo Kristensen Grønholdt
echo -n "" > $2
while read url
do
curl -s ${url} > index.tmp