How to push to a private Docker registry

  07-17-2015 · Tagged under: docker

I’ve recently setup a internal registry server on my CoreOS cluster and am now able to push images locally. Check out this script I created to bring up a local registry server. Once the registry is up and you need to push to it. You’ll want to tag the image you plan to push. docker tag 179a693aa1d5 10.1.10.2:5000/nginx Here the hash “179a693aa1d5” is the local image I built and want to send to the registry server at 10.

Read more...

Git cheatsheet

  07-08-2015 · Tagged under: git

I leverage Git on a daily basis to add and track changes. But often other less used commands such as tag, amend, are often forgotten or I forget how to use them. Here’s a complete list of useful Git one liners I reference when I get stuck. Tagging a previous commit so we can roll back to it for builds. git tag -a v4.4 ac903bf -m "My tag message" Where ac903bf = commit id and 4.

Read more...

How to access the Raspberry Pi filesystem from OS X

  01-18-2015 · Tagged under: pi

In a series of unfortunate events I ended up screwing up all out of band access I had to my Pi by trying to configure a static IP address for wireless usage. I operate in headless mode without a monitor so if the wireless or network is down the only means I can connect to it is via a GPIO cable. Well as luck would have it the GPIO cable also no longer works and I had to wait for another to arrive in the mail.

Read more...

How to check the version of CoreOS you are running

  01-18-2015 · Tagged under: coreos

Similar to how Red Hat uses /etc/redhat-release to show you the release you are on, you can query the same thing within CoreOS. CoreOS release information is stored in /etc/os-release $ cat /etc/os-release NAME=CoreOS ID=coreos VERSION=444.5.0 VERSION_ID=444.5.0 BUILD_ID= PRETTY_NAME="CoreOS 444.5.0" ANSI_COLOR="1;32" HOME_URL="https://coreos.com/" BUG_REPORT_URL="https://github.com/coreos/bugs/issues" This info will help you determine what release your on and if you’ll need to upgrade.

Read more...

How to connect to an external url through a proxy using netcat

  01-18-2015 · Tagged under: netcat

If your corporate security team blocks all direct outbound connectivity to port 443 and forces all traffic through a proxy, then how do you test a external website connection? Instead of using telnet and manually connecting to the proxy and then outbound, you can do it with a single one liner using Netcat. nc -v -x192.168.1.10:3128 -Xconnect www.google.com 443 Here we specify our internal proxy address the port it’s listening on.

Read more...

How to determine if syslog is listening using netcat

  01-18-2015 · Tagged under: syslog

During my weekend adventures of playing with HAProxy and syslog, I needed to figure out if a configured syslog server was listening on the other end. After opening up iptables rules and configuring the syslog receiver, it was time to send some test messages. To do this, I used netcat. nc -w0 -u yourlogserver.dky.io 514 <<< "sometest log event" This will send a single event to your log server. Hopefully if you configured logging correctly you should see it come through.

Read more...

How to exclude a range mac addresses with nmap

  01-18-2015 · Tagged under: nmap

I needed to figure out how to exclude a group of Polycom VoIP devices from a nmap scan and couldn’t figure out how to exclude based on MAC addresses. With really ugly egrep, awk, and tr I was able to come up with a solution to populate an exclude list of IP addresses. sudo nmap -sP 192.168.1.0/24 | egrep "00:04:F2" -B 2 | awk '/^Nmap scan report/ { print $6 }' | tr -d '(' | tr -d ')' > exclude.

Read more...

How to explicitly define your Puppet agent cert name

  01-18-2015 · Tagged under: puppet

If you are building Puppet nodes in a cloud environment you might be assigned a random hostname/domain name when bringing up the host. This becomes problematic when you join the agent to your Puppet master since you’ll get this random hostname in certificate list. To explicitly define your host or domain name you’ll want to use the certname directive in your /etc/puppet/puppet.conf file. [main] logdir=/var/log/puppet vardir=/var/lib/puppet ssldir=/var/lib/puppet/ssl rundir=/var/run/puppet factpath=$vardir/lib/facter templatedir=$confdir/templates certname=webserver1.

Read more...

How to hard code your puppet master

  01-18-2015 · Tagged under: puppet

After registering and having client certificate signed by the master, if you attempt issue a configuration run and get the following error: # puppet agent --test Error: Could not request certificate: getaddrinfo: Name or service not known Exiting; failed to retrieve certificate and waitforcert is disabled It means that the client can’t find the Puppet master. In my case I had a A record resolving to my puppet master but that wasn’t enough.

Read more...

How to install Bash in boot2docker

  01-18-2015 · Tagged under: bash

I was messing around with boot2docker and realized that it didn’t have Bash installed by default. After some digging I figured you can get bash installed running: tce-load -wi bash This pulls the package from the tiny-core repos. Tiny-core also releases a nice little cheat sheet here as a reference on installing packages.

Read more...