This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# find-out-what-is-using-your-swap.sh | |
# -- Get current swap usage for all running processes | |
# -- | |
# -- rev.0.3, 2012-09-03, Jan Smid - alignment and intendation, sorting | |
# -- rev.0.2, 2012-08-09, Mikko Rantalainen - pipe the output to "sort -nk3" to get sorted output | |
# -- rev.0.1, 2011-05-27, Erik Ljungstrom - initial version | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpHeaders requestHeaders = new HttpHeaders(); | |
requestHeaders.add("Cookie", "JSESSIONID=" + session.getValue()); | |
HttpEntity requestEntity = new HttpEntity(null, requestHeaders); | |
ResponseEntity rssResponse = restTemplate.exchange( | |
"https://jira.example.com/sr/jira.issueviews:searchrequest-xml/18107/SearchRequest-18107.xml?tempMax=1000", | |
HttpMethod.GET, | |
requestEntity, | |
Rss.class); | |
Rss rss = rssResponse.getBody(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 )" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: jmxtrans | |
# Required-Start: $local_fs $network $named $time $syslog | |
# Required-Stop: $local_fs $network $named $time $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Description: JMX Proxy | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
STACKDRIVER_API_KEY=$1 | |
JMX_HOST="localhost" | |
JMX_PORT="7199" | |
CASSANDRA_HOST="localhost" | |
CASSANDRA_PORT="7199" | |
curl -O https://repo.stackdriver.com/stack-install.sh | |
sudo bash stack-install.sh --api-key=$STACKDRIVER_API_KEY |