Skip to content

Instantly share code, notes, and snippets.

View creaktive's full-sized avatar
👽
🛸

Stanislaw Pusep creaktive

👽
🛸
View GitHub Profile
@creaktive
creaktive / gpsd-wrapper.pl
Created July 8, 2015 12:47
gpsd-wrapper.pl
#!/usr/bin/env perl
use strict;
use warnings qw(all);
use Data::Dumper;
use IPC::Run qw(start pump);
use JSON::XS;
use Net::GPSD3;
my $gpsd_host = '127.0.0.1';
@creaktive
creaktive / mysqldump2csv.pl
Last active August 29, 2015 14:27
convert MySQL dump to CSV
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
my $schema;
my $table;
while (my $line = <>) {
my @csv = ();
if ($line =~ m{^ CREATE \s+ TABLE \s+ `(?<table> \w+)`}ox) {
@creaktive
creaktive / .Xdefaults
Created January 15, 2011 20:43
urxvt config
! foreground/background
URxvt.background: #161616
URxvt.foreground: #B2B2B2
! black
URxvt.color0 : #000000
URxvt.color8 : #686868
! red
URxvt.color1 : #B21818
URxvt.color9 : #FF5454
! green
@creaktive
creaktive / magicmouse.sh
Created January 15, 2011 20:56
Apple Magic Mouse @ Ubuntu
#!/bin/sh
sudo hidd --connect C4:2C:03:99:6D:53
sleep 1
sudo bash -c 'echo Y > /sys/module/hid_magicmouse/parameters/scroll_acceleration'
sudo bash -c 'echo 40 > /sys/module/hid_magicmouse/parameters/scroll_speed'
ID=`xinput list --short | grep -i 'mouse' | cut -f2 | cut -c4-`
#xinput list-props $ID
xinput --set-prop $ID "Device Accel Adaptive Deceleration" 2.0
@creaktive
creaktive / .tmux.conf
Created January 15, 2011 20:41
tmux config
setw -g xterm-keys on
setw -g mode-mouse on
setw -g mode-keys vi
set -g mouse-select-pane on
set -g set-titles on
set -g history-limit 10000
set -g prefix C-a
bind-key C-a last-window
@creaktive
creaktive / ora.sh
Created January 16, 2011 14:25
Oracle error messages
perl '-F/\s*,\s*/' -lane 'BEGIN{$,="\t"};chomp;print @F[0,2] if $_ && !m%^/%' /home/stas/oracle/product/10.2.0/db_1/rdbms/mesg/oraus.msg
@creaktive
creaktive / hex2bin.pl
Created January 16, 2011 14:26
hex2bin
print(unpack"B*",pack("h*",$_))
@creaktive
creaktive / .htpasswd
Created January 16, 2011 14:19
Apache password
AuthUserFile /etc/apache2/htpasswd
AuthGroupFile /dev/null
AuthName "Senha"
AuthType Basic
require valid-user
order deny,allow
@creaktive
creaktive / rtmp2mp3.sh
Created January 16, 2011 14:24
leech MP3 stream via RTMP
rtmpdump --host 187.45.227.58 --app oflaDemo --playpath ci101c2fa90a4ac9a8123b8d26bf0ebd0e10.mp3 -o ci101c2fa90a4ac9a8123b8d26bf0ebd0e10.mp3
ffmpeg -i ci101c2fa90a4ac9a8123b8d26bf0ebd0e10.flv -f mp3 -vn -acodec copy ci101c2fa90a4ac9a8123b8d26bf0ebd0e10.mp3
@creaktive
creaktive / x.pl
Created January 16, 2011 13:57
JáCotei: prova X
($x,$y)=(1,1<<32);for(0..30){$_=unpack'B32',pack'N',($x<<=1)|($y>>=1);tr%01% J%;s%\s*$%\n%;print}