Skip to content

Instantly share code, notes, and snippets.

View pce's full-sized avatar

Patrick C. Engel pce

  • UTC+1
View GitHub Profile
@pce
pce / vim.md
Last active October 27, 2015 08:12
Vim
@pce
pce / .gitconfig
Last active August 29, 2015 14:17
basic git alias
[alias]
co = checkout
cob = checkout -b
ci = commit
com = commit -m
cp = cherry-pick
st = status -s
cl = clone
br = branch
diff = diff --word-diff
@pce
pce / gftp_srabble.py
Last active May 10, 2017 10:16
gftp desramble password
#!/usr/bin/python2.7
import sys
def gftp_descrable_password(password):
"""gftp password descrambler
This code has been released in the Public Domain by the original author.
"""
@pce
pce / homebank_csv.rb
Created August 27, 2014 09:26
ing-diba export format umsatz.csv -> homebank-import.csv ("Buchung";"Valuta";"Auftraggeber/Empfänger";"Buchungstext";"Verwendungszweck";"Betrag";"Währung";"Saldo";"Währung" -> date ; paymode ; info ; payee ; description ; amount ; category )
#!/usr/bin/ruby
require 'csv'
bank_csv = Array.new
CSV.foreach("umsatz.csv", { :col_sep => ";" }) do |row|
bank_csv << [row[0].gsub(".", "-"), 0, row[4], row[2], row[4], row[5].gsub(",", "."), row[3]]
end
CSV.open("homebank-import.csv", "wb", { :col_sep => ";" }) do |csv|
@pce
pce / euclid.rb
Created July 25, 2014 16:24
euclidian
#!/bin/env ruby
def euclid(m, k)
if k==0
return m
else
return euclid(k, m%k)
end
end
#!/bin/bash
# TODO use $TLD to build a regex for egrep and strlen of head
TLD=to
for domain in $(aspell -l en dump master | egrep '^\w{3,5}to$')
do
domain=$(echo $domain | head -c-3).$TLD
echo $domain
whois $domain | grep "Status: free" >/dev/null && echo "the domain $domain seems available"
@pce
pce / etc_netbeans.conf.part
Created February 24, 2014 10:11
netbeans.conf options for a nicer java font in crunchbang/debian
# added "-J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd"
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd"
@pce
pce / space-checker
Created January 21, 2014 12:20
/usr/local/bin/space-checker
#!/bin/bash
# . .:free space checker:.
# -o-
# ' .-. .
# __/ @_\_ . * -o-
# (________) '
#
# * |
# . --o--
# ~/.bashrc: executed by bash(1) for non-login shells.
export PS1='\h:\w\$ '
umask 022
# colors
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
# alias ll='ls $LS_OPTIONS -l'
@pce
pce / remday.py
Created March 13, 2013 16:18
check days with timedelta 0, -7, -1 days before a birthday and mail notification. contacts.db is assumed to be located in the same directory.
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
remd - remember days and get a mail notification.
contacts.db assumed to be in same directory.
Copyright (C) 2013 pce
# Cronjob everyday at 0'o clock
# crontab -e