Skip to content

Instantly share code, notes, and snippets.

@archector
archector / docker_stats_with_names.sh
Created February 19, 2018 17:25 — forked from SQiShER/docker_stats_with_names.sh
Docker stats with Container Names instead of IDs
docker stats $(docker inspect -f '{{.Name}}' $(docker ps -q) | cut -c 2-)
@archector
archector / get-docker.sh
Created February 17, 2017 05:03
Easy installation of docker in server
sudo wget -qO- https://get.docker.com/ | sh
@archector
archector / find_best_apt_mirror
Created January 30, 2017 18:28
find_best_apt_mirror
sudo netselect -v -s10 -t20 `wget -q -O- https://launchpad.net/ubuntu/+archivemirrors | grep -P -B8 "statusUP|statusSIX" | grep -o -P "(f|ht)tp.*\"" | tr '"\n' ' '`
@archector
archector / gist:e17e41647c51f9cb95e2a73a26ef3aa4
Created August 4, 2016 00:32
Migrate mails from gmail to dovecot
imapsync --syncinternaldates --host1 imap.gmail.com --host2 192.168.1.11 --user1 your_user@gmail.com --password1 your_pass --user2 your_new_account_user --password2 your_new_account_pass --authmech1 LOGIN --port1 993 --ssl1 --useheader="X-Gmail-Received" --useheader 'Message-Id' --noauthmd5 --allowsizemismatch --exclude 'Trash|Spam'
@archector
archector / manualCert.sh
Last active July 25, 2016 22:56
Issue letsencrypt cert
DOMAIN="mi.dominio.com"
EMAIL="este@dominio.com"
sudo letsencrypt certonly -a webroot --webroot-path=/var/www/letsencrypt -d $DOMAIN --email $EMAIL --agree-tos
@archector
archector / enospc_solver.sh
Created May 9, 2016 19:38
Gulp ENOSPC solution
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@archector
archector / recursiveMogrify.sh
Created May 8, 2016 23:56
Compress and resize all jpg folders recursively
find . -name "*.jpg" -print0 | xargs -0 -n1 mogrify -quality 80 -resize 50%
import subprocess
import re
import os
import sys
################################################################################################
# ADB path
ADB = "/Users/darren/Library/Android/sdk/platform-tools/adb"
# image destination path
IMAGE_PATH = "/Users/darren/Desktop/images/"
@archector
archector / mongoupdate
Created June 4, 2015 21:59
Script mongo
db.images.find({}).forEach(function(doc){
var regexp = /(.*)\.[^.]+$/;
var thumbName = doc.name.split('.').reverse().slice(1);
db.images.update(
{number:doc.number},
{ $set:
{"path": {
"url" : "assets/images/users/" + doc.username + "/pieces/" + doc.number + "/" + doc.name,
"thumb": "assets/images/users/" + doc.username + "/pieces/" + doc.number + "/" + thumbName + "_thumb.jpg"}
}
@archector
archector / compressScannedPDF
Created February 23, 2015 01:04
ghostscript to compress scanned pdf
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=reglamentoAlavilaP.pdf reglamentoAlavila.pdf