Merging two hash maps seems like an O(N) operation. However, while merging millions of keys, I encountered a massive >10x performance degradation unexpectedly. This post explores why some of the most popular libraries fall into this trap and how to fix it. The source code is available here.
| # Put this function to your .bashrc file. | |
| # Usage: mv oldfilename | |
| # If you call mv without the second parameter it will prompt you to edit the filename on command line. | |
| # Original mv is called when it's called with more than one argument. | |
| # It's useful when you want to change just a few letters in a long name. | |
| # | |
| # Also see: | |
| # - imv from renameutils | |
| # - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste) |
This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).
Matrix multiplication is a mathematical operation that defines the product of
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" | |
| "strconv" |
| package main | |
| import ( | |
| "context" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" |
| #!/bin/sh | |
| # /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh | |
| # INSTALL | |
| # | |
| # > curl -L 'https://gist.github.com/paulfurley/46e0547ce5c5ea7eabeaef50dbacef3f/raw/56ee5dd5f40dec93b8f7438cbdeda5475ea3b5d2/randomize-mac-addresses.sh' |sudo tee /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh | |
| # > sudo chmod +x /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh | |
| # Configure every saved WiFi connection in NetworkManager with a spoofed MAC |
| ######################################################################### | |
| # Wifiscanner.py - A simple python script which records and logs wifi probe requests. | |
| # Author - D4rKP01s0n | |
| # Requirements - Scapy and Datetime | |
| # Inspiration - Tim Tomes (LaNMaSteR53)'s WUDS https://bitbucket.org/LaNMaSteR53/wuds/ | |
| # Reminder - Change mon0 (around line 65) to your monitor-mode enabled wifi interface | |
| ######################################################################### | |
| from datetime import datetime |
ElementaryOS - Loki is an amazing ubuntu based distribution, I've just felt in love on it BUT they've removed what's required to install easily the nVidia Proprietary drivers. So here is the reason of this gist, to store the install instructions in one place inside a crystal clear documentation.
Open your favorite terminal application then type sudo ubuntu-drivers devices, you should get something like this:
| # VERSION: 0.1 | |
| # DESCRIPTION: Build an Electron app in a container | |
| # AUTHOR: Paul Betts <paul@paulbetts.org> | |
| # COMMENTS: | |
| # Use Surf to build an Electron app in a container and upload the result | |
| # Originally based on the Atom Dockerfile by Jessica | |
| # Frazelle <jessie@docker.com> | |
| # USAGE: | |
| # # Download atom Dockerfile | |
| # wget https://raw.githubusercontent.com/atom/atom/master/Dockerfile |