Skip to content

Instantly share code, notes, and snippets.

View debedb's full-sized avatar

Gregory Golberg debedb

View GitHub Profile
<?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'
package main
import (
"bytes"
"encoding/base64"
"encoding/binary"
"fmt"
"os"
)
@debedb
debedb / gist:2b00c6c5de1a0c21da7f
Created December 1, 2014 18:31
Print call sequence of a C program
#!/usr/bin/perl
# See http://debedb.blogspot.com/2007/02/poor-mans-tracepoints-and-call-sequence.html
use FileHandle;
use IPC::Open2;
if (! (-e "tags")) {
print "Cannot find tags, will run\n";
$tagCmd = "ctags *.h *.c";
@debedb
debedb / xtermlauncher.bash
Created September 2, 2014 07:11
RTBKit Xterm-based launcher
#!/bin/bash
bindir=/home/grisha/git/rtbkit/build/x86_64/bin
export bindir
router="router_runner"
monitor="monitor_service_runner"
logger="data_logger_ex"
config="agent_configuration_service_runner"
banker="banker_service_runner"
augmentor="augmentor_ex_runner"
@debedb
debedb / gist:7de0c646664a4f68e342
Created August 29, 2014 05:19
Print Call Sequence Of A C Program
#!/usr/bin/perl
use FileHandle;
use IPC::Open2;
if (! (-e "tags")) {
print "Cannot find tags, will run\n";
$tagCmd = "ctags *.h *.c";
print "\t$tagCmd\n";
system($tagCmd) && die ("Make sure ctags is installed\n");