Plurrrr

a tumblelog
home

Commit messages guide

I just read the Commit messages guide, a guide to understand the importance of commit messages and how to write them well by Rômulo Oliveira.

Testing ProxyChains with cURL

Today I wanted to test ProxyChains with a SOCKS5 tunnel, which I did as follows:

$ proxychains curl ipinfo.io

This returns JSON which includes the proxy's IP address if everything works as expected, which it did.

For more information on how to use proxychains, see: Subversion proxy: fixed IP address with proxychains

How to use jq in a shell pipeline

If you use the identity filter, '.', you can pipe output of a command to jq, a lightweight and flexible command-line JSON processor, and have it pretty printed. For example:

curl -s ip-api.com/json/ | jq '.'

The above will show information about your current (external) IP address, similar to http://ipinfo.io/.

For more information about jq, see the jq Manual.

Building the latest version of ProxyChains NG

Today I also built the latest version of ProxyChains NG in order to get rid of the "ProxyChains-3.1 (http://proxychains.sf.net)" message the old version of ProxyChains prints to stdout.

Tumblelog version 1.0 released

I just pushed version 1.0 of tumblelog, both the Perl and Python version, to GitHub.

New are the --version option and a [% version %] tag. The latter can be added to the template.

Mudan flowering

Mudan (Paeonia suffruticosa) flowering Mudan, Paeonia suffruticosa, flowering.

Yesterday, I used the PlantSnap app on my iPhone 5 to identify a flowering bush growing in my mother's garden. The program suggested that it was a Paeonia suffruticosa. Today the flower I took a photo of yesterday was more open so I took another photo for this blog.

Refactoring tumblelog

This morning I refactored the Perl version of tumblelog because I wanted to add next and previous links to the day pages. Yesterday, I had done some brainstorming and I concluded that quite a rewrite was required, which was indeed the case.

In the evening I modified the Python version based on the new Perl version. Both versions are available on GitHub.

WD My Passport arrived

WD My Passport 2TB orange Western Digital My Passport 2TB orange.

Making a backup on OS X

After I had unpacked the Western Digital My Passport I used Disk Utility on OS X to erase and format the drive as "OS X Extended (Journaled)".

Erasing and formatting a drive using Disk Utility Erasing and formatting a drive using Disk Utility on OS X "El Capitan".

Next, I selected the drive in Finder, selected "Get Info", unlocked the settings at the very bottom and turned "Ignore ownership on this volume" off.

Ignore ownership on this volume disabled "Ignore ownership on this volume" disabled after unlocking.

Finally, I used rsync in the terminal as follows

sudo rsync -avh /Users/ \
    /Volumes/Orange/Users/

to start a complete backup of all Users data on the brand new Western Digital harddisk named Orange.

Transfer speed of a WD My Passport 2TB drive

When done with the backup of my OS X "El Captain" /Users/ directory the rsync command reported a transfer speed of 34.72M bytes/sec for the WD My Passport 2TB drive (output reformatted to fit):

sent 788.46G bytes
received 13.34M bytes
34.72M bytes/sec
total size is 788.81G
speedup is 1.00

Sheep walking on the road

Sheep walking on the road In the afternoon a lot of noisy sheep passed by. I took a photo out of my office window.

WD My Passport 2TB ordered

I just bought an orange WD My Passport 2TB online at MediaMarkt for €79.99. The external hard disk drive will be delivered tomorrow. Somehow my Revolut prepaid credit card was not accepted so I used PayPal to pay instead.

The hard drive is going to be used to make an additional backup of my Mac mini 2014 as I want to do a clean install of macOS Mojave; I am still on OS X "El Capitan".

Jsonnet: a data templating language

Today I learned that there is a templating language that is a superset of JSON: Jsonnet.

Finding hexadecimal color codes on macOS

Use the Digital Color Meter to find the hexadecimal color code of a specific color on macOS or OS X. The program shows default decimal values. Select "as Hexadecimal" in the "Display Values" submenu available under "View" to obtain hexadecimal values.

Switching the Digital Color Meter to hexadecimal Switching the Digital Color Meter to hexadecimal.

Looking up user info on macOS

$ dscacheutil -q user -a name john
name: john
password: ********
uid: 501
gid: 20
dir: /Users/john
shell: /bin/bash
gecos: John Bokma

To look up information of all users, use:

dscacheutil -q user

Unique visitors per day

In the afternoon I used GoAccess to generate a HTML report with the access.log of this website as input.

Unique visitors per day as reported by GoAccess Excerpt of the GoAccess report: unique visitors per day.

JSON as configuration files: please don't

I read Martin Tournoij's article on why you shouldn't use JSON as configuration files. To summarise the shortcomings:

  • Lack of comments
  • Readability
  • Strictness
  • Lack of programmability

Happy birthday Alice

Today our daughter Alice turns 12 years old. Happy birthday little princess!

More SEO friendly

