Note: Assume you are using the compose file, if not switch to one its much easy.
postgresql:
restart: always
image: sameersbn/postgresql:9.6-2
volumes:
# gets the last tag on the branch | |
LAST_TAG=`git describe --abbrev=0 --tags` | |
echo "Features:" | |
echo "" | |
echo "" | |
echo "Commits:" | |
# git log | |
git log --oneline --no-decorate $LAST_TAG..${1:-master} | while read line; do echo "* $line"; done |
git remote prune ${1:-origin} | |
git branch -D `git branch -vv|grep gone| cut -d ' ' -f 3` |
#!/bin/bash | |
######If the postgis major version changes the below will not work. | |
### Switch back the binary to old postgresql binary if upgrade has happeneded | |
brew switch postgresql $OLDVer | |
## Backup DB which contains postgis and Drop it (upgrade fails otherwise) | |
pg_dump mysrcm > /tmp/mysrcm.sql | |
dropdb mysrcm |
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography |
#!/bin/bash | |
export YOUR_DB=<dbname> | |
export NEW_OWNER=<new_user> | |
for tbl in `psql -qAt -c "select tablename from pg_tables where schemaname = 'public';" $YOUR_DB` ; do psql -c "alter table \"$tbl\" owner to $NEW_OWNER" $YOUR_DB ; done | |
for tbl in `psql -qAt -c "select sequence_name from information_schema.sequences where sequence_schema = 'public';" $YOUR_DB` ; do psql -c "alter table \"$tbl\" owner to $NEW_OWNER" $YOUR_DB ; done | |
for tbl in `psql -qAt -c "select table_name from information_schema.views where table_schema = 'public';" $YOUR_DB` ; do psql -c "alter table \"$tbl\" owner to $NEW_OWNER" $YOUR_DB ; done |
#!/bin/bash | |
# Commands to rename and move photos to right folder | |
python copytofolder.py `cd /home/narsi/Dropbox/Camera\ Uploads && find .|grep .jpg` | |
mv `find .|grep 2012-09` | |
find . -name '2013-01*' | |
mkdir /windows/d/Narshu/`date +%Y%m` | |
find . -name '2013-01*.jpg' -exec mv {} /windows/d/Narshu/201301 \; |
#!/usr/bin/python | |
import random | |
import sys | |
import itertools | |
from multiprocessing import Process, Manager | |
from time import sleep | |
def waitforx(time): | |
sleep(time) | |
exit(0) |
# Convert iPhone Call history to Droid. | |
# Step1: Backup your iPhone using iTunes. Copy the call_history.db by following this link | |
# https://theiphonewiki.com/wiki/Call_History_Database | |
# (The iTunes Backup filename of call_history.db is 2b2b0084a1bc3a5ac8c27afdf14afb42c61a19ca.) | |
# Step2: Store the script in the same folder as the call_history.db and run the script | |
# python call_history_to_droid.py > calls-YYYYMMDDhhmmss.xml | |
# Use dummy date is also fine. | |
# Step3: In Android phone install the app CallLogBackupRestore -> | |
# https://play.google.com/store/apps/details?id=com.riteshsahu.CallLogBackupRestore | |
# Place the file created in step2 in your phone and restore using the app. |