Let's look at some basic kubectl output options.
Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).
We can start with:
kubectl get no
| FILE SPACING: | |
| # double space a file | |
| sed G | |
| # double space a file which already has blank lines in it. Output file | |
| # should contain no more than one blank line between lines of text. | |
| sed '/^$/d;G' |
| install_selenium_server_standalone() { | |
| local desired_version=${1:-latest} | |
| # Create our shell user | |
| init_shell_user "selenium" "*" | |
| local selenium_download_site="http://selenium-release.storage.googleapis.com" | |
| local selenium_releases=$(curl --silent --show-error "$selenium_download_site" | grep --only-matching --perl-regexp '[0-9\.-\w]+?/selenium-server-standalone.*?\.jar' | sort --reverse) | |
| if [ "$desired_version" == "latest" ]; then |
| public class Permutations { | |
| public static <T> Stream<Stream<T>> of(final List<T> items) { | |
| return IntStream.range(0, factorial(items.size())).mapToObj(i -> permutation(i, items).stream()); | |
| } | |
| private static int factorial(final int num) { | |
| return IntStream.rangeClosed(2, num).reduce(1, (x, y) -> x * y); | |
| } |
This is a quick reference to get to Jolokia statistics urls for JBoss Fuse or JBoss A-MQ statistics. Sometimes, when you are interested in very specific attributes, it's easier to keep monitoring a specific url rather than loading the full Hawtio console.
Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.
cherry-pick does support a range of commits, but if you have merge commits in that range, it gets really complicated
git checkout branch-B
git cherry-pick X
git cherry-pick Y
Centos 6.* comes with Python 2.6, but we can't just replace it with v2.7 because it's used by the OS internally (apparently) so you will need to install v2.7 (or 3.x, for that matter) along with it. Fortunately, CentOS made this quite painless with their Software Collections Repository
sudo yum update # update yum
sudo yum install centos-release-scl # install SCL
sudo yum install python27 # install Python 2.7
To use it, you essentially spawn another shell (or script) while enabling the newer version of Python:
| #!/bin/bash | |
| # Perform installation as root | |
| # Install prereqs | |
| yum -y install libcurl libcurl-devel rrdtool rrdtool-devel rrdtool-prel libgcrypt-devel gcc make gcc-c++ | |
| # Get Collectd, untar it, make it and install | |
| wget http://collectd.org/files/collectd-5.4.0.tar.gz | |
| tar zxvf collectd-5.4.0.tar.gz |
A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.
As it turns out, there are several open-source tools that allow for conversion between file types. Pandoc is one of them, and it's powerful. In fact, pandoc's website says "If you need to convert files from one markup format into another, pandoc is your swiss-army knife." But, although pandoc can convert from markdown into .docx, it doesn't work in the other direction.
| import org.apache.poi.ss.usermodel.* | |
| import org.apache.poi.hssf.usermodel.* | |
| import org.apache.poi.xssf.usermodel.* | |
| import org.apache.poi.ss.util.* | |
| import org.apache.poi.ss.usermodel.* | |
| import java.io.* | |
| class GroovyExcelParser { | |
| //http://poi.apache.org/spreadsheet/quick-guide.html#Iterator |