Skip to content

Instantly share code, notes, and snippets.

View elwarren's full-sized avatar

elwarren elwarren

  • this is fun stuff not work
View GitHub Profile
@bitsurgeon
bitsurgeon / nvidia.md
Last active June 20, 2024 16:56
install Nvidia driver on Ubuntu with Secure Boot

Install Nvidia Driver on Ubuntu 18.04.3

Secure Boot

This section applies to machines with Secure Boot, such as ThinkPad.

  1. Before installation, switch to "Discrete Graphics" in BIOS, if both Intel and Nvidia graphics are present.
  2. During installation, make sure to select the "Install third-party software for graphics and Wi-Fi hardware and addition media formats" in "Updates and other software" screen.
  3. Select "Configure Secure Boot", and set password.
  4. Continue Ubuntu installation as normal.
@stevenringo
stevenringo / reinvent-2017-youtube.md
Created December 3, 2017 23:01
Links to YouTube recordings of AWS re:Invent 2017 sessions

| Title | Description

@jsbain
jsbain / avplayer.py
Created September 2, 2017 10:49
avplayer.py
'''
minimal avplayer example
'''
from objc_util import *
AVPlayerItem=ObjCClass('AVPlayerItem')
AVPlayer=ObjCClass('AVPlayer')
AVPlayerLayer=ObjCClass('AVPlayerLayer')
import photos
def pick_asset():
assets = photos.get_assets(media_type='video')
@szinck
szinck / alb_logs.sql
Created August 13, 2017 02:21
Athena Table for ALB Logs
-- This creates an athena table that can parse ALB logs.
-- Advantage of this over others are this works when the log ends with a trailing space
-- plus it also breaks the http request into route and params for easier grouping
CREATE EXTERNAL TABLE IF NOT EXISTS alb_logs (
type string,
timestamp string,
elb string,
client_ip string,
client_port int,
@gbaman
gbaman / HowToOTGFast.md
Last active July 19, 2024 23:49
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@cboettig
cboettig / docker-compose.yml
Last active December 31, 2023 15:23
debugging NGINX configuration for Jupyter
jupyter:
image: jupyter/datascience-notebook
environment:
- PASSWORD=${PASSWORD}
nginx:
image: nginx
links:
- jupyter
@iconara
iconara / queries.sql
Last active November 13, 2023 22:26
Low level Redshift cheat sheet
-- Table information like sortkeys, unsorted percentage
-- see http://docs.aws.amazon.com/redshift/latest/dg/r_SVV_TABLE_INFO.html
SELECT * FROM svv_table_info;
-- Table sizes in GB
SELECT t.name, COUNT(tbl) / 1000.0 AS gb
FROM (
SELECT DISTINCT datname, id, name
FROM stv_tbl_perm
JOIN pg_database ON pg_database.oid = db_id
@carsonfarmer
carsonfarmer / README.md
Last active February 8, 2016 03:56
CitiBike Trips

CitiBike trips by Neighborhood

Mouseover to focus on rides to or from a single neighborhood.

The thickness of links between neighborhoods encodes the relative frequency of rides between two neighborhoods: thicker links represent more frequent rides. Only flows that represent more than 1000 trips are represented here to avoid too many small flows.

Links are directed: for example, while 0.5% of rides go from Midtown to the Flatiron District, only 0.4% go in the opposite direction. Links are colored by the more frequent origin.

This may not be the best visualisation for this type of data, particularly given how dense the connectivity matrix is. However, it does present a quick and fun way to checkout the CitiBike data at an aggregate level.

@omz
omz / ShowLastPhotoMap.py
Last active March 21, 2019 16:04
ShowLastPhotoMap
# Shows the location of the last photo in the canera roll in the Maps app.
# (thanks to @HyShai for pointing out that the latitude/longitude refs are necessary)
import photos
import webbrowser
meta = photos.get_metadata(-1)
gps = meta.get('{GPS}')
if gps:
latitude = str(gps.get('Latitude', 0.0)) + gps.get('LatitudeRef', '')
@craigeley
craigeley / sifttter.rb
Last active July 23, 2018 16:37
This script looks for text files in a specific folder that include completed tasks ('@done') and timestamps, and then collects them into a daily log for the Day One journaling application. It works especially well when it's connected to IFTTT. See more details at http://craigeley.com/tagged/sifttter
#!/usr/bin/ruby
# SIFTTTER 1.5: An IFTTT-to-Day One Logger by Craig Eley 2014 <http://craigeley.com>
# Based on tp-dailylog.rb by Brett Terpstra 2012 <http://brettterpstra.com>
# Multiple Date Function by Paul Hayes 2014 <http://paulrhayes.com>
#
# Notes:
# * Uses `mdfind` to locate a specific folder of IFTTT-generated text files changed in the last day
# * The location of your folder should be hardcoded in line 67, and the location of your Day One in line 66
# * Scans leading timestamps in each line matching the selected dates
# * Does not alter text files in any way