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
@deadbok
deadbok / htaccess
Last active August 1, 2016 08:50
Better .htaccess for WordPress on VestaCP
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
@deadbok
deadbok / dirdiff.sh
Last active August 9, 2016 11:36
Scan for changed and suspucious files on WordPress sites.
# Set this to the directory where the script is installed.
# Make sure the script is saving the files in a sane place
# when running as a cron job.
ROOT=.
#Directory to scan
DIR=/home/*/web/*/public_html/
if [ ! -f ${ROOT}/dirdiff.lst ];
then
touch ${ROOT}/dirdiff.lst
#!/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
@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
@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 / 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

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 / 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:
#!/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 / 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)