Skip to content

Instantly share code, notes, and snippets.

View rsds143's full-sized avatar

rsds143

View GitHub Profile
@rsds143
rsds143 / counter_replacement.scala
Last active August 29, 2015 14:07
counter replacement
/*
* Copyright 2014 Ryan Svihla
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rsds143
rsds143 / Vagrant_file_dse_spark
Last active August 29, 2015 14:06
Vagrant file to inline configure a 2 node dse spark cluster.
VAGRANTFILE_API_VERSION = "2"
# -*- mode: ruby -*-
# # vi: set ft=ruby :
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
@rsds143
rsds143 / fix_rpc_address.sh
Last active August 29, 2015 14:05
script to fix broken cassandra.yaml
#!/bin/bash
hostList=($(cat hostfile_from_csshx))
for host in $hostList
do
ssh $host "sed -i s/0.0.0.0/$host/g /opt/dse-4.5.1/resources/cassandra/conf/cassandra.yaml"
done
@rsds143
rsds143 / Vagrantfile
Last active August 29, 2015 14:05
Vagrantfile add provisioning joy
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
# Configurate the virtual machine to use 4GB of RAM
@rsds143
rsds143 / cleanup_dse.sh
Last active August 29, 2015 14:05
clean up cassandra data direction on all nodes
#!/bin/bash
hosts = 10.1.10.200,10.1.10.201,10.1.10.202
dse_location = "/opt/dse-4.5.1"
for HOST in $hosts
do
ssh root@%HOST '$dse_location/bin/dse cassandra-stop'
ssh root@$HOST 'rm -fr /var/lib/cassandra'
done
            ConnectorServiceClient client = new ConnectorServiceClient ();
            btMessage message = new btMessage ();
            // you'll need to set message.body to be whatever you need to send
            btMessage response = client.Submit(message);
            XmlElement body = response.body;
            XmlReader bodyReader = body.CreateNavigator ().ReadSubtree ();
            XElement parsedBody = XElement.Load(bodyReader);
            XNamespace msg = "Messages";
            var name =  msg+"appExportResponse";
            XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(AppExportResponse));
@rsds143
rsds143 / chruby.plugin.bash
Last active December 20, 2015 15:19
chruby bash-it plugin
# Load chruby if you are using it
cite about-plugin
about-plugin 'load chruby, if you are using it'
# Check to make sure that RVM is actually loaded before adding
# the customizations to it.
if [ -d /usr/local/share/chruby ];then
source /usr/local/share/chruby/chruby.sh
@rsds143
rsds143 / gist:5788418
Created June 15, 2013 15:02
tmux.conf
#set -g default-terminal screen-256color
#set -g terminal-overrides 'xterm-256*:smcup@:rmcup@'
# improve colors
set -g default-terminal "screen-256color"
# soften status bar color from harsh green to light gray
set -g status-bg '#666666'
set -g status-fg '#aaaaaa'
# remove administrative debris (session name, hostname, time) in status bar
@rsds143
rsds143 / EmailsController.cs
Created May 21, 2013 02:13
WebApi FromBody and FromUrl
public IEnumerable<Email> Get([FromUrl] EmailGetOptions options){
string from = options.From;
//search tables
}
public void Create Post([FromBody] Email email){
//save email
}
@rsds143
rsds143 / gist:5331034
Last active December 15, 2015 22:09
evernote journal
#!/bin/sh
#change checkout_dir to match where you've checked out the latest
checkout_dir=~/Documents/geeknote
#change notebook to whatever notebook you use as your journal
notebook=Journal
title=$1
if [ -z "$1" ]
then
title=$(date +%Y-%m-%d)