Skip to content

Instantly share code, notes, and snippets.

View gdamdam's full-sized avatar

gio gdamdam

  • Internet Archive
  • San Francisco
View GitHub Profile
youtube-dl --write-description --write-info-json --write-annotations --write-sub --write-thumbnail
@gdamdam
gdamdam / qubeos-screen.txt
Last active April 25, 2019 00:54
Add Screen Resolution dimensions
gtf X Y FREQ give you the parameters
xrandr --newmode $(gtf 1600 900 60 | grep Modeline | sed s/Modeline\ // | tr -d '"')
xrandr --addmode "eDP-1" "1600x900_60.00"
xrandr --output "eDP-1" "1600x900_60.00"
gsettings set org.gnome.desktop.interface scaling-factor 2
@gdamdam
gdamdam / VIMclipboard.md
Last active January 31, 2017 18:42
VIM Clipboard

Paste your clipboard to a file and open it with VIM

in your bashrc:

viclipboard () { 
    ( tmpfile=~/.clips/$(date +%Y%m%d%H%M%S);
    pbpaste > $tmpfile && vim $tmpfile && pbcopy < $tmpfile )

}

@gdamdam
gdamdam / gpgmutt.md
Created October 7, 2016 16:41 — forked from bnagy/gpgmutt.md
Mutt, Gmail and GPG

GPG / Mutt / Gmail

About

This is a collection of snippets, not a comprehensive guide. I suggest you start with Operational PGP.

Here is an incomplete list of things that are different from other approaches:

  • I don't use keyservers. Ever.
  • Yes, I use Gmail instead of some bespoke hipster freedom service
@gdamdam
gdamdam / docker_cookbook.md
Created April 16, 2016 03:08
Tiny DOCKER Cookbook

:: list images

sudo docker images

:: list the containers

sudo docker ps
sudo docker ps -a

:: start/stop a container

@gdamdam
gdamdam / reverse_proxy_ssl.conf
Created April 16, 2016 03:06
NGINX: Reverse Proxy SSL
## redirect http to https
server {
listen 0.0.0.0:80;
server_name YOUR_DOMAIN;
rewrite ^ https://$http_host$request_uri? permanent; # force redirect http to https
}
## https
server {
@gdamdam
gdamdam / supervisor_gunicorn.conf
Created April 16, 2016 03:03
Supervisor and Gunicorn: simple service configuration
[program:SERVICE_NAME]
command = /srv/<SERVICE>/venv/bin/gunicorn <SERVICE>:app --bind=127.0.0.1:5000 -w 4
directory = /srv/demo
user = <USER>
stdout_logfile = /var/log/<SERVICE_NAME>/<SERVICE_NAME>.log
stderr_logfile = /var/log/<SERVICE_NAME>/<SERVICE_NAME>_error.log
redirect_stderr = True
restart = True
environment=USER=<USER>
@gdamdam
gdamdam / fabfile_app.py
Created April 16, 2016 03:02
FABRIC: fabfile deployment app
"""fabfile.py example
Deploy <APP_TO_DEPLOY>:
fab deploy:<APP_TO_DEPLOY>
"""
import os,sys
from fabric.api import local
@gdamdam
gdamdam / postresql_9.5.json.md
Created April 16, 2016 03:00
PostgreSQL 9.5 and JSON

PostgreSQL and JSON

Install PostgreSQL 9.5

Install and configure the repository

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -

Install the package

Keybase proof

I hereby claim:

  • I am gdamdam on github.
  • I am gdamiola (https://keybase.io/gdamiola) on keybase.
  • I have a public key whose fingerprint is BFB3 8C12 E49F B744 524F B04B BBC9 C05B 8C94 A529

To claim this, I am signing this object: