Skip to content

Instantly share code, notes, and snippets.

View prashantvidja's full-sized avatar
😉
Focusing

Prashant Vidja prashantvidja

😉
Focusing
  • Rajkot,Gujarat
View GitHub Profile
@prashantvidja
prashantvidja / pishrink_ubuntu.sh
Created January 1, 2020 18:58
Shrink ubuntu arm image.
#!/bin/bash
function cleanup() {
if losetup $loopback &>/dev/null; then
losetup -d "$loopback"
fi
}
usage() { echo "Usage: $0 [-s] imagefile.img [newimagefile.img]"; exit -1; }
@prashantvidja
prashantvidja / pishrink.sh
Created January 1, 2020 18:56
Shrink raspberry pi image
#!/bin/bash
version="v0.1.2"
CURRENT_DIR=$(pwd)
SCRIPTNAME="${0##*/}"
LOGFILE=${CURRENT_DIR}/${SCRIPTNAME%.*}.log
function info() {
echo "$SCRIPTNAME: $1..."
@prashantvidja
prashantvidja / fav_servers.py
Created February 12, 2019 06:00 — forked from pudquick/fav_servers.py
Modifying the Favorite Servers list (in Finder's "Connect to Server" dialog) on OS X 10.11, a revisit of my blog post at: http://michaellynn.github.io/2015/10/24/apples-bookmarkdata-exposed/
import os.path
from Foundation import NSData, NSKeyedUnarchiver, SFLListItem, NSURL, NSMutableDictionary, NSKeyedArchiver, NSString, NSDictionary, NSArray
def load_favservers(sfl_path):
if os.path.isfile(sfl_path):
# File exists, use it
sfl_decoded = NSKeyedUnarchiver.unarchiveObjectWithData_(NSData.dataWithContentsOfFile_(sfl_path))
else:
# File doesn't exist, make a blank template
sfl_decoded = {u'items': [],