Tag: basic setup
Nice irssi theme to fit with my fancy screen status bar
by mmnicolas on Nov.09, 2009, under gnu/linux
As another part of my basic setup, here is my irssi theme file:
And my precious key bindings, see this post to understand why it is from F7 to F10.
For this to work, just copy/paste this into your irssi:
GNU Screen scroll fix
by mmnicolas on Nov.08, 2009, under gnu/linux
The GNU Screen manual tells you that to use scrolling, you must first enter “Copy mode” with C-a [.
You can easily fix this and use regular PgUp/PgDn by simply adding a line to your ~/.screenrc. I really don’t know why this isn’t a default setting except that it seems to mess with Vim scrollback.
Here’s the line:
termcapinfo xterm ti@:te@
Enjoy.
Auto-reattaching terminal multiplexor with tabs
by mmnicolas on Oct.21, 2009, under gnu/linux
Typically, from a single ssh connection comes a single shell, let’s improve this situation.
We will use a terminal multiplexor GNU Screen, which provide multiple terminals. We will also implement a neat tab bar to allow naming/showing tabs and automatic session re-attachment capability.
Follow these steps to significantly enhance your distant shell experience, you will need to install screen and ssh, mutt and irssi are optional.
The first step involves using environment variables in order to detect if the login is locally originating or not. If the user is logging from a distant machine, we will reattach an existing detached screen session or create a new one.
When logging in remotely, the most evident distinction i’ve found between a local and remote shell is the environment variable SSH_CONNECTION=, with this var we have a way of detecting remote logins easily and launch something else accordingly.
Useful and nice looking shell with GNU Screen
by mmnicolas on Jul.28, 2009, under gnu/linux
This is how i got my linux shell looking so wonderful, using GNU Screen of course and its famous ~/.screenrc configuration file.
Let’s create it and paste this into it:
#hardstatus string ” %wb%-w%wr%n %t%-%+w %=%D %d %M %y %c”
#hardstatus string “%r%c%k | %w% ? (%h)% ?”
#hardstatus string “%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{r}(%{W}%n*%f %t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m/%d %{W}%c %{g}]“
hardstatus string ‘%{= c}[ %{W}%H %{c}][%= %{= w}%?%-Lw%?%{c}(%{W}%n*%f%t%?(%u)%?%{c})%{w}%?%+Lw%?%?%= %{c}][%{W} %d/%m %{W}%c %{c}]‘bindkey -k F1 prev
bindkey -k F2 nextscreen -t irssi 1 irssi -c irc.freenode.net
screen -t mutt 2 mutt
screen -t monitor 0 lwatch -i /dev/xconsolehardstatus alwaysignore hardstatus alwayslastline
The whole aesthetic thing reside in the first uncommented line, this is where it sets what is displayed in the hardstatus line which is always the last line. You can find documentation about the variables that can be used to display different types of information in the screen man page. ($ man screen).
As for the bindkey, you’ve guessed they bind keys to go forward and backward in your terminal tabs, and yes F1 means F11, don’t ask me why. I use F11 and F12 because i intend to use F9 and F10 in irssi to move between windows.
Using fetchmail with gmail
by mmnicolas on Jul.28, 2009, under gnu/linux
Gmail requires a secured connection for authentication and for this we need a certificate, here’s how:
Verify the current certificate gmail is using with this command:
openssl s_client -connect smtp.gmail.com:995 -showcerts
Hit Ctrl-c to terminate the command once you got something like this:
—–BEGIN CERTIFICATE—–
MIIC3TCCAkagAwIBAgIDCDijMA0GCSqGSIb3DQEBBQUAME4xCzAJBgNVBAYTAlVT
MRAwDgYDVQQKEwdFcXVpZmF4MS0wKwYDVQQLEyRFcXVpZmF4IFNlY3VyZSBDZXJ0
aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDcxMDI1MTc1MzE2WhcNMDkxMjI0MTg1MzE2
WjBoMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN
TW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xFjAUBgNVBAMTDXBv
cC5nbWFpbC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAO03QxerFKZV
8yeomuL4zSl8Pr7hMWnKMMgp/CwhwadeBmL0LQHHbjL/6z/Z59ZQvrztqkwhchA2
APKzUwRVTyn7Shx6vBqk6oFmTqoOLmY6hbq6l8uVdUv0AfbHwio8CnLpK2+nbuFl
flPwx1DH0E3grD8+CrH5SmScfTWbDkcXAgMBAAGjga4wgaswDgYDVR0PAQH/BAQD
AgTwMB0GA1UdDgQWBBTJRG/OFpZt+BV43JM3NshHMjpwazA6BgNVHR8EMzAxMC+g
LaArhilodHRwOi8vY3JsLmdlb3RydXN0LmNvbS9jcmxzL3NlY3VyZWNhLmNybDAf
BgNVHSMEGDAWgBRI5mj5K9KylddH2CMgEE8zmJCf1DAdBgNVHSUEFjAUBggrBgEF
BQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQEFBQADgYEAOKr3mhxtwFCS3J6lbeaf
3KrHKi935BZkI75sRbON+hog0t2ovcM2i7fxs3xneH8USLsHgfxNBj9tkMogMK/K
sO/NUVZ/IfyqcNNkp2619qTQXthKRH42JKpAKgNhT1bdno3pxn+eDEpqmU3CE7IP
HDCjWOK1fGkZ/yFAuTxuxAc=
—–END CERTIFICATE—–
Setup postfix as a gmail relay
by mmnicolas on Jul.27, 2009, under gnu/linux
Here’s how to use postfix to send mail through gmail. Assuming you have postfix and libsasl2-modules installed, the rest should be automatically installed since it depends on it. First open your postfix main.cf file located at /etc/postfix/ (on debian).
Append this to the end:
relayhost= [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymoussmtp_destination_rate_delay = 60
relay_destination_rate_delay = 60mailbox_command = /usr/bin/procmail -a $EXTENSION
Keyboard layout configuration without desktop environments tools
by mmnicolas on Jul.27, 2009, under gnu/linux
My home file server used to be headless, but i thought it deserves a head even if it’s only a PIII 300mhz/256mb of ram, no video accel. So i installed a minimal Xorg server with openbox as a window manager. Then i remembered, maybe 10 years ago when i was using WindowMaker and/or Blackbox i had to fiddle with xmodmaps and xkeycaps to get french accents working. Now i realize there is a much more simpler way to do it through the Xorg config file /etc/X11/xorg.conf.
Section “InputDevice” Identifier “keyboard”
Option “XkbRules” “xorg”
Option “XkbLayout” “ca”
Option “XkbVariant” “fr”
EndSection
Just modify your keyboard section with the above Xkb options.
And there you are, with a french canadian keyboard layout! Now i can watch pictures with french accents in the filename…