Ansible and AWS Tips
I’ve been using Ansible to provision resources on AWS. Here is a collection of tips and things I wish I’d know before starting.
I’ve been using Ansible to provision resources on AWS. Here is a collection of tips and things I wish I’d know before starting.
“They” say that Linux m4 is a useful tool but I’ve never had the time to get my head around it. This is a small recipe.
Notes on Haskell Folds.
Today I released soniah/awsenv - a small binary for helping load aws environment variables.
A list of Go libraries and tools I find useful.
My work associate Peter Viertel recently gave a lunchtime brownbag on Docker.
Some notes on Docker Dockerfiles.
A quick howto on working with AWS .pem ssh certificates.
My notes on Russ Olsen’s excellent book Eloquent Ruby. These aren’t meant to be full and complete notes they’re just things I want to remember; for more details see the book.
I just finished attending the excellent Brisbane YOW! Lambda Jam. One of the really useful things I learned from Tony Morris was “Hole Driven Development” for Haskell - basically using the type system to help you write a function.
A guest blog post I wrote on managing git branches when doing devops.
When doing Devops we all know that using source code control is a “good thing” — indeed it would be hard to imagine doing Devops without it. But if you’re using Puppet and R10K for your configuration management you can end up having hundreds of old branches lying around — branches like XYZ-123, XYZ-123.fixed, XYZ-123.fixed.old and so on.
SaltStack currently doesn’t set the hostname correctly on Debian/Ubuntu. For example, this won’t work:
Instructions on how to build the development version of Terraform.
I’ve been migrating some repositories from Mercurial to Git; as part of this migration process some users want to keep using Mercurial locally until they have time to learn git.
A list of ‘Essential Reading’ for SaltStack. A collection of useful links, mostly for myself but possibly helpful to others.
Some notes on setting up Arduino on Debian.
How to change the default editor in Debian (for root), as I keep forgetting:
I’m using FreeNAS for my storage at home, liking it a lot. But the web interface can get rather slow when searching for snapshots, as always the shell is faster.
How to convert LibreOffice .ods files to .csv from the command line - useful for scripts or when working without X:
I recently came across a useful tool while reading The Debian Administrator’s Handbook - debfoster.
I’ve recently been working on a large Go project, and one of the deliverables was that the project be buildable using Jenkins.
There is already a great article on Profiling Go Programs. However that article only discusses how to profile a standalone binary - what about a library?
There are many pages out there discussing how to recover an Ubuntu encrypted home directory (see also below).
Git bisect is a great tool for finding bugs in a program. But many examples show manual uses of git bisect - here’s an example of automating the process using git bisect run.
Today I released soniah/gosnmp - an update of alouca/gosnmp.
I’ve just finished refactoring a large Go program, and the process was rather…. pleasant.
Update 8/Mar/13. Work on gsnmpgo has halted. Making the gsnmp C library multithreaded was proving too time consuming. Use http://github.com/soniah/gosnmp instead.
(Just a summary of Stack Overflow “How do you Remove an Invalid Remote Branch Reference from Git?”).
Git has a “force push” option (git push -f remote branch), but it doesn’t have a “force pull” option (like git pull -f remote branch).
When creating files in Linux (and other OS’s) there’s the usual convention of .txt for text files, .c for C files, etc - you just pick them up as you go along.
I got a Huawei HSPA E1762 USB stick a few months ago for 3G network access, together with Exetel’s $5/month Zero Gig plan (uses the Optus network). Great for when I’m out and about and can’t find a wireless signal to jump onto, or I’m at some client who doesn’t allow laptops onto their network.
Bufexplorer - my new favourite add-on for vim.
I’m tired of Ubuntu’s latest desktop mess offering (Unity). I’ve been trying lots of DE’s (Desktop Environments) and WM’s (Window Managers), and I’ve finally settled on one I luuuuurv - Xmonad.
A quick example of sending email from the shell via mutt.
Here’s the setup I use for compiling Go binaries, as well as for writing .deb’s to package them and markdown for README’s - notes for me.
Notes to myself more than anything, and not really specific to Go (but that’s where I was using it).
A question I get regularly from other sysadmins - how to tell if you’re running a 32 or 64 bit install (vs CPU) of Linux?
Some doco for my work mates, and others learners of git…
Here’s how to debug a Perl program that’s running remotely on a server that doesn’t have X. It’s pretty simple, these are just notes for me…
4clojure problem 59 Juxtapostion - here’s how I approached the problem (warts and all) in the hope that it helps others who are learning Clojure.
I was doing remote internet support the other day for a friend in England - here’s how I connect remotely to the person’s desktop in graphical mode, using vnc and an ssh tunnel.
4clojure problem 100 - calculate the Least Common Multiple (LCM) of two or more numbers.
My new favourite git option:
4clojure problem 97 Pascal’s Triangle - calculate the nth row:
My first attempt at writing up one of my 4clojure solutions. Problem 63 “Group a Sequence” requires you to re-implement group-by. As always looking at the source code is cheating :-)
I’ve been playing with Lisp and now Clojure for a couple of years now. Here’s a list of the books I’ve read on my journey to Clojure enlightenment (I’ve still got a long way to go…).
A small Vim Buffers cheatsheet:
A little problem I came across today. When you install ImageMagick (IM) on RHEL (or OEL or similar), IM fails when converting pdfs.
Up late tonight reading about Emacs Lisp, I came across Tour de Babel by Steve Yegge comparing different languages (C, C++, Java, etc), and why he likes Lisp and Ruby so much.
I’ve been using GNU Screen for years, and I always wished it had a “broadcast” functionality like MultiXterm.
One of the features I’ve always wished Gnu screen had was the ability to split a screen horizontally, so you can for example run a grep or mc in the top half of the terminal, and some commands in the bottom half.
I little command I always have to search for when using vimdiff – :diffupdate
I’ve just setup the venerable [denyhosts][1] on one of my servers, to stop the usual script-kiddies from filling up my logs (I’m not particularly worried about them getting in.).
A little ssh error I came across while trying to work remotely on an Ubuntu machine. [ssh X Display Forwarding][1] wasn’t working, and I was getting an error:
To reload your [mutt][1] configuration (for example after editing muttrc):
Whenever I come across servers with names like chpvuat01, I’m reminded of [RFC 1178][1] “Choosing a name for your computer”. Especially when ch stands for crack house, pv stands for paid verbiage, but uat doesn’t stand for user acceptance testing: the box used to be in UAT, was moved to SIT (System Integration Testing), but kept it’s old name because renaming it would be too hard.
Midnight Commander (mc) is mostly obvious, but there’s a few things I regularly forget and have to look up.
My new favourite git option:
Some notes on ruby, blocks, and procs.
A script to make an existing git branch track a remote branch. For example when you’ve cloned from somewhere else and now want to track your normal remote.
If you work in an IT environment, it’s nice to be able to quickly share some of your git repositories from your workstation, without setting up accounts and ssh keys ie using http.
A script I wrote – rsyncp. It allows you to provide a password to rsync over ssh, when you’re unable to use ssh key-based authentication:
Both $* and $@ expand to “all positional parameters”; in a nutshell – ”$@” is often desired as it handles spaces correctly; see man bash “Special Parameters”.
For development projects, I use the standard git workflow ie master is my main branch, and I do development in branches (read more about this recommended workflow at [A successful Git branching model][1]**).
Opinions around the latest Ubuntu (11.04) range from “interesting” (as in the curse “may you live in interesting times”) to “it sucks”.
A nice tool written by Jeremy Visser – [Python-iView][1].
A nice option I discovered in [rsync][1] – the –fuzzy option.
A nice little [snippet ][1]I came across yesterday on configuring RedHat up2date.
Every time I go to loop mount an iso file, it’s long enough since I last did it that I have to “re-google”.
I watch lots of (martial arts) instructional videos.
I’m using the Cisco VPN client, and it seems unreliable on Linux – it occasionally connects but often just gives up with “Remote peer is no longer responding”.
I blogged [previously][1] about how the Australian locale in Ubuntu incorrectly uses Sunday rather than Monday as the first day of the week, and how to manually fix it. Unfortunately, whenever the locale gets updated (eg via one of Ubuntu’s regular package updates), the locale reverts and you have to manually fix it again.
Here’s how to install Virtualbox 2.1.4 on Ubuntu Jaunty (people are [saying][1] 2.2.0 is buggy). And now that Oracle owns Sun, Virtualbox may go the way of the dodo.
I’ve always used vim as my main editor, but I thought I’d try RadRails since so many Rails people rave about it.
I recently bought a new laptop – a bottom of the range Toshiba Satellite Pro L300 costing $780 (extra RAM pushed the price up).
Some good documentation on [Troubleshooting Sound on Ubuntu][1].
ipcalc – a tool I used to use years ago but had forgotten about.
(Updated May/09 for Ubuntu 8.10/Ibex): for a long time I couldn’t get JPilot syncing with my Palm Pilot on Ubuntu 8.04 and 8.10.
Discontinued versions of Ubuntu are mirrored under http://old-releases.ubuntu.com/ubuntu/, which can be used to setup apt’s sources.list.
I recently reinstalled Ubuntu Gutsy on one of my laptops, and the fonts in Firefox came up ugly.
It’s years since I’ve dealt with apt-pinning, so all my knowledge on it has paged-out.
I got a pleasant surprise last night – well pleasant for the Spanish spea[][1]king part of my brain, anyway.
Notes from a recent post on SLUG:
A [good article][1] on Oracle and shmmax and shmall. In a nutshell:
I’ve used [putty.exe][1] for doing ssh client work on Windows machines for years.
When posting code into vim, it often auto-indents it in a staircase fashion off to the right – really annoying.
The Reverand Simon Rumble wrote a nice post on [Mobile broadband over Bluetooth with Ubuntu 8.10][1] using [Blueman][2].
A post a stumbled upon – [Speed up Firefox on Linux – Disable IPv6 Lookups][1].
I can never remember what those comments that change vim settings are called, and spend hours trawling through vim’s help.
A good post from Glen Turner on SLUG about udev, HAL, DBUS (in the context of GSM modems):
A useful tool I came across last night (thanks Rodrigo) – sfdisk – “Partition table manipulator for Linux”.
[wicd][1] – “an open source wired and wireless network manager” – a possible replacement for Ubuntu’s annoying Network Manager (Mangler?).
I’ve noticed that issuing a sudo halt on my [EeePC 701][1] shuts down the operating system ([eeeXubuntu][2]), but doesn’t power down the system.
A useful tool I’ve come across (thanks JB) – socat. As the [homepage][1] says, sort of netcat++.
VMWare Tools need to be installed on guests to prevent approx 50% time loss. Here are the steps:
I’ve just started using Evolution to access the hExchange server at work, and it keeps on popping up new email notifications (even though I’ve disabled it in Evolution and restarted X) – too much like Winblows for my likings.
[Gutsy Intel HD Audio Controller][1], “Method G”
A list of useful tools for network monitoring on Linux:
I’ve been going to a few job interviews recently. One the standard ‘tricky’ (oooooh) Linux questions is “explain suid, sgid, sticky bit, etc”.
Under the Australian locale, the first day of the week appears as Sunday rather than Monday, which is incorrect. To change it:
[Good article][1] and comments on slashdot about Open Source Calendaring replacements for Exchange, et al.
Summary:
Linux ACLs (Access Control Lists) can be a bit difficult at first – here’s my understanding of how they work:
Subversion Cheatsheet
**Rip audio from a dvd **
atime, ctime, mtime
HowTo Search SLUG Archives
Multisite CVS Drupal Installation on Ubuntu
Here’s how to find the 50 biggest files on a partition:
Useful tool for converting audio files
A useful tool for splitting mp3 music files on Linux is mp3splt. To install it on Ubuntu or Debian based distributions, type:
HowTo Setup 3 Broadband Wireless on Ubuntu Linux
On Ubuntu Edgy I notice that when I do an ‘apt-get update’ I get
messages like this:
I blogged a while ago about [using FuzzyOcr for detecting image spam][1]. My FuzzyOcr isn’t working and at the moment I haven’t got time to fix it, so I wrote a procmail recipe to solve the problem instead:
A useful collection of scripts for helping with pgp, including caff – a script that helps you in keysigning – http://pgp-tools.alioth.debian.org/. In Debian, these tools are included in the [signing-party][1] package. There’s also a writeup about how to use them effectively (addressed to the participants of LCA2006) [here][2].
HowTo Disable Session Restore in Firefox 2.0
To rebuild a package, I usually:
checkinstall – build .deb’s from .tar.gz’s
Using kickstart to automate Redhat/Fedora setups
ipw2200 wireless on linux
procmail notes
pdf toolkit
howto fix broken grub
ActiveCollab
[Screen][1] is a really useful console tool that allows you to copy and paste text, scroll back through screen output, reattach if you lose your connection, and so on. One useful trick is sharing a screen between 2 or more users, so you can see what each other is doing whilsts typing – useful for learning or solving a difficult problem (see also [LinuxQuestions.Org][2]).
Useful tool: [Monit][1]
I usually use vimdiff to find the differences between two files; here are some gui tools that do the same thing:
sharing application data on a dual boot laptop
Two useful tools for modifying Debian/Ubuntu runlevels (apart from just editing the links directly in /etc/rc?.d):
A while ago I bought a [account][1] from Telstra for roaming wireless on my laptop – it uses a Maxon MiniMax [MM-5500U][2] to connect on the CDMA phone network. I got this rather than other wireless products as I was going to be doing some work in Perth, and this was the only network that had coverage.
automatically load ssh key on login
using kpkg to build kernels