Skip to content

Instantly share code, notes, and snippets.

@eckelon
eckelon / debug-seneca-microservice.sh
Created May 24, 2019 10:34
simple script to debug a seneca microservice running in fuge
#!/bin/bash
if [[ $# -eq 0 ]] ; then
echo 'you need to specify a service'
exit 0
fi
pid=`ps aux | grep microservices | grep $1 | awk '{print $2}'`
if [ -z "$pid" ]
@eckelon
eckelon / start-mongo-local.sh
Last active May 23, 2019 10:16
Simple command to start mongo in local machine with data persistence
docker stop mongo-local
docker run --name mongo-local --rm -v $(pwd)/data:/data/db -p 27017:27017 -d mongo:4.0
@eckelon
eckelon / update_git_repos.sh
Created May 8, 2019 10:11 — forked from douglas/update_git_repos.sh
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
printf "Checkout updated develop branch for all repos...\n\n"
# Find all git repositories and update it to the develop latest revision
for i in $(find . -name ".git" | cut -c 3-); do
find . -type f -name '*.jpg' -print0 | xargs -0 -I{} -P4 guetzli --quality 84 {} {}_optim.jpg
@eckelon
eckelon / syncDev.sh
Last active October 18, 2018 11:21
Simple script to automatically synchronize files with remote machine using rsync and inotify-tools
#!/bin/bash
# https://github.com/rvoicilas/inotify-tools/wiki needed!
while inotifywait -r -e modify,create,delete /home/user/Development/; do
rsync -rltvze "ssh" -O -J --exclude '.git*' --exclude '*.pdf' --exclude '*.zip' /home/user/Development/* user@server:/var/www/
done
@eckelon
eckelon / Using_Libvirt_With_Vagrant.sh
Last active July 14, 2018 20:11
This is how I managed to provision my vagrant development environment using libvirt instead of Virtualbox, so it now loads faster.
sudo apt-get -y install libvirt-dev qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
vagrant plugin install vagrant-libvirt
vagrant plugin install vagrant-share
sudo addgroup libvirtd
sudo usermod -a -G libvirtd $user
sudo apt install nfs-kernel-server
sudo reboot
vagrant up --provider=libvirt
"Fix nvim slowliness
set cursorline!
set lazyredraw
set noshowcmd
set noruler
<div>
<a href="#">
<picture>
<source
media="(max-width: 768px)"
srcset="mobile.jpg 1x, mobile@2x.jpg 2x">
<source
media="(max-width: 991px)"
srcset="tablet.jpg 1x, tablet@2x.jpg 2x">
<img
@eckelon
eckelon / gulpfile.js
Last active April 10, 2018 06:06
Simple gulpfile that process, lints and minify scss to css and js files. It also keeps files cached in order to improve tasks execution time.
var autoprefixer = require('gulp-autoprefixer');
var cache = require('gulp-cached');
var cleanCSS = require('gulp-clean-css');
var concat = require('gulp-concat');
var eslint = require('gulp-eslint');
var gulp = require('gulp');
var notify = require("gulp-notify");
var plumber = require('gulp-plumber');
var remember = require('gulp-remember');
var sass = require('gulp-sass');
@eckelon
eckelon / jack-different-output-device.sh
Created March 30, 2018 17:03
Simple snippet that enables jack to use a second audio device for output
alsa_out -j "Xmod" -d hw:Xmod -q 1 2>&1 1> /dev/null &