Skip to content

Instantly share code, notes, and snippets.

@dasgoll
dasgoll / gist:f5b294e0c9924900fc79
Created October 19, 2015 11:00
Cassandra CQL cqlsh supported version
[root@dev-etl apache-cassandra-2.2.3]# cd bin/
[root@dev-etl bin]# ./cqlsh cassandra1.kafkacluster100.com -u dwhuser -p 'password'
Connection error: ('Unable to connect to any servers', {'cassandra1.kafkacluster100.com': ProtocolError("cql_version '3.3.1' is not supported by remote (w/ native protocol). Supported versions: [u'3.3.0']",)})
[root@dev-etl bin]# ./cqlsh cassandra1.kafkacluster100.com -u dwhuser -p 'password' --cqlversion=3.3.0
Connected to kafkacluster100 at cassandra1.kafkacluster100.com:9042.
[cqlsh 5.0.1 | Cassandra 2.2.1 | CQL spec 3.3.0 | Native protocol v4]
Use HELP for help.
dwhuser@cqlsh>
@kriegsman
kriegsman / TwoAnimationsAtTheSameTime.ino
Last active August 19, 2022 17:54
TwoAnimationsAtTheSameTime - one way to run two different animations at the same time.
#include "FastLED.h"
// TwoAnimationsAtTheSameTime
// Example showing one way to run two different animations on
// two different parts of one LED array at the same time.
//
// The three keys to success here are:
//
// 1. Move the drawing of each animation into a separate 'draw' function,
// each of which is called from 'loop()'. Each 'draw' function draws
@mrlesmithjr
mrlesmithjr / nxlog.conf
Last active November 7, 2019 16:59
Windows nxlog.conf for Logstash
## Please set the ROOT to the folder your nxlog was installed into,
## otherwise it will not start.
#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog
define ROOT_STRING C:\Program Files (x86)\\nxlog
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
@wrburgess
wrburgess / gist:5528649
Last active November 24, 2022 15:29
Backup Heroku Postgres database and restore to local database

Grab new backup of database

Command: heroku pgbackups:capture --remote production

Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712

Get url of backup download

Command: heroku pgbackups:url [db_key] --remote production

@nixme
nixme / acr122u.rb
Created May 17, 2012 08:00
Read NFC tag IDs from a Tagstand ACR122U USB reader
# Quick and dirty script to read unique IDs from NFC tags using the ACR122U USB
# reader.
#
# PC/SC-based API details for the ACR122U available at
# http://acs.com.hk/drivers/eng/API_ACR122U_v2.01.pdf
#
# Assumes ruby >= 1.9.2
# `gem install smartcard` first
#
@kagemusha
kagemusha / gist:1569836
Created January 6, 2012 09:20
Dump Heroku Postgres DB and load locally
Get the Heroku db as detailed here:
http://devcenter.heroku.com/articles/pgbackups#exporting_via_a_backup
1. heroku pgbackups:capture
2. heroku pgbackups:url <backup_num> #=>backup_url
- get backup_num with cmd "heroku pgbackups"
3. curl -o latest.dump <backup_url>
Then locally do:
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump
@shapeshed
shapeshed / unicorn
Created September 16, 2011 10:12
Unicorn / Monit setup
#!/bin/sh
set -e
# Example init script, this can be used with nginx, too,
# since nginx and unicorn accept the same signals
# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/path/to/your/app/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
ENVIRONMENT=production
@bobbrez
bobbrez / gist:993344
Created May 26, 2011 15:15
MySQL on OS X using Homebrew

Change Permissions

You'll need to change the permissions for /usr/local for your local user.

sudo chown -R whoami /usr/local

Homebrew

The easiest way to get everything setup is to use Homebrew. To do this, you'll need to first install XCode from the standard XCode from Apple Developer site. Afterwards you can just install Homebrew though its normal installation

ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"