Posts filed under Operating Systems

Specific Windows DNS Client routing with Powershell

Recently I ran into an issue in regards to accessing internal company websites while using the corporate VPN. Turns out that Windows has its own ideas in regards to network connections (wired/wireless) and VPN’s metrics.

The internal website was only accessible by modifying the metric on the VPN adapter to a lower than 5 value. Reason is that the metric on the ethernet adapter has a lower metric than the VPN.
Modifying the metric setting on the VPN helped, but the VPN confgi is maintained by our IT department, and they (you already guessed it) may change settings and/or reset them back to the intended defaults.

By accident I ran into a more permanent solution by invoking the powers of PowerShell. It turns out that you can manipulate the DNS Client behavior and direct DNS queries for specific hosts an/or domains to specific DNS services.

Start PowerShell with local admin rights.

Add-DnsClientNrptRule -DisplayName "My DNS Override"  -Namespace "<FQDN/domain>" -NameServers "DNSSERVER#1","DNSSERVER#2"

The minimum required number of DNS servers is 1.

This setting will survive reboots, so it’s pretty permanent.

Checking the current DNS Client settings:

Get-DnsClientNrptRule | more

Find the entry with the DisplayName giving while creating the override.
If you want to remove the entry you created you need the Name of the rule. This is represented by a GUID between curly brackets (e.g. {E5FA72F5-5575-4C15-9A2C-5F2D7B59845F}).

Remove-DnsClientNrptRule -Name "{E5FA72F5-5575-4C15-9A2C-5F2D7B59845F}"

Unfortunatelly, you cannot use the DisplayName (which is more user-friendly/readable)

Posted on August 1, 2022 and filed under Operating Systems, Tips'n Tricks.

Reset Apple macOS Spotlight

The macOS Spotlight service might loose its touch. E.g. when some applications or documents won't show up when you <CMD><SPACE> them. Reason could be that the service or its database got corrupt for some reason.

The following 4 commands will reset the Spotlight service and database. So after you issue those commands the PC/laptop will be re-indexed (which could take a while).

sudo mdutil -a -i off
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo mdutil -a -i on

Now, wait a bit, and everything should be back to normal.

Happy Spotlighting.

Posted on August 1, 2017 and filed under Apple, Operating Systems, Tips'n Tricks.

Installing Python Matplotlib On MacOS Sierra

