This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check all MP4 video files to see if they're corrupt, then merge into one file. | |
which avprobe | |
if [ $? -ne 0 ]; then echo "Please install avprobe"; exit; fi | |
find . -type f -iname "*.mp4" -print0 | while IFS= read -r -d $'\0' line; do | |
avprobe "$line" &> /dev/null | |
if [ $? -ne 0 ]; then | |
echo "Deleting corrupt file $line" | |
rm "$line" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://blogs.dropbox.com/tech/2014/07/open-sourcing-our-go-libraries/ | |
http://highscalability.com/blog/2014/5/7/update-on-disqus-its-still-about-realtime-but-go-demolishes.html | |
https://blog.repustate.com/migrating-entire-api-go-python/ | |
http://s3.amazonaws.com/golangweekly/go_for_pythonistas.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#ToDo: Learn how to use functions in Bash :P | |
MAXTHREADS=20 | |
#####1. No proxy | |
echo "Downloading `wc -l sites.txt|xargs` sites with no proxy (max threads: $MAXTHREADS)" | |
start=`date +%s` | |
for i in `cat sites.txt` | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def run_program(rcmd): | |
""" | |
Runs a program, and it's paramters (e.g. rcmd="ls -lh /var/www") | |
Returns output if successful, or None and logs error if not. | |
""" | |
cmd = shlex.split(rcmd) | |
executable = cmd[0] | |
executable_options=cmd[1:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dateutil.parser.parse("2014-07-08T10:18:01+02:00") - datetime.datetime.now(dateutil.tz.tzutc()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Write an image to multiple SD cards at the same time | |
# Supply: image to be written, comma separated list of devices | |
# @glennzw | |
#set -e | |
echo -en " +++ Glenn's multi SD writer. Use with care. @glennzw +++\n\n" | |
BS=1m | |
OIFS=$IFS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Disable IPv6 on Linux | |
# [email protected] | |
echo "Disabling IPv6..." | |
echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6 | |
echo "Disabling IPv6 on boot..." | |
cat >> /etc/sysctl.conf << EOF | |
#disable ipv6 on boot | |
net.ipv6.conf.all.disable_ipv6 = 1 | |
net.ipv6.conf.default.disable_ipv6 = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# [email protected] | |
from collections import OrderedDict | |
class fifoDict: | |
"""OrderedDict with FIFO size constraint""" | |
def __init__(self, size=1000, reducePc=0.2): | |
self.od = OrderedDict() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# [email protected] | |
# Get times for a bus from TFL | |
from bs4 import BeautifulSoup | |
import requests | |
import re | |
import os | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup ToR, ToR browser, and Moxie's tortunnel on Kali | |
# [email protected] | |
set -e | |
echo "Installing ToR and privoxy for Kali, and enabling start on boot" | |
#Install tor services for proxychaining etc | |
apt-get install -y tor privoxy | |
/etc/init.d/tor start | |
/etc/init.d/privoxy start | |
update-rc.d tor enable |