screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
screen -AmdS docker ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
screen -r docker
# enter, then disconnect with Ctrl-a d
screen -S docker -p 0 -X stuff $(printf root\\r\\n)
screen -r docker
This file contains 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/python | |
DOCUMENTATION = ''' | |
--- | |
module: github_repo | |
short_description: Manage your repos on Github | |
''' | |
EXAMPLES = ''' | |
- name: Create a github Repo |
This file contains 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 | |
# | |
# synopsis | |
# | |
# ruby merge_locales.rb config/locales translations.yml | |
require 'yaml' | |
require 'rubygems' | |
require 'highline/import' |
This file contains 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
--- | |
- name: Load NRPE variables from Hiera | |
connection: local | |
hiera: path=lib/hiera/bin/hiera key="{{ item.value }}" fact="{{ item.key }}" source=hiera.yaml | |
args: | |
context: | |
environment: "{{ environment }}" | |
sitecode_lc: "{{ sitecode_lc }}" | |
with_dictionary: | |
nrpe_server_port: "nrpe_server_port" |
The document is a little bit old, especially the part of "Generating Keys and Certificates Using easy-rsa" :
git clone -b release/2.x https://github.com/OpenVPN/easy-rsa.git
cp easy-rsa/easy-rsa/2.0/* /etc/openvpn/easy-rsa
This file contains 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
# This is a general-purpose function to ask Yes/No questions in Bash, either | |
# with or without a default answer. It keeps repeating the question until it | |
# gets a valid answer. | |
ask() { | |
# http://djm.me/ask | |
while true; do | |
if [ "${2:-}" = "Y" ]; then | |
prompt="Y/n" |
This file contains 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
#!/bin/bash | |
#!/bin/bash | |
#Utility to log into the RunDeck server and store cookie file for later use | |
errorMsg() { | |
echo "$*" 1>&2 | |
} |
Installing nokogiri 1.6.7.2 with native extensions
libxml2 version 2.6.21 or later is required!
Solution:
brew install libxml2
bundle config build.nokogiri "--use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2"
bundle install
AWS ec2 instances normally have both public DNS name and public IP address. We can wisely use them for office environment which may behind proxy and directly connect from home.
Set below code in .ssh/config
and enjoy convenience.
Suppose the instance has name as
ec2-54-252-146-85.ap-southeast-2.compute.amazonaws.com
54.252.146.85
So you can set as below
I was recommended to use github repository bazaarvoice/cloudformation-ruby-dsl
to generate cloudformation template. But its README is not good enough.
Here are the steps on how to use it on my mac with bundler
$ git clonehttps://github.com/bazaarvoice/cloudformation-ruby-dsl.git
$ cd cloudformation-ruby-dsl
$ bundle install
$ bundle exec rake -T
rake build # Build cloudformation-ruby-dsl-1.0.4.gem into the pkg directory
rake install # Build and install cloudformation-ruby-dsl-1.0.4.gem into system gems