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
sudo update-alternatives --config x-www-browser | |
credits: | |
http://ubuntuforums.org/showthread.php?t=201430 | |
gvfs-mime --query x-scheme-handler/http | |
gvfs-mime --query x-scheme-handler/https | |
gvfs-mime --set x-scheme-handler/http google-chrome.desktop | firefox.desktop | |
gvfs-mime --set x-scheme-handler/https google-chrome.desktop | firefox.desktop |
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
http://docs.vagrantup.com/v2/cli/package.html | |
http://stackoverflow.com/questions/19094024/is-there-any-way-to-clone-a-vagrant-box-that-is-already-installed?answertab=active#tab-top | |
cd /home/ten0s/projects/ansible/vagrant/cluster | |
VBoxManage list vms | |
"cluster_arbiter_1434442130502_70811" {e8fd64da-b59f-4377-8ddf-5c5d660867a1} | |
"cluster_arbiter2_1434442190803_23274" {a4beff52-3a11-40e2-885f-b09722a09f85} | |
"cluster_node1_1434442012780_7672" {73c70448-4333-4932-bdd9-ac774532f591} | |
"cluster_node2_1442485877717_61624" {633d5855-9f19-427b-af29-8041f8d69829} |
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
router MT-PON-AT-4 | |
Security -> Enable ALG -> Enable IPSEC ALG |
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
% -*- coding: utf8 -*- | |
% Example of Nif testing. | |
% This one only works with erlang 17.4 and 17.3 | |
% | |
% $ cat hello.c | |
% #include "erl_nif.h" | |
% | |
% static ERL_NIF_TERM say(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) | |
% { | |
% return enif_make_string(env, "Hello world!", ERL_NIF_LATIN1); |
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
Ansible template | |
template: src={{item}}.j2 dest=/etc/nginx/conf.d/{{item}} | |
with_items: | |
- server.conf | |
notify: Restart Nginx | |
fails with: | |
fatal: [test] => {'msg': "TypeError: argument of type 'StrictUndefined' is not iterable", 'failed': True} |
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
vagrant init ubuntu/precise32 | |
vagrant up | |
vagrant ssh | |
Deps | |
---- | |
sudo apt-get update | |
sudo apt-get install build-essential curl dos2unix gdb emacs git htop mc wget libwxgtk2.8-dev libglu-dev xsltproc libssl-dev libncurses5-dev fop unixodbc-dev default-jdk libtk-img-dev | |
cd |
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
lists:foldr(fun(B, {I, Acc}) -> {I+1, B*trunc(math:pow(2, I))+Acc} end, {0,0}, [I || <<I:1>> <= <<$h>>]). |
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
In [1]: from jinja2 import Template | |
In [2]: Template("{{s.split('-')}}").render(s='a-bad-string') | |
Out[2]: u"['a', 'bad', 'string']" |
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: Import RabbitMQ GPG key | |
rpm_key: key=http://www.rabbitmq.com/rabbitmq-signing-key-public.asc | |
state=present | |
- name: Register RabbitMQ version | |
command: rpm -q rabbitmq-server | |
register: rmq | |
changed_when: false | |
failed_when: false |
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
==> default: Waiting for machine to boot. This may take a few minutes... | |
default: SSH address: 127.0.0.1:2202 | |
default: SSH username: vagrant | |
default: SSH auth method: private key | |
default: Warning: Connection timeout. Retrying... | |
default: Warning: Remote connection disconnect. Retrying... | |
default: Warning: Authentication failure. Retrying... | |
default: Warning: Authentication failure. Retrying... | |
default: Warning: Authentication failure. Retrying... |