Skip to content

Instantly share code, notes, and snippets.

View chluehr's full-sized avatar

Christoph Lühr chluehr

View GitHub Profile
@chluehr
chluehr / Passwordless SSH Login
Created August 17, 2010 08:33
Passwordless SSH Login
Passwordless SSH Login
=========================
On the client
* generate a RSA keypair
* copy the *.pub part to the server, add it to ~/.ssh/authorized_keys
* modify your /etc/ssh/ssh_config for keepalive (30 sec. is very short - only if you get "broken pipe" errors):
ServerAliveInterval 30
@chluehr
chluehr / h264 mp3
Created September 1, 2010 17:29
encode flv/h264/mp3
mencoder -mc 0 -noskip -o /tmp/test.flv test.mov -ovc x264 -x264encopts bitrate=300 -vf scale=248:204 -oac mp3lame -lavcopts acodec=mp3:abitrate=56
@chluehr
chluehr / port_forwarding.sh
Created September 10, 2010 13:52
SSH Port Forwarding Setup
# example: Create a forward from localhost:8080 to heise.de:80
DEST_HOST=heise.de
DEST_PORT=80
LOCAL_PORT=8080
ssh $DEST_HOST -L $LOCAL_PORT:localhost:$DEST_PORT
@chluehr
chluehr / count_unique_lines.sh
Created September 15, 2010 17:24
Count number of unique lines in a file
#!/bin/sh
# sample.csv contains: <id>;<data> , e.g. 33;fooooo
# script counts how many lines with the same id exist, cnt DESC
cut -f1 -d\; sample.csv | uniq -c -d | sort -n -r
@chluehr
chluehr / oqgraph_notes.md
Created November 13, 2010 15:57
How to setup MariaDB w/ OQGraph Plugin
  • Download all from: MariaDB deb package repository

  • install packages:

    dpkg --install libmariadbclient16_5.2.3-mariadb87_amd64.deb \
    libmysqlclient16_5.2.3-mariadb87_amd64.deb \
    mariadb-client_5.2.3-mariadb87_all.deb  \
    mariadb-client-5.2_5.2.3-mariadb87_amd64.deb  \
    mariadb-server_5.2.3-mariadb87_all.deb  \
    

mariadb-server-5.2_5.2.3-mariadb87_amd64.deb \

@chluehr
chluehr / forkbomb.sh
Created November 27, 2010 10:55
Shell Fork Bomb - AFAIK: (c) 2002 Jaromil
#!/bin/sh
:(){ :|:& };:
@chluehr
chluehr / live-http-headers.pl
Created December 14, 2010 15:02
Ethernet scan for http requests (headers)
#!/usr/bin/perl -w
use strict;
use lib 'lib';
use Class::Accessor;
use Net::Pcap;
use Sniffer::HTTP;
use Data::Dumper;
=head1 NAME
@chluehr
chluehr / switch_twinview.sh
Created January 27, 2011 08:55
Gnome Panel Conf. Switcher
#!/bin/bash
# from: https://answers.launchpad.net/ubuntu/+source/gnome-panel/+question/8152
# Cristian Măgherușan-Stanciu
if [[ "x$1" == "xon" ]]
then
echo "Turning on VGA"
xrandr --output VGA --left-of LVDS --auto
echo "Moving panel to second display"
gconftool-2 --set "/apps/panel/toplevels/top_panel_screen0/monitor" --type integer "1"
@chluehr
chluehr / lighttpd_sample.conf
Created February 8, 2011 12:28
A space to keep notes about lighttpd (lighty) config options
# only for 1.4.24 and above!
#
server.modules += ( "mod_rewrite" )
url.rewrite-if-not-file = (
"^/events/(.*)/$" => "/events/$1/index.php"
)
# other solution: mod_magnet
server.modules += ( "mod_magnet" )
magnet.attract-physical-path-to = ( "/etc/lighttpd/rewrite.lua" )
@chluehr
chluehr / solr_range_unset.txt
Created March 23, 2011 18:01
Solr filter query to find all documents where a field value is EITHER IN a given range OR not set at all.
fq:-(-age:[18 TO 60] AND age:[* TO *])