Skip to content

Instantly share code, notes, and snippets.

View creaktive's full-sized avatar
👽
🛸

Stanislaw Pusep creaktive

👽
🛸
View GitHub Profile
@creaktive
creaktive / pdf-nopasswd.sh
Created January 16, 2011 14:12
gs -dSAFER -dBATCH -dNOPAUSE -r300 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=tiff24nc -sOutputFile=new.tif old.pdf Ghostscript unlock tools
gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sFONTPATH=xfonts;. -sPDFPassword= -dPDFSETTINGS=/prepress -dPassThroughJPEGImages=true -sOutputFile=new.pdf old.pdf
@creaktive
creaktive / perl-xpath-tidy.sh
Created January 16, 2011 14:14
Perl XPath tidy
perl -MHTML::TreeBuilder::XPath -0777 -e 'print HTML::TreeBuilder::XPath->new_from_content(<>)->as_XML_indented'
@creaktive
creaktive / backup.sh
Created January 16, 2011 14:16
rdiff-backup params
#!/bin/sh
BACKUP_PART=/backup
/sbin/mount ${BACKUP_PART}
/usr/local/bin/rdiff-backup --print-statistics --terminal-verbosity 5 \
--exclude ${BACKUP_PART} \
--exclude /db/ \
--exclude /tmp/ \
@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 / mp3-to-m4ab.sh
Created January 16, 2011 14:21
mp3 => m4a/m4b
find . -type f -print|perl -ne 'chomp;s%\.m4a$%%;s%^./%%;print"ffmpeg -i \"$_.mp3\" -acodec aac -map_meta_data outputfile:inputfile -strict experimental \"$_.m4a\"\n"' > batch.sh
@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 / 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 / extractor.pl
Created January 16, 2011 14:29
encodingless HTML text extractor
#!/usr/bin/perl
use strict;
# Para ter certeza absoluta de que nenhum warning de 'Wide character' escapou
use warnings 'all';
# Somente indica que este arquivo .pl está na codificação UTF-8!!!
use utf8;
# Ignora codificação de entrada
@creaktive
creaktive / gist:792158
Created January 23, 2011 15:50
Rescale & rotate 180° via MEncoder
mencoder -oac mp3lame -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -vf flip,mirror,scale=480:272 IMG_0021.MOV -o IMG_0021.avi