Skip to content

Instantly share code, notes, and snippets.

View mrtazz's full-sized avatar
👨‍🔧
computer plumbing

Daniel Schauenberg mrtazz

👨‍🔧
computer plumbing
View GitHub Profile
# figure out name of USB device
diskutil list
# unmount partitions but keep device proper
diskutil unmountDisk /dev/USBSTICK
# write image to USB device
dd if=8.1-RELEASE-amd64-memstick.img of=/dev/USBSTICK bs=10240 conv=sync
Starting CouchDB...
Eshell V5.7.5 (abort with ^G)
1> Apache CouchDB 1.0.0 (LogLevel=info) is starting.
1> [error] [<0.91.0>] {error_report,<0.35.0>,
{<0.91.0>,crash_report,
[[{initial_call,{couch_auth_cache,init,['Argument__1']}},
{pid,<0.91.0>},
{registered_name,[]},
{error_info,
{exit,
#!/bin/sh
# wrapper to use vimdiff with git
# diff is called by git with 7 parameters:
# path old-file old-hex old-mode new-file new-hex new-mode
mvimdiff "$2" "$5"
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf *.pdf

P2P Networks

Overview of P2P lecture Summer 2010 University of Freiburg

Napster

  • Star topology
  • Query via server
  • Download directly from Peer

Gnutella

  • Neighbourhood lists
@mrtazz
mrtazz / redmine_git_update.sh
Created November 30, 2010 22:01
zsh script to update 'git clone --mirror' repos for redmine
#!/usr/local/bin/zsh
# variables
gitcmd="/usr/local/bin/git"
REPOS="/home/redmine/repos/"
repos=(`ls -1 ${REPOS}`)
for r in ${repos[@]}
do
cd ${REPOS}${r} && $gitcmd fetch
@mrtazz
mrtazz / redmine_psql_backup.sh
Created December 3, 2010 10:08
dump the redmine DB from psql and commit it to a git repository
#!/bin/sh
#
# shell script to dump a database from PostgreSQL and
# store it in git
#
AUTHOR="User <user@host>"
GITCMD="/usr/local/bin/git"
DUMPCMD="/usr/local/bin/pg_dump"
BACKUP_REPO="/path/to/repo"
def tsplit(string, delimiters):
"""Behaves str.split but supports multiple delimiters."""
delimiters = tuple(delimiters)
stack = [""] # stack to return
for i in xrange(len(string)):
if string[i] in delimiters:
stack.append("")
else:
@mrtazz
mrtazz / german_politics.mustache
Created April 5, 2011 19:43
Template for actions taken after a party polls badly (German edition)
{{party}} gets bad results in election.
{{leader}}, leader of {{party}}, steps down.
{{party}} elects {{new_leader}} as new leader.
{{new_leader}} promises that he will reinvent the party and earns back
the trust of the voters.
{{coalition_partner}} hopes they succeed fast with their endeavor.
{{member_of_opposition}} is sure that this will never work and that {{party}}
has chosen the wrong direction.
Nothing changes.
@mrtazz
mrtazz / codepoints.txt
Created June 8, 2011 10:06
UTF-8 sample content
0020 SPACE
0021 ! EXCLAMATION MARK
0022 " QUOTATION MARK
0023 # NUMBER SIGN
0024 $ DOLLAR SIGN
0025 % PERCENT SIGN
0026 & AMPERSAND
0027 ' APOSTROPHE
0028 ( LEFT PARENTHESIS
0029 ) RIGHT PARENTHESIS