Skip to content

Instantly share code, notes, and snippets.

View pce's full-sized avatar

Patrick C. Engel pce

  • UTC++
View GitHub Profile
#!/usr/bin/env bash
USAGE="$0 <arg1>"
if [ $# -eq 0 ] ; then
echo $USAGE
exit 1
fi
@pce
pce / awesome_debian.md
Last active December 14, 2015 03:28
my awesome debian

Create a bootable USB Stick to install debian

In the Example is /dev/sdb the unmounted usb stick.

$ dd if=debian-testing-i386-netinst.iso of=/dev/sdb
516096+0 records in
516096+0 records out
264241152 bytes (264 MB) copied, 92.3948 s, 2.9 MB/s
@pce
pce / funterminal.js
Last active December 14, 2015 04:59
"use strict";
function trace(s) {
if (typeof console != "undefined") {console.log(s);}
}
var TerminalHistory = function () {
this.cmd = [];
this.cmdIndex = 0;
@pce
pce / drawarea.c
Created March 11, 2013 13:19
gcc -Wall drawarea.c -o drawarea `pkg-config --cflags --libs gtk+-2.0`
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
static gboolean button_pressed (GtkWidget*, GdkEventButton*, GArray*);
static gboolean motion_notify (GtkWidget*, GdkEventMotion*, GPtrArray*);
static gboolean key_pressed (GtkWidget*, GdkEventKey*, GPtrArray*);
static gboolean expose_event (GtkWidget*, GdkEventExpose*, GArray*);
static gboolean ui_draw_grid (GtkWidget *area);
static gboolean ui_draw_boxes (GtkWidget *area);
static gboolean ui_redraw (GtkWidget *area, GArray *steparray);
@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
# ~/.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 / space-checker
Created January 21, 2014 12:20
/usr/local/bin/space-checker
#!/bin/bash
# . .:free space checker:.
# -o-
# ' .-. .
# __/ @_\_ . * -o-
# (________) '
#
# * |
# . --o--
@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"
#!/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 / 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