Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / find_imports.py
Last active Feb 7, 2021
Which modules are imported in the Python standard library most often?
View find_imports.py
#!/usr/bin/env python3
# This script scans all .py files in cpython/Lib, finds all import statements
# in them and counts out what is imported most often in each top directory
# or file in Lib/ (meaning if some library is imported many times in various
# files in e.g. Lib/http/ , it will only be counted once).
#
# Clone the CPython repo then put this file in the top level cpython/
# directory and run it:
#
@verhovsky
verhovsky / minimal-stackoverflow-ui.txt
Last active Oct 8, 2022
Stack Overflow minimal content block
View minimal-stackoverflow-ui.txt
! This is a set of filters you can paste into uBlock Origin's "My filters" tab
! to reduce the clutter you see on Stack Overflow
stackoverflow.com,stackexchange.com,askubuntu.com,stackapps.com,mathoverflow.net,superuser.com,serverfault.com##.site-footer
stackoverflow.com,stackexchange.com,askubuntu.com,stackapps.com,mathoverflow.net,superuser.com,serverfault.com##.bottom-notice
stackoverflow.com,stackexchange.com,askubuntu.com,stackapps.com,mathoverflow.net,superuser.com,serverfault.com###hot-network-questions
stackoverflow.com,stackexchange.com,askubuntu.com,stackapps.com,mathoverflow.net,superuser.com,serverfault.com###feed-link
stackoverflow.com##.js-sidebar-zone
! causes suggested edit approve/reject dialog to be hidden on desktop
@verhovsky
verhovsky / symbol_names.md
Last active Oct 14, 2022
Urbit ASCII character names
View symbol_names.md

Hoon is Urbit's high-level programming language. It compiles to Nock, Urbit's low-level language.

https://urbit.org/docs/glossary/

Hoon code makes heavy use of non-alphanumeric symbols. Reading off code aloud using the proper names of ASCII symbols is tedious, so we've mapped syllables to symbols:

ace [1 space]       gap [>1 space, nl]  pat @
@verhovsky
verhovsky / funny_man
Last active Oct 24, 2022
Amusing `man` commands I've typed
View funny_man
man cat
man time
man date
man unzip
man bash
man tree
man route
man convert
man echo