gorn.ch

Tobias Ebnöther's personal blog

xchat on OSX / Command as alt

Hi all, long time no see :)

Lately I got more and more unstatisfied with Colloquy so I decided to go back to xchat. Since xchat aqua seems unmaintained I opted for "the real thing" on X11. Unfortunately MacPorts once again failed to build it (I think I never managed to sucessfully build something with it that has some deps) so I had too look for something else.

Bruno pointed me at Homebrew which looks totally awesome. There was no Formula for xchat but it was pretty easy to create one. After only two hours my commit was accepted and it's in the main branch now :)

To be able to nicely switch channels I decided to map the command (⌘) key to alt aka meta. For that purpose I added the following lines to my ~/.Xmodmap:

clear Mod1
clear Mod2
keycode 63 = Meta_L
keycode 66 = Mode_switch
add Mod1 = Meta_L
add Mod2 = Mode_switch
Related Entries:
Setting up relayhost for postfix on OSX (with ssl and authentication)
MacHeist Software Bundle
Leopard native apache with custom (64bit) PHP
Leopard PHP / Apache Package with pecl support
Taming firefox temp files on osx
Comments (4)  Permalink

Setting up relayhost for postfix on OSX (with ssl and authentication)

Ok several co workers asked me how to make the command line mail tool use a proper mailserver under osx. The problem is that it sends mails directly which will not be accepted by most of the mailservers.

If you only want to send your mail plaintext over a mailserver and not use any authentication you just have to add this line to your /etc/postfix/main.cf:

relayhost = gorn.ch

If your mailserver allows SSL encryption you should also add the following lines:

smtp_sasl_auth_enable = yes
smtp_sasl_security_options =

Now finally if your mailserver requires a login you need some more steps to do. First add the following line to your main.cf:

smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

Now create a file called /etc/postfix/sasl_passwd make sure it's only readable by root because you will have to put in your password there the syntax looks like this:

gorn.ch username:password

Finally run this and you should be good to go. Send a mail over the commandline to make sure it works. :)

sudo postmap hash:/etc/postfix/sasl_passwd
Related Entries:
xchat on OSX / Command as alt
MacHeist Software Bundle
Leopard native apache with custom (64bit) PHP
Leopard PHP / Apache Package with pecl support
Taming firefox temp files on osx
 Permalink

Awesome Skype Regex Replaces

Skype has an awesome new feature. If you want to edit your last message you can simply do it with a regular expression. Definitely a feature every command line geek will love and most likely already use without knowing (took me some days to figure out ;))

So if you type something like "Hello Patrick" to Patrice you can simply correct it by writing "s/Patrick/Patrice/" see the video for a demo:

Comments (2)  Permalink

Resolve subversion conflicts with Araxis Merge

I am a big fan of Araxis Merge and I also use svnmerge.py quite often. Lately I run into a bunch of nasty conflicts that weren't so easy to resolve. I wrote a little script that you can execute in the current directory to open all conflicting files in Araxis.

It opens the file diff with your working state on the left and the subversion state on the right. If you save it saves to the "real" file. You still need to execute svn resolved afterwards.

#!/bin/bash
OPTS="-2"
for FILE in `svn st | grep '^C' | awk '{print $2}'`; do
/usr/local/bin/compare $OPTS "${FILE}.working"  "${FILE}.merge-right"* "${FILE}"
done

You probably need to adjust the path to compare. I specified the full path here since Image Magick has the same command. You can add additional options like -wait to the OPTS variable to resolve one file after another.

PS: I hope someone from Araxis reads this and renews my support which is running out soon :)

 Permalink

Lock screen on osx with screensaver

This is mainly for myself because I search that snipped every time I set up a mac. I place it to /usr/local/bin/lock and then type lock in my shell (or LaunchBar) to fire the screensaver and lock the screen (locking needs to be turned on in the preferences).

#!/bin/bash
SCRS=`ps xcopid,command|grep ScreenSaverEng|cut -b1-5`
if [ -z "$SCRS" ]; then
  /System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine
fi

To safe some energy I don't use the screensaver but let blank the screen after a while.

Related Entries:
NetNewsWire Lite vs Vienna memory usage
Living with Terminal.app
Fixing the delete key in Terminal.app
Nice screenrc and common keystokes
tail -f to growl
 Permalink

Start memcached with launchd [Updated]

I let memcached automatically start with the OS X integrated launchd. Here is the XML I provided to start it with the following settings:

  • Bound to localhost
  • Runs as nobody
  • Spawns only one thread (this can slow things down)
  • Consume a maximum of 10MB memory (it will just throw old stuff out afterwards)
  • It will start when you login
  • It will send all output to /dev/null

