Skip to content

Instantly share code, notes, and snippets.

View supermasita's full-sized avatar
🤘
Calambre de trueno

Supermasita supermasita

🤘
Calambre de trueno
View GitHub Profile
@supermasita
supermasita / sqlite2csv.sh
Created May 17, 2016 17:53
BASH - Export SQLite to CSV - Example
#!/bin/bash
# Export SQLite to CSV - Example
# Replace "$database" and "$table"
sqlite3 $database <<!
.headers on
.mode csv
.output $database.csv
select * from $table;
!
@supermasita
supermasita / gist:decd55c44719005c5adc7ab27d844884
Created May 3, 2016 21:46
NGINX - Determine if user agent is mobile and add set a different proxy_cache_key
location ~ / {
# mobile users
if ($http_user_agent ~* '(iPhone|iPod|mobile|Android|2.0\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile)') {
set $ismobile '1';
}
proxy_cache_key $proxy_host$uri$ismobile;
add_header X-Is-Mobile $ismobile;
@supermasita
supermasita / gist:8935da063725f456de45a7ebe86e59ad
Created May 3, 2016 21:41
Docker - Adding port to already runnning container (example)
sudo iptables -t nat -A DOCKER -p tcp --dport 443 -j DNAT --to-destination 172.17.0.1:443