Skip to content

Instantly share code, notes, and snippets.

View pcolby's full-sized avatar

Paul Colby pcolby

View GitHub Profile

Fresh [L]Ubuntu

Just some notes on things I like (or need) to do to make a fresh Ubuntu (or Lubuntu) install usable ;)

Basics

sudo apt install arandr build-essential colordiff curl fonts-noto-color-emoji \
  gawk gpa hunspell-en-au jq keepassxc lcov solaar ssh
@pcolby
pcolby / resume.json
Last active December 27, 2023 03:01
{
"basics": {
"name": "Paul Colby",
"label": "Technology Leader",
"email": "resume@colby.id.au",
"phone": "+61 417 717 669",
"summary": "With more than 20 years experience in software engineering and technical leadership, I've worked successfully at all levels of software delivery, from bare metal software engineering, to architecting large-scale high-throughput low-latency cloud-based systems; building and leading high-performance teams, to complete management of a SaaS startup's IT.\n\nIn all that I do, I strive to deliver quality solutions, with a strong sense of ownership. I value open and transparent communication, with genuine care for the both the business and the people I work with.",
"profiles": [
{
"network": "GitHub",
@pcolby
pcolby / cpu.sh
Created September 14, 2013 04:29
Calculating CPU Usage from /proc/stat
#!/bin/bash
# by Paul Colby (http://colby.id.au), no rights reserved ;)
PREV_TOTAL=0
PREV_IDLE=0
while true; do
CPU=(`cat /proc/stat | grep '^cpu '`) # Get the total CPU statistics.
unset CPU[0] # Discard the "cpu" prefix.
IDLE=${CPU[4]} # Get the idle CPU time.
@pcolby
pcolby / xmlToVariant.cpp
Last active December 28, 2022 19:44
Sample function for parsing a QXmlStreamReader (or part thereof) to a QVariant tree.
QVariantMap xmlStreamToVariant(QXmlStreamReader &xml, const QString &prefix = QLatin1String("."), const int maxDepth = 1024)
{
if (maxDepth < 0) {
qWarning() << QObject::tr("max depth exceeded");
return QVariantMap();
}
if (xml.hasError()) {
qWarning() << xml.errorString();
return QVariantMap();
@pcolby
pcolby / cpp-style.md
Last active January 2, 2020 01:20
cpp-style
--- /usr/local/lib/python2.7/dist-packages/awslogs/core.py.backup 2017-05-25 06:51:39.360136000 +1000
+++ /usr/local/lib/python2.7/dist-packages/awslogs/core.py 2018-02-07 10:11:08.695686691 +1100
@@ -18,8 +18,10 @@
def milis2iso(milis):
- res = datetime.utcfromtimestamp(milis/1000.0).isoformat()
- return (res + ".000")[:23] + 'Z'
+ #res = datetime.utcfromtimestamp(milis/1000.0).isoformat()
+ #return (res + ".000")[:23] + 'Z'
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!--
<match>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Color Emoji</string>
</edit>
</match>
@pcolby
pcolby / rip-dvd-iso.sh
Created January 10, 2018 10:35
A simple way to copy a DVD ISO using dd
#!/bin/bash
DEVICE=/dev/cdrom
DD=`which dd` || { echo 'Required command not found: dd' >&2; exit 1; }
ISOINFO=`which isoinfo` || { echo 'Required command not found: isoinfo' >&2; exit 1; }
SED=`which sed` || { echo 'Required command not found: sed' >&2; exit 1; }
LABEL=`"$ISOINFO" -d -i "$DEVICE" | "$SED" -nre 's/^Volume id: //p'`
BLOCK_SIZE=`"$ISOINFO" -d -i "$DEVICE" | "$SED" -nre 's/^Logical block size is: //p'`
@pcolby
pcolby / ! XPS 13.md
Last active August 24, 2017 19:50
XPS 13 9343

Just some notes on my XPS 13 (9343) setup.

See also mpalourdio/xps13.

DP-1
  -> DP-1-1
    -> DP-1-1-1: Dell 2007FPB (Left)  [eVGA DP3]
    -> DP-1-1-2: Dell 2007FPB (Right) [eVGA DP2]
 -&gt; DP-1-2: Dell U3014 (Middle) [eVGA DP1]