Skip to content

Instantly share code, notes, and snippets.

View jedisct1's full-sized avatar

Frank Denis jedisct1

View GitHub Profile
Nov 13 21:18:39 cell /bsd: wd0a: uncorrectable data error reading fsbn 272768 of 272768-272831 (wd0 bn 272831; cn 33 tn 106 sn 41), retrying
Nov 13 21:20:04 cell /bsd: wd0a: uncorrectable data error reading fsbn 272768 of 272768-272831 (wd0 bn 272831; cn 33 tn 106 sn 41), retrying
Nov 13 21:20:04 cell /bsd: wd0a: uncorrectable data error reading fsbn 272768 of 272768-272831 (wd0 bn 272831; cn 33 tn 106 sn 41), retrying
Nov 13 21:20:05 cell /bsd: wd0a: uncorrectable data error reading fsbn 272768 of 272768-272831 (wd0 bn 272831; cn 33 tn 106 sn 41), retrying
Nov 13 21:20:05 cell /bsd: wd0a: uncorrectable data error reading fsbn 272788 of 272768-272831 (wd0 bn 272851; cn 33 tn 106 sn 61), retrying
Nov 13 21:20:05 cell /bsd: wd0a: uncorrectable data error reading fsbn 272788 of 272768-272831 (wd0 bn 272851; cn 33 tn 106 sn 61)
Nov 13 21:20:05 cell /bsd: wd0a: uncorrectable data error reading fsbn 272768 of 272768-272799 (wd0 bn 272831; cn 33 tn 106 sn 41), retrying
Nov 13 21:20:06 cell /bsd: wd0a: uncorrectable
#import <UIKit/UIKit.h>
#import "LDMAdit.h"
@interface SimpleAdView : UIView {
NSString *wantedPageId;
LDMAdit *ldmAdit;
}
- (void) switchToEstatGroup: (NSString *) estatGroup andPage: (NSString *) estatPage;
@jedisct1
jedisct1 / gist:831540
Created February 17, 2011 11:32
OpenBSD dmesg on Dedibox PRO R410
OpenBSD 4.9 (GENERIC.MP) #807: Wed Feb 16 13:22:14 MST 2011
todd@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 3475476480 (3314MB)
avail mem = 3368943616 (3212MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xcf49c000 (78 entries)
bios0: vendor Dell Inc. version "1.5.3" date 10/22/2010
bios0: Dell Inc. PowerEdge R410
acpi0 at bios0: rev 2
acpi0: sleep states S0 S4 S5
@jedisct1
jedisct1 / Adku puzzle.erl
Created March 7, 2011 15:48
Adku puzzle solver in Erlang
-module(adku).
-export([adku/1]).
adku({ Width, Height }) -> adku({ Width - 1, Height - 1 }, [ ], { 0, 0 }).
adku({ Max_X, Max_Y } = Borders, Queue, Pos) ->
InList = lists:member(Pos, Queue),
if InList -> 0;
Pos =:= { Max_X, Max_Y } -> 1;
true ->
@jedisct1
jedisct1 / Twitter OAuth2
Created March 15, 2011 13:01
Twitter API with OAuth2
Browse:
https://oauth.twitter.com/2/authorize?oauth_callback_url=http://www.example.com/&oauth_mode=flow_web_client&oauth_client_identifier=7ynojZQ3uVE2DifWftbS3w
After authentication, user gets redirected to:
http://www.example.com/#oauth_access_token=RnEJAQAAAABpYH8NAAAAAGKSBQAAAAAAr9G2hLrnXaznri8LlSIaR0HuNBI=HLx1r47oqpobPncAm9DNeRCdySaMqoTKJcCLwnhIP&oauth_bridge_code=2wxWDd3IIZ0UW1y4oFpioWfbzTeaAlSGoJk5L6qMpGQ
...Use the API:
@jedisct1
jedisct1 / Reduce, Kaffeine, NodeJS and Redis
Created March 22, 2011 08:35
Tiny recommendation engine using Map/Reduce, Kaffeine, NodeJS and Redis
sys = require "sys";
http = require "http";
url = require "url";
connect = require "connect";
redis = require "redis";
hashRing = require "hash_ring";
Sharding = {
servers = { "127.0.0.1 10000 6378": 1 };
ring = new hashRing.HashRing servers;
@jedisct1
jedisct1 / Serializing hashes and arrays
Created March 31, 2011 11:29
msgpack vs json vs igbinary vs php serialize
* Results
ruby json: 19,777,781 bytes
ruby msgpack: 14,757,439 bytes
php serialize(): 33,777,792 bytes
php igbinary: 18,757,571 bytes
php json_encode: 19,777,781 bytes
msgpack vs json (MRI 1.9.2) speed:
#if MYSQL_VERSION_ID < 40100 || defined(USE_OLD_MYSQL_SCRAMBLING)
unsigned long hash_res[2];
char scrambled_password[MYSQL_CRYPT_LEN];
# if MYSQL_VERSION_ID < 40100
hash_password(hash_res, password);
# else
hash_password(hash_res, password, strlen(password));
# endif
snprintf(scrambled_password, sizeof scrambled_password, "%08lx%08lx",
@jedisct1
jedisct1 / pig 0.6 + json with elephant bird
Created April 5, 2011 12:25
Just a personal cheatsheet on pig+json
git clone https://github.com/kevinweil/elephant-bird.git
ant nonothing
cp lib/google-collect*jar lib/json-simple*jar /tmp/x
cd build/classes
jar -cf /tmp/x/elephant-bird.jar com
REGISTER google-collect-1.0.jar;
REGISTER json-simple-1.1.jar;
REGISTER elephant-bird.jar;
@jedisct1
jedisct1 / Greplin challenge 3.rb
Created April 5, 2011 18:17
My attempt at solving the Greplin puzzle #3
SET = [ 3, 4, 9, 14, 15, 19, 28, 37, 47, 50, 54, 56, 59, 61, 70, 73, 78, 81, 92, 95, 97, 99 ]
def find_with(set, target, expr = [ ], res = [ ])
lowset = set.select { |e| e <= target }
lowset.each do |n|
expr2 = expr + [n]
if n == target
res << "#{expr2.sort.join(' + ')} = #{expr2.inject(:+)}" unless expr.empty?
else
find_with(lowset - [n], target - n, expr2, res)