Skip to content

Instantly share code, notes, and snippets.

@emzo
emzo / keybase.md
Created September 27, 2017 18:17
keybase.md

Keybase proof

I hereby claim:

  • I am emzo on github.
  • I am emzo (https://keybase.io/emzo) on keybase.
  • I have a public key ASAroVczH5_U9AmuvtuCcsIxVrvPCXQlB70lXJTFP0d-uwo

To claim this, I am signing this object:

@emzo
emzo / gist:81acf12356e66cf4e4420b26e29e950d
Created April 24, 2019 08:26
Restart Bluetooth via terminal on macOS Mojave 10.14
sudo launchctl stop com.apple.bluetoothd
@emzo
emzo / gist:cda9cfc61031395c570373d165773241
Last active October 30, 2022 18:18
Make Offline Mirror of a Site using `wget`
https://www.guyrutenberg.com/2014/05/02/make-offline-mirror-of-a-site-using-wget/
Sometimes you want to create an offline copy of a site that you can take and view even without internet access. Using wget you can make such copy easily:
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent http://example.org
Explanation of the various flags:
--mirror – Makes (among other things) the download recursive.
--convert-links – convert all the links (also to stuff like CSS stylesheets) to relative, so it will be suitable for offline viewing.
@emzo
emzo / s3undelete.sh
Created July 29, 2019 15:26
Undelete files form Amazon S3 (versioned buckets only)
#!/bin/bash
BUCKET=$1
PREFIX=$2
aws s3api list-object-versions --bucket $BUCKET --prefix $PREFIX --output text |
grep "DELETEMARKERS" | while read OBJECTS
do
KEY=$( echo $OBJECTS| awk '{print $3}')
VERSION_ID=$( echo $OBJECTS | awk '{print $5}')
@emzo
emzo / pythonUtf8.md
Created October 7, 2019 08:56 — forked from embayer/pythonUtf8.md
set python default encoding to utf-8

change default encoding

cd ~/.virtualenvs/myvirtualenv/lib/python2.x/site-packages
echo 'import sys;sys.setdefaultencoding("utf-8")' > sitecustomize.py

set default encoding for each new virtualenv

to automatically create a sitecustomize.py every time you create a virtualenv, edit your