Skip to content

Instantly share code, notes, and snippets.

Facundo Bianco vando

View GitHub Profile
View Basic template for unix functions
func_name()
{
case ${1} in
up|start) command ;;
down|stop) command ;;
restart) func_name down ; sleep 1 ; func_name up ;;
st|status) pgrep -fl command ;;
-h|--help|"") echo "useful info" ;;
*) echo -e "func_name: invalid option '$1'\nfunc_name -h for help" ;;
esac
@vando
vando / slackware_qemu.md
Last active Aug 29, 2015
Create virtual machines with qemu in Slackware
View slackware_qemu.md

Commands

qemu-img create -f qcow2 debian.qcow 680M 
qemu-system-x86_64 -hda debian.qcow \
                   -cdrom /home/vando/down/debian-8.1.0-amd64-netinst.iso \
                   -boot d \
                   -m 512
View LVM cheetshet.md

LVM Cheetsheet

gdisk (prepare HDD)

Run the command

gdisk /dev/sdb
@vando
vando / saltstack_apache_module.md
Last active Oct 22, 2015
Solved Saltstack apache module enabled
View saltstack_apache_module.md

I had this instrutions in Salt for install Apache modules

apache2:
  pkg.installed

{% for modname in ['ssl','proxy_http'] %}  
{{ modname }}-mod:
  apache_module.enable:
    - name: {{ modname }}
@vando
vando / docker_aliases.sh
Last active Apr 22, 2016
Docker aliases for shell
View docker_aliases.sh
alias di='docker images'
alias dps='docker ps'
alias dgrep='di | grep'
alias drm='docker rm `docker ps -aq -f status=paused -f status=exited -f status=dead`' # Removes unused instances
alias drmi='docker rmi -f `docker images -q --filter "dangling=true"' # Removes images with name "<none>"
@vando
vando / Slackware+UEFI.md
Last active Nov 30, 2015
How to install Slackware 14.1 on a machine with UEFI
View Slackware+UEFI.md

First Step

Download and install Ubuntu following the default options. Once you login, format the HDD with an empty partition.

Slackware pre installation

Download Slackware64 14.1 and mount it

@vando
vando / raspi_gpip_poweroff.sh
Last active Jan 17, 2016
Software poweroff or reset for Raspberry Pi through GPIO.
View raspi_gpip_poweroff.sh
#!/bin/bash
#
# Based on https://github.com/g0to/misc_scripts/blob/master/raspi_gpio_actions.sh
# More info about the GPIO: http://elinux.org/RPi_Low-level_peripherals
#
# sudo echo -e "\n@reboot root /home/pi/scripts/raspi_gpio_poweroff.sh" >> /etc/crontab
if [[ $EUID -ne 0 ]]; then
echo "Error: This script must be run as root" >&2
exit 1
@vando
vando / 000-drone.conf
Created Feb 3, 2016
Apache 2.4 virtualhost for Drone.io
View 000-drone.conf
<VirtualHost *:80>
ServerName drone.yourdomain.com
Redirect 301 / https://drone.yourdomain.com/
</VirtualHost>
<VirtualHost *:443>
ServerName drone.yourdomain.com
Include /etc/apache2/include/ssl
# Avoid multiple 303 response
View drone.go
[GIN] 2016/02/05 - 15:27:38 | 303 | 1.157281ms | XXX.XXX.XXX.XXX:62817 | GET /authorize
fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x63 pc=0x7f31563ac4fc]
runtime stack:
runtime.throw(0xda6020, 0x2a)
/usr/local/go/src/runtime/panic.go:527 +0x90
runtime.sigpanic()
/usr/local/go/src/runtime/sigpanic_unix.go:12 +0x5a
@vando
vando / README.md
Last active Feb 15, 2016
Nagios pluging for Docker
View README.md

Nagios plugin for Docker

This plugin monitors how much docker instances are stoped/exited/dead or if one instance is running.

Check not runnig instances

$> /usr/lib/nagios/plugins/check_docker.sh -w 3 -c 6
There are 2 not running container(s)
You can’t perform that action at this time.