Skip to content

Instantly share code, notes, and snippets.

🐰
Gopher, Rubist, Phper, Now learning Rust, Linuxer, Vimer, Father of 2 girl

jinleileiking jinleileiking

🐰
Gopher, Rubist, Phper, Now learning Rust, Linuxer, Vimer, Father of 2 girl
View GitHub Profile
View tdes.rb
require 'lib/ruby-des'
class TDES
class << self
def en_des plain, key
ret = ''
blocks = plain.scan(/.{16}/)
blocks.each do |block|
ret = ret + en_des_block(block, key)
end
View gist:547099
class Subject < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name
acts_as_tree
class << self
@@all_subjects =[]
def get_all_childrens_recursive parent
return if parent == nil
@jinleileiking
jinleileiking / crc.c
Created May 17, 2012
Testing f**king CRC
View crc.c
typedef unsigned short WORD16;
typedef unsigned long WORD32;
typedef unsigned char BYTE;
#define NULL 0
#define SWAP16(A) (((A)>>8) | (((A)&0x00ff) <<8))
/* CRC16表 */
const WORD16 crctab16[] ={
// X16+X12+X5+1 余式表
@jinleileiking
jinleileiking / GentooInstall.sh
Last active Apr 23, 2019
Gentoo Install Script with Rescue CD
View GentooInstall.sh
fdisk /dev/sda
# n
# 1
# +32M
# n
# 2
# +512M
# n
@jinleileiking
jinleileiking / sqlite.rb
Created May 17, 2012
Sqlite using ruby
View sqlite.rb
require 'rubygems'
require 'sqlite3'
db = SQLite3::Database.new( "ec00" )
begin
puts "dropping tables....."
db.execute("drop table member;")
db.execute("drop table rule;")
puts "done...."
View gist:2717471
交叉编译configure
CC=/eldk/usr/bin/ppc_8xx-gcc ./configure --host=ppc-linux --prefix=/home/jinlei/iconv_static_lib_ppc
linux和win共享文件夹
mkdir /mnt/leiking
mount -t smbfs -o username=Administrator,iocharset=GB2312 -l //10.86.10.48/Codes /mnt/leiking/
mkdir /mnt/leiking/6204
mount -t smbfs -o username=Administrator,iocharset=GB2312 -l //10.86.10.48/Code /mnt/leiking/6204
View USB.md
Device  Phase  Data                                                                                                    Description       Cmd.Phase.Ofs(rep)
------  -----  ------------------------------------------------------------------------------------------------------  ----------------  ------------------
  22    CDB    00 00 00 00  00 00                                                                                      TEST UNIT READY          1.1.0        
  20.1  DO     55 53 42 43  b8 dd 17 87  00 00 00 00  00 00 06 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00     USBC............         2.1.0        
  20.1  DI     55 53 42 53  b8 dd 17 87  00 00 00 00  00                                                               USBS.........            3.1.0        

55 53 42 43 b8 dd 17 87 00 00 00 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

View gist:3028795
app-admin/hddtemp
app-admin/sudo
app-admin/syslog-ng
app-arch/unrar
app-editors/gvim
app-emulation/virtualbox-guest-additions
app-i18n/fcitx
app-i18n/fcitx-cloudpinyin
app-i18n/fcitx-configtool
app-misc/colordiff
@jinleileiking
jinleileiking / dm370.md
Created Jul 3, 2012
dm370 将xloader,uboot,kernel,fs移到nand
View dm370.md

flash x-loader & uboot to nandflash.

from TMS320DM3730_Software_Developers_Guide.pdf:

How to create an SD card
This section explained the procedure required for creating SD card image for DM3730 and the steps has been
verified on 2GB and 4GB SD cards.
1.  Plug an SD card on Linux host machine.
2.  Run dmesg command to check the device node. Triple check this to ensure you do not damage your HDD
View gist:3045021

system to nand

mlo & uboot from sdcard

mmc rescan ; nand erase 0x0 0x280000 ; nandecc hw 2; fatload mmc 0 0x81000000 MLO_nand; nand write 0x81000000 0x0 0x20000; nand write 0x81000000 0x20000 0x20000;

You can’t perform that action at this time.