Skip to content

Instantly share code, notes, and snippets.

View mredar's full-sized avatar

Mark Redar mredar

  • CDL
  • Oakland, CA
View GitHub Profile
@tingletech
tingletech / install_gpu.md
Created December 14, 2016 03:39
Notes for setting up to follow https://github.com/tensorflow/models/tree/master/im2txt on a generic ubuntu 14x AMI

Ubuntu/Linux 64-bit, GPU enabled, Python 2.7 Requires CUDA toolkit 8.0 and CuDNN v5.1

Install CUDA 8.0

wget "http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_8.0.44-1_amd64.deb"
sudo dpkg -i cuda-repo-ubuntu1404_8.0.44-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda
@cube-drone
cube-drone / automation.md
Last active March 26, 2024 20:24
Automation For The People

Automation for the People

Long ago, the first time I read "The Pragmatic Programmer", I read some advice that really stuck with me.

"Don't Use Manual Procedures".

This in the chapter on Ubiquitous Automation. To summarize, they want you to automate all the things.

The trouble was that I hadn't much of an idea how to actually go

@ipedrazas
ipedrazas / awslogs-logrotate
Created July 14, 2015 09:50
awslogs logrotate conf
/var/log/awslogs.log {
daily
missingok
notifempty
size 50M
create 0600 root root
delaycompress
compress
rotate 4
postrotate
@bcantoni
bcantoni / Vagrantfile
Created September 23, 2014 01:27
Example Vagrant configuration for use with Amazon Web Services (vagrant-aws plugin)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrant on AWS Example
# Brian Cantoni
# This sample sets up 1 VM ('delta') with only Java installed.
# Adjustable settings
CFG_TZ = "US/Pacific" # timezone, like US/Pacific, US/Eastern, UTC, Europe/Warsaw, etc.
@nod
nod / minimal_ansible_playbook.py
Last active July 17, 2024 10:54
Minimal code to run an Ansible Playbook from within python and get stats back on success or fail
from ansible import playbook, callbacks
# uncomment the following to enable silent running on the playbook call
# this monkey-patches the display method on the callbacks module
# callbacks.display = lambda *a,**ka: None
# the meat of the meal. run a playbook on a path with a hosts file and ssh key
def run_playbook(playbook_path, hosts_path, key_file):
stats = callbacks.AggregateStats()
playbook_cb = callbacks.PlaybookCallbacks(verbose=0)
@billdueber
billdueber / solr_text_types.xml
Last active December 18, 2015 03:09
Umich experimental text types for solr
<!--
#########################
TEXT FIELD TYPES
#########################
In all cases, we want to perform NFKC unicode normalization,
case folding, and ASCII-folding (i.e., removal of accents so
ü => u).
ICUFoldingFilterFactory will give us *all* of those things.

The collection registry manages provenance and non⁃provenance based collections

  • provenance based collection registry
    • needs to sync/link to OAC/ArchviesSpace/MARC when already described
    • use for digitized and potentially digitizable collections
    • control harvest/crawling
    • embargo information

Vocabulary Management

@phred
phred / pedantically_commented_playbook.yml
Last active June 27, 2024 13:39
Very complete Ansible playbook, showing off all the options
---
####
#### THIS IS OLD AND OUTDATED
#### LIKE, ANSIBLE 1.0 OLD.
####
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES
####
#### IF IT BREAKS I'M JUST SOME GUY WITH
#### A DOG, OK, SORRY
####
@dstroot
dstroot / install-redis.sh
Created May 23, 2012 17:56
Install Redis on Amazon EC2 AMI
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@kennethreitz
kennethreitz / 0_urllib2.py
Created May 16, 2011 00:17
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()