View .hg_check_issue_id
#!/usr/bin/env bash | |
HG_COMMIT_MESSAGE="$(hg tip --template {desc})" | |
HG_BRANCH="$(hg identify -b)" | |
if [[ ${HG_COMMIT_MESSAGE=} = *${HG_BRANCH}* ]]; then | |
exit 0 | |
fi | |
exit 1 |
View pip_upgrade.sh
pip list --outdated | awk '{print $1}' | xargs pip install -U |
View remove_app_launchpad_yosemite.sh
sqlite3 $(sudo find /private/var/folders -name com.apple.dock.launchpad)/db/db "DELETE FROM apps WHERE title='APPNAME';" && killall Dock |
View disable_wireless
# Add next line to `/etc/network/interfaces` | |
iface wlan0 inet manual | |
# Restart NetworkManager | |
$ sudo service network-manager restart |
View celery.sh
/* Useful celery config. | |
app = Celery('tasks', | |
broker='redis://localhost:6379', | |
backend='redis://localhost:6379') | |
app.conf.update( | |
CELERY_TASK_RESULT_EXPIRES=3600, | |
CELERY_QUEUES=( | |
Queue('default', routing_key='tasks.#'), |
View pytest.sh
py.test test_sample.py --collect-only # collects information test suite | |
py.test test_sample.py -v # outputs verbose messages | |
py.test -q test_sample.py # omit filename output | |
python -m pytest -q test_sample.py # calling pytest through python | |
py.test --markers # show available markers |
View parallel_fibonacci.py
import threading | |
from Queue import Queue | |
fibo_dict = {} | |
shared_queue = Queue() | |
input_list = [3, 10, 5, 7] | |
queue_condition = threading.Condition() |
View elasticsearch_startup.sh
# Add the service to the automatic startup system. For further detail look at the man page | |
# for update-rc.d by typing the command man update-rc.d | |
sudo update-rc.d eleasticsearch defaults |
View git_archive.sh
git archive --format=tar --prefix=git-1.4.0/ v1.4.0 | gzip >git-1.4.0.tar.gz # Create a compressed tarball for v1.4.0 release. | |
git archive --format=zip --prefix=git-1.4.0/ v1.4.0 > git-1.4.0-docs.zip # Create a compressed zipball for v1.4.0 release. |
View Configure Spanish keyboard on Ubuntu
# Fast method. Run next command on terminal | |
sudo setxkbmap -layout 'es,es' -model pc105 | |
# Modify /etc/X11/xorg.conf file | |
Section “InputDevice” | |
Identifier “Generic Keyboard” | |
Driver “kbd” | |
Option “CoreKeyboard” | |
Option “XkbRules” “xorg” | |
Option “XkbModel” “pc105″ |
NewerOlder