Skip to content

Instantly share code, notes, and snippets.

View debedb's full-sized avatar

Gregory Golberg debedb

View GitHub Profile
@debedb
debedb / dhcp.conf
Created August 29, 2017 02:35
vmnet2 sample (/Library/Preferences/VMware Fusion/vmnet2/dhcd.conf)
# Configuration file for ISC 2.0 vmnet-dhcpd operating on vmnet2.
#
# This file was automatically generated by the VMware configuration program.
# See Instructions below if you want to modify it.
#
# We set domain-name-servers to make some DHCP clients happy
# (dhclient as configured in SuSE, TurboLinux, etc.).
# We also supply a domain name to make pump (Red Hat 6.x) happy.
#
@debedb
debedb / etcdrmrf.sh
Created August 23, 2017 20:21
Remove everything from etcd
#!/bin/csh
foreach x (`etcdctl ls --recursive | sort -r | uniq`)
etcdctl rmdir $x
end
etcdctl ls --recursive /
@debedb
debedb / turbotaxfile.py
Last active July 16, 2017 05:33
Quick sort of receipts into folders based on TurboTax clasification
import time
import os
import sys
import shutil
from subprocess import Popen
reader = 'open'
# Inventory, Taxes_and_Licenses, Advertising, Insurance, Interest,
# Rental, Commissions, Contract Labor, Repairs and Maintenance,
@debedb
debedb / formMarshaller.go
Created November 16, 2016 19:39
formMarshaller provides functionality to marshal/unmarshal data to/from HTML form format.
// formMarshaller provides functionality to marshal/unmarshal
// data to/from HTML form format.
type formMarshaller struct{}
func (j formMarshaller) Marshal(v interface{}) ([]byte, error) {
retval := ""
vPtr := reflect.ValueOf(v)
vVal := vPtr.Elem()
vType := reflect.TypeOf(vVal.Interface())
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="GoClipse" version="12">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
@debedb
debedb / go_arrays_pointers.go
Created March 23, 2016 18:53
Go arrays and pointers
// See https://play.golang.org/p/qK05tDYCFR
package main
import "fmt"
type Make struct {
Name string
}
@debedb
debedb / WrappedStreamingBody
Last active November 26, 2020 09:05
Wrap boto3's StreamingBody object to provide enough Python fileobj functionality fileobj functionality so that GzipFile is satisfied.
class WrappedStreamingBody:
"""
Wrap boto3's StreamingBody object to provide enough
fileobj functionality so that GzipFile is
satisfied. Sometimes duck typing is awesome.
@debedb
debedb / Go vendoring
Last active February 10, 2017 20:01
#!/bin/sh
set -x
if [ "$1" == "" ]; then
echo "Usage: $0 <REPO_PATH> [<PROJECT_ROOT>] [<branch>]"
exit 1
fi
repo=$1
@debedb
debedb / m2c.py
Created August 25, 2015 18:39
mod_uid hex to cookie
import base64
import struct
import sys
def main():
"""
http://www.lexa.ru/programs/mod-uid-eng.html
Sample input: 'F705D40AACC48C54571D9D7A02CAFA59'
yields sample output: 'CtQF91SMxKx6nR1XWfrKAg=='
@debedb
debedb / c2m.py
Created August 25, 2015 18:37
mod_uid cookie to hex, python
import base64
import struct
import sys
def main():
"""
http://www.lexa.ru/programs/mod-uid-eng.html
Sample input: 'CtQF91SMxKx6nR1XWfrKAg=='
yields sample output: 'F705D40AACC48C54571D9D7A02CAFA59'