Skip to content

Instantly share code, notes, and snippets.

View igorbonadio's full-sized avatar

Ígor Bonadio igorbonadio

View GitHub Profile
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@turboladen
turboladen / psql_encoding.sql
Created October 2, 2013 08:46
Script for dealing with creating Postgres databases that complain with: ``` PG::InvalidParameterValue: ERROR: encoding UTF8 does not match locale en_US DETAIL: The chosen LC_CTYPE setting requires encoding LATIN1. ``` ...when trying to create the production DB. Taken from: http://stackoverflow.com/questions/13115692/encoding-utf8-does-not-match-…
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8'
lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';
@ebinion
ebinion / gist:5690817
Last active March 3, 2016 17:23
Update Postgres "template1"
UPDATE pg_database SET datallowconn = TRUE where datname = 'template0';
\c template0
UPDATE pg_database SET datistemplate = FALSE where datname = 'template1';
drop database template1;
create database template1 with template = template0 encoding = 'UNICODE' LC_CTYPE = 'en_US.UTF-8' LC_COLLATE = 'C';
UPDATE pg_database SET datistemplate = TRUE where datname = 'template1';
\c template1
UPDATE pg_database SET datallowconn = FALSE where datname = 'template0';