Skip to content

Instantly share code, notes, and snippets.

Build tensorflow on OSX with NVIDIA CUDA support (GPU acceleration)

These instructions are based on Mistobaan's gist but expanded and updated to work with the latest tensorflow OSX CUDA PR.

Requirements

OS X 10.10 (Yosemite) or newer

@andrealbinop
andrealbinop / setup-modernie-vagrant-boxes.md
Last active May 28, 2023 01:54
Setup modern.ie vagrant boxes

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites

@alicial
alicial / mock-service-example.js
Last active June 10, 2019 14:26
AngularJS: Setting up a mocked service to use in controller unit tests.
// Mocked Service
angular.module('mock.users', []).
factory('UserService', function($q) {
var userService = {};
userService.get = function() {
return {
id: 8888,
name: "test user"
}
#!/usr/bin/python
# -*- coding: utf-8 -*-
# launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
# launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist
from twisted.internet import reactor, stdio, defer
from twisted.internet.protocol import Protocol, Factory
from twisted.protocols.basic import LineReceiver
import time, re, math, json
@stuartcarnie
stuartcarnie / clear-apc.php
Last active February 25, 2024 11:07
Self-contained php script to clear shared-memory cache in php5-fpm via command-line. In this instance it is clearing APC, but can be easily changed to clear other shared-memory caches.
#!/usr/bin/env php
<?php
/*
Copyright 2013 Stuart Carnie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
@scragg0x
scragg0x / gist:3894835
Created October 15, 2012 19:47
Unserialize PHP Session in Python
def unserialize_session(val):
if not val:
return
session = {}
groups = re.split("([a-zA-Z0-9_]+)\|", val)
if len(groups) > 2:
groups = groups[1:]
groups = map(None, *([iter(groups)] * 2))
for i in range(len(groups)):
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@cheeming
cheeming / patch-fix-slave-ok-flag.diff
Created August 5, 2012 11:28
Patch to fix mongo c driver to allow connection to secondary/slave mongodb instances. This patch will apply cleanly on revision 13808396bd1b128dfa03ea3ba4d3cdccb9d990c7 for https://github.com/mongodb/mongo-c-driver
diff --git a/src/gridfs.c b/src/gridfs.c
index f51b397..66f8d88 100644
--- a/src/gridfs.c
+++ b/src/gridfs.c
@@ -43,7 +43,7 @@ int gridfs_init( mongo *client, const char *dbname, const char *prefix,
int options;
bson b;
- bson_bool_t success;
+ bson_bool_t success = 1;
@cheeming
cheeming / patch-fix-slave-ok-flag2.diff
Created August 5, 2012 11:19
Patch to fix nginx gridfs module to allow connection to secondary/slave mongodb instances. This patch will apply cleanly on revision 76225528b3903fc9eafcb8163c7ebfdf34237e8b for https://github.com/mdirolf/nginx-gridfs.
diff --git a/ngx_http_gridfs_module.c b/ngx_http_gridfs_module.c
index 77ef430..859dff1 100644
--- a/ngx_http_gridfs_module.c
+++ b/ngx_http_gridfs_module.c
@@ -490,7 +490,7 @@ static ngx_int_t ngx_http_mongo_add_connection(ngx_cycle_t* cycle, ngx_http_grid
if ( gridfs_loc_conf->mongods->nelts == 1 ) {
ngx_cpystrn( host, mongods[0].host.data, mongods[0].host.len + 1 );
- status = mongo_connect( &mongo_conn->conn, (const char*)host, mongods[0].port );
+ status = mongo_connect( &mongo_conn->conn, (const char*)host, mongods[0].port, MONGO_SECONDARY_OK );
@loonies
loonies / 1_phpunit-api.md
Last active January 19, 2024 07:34
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this-&gt;anything()