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 bash | |
set -eux | |
# Parameters. | |
disk_img_snapshot="/mnt/hd/images/arcolabs.qcow2" | |
# Run the copy of the installed image. | |
#qemu-system-x86_64 \ | |
# -drive "file=${disk_img_snapshot},format=qcow2" \ |
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
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_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
acpi | |
alsa-utils | |
ansible | |
ansible-lint | |
apache | |
arandr | |
bash | |
bash-completion | |
blueman | |
bluez |
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
Basic | |
===== | |
[Shift]+[Mod]+[Enter] - launch terminal. | |
[Mod]+[b] - show/hide bar. | |
[Mod]+[p] - dmenu for running programs like the x-www-browser. | |
[Mod]+[Enter] - push acive window from stack to master, or pulls last used window from stack onto master. | |
[Mod] + [j / k] - focus on next/previous window in current tag. |
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
# Competitive programming | |
[Codeforces](https://codeforces.com) | |
[Timus](http://acm.timus.ru/help.aspx?topic=judge&locale=en) | |
[Sphere](https://www.spoj.com) | |
# Python debugging | |
[1](http://www.ericholscher.com/blog/2008/aug/30/using-pdb-python-debugger-django-debugging-series-/) | |
[2](https://pythonconquerstheuniverse.wordpress.com/2009/09/10/debugging-in-python/) |
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
(map-indexed vector [5 10 15]) | |
;; ([0 5] [1 10] [2 15]) | |
;; 0, 1, 2 => indexes | |
(map-indexed hash-map [:a :b :c]) | |
;; ({0 :a} {1 :b} {2 :c}) | |
;; sorting by key on a map | |
(def seq-prices '({:price 1500}, {:price 300})) | |
(->> seq-prices (sort-by :price)) ;; ({:price 300} {:price 1500}) |
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
--- | |
# ^^^ YAML documents must begin with the document separator "---" | |
# | |
#### Example docblock, I like to put a descriptive comment at the top of my | |
#### playbooks. | |
# | |
# Overview: Playbook to bootstrap a new host for configuration management. | |
# Applies to: production | |
# Description: | |
# Ensures that a host is configured for management with Ansible. |
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
Installing | |
Download tar.xz | |
xz -d cmocka-1.x.x.tar.xz | |
tar vxf cmocka-1.x.x.tar | |
cd cmocka-1.x.x | |
mkdir build && cd $_ | |
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release .. | |
make && make install |
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 docker -d H=tcp://address:port | |
ex: sudo docker -d H=tcp://0.0.0.0:2375 | |
# listen using the default unix socket, and on 2 specific IP addresses on this host. | |
docker -d -H unix:///var/run/docker.sock -H tcp://192.168.59.106 -H tcp://10.10.10.2 |
NewerOlder