| (ebay) Intel Xeon CPU E5-2670 2.60GHz Eight-Core | 2 | $140 |
| (newegg) ASRock EP2C602-4L/D16 SSI EEB Server Motherboard | $310 | |
| (ebay) 128GB (16x8GB) DDR3 ECC Reg | $330 | |
| (newegg/ama) EVGA 650 GQ Power Supply | $80 | |
| (newegg/ama) Phanteks Enthoo Pro | $110 | |
| Corsair Hydro Series Liquid CPU Cooler H60 | 2 | $120 |
| HDDs | ||
| Total | $1,090 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'titleize' | |
| require 'colorize' | |
| Encoding.default_internal = Encoding::UTF_8 | |
| Encoding.default_external = Encoding::UTF_8 | |
| $dir = Rake.original_dir.encode(Encoding::UTF_8) | |
| Dir.chdir($dir) | |
| puts "Executing in (#{$dir})..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| input = [ | |
| [1,2,3], | |
| [2,3], | |
| [3,5], | |
| [10,15] | |
| ] | |
| # 二级引用 | |
| class Ref | |
| attr_accessor :obj |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From: msg7086 <i@7086.in> | |
| Date: Sun, 8 Apr 2018 22:22:22 -0400 | |
| Subject: [PATCH] Also try to set TLSv1.3 ciphers | |
| --- | |
| diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c | |
| index 88a6dbe..5ac0ec6 100644 | |
| --- a/src/event/ngx_event_openssl.c | |
| +++ b/src/event/ngx_event_openssl.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!ruby | |
| require 'rake' | |
| require 'json' | |
| require 'colorize' | |
| @db = File.expand_path '~/task.txt' | |
| @stop = File.expand_path '~/stop.txt' | |
| def load_task | |
| File.readlines(@db).map { |t| JSON.parse(t.chomp, :symbolize_names => true) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'rake' | |
| include FileUtils | |
| include Rake | |
| domain=ARGV.first | |
| commonname=domain | |
| country='US' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'digest' | |
| md5 = '3bed22f7f496e84b035a996522baa7594c27c7e5718a78bfddf9012904b70eb755d67f90c8de149ead7ee674b024f38c216642030c2d54cb1dd657dd66342c99c239f3c31fd399fc052a9b7861f2073d2b9f47811dd77fd544d570c34bf5f349d110389979571714694a5054238465ca38ba26c25fb1a32b4d0a3b93666b09b3' | |
| prefix = Digest::MD5.hexdigest 'v2ex' | |
| str = '' | |
| md5.scan(/.{32}/) { |m| str += [*'0'..'9',*'A'..'Z',*'a'..'z'].find { |s| Digest::MD5.hexdigest(prefix + str + s + Digest::MD5.hexdigest(str + s)) == m } } | |
| puts str #=> csdaixie |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def a(unsafe) | |
| chars = unsafe.split(//).map! do |char| | |
| if char =~ /[A-Z]/ | |
| char <<= char.tr('A-Z', 'a-z') | |
| end | |
| char | |
| end | |
| end | |
| def b(unsafe) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rake' | |
| require 'time' | |
| Encoding.default_internal = Encoding::UTF_8 | |
| Encoding.default_external = Encoding::UTF_8 | |
| class Timestamp | |
| attr_reader :from, :to | |
| def initialize from, to | |
| @from = from.to_i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_list sort: 'new', cate: nil, type: nil, ch: nil, kind: 'normal', cid: 0, page: 0, per_page: 10 | |
| data = Soft | |
| pcate = root_key && cached_get(root_key) | |
| data = data.where(['charIndex(?, categoryPath) > 0', "/#{pcate.ID}/"]) if !pcate.nil? | |
| data = data.where(['charIndex(?, categoryPath) > 0 or charIndex(?, categoryPath) > 0)', *ch_args]) if !ch_args.empty? | |
| if cate | |
| cate_ent = cached_get(root_key, cate) | |
| data = data.where(category_id: cate_ent.ID) | |
| end | |
| cid = cid.to_i |