The Wiert Corner – irregular stream of stuff

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

  • 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,862 other subscribers

Archive for the ‘Apple’ Category

Mac OS X: finding the DNS servers available

Posted by jpluimers on 2016/07/01

DNS and Mac OS X are a bit of a tricky situation as OS X can use more than the default DNS servers: its resolve can do a multi-client DNS search.

The default DNS servers can be listed like this:

scutil --dns | grep 'nameserver\[[0-9]*\]' | sort | uniq

The effective DNS server like this:

dig whoami.akamai.net | grep "^;; SERVER" | cut -c 12-

Sometimes you want to know if you have manually configured DNS servers, or only DHCP assigned ones. This statement shows that for my Wi-Fi network-service:

networksetup -getdnsservers Wi-Fi

Because of the multi-client setup, you need to run this for all network-services configured on your OS X installation. You can get the list like this:

networksetup -listallnetworkservices

I’ve not yet found a way to list only active services, as the networksetup documentation indicates the -listnetworkserviceorder option will mark inactive ones with (*), but it reality does so only for disabled ones. So this does not work:

networksetup -listnetworkserviceorder

I might one day dig into combining the output of ifconfig with networksetup to figure out a shell based solution to this question.

–jeroen

Posted in Apple, Mac OS X / OS X / MacOS, Mac OS X 10.7 Lion, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, Power User | Leave a Comment »

Woof – simply exchange files – one-time sharing of a file over http

Posted by jpluimers on 2016/06/22

Woof is a small simple stupid webserver that can easily be invoked on a single file. Your partner can access the file with tools he trusts (e.g. wget). No need to enter passwords on keyboards where you don’t know about keyboard sniffers, no need to start a huge lot of infrastructure, just do a

$ woof filenameand

tell the recipient the URL woof spits out. When he got that file, woof will quit and everything is done.And when someone wants to send you a file, woof has a switch to offer itself, so he can get woof and offer a file to you. …

Woof needs Python on a unix’ish operating system. Some people have used it successfully on Windows within the cygwin environment.

Source: Woof – simply exchange files

Works from homebrew on OS X.

via: Web Offer One File – Thomas Mueller (dummzeuch) – Google+

Source: Web Offer One File

–jeroen

Posted in *nix, *nix-tools, Apple, BSD, Home brew / homebrew, Linux, Mac, Mac OS X / OS X / MacOS, Power User | Leave a Comment »

network – How can I release and renew my DHCP lease from Terminal? – Ask Different

Posted by jpluimers on 2016/06/07

Via the answer below I created the renew alias. I already had the first two aliases.

alias route-and-ipaddresses="netstat -nr | grep 'Internet\|Gateway\|default' && echo && ifconfig | grep '\: flags\|inet\|inet6' && echo more detailed info through ifconfig and netstat -nr"

alias whatismyip="curl http://whatismyip.akamai.com && echo"

alias renew_dhcp="sudo ipconfig set en0 DHCP && echo waiting 10 seconds for DHCP lease to be obtained && sleep 10 && route-and-ipaddresses && whatismyip"

–jeroen

via: network – How can I release and renew my DHCP lease from Terminal? – Ask Different.

Posted in Apple, bash, Development, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.6 Snow Leopard, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, Scripting, Software Development | Leave a Comment »

domain name system – How to test DNS glue record? – Server Fault

Posted by jpluimers on 2016/05/26

Thanks Adrian W for providing the below example in your answer about obtaining GLUE record information for a domain.

It is an excellent showcase for the $IFS Internal Field Separator available in any nx shell.

In this case it is used to get the TLD (top-level domain) from the domain name specified at the command-line.

After that, it obtains the name servers for that TLD, and queries the glue records there, both using dig.

Here is a little shell script which implements Alnitak’s answer:

#!/bin/sh
S=${IFS}
IFS=.
for P in $1; do
  TLD=${P}
done
IFS=${S}

echo "TLD: ${TLD}"
DNSLIST=$(dig +short ${TLD}. NS)
for DNS in ${DNSLIST}; do
  echo "Checking ${DNS}"
  dig +norec +nocomments +noquestion +nostats +nocmd @${DNS} $1 NS
done

Pass the name of the domain as parameter:

./checkgluerecords.sh example.org

–jeroen

via domain name system – How to test DNS glue record? – Server Fault.

Posted in *nix, Apple, bash, Development, DNS, Linux, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, openSuSE, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, Scripting, Software Development, SuSE Linux | Leave a Comment »

Mac OS X Time Machine – Stuck on “Preparing Backup”

Posted by jpluimers on 2016/04/25

For one of my USB backup drives, Time Machine was stuck showing “Preparing Backup”.

tmutil (which has a lot of undocumented parameters) helped me out.

tmutil status would not show any change for hours either:

