Skip to content

Instantly share code, notes, and snippets.

View akwiatkowski's full-sized avatar

Aleksander Kwiatkowski akwiatkowski

View GitHub Profile
url = "http://blitzortung.net/Images/image_b_pl.png"
ref = "http://blitzortung.net"
agent = "Internet Explorer 8.0"
interval = 10*60
sleep_interval = 20
next_download_t = Time.now.to_i
Dir.mkdir('data') unless File.exists?('data')
loop do
@akwiatkowski
akwiatkowski / make_it_so.rb
Created May 26, 2012 21:09
graphs for wind turbine
data = Array.new
f = File.new('power_calculator.txt')
f.each_line do |l|
if l =~ /(\d*);(\d*);(\d*\.?\d*);(\d*\.?\d*)/
data << {
time_from: $1.to_i,
time_to: $2.to_i,
energy: $3.to_f,
utilization: $4.to_f,
@akwiatkowski
akwiatkowski / xorg.conf
Created April 19, 2012 08:37
vostro 3555 xorg.conf - working skype
Section "ServerLayout"
Identifier "aticonfig Layout"
Screen 0 "aticonfig-Screen[0]-0" 0 0
EndSection
Section "Module"
EndSection
Section "Monitor"
Identifier "aticonfig-Monitor[0]-0"
@akwiatkowski
akwiatkowski / rubywrap.sh
Created April 17, 2012 13:02 — forked from alexpc/rubywrap.sh
Small wrapper for Ruby scripts running on RVM Single-User installations
#!/bin/bash
# Change those for valid ones
HOMEDIR=/home/yourlogin
RUBYVER="1.9.2-p318"
# Adding to $PATH paths for rvm and ruby executables
PATH=$PATH:$HOMEDIR/.rvm/bin:$HOMEDIR/.rvm/rubies/ruby-$RUBYVER/bin/
# Creating variable containing path to installed gems
RUBYLIB=$HOMEDIR/.rvm/gems/ruby-$RUBYVER/gems/:$HOMEDIR/.rvm/gems/ruby-$RUBYVER@global/gems/
@akwiatkowski
akwiatkowski / asound.conf
Created January 15, 2012 13:40
Dell Vostro 3555 linux asound.conf
#pcm.!default {
#type hw
#card 1
#}
ctl.!default {
type hw
card 1
}
@akwiatkowski
akwiatkowski / co_ja_kodze.rb
Created January 13, 2012 09:37
Co ja kodze
=begin
.',,,.
...,,,,,.
..'',;;;:;'.
.,,,;;,,,;:c,'
... .,;,;:;,,,,;:c;,.
;c:;,'.... ..,:lc:::::;,,,,,;c:'.
.;'.'''...','. ..;coddo:ccc:::;,,,,;:c:'.
.'',''...',,'''.. ..''... ...;coxxxxoc:llc:::;;;;;::cl;.
.';;,'....',,;,,,,,.... ....';;;:oxxxxddol:,,:::c::coxkOOdlclollc::;;;;;;;;::'.
@akwiatkowski
akwiatkowski / cleaner.rb
Created December 27, 2011 09:12
script for downloading shots from webcams
require 'digest/md5'
def clean_directory(d)
path = File.join('pix', d)
to_delete = Array.new
files = Array.new
Dir.new(path).each do |f|
if not File.directory? File.join('pix', d, f)
file_path = File.join(path, f)