dilluns, 10 d’agost de 2009

FreeBSD Install VIM Editor Without X11 GUI

You can easily build VIM without X11 under FreeBSD. First, update your ports tree, using portsnap command, enter: # portsnap fetch update Install vim without X11, enter: # cd /usr/ports/editors/vim && make WITHOUT_X11=yes install clean

To avoid install all X11 dependencies when upgrade via portupgrade, add this to /etc/make.conf:

$ vi /etc/make.conf

.if ${.CURDIR:M*/editors/vim*}
NO_GUI=yes
.endif

Optional: vim configuration

Copy /usr/local/share/vim/vimXY/vimrc_example.vim to /usr/local/share/vimrc, enter: # cp /usr/local/share/vim/vim72/vimrc_example.vim /usr/local/share/vimrc
Create your ~/.vimrc file, enter: $ vi ~/.vimrc
Add customization:
set nocompatible
filetype on
filetype indent on
filetype plugin on
set laststatus=2
syntax on
Save and close the file. Set bash alias, enter: $ echo "alias vi='vim'" >> ~/.bashrc
Setup INPUTRC for bash, enter: # echo 'export INPUTRC=/usr/local/etc/inputrc' >> /etc/profile
Finally, create /usr/local/etc/inputrc, enter: # cat >> /usr/local/etc/inputrc
Append config:
set meta-flag on
set input-meta on
set convert-meta off
set output-meta on

"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word

Fast-lane:

Create an updated OS X install

When reselling or gifting a pre-owned Mac, it's convenient to ship it without any accounts, but with all updates and legally-included packages. This is actually quite simple to do. This process uses a number of well-known techniques, which are listed in the order that they are executed. Boot the Mac's original or retail Leopard Install DVD (Hold the 'C' key during startup). When selecting the drive during the OS X install, click the Options button and set it to 'Erase and Install' for a clean install. Once the initial install is complete, reboot again to the Install Disk. After selecting the default language, immediately choose Reset Password from the Utilities menu. Set the password for the System Administrator (root) user and click the Save button. Quit out of Password Reset, and quit again out of the Installer to restart the Mac. Hold Command-S during restart to enter Single User Mode. Enter the following to turn off the Welcome sequence:
$ /sbin/fsck -fy
$ /sbin/mount -uw /
$ touch /private/var/db/.AppleSetupDone
$ exit
The Mac will now boot to the login window. Log in as root with the password previously set above. Setup the internet connection and run Software Update from the Apple menu. This will take two or three reboots before all updates are installed. If you're including iLife '09 and/or iWork '09, install them after the first update/reboot sequence, but before repeating the Software Update process. Keep repeating Software Update until it reports that there are no further updates. Now install any other included packages. If asked, select to install for All Users. Run and install any updates for each package. Don't bother configuring the Dock layout, since the user will end up with Apple's default Dock layout anyway. Avoid making any changes to System Preferences from the default settings. This will assure that the new user starts with a pristine system. After everything desired is installed and updated, launch Terminal (in /Applications/Utilities) and enter the following code to re-enable the default Welcome sequence.
rm /private/var/db/.AppleSetupDone
Quit Terminal and run Directory Utility, also located in the /Applications/Utilities folder. Select Disable Root User from the Edit menu. Insert the Leopard Install Disk, restart, and boot from the DVD one more time. Choose Reset Password from the Utilities menu again, but this time, select System Administrator (root) user and click the Reset button. Note: There will now be an iPhone (_usbmuxd) user. It should be ignored and left alone. Quit Reset Password and the Installer to restart. Hold the Mouse button to eject the Leopard Install DVD and verify that the Welcome movie plays. When the initial setup screen appears, enter Command-Q to shutdown the Mac. The Mac is now ready to ship! from macosxhints