Here is the updated script (I use macports now instead of fink just change the path to wherever your binary is). Just put the XML to ~/Library/LaunchAgents/memcached.plist and run launchctl load ~/Library/LaunchAgents/memcached.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>memcached</string>
    <key>ProgramArguments</key>
    <array>
        <string>/opt/local/bin/memcached</string>
        <string>-l</string>
        <string>127.0.0.1</string>
        <string>-u</string>
        <string>nobody</string>
        <string>-t</string>
        <string>1</string>
        <string>-m</string>
        <string>10</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>StandardOutPath</key>
    <string>/dev/null</string>
    <key>StandardErrorPath</key>
    <string>/dev/null</string>
</dict>
</plist>
Related Entries:
Start memcached with SystemStarter
Comments (3)  Permalink

View source in Safari with TextMate

Some days ago Lukas Smith asked me if it's possible to get source highlighting in Safari. For Firefox I used the ViewSourceWith extension for a long time to use TextMate. So now I wanted to get that in Safari too. Usually I use Safari to browse and Firefox to develop so it's not really necessary but a nice feature.

I found a cool plugin for Safari called SafariScript which ships a view source in TextMate script. But the script is pretty poor. It just fetches the URL via curl to a specified file, so you can only access public sites and only one page at time. The other scripts are very cool trough for example the "Open page in Firefox" script which I love when I opened the page in the wrong browser.

I came up with my own script which you can see bellow. It fetches the source directly from Safari instead of downloading the URL and it adds a timestamp and random number to the tempfile so it should be possible to open as much pages as you want. Just put it in place of the old script and add a cool keyboard shortcut (I use ⌘U as in Firefox).

property newline : ASCII character 10

set timestamp to do shell script ("date +%s") & (random number from 1 to 1024) as text
set tmpfile to POSIX path of ((path to "temp" as Unicode text) & "view_source" & (timestamp) & ".html ")
set tmpfileSpec to ((path to "temp" as Unicode text) & "view_source" & (timestamp) & ".html ") as file specification

tell application "Safari"
        set htmlSource to source of document of front window as text
end tell

set fp to open for access tmpfileSpec with write permission
set eof of fp to 0
write (htmlSource) to fp starting at eof
close access fp

tell application "TextMate"
        activate
        open tmpfileSpec
end tell

do shell script "rm -f  -- '" & tmpfile & "'"
Related Entries:
TextMate Presentation
Comments (5)  Permalink

Enable tags in ecto3

Yesterday I wrote a little Patch to fix the tagging feature in ecto3. You will have to set the setting to the following:
ecto_tagging_settings.png

I fixed the image upload too, but I didn't figure out how to use a customized image template to let FluxCMS generate the thumbnails instead of uploading them separately.

Related Entries:
monorom teaches css
 Permalink

MacHeist Software Bundle

A few days ago I bought the macheist bundle. In my opinion this years bundle is great. I allready converted nearly ALL of my useraccounts to 1password generated password. Played around with snapz pro (now I can blog cool screencasts in great quality :) and CSSEdit. Also I used AppZapper to Zap iStopMotion since I will not produce a movie anyways, just wanted to take a look. Probably more detailed reviews will follow.

But now to get more (free) apps you need to referr people to buy it. Actually I don't like to do this, but I like to get free apps :) So if you read this and are going to buy the bundle, please use this link: https://www.macheist.com/buy/invite/89925
Related Entries:
xchat on OSX / Command as alt
Setting up relayhost for postfix on OSX (with ssl and authentication)
Leopard native apache with custom (64bit) PHP
Leopard PHP / Apache Package with pecl support
Taming firefox temp files on osx
 Permalink

TextMate Presentation

As mentioned in the post earlier I was going to do a presentation of TextMate. In the final version I excluded the blogging bundle stuff since it doesn't work well with the FluxCMS blog and I was short on time.

If you're still interested you can get the slides here. The slides are something like a mix between feature presentation (first part) and cheatsheet (second part).

There did some interesting things happen while writing this presentation.
1) Presenting a text editor is more stupid than I thought. Actually there are a lot of things that you like and can't explain well in words - it's just a feeling you get.
2) I'm using ways to less key combos :)
3) TextMate rocks!
4) I need to train my presentation skills and try to not forget things I wanted to say (in the correct order)...
Related Entries:
Jackalope presentation and status
View source in Safari with TextMate
Leopard native apache with custom (64bit) PHP
Leopard PHP / Apache Package with pecl support
Nabaztag Widget
 Permalink
Next1-10/20
Powered by Flux CMS