Showing posts with label OS X. Show all posts
Showing posts with label OS X. Show all posts
Monday, 7 October 2019

No default realm defined for Kerberos


When you connect to some old cisco routers using iterm2 on an OS X, it might takes some time before it prompts for a username. And it might also promt you with this message.
Kerberos: No default realm defined for Kerberos! 
To disable this message you need to create or edit the file .telnetrc in your home directory and add default unset autologin
$ vim ~/.telnetrc
  default unset autologin
esc : wq
Thursday, 12 October 2017

Telnet Removed in Mac OS High Sierra 10.13


Found out that telnet as been removed in Mac OS High Sierra 10.13 when I upgraded last night, which is bad for me as i work in networking and some legacy equipment still only has telnet. You can enable it with Homebrew. First, update or install Xcode from the App Store.

brew tap theeternalsw0rd/telnet
brew install telnet 

If Homebrew is not installed, it's available here >> brew.sh

Another option is to copy it from a backup, or other machine, if you have one into /usr/local/bin/

--cheers
Thursday, 19 January 2017

Change default Screenshot Save Location MacOS X


I take a lot of screenshots for different reasons. I keep some, post others on social media or I use them to illustrate my posts. The default save lcation is current users desktop, and you might find the desktop to be cluttered with the screenshot files rather quickly.

Keyboard Shortcuts to Capture a Screen Shot with Mac OS X

Save to location
⌘ Cmd + Shift + 3 - Entire screen
⌘ Cmd + Shift + 4 - Portion of the screen
⌘ Cmd + Shift + 4 then Space - Specific application window

Copy to clipbard
⌘ Cmd + Ctrl + Shift + 3 - whole screen capture
⌘ Cmd + Ctrl + Shift + 4 - selective capture
⌘ Cmd + Ctrl + Shift + 4 Space - window screen capture

How to change default Screenshot Save Location

Press ⌘ Cmd + Space to open Spotlight and type terminal or, as I prefer, iTerm 2
$ mkdir $HOME/Documents/Screenshots
$ defaults write com.apple.screencapture location $HOME/Documents/Screenshots/
$ killall SystemUIServer

You also might want to move all your existing screenshots from the desktop to your new folder.
$ mv $HOME/Desktop/Screen\ Shot\ *.png $HOME/Documents/Screenshots/.

Change the default screenshot file name

The default screenshot name is "Screen Shot 2017-01-18 at 10.56.49.png"
[Name] [date] at [time].[type] You can only change the [Name] and [type]

$ defaults write com.apple.screencapture name "Prefix Name"

Change the screenshot image type

By default, OS X saves screenshots as .png (or Portable Network Graphics) files. Valid formats: .bmp, .pdf, .jpg, .jp2, .tif, .pict, .tga and .png

$ defaults write com.apple.screencapture type jpg
Sunday, 18 December 2016

Run a TFTP Server on Mac OS X



To upgrade firmware or upload config backup on networking devices TFTP server often comes handy. In my job I usually have access tosuch server, but in some cases when network access is limited or not available I configure a TFTP server on my laptop. For Linux see: Install and run a TFTP server

Mac OS X has a tftp server included, it's eazy to start it and do a minor configuration. First see if there are any commands related to tftp.
apropos tftp
You should get answer like this.
tftp(1) - trivial file transfer program
tftpd(8) - DARPA Internet Trivial File Transfer Pro
You can start it with launchctl
sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist
To confirm it’s running use netstat to check what is listening on its port, traditionally port 69.
netstat -na |grep \*.69
Should get answer like this.
udp6       0      0  *.69                   *.*
udp4       0      0  *.69                   *.*
It's a good idea to symlink the tftpboot to a folder you have full control over because OS X El Capitan has strong security via its System Integrity Protection (SIP) which makes things more difficult.
cd /private/
sudo rm -rf tftpboot
mkdir /Users/<username>/tftpboot
sudo ln -s /Users/<username>/tftpboot tftpboot
sudo launchctl unload -F /System/Library/LaunchDaemons/tftp.plist
sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist

When you’re not using the TFTP server, make sure to unload the service.
sudo launchctl unload -F /System/Library/LaunchDaemons/tftp.plist
netstat -na |grep \*.69
The netstat should return nothing.

-cheers