Skip to content

Instantly share code, notes, and snippets.

View abonec's full-sized avatar

Alexander abonec

  • Russian, Moscow
View GitHub Profile
def iterate_over_pages pattern
page = 1
loop do
url = pattern.gsub(/%page%/, page.to_s)
break unless yield url, page
page += 1
end
end
iterate_over_pages("http://leplay.com.ua/category/pic/page/%page%/") do |url, page|
+---------------------------------------------------------+
|---------------------------------------------------------|
+---------------------------------------------------------+
| | |
| | |
| | |
| | |
| | |
| | |
| | |
#!/usr/bin/env ruby
require "openssl"
class BF < Struct.new(:key, :pad_with_spaces)
def encrypt(str)
cipher = OpenSSL::Cipher.new('bf-ecb').encrypt
if pad_with_spaces
str += " " until str.bytesize % 8 == 0
cipher.padding = 0
@abonec
abonec / port_forwarding.conf
Created March 10, 2014 13:09
Port forwarding for upstart via autossh and ssh
description "autossh daemon"
start on net-device-up IFACE=eth0
stop on runlevel [01S6]
respawn
respawn limit 5 60 # respawn max 5 times in 60 seconds
script
export AUTOSSH_PIDFILE=/var/run/autossh.pid
abonec@abonec-System-Product-Name:~/vim$ make
Starting make in the src directory.
If there are problems, cd to the src directory and run make there
cd src && make first
make[1]: Entering directory `/home/abonec/vim/src'
mkdir objects
CC="gcc -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pixman-1 " srcdir=. sh ./osdef.sh
gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pixman-1 -