Skip to content

Instantly share code, notes, and snippets.

@mitfik
mitfik / gist:a765b3b6ee6b57944794fef9072cceda
Last active August 23, 2016 15:41 — forked from wrburgess/gist:5528649
Backup Heroku Postgres database and restore to local database

Grab new backup of database

Command: heroku pgbackups:capture --remote production

Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712

Get url of backup download

Command: heroku pgbackups:url [db_key] --remote production

@mitfik
mitfik / devise.pl.yml
Last active October 15, 2023 09:18
devise.pl.yml
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
pl:
devise:
confirmations:
confirmed: "Twoje konto zostało aktywowane. Zostałeś pomyślnie zalogowany."
send_instructions: "Za chwilę otrzymasz email z instrukcją jak aktywować konto."
send_paranoid_instructions: "Jeśli Twój adres email istnieje w naszej bazie, za chwilę powinieneś otrzymać instrukcję jak aktywować konto."
failure:
already_authenticated: "Jesteś aktualnie zalogowany."
@mitfik
mitfik / newsbutter
Created October 21, 2013 16:41
rss urls
http://kopalniawiedzy.pl/wiadomosci.rss
http://rss.slashdot.org/Slashdot/slashdot
http://feeds.feedburner.com/Neurotycznie
http://bronikowski.com/feed
http://gpgpu.org/feed
http://www.osnews.com/files/recent.rdf
http://osnews.pl/feed/
http://www.mt.com.pl/feed
http://freeviewdocumentaries.com/feed/
http://www.focus.pl/rss/
@mitfik
mitfik / converter
Created July 29, 2013 12:27
Size converter
echo "1T" | sed -e 's/t/kg/i;s/g/km/i;s/m/kk/i;s/k/*1024/ig;s/b//i' | bc
@mitfik
mitfik / config
Created March 25, 2013 14:46
refs for pull request
fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
@mitfik
mitfik / gist:4054558
Created November 11, 2012 10:58
OGG to mp3
for name in *.ogg; do ffmpeg -i "$name" "$name.mp3"; done;
@mitfik
mitfik / gist:3775800
Created September 24, 2012 12:50
Cross checking for two files
# linux is awsome
# first.csv
# A
# B
# C
# D
# second.csv
# B
@mitfik
mitfik / gist:3402722
Created August 20, 2012 09:50
LDAP CheatSheet
# Get info about all Contexts in ldap
ldapsearch -x -H ldap://localhost -b "" -s base configContext namingContexts monitorContext
# display cn=config structures and data
ldapsearch -Y EXTERNAL -H ldapi:/// -b "cn=config"
# or
slapcat -b cn=config > config.ldiff
# modify config
@mitfik
mitfik / gist:3169039
Created July 24, 2012 09:22
Helper for S3 direct upload file
def s3_form_tag(options = {})
bucket = options[:bucket]
access_key_id = options[:access_key_id]
secret_access_key = options[:secret_access_key]
key = options[:key] || ''
content_type = options[:content_type] || '' # Defaults to binary/octet-stream if blank
redirect = options[:redirect] || '/'
acl = options[:acl] || 'public-read'
expiration_date = options[:expiration_date].strftime('%Y-%m-%dT%H:%M:%S.000Z') if options[:expiration_date]
max_filesize = options[:max_filesize] || 671088640 # 5 gb
@mitfik
mitfik / change_name.sh
Created June 2, 2012 19:25
Rename extension for all files in all directories
find -L . -type f -name "*.rhtml" | while read FNAME; do cp $FNAME `dirname $FNAME``echo '/'``basename $FNAME .rhtml`.html.erb; done