gorn.ch

Tobias Ebnöther's personal blog

Nice screenrc and common keystokes

I like to work with screen because I can easily switch between different virtual consoles and attach them somewhere else if needed. So here is how I setup my screenrc:

vbell off                  #Don't display the wuff wuff stuff
defutf8 on #Turn on UTF-8 by default
shelltitle "$ |bash" #Standard Shell title will be replaced by bash
caption always #I never use split view but like the caption
caption string "%{= wk}%w" #Show me all opened consoles with white on black

Add this to your .bashrc to get nice console names (usually the runnig programm):

export PROMPT_COMMAND='echo -ne "\ek\e\\"'

Here are the keystokes I use very often:

Create new console:        ^A c
Get to next console: ^A n
Go to last console: ^A a
Go to specific console: ^A <consolenumber>
Deattach screen: ^A d
Related Entries:
NetNewsWire Lite vs Vienna memory usage
Living with Terminal.app
Fixing the delete key in Terminal.app
tail -f to growl
Setting up relayhost for postfix on OSX (with ssl and authentication)
Comments (1)  Permalink

tail -f to growl

What I'd like to do is to observe a file with growl (the apache error_log in my case). Getting inspired by this article I wrote a little script called tailf2growl just copy it to /usr/local/bin/tailf2growl or something:

#!/bin/sh
if [ -z "$1" ]; then
echo "Missing filename"
exit 1
fi

tail -n0 -F $1 | while read; do
echo $REPLY | growlnotify -a tailfgrowl -t $1;
done

The usage is simple as hell just do it like this:

tailf2growl /var/log/httpd/error_log 
Related Entries:
NetNewsWire Lite vs Vienna memory usage
Living with Terminal.app
Fixing the delete key in Terminal.app
Nice screenrc and common keystokes
Setting up relayhost for postfix on OSX (with ssl and authentication)
Comments (3)  Permalink

Turn your openwrt router into a bridge

So here is what I wanted to prevent a cable between our cablecom connection, where our first router is located and our office.

    +---------+                                   +--------------+
| OpenWRT | <--- WPA secured WiFi ---> | Existing |
| bridge | | access point | -- (DHCP server)
+---------+ +--------------+
| | |
PC PC PC
This graphic and most of the configs are from http://wiki.openwrt.org/WirelessBridgeWithWPAHowto I just changed it to match WPA1 and my WRT54g. This Script will turn your router into a wireless bridge, but with an IP on the LAN and on the wireless side assigned so you can still configure it.
#Remove unused services:
rm /etc/init.d/S45firewall
rm /etc/init.d/S50dnsmasq
cp -f /rom/etc/init.d/S40network /etc/init.d/S40network
sed -i "/ifup wan/d" /etc/init.d/S40network

#Configure wifi:
ipkg install nas
ipkg install wl
nvram set wl0_radio=1
nvram set wl0_infra=1
nvram set wl0_mode=wet
nvram set wl0_ssid=ebiwireless
nvram set wl0_akm=psk
nvram set wl0_crypto=tkip
nvram set wl0_wpa_psk=fsckingunsecure

#Configure the interfaces:
nvram unset wan_ifname
nvram set wan_proto=none
nvram set lan_ifname=br0
nvram set lan_ifnames="vlan0 eth1"
nvram set lan_ipaddr=192.168.2.253
nvram set wifi_ifname=eth1
nvram set wifi_proto=static
nvram set wifi_ipaddr=192.168.2.252
nvram unset vlan1ports
nvram unset vlan1hwname
nvram set vlan0ports="4 3 2 1 0 5*"

#Save that stuff and reboot
nvram commit
reboot
 Permalink

Rabbit got a friend...



Our sweet little drNabaz got a friend who's taking place at my home
soon :)
 Permalink
1-4/4
Powered by Flux CMS