View gist:da78be919ded11bcb799b2af111b7526
def insert_comma(mystring, position): | |
mystring[:position] + ',' + mystring[position:] | |
offset = 0 | |
for magic_number in magic_numbers: | |
position = magic_number + offset | |
mystring = insert_comma(mystring, position) | |
offset += 1 |
View RETA-2000example.dat
117LANPD001C7004348817Y 0812823530121000484674036598000000000 000000000 0004658280000000000000000002Y0NNEW ORLEANS LA CHIEF OF POLICE RECORDS & IDENTIFICATION 715 SOUTH BROAD STREET NEW ORLEANS, LA 701191170E1 0008300022222PPPP0000000000000030000200001000010000100000000000000000001000000000000000000000000100000000000000000000000010000000000000000000000006000000000000010000000002200021000010022600140000140001300059001910008500045000490000000012003840030300059000220140300571003800012500066028070000000000000050000000009000090000000071000410000000008000220017000063000430005300000000110007300056000160000100388000690005500010000040078500000000000000000000000000000000000000090000100000000020000600016000050000400004000000000300010000090000100000000470001600010000030000300098000000000000000000000210008300055555PPPP0000000000000030000300000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000 |
View mysql-mirror.sh
#!/bin/bash | |
# Copyright (c) 2005 nixCraft project <http://cyberciti.biz/fb/> | |
# This script is licensed under GNU GPL version 2.0 or above | |
# Source: http://www.cyberciti.biz/tips/move-mysql-users-privileges-grants-from-one-host-to-new-host.html | |
# Author Vivek Gite <vivek@nixcraft.com>, | |
# Peter Geil <code@petergeil.name> | |
# ------------------------------------------------------------ | |
# SETME First - local mysql user/pass | |
_lusr="src-db-user" | |
_lpass="src-db-pw" |
View .vimrc
version 7.0 | |
if &cp | set nocp | endif | |
let s:cpo_save=&cpo | |
set cpo&vim | |
let &cpo=s:cpo_save | |
unlet s:cpo_save | |
set cscopeprg=/usr/bin/cscope | |
set cscopetag | |
set cscopeverbose | |
set fileencodings=utf-8,latin1 |
View .vimrc
" Include user's local vim before config | |
if filereadable(expand("~/.vimrc.before")) | |
source ~/.vimrc.before | |
endif | |
"" | |
"" Basic Setup | |
"" | |
set nocompatible " use vim, no vi defaults |
View .gitconfig
# | |
# Working with branches | |
# | |
# Get the current branch name (not so useful in itself, but used in | |
# other aliases) | |
branch-name = "!git rev-parse --abbrev-ref HEAD" | |
# Push the current branch to the remote "origin", and set it to track | |
# the upstream branch | |
publish = "!git push -u origin $(git branch-name)" |
View diglet.sh
#! /bin/bash | |
IPLIST="ips.txt" | |
while read IP; do | |
echo "" | |
echo "$IP" | |
whois "$IP" | grep descr | |
whois "$IP" | grep changed | |
dig -x "$IP" +short | head -1 |
View tweet_dumper.py
#!/usr/bin/env python | |
# encoding: utf-8 | |
import tweepy #https://github.com/tweepy/tweepy | |
import csv | |
#Twitter API credentials | |
consumer_key = "" | |
consumer_secret = "" | |
access_key = "" |
View etc - ganglia - gmond.conf
/* This configuration is as close to 2.5.x default behavior as possible | |
The values closely match ./gmond/metric.h definitions in 2.5.x */ | |
globals { | |
daemonize = yes | |
setuid = yes | |
user = ganglia | |
debug_level = 0 | |
max_udp_msg_len = 1472 | |
mute = no | |
deaf = no |
View rrd_exporter.sh
#! /bin/bash -xe | |
# Note: run from /var/lib/ganglia directory, no need for subdir | |
# Run with: find /var/lib/ganglia/rrds/ -type d -exec sh -c 'cd "{}" ; /var/lib/ganglia/rrd_exporter.sh ;' \; | |
# backup current rrd files -- tar all and place in /tmp | |
tar --exclude='*.xml' -cvf /tmp/rrds-"$(date --date='now' +%F-%R)".tar rrds/* | |
echo "Backed up files in /tmp" | |
#Pull in rrd files one at a time | |
for i in *.rrd |
NewerOlder