Skip to content

Instantly share code, notes, and snippets.

View dpavlin's full-sized avatar

Dobrica Pavlinušić dpavlin

View GitHub Profile
@warewolf
warewolf / gist:c185d17008dd1639138f
Created January 1, 2015 02:21
SMI USB flash drive controller identification page
# sg_raw -r 525 /dev/sg2 f0 04 00 00 00 00 00 00 00 00 00 01
>>> transport error: Host_status=0x03 [DID_TIME_OUT]
Driver_status=0x00 [DRIVER_OK, SUGGEST_OK]
SCSI Status: Good
Received 525 bytes of data:
00 02 00 43 30 4b 40 02 c0 17 22 22 30 4b 38 02 c0 ..C0K@...""0K8..
10 1a 22 22 30 4b 30 02 c0 1d 22 22 30 4b 29 02 c0 .""0K0...""0K)..
@dpavlin
dpavlin / audacity-labels.pl
Created August 12, 2010 18:31
Dump labels from Audacity into <li> with formatting
#!/usr/bin/perl
# usage:
# ./audacity-labels.pl 6-nosql-take-3.aup
use warnings;
use strict;
use XML::Simple;
use Data::Dump qw(dump);
@Meettya
Meettya / Author.pm
Created February 25, 2011 21:03
MojoX::Redis example
package NoticeBackend::Author;
use Mojo::Base 'Mojolicious::Controller';
use 5.12.0;
use warnings;
use utf8;
use MojoX::Redis;
my $redis = MojoX::Redis->new(server => '192.168.1.20:6379');
@guybrush
guybrush / nodeconf_2011.md
Created May 6, 2011 07:22
a list of slides from nodeconf 2011
@gdamjan
gdamjan / 3g
Created December 2, 2011 21:37
connect to 3G from command line (with pppd and chat)
# file: /etc/ppp/peers/3g
# usage: pppd call 3g
connect '/etc/ppp/peers/dial -V -Upublicinternet -T*99***1#'
user internet
password internet
noauth
usepeerdns
@jyio
jyio / Makefile
Created December 19, 2011 23:01
build the CyanogenMod 9 preview for NOOK Color
## Copyright (c) 2011 Jiang Yio, http://inportb.com/
##
## Permission is hereby granted, free of charge, to any person obtaining
## a copy of this software and associated documentation files (the
## "Software"), to deal in the Software without restriction, including
## without limitation the rights to use, copy, modify, merge, publish,
## distribute, sublicense, and/or sell copies of the Software, and to
## permit persons to whom the Software is furnished to do so, subject to
## the following conditions:
##
@chaosct
chaosct / soziframes.js
Created February 22, 2012 00:35
sozi frame generator using phantomjs
/*
soziframes.js : transforming sozi SVG animations
to a sequence of PNG images, so you can make
a proper video without capturing the screen.
author: Carles F. Julià < chaos.ct _AT_ gmail com >
You need phantomjs to run it!
*/
var page = require('webpage').create(),
@und3f
und3f / no-more-blues.pl
Created May 2, 2012 20:40
No more blues with internal speaker
use Audio::Beep; Audio::Beep->new->play(join ' ', <DATA>);
__DATA__
\bpm240
f2 a, d2. f4 e2 b2 d2.
e4 f2 bes cis2.
f4 e d8 f4 f6 e d a1
f'2 a,2 b d c4 e2
r4 e d c c4 bes2
r4 f e d d cis e c bes2. r4
@dpavlin
dpavlin / mysqldump-4-to-5-migration.pl
Created July 10, 2012 19:31
Migrate MySQL 4.0 dump to 5.5 format
#!/usr/bin/perl
use warnings;
use strict;
my $create_table = 0;
sub key {
my ($unique,$key,$name,$cols) = @_;
$name = "`$name`" if defined $name;
return " $unique$key $name (" . join(',', map {
@jbarrett
jbarrett / rssfs.pl
Created August 24, 2012 14:05
FUSE Module to read/mount a RSS feed
#!/usr/bin/env perl
# rssfs.pl
use strict;
use warnings;
use Date::Parse;
use Fuse;
use HTML::FormatText::WithLinks;