Skip to content

Instantly share code, notes, and snippets.

View djravine's full-sized avatar
🏠
Working from home

Adan Rehtla djravine

🏠
Working from home
View GitHub Profile
@djravine
djravine / gist:cbece97e05f09c749b317743a2d6b0c4
Created January 14, 2020 23:34 — forked from barezina/backup.py
BackupRipper for iOS - Unpack an iOS iPhone Backup into its native files.
import sqlite3
import os
print('BackupRipper for iOS - v1.0')
def dict_factory(cursor, row):
d = {}
for idx, col in enumerate(cursor.description):
d[col[0]] = row[idx]
return d
@djravine
djravine / git-update-index-script.sh
Last active July 22, 2019 05:09
Automatically apply “git update-index --chmod=+x” to executable files
find . -name '*.sh' | xargs git update-index --chmod=+x
@djravine
djravine / git-reset.sh
Created July 2, 2019 06:07
GIT RESET - Squash all commits into 1
git reset $(git commit-tree HEAD^{tree} -m "A new start")
@djravine
djravine / algolite-test.js
Created March 26, 2019 06:14
Algolite Test Script
# npm i algoliasearch
var algoliasearch = require('algoliasearch');
var connectJSON = {
timeout: 4000,
protocol: 'http:',
hosts: {
read: ['localhost:9201'],
write: ['localhost:9201']
@djravine
djravine / purge.sh
Created February 21, 2019 04:58 — forked from adrienbrault/purge.sh
Script to reduce VM size before packaging for vagrant
#!/bin/sh
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
aptitude -y purge ri
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5
@djravine
djravine / OpenShift-V2-MySQL-RepairAllDatabases.txt
Last active May 2, 2017 07:55
OpenShift V2 - MySQL - Repair All Databases
mysqlcheck --repair --all-databases -h $OPENSHIFT_MYSQL_DB_HOST -P ${OPENSHIFT_MYSQL_DB_PORT:-3306} -u ${OPENSHIFT_MYSQL_DB_USERNAME:-'admin'} --password="$OPENSHIFT_MYSQL_DB_PASSWORD"
@djravine
djravine / ec2-host-from-tag-to-env-vars.sh
Last active March 6, 2017 02:53
Create Environment Variables in EC2 Hosts from EC2 Host Tags, just like Beanstalk or Heroku does!
######
# Author: Marcello de Sales (marcello.desales@gmail.com)
# Modifier: Adan Rehtla (Adan@AdanRehtla.com)
# Description: Create Create Environment Variables in EC2 Hosts from EC2 Host Tags
# Original GIST: https://gist.github.com/marcellodesales/a890b8ca240403187269
#
### Requirements:
# * Install jq library (sudo apt-get install -y jq awscli)
# * Install the EC2 Instance Metadata Query Tool (http://aws.amazon.com/code/1825)
#
@djravine
djravine / OpenShift-V2-MySQL-DumpAllDatabases.txt
Last active May 9, 2016 08:41
OpenShift V2 - MySQL - Dump All Databases
mysqldump -h $OPENSHIFT_MYSQL_DB_HOST -P ${OPENSHIFT_MYSQL_DB_PORT:-3306} -u ${OPENSHIFT_MYSQL_DB_USERNAME:-'admin'} --password="$OPENSHIFT_MYSQL_DB_PASSWORD" --all-databases > ~/app-root/data/tmp/all.sql