How to get Weather on the Mac Console

Here is a simple way to get the weather from the console.

$ weather Pieniezno
Weather for City: Pieniezno, Poland

  _`/"".-.     Moderate or heavy rain shower
   ,\_(   ).   20 °C          
    /(___(__)  ↑ 7 km/h       
    ‚‘‚‘‚‘‚‘   7 km           
    ‚’‚’‚’‚’   2.7 mm         
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Fri 29. Jul ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│    \  /       Partly Cloudy  │  _`/"".-.     Light rain sho…│  _`/"".-.     Moderate or he…│  _`/"".-.     Patchy rain ne…│
│  _ /"".-.     25 – 27 °C     │   ,\_(   ).   27 – 28 °C     │   ,\_(   ).   20 °C          │   ,\_(   ).   17 °C          │
│    \_(   ).   ↖ 8 – 9 km/h   │    /(___(__)  ↑ 9 – 11 km/h  │    /(___(__)  ↑ 7 – 15 km/h  │    /(___(__)  ↑ 9 – 20 km/h  │
│    /(___(__)  10 km          │      ‘ ‘ ‘ ‘  10 km          │    ‚‘‚‘‚‘‚‘   7 km           │      ‘ ‘ ‘ ‘  9 km           │
│               0.0 mm | 3%    │     ‘ ‘ ‘ ‘   0.9 mm | 98%   │    ‚’‚’‚’‚’   2.7 mm | 96%   │     ‘ ‘ ‘ ‘   1.6 mm | 95%   │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Sat 30. Jul ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│     \   /     Sunny          │  _`/"".-.     Patchy rain ne…│  _`/"".-.     Patchy rain ne…│  _`/"".-.     Patchy rain ne…│
│      .-.      21 – 22 °C     │   ,\_(   ).   22 – 23 °C     │   ,\_(   ).   20 °C          │   ,\_(   ).   16 °C          │
│   ― (   ) ―   ↗ 16 – 19 km/h │    /(___(__)  ↗ 18 – 22 km/h │    /(___(__)  → 6 – 13 km/h  │    /(___(__)  ↗ 9 – 19 km/h  │
│      `-’      10 km          │      ‘ ‘ ‘ ‘  9 km           │      ‘ ‘ ‘ ‘  9 km           │      ‘ ‘ ‘ ‘  9 km           │
│     /   \     0.1 mm | 16%   │     ‘ ‘ ‘ ‘   0.6 mm | 90%   │     ‘ ‘ ‘ ‘   0.6 mm | 88%   │     ‘ ‘ ‘ ‘   0.2 mm | 46%   │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤ Sun 31. Jul ├───────────────────────┬──────────────────────────────┐
│           Morning            │             Noon      └──────┬──────┘    Evening            │            Night             │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│  _`/"".-.     Light rain sho…│  _`/"".-.     Patchy rain ne…│  _`/"".-.     Patchy rain ne…│  _`/"".-.     Patchy rain ne…│
│   ,\_(   ).   23 – 25 °C     │   ,\_(   ).   21 – 22 °C     │   ,\_(   ).   20 – 21 °C     │   ,\_(   ).   17 – 18 °C     │
│    /(___(__)  → 15 – 18 km/h │    /(___(__)  ↘ 9 – 11 km/h  │    /(___(__)  ← 5 km/h       │    /(___(__)  ↑ 3 – 5 km/h   │
│      ‘ ‘ ‘ ‘  10 km          │      ‘ ‘ ‘ ‘  9 km           │      ‘ ‘ ‘ ‘  9 km           │      ‘ ‘ ‘ ‘  9 km           │
│     ‘ ‘ ‘ ‘   0.6 mm | 81%   │     ‘ ‘ ‘ ‘   0.5 mm | 81%   │     ‘ ‘ ‘ ‘   1.1 mm | 79%   │     ‘ ‘ ‘ ‘   0.4 mm | 71%   │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘

For this we need a very simple shell script:

#!/bin/bash

if [ "$1" == "" ]; then
  curl wttr.in/$(LocateMe -f "{LAT}+{LON}")
else
  curl wttr.in/$1
fi

If you don’t pass a parameter, it uses LocateMe which you’d have to download separately. LocateMe makes available the current location of the computer on the command line.

By mnott on 2016/07/29 | Code, Computer, General | A comment?

How to stop Safari downloading .pdf as .pdf.lspdf

There may be an issue that arises, apparently rarely, if you have once installed the Livescribe Echo application. Safari, when downloading a .pdf, will appear to keep adding a second extension, .lspdf, to the file name. Searching on Google doesn’t really return anything useful, and removing com.apple.Safari.plist etc. doesn’t help either. This article reports a way to solve that problem, which to the best of my knowledge has not been solved before.

Read more…

By mnott on 2016/05/25 | Computer, Hacks | A comment?

Update Airport Firmware by running Airport Utility 6.5.1 on El Capitan

I just came across an interesting situation where the Airport Utility showed a red alert with a „1“ in it, indicating some sort of message or update, but not detailing what it was about – and actually no apparent possibility to do anything about it:

¡Bildschirmfoto2016-05-25um13.55.29-2016-05-25-13-55.png

A quick search on Google brought up the idea to use an older version of the Airport utility, which identified a newer version for the Airport to be available, and allowing to update it.

Read more…

Missing sidebar Icons in Finder

I again had the problem that some sidebar icons were missing in Finder. Seems like that either I have to restore ~/Library/Preferences/com.apple.finder.plist from a backup, and re-login, or just re-login.

By mnott on 2016/05/23 | Computer | A comment?

How to add Files from Finder to Evernote and keep a permanent relation

As a follow-up to my post on how to automatically add files to Evernote, keeping persistent links, here is a slightly reworded automator workflow that I use to do the same thing: Mark one or multiple files in Finder and then Hit Cmd-E to have them added to Evernote’s Inbox, while at the same time having those notes in Evernote contain hyperlinks to the original file which are persistent even if the original file is moved around.

Read more…

By mnott on 2016/01/14 | Computer, Hacks | A comment?

How to create Persistent File Links from Evernote to the Filesystem

So I’m playing around with Evernote and essentially don’t want to use Evernote as my “store it all” kind of document repository. DevonThink didn’t work out that well after all, and using Evernote that way seems to be equally inadequate. At the end of the day, I have a decent file system anyhow, so why should I decide to move all my files over there. Rather, I’d use Evernote for notes and stuff, as the name suggests.

One thing I like about Evernote is, of course, that it has files available on all devices. So one thing I’d like to do is to have things like the invoices I’m currently paying being in Evernote, while at the same time staying in my existing file system structure.

Read more…

By mnott on 2016/01/13 | Computer, Hacks | 1 comment

How to fix a Maxi-Cosi FamilyFix Base

I’ve had a little issue with our MaxiCosi FamilyFix Base not releasing the child seat anymore. Turns out, this is a common problem. Unfortunately, I didn’t find any description on how to really solve it, so here is one. Read more…

By mnott on 2016/01/01 | Hacks | A comment?

Very clearly my Daughter…

IMG_2093

By mnott on 2015/11/06 | Computer, Hacks | 1 comment

Latest Pornographic Addition…

So here it is, the added 150 TB of backup space that just came in. Read more…

By mnott on 2015/04/09 | Computer | A comment?

Moving Virtual Boxes in Ubuntu

This is perhaps the 100 millionth post on the topic, yet all I could find was how to move the virtual box files through vboxmanage, which appears to imply having to remove snapshots. Here is a very easy different process that will just repoint to where the machine’s folder is located.
Read more…

By mnott on 2015/04/07 | Computer, Hacks | A comment?