Skip to content

Instantly share code, notes, and snippets.

@joaquinco
joaquinco / nginx.conf.tpl
Created March 4, 2024 10:24
Nginx Reverse Proxy configuration template (replace $SERVER_NAME and configure TSL certificates with certbot)
upstream app_server {
server 127.0.0.1:8080;
keepalive 16;
}
server {
server_name $SERVER_NAME;
add_header X-Frame-Options "DENY";
@joaquinco
joaquinco / gitsecute.sh
Last active April 14, 2023 15:05
Run remote scripts through git and push the result back
#!/bin/bash
: "
Executes what's on a script, put its stdout and stderr
in an output file, update the .script_checksum file and commits.
## Dependencies
Requires bash, sha256sum and git.
@joaquinco
joaquinco / dirdiff
Created March 28, 2022 15:13
diff for directories
#!/bin/bash
: "
Compare files from the first to the same filename
in the second directory, if they both exist.
"
DIFF_VER=${DIFF_VER:-diff}
dir1=$1
@joaquinco
joaquinco / init.vim
Last active July 20, 2023 00:22
NeoVim init file
call plug#begin()
" File explorer
Plug 'scrooloose/nerdtree'
" Commenting stuff
Plug 'tpope/vim-commentary'
" Visualization
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Autocomplete
@joaquinco
joaquinco / .bash_historyrc
Created January 27, 2021 15:04
Bash History configuration
# Lines of history in memory
export HISTSIZE=10000
# Lines of history to disk
export HISTFILESIZE=2000000
export HISTCONTROL=ignoreboth
export HISTIGNORE=history
export HISTTIMEFORMAT='%F %T '
@joaquinco
joaquinco / .gitconfig
Last active September 27, 2022 19:44
gitconfig aliases
[alias]
latestbranchs = branch --sort -committerdate
prettylog = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
treelog = log --graph --oneline --all
word-diff = diff --color-words
@joaquinco
joaquinco / applyexifdate.py
Last active July 24, 2020 22:48
Python script to set modifiy date of images files to the one specified in exif metadata
"""
Python script to set modifiy date of images files to the one specified in exif metadata.
Usage:
python applyexifdate.py Photos/**/*.jpg
"""
import argparse
from datetime import datetime
import logging
import os