I recently 'upgraded' to MacOS Sierra (Apple's latest Operating System) by doing a clean install. This resulted in a couple of challenges, including some software that could not be installed, and for which I had to find some alternatives.

Another issue I ran into is that some Python3 scripts with matplotlib wouldn't run, because matplotlib wouldn't install correctly.
I could 'pip' all I wanted, but the result was always:

$ pip3 install matplotlib
[...]
The following required packages can not be built: freetype

Some googling pointed me to some articles that freetype is/was a part of the XQuartz (X11) software that's no longer (pre)installed on MacOS Sierra. And in the past I have always upgraded my OS. The times that I did a clean install on this machine.... Must have been ages ago.

After some frustrating hours of trying to get this 'freetype' thing installed, I ran into an article on yantonov.com which solved my issue finally.

First I installed 'homebrew'.

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

After that I installed pkg-config and freetype:

$ brew install pkg-config
[...]

$ brew install freetype
[...]

And finally, I was able to successfully install matplotlib:

$ pip3 install matplotlib

VPN and Resolving Issues on OS X

We have a lab which we can access by using a VPN (Cisco ASA and Cisco AnyConnect). This setup has a so-called split DNS configuration, which means that only resources in the lab are accessed through the VPN tunnel. Regular Internet traffic uses my local DSL connection.

At my house I (like most folks) rely on DHCP for providing me with IP address, gateway and DNS servers. My local subnet uses 192.168.10.1 for DNS and 192.168.10.254 is my default gateway. So my clients are in the same subnet as my DNS server (directly-connected).

All these things considered I should be able to browse the Internet while I have a VPN running. Well, that's where you're wrong.

Posted on September 18, 2016 and filed under Annoying, Apple, Operating Systems, Tips'n Tricks.

OSX 10.10 (Yosemite) and Audio Out Changes

Yesterday I ran into a new Yosemite feature that annoyed me a bit. After changing the input on my Dell 27" display from DisplayPort to HDMI, the screen turned black on my 27" iMac, and audio stopped. Forcing a reboot (holding the power button for >4 seconds) was needed to get the iMac's display back.

But from that point on, the audio was greyed-out in the menu bar. Changing the volume on the (Apple) keyboard gave a disabled icon on screen. Also, no audio was playing over my external speakers.

My first thoughts were that the earlier crash had corrupted something on my system, so I did an additional reboot. Nothing. After that a PRAM reset (power off, power-on and hold command-option-P-R until you have heard two start-up 'boings'). The start-up sounds were there, so the actual audio hardware was just fine.

When the desktop loaded still no audio control, until I unplugged my DisplayPort connector on the Dell 27" monitor. Audio (controls) came back instantaneous.

So, with DisplayPort connected to the external monitor: no audio (controls), and without the DisplayPort: audio (controls).

Turns out that with Yosemite, the audio is channelled BY DEFAULT over a DisplayPort connection (to a external monitor). In my case, the Dell also has an audio out connector, and I guess that is 'advertised' over the DisplayPort.

Changing the default behaviour is done in the System Preferences -> Sound

The first image shows the default (at least in my case). Changing the settings to the second image gave me back the audio and volume control.

I have no idea if this was also possible with Mavericks (or even earlier versions of OSX), but it's definitely a (default) feature that annoyes the hell out of me.

Even though I tackeled the audio problem, the issue with loosing the display when I change the video input on the external monitor still remains. But only if the desktop is extended to the second screen. It doesn't occur when the screen is mirrored.

Posted on November 18, 2014 and filed under Annoying, Apple, Operating Systems, Tips'n Tricks.

AirDrop Between iOS and OS X Maverick

I got my new AirDrop-capable phone today.  Not that AirDrop was the reason for getting it, but the feature itself is quite nice; being able to send files between devices. No need to use mail or other communication methods.

This evening I shot a video on my phone and I needed it on my MacBook (with OS X Maverick). Both devices are AirDrop capable, so ..... 

And there is I went wrong. After trying for about 30 minutes to get it to work I found the answer online.... Looks like that AirDrop between different OS is NOT supported by Apple. And not supported does mean that it won't work.  

OS X: Can I use AirDrop with my computer?
http://support.apple.com/kb/ht4783
iOS: Using AirDrop
http://support.apple.com/kb/HT5887 

That is one Epic Fail if you ask me.  

Posted on November 11, 2013 and filed under Annoying, Apple, iPhone, Operating Systems.

Windows 8(.1)... What The Hell Were They Thinking?

Even though I switched to the Apple operating systems and devices in my personal life, I still have some laptops, and virtual machines around for work.  In the almost 15 years, I seen, used, supported and troubleshot(??) basically every Windows operating system around.

If you follow the development of the OS through the years, it's getting better with (almost) every release. There were some bad ones though; Windows Millennium Edition, and Windows Vista were most notorious.... Until now. Now we have Windows 8(.1).

Windows 8(.1) is (in my opinion) a Frankenstein monster that incorporates a tablet Metro desktop and a crippled old-skool desktop.

 

Posted on October 30, 2013 and filed under Annoying, Microsoft, Operating Systems.

OS X Wireless Connection Problems Solved (??)

Ever since the upgrade to Apple OS X Mountain Lion (10.8) on my MacBook (v5.1) I encountered wireless problems every now and then. These 'experiences' are documented in two different blog posts here and here.
At the time I was also running an 'old' version of Little Snitch (v2.x). After installing v3.0.1 my problems seemed to have solved... Seemed, until I upgraded Little Snitch to v3.0.2.

After the (mandatory) reboot my wireless connections were gone. The adapter wouldn't go active. The symptoms being the exactly the same as before. So I have no doubt, that Little Snitch had something to do with it.

Posted on December 8, 2012 and filed under Software, Annoying, Apple, Operating Systems, Tips'n Tricks.

Reset 'Open With' Dialog in Finder

After the upgrade of several programs I found that these programs had multiple entries in the 'Open With' dialog in OS X Finder. The following command (executed in the Terminal app) rebuilds the LaunchService database, and removes the duplicate entries.

Note that the following command is 1 (one) line of code, that you need to copy & past in the terminal window.

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

As far as I can tell, it works on OS X Mountain Lion and every earlier version (at least till 10.6).

Posted on July 29, 2012 and filed under Apple, Operating Systems, Tips'n Tricks.