PuTTYcyg just replaced rxvt for me

putty_icon.gifI like PuTTY, I’ve been using it for years. In my last post I talked about Cygwin and it’s rxvt (which already works pretty good). I also joked about using PuTTY to ssh into localhost.

Well, for the people who want to use PuTTY for their local Cygwin there is a solution: PuTTYcyg. PuTTYcyg is just a patched version of PuTTY which adds “cygterm” as a connection-type. If you wan’t to use it with a desktop/tray shortcut you have to call putty.exe -cygterm - where putty.exe is of course the patched PuTTYcyg version.

The reason for me to use PuTTYcyg instead of rxvt is the Full-Screen-mode of PuTTY. Besides that I guess there are other advantages over rxvt (like being able to change font and terminal-emulation-options for the running session). Oh, and don’t fear, of course it supports 256 colors just fine ;)

mutt 1.5.18, msmtp 1.4.16 and screen 4.0.2 with Cygwin

mutt 1.5.18 works fine with Cygwin (as I just discovered). Building it from source I used

./configure --prefix=$HOME/local/stow/mutt --enable-imap --with-homespool --with-ssl=/usr --enable-hcache --enable-locales-fix

This is assuming you installed the openssl-libs and openssl-devel packages (those can be installed using Cygwins own installer .exe). For header-caching (you really want it when using IMAP) you’re also gonna need some version of berkeley-db, which can also be installed using the Cygwin setup.exe.

msmtp (an SMTP-client which can be used in conjunction with mutt when sending mails over a server which uses TLS/SSL) works equally fine. With version 1.4.16 just do

./configure --prefix=$HOME/local/stow/msmtp --with-libgnutls-prefix=/usr

GNU screen is available as a Cygwin-package (4.0.3) but if, like me, you want 256 colors (and with a spiffy vim-theme you do ;) you have to fall back on building it yourself. You have to apply two patches though: Patch 1 (found here) and Patch 2 (found here). After that

./configure --prefix=$HOME/local/stow/screen --enable-colors256

should do the trick. To actually get 256 colors working use this in your .screenrc:

# terminfo and termcap for nice 256 color terminal
# allow bold colors - necessary for some reason
attrcolor b ".I"
# tell screen how to set colors. AB = background, AF=foreground
termcapinfo rxvt 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# erase background with current bg color
defbce "on"

Careful! If your TERM (the one you start screen with) is not rxvt then you need to adjust that. To see if 256 colors work I use this script (found here).

zsh git-branch prompt and cygwin

This is a post about a few things at once, since I have all these little tips/hints I’d like to make public which don’t deserve their own post ;)

Ok, first about the git-branch status on your zsh. What is that good for? Well, I often find myself working in git-repositories with different local branches (obviously), and sometimes you lose track which branch you have checked out in which repository at the moment. Instead of issuing “git branch” all the time (also note that the git- syntax is no longer valid, the commands are used without the dash now!) you can use that unused space on the right side of your prompt to display the active branch of the current directory (given it is a git repository of course). This is what it will look like (the yellow text is the current branch):

zsh-git-cygwin.gifTo achieve that (and the colors too) you have to put the following into your .zshrc:

