Skip to content

Instantly share code, notes, and snippets.

@nekoya
nekoya / decrypt.py
Created March 5, 2013 07:20
Perl Crypy::CBC (Blowfish) -> Python Crypto
import base64
from Crypto.Cipher import Blowfish
from binascii import unhexlify
from struct import pack
key = unhexlify('144a6b229633360207ff9c79016fc49426f1814727b663bc39df05df9a1892073e2812df9492c1e952aac68d1ddfefba635d3a33aba21535') # "thisiskey"
iv = '123abc45'
def enc(str):
@nekoya
nekoya / sqlite.md
Created February 15, 2013 06:40
sqlite <-> mysql

sqliteでどうすればmysqlの〇〇が出来るのか

show tables

.tables

desc {table}

@nekoya
nekoya / kernel-ml.patch
Created December 28, 2012 07:04
Hardware clock patch for kernel-ml http://elrepo.org/tiki/kernel-lt
--- /etc/rc.sysinit 2012-02-22 23:47:49.000000000 +0900
+++ rc.sysinit 2012-12-28 15:36:17.000000000 +0900
@@ -271,2 +271,15 @@
+### ELREPO: See if the RTC driver is built-in, otherwise load it
+if [ ! -f /proc/driver/rtc ]; then
+ action $"Loading rtc_cmos driver: " /sbin/modprobe rtc_cmos
+fi
+
+### ELREPO: Make the newer device nodes to accomodate hwclock
@nekoya
nekoya / setup_r8168.sh
Created December 7, 2012 09:24
Setup r8168 NIC driver
#!/bin/bash
cd /usr/local/src
wget http://r8168.googlecode.com/files/r8168-8.032.00.tar.bz2
tar -jxvf r8168-8.032.00.tar.bz2
cd r8168-8.032.00
make clean modules
make modules
make install
@nekoya
nekoya / MyApp_Web_Request.pm
Created October 19, 2012 01:26
Mouse/URI::Escape::XS based on Plack::Request
package MyApp::Web::Request;
use Mouse;
use MouseX::Foreign qw(Plack::Request);
use URI::Escape::XS qw/uri_unescape/;
use Time::Piece;
has 'env' => ( is => 'rw', isa => 'HashRef', required => 1 );
has 'now' => ( is => 'rw', isa => 'Time::Piece', default => sub { localtime } );
@nekoya
nekoya / network_nic_r8168.md
Created September 24, 2012 10:03
RealTekのNICドライバ問題(r8169→r8168への切り替え)
@nekoya
nekoya / server_assemble.md
Created September 19, 2012 11:23
Kauli server assembling

Kauli自作サーバ組み立てマニュアル

''2012年1月26日時点''での構築手順を記します。M/Bは第3世代サーバを使用する場合です。世代交代したら適宜更新が必要。

完成形

complete
complete posted by (C)nekoya

準備物

@nekoya
nekoya / ssh-start.sh
Created September 19, 2012 02:10
ssh-start
#!/bin/sh
ssh-agent | grep -v echo > "${HOME}/.ssh/agent-env"
. "${HOME}/.ssh/agent-env"
ssh-add
echo "please type:"
echo ". ~/.ssh/agent-env"
@nekoya
nekoya / rbenv.md
Created September 17, 2012 15:45
wiki/rbenv

ruby環境構築

rbenv下準備

今のところcapistranoを使うだけなのだけど、ある時期からOS標準のRubyでは動かなくなったので面倒。

rvmを使うとCentOS5系のzshだと使えないという問題が出た。

どうにも不便なので、rbenvを試してみる。

@nekoya
nekoya / daemontools.md
Created September 17, 2012 15:37
daemontools