Skip to content

Instantly share code, notes, and snippets.

@verhovsky
verhovsky / delete_duplicate_images.py
Last active Oct 22, 2018
a script that uses perceptual hashing (pHash) to find all the duplicated images in a directory and delete them
View delete_duplicate_images.py
#!/usr/bin/env python3
'''
find all the duplicated images in the current directory using perceptual hashing and delete them
to install dependencies
$ pip install imagehash Pillow
usage: ./delete_duplicate_images.py [directory containing the images]
'''
@verhovsky
verhovsky / explanation.md
Last active Dec 15, 2017
Useful short prefix search engines for Chrome. Like adding DuckDuckGo bangs to google.
View explanation.md

How to add DuckDuckGo bangs to Google (if you're using Chrome)

Chrome has a feature for defining your own search engines for the omni bar. It's intended for adding search boxes present on other websites, but it accepts arbitrary urls, including modified google search URLs. The URL for a google search query is just google.com/search?q=your+query+with+spaces+replaced+with+plus+signs, which means if you bind a "search engine" like google.com/search?q=wikipedia+%s to "w" you will automatically have the word "wikipedia" added to your search query if you search "w something". You won't even have to type the "!". Here's an example

Go to SettingsManage Search EnginesOther search enginesADD and then

Search engine: wikipedia

Keyword: w

@verhovsky
verhovsky / create_usb_from_iso.sh
Last active Jul 3, 2017
create bootable usb from .iso file on macOS
View create_usb_from_iso.sh
# if you want to boot a laptop from a USB drive and you have a file like archlinux-2017.07.01-x86_64.iso
# (and a USB drive plugged in), this is a script to copy the .iso onto the USB drive.
# like UNetbootin but debuggable.
# https://apple.stackexchange.com/questions/179781/how-to-create-a-bootable-ubuntu-usb-stick-using-os-x-10-10-2
ls
echo "path to .iso?"
read iso_filepath
You can’t perform that action at this time.