How to change your default shell
Tuesday, August 12th, 2008I ain’t never going to remember this, so into the blog it goes:
$ chsh -s /path/to/fish
Masochists should substitute “fish” for whatever less friendly shell they prefer.
I ain’t never going to remember this, so into the blog it goes:
$ chsh -s /path/to/fish
Masochists should substitute “fish” for whatever less friendly shell they prefer.
Hypothetically speaking of course, let’s assume you forget to renew a domain name. And suddenly that domain’s email is not working. And then you notice the site is down. The next step is, logically speaking, to panic, followed by an attempt to figure out what the hell is going on. Which usually means restarting Apache. Which results in:
apache2: apr_sockaddr_info_get() failed for yourhost
Which is, wow, an exotic new error. If you see this it means that, even though Apache says its restarting, really its probably not. And now all your other sites are down. And, so, more panic. More panic for you.
Now that you’ve probably realized that the default domain name has expired, you will want to get Apache back up on a different, actually non-expired domain. Like this:
$ hostname actual-non-expired-domain-name.com
Now restart.
Alternatively if your hostname is set to something like “www”, probably you can change the default site in vhosts so that Apache can connect the hostname to the tld.
This is all hypothetical of course.
You login to a mysterious new box. There is no login message. You poke around and before long you start to wonder “So what the heck distro is this anyway?”
$ uname -a
just tells you all about the kernel. Hmmm. A mystery.
To pull up details on the distribution, take a peak in /etc/issue. This text file is often what is presented to users after they login, and typically contains distribution specific details. Likewise, look for /etc/*release or /etc/*version, which various distributions use to tag the release version.
Elementary!
If you ever find yourself stuck relying on the IME built-into Emacs (rather than the IME native to your OS), here are the essential key strokes you’ll need to know.
C-\: toggle input mode (ime on or off)C-h: shows conversion options if used when in conversion modeSPC: transform input to kanji, or show the next conversion candidateDEL: abort conversionC-n: show the next conversion candidateC-p: show the previous conversion candidateC-o: lengthen conversion bunsetsuC-i, TAB: shorten conversion bunsetsuShift-k: toggle between hiragana and katakanaqq: toggle between alphabet and kanji modesqz: turn on zenkaku alphabet modeqh: turn off zenkaku alphabet modeAlso useful:
C-x RET l: set the buffer language environmentC-x RET C-\: select the input methodNow that the Senate has decided to grant retroactive immunity to the telecoms (video), it probably won’t be long before the Bush Administration starts routinely tracking your search habits, mining your email, and monitoring your phone calls. This kind of automated profiling will allow the NSA to determine, among other things, your propensity for terror. Yes, soon the Bush Administration will be protecting us all from ourselves.
But I say, why wait?! I want the Bush Administration to protect me from myself right now! Am I a subversive? Could I be a terrorist? I need to know! And I’m sure you do as well.
That’s why I have started automatically carbon copying all of my email to George W. Bush. Okay, well, technically I’m carbon copying them all to Dick Cheney because it would appear that Cheney reads Bush’s email for him. But I have every confidence that Mr. Cheney will keep the president abreast of my goings on.
If you’re a Microsoft Outlook user, here’s how you too can automatically carbon copy all of your email to the White House.




That’s it! Now all of your email will be automatically carbon copied to Dick Cheney at the White House, who will update President George W. Bush, who will work with the NSA to figure out if you are a terrorist or not. Because, let’s face it, who knows what you’re capable of? Act now before it’s too late!
It’s an Emacs weekend here at blog.arithm.
I was recently asked if it was possible to do remote PHP debugging with Emacs. We’re talking about Emacs, so the answer is: Of course! How to do it:
debugclient somewhere in your path. (Here Emacs is running on Windows, so I just threw it into the C:\WINDOWS\ directory.) Make sure the executable is named “debugclient” and not “debugclient-0.9.0″ or whatever.Now, assuming you already have xdebug plugged into PHP, modify php.ini or an .htaccess file with the following settings:
xdebug.remote_enable = true xdebug.remote_handler = dbgp xdebug.remote_host = your_client_ipFor security reasons it’s wiser to do this via .htaccess on directories that permit only authenticated access.
To debug, ask Emacs to listen for connections by going into GEBEN Mode with Meta-x geben. You should see “xdebug started.” in the status row at the bottom of the Emacs window.
Run your PHP script with the xdebug switch on, eg.
http://www.example.com/script.php?XDEBUG_SESSION_START
If everything is setup correctly, Emacs will load the source of script.php (be wary of security!) and allow you to step through the code.
Available commands are:
spc step into/step over
i step into
o step over
r step out
b set a breakpoint at a line
u unset a breakpoint at a line
g run
q stop
Some gotchas: I’ve noticed the GEBEN expects the first keystroke to be “space”; often it will freeze otherwise. GEBEN may also run into problems on certain session-related PHP commands.
Happy debugging!
Rather than allow Emacs to assume HOME is c:\ (which will cause Vista to winge every time you want to modify your .emacs file), try the following:
setx HOME "%USERPROFILE%"
This will make home something like c:\Users\username.
Now you can keep your .emacs in a far more rational place and not have to wake up the Vista security troll whenever you want to do some tweaking.
There are a variety of ways to “undo” something in Emacs. Unfortunately some of the keystrokes work in some environments, while others do not. Here’s a quick rundown:
Meta-x undo — Will undo only the most recent changes. Cannot be used multiple times.Ctrl-x u — Undo. Consecutive repetitions will undo earlier and earlier changes.Ctrl-_ or Ctrl-/ — Same as Ctrl-x u, however does not work in some envrionments.Ctrl-Shift-Minus — Same as Ctrl-x u, however does not work in some environments.For whatever reason I can never remember the Ctrl-Shift-Minus sequence when I find myself in an environment where Ctrl-_ and Ctrl-/ don’t work.
Keep in mind that Emacs undo is a bit different from traditional undo: Undo actions themselves are recorded as actions. This can be confusing.
In some environments, Ctrl-x Ctrl-_ will reverse the order of undo. I avoid this out of fear that it will cause the universe to implode.
See the Emacs info node for more good undo lore, such as how to use “selective undo” which restricts undo actions to changes performed in the current active region. (Very useful.)
Something else I should have known about long ago. To turn on logging in portage, simply add the following to /etc/make.conf:
PORTAGE_ELOG_CLASSES="warn error log"
PORTAGE_ELOG_SYSTEM="save"
The will add log files for each package to /var/log/portage/elog/:
# ls -lah
total 108K
drwxrws--- 2 portage portage 4.0K 2008-06-06 01:13 .
drwxr-xr-x 3 root root 4.0K 2007-10-04 12:29 ..
-rw-r--r-- 1 root portage 200 2008-06-06 00:58 dev-db:postgresql-8.0.15:20080605-155810.log
-rw-rw-r-- 1 root portage 72K 2008-06-06 00:44 summary.log
-rw-r--r-- 1 root portage 67 2008-06-06 01:06 sys-apps:coreutils-6.10-r2:20080605-160624.log
-rw-r--r-- 1 root portage 108 2008-06-06 01:08 sys-apps:shadow-4.0.18.2:20080605-160842.log
Useful to have around when you miss a barrage of announcements after a large emerge.
Looks like mktemp is now provided by coreutils. No wonder. This block has been bugging me (read: I’ve been ignoring it) for months.
To fix just unmerge mktemp and update coreutils.
Update: Same for the setarch / util-linux block should you come across it. Unmerge setarch.