#OpenSSL cheat sheet This is a brief howto for socket programmers.
ex: 1024bits length key pair:
$> openssl genrsa -out myprivate.pem 1024
$> openssl rsa -in myprivate.pem -pubout -out mypublic.pem| # encoding: utf-8 | |
| require "timeout" | |
| # Capture the standard output and the standard error of a command. | |
| # Almost same as Open3.capture3 method except for timeout handling and return value. | |
| # See Open3.capture3. | |
| # | |
| # result = capture3_with_timeout([env,] cmd... [, opts]) | |
| # |
| # Requires Capistrano 3.2 or later | |
| namespace :deploy do | |
| after :finishing, :tag_and_push_tag do | |
| on roles(:app) do | |
| within release_path do | |
| set(:current_revision, capture(:cat, 'REVISION')) | |
| # release path may be resolved already or not | |
| resolved_release_path = capture(:pwd, "-P") |
| package httpmock | |
| import ( | |
| "errors" | |
| "net/http" | |
| ) | |
| // Responders are callbacks that receive and http request and return a mocked response. | |
| type Responder func(*http.Request) (*http.Response, error) |
YourTrelloKey with this hash.YourTrelloToken with this looong hash.| # /etc/make.conf | |
| # Clemens Gruber, 2017 | |
| # | |
| # Nearby mirror | |
| #MASTER_SITE_OVERRIDE="ftp://ftp.at.freebsd.org/pub/FreeBSD/ports/distfiles/" | |
| #MASTER_SITE_OVERRIDE="ftp://ftp.de.freebsd.org/pub/FreeBSD/ports/distfiles/" | |
| # Build | |
| MAKE_JOBS_NUMBER?=8 |
| # Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source. | |
| # Will include all hosts the playbook is run on. | |
| # Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html | |
| - name: "Build hosts file" | |
| lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present | |
| when: hostvars[item].ansible_default_ipv4.address is defined | |
| with_items: groups['all'] |
| [program:redmine] | |
| command=/home/redmine/start_redmine.sh | |
| user=redmine | |
| directory=/home/redmine | |
| stderr_logfile=/var/log/supervisor/redmine_error.log | |
| stdout_logfile=/var/log/supervisor/redmine_out.log | |
| environment=HOME="/home/redmine" |
| defmodule Tcprpc.Server do | |
| use GenServer.Behaviour | |
| defrecord State, port: nil, lsock: nil, request_count: 0 | |
| def start_link(port) do | |
| :gen_server.start_link({ :local, :tcprcp }, __MODULE__, port, []) | |
| end | |
| def start_link() do |
| // helpful links: | |
| // https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/EV_SET.2.html | |
| // http://julipedia.meroh.net/2004/10/example-of-kqueue.html | |
| // create kqueue | |
| kq, err := syscall.Kqueue() | |
| if err != nil { | |
| log.Println("Error creating Kqueue descriptor!") | |
| return | |
| } |