The day pages of tumblelog now can have a title that can be defined via the Markdown input file by putting text behind the date. This update is available on GitHub. For more information please read SEO friendly titles for tumblelog.

Emacs font lock II

Today I refactored some Emacs Lisp for additional font locks in Emacs. The Markdown file in which I enter blog entries looks now much better.

Birthday girl

Alice Bokma at her birthday party Alice at her birthday party at IHOP, Xalapa. Photo taken by Esme.

Emacs highlight-regexp

After some playing with font-lock in Emacs I was wondering how to highlight the entire line when it just has a % character on it in Markdown mode. Entire line as in all other columns, with a background color.

So I asked this question at the Emacs StackExchange and very soon got a helpful answer by Tobias which with some additional Googling led to the following solution:

(defface markdown-item-face
  '((t (:background "#364e7a")))
  "Used to highlight %")

(add-hook 'markdown-mode-hook
    (lambda()
        (highlight-regexp
         "^%\n"
         'markdown-item-face)))

Now my blog posts in Emacs are separated by blue bars: Emacs with highlight-regexp in Markdown mode showing blue bars Emacs with hightlight-regexp in Markdown mode showing blue bars.

Update, update!

I just pushed two updates to the tumblelog repository:

  • A new style has been added: thought-provoking.scss.
  • The label format for week can now be specified via the command line.

The default for the latter is 'week %V, %Y' with %V the ISO 8601 week as a decimal number with an optional leading zero and %Y the four digit year.

Garden centre "De Carlton"

In the afternoon I went with my mother to the garden centre "De Carlton" near to her house. We had a coffee and I took a few photos with my iPhone 5 of the plants on sale.

African daisies (Osteospermum) flowering African daisies or daisybushes flowering; Osteospermum species.

Moth orchid (Phalaenopsis) flowering Moth orchid flowering; Phalaenopsis species.

Tillandsia species for sale Tillandsia species for sale, including Tillandsia ionantha, Tillandsia xerographica, and Tillandsia usneoides.

Treasure flowers (Gazania rigens) flowering Treasure flowers, Gazania rigens, flowering.

Brachyscome angustifolia flowering Brachyscome angustifolia flowering.

Firefox Copy as cURL

Select "Network" in the "Web Developer" submenu of "Tools". Reload the page. Right click on a URL and in the "Copy" menu select "Copy as cURL".

Safari Copy as cURL

Select "Show Page Resources ⌥⌘A", right click on a URL and select "Copy as cURL".

Even more style

Another tumblelog style has been added; adrift-in-dreams.scss, see my GitHub repository.

Screenshots of themes

I just made screenshots, using Firefox, of the themes I have created for the tumblelog program and added them to my GitHub repository.

SEO friendly titles are coming

I just finished an update to the Perl version of tumblelog which makes it possible to give each day page a title. This is more SEO friendly. Tomorrow, I'll port this to the Python version and make both available on GitHub

Emacs font lock

I have been playing with font lock in Emacs and managed to give a specific face to each line starting with an ISO date. I use this in Markdown mode in which I write this blog. I will blog about this on my main blog tomorrow.

More Style

I just pushed another update to of tumblelog. This time I modified both the HTML and SCSS to make styling of a tumblelog easier. I also made the HTML slightly more semantic. Enjoy!

Yello's Pocket Universe

Currently listening to one of my favorite Yello albums; Pocket Universe.

How to create a SOCKS tunnel

ssh -fNCqD 1080 user@example.com
  • -f - Fork in the background.
  • -N - No command is sent once the tunnel is up.
  • -C - Compress the data before sending it.
  • -q - Quiet mode.
  • -D - Dynamic application level port forwarding. Supports SOCKS protocol.

The above creates a SOCKS proxy listening on port 1080.

See also How To Route Web Traffic Securely Without a VPN Using a SOCKS Tunnel.

Importing a CSV into MySQL

I helped Paul out with the problem of importing a CSV file created in OpenOffice on Windows into an existing table on MySQL. After some reading I came up with a command similar to:

LOAD DATA LOCAL INFILE
"file.csv"
INTO TABLE tablename
COLUMNS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES;

Note the LINES TERMINATED value, which must be '\r\n' if the file was created on Windows. If on Linux, use just '\n'.

Don't forget the LOCAL otherwise MySQL can't execute the command if running with the --secure-file-priv option.

less and UTF-8

To have less work correctly with UTF-8 files use:

LESSCHARSET='utf-8' less file.txt

Deleting .DS_Store files

find ~ -name '.DS_Store' -delete

Stop command echoing with GNU make

Normally GNU make shows each line of the recipe that's executed on stdout. Putting an @ in front of a command prevents this; see Recipe echoing.

Clearing the terminal in macOS

I use ⌃L to clear the terminal. This has the same effect as pressing enter n times with n the number of lines in the terminal. So scrolling back is possible. If I want to prevent scroll back or don't care I use ⌘K (Clear to Start).

Archives