$ brew install nginx$ vim /usr/local/etc/nginx/nginx.conf| # -*- coding: utf-8 -*- | |
| # | |
| # Used like this: | |
| # | |
| # from repermute import ipermute | |
| # | |
| # for s in ipermute('[A-Z]\d'): | |
| # print s | |
| # | |
| # Almost all regular expression constructs are supported except for '*' |
| //Install Macports. | |
| //Install aircrack-ng: | |
| sudo port install aircrack-ng | |
| //Install the latest Xcode, with the Command Line Tools. | |
| //Create the following symlink: | |
| sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport | |
| //Figure out which channel you need to sniff: | |
| sudo airport -s | |
| sudo airport en1 sniff [CHANNEL] |
| module RailsAppName | |
| class Application < Rails::Application | |
| # .... your settings | |
| require "#{Rails.root}/lib/cloud_flare_middleware" | |
| config.middleware.insert_before(0, Rack::CloudFlareMiddleware) | |
| # ... your settings | |
| end | |
| end |
| #!/usr/bin/env python | |
| """ | |
| Script for dumping Bluetooth pairings from OS X to a registry file, for Windows | |
| import. This will allow you to have your Bluetooth devices paired with both | |
| operating systems at the same time. | |
| In case of problems with Windows registry entries: pair your device with Windows | |
| first, then with OS X, and then do the dump and import. | |
| Latest version can be found at: |
| # Extremely basic development setup to serve the current directory at http://localhost:9001 | |
| # Start nginx in this directory with `nginx -p . -c nginx.conf` | |
| # Stop nginx with `nginx -p . -s stop` | |
| events {} | |
| http { | |
| # Serve files with correct mimetypes on OSX | |
| # location may have to be adjusted depending on your OS and nginx install | |
| include /usr/local/etc/nginx/mime.types; |
| // This will open up a prompt for text to send to a console session on digital ocean | |
| // Useful for long passwords | |
| (function () { | |
| var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split(""); | |
| function f() { | |
| var character = t.shift(); | |
| var i=[]; | |
| var code = character.charCodeAt(); | |
| var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1 |
| #!/bin/bash | |
| # | |
| # This version uses September 2017 august stretch image, please use this image | |
| # | |
| if [ "$EUID" -ne 0 ] | |
| then echo "Must be root" | |
| exit | |
| fi |
| # UPDATED 17 February 2019 | |
| # Redirect all HTTP traffic to HTTPS | |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| server_name www.domain.com domain.com; | |
| return 301 https://$host$request_uri; | |
| } | |
| # SSL configuration |
In February 2017, Google announced the availability GPU-based VMs. I spun up a few of these instances, and ran some benchmarks. Along the way, I wrote down the steps taken to provision these VM instances, and install relevant drivers.
Update April 2019: Updated instructions to use instances with the Tesla T4 GPUs.