Skip to content

Instantly share code, notes, and snippets.

View constrict0r's full-sized avatar
👘
The plan is programmed in all of my thousand robots

Victor Mattei constrict0r

👘
The plan is programmed in all of my thousand robots
  • @cslucr @lamportcomputing
  • Costa Rica
View GitHub Profile
@constrict0r
constrict0r / docker-ansible-extra-vars.sh
Last active April 24, 2019 06:05
Run Ansible role on Docker with --extra-vars.
docker run constrict0r/debian-apt bash -c \
"ansible localhost -m include_role \
-a name=constrict0r.debian_apt \
--extra-vars 'upgrade=True packages_file_path=extra-packages.yml {packages: [leafpad, rolldice]}'"
@constrict0r
constrict0r / ansible-complex-extra-vars.sh
Last active April 24, 2019 06:05
Ansible complex --extra-vars.
su -c 'ansible-playbook -i tests/inventory tests/test.yml \
--extra-vars "{upgrade: True, packages: [leafpad, rolldice], packages_file_path: extra-packages.yml}"'
@constrict0r
constrict0r / remove-apt-keys.sh
Last active February 14, 2019 18:32
Remove apt keys.
# Spotify key.
sudo apt-key del 931FF8E79F0876134EDDBDCCA87FF9DF48BF1C90
# Docker key.
sudo apt-key del 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
# Verify.
sudo apt-key list
@constrict0r
constrict0r / git-status-multiple.sh
Last active April 24, 2019 06:05
Show git status multiple repos.
find . -maxdepth 1 -mindepth 1 -type d -exec sh -c '(echo {} && cd {} && git status -s && echo)' \;
@constrict0r
constrict0r / max-compress.sh
Last active April 24, 2019 06:05
Maximum compress img file.
tar -cf - my-file.img | xz -9 -c - > my-file.img.tar.xz
@constrict0r
constrict0r / docker-interactively.sh
Last active April 24, 2019 07:48
Docker run interactively.
docker run -it --entrypoint /bin/bash constrict0r/debian-kickstart
@constrict0r
constrict0r / pip-check-available-version.sh
Last active April 26, 2019 18:37
Pip check package available versions.
python -m pip install django-tagging==
@constrict0r
constrict0r / open-ports.sh
Created April 28, 2019 06:18
Verify listening ports.
netstat -anltp | grep "LISTEN"
@constrict0r
constrict0r / travis-before-apt-full.yml
Last active May 8, 2019 20:31
Travis before apt cleanup
---
dist: xenial
before_install:
- sudo apt remove mysql-server-5.7
- sudo apt update
install:
- sudo apt-get full-upgrade -y
@constrict0r
constrict0r / bash-alias.sh
Last active December 6, 2019 20:41
Set bash aliases.
#!/bin/bash
#
# @file bash-alias
# @brief Add useful bash commands aliases.
alias changes="find . -maxdepth 1 -mindepth 1 -type d -exec sh -c '(echo {} && cd {} && git status -s && echo)' \;"
alias runit="ansible-playbook -i tests/inventory tests/test-playbook.yml"
alias gic="git add . && git commit -m 'Updated repository' && git push"
alias fixme="xrandr --newmode '1366x768_60.00' 84.75 1360 1432 1568 1776 768 771 781 798 -hsync +vsync && xrandr --addmode VGA-1 '1366x768_60.00' && xrandr --output VGA-1 --mode '1366x768_60.00'"