“I’m a bit of a command-line freak and like to spend a fair amount of time with the terminal open… As such I like to spend a small amount of time getting the terminal set-up nicely. Other than changing the default colour scheme and font, one (slightly) more drastic change is to replace the standard implementation of ls for one that is slightly more configurable.
The default ls on OS X comes from BSD and compared to the GNU/Linux alternative is slightly lacking when it comes to changing how things look – so what I like to do is replace it with the GNU ls available in MacPorts – this allows me to get a terminal setup like below…” — via A better ls for Mac OS X – hocuspokus.
Since I started frequent cron backups with [CRIBBS][a_110616113305] my unix mailbox (`/var/mail/user`) has been filling up with `stdout` (output) and `stderr` (error) messages kindly left there courtesy of cron. While being informed about what my cron jobs (and the script they’re running) have managed to do while I was gone is great, I really only need to know when there is a problem.
Searching the googlewebs for an answer leads you to all kinds of I/O redirecting resources and sites telling you how to stop both `stdout` and `stderr` from being delivered to your *nix mail. Most seem to miss the obvious–you want to know about the errors but can do without the general output.
The answer is pretty simple (thanks to this [I/O redirect resource][a_110616114319]). If your crontab entry looks like this:
… then all you need to do is add `1>/dev/null` to the end of the line, like this:
This will effectively redirect “1″ (`stdout`) to /dev/null (a non existent designation). All other error messages (`stderr`) will still be delivered as per usual.
“When developing websites it is quite common for there to be some kind of contact form or other mailing function. The problem is that should you, like me, have your email being forwarded through Google Mail you will find those emails never get to your Google address. The reason for this is simple, your computer is not recognised as a legitimate SMTP server so Google rejects the mail. The good news is you can instead tell your Website to send the emails to your local computer instead.” – via Using local mail (/var/mail/user) » themattharris.com.
While I don’t need this at the moment, I did find it worthy of bookmarking since it does come up from time to time.
I am forever going back and forth in Terminal from my local machine (Mac Pro) to an ssh session on my Ubuntu Server. Terminal is not the easiest on the eyes to begin with but I’m particularly bothered by OS X’s default shell prompt, especially after spending time in Ubuntu’s shell.
This is what the default Mac shell prompt looks like:
And this is what my Ubuntu shell prompt looks like:
A little splash of color goes a long way on tired eyes. But even the Ubuntu layout is better… on a Mac the prompt reads like this:
as opposed to this on Ubuntu:
At first look the difference seems negligible, but consider drilling deep into the file structure with cd… again, on a Mac:
and on Ubuntu:
Tell me in each example, at a glance, a) who’s session it is and b) what folder you’re currently in. On the Mac, one might be inclined to think we’re in the “user” folder and “host” is the session user. In Ubuntu there is no doubt, the prompt starts by identifying the user and the host, and ends with the current folder.
So what can we do about it?
## Adding color ##
You may or may not already have a `~/.profile` or `~/.bash_profile` on your Mac–if you do, that’s great. If not, make one (using vim, nano, TextMate or your editor of choice).
For a default Mac prompt, add this line:
For this outcome:
Here is what it all means…
* `PS1` — the initial prompt string
* `\[\e[34m\]\h` — will be a blue `host`
* `\[\e[00m\]:` — will be a white colon
* `\[\e[32m\]\w ` — will be green directories followed by a space
* `\[\e[34m\]\u` — will be the user in blue
* `\[\e[00m\]\$` — will be a white `$`
Here is a chart to help you with the colors and their corresponding numbers (courtesy of [IBM][a_110613211618]):
## Making it easier to read ##
If you’re like me and you want to be able to read the prompt logically, then you can rearrange the prompt like this:
For this outcome:
I hope that helps make your stay in Terminal a little easier.
“The Linux driver r8169 for the Realtek network chip in the EQ servers does not work correctly in CentOS 5.x, Ubuntu 9.04, OpenSUSE 11.1 and Debian Lenny. Timeouts and state changes to link down may occur. The solution is to use the official Realtek r8168 driver. Unfortunately this driver is not yet included in any distribution. For CentOS it can be installed from 3rd party repositories. For Debian and Ubuntu it must be compiled by the user.This article describes how to setup the network driver.”
Thanks to a tip from [@iservice][a_110609143540] I was able to get my ethernet connection to stop dying with this driver. Apparently this NIC’s r8169 driver is a bit of problem for Ubuntu. Using the r8168 driver is the trick.