This file contains hidden or 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
# | |
# Read the dump made by lvm2defrag and calculate the total size per lv | |
# | |
import glob, itertools, re | |
from collections import defaultdict | |
from optparse import OptionParser | |
""" | |
Read 'dump.txt' generated by lvm2defrag and gather all it's fragments |
This file contains hidden or 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
# | |
# Parse all multicast URL's from the IPTV stream list | |
# | |
import json, os, collections, re, requests, urlparse | |
TVHEADEND_USER = '' | |
TVHEADEND_PASS = '' | |
assert TVHEADEND_USER and TVHEADEND_PASS | |
TVHEADEND_ROOT = 'http://server:9981/' |
This file contains hidden or 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
import bz2 | |
BUFFER_SIZE = 4096 | |
def stream_bz2(fn): | |
buf = bytearray(BUFFER_SIZE) | |
with bz2.BZ2File(fn) as b2f: | |
while True: | |
s_r = b2f.readinto(buf) |
This file contains hidden or 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 | |
""" | |
One of my machines runs multiple KVM vm's. | |
When the host needs to reboot i suspend the vm's first using this quick and dirty script. | |
After the reboot there is some time skew in the vm's (they continue at the time of the | |
suspend). You either need to use one of these solutions; | |
* reboot the vm's. They will pickup the correct time... | |
* manually stop ntp (service stop ntp) and let ntpd fix the time with a large step (ntpd -gq) | |
* setup ntp to skew the clock faster |
This file contains hidden or 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
# SSL config snippet for apache | |
SSLProtocol -ALL +SSLv3 +TLSv1 +TLSv1.1 +TLSv1.2 | |
SSLCipherSuite EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH+aRSA:RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4 | |
SSLHonorCipherOrder on | |
#SSLCipherSuite HIGH:MEDIUM | |
# HSTS | |
Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains" |
This file contains hidden or 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
listen [::]:443 ipv6only=on ssl default_server; | |
ssl_session_cache shared:SSL:10m; | |
ssl on; | |
ssl_certificate <unified certificate chain>; | |
ssl_certificate_key <private key>; | |
ssl_dhparam <dh param>; | |
ssl_session_timeout 5m; |
This file contains hidden or 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
class projects::ossettings { | |
# directory setup | |
$home = "/Users/${::boxen_user}/" | |
## java home | |
file_line { 'java_home': | |
path => "${home}/.profile", | |
line => 'export JAVA_HOME=`/usr/libexec/java_home`', | |
} |
This file contains hidden or 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
function encode(instr) | |
{ | |
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; | |
var outstr = ""; | |
var chr1, chr2, chr3 = ""; | |
var enc1, enc2, enc3, enc4 = ""; | |
var i = 0; | |
do { | |
chr1 = instr.charCodeAt(i++); |
This file contains hidden or 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
package com.haibison.android.lockpattern.widget; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.text.Html; | |
import android.util.Log; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.Button; |