Skip to content

Instantly share code, notes, and snippets.

@lucaspwbx
lucaspwbx / gist:aedf2ecd475b56004e22
Created December 16, 2014 01:14
bind docker daemon to a tcp address
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
@lucaspwbx
lucaspwbx / gist:041b82db8f740b24fbe983158e360c0b
Created October 6, 2016 22:30
Installing Cmocka and running tests (Mac)
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
@lucaspwbx
lucaspwbx / pedantically_commented_playbook.yml
Created November 11, 2016 03:01 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ 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.
@lucaspwbx
lucaspwbx / experiments.clj
Last active January 2, 2022 00:48
clojure
(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})
# 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/)
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.
acpi
alsa-utils
ansible
ansible-lint
apache
arandr
bash
bash-completion
blueman
bluez
@lucaspwbx
lucaspwbx / generate-ssh-key.sh
Last active November 17, 2020 13:25 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
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
#!/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" \