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

    20140508-Delphi-2007--Project-Options--Cannot-Edit-Application-Title-HelpFile-Icon-Theming

    20140430-Fiddler-Filter-Actions-Button-Run-Filterset-now

    20140424-Windows-7-free-disk-space

    More Photos
  • Pages

  • All categories

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

    Join 1,723 other followers

Archive for the ‘MacBook-Air’ Category

Mac OS X – serial communication programs

Posted by jpluimers on 2017/03/30

Some links that helped me getting FTDI USB serial communication to Raspberry Pi systems going:

–jeroen

Posted in Apple, Communications Development, Development, Hardware Development, Hardware Interfacing, iMac, Legacy Ports: COM, Mac, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X, OS X Maverick, OSX Yosemite, Power User, Raspberry Pi, USB | Leave a Comment »

Mac OS X: restarting Google Drive when it shows a spinning wheel

Posted by jpluimers on 2017/03/29

Every now and then, Google Drive on Mac OS X gets confused and starts showing the spinning wheel when hovering over the menu bar icon similar to for instance DropBox does every once in a while.

This is how to terminate and restart Google Drive from the terminal (no need for su):

killall -v -SIGKILL Google\ Drive
open -a Google\ Drive

Alternatively you can start Google Drive using this:

/Applications/Google\ Drive.app/Contents/MacOS/Google\ Drive &

I found this executable through osx – Find all executable files within a folder in terminal – Ask Different

Note that this won’t kill Google Drive as it sends the TERM signal (SIGTERM):

killall -v Google\ Drive

–jeroen

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

Finder doesn’t work since Yosemite – Ask Different

Posted by jpluimers on 2017/02/20

Source: Finder doesn’t work since Yosemite – Ask Different [WayBack]:

This fix from Reddit worked perfectly for me!!

http://www.reddit.com/r/osx/comments/2jtikj/finder_not_responding_new_yosemite_install/ [WayBack]

You can most likely fix the issue by clearing out Finder’s saved state, caches, and/or settings.

Use Spotlight (the search icon in the far right of the menu bar) to find and open the “Terminal” application. Triple-click the following line in order to copy and paste it into Terminal’s window:

rm -fR ~/Library/Saved\ Application\ State/com.apple.finder.savedState ~/Library/Caches/com.apple.finder; killall Finder

If it still doesn’t work, try this one:

mv ~/Library/Preferences/com.apple.finder{,.backup}.plist; killall Finder

–jeroen

Read the rest of this entry »

Posted in Apple, iMac, Mac, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X, OSX Yosemite, Power User | Leave a Comment »

Managing WIFI connections using the Mac OSX…

Posted by jpluimers on 2017/02/10

These links:

Made me add this to my ~/.bash_profile:

alias airport="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport"
alias wifi-off="networksetup -setairportpower en0 off"
alias wifi-on="networksetup -setairportpower en0 on"
alias wifi-scan="airport scan"
alias wifi-join-SSID-password="networksetup -setairportnetwork en0"
alias wifi-list-ports="networksetup -listallhardwareports

–jeroen

 

Posted in Apple, Mac, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X, OS X Maverick, OS X Snow Leopard, OSX Yosemite, Power User | Leave a 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 »

 
%d bloggers like this: