Skip to content

Instantly share code, notes, and snippets.

View niccottrell's full-sized avatar
🏠
Working from home

Nicholas Cottrell niccottrell

🏠
Working from home
View GitHub Profile
@smitshilu
smitshilu / Tensorflow_Build_GPU.md
Last active June 9, 2020 18:27
Tensorflow 1.4 Mac OS High Sierra 10.13 GPU Support

Tensorflow

System information

  • OS - High Sierra 10.13
  • Tensorflow - 1.4
  • Xcode command line tools - 8.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)
  • Cmake - 3.7
  • Bazel - 0.7.0
@jganzabal
jganzabal / Nvidia Titan XP + MacBook Pro + Akitio Node + Tensorflow + Keras.md
Last active November 2, 2022 11:43
How to setup Nvidia Titan XP for deep learning on a MacBook Pro with Akitio Node + Tensorflow + Keras

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

@steffenr
steffenr / url.php
Last active March 24, 2016 10:51
Create link with attributes in Drupal 8
<?php
$link_url = Url::fromRoute('node.add', array('node_type' => $content_type));
$link_url->setOptions(array(
'attributes' => array(
'class' => array('button')
),
'query' => \Drupal::destination()->getAsArray(),
));
$link_text = t('Add !content_type content', array('!content_type' => ucfirst($content_type)));
// Build link
@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active April 25, 2024 22:55
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@niccottrell
niccottrell / mongodb-arbiter.conf
Created August 14, 2014 09:22
mongodb arbiter configuration file (shard)
systemLog:
destination: file
path: "/var/log/mongo/mongo-arb.log"
logAppend: true
storage:
dbPath: "/var/lib/mongo-arb"
processManagement:
fork: true
pidFilePath: "/var/run/mongo/mongod-arb.pid"
net:
@matteofigus
matteofigus / mongo-ls.js
Created February 6, 2014 12:29
A script to list all the collections and document count for a specific mongodb db
// Usage: mongo {Server without mongodb:// example 127.0.0.1:27017}/{DbName} [-u {Username}] [-p {Password}] < ./mongo-ls.js
var collections = db.getCollectionNames();
print('Collections inside the db:');
for(var i = 0; i < collections.length; i++){
var name = collections[i];
if(name.substr(0, 6) != 'system')
print(name + ' - ' + db[name].count() + ' records');
@zhovner
zhovner / etckeeper.sh
Created February 5, 2013 18:02
etckeeper setup with bitbucket repo
# После установки etckeeper
/etc/etckeeper/etckeeper.conf VCS="git"
etckeeper init && etckeeper commit
# ------
git config --global user.name "My Machine"
git config --global user.email "etckeeper@my.machine"
@fkei
fkei / backup.py
Created August 23, 2012 06:27 — forked from rore/backup.py
A script to automate freezing XFS and locking MongoDB and snapshotting EBS volumes
#!/usr/bin/env python
from __future__ import with_statement
import contextlib
import logging
import os
import sys
import urllib2
from boto.ec2.connection import EC2Connection
@eranation
eranation / gist:3241616
Created August 2, 2012 22:51
MongoDB Aggregation Framework way for "select count (distinct fieldName) from someTable" for large collections
//equivalent of "select count (distinct fieldName) from someTable"
db.someCollection.aggregate([{ $group: { _id: "$fieldName"} },{ $group: { _id: 1, count: { $sum: 1 } } } ])