Skip to content

Instantly share code, notes, and snippets.

Avatar

Fabio AM fabioam

View GitHub Profile
View i3-config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
@fabioam
fabioam / runapp.sh
Last active Sep 13, 2022
Run cool-retro-term as Guake
View runapp.sh
# This script searchs for the application with the
# given classname. There are three possibilities:
# 1. If the app is not open, opens it
# 2. If the app is open but is not the active window, activates it
# 3. If the app is open AND is the active window, minimizes it#
# The idea is to assign this script to keyboard shortcuts in order
# to launch/activate/minimize a common used application quickly
#
# Requieres 'xdotool' installed
@fabioam
fabioam / MagentoAddRandomCustomers.php
Last active Mar 7, 2018
add random customers to Magento database
View MagentoAddRandomCustomers.php
//PHP array containing forenames.
$names = array(
'Joao',
'Alberto',
'Jose',
'Raimundo',
'Carlos',
'Fabio',
'David',
'Mell',
View docker_remove_networks.txt
docker network rm $(docker network ls | grep "foo" | awk '/ / { print $1 }')
@fabioam
fabioam / docker-destroy-all.sh
Created Feb 5, 2018 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
View docker-destroy-all.sh
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@fabioam
fabioam / docker-normal-user.sh
Created Feb 3, 2018
Docker as a normal user
View docker-normal-user.sh
$ sudo usermod -aG docker $USER
$ sudo setfacl -m user:$USER:rw /var/run/docker.sock
@fabioam
fabioam / Gulpfile.js
Last active Jan 28, 2018
Simple gulp file example using gulp-livereload
View Gulpfile.js
/*
* Simple gulp file using gulp-livereload
* $ gulp -v
* CLI version 3.9.1
* Local version 3.9.1
*
* run example:
* $ gulp watch
*
* if you have errors, check first if you have fs.inotify.max_user_watches configured appropriate
@fabioam
fabioam / instagram-split-in-14s.sh
Created Nov 4, 2017
Description: Split mp4 video 14s with each - for using with instagram stories
View instagram-split-in-14s.sh
#!/bin/bash
if [ "$#" -ne 1 ]
then
echo "Description: Split mp4 file with 14s each - for using with instagram stories"
echo "Usage: $0 <filename>"
exit 1
fi
echo $1
@fabioam
fabioam / instagram-portrait-convert.sh
Created Nov 4, 2017
Convert mp4 video to instagram portrait format (720wx1080h)
View instagram-portrait-convert.sh
#!/bin/bash
# 99% of credits by https://unix.stackexchange.com/a/192021/235601
if [ "$#" -ne 1 ]
then
echo "Description: Convert mp4 file to instagram portrait format (720wx1080h)"
echo "Usage: $0 <filename>"
exit 1
fi
@fabioam
fabioam / .bashrc
Last active Feb 3, 2018
bashrc with some alias and functions
View .bashrc
#
# ~/.bashrc
#
[[ $- != *i* ]] && return
colors() {
local fgc bgc vals seq0
printf "Color escapes are %s\n" '\e[${value};...;${value}m'