Tip of the Day: Fixing Page Up and Page Down Keys in Leopard's Terminal.app 1

Posted by Ben Allen Mon, 12 May 2008 06:15:00 GMT

To expand on my last post about fixing the home and end keys in Terminal here is how to fix the Page Up and Page Down keys.

Follow the directions in my last post, but instead of choosing the end or home keys select the page up and page down keys.

Set action to send string to shell and in the text box copy and paste: \033[6~ for page down, and \033[5~ for page up in the text box under the action pull-down.

If you can't copy and paste, the key sequence goes as the following: ESC [ 6 ~ and ESC [ 5 ~ respectively. Those two key sequences should expand to the above text.

Tip of the Day: Fixing Home and End Keys in Leopard's Terminal.app 2

Posted by Ben Allen Mon, 12 May 2008 01:01:00 GMT

By default in Terminal.app the home and end scroll the the top of the screen and the end of the screen buffer respectively. To make Terminal act like a normal console (in other words the home key moves the cursor to the beginning of the line, and the end key moved the cursor to the end of the line, etc) do the following:

  • Open Terminal
  • Open Terminal's preferences
  • Goto the Settings Tab
  • Goto the Keyboard Tab as shown below Terminal Settings
  • Select the end key settings
  • Change the action setting to send string to shell as below End Key Setting
  • In the text box below the action setting, enter the key combination of ctrl-e.
  • The text \005 should appear like below End Key Setting Entered
  • Click OK
  • Select the home key
  • Change the action setting to send string to shell
  • For this key enter the key combination of ctrl-a
  • The text \001 should appear like below
  • Click OK and close the preferences.

The end and home keys should now act like a normal console in Terminal. Enjoy!

Resource: http://blog.yiqiang.org/2007/12/fixing-home-and-end-key-for-terminalapp.html

Tip of the Day - SSH Keys and Mac OS X Leopard

Posted by Ben Allen Sat, 19 Jan 2008 03:09:00 GMT

Create a standard SSH keypair by using the ssh-keygen command. When prompted for a passphrase enter one. Copy your ~/.ssh/id_rsa.pub to your destination's authorized_keys file. Now login to your destination from the Terminal with ssh. You will be pleasantly surprised with a pop-up box asking for the password associated with the id_rsa SSH key. It gives you the option to store this password in your Leopard keychain if you wish. This effectively takes place of using a ssh-agent to store SSH keys. SSH Key Password Prompt

Creating a System Account in Mac OS X 10.5 Leopard

Posted by Ron Valente Fri, 19 Oct 2007 20:11:00 GMT

Introduction

With the upcoming release of leopard there are many changes under the hood. One of the small but quite annoying changes if you are used to the old ways is the removal of the NetInfo manager application. This is a blessing in disguise because the new implementation of user creation and account management.

Create the users home directory

sudo mkdir -p /Users/USER

Creating the users primary group

sudo dscl . -create /Groups/USER
sudo dscl . -create /Groups/USER PrimaryGroupID UID

Creating the user and setting options

sudo dscl . -create /Users/USER
sudo dscl . -create /Users/USER RealName "USER FULL NAME"
sudo dscl . -create /Users/USER NFSHomeDirectory /Users/USER
sudo dscl . -create /Users/USER UserShell /bin/SHELL
sudo dscl . -create /Users/USER UniqueID UID
sudo dscl . -create /Users/USER PrimaryGroupID UID

Setting the users passwd

passwd USER

Adding users to a secondary group

sudo dscl . -append /Groups/OTHERGROUP GroupMembership USER

Set the ownership of the users home directory to the users home dir

sudo chown -R USER:GROUP /Users/USER

Tip of the Day - Live Remounting of Filesystems

Posted by Ben Allen Wed, 05 Sep 2007 04:25:00 GMT

If you need to remount a in-use filesystem like / or /usr without rebooting the operating system, use the mount command with the -o remount option.

To remount the root partition using settings found in /etc/fstab.conf run:

mount -o remount /

This is handy if a filesystem has been mounted read only during a recovery process. For example to remount the root partition read/write do:

mount -o remount,rw /

If there is no /etc/fstab entry for the root partition (or any partition you are using) you may need to specify the root partition (/dev/sda1 in this example):

mount -o remount,rw /dev/sda1 /