Skip to content

Instantly share code, notes, and snippets.

View giflw's full-sized avatar
🚛

Guilherme I F L Weizenmann giflw

🚛
View GitHub Profile
@giflw
giflw / default.conf
Created January 30, 2018 17:22 — forked from cbmd/default.conf
nginx config - dynamic virtual hosts
server {
index index.php;
set $basepath "/var/www";
set $domain $host;
# check one name domain for simple application
if ($domain ~ "^(.[^.]*)\.dev$") {
set $domain $1;
set $rootpath "${domain}";
@giflw
giflw / estados-cidades.json
Last active July 26, 2017 23:46 — forked from letanure/estados-cidades.json
JSON estados cidades
{
"states": [
{
"abbr": "AC",
"name": "Acre",
"capital": "Rio Branco",
"cities": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
@giflw
giflw / postgres
Created April 6, 2016 19:08 — forked from mmrwoods/postgres
Postgres maintenance crontab file
# dump all databases once every 24 hours
45 4 * * * root nice -n 19 su - postgres -c "pg_dumpall --clean" | gzip -9 > /var/local/backup/postgres/postgres_all.sql.gz
# vacuum all databases every night (full vacuum on Sunday night, lazy vacuum every other night)
45 3 * * 0 root nice -n 19 su - postgres -c "vacuumdb --all --full --analyze"
45 3 * * 1-6 root nice -n 19 su - postgres -c "vacuumdb --all --analyze --quiet"
# re-index all databases once a week
0 3 * * 0 root nice -n 19 su - postgres -c 'psql -t -c "select datname from pg_database order by datname;" | xargs -n 1 -I"{}" -- psql -U postgres {} -c "reindex database {};"'
@giflw
giflw / utils.liq
Last active August 19, 2019 07:40
Liquidsoap utils.liq modification to playlist.reloadable reloads more than once
# Turn a source into an infaillible source by adding blank when the source is
# not available.
# @param s the source to turn infaillible
# @category Source / Track Processing
def mksafe(~id="mksafe",s)
fallback(id=id,track_sensitive=false,[s,blank(id="safe_blank")])
end
# Alias for the <code>l[k]</code> notation.
# @category List