Skip to content

Instantly share code, notes, and snippets.

View ebridges's full-sized avatar
🛠️
Fixing things

Edward Q. Bridges ebridges

🛠️
Fixing things
View GitHub Profile
mkdir my-jars
cp **/*.jar my-jars
ANDROID_HOME=/opt/android-sdk
for file in my-jars/*.jar; do
echo $file;
${ANDROID_HOME}/build-tools/17.0.0/dx --dex --output=temp.dex $file 2> /dev/null
cat temp.dex| head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
done
@ebridges
ebridges / vbox-change-time.sh
Last active July 3, 2017 16:06
Change the bios time of a Virtualbox image of `<name>` to be +/- `<msecs>` from current time.
# Disable time synchronization
VBoxManage setextradata <name> "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1
# Change time
VBoxManage modifyvm <name> --biossystemtimeoffset <msecs>
# Change time via OS (Ubuntu) to 03/09/2014 at 01:00:00
sudo date 030901002014.00
# update timezone data

Keybase proof

I hereby claim:

  • I am ebridges on github.
  • I am ebridges (https://keybase.io/ebridges) on keybase.
  • I have a public key whose fingerprint is 0B87 E5DC E75C D3CC D084 F276 C72B C826 94F7 4CC4

To claim this, I am signing this object:

@ebridges
ebridges / restore-table.sh
Created October 21, 2014 21:27
Restores a single table from a dump file to the configured database.
#!/bin/bash
table=$1
if [ -z "$table" ];
then
echo "Usage: $0 [table-name]"
exit
fi
#!/bin/sh
### Requires python virtualenv to be available
if [ ! -e playbook-test ]; then
mkdir playbook-test
fi
cd playbook-test
virtualenv pbtest
@ebridges
ebridges / rebase-master.sh
Created April 21, 2015 20:12
How to rebase master onto a long-lived branch that has been pushed to origin already
## 0.
$ BRANCH_NAME=eqb/my-branch
## 1. Pull down latest remote version of master & branch
$ git checkout master && git pull
$ git checkout $BRANCH_NAME && git pull
## 2. Delete remote branch
$ git push origin --delete $BRANCH_NAME
## 3. Remove dangling reference to origin
$ git branch --unset-upstream
## 4. Apply changes from master on branch
@ebridges
ebridges / merge-repos.md
Last active January 19, 2016 02:11
Import history from one repo into another
@ebridges
ebridges / list-jpegs.sh
Last active September 17, 2016 15:42
Lists all JPEGs under a directory into a format indexed by filename.
find . -iname '*.jpg' -not -path '*.AppleDouble*' -print0 \
| while read -d $'\0' file; \
do \
FILE=`basename "$file"` && echo "$FILE^$file" ; \
done > list.txt
@ebridges
ebridges / s3-playbook.yml
Last active June 7, 2021 16:30
Ansible playbook to generate one or more S3 buckets with permissions useful for rclone.
---
## Usage:
## ansible-playbook s3-playbook.yml
- hosts: localhost
connection: local
gather_facts: False
vars:
buckets:
'<BucketName>' : '<BucketARN>'
'com.example.bucket' : 'arn:aws:s3:::com.example.bucket'
@ebridges
ebridges / gnucash.modules
Created November 11, 2017 02:57
gnucash.modules configuration
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE moduleset SYSTEM "moduleset.dtd">
<?xml-stylesheet type="text/xsl" href="moduleset.xsl"?>
<moduleset>
<repository type="tarball" name="ftp.gnome.org" default="yes"
href="http://ftp.gnome.org/pub/GNOME/sources/"/>
<repository type="tarball" name="kernel.org"
href="http://www.kernel.org/pub/linux/"/>
<repository type='tarball' name='ftp.gnu.org'