Skip to content

Instantly share code, notes, and snippets.

View chrislovecnm's full-sized avatar
😃
Living LIFE!!

Chris Love chrislovecnm

😃
Living LIFE!!
View GitHub Profile
@chrislovecnm
chrislovecnm / puppetdb test
Created May 28, 2014 19:17
puppetdb test
curl 'http://puppetmaster:8080/v3/resources/Notify/foobar'
[]
cat test.pp
@@notify { "foobar": }
puppet apply test.pp --debug | tee /tmp/puppet.out
^[[0;36mDebug: Configuring PuppetDB terminuses with config file /etc/puppet/puppetdb.conf^[[0m
^[[0;36mDebug: Failed to load library 'selinux' for feature 'selinux'^[[0m
@chrislovecnm
chrislovecnm / copy_lvs.sh
Created June 12, 2014 19:08
Copy a LVS logical volume between volume groups
#!/bin/bash
export mount_point=$1
if [[ -z "$mount_point" ]]; then
echo "pass in drive name as first argument";
exit 1;
fi
# Sanity check that lv is not used
lvuses="$( lvdisplay -c /dev/vg0/${mount_point} | cut -d ':' -f 6 )"
@chrislovecnm
chrislovecnm / install_repos.sh
Created June 13, 2014 00:46
install ubuntu dse and puppet
apt-get install software-properties-common
add-apt-repository ppa:webupd8team/java
echo "deb http://username:password@debian.datastax.com/enterprise stable main" | sudo tee -a /etc/apt/sources.list.d/datastax.sources.list
apt-get install curl
curl -L https://debian.datastax.com/debian/repo_key | sudo apt-key add -
curl -L https://apt.puppetlabs.com/puppetlabs-release-trusty.deb | dpkg -i -
apt-get update
apt-get install oracle-java7-installer
apt-get install dse-full
apt-get install puppet
@chrislovecnm
chrislovecnm / show_chmod_numbers.sh
Created June 27, 2014 17:03
get chmod numbers for a directory
#!/bin/bash
// get the chmod numbers for a directory
// http://stackoverflow.com/questions/1795976/can-the-unix-list-command-ls-output-numerical-chmod-permissions/1796009
ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) \
*2^(8-i));if(k)printf("%0o ",k);print}'
@chrislovecnm
chrislovecnm / nodetool_stats.sh
Last active August 29, 2015 14:11
Monitoring netstats - one lines
while true; do echo "$(nodetool netstats | grep Receiving)"; echo " Finished $(nodetool netstats | grep data | grep cassandr | wc -l)"; echo "$(nodetool netstats | grep -v 100% | grep data)";echo "--------" && sleep 30; done;
@chrislovecnm
chrislovecnm / gist:4af766fdcaec9da01003
Last active August 29, 2015 14:13
Gentoo Perl Purgatory
emerge -av -1 -O =dev-lang/perl-5.18* $(eix '-I#' 'virtual/perl-*') dev-perl/extutils-pkgconfig
perl-cleaner --reallyall -- -v
emerge -vuDN world --with-bdeps=y
@chrislovecnm
chrislovecnm / gist:1338247
Created November 3, 2011 23:24
Git goodness
git pull -s recursive -X theirs
@chrislovecnm
chrislovecnm / gist:1349373
Created November 8, 2011 21:52
Mvn build release instructs from dsyer ~ ampq spring

Requirements:

  • Java 6;
  • Maven 2.2.1
  • (Optional) Ant 1.7.1;
  • If you are on Linux don't use Maven or Ant installed by root (file permission issues with mvn deploy - download it and install it as yourself).

Tagging

@chrislovecnm
chrislovecnm / gist:1359965
Created November 12, 2011 02:59
jquery validation plugin fix
var v = $.browser.msie && !(op.attributes['value'] != null &&
op.attributes['value'].specified) ? op.text : op.value;
// var v = $.browser.msie && !(op.attributes['value'].specified) ?
op.text : op.value;
@chrislovecnm
chrislovecnm / gist:1375751
Created November 18, 2011 06:18
Evil ie dropdowns
function selectDropDownIEbehavior() {
// Apply this behavior for IE only
if (!$.browser.msie)
return;
var expand = function()
{
var width = $(this).css("width");
// Don't overwrite the stored original width,