Forked from @William-Zhang's gist
- NVIDIA Web-Drivers 387.10.10.10.30.106 for 10.13.4 (17E199) (w/o Security Update)
- CUDA-Drivers 387.128
- CUDA 9.1 Toolkit
- cuDNN 7.0.5 (latest for macOS)
#!/bin/bash | |
echo Processing $1 | |
SIZE=`convert -identify -ping $1 /dev/null | cut -d ' ' -f 3` | |
X=`echo $SIZE | cut -d 'x' -f 1` | |
Y=`echo $SIZE | cut -d 'x' -f 2` | |
X=`expr $X - 1500` | |
Y=`expr $Y - 100` | |
mv $1 _$1 | |
set -o verbose | |
convert _$1 -font ~/Downloads/digital_7/digital-7-mono.ttf -pointsize 300 -fill red -annotate +$X+$Y %[exif:DateTimeOriginal] $1 |
import sys | |
import os | |
import json | |
import virtualenv | |
SOURCE = 'src.py' | |
RUNSH = 'run.sh' | |
REQUIREMENTS = 'requirements.txt' | |
BOOTSTRAPENV = 'bootstrap.env' |
- (NSManagedObjectContext *) managedObjectContext { | |
if (_managedObjectContext != nil) { | |
return _managedObjectContext; | |
} | |
NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; | |
if (coordinator != nil) { | |
_managedObjectContext = [[NSManagedObjectContext alloc] init]; | |
[_managedObjectContext setPersistentStoreCoordinator: coordinator]; | |
} |
// this script copies a youtube playlist to the "watch later" list, so you can easily clone the | |
// list by creating a new one off the watch later list. You must run this on a playlist overview | |
// page like http://www.youtube.com/playlist?list=xxxxxxxxx | |
// this script is meant to be converted into a bookmarklet, using something like http://mrcoles.com/bookmarklet/ | |
// after conversion, it becomes this: | |
// javascript:(function()%7Bvar%20buttons%20%3D%20document.querySelectorAll(%22button.addto-watch-later-button%22)%3Bvar%20videos%20%3D%20document.querySelectorAll(%22.playlist-video-item%22)%3Bif%20(videos.length%20!%3D%20buttons.length)%20%7Balert(%22Some%20videos%20are%20already%20in%20watch%20later!%20Found%20%22%20%2B%20videos.length%20%2B%20%22%20videos%20but%20%22%20%2B%20buttons.length%20%2B%20%22%20buttons.%20Abort%20now.%22)%3B%7D%20else%20%7Bif%20(confirm(%22Add%20%22%20%2B%20buttons.length%20%2B%20%22%20videos%3F%22))%20%7Bvar%20dialog%20%3D%20document.createElement(%22h1%22)%3Bdialog.innerHTML%20%3D |
import mock | |
import sys | |
class Finder(object): | |
def find_module(self, name, path=None): | |
print name, path | |
raise ImportError | |
import threading |
#!/bin/bash | |
# Taken from http://gregmac.net/git/2013/06/13/locating-large-objects.html | |
GIT_CMD=/usr/local/bin/git | |
RANGE=$1 # like '1.month.ago' | |
SIZE_THRESHOLD=$2 # size in bytes | |
# Iterate over a list of commits | |
for commit in $(${GIT_CMD} rev-list --all --since={${RANGE}} --pretty=oneline | cut -d' ' -f1); do |
Forked from @William-Zhang's gist
Run sudo ubuntu-drivers devices
to find what drivers are available, and then use apt
to install the driver. In my case, it is apt install nvidia-driver-390
. Reboot after installation completes, and use nvidia-smi
command to ensure the driver is loaded.
Use Anaconda to simplify the process of installing tensorflow and related packages. Install it with wget https://repo.anaconda.com/archive/Anaconda3-5.3.0-Linux-x86_64.sh
and then execute it.