retinambpro1tb:~ root# tmutil status
Backup session status:
{
    BackupPhase = ThinningPreBackup;
    ClientID = "com.apple.backupd";
    DateOfStateChange = "2015-05-04 19:27:31 +0000";
    DestinationID = "01AE12C7-1D3E-469E-BE7E-32DA30F0030E";
    DestinationMountPoint = "/Volumes/Elements2TB1";
    Percent = "-1";
    Running = 1;
    Stopping = 0;
}
...
retinambpro1tb:~ root# tmutil status
Backup session status:
{
    BackupPhase = ThinningPreBackup;
    ClientID = "com.apple.backupd";
    DateOfStateChange = "2015-05-04 21:13:28 +0000";
    DestinationID = "01AE12C7-1D3E-469E-BE7E-32DA30F0030E";
    DestinationMountPoint = "/Volumes/Elements2TB1";
    Percent = "-1";
    Running = 1;
    Stopping = 0;
}

So I:

  1. removed the .inProgress file found by ls -al /Volumes/Elements2TB1/Backups.backupdb/`scutil --get ComputerName`/*.inProgress
  2. rebooted with the USB drive attached
  3. waited for spotlight to complete
  4. manually started a backup
  5. verified it made progress using tmutil (you need to run that as root, for instance with sudo su -)

And it indeed made progress and finished:

Read the rest of this entry »

Posted in *nix, Apple, Mac, Mac OS X / OS X / MacOS, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X 10.8 Mountain Lion, Power User, SpotLight | Leave a Comment »

Hacking is Important — Medium

Posted by jpluimers on 2016/04/22

“We’re barbarians, not bureaucrats!”

Source: Hacking is Important — Medium

On hacking vs processes, being disruptive and how people think. Short stories about Borland, Apple, FaceBook and others.

–jeroen

via: Hacking is Important — Medium – David Berneda – Google+

Posted in Apple, Delphi, Development, Facebook, LifeHacker, Power User, SocialMedia, Software Development | Leave a Comment »

Homebrew Core/Formulae Split – Google Groups

Posted by jpluimers on 2016/04/15

Recently homebrew reorganised on github:

Hi all!

The Homebrew/homebrew repository has been deprecated and split into two repositories:

This split helps the Homebrew maintainers in various ways but for users the main advantages should be increasing stability over time and a quicker development process.

The migration will be handled for you automatically when you `brew update`. If you have any migration issues please create an issue at https://github.com/Homebrew/brew/issues/new

If you have any questions: feel free to ask them.

Thanks for using Homebrew!

Mike McQuaid
http://mikemcquaid.com

–jeroen

Source: Homebrew Core/Formulae Split – Google Groups

Posted in Apple, Home brew / homebrew, Power User | Leave a Comment »

Tools that Isotopp installed on his Mac…

Posted by jpluimers on 2016/04/01

IRC so: »i> Isotopp: Ich habe jetzt nen Mac als Arbeitsplatzrechner… Was will man als UNIX Hacker zuerst an Tools installieren?«

Source: IRC so: »i> Isotopp: Ich habe jetzt nen Mac als Arbeitsplatzrechner… Was will… by Kristian Köhntopp.

Since G+ is very bad at searching, I created this summary of the tools; read the full G+ post (Google Translate is quite OK), including comments on why.

Edit: 20160402 – I’m posting regular updates based on the comments for that G+ post. I’ve changed or added German iTunes store links to US-English ones.

Read the rest of this entry »

Posted in Apple, Audacity, Audio, Fusion, Hardware, Keybase, Keyboards and Keyboard Shortcuts, KVM keyboard/video/mouse, Mac, Mac OS X / OS X / MacOS, MacBook, MacBook Retina, MacBook-Pro, Media, OS X 10.10 Yosemite, OS X 10.11 El Capitan, Power User, Security, VirtualBox, Virtualization, VMware | Leave a Comment »

Happy 40th birthday Apple – it hangs pirate flag over Infinite Loop HQ – via 9to5Mac/twitter

Posted by jpluimers on 2016/04/01

Apple Pirate Flag

Apple Pirate Flag

Happy birthday Apple!

In homage to its history, Apple has hung a pirate flag at its Infinite Loop Headquarters (images via @twfarley and @mjisrawi). On April 1st, 40 years ago, Apple was founded…

Time lines:

–jeroen

Posted in Apple, Power User | Leave a Comment »

Apple@40: happy birthday!

Posted by jpluimers on 2016/04/01

Apple Inc. just turned 40 today. Happy birthday!

Based on Mac@30, here is my educated guess for Apple@40.

(Boy what were they thinking when establishing Apple Computer Inc. on April 1st 1976)

–jeroen

Posted in 6502, Apple, Apple I, History, Power User | Leave a Comment »