Skip to content

Instantly share code, notes, and snippets.

@tknv
tknv / rake.rb
Created April 19, 2011 14:40
rake.rb
# rake.rb
# setup >(rake your_task pc=a_one_of_sacrifice p=where_to_agony) 1> errIO.txt
task :hell_grinder do
begin
ruby "death_test.rb "
rescue
p "ring ring ring..."
ruby "death_agony.rb " + ENV['pc'] + " " + ENV['p']
end
end
@tknv
tknv / mooding.rb
Created April 19, 2011 14:45
mooding.rb
#! ruby -Ku
# mooding.rb
require 'rubygems'
require 'win32ole'
require 'twitter'
require 'kconv'
$KCODE = 'UTF8'
@oTwitter = Twitter::Client.new
% mutt (enter)
Then when see mutt,Type 'c'
#####Starting Interactive with mutt########
Open mailbox ('?') for list):imaps://imap.gmail.com:993(enter)
your account or id:[email protected](enter)
Passwd:YoursPasswd(enter)
$label_url = "http://www.blogger.com/feeds/#{$userID}/blogs/#{$blogID}?alt=json-in-script&callback=listLabels"
class BlogLabels
def get_labels
result = URLFetch.get($label_url)
result_headless = result.gsub("listLabels(",'')
pure_result = result_headless.gsub(");",'')
JSON.parse(pure_result)['entry']['category']
end
response = URLFetch.get($label_url)
result = response.to_s
result_headless = result.gsub("listLabels(",'')
pure_result = result_headless.gsub(");",'')
json_to_yaml = YAML::load(pure_result)['entry']['category']
@tknv
tknv / gist:1004435
Created June 2, 2011 13:36
Debian sarge 2011
We couldn’t find that file to show.
@tknv
tknv / gist:1005917
Created June 3, 2011 05:34
build openswan userland tool
cd some/src/openswan-2.4.15
make KERNELSRC=/usr/src/kernel-source<yo linux> programs module
make KERNELSRC=/usr/src/kernel-source<yo linux> install minstall
@tknv
tknv / gist:1005924
Created June 3, 2011 05:40
patch kernel,build install
cd /usr/src
wget http://www.openswan.org/download/openswan-2.4.15.tar.gz
wget http://www.openswan.org/download/openswan-2.4.15.kernel-2.4-klips.patch.gz
tar -xvjf kernel-source<yo linux>
cd kernel-source<yo linux>
cp -r ../kernel-headers-<yo linux>/* .
patch -p1 < some/patch/openswan-2.4.15.kernel-2.4-klips.patch
make oldconfig or make menuconfig
make-kpkg clean
make-kpkg --revision klips.rc03 kernel-image modules_image
@tknv
tknv / gist:1006074
Created June 3, 2011 08:56
yaird for make initrd
cd /tmp
wget http://downloads.howtoforge.com/files/yaird_0.0.12-8bpo1_i386.deb
dpkg -i yaird_0.0.12-8bpo1_i386.deb
@tknv
tknv / include_lvm_utils.sh
Created June 3, 2011 18:59
initrd for LVM2 Use
#!/bin/bash -xv
rm -f ${INITRDDIR}/sbin/{vgscan,vgchange}
cp {,${INITRDDIR}}/sbin/lvmiopversion
for FILE in /lib/lvm-10/*; do
cp ${FILE} ${INITRDDIR}/${FILE}
ln -s lvmiopversion ${INITRDDIR}/sbin/$(basename ${FILE})
done