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,312 other followers

Archive for the ‘OS X Leopard’ Category

Restoring files from OS X Time Machine with Terminal.app

Posted by jpluimers on 2017/12/01

cd /Volumes/Backup/Backups.backupdb/Joshua\ Priddle’s\ MacBook\ Pro/Latest/Macintosh\ HD/Users/priddle

tmutil restore -v secret_docs.txt ~/

Learned from [WayBackRestoring files from OS X Time Machine with Terminal.app:

  • do not use cp as it will give you wrong permissions
  • do use tmutil

More elaborate steps (including finding the backup in the first place) is at [WayBackCommandline restoration of a file in Time Machine on OS X | Hacks for Macs

–jeroen

Posted in Apple, 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 Sierra, OS X Snow Leopard, OS X Tiger, OSX Yosemite, Power User | Leave a Comment »

How-To: Automatically change your Mac’s display resolution when running specific apps [Video] – via: 9to5Mac

Posted by jpluimers on 2017/08/11

Yet another reason I love SwitchResX: : How-To: Automatically change your Mac’s display resolution when running specific apps [Video] | 9to5Mac

A few years ago, SwitchResX helped me switch my Mac machine to 1360×768 and 1888×1062 « The Wiert Corner – irregular stream of stuff

–jeroen

Posted in Apple, 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, OSX Yosemite | Leave a Comment »

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 »

fixing a Mac home `brew update` that has permission errors (after that I could install plantuml)

Posted by jpluimers on 2017/01/26

I had this occurring on my system:

RetinaMBPro1TB:~ jeroenp$ brew update
error: unable to unlink old 'Library/ENV/pkgconfig/10.11/libcurl.pc' (Permission denied)
error: unable to unlink old 'Library/ENV/pkgconfig/10.11/libxml-2.0.pc' (Permission denied)
error: unable to unlink old 'Library/ENV/pkgconfig/10.11/sqlite3.pc' (Permission denied)
To restore the stashed changes to /usr/local run:
  'cd /usr/local && git stash pop'
Already up-to-date.

This is how I solved it:

RetinaMBPro1TB:~ jeroenp$ ls -al /usr/local | grep -w Library
drwxr-xr-x+ 11 jeroenp  admin   374 Mar  9 19:33 Library
RetinaMBPro1TB:~ jeroenp$ sudo chown -R $USER /usr/local/Library/
Password:
RetinaMBPro1TB:~ jeroenp$ brew update
To restore the stashed changes to /usr/local run:
  'cd /usr/local && git stash pop'
Updated Homebrew from d32996d to 638d755.
==> New Formulae
...
==> Updated Formulae
...
==> Renamed Formulae
...
==> Deleted Formulae
...
RetinaMBPro1TB:~ jeroenp$ 

The above solution is based on major python problems · Issue #48301 · Homebrew/homebrew

After that, I could install plantuml (which requires java, just so you know) so now I can create SVGs from it locally:

plantuml -tsvg PSO.network-diagram.PlantUML.txt

Note I had to edit the formula so it installs plantuml-8037 or higher (the git version back then installed plantuml-8031) as it fixed a namespace bug. Since plantuml releases often, be prepared to do some version fiddling.

–jeroen

Posted in *nix, *nix-tools, Apple, Development, Home brew, Java, Java Platform, Mac, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X, OS X Leopard, OS X Maverick, OS X Mountain Lion, OS X Snow Leopard, OSX Yosemite, PlantUML, Power User, Software Development, UML | Leave a Comment »

 
%d bloggers like this: