Skip to content

Instantly share code, notes, and snippets.

# coding=utf-8
import datetime
import sys
import time
import threading
import traceback
import SocketServer
from dnslib import *
@rmamba
rmamba / esxi.rdm
Created May 8, 2015 23:22
ESXI RDM
#List devices:
ls /dev/disks/ -l
#create RDM
vmkfstools -r /vmfs/devices/disks/vml.01000000002020202020202020202020203951473358423630535433353030 /vmfs/volumes/datastore1/MediaServer/hwRAID5.vmdk -a lsilogic
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
#!/bin/sh
### BEGIN INIT INFO
# Provides: deluge-daemon
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Daemonized version of deluge and webui.
@rmamba
rmamba / planetosm.sh
Created November 6, 2014 20:17
Generate empty PostGres DB for OSM
SET pgpass=secret
SET pguser=postgres
DROPDB -U postgres -h localhost planetosm
CREATEDB -U postgres -h localhost -T template_postgis -e -O postgres planetosm
psql -h localhost -t -d planetosm -U postgres -a -c "CREATE SCHEMA markware;"
psql -h localhost -t -d planetosm -U postgres -a -c "ALTER DATABASE planetosm SET search_path='markware','public';"
psql -h localhost -t -d planetosm -U postgres -a -c "GRANT ALL PRIVILEGES ON DATABASE planetosm to osm;"
psql -h localhost -t -d planetosm -U postgres -a -c "CREATE EXTENSION hstore;"
psql -h localhost -U postgres -f /home/osm900913.sql planetosm
@rmamba
rmamba / config.py
Last active August 29, 2015 14:08
tweetFollowBot
config = [
{
'consumer_key': 'KEY',
'consumer_secret': 'SECRET',
'access_token': 'TOKEN',
'access_token_secret': 'SECRET'
'user_name': 'YOUR_TWITTER_USER'
}
]
@rmamba
rmamba / mapnik_style.xml
Last active August 29, 2015 14:07
mapnik_style.xml
<?xml version="1.0" encoding="utf-8"?>
<Map background-color="#f2efe9" srs="+proj=latlong +datum=WGS84">
<FontSet name="book-fonts">
<Font face-name="DejaVu Sans Book" />
</FontSet>
<Style name="highways">
<Rule>
<Filter>[highway] &lt;&gt; ''</Filter>
<LineSymbolizer stroke="#808080" stroke-width="2" stroke-linejoin="round"
stroke-linecap="round" />
@rmamba
rmamba / chmodr.sh
Last active August 29, 2015 14:06 — forked from francisbyrne/chmodr.sh
#!/bin/sh
#
# chmodr.sh
#
# author: Francis Byrne
# date: 2011/02/12
#
# Generic Script for recursively setting permissions for directories and files
# to defined or default permissions using chmod.
#
@rmamba
rmamba / qt5checkout.sh
Last active August 29, 2015 14:06
qt5checkout.sh
#!/bin/bash
# Checkout qt5 submodules to specific branch/tag
# call as 'git submodule foreach /path/to/qt5checkout.sh 5.4'
if git show-ref | grep -q refs/remotes/origin/$1 ; then
echo -e '\e[31mgit checkout ...'
git checkout "$1"
echo -e '\e[32mgit pull ...'
git pull
echo -e '\e[39m'
@rmamba
rmamba / fstab
Last active August 29, 2015 14:02
raspberry pi USB mount
#add this line for each USB drive
#format USB drive: sudo mkfs.ext4 /dev/sda1 -L untitled
UUID=uuid /mnt ext4 auto,rw,defaults 0 0