Skip to content

Instantly share code, notes, and snippets.

View halida's full-sized avatar

Halida halida

View GitHub Profile
@halida
halida / gist:2019392
Created March 12, 2012 02:44
my gemfile
source 'http://rubygems.org'
gem 'rails', '3.2.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :assets do
# gem 'sass-rails', " ~> 3.1.0"
gem 'sass-rails', git: "https://github.com/rails/sass-rails.git", :branch => '3-2-stable'
gem 'coffee-rails', " ~> 3.2.0"
@halida
halida / gist:2290229
Created April 3, 2012 07:45
test map speed
def timeit name
begins = Time.now
yield
ends = Time.now
puts "running: #{name}, spend time: #{ends - begins}"
end
class MyData
def initialize(value)
@value = value
@halida
halida / gist:2373297
Created April 13, 2012 03:07
rubinius test
$ make
time ruby test.rb
4999999950000000
5.20user 0.04system 0:05.25elapsed 99%CPU (0avgtext+0avgdata 119920maxresident)k
0inputs+0outputs (0major+12315minor)pagefaults 0swaps
rbx compile test.rb -o t.rbc
time rbx -e "Rubinius::CodeLoader.require_compiled 't'"
4999999950000000
5.20user 0.00system 0:05.22elapsed 99%CPU (0avgtext+0avgdata 121152maxresident)k
0inputs+0outputs (0major+12387minor)pagefaults 0swaps
@halida
halida / gist:2729866
Created May 19, 2012 07:25
ruby class machanism example 1
class Sth
def present
raise NotImplementedError
end
def log s
puts s
end
end
@halida
halida / gist:3130364
Created July 17, 2012 16:14
resque bug
class Outbox
@queue='v_redis'
def self.perform(userid,msgid)
$v_redis.set('ok',msgid+"*******")
get(userid,msgid)
end
def get(msg,msgid)
end
@halida
halida / slides.md
Last active December 15, 2015 08:09 — forked from greatghoul/slides.md

name: inverse layout: true class: center, middle, inverse

#EasyOJ [linjunhalida]

我们为什么要作另外一个OJ?


layout: false

@halida
halida / client.d
Last active December 15, 2015 22:00
import std.stdio;
import std.socket;
import std.string;
import std.conv;
import std.random;
import std.outbuffer;
import core.thread;
int main() {
auto s = new TcpSocket();
@halida
halida / gist:7177873
Created October 27, 2013 04:05
net-ssh issue
This file has been truncated, but you can view the full file.
11:58:24 write 0.000010 ruby
11:58:25 read 0.510431 W ruby
11:58:25 write 0.000010 ruby
11:58:25 ioctl 0.000027 W ruby
11:58:25 open lida/.rvm/gems/ruby-2.0.0-p247/gems/coderay-1.0.9/lib/coderay/tokens_proxy.rb 0.000036 ruby
11:58:25 fcntl 0.000002 ruby
11:58:25 fstat64 0.000004 ruby
11:58:25 fstat64

服务器创建后初始化

用root登陆,修改root密码:

passwd

创建用户