Skip to content

Instantly share code, notes, and snippets.

View ralph-tice's full-sized avatar

Ralph Tice ralph-tice

  • Kentik
  • Texas
View GitHub Profile
@ralph-tice
ralph-tice / gist:7139341
Last active September 28, 2017 19:15
version control jenkins and jobs this shell snippet itself can be used as a jenkins job and it will add itself.
cd /var/lib/jenkins
git add userContent/* -f
git add jobs/*/*.xml -f
git add users/*/config.xml -f
git add *.xml
COUNT=`git ls-files --deleted | wc -l`
if [ $COUNT -ne 0 ]
then git ls-files --deleted | xargs -d '\n' git rm
@ralph-tice
ralph-tice / rsyslog.conf
Last active December 22, 2015 22:59
rsyslog testing
#!/usr/bin/perl
use Sys::Syslog qw( :DEFAULT setlogsock );
setlogsock('unix');
openlog('apache', 'cons', 'pid', 'local2');
while ($log = <STDIN>) {
syslog('notice', $log);
}
closelog
@ralph-tice
ralph-tice / backup_solr_cloud.sh
Last active December 22, 2015 18:18
backup solr cloud v2 courtesy of elyograg @ #solr
#!/bin/bash
# Defaults. Override in /etc/default/solr-backup.
# Unprivileged user/group that we will use to run this script.
B_USR=ubuntu
B_GRP=${B_USR}
# Domain SUFFIX.
SUFFIX=.dnsxSUFFIX.yourhost.com
@ralph-tice
ralph-tice / gist:6310571
Created August 22, 2013 17:55
ISCABBS rant on autocruft.
Jun 4, 2007 12:38 from John Public
WORF> You just stepped in the worst pile of GNU horseshit ever to be barfed
all over the *nix world: autocruft.
The idea is this. You write your app in C. It's 99% portable. However,
different unixes have slightly different C functions, or are missing them. You
could easily workaround this with two lines of preprocessor #ifdefs, or just a
contrib/ directory for patches. Instead, you write some M4 macros to fuss with
some C headers to patch your code. Now your code is 99.1% portable. However,
different unixes have slightly different m4 variants. Damn. Now you need to
@ralph-tice
ralph-tice / gist:5993238
Created July 14, 2013 04:42
given the context of a tweet on twitter that has a pic.twitter.com image this is how you get the actual url to the picture... or is it ? Do I just suck at filtering?
//v1, works, normally .each instead of [0]
$($($('a:contains("pic.twitter.com/")')[0]).parent().parent().parent().data('expandedFooter')).children(".cards-media-container").children().children(".media").children("a").data('url')
//v2, found 'find' instead of 'filter'...
$($($('a:contains("pic.twitter.com/")')[0]).parent().parent().parent().data('expandedFooter')).find("a.media-thumbnail").data('url')
@ralph-tice
ralph-tice / gist:5759242
Created June 11, 2013 18:05
hadoop OSX bootstrap
wget http://apache.claz.org/hadoop/common/hadoop-1.2.0/hadoop-1.2.0-bin.tar.gz
gzip -d hadoop-1.2.0-bin.tar.gz
tar xvf hadoop-1.2.0-bin.tar
cd hadoop-1.2.0
mkdir input
cp ../conf/*.xml ./
export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
export HADOOP_HOME=/Users/ralphtice/hadoop/hadoop-1.2.0/
export HADOOP_OPTS="-Djava.security.krb5.realm=OX.AC.UK -Djava.security.krb5.kdc=kdc0.ox.ac.uk:kdc1.ox.ac.uk"
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@ralph-tice
ralph-tice / gist:5672064
Created May 29, 2013 17:24
stuff installed on new macbook air
#Sublime Text 2 + Ensime for scala development
www.sublimetext.com/2
http://wbond.net/sublime_packages/package_control/installation
https://github.com/sublimescala/sublime-ensime
#x11 forwarding (xquartz)
http://xquartz.macosforge.org/landing/
https://papertrailapp.com/systems/setup
# sudo sh
# cd /etc
# wget https://papertrailapp.com/tools/syslog.papertrail.crt
# yum install rsyslog-gnutls
jar 'com.netflix.hystrix:hystrix-core', '~>1.2.16'