Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
COSM_API_KEY="abcdefghijk"
DATASTREAM="/v2/feeds/70987/datastreams/0.csv"
hddtemp -u C -n /dev/sda | \
mosquitto_pub -d -h api.cosm.com -u "$COSM_API_KEY" -t "$DATASTREAM" -s
#!/bin/bash
# installing erlang on ubuntu's
VERSION="R16B"
sudo apt-get install curl build-essential libncurses5-dev openssl libssl-dev
sudo mkdir -p /opt/erlang/
curl -O https://raw.github.com/spawngrid/kerl/master/kerl && chmod a+x kerl
sudo mv kerl /opt/erlang/

Each of these commands will run an ad hoc http server in your current directory. Use this power wisely.

Python 2.x

$ python -m SimpleHTTPServer 8000

Python 3.x

{module, mpegts_alloc}. %% version = 0
{exports, [{module_info,0},{module_info,1},{new,1}]}.
{attributes, []}.
{labels, 7}.
{function, new, 1, 2}.
1. Go to https://dev.twitter.com/
2. Click on "Sign In" in the upper-right corner.
* There is a link to sign up under the username field if you do not already have a Twitter account.
* If you sign up for a new account, you'll have to confirm your email before you can get an API key.
3. Enter your credentials and sign in.
4. Back at https://dev.twitter.com/, click on your avatar in the upper-right corner, then My Applications.
5. Click on "Create a new application".
6. Fill out the information, agree to the Rules of the Road, do the captcha, and click on "Create your Twitter application".
7. In the application page that comes up next, copy down the "Consumer key" and "Consumer secret". This is half of the key info.
8. Click on "Create my access token" at the bottom of the application page, under "Your access token".
@nivertech
nivertech / console.sh
Created July 30, 2013 13:50
CUDA5 with NVIDIA OpenCL on Ubuntu 12.04 on AWS EC2 Cluster GPU instance
$ sudo apt-get purge nvidia*
...
$ sudo ./nvidia_cuda.run
Do you accept the previously read EULA? (accept/decline/quit): accept
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 304.54? ((y)es/(n)o/(q)uit): y
#!/usr/bin/env bash
if [ $# -ne 2 ]
then
echo "Usage: erl_new <type> <project_name>"
exit 1
fi
TYPE=$1
PROJECT_NAME=$2
#!/bin/bash
# Pull this file down, make it executable and run it with sudo
# wget https://raw.github.com/gist/6152521/build-erlang-r16b01.sh
# chmod u+x build-erlang-r16b01.sh
# sudo ./build-erlang-r16b01.sh
if [ $(id -u) != "0" ]; then
echo "You must be the superuser to run this script" >&2
exit 1
fi
# https://discussions.apple.com/thread/4144252
# partition 5 - Ubuntu boot
# partition 6 - Ubuntu swap
# partition 7 - Ubuntu files ~ 100 GB
$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *251.0 GB disk0