setopt prompt_subst
autoload -U colors
colors
function __prompt_git()
{
        local git_dir ref br top;
        git_dir=$(git rev-parse --git-dir 2> /dev/null) || return
        ref=$(git symbolic-ref HEAD 2> /dev/null) || return
        br=${ref#refs/heads/}
        top=$(cat $git_dir/patches/$br/current 2>/dev/null) \
                  && top="/$top"
                  echo "[$br$top]"
}
export PS1='[%?]%{$fg[green]%}%n%{$reset_color%}@%m:%~\$ '
export RPS1='%{$fg[yellow]%}$(__prompt_git) %{$reset_color%}%*'
if [[ "$USER" == "root" ]] ; then
        export PS1='[%?]%{$fg[red]%}%n%{$reset_color%}@%m:%~# '
fi

(RPS1 is the right side of the prompt)

This colors your username green and red if you’re root (really helpful). I’ve picked up the habit of giving remote hosts different colors for the username so that when I have many terminals open I can identify the corresponding host not only by name but also by color. The number in front of the username is the return-code of the command just executed.

cygwin-logo.jpgThe title of this post (and the screenshot) already mentioned the second topic. Cygwin. I heard about it before but always dismissed it as a poor attempt to bring something into an operating system in a strange and crippled way just because some people are too scared to switch to a unix system. Well, being at home right now (and using Windows XP here because I am too lazy to switch this old machine and also play the occasional game in my free time ;) made me try cygwin, and I have to say I am impressed. I don’t use it extensively, to be honest I only use it to be able to ssh/scp without using gui-software like PuTTY/WinSCP, to use git without a gui and to have a decent zsh with screen in it. Oh yeah, and vim. Basically all the little life-savers you have with linux (tar, grep, less, sed, man). Just being able to download a tarball (like git or stow) and compiling/installing it like on any unix is quite convenient too. And that works fine with cygwin. You can also access you normal windows-drives and it has a tool (cygstart) to open files with the associated programes (like “open” in Mac OS). Last but not least you can even run an ssh-server, which seems weird at first, but comes in handy when all you want to do is shutdown you windows-box remotely ;). So if you don’t like the rxvt you can always use putty to ssh to localhost (yeah, I don’t do that neither).

Streulichtblende DIY

Was ist eine Streulichtblende? Eine Streulichtblende sieht so aus (Foto von fensterbme), Streulichtblendeman kennt den Anblick von jedem Profi-Fotografen. Also eine Blende die man vorne auf sein Objektiv steckt. Und was hat man jetzt davon? Blende DIY{.thickbox}Wenn man Leute fragt die schon so eine Blende haben hört man dass die Fotos dadurch einen besseren Kontrast haben und weniger ausgewaschen aussehen. Das ist so da Lichtstrahlen die nicht direkt (also vom Motiv) ins Objektiv fallen sondern halt durch gestreutes Licht von der schrägen Seite kommen durch diese Blende abgeschirmt werden. Ich bin bei solchen Aussagen allerdings immer ein bisschen skeptisch. Deshalb habe ich heute mal ein kleines Experiment gestartet, nachdem ich jetzt sicher bin die 20 Euro für eine richtige Blende zu investieren.

Idee

Tja, Langeweile, tiefstehende Nachmittags-Sonne, Stativ mal ausgepackt. Hm. Also eine Schachtel Schoko-Bananen-Müsli genommen, einen längeren Streifen mit ca. 5cm Breite abgeschnitten, das ganze als Zylinder genau auf größe des Objektiv gerollt und dann zusammengetackert. Dann muss man nur noch das Foto machen, wobei man natürlich drauf achten muss dass das Licht sich zwischen den Aufnahmen nicht ändert und dass keine andere Blende/Belichtungszeit benutzt wird.

Resultat

Wow, das hätte ich nicht erwartet. Das Bild ohne Blende sieht aus als wäre das Originalmotiv von einer ordentlichen Smogwolke befallen worden, wodurch alles heller und viel kontrastärmer wurde. Guckt es euch selbst an, ist schwer das nebeneinander zu zeigen, deswegen empfehle ich beide Bilder runterzuladen und hintereinander zu gucken (Foto oben natürlich mit Blende, unten ohne).

AwF Blende
AwF Keine Blende

Fazit

Die Blende ist absolut billig und einfach, das Material innen ist weder dunkel noch extra beschichtet und trotzdem sieht man schon so einen Unterschied. Der Vorteil bei einer richtigen Blende ist auch dass man sie falschrum auf das Objektiv stecken kann und somit leicht transportieren und gleichzeitig das Objektiv schützen kann.

subscribe via RSS