Skip to content

Instantly share code, notes, and snippets.

View 5v3n's full-sized avatar

Sven Kräuter 5v3n

View GitHub Profile
// Controlling the modulation of an LED using a potentiometer (variable resistor)
int ledpin = 3; // light connected to digital pin 3
int potpin = A3; // analog pin used to connect the potentiometer
int sensorValue, outputValue; // variables to read the values
void setup()
{
// initialize serial communications at 9600 bps:
Serial.begin(9600);
@5v3n
5v3n / spec_helper.rb
Created April 13, 2011 15:39
in order to make spork reload routes & any rb file in the app folder:
Spork.each_run do
load "#{Rails.root}/config/routes.rb"
Dir["#{Rails.root}/app/**/*.rb"].each { |f| load f }
end
@5v3n
5v3n / Gemfile
Created May 4, 2011 06:29
Makeshift fix for tweetlr issue #2 - missing curb dependency
source :rubygems
gem 'curb'
gem 'tweetlr'
@5v3n
5v3n / Gemfile
Created September 30, 2011 12:33
supporting oirukan ;-)
source :rubygems
gem 'oirukan', :git => "git://github.com/filtercake/oirukan.git"
@5v3n
5v3n / README.MD
Created December 30, 2011 21:11 — forked from wynst/README.MD
A Thor Task to unwatch *all* Github watched repositories (excluding owned) and optionally export to delicious.

A Thor Task to unwatch all Github watched repositories (excluding owned) and optionally export to delicious.

Sorry Github, for I have sinned. I use the Watch feature as a bookmarker.

Install required gems:

 `gem install thor rest-client`

Install this script in Thor:

## The quick-and-nasty CVE-2013-0156 Heroku inspector!
## Originally brought to you by @elliottkember with changes by @markpundsack @ Heroku
## Download and run using:
## ruby heroku-CVE-2013-0156.rb
`heroku list`.split("\n").each do |app|
app = app.strip
puts "checking #{app}"
@5v3n
5v3n / load test faye server.js
Last active December 20, 2015 16:59
load test faye server. connect 200 concurrent clients that subscribe to a channel.
var faye = require('faye');
var clients = [], client;
var responseCount = 0;
for (var i = 0; i < 200; i++) {
client = new faye.Client('http://HOSTNAME/faye');
client.subscribe('/status/realtime', function(message) {
var time = new Date().getTime();
responseCount++;
console.log(responseCount);
@5v3n
5v3n / ruby on linino
Created February 15, 2014 00:25
Fix broken ruby on Linino - using precompiled ruby packages. Work in Progress...
- Download and extract https://docs.google.com/file/d/0B54xzz44RpW6YlpaQXV3M2hTQVk to /tmp
# cd tmp
- ruby core
# opkg install libyaml libdb47 libruby_1.9.3-p429-1_ar71xx.ipk ruby-core_1.9.3-p429-1_ar71xx.ipk ruby_1.9.3-p429-1_ar71xx.ipk
# ruby -v
ruby 1.9.3p429 (2013-05-15 revision 40747) [mips-linux]
@5v3n
5v3n / ybeacon
Last active August 29, 2015 13:56
Bluetooth for the YUN for devices not listed automatically via hciconfig
root@gretelomat:~# lsusb
Bus 001 Device 002: ID 058f:6254 Alcor Micro Corp. USB Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 0b05:17cb ASUSTek Computer, Inc.
Bus 001 Device 004: ID 058f:6366 Alcor Micro Corp. Multi Flash Reader
root@gretelomat:~# echo 0b05 17cb > /sys/bus/usb/drivers/btusb/new_id
root@gretelomat:~# hciconfig
hci0: Type: BR/EDR Bus: USB
BD Address: 00:02:72:C9:0E:AA ACL MTU: 1021:8 SCO MTU: 64:1
DOWN
sudo apt-get install libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev
sudo mkdir bluez
cd bluez
sudo wget www.kernel.org/pub/linux/bluetooth/bluez-5.11.tar.xz
sudo unxz bluez-5.11.tar.xz
sudo tar xvf bluez-5.11.tar
cd bluez-5.11
sudo ./configure --disable-systemd
sudo make && sudo make install