The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,844 other followers

Archive for the ‘OS X Tiger’ Category

OS X – the versions and their names – as I always forget them

Posted by jpluimers on 2017/04/03

I always forget which OS X versions there are and which names they use.

So via: OS X – Wikipedia, the free encyclopedia, I made this list where the first item points to the table in the above article and each subsequent item to the individual article on the version. I tried to find EOL dates, but that’s hard despite the overview at Apple security updates – Apple Support:

None of this would be noteworthy if Apple, like Microsoft and a host of other major software vendors, clearly spelled out its support policies. But Apple doesn’t, leaving users to guess about when their operating systems will fall off support. | Computerworld

–jeroen

PS: EOL dates are as of 20160403.

Posted in Apple, OS X, OS X El Capitan, OS X Leopard, OS X Lion, OS X Maverick, OS X Mountain Lion, OS X Snow Leopard, OS X Tiger, OSX Yosemite, Power User | 1 Comment »

Determining the current shell in *n*x variants including ESXi

Posted by jpluimers on 2017/02/08

On most systems, I use bash as shell, but not all systems have it, for instance the shell.xs4all.nl server uses tcsh and ESXi 4+ uses a very limited ash shell from busybox (ESX 4 had bash though).

There is this huge script that covers many shell and operating system versions (even DOS, Windows) and interpreters (python, ruby, php, etc) what shell is this which I got through Stéphane Chazelas‘s answer in linux – determine shell in script during runtime – Unix & Linux Stack Exchange

I wanted a shorter thing that works in current Linux, BSD, OS X and ESXi versions.

Some very short scripts are less reliable, for instance echo $SHELL looks nice, but isn’t always set.

Similar for echo $0 which will fail for instance if it shows as sh but in fact is a different shell in disguise.

This works for bash, tcsh and busybox sh, is a bit more precise than getting $0. It’s based on HOWTO: Detect bash from shell script – Stack Overflow:

lsof -p $$ | awk '(NR==2) {print $1}'

But on ESXi it shows this because lsof doesn’t take any parameter there and just dumps all information:

----------+---------------------+---------------------+--------+------------------

It’s because lsof on ESXi always shows this header where Cartel and World aren’t exactly well documented:

Cartel | World name | Type | fd | Description
----------+---------------------+---------------------+--------+------------------

Empirically for non VM related processes, it looks like the Cartel is the PID and World name the command.

On Linux and BSD based systems, the header looks like this, so command and PID are reversed in ESXi:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

This command then works on both ESXi, OS X, Linux and BSD assuming you can word search for the PID and noting that PID/command will be reversed on ESXi as compared to OSX/Linux/BSD:

lsof -p $$ | grep -w $$ | awk '(NR==2) {print $1,$2}'

–jeroen

Posted in Apple, bash, BSD, Development, iMac, Mac, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X, OS X El Capitan, OS X Leopard, OS X Lion, OS X Maverick, OS X Mountain Lion, OS X Snow Leopard, OS X Tiger, OSX Yosemite, Power User, Scripting, Software Development | Leave a Comment »

whatismylocalip alias (actually more like whataremylocalips) and some sed links

Posted by jpluimers on 2017/01/10

Getting the local IP (actually IPs, but most hosts only have a single IP):

# OS X:
alias whatismylocalip='ifconfig | sed -En '\''s/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'\'''
# Linux:
alias whatismylocalip='ip a | sed -En '\''s/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'\'''

I got them via bash – How to I get the primary IP address of the local machine on Linux and OS X? – Stack Overflow

Mac OS X and BSD have ifconfig, but most Linux distributions don’t use ifconfig any more in favour of iproute2, so you use ip a (which is shorthand for ip address show) there.

Their output is similar enough for the sed to work, though. Which surprised be because I didn’t know about the -E option (it lacks in the manual Linux page but it is in the Mac OS X one) which enables POSIX extended regular expressions. In Linux this is documented as -r, but -E also works.

I learned this through the Sed – An Introduction and Tutorial which compares the various versions of sed which also explains about the -n doing no printing.

–jeroen

Posted in *nix, *nix-tools, Apple, bash, bash, Development, Linux, Mac, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, openSuSE, OS X, OS X Leopard, OS X Lion, OS X Maverick, OS X Mountain Lion, OS X Snow Leopard, OS X Tiger, OSX Yosemite, Power User, Scripting, Software Development, SuSE Linux, Tumbleweed | Leave a Comment »

How to securely delete files in OS X 10.11 ‘El Capitan’ | MacIssues

Posted by jpluimers on 2016/12/23

Interesting: diskutil secureErase freespace LEVEL /Volumes/DRIVENAME

–jeroen

Source: How to securely delete files in OS X 10.11 ‘El Capitan’ | MacIssues

Posted in Apple, Mac, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X, OS X Leopard, OS X Lion, OS X Maverick, OS X Mountain Lion, OS X Snow Leopard, OS X Tiger, OSX Yosemite, Power User | Leave a Comment »

installing the joe terminal/console text editor on Mac OS X: brew to the rescue

Posted by jpluimers on 2016/10/07

The most recent versions of Joe don’t even build from stock in OS X any more and there are no direct installers for them.

But there are two most recent older versions that have installers, and a formula recent brew based HomeBrew installation:

  1. joe-3.7-0.pkg – rudix-snowleopard – JOE – Rudix: The hassle-free way to get Unix programs on Mac OS X – Google Project Hosting.
  2. PROJECT DETAIL for Joe’s Own Editor.
  3. Homebrew Formulas – Joe.

After experimenting for a while without brew preferring the first over second, I’ve installed the the third as:

  1. The first actually installs version 3.6, but has the syntax highlighting files installed in the correct place, so you get syntax highlighting.
  2. The second does install version 3.7, but since the syntax highlighting files are in the wrong place: you get no syntax highlighting.
  3. The brew formula has an up to date joe version 4.0 and installs the syntax highlighting in the right place: you get syntax highlighting.

Before making a choice, you might want to consider reading about joe versions in JOE – Joe’s own editor / … /NEWS.md.

Having a background partially in the Linux world, I tried building joe from source on my Mac following the steps at JOE – Joe’s own editor / Discussion / joe-editor-general:Mac binary for 3.3 does not run on OS/X 10.8. It failed because the Mercurial 3.8 branch required automake and autoconf which are not available on  just a Mac + Xcode. So I’m happy that others have bit the bullet and make a good HomeBrew build.

What makes HomeBrew so great is that it is based on a fully versioned git/ruby combination, allows for multiple Python versions, allows for binaries through bintray served bottles and has zillions (well, thousands) of installable formulae, all versioned.

–jeroen

Posted in *nix, *nix-tools, Apple, joe, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X, OS X Leopard, OS X Lion, OS X Maverick, OS X Mountain Lion, OS X Snow Leopard, OS X Tiger, OSX Yosemite, Power User | Leave a Comment »

 
%d bloggers like this: