Skip to content

Instantly share code, notes, and snippets.

Ido Kanner ik5

  • :::1
Block or report user

Report or block ik5

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View create_blog.sql
CREATE TABLE posts (
id BIGINT NOT NULL PRIMARY KEY,
name VARCHAR(255),
title VARCHAR(255),
content VARCHAR(255),
timestamps timestamp
);
CREATE GENERATOR POSTS_SEQ;
@ik5
ik5 / daemon.rb
Created Jun 22, 2010
a quick and dirty jruby daemon based on basic_daemon
View daemon.rb
#!/usr/bin/env jruby
#
#
require 'rubygems'
require 'spoon'
EXEC = '/tmp/exec.rb'
PID_PATH = '/tmp/exec.pid'
WORK_PATH = '/tmp/'
View file_content_type.rb
#!/usr/bin/env ruby
# gem install ruby-filemagic
# please note that this program works only on Unix based systems and Linux.
# It uses the "file command" library (and information) in a native code to validate file content (rather then extension).
# Important note: It only read the *header* of the files rather the whole, content so we might still have malicious content ... :(
require 'rubygems'
require 'filemagic'
@ik5
ik5 / test_of_labels.pas
Created Sep 7, 2010
A test in Pascal (FPC) for some low level. I'm looking to know how to translate it into C and _asm
View test_of_labels.pas
{$IFDEF FPC}{$GOTO ON}{$asmmode att}{$ENDIF}
program asm_code;
label a_label;
label _end;
var i : integer;
begin
writeln('a_label address: ', HexStr(PtrUInt(@a_label), 32));
i := -10;
@ik5
ik5 / cli output
Created May 25, 2011
Something wrong with pacman
View cli output
ldconfig: File /usr/lib/libsolidcontrolnm09ifaces.so.4.6.0 is empty, not checked.
ldconfig: File /usr/lib/libknmservice.so is empty, not checked.
ldconfig: File /usr/lib/libsolidcontrolnm09.so.4.6.0 is empty, not checked.
ldconfig: File /usr/lib/libknmservice.so.4 is empty, not checked.
ldconfig: File /usr/lib/libsolidcontrolnm09.so is empty, not checked.
ldconfig: File /usr/lib/libknmservice.so.4.6.0 is empty, not checked.
ldconfig: File /usr/lib/libsolidcontrolnm09.so.4 is empty, not checked.
ldconfig: File /usr/lib/libknminternals.so.4 is empty, not checked.
ldconfig: File /usr/lib/libsolidcontrolfuture.so is empty, not checked.
ldconfig: File /usr/lib/libknm_nm.so is empty, not checked.
@ik5
ik5 / watchdog.rb
Created Nov 16, 2011
A watchdog for ahn v0.1
View watchdog.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'mail' # gem install mail
require 'fileutils' # for 1.8
BASE_PATH = '' # Place your path here for ahn
DEAMON = '' # Place the deamon path and name here
def send_email
@ik5
ik5 / archlinux signing
Created Jan 24, 2012
archlinux package signing - FAILS !
View archlinux signing
error: freeglut: signature from "Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>" is unknown trust
error: iproute2: signature from "Ionut Biru <ibiru@archlinux.org>" is unknown trust
error: lib32-kmod: signature from "Laurent Carlier <lordheavym@gmail.com>" is unknown trust
error: lib32-udev: signature from "Laurent Carlier <lordheavym@gmail.com>" is unknown trust
error: libgee: signature from "Ionut Biru <ibiru@archlinux.org>" is unknown trust
error: linux: signature from "Pierre Schmitz <pierre@archlinux.de>" is unknown trust
error: linux-headers: signature from "Pierre Schmitz <pierre@archlinux.de>" is unknown trust
error: sdl: signature from "Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>" is unknown trust
error: failed to commit transaction (invalid or corrupted package (PGP signature))
Errors occurred, no packages were upgraded.
@ik5
ik5 / nested multibulk
Created Feb 8, 2012
Redis nested multibulk
View nested multibulk
1) 1) (integer) 0
2) (integer) 1328734844
3) (integer) 14
4) 1) "CONFIG"
2) "SET"
3) "slowlog-log-slower-than"
4) "1"
@ik5
ik5 / is_internal_ip.rb
Created Mar 6, 2012
function to detect if an IPv4 address should be considered local
View is_internal_ip.rb
def internal_ip?(s)
s =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/
# based on http://www.ietf.org/rfc/rfc3330.txt
return case $1
when '0', '10', '127'
true
when '169'
# link local Zero Conf
(('16'..'31').include? $2) || ($2.eql? '254')
@ik5
ik5 / dynamic_method.pas
Created Jun 18, 2012
How dynamically execute a method in Object Pascal Class
View dynamic_method.pas
{$mode objfpc}{$M+}
program test;
type
TMyClass = class
procedure SayHi;
end;
procedure TMyClass.SayHi;
begin
You can’t perform that action at this time.