For excessively paranoid client authentication.
Updated Apr 5 2019:
because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.
some other notes:
| ' Copyright (c) 2007, Tony Ivanov | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without | |
| modification, are permitted provided that the following conditions are met: | |
| * Redistributions of source code must retain the above copyright | |
| notice, this list of conditions and the following disclaimer. | |
| * Redistributions in binary form must reproduce the above copyright | |
| notice, this list of conditions and the following disclaimer in the | |
| documentation and/or other materials provided with the distribution. |
| # from http://stackoverflow.com/questions/6499654/is-there-an-asynchronous-logging-library-for-ruby/6527134#6527134 | |
| require 'thread' | |
| require 'singleton' | |
| require 'delegate' | |
| require 'monitor' | |
| class Async | |
| include Singleton |
| module Maths where | |
| data Nat : Set where | |
| zero : Nat | |
| suc : Nat → Nat | |
| plus : Nat → Nat → Nat | |
| plus zero n = n | |
| plus (suc m) n = suc (plus m n) |
| $ irb -r ./select_server | |
| >> client.puts "hi" | |
| => nil | |
| >> client.puts "bye" | |
| => nil | |
| >> client.close | |
| => nil | |
| >> exit |
| # 在本地服务器建立 rubygems.org 的镜像缓存,以提高 gem 的安装速度 | |
| # 此配置设置缓存过期为1天,也就是说,新上的 gem 无法马上安装 | |
| # 做这个起什么作用? | |
| # rubygems 的很多资源文件是存放到 Amazon S3 上面的,由于 GFW 对某些 S3 服务器又连接重置或丢包,导致 gem 安装异常缓慢或有时候根本无法连接安装。 | |
| # 而通过这种跳板的方式可以很好的解决这个问题,当然前提是 Nginx反向代理 服务器需要在国外 | |
| proxy_cache_path /var/cache/rubygems levels=1:2 keys_zone=RUBYGEMS:10m | |
| inactive=24h max_size=1g; | |
| server { | |
| listen 80; |
| config.json | |
| reading-image.png |
| " Use vim settings, rather then vi settings (much better!) | |
| " This must be first, because it changes other options as a side effect. | |
| set nocompatible | |
| set t_Co=256 " iTerm2 supports 256 color mode. | |
| set ai " auto indenting | |
| set history=100 " keep 100 lines of history | |
| set ruler " show the cursor position | |
| syntax on " syntax highlighting | |
| filetype plugin on " use the file type plugins |