Linux Colloquy push notifications from Debian Squeeze

To get this working I did the folloing on my Debian Squeeze installation.

Compile the latest znc

$ sudo aptitude install build-essential libssl-dev libperl-dev pkg-config 
$ sudo aptitude build-dep znc 
$ wget http://znc.in/releases/znc-latest.tar.gz 
$ tar -xzvf znc*.*gz $ cd znc* 
$ ./configure 
$ make 
$ sudo make install 

Install Colloquy push add-on

$ curl -LO http://github.com/wired/colloquypush/raw/master/znc/colloquy.cpp 
$ znc-buildmod colloquy.cpp 

Move colloquy.so to ZNC’s modules folder. By default, this is ~/.znc/modules/.

$ mv colloquy.so ~/.znc/modules/ 

Configure ZNC

$ /usr/local/bin/znc --makeconf 

Misc

Load the Push module with ZNC, either through webadmin or by typing /msg *status loadmod colloquy.

For help and options, type /msg *colloquy help or /msg *colloquy status in your IRC client.

Note: if you want to disable push when another client is connected to znc, pass the following argument to the colloquy module (make sure your module is up-to-date):

-attachedpush 0 

or send a message to *colloquy after loading the module:

/msg *colloquy attachedpush 0 

Sources

Create fluid apps with shell script

With netflix now available in Sweden I made an fluid app for netflix to have in my dock.

I found the script over at lifehacker.

It is really useful because you get to specify what browser you want the fluid app to launch.

Patching GNU Screen with vertical split support in OS X

I found this great article on how to get support for vertical split in GNU Screen when running Mac OS X.


$ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/screen co screen
$ curl http://old.evanmeagher.net/files/gnu-screen-vertsplit.patch > gnu-screen-vertsplit.patch
$ cd screen/src
$ patch < ../../gnu-screen-vertsplit.patch
$ ./configure --enable-locale --enable-telnet --enable-colors256 --enable-rxct_osc
$ make
$ sudo make install

Sources:

How to install Google Authenticator under Debian Squeeze

The Two way authentication from Google is very cool! I found a post describing how to install it under sid, but I have modified it to apply to the current version of Debian stable.

  1. Download the libpam-google-authenticator package from http://packages.debian.org/wheezy/libpam-google-authenticator. (It is not available in Squeeze stable, so I downloaded the following manually: http://ftp.se.debian.org/debian/pool/main/g/google-authenticator/libpam-google-authenticator_20110413.68230188bdc7-1.1_amd64.deb)
  2. Run:
    sudo aptitude install libqrencode3
    sudo dpkg -i libpam-google-authenticator_20110413.68230188bdc7-1.1_amd64.deb
  3. Configure google-authenticator by running
    google-authenticator
  4. Scan the barcode from the Google Authenticator app on your mobile device.
  5. Edit /etc/ssh/sshd_config and set :
    ChallengeResponseAuthentication yes
  6. Edit /etc/pam.d/sshd and add at the very beginning of the file :
    auth required pam_google_authenticator.so
  7. Restart the service :
    service ssh restart
  8. Done

 

Sources:

Exporting VMs MAC and IP from vCenter

I stumbled across a forum post that describes a simple way to export all of your VMs MAC and ip addresses.

Just connect to your vCenter database using SQL Management studio and run the following:

select e.name, n.mac_address, n.network_name, i.ip_address
from vpx_vm v

inner join vpx_nic n on (v.id = n.entity_id)
inner join vpx_entity e on (v.id = e.id)
inner join vpx_ip_address i on (i.entity_id = n.entity_id and i.device_id = n.device_id)

Source: http://communities.vmware.com/thread/217326

Mac: Run Script before or after Wake from Sleep

I have a few scripts that I want want my macbook to run just before I put it to sleep (by simply closing the lid).

To achive this I did the following:

  1. I installed sleepwatcher via brew
    brew install sleepwatcher
  2. Then I copied the launchd files to the ~/Library/LauchAgents directory
    cp /usr/local/Cellar/sleepwatcher/2.2/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist ~/Library/LaunchAgents
  3. I restarted my Macbook and created the ~/.sleep script which contains the commands that will run before sleep.. (You could also create a ~/.wakeup script that runs when the mac wakes up.)

Source: EchoDitto Labs, Stack Overflow

gcc path problem with Debian 6.0.4 on VMware Fusion

I got the following error message while installing VMware Tools on Debian 6.0.4 on VMware Fusion.

The path "/usr/bin/gcc" is not valid path to the gcc binary.

I tried to fix it by installing the linux-header files…without any success.

I solved it by running:

apt-get install kernel-package

apt-get install gcc-4.3 linux-headers-`uname -r` -y

I found the solution here.

Dockless hides apps from the dock

I’ve been using a small app called dockless. Dockless hides the icon from the dock…that’s all. But it does it great and it’s free.

Dockless is a little app that does what some people have always wanted – remove certain applications from their dock. Dock real estate can become precious, and some apps don’t make a whole lot of sense sitting there. That’s where Dockless comes in. With Dockless, any OS X application can be made to show in the Dock or not.

Download dockless here

DavMail is a Exchange to IMAP CalDav proxy

Snow Leopard and Mac OS X Lion both have built in support for Exchange 2007 and 2010.

But what do you do if your company is running Exchange 2003 or if you want to run IMAP (And your company only permits a “Outlook Anyware”-type setup, IMAP over HTTPS).

Well you can either stick to running the Outlook Web Access, which in Exchange 2010 is kind of nice, or you can install a program called DavMail. DavMail acts as a proxy between your computer and the corporate Exchange server.

Some really nice features in DavMail:

  • It’s cross-platform. You can run it on your Mac, Windows och Linux machine.
  • You can run it on a server or locally on your client-computer.

How to install Huawei e173 on Mac OS Lion

I live in Sweden and bought a Huawei e173 from the Swedish operator Telia. The only problem is that the 3G modem came with drivers and software for Snow Leopard (Mac OS X 10.6).

To start off, I installed the modem on a windows machine and disabled the PIN-code on the simcard. I personally get quite annoyed when I have to enter a PIN-code everyone I connect a 3G modem..

Next, I downloaded the drivers on my own from mobinil.com, installed them and configured the modem with the following settings:

Dial: *99#

Vendor:Generic

Model: GPRS (GSM/3G)

APN: online.telia.se

Note that the APN is different on every carrier. Just Google it…

Enforce HTTPS with a .htaccess file

Start by enabling mod_rewrite then create an .htaccess file in the directory that you want to force HTTPS.

The content of the .htaccess-file:

RewriteEngine On RewriteCond %{SERVER_PORT} 80 
RewriteCond %{REQUEST_URI} somefolder 
RewriteRule ^(.*)$ https://www.domain.com/somefolder/$1 [R,L]

Now if you go to http://www.domain.com/somefolder you will be redirected to https://www.domain.com/somefolder.

How to force TotalTerminal to always display on top of the dock

I have been using TotalTerminal for a while now. But since the latest 1.1.1 the visor is displayed under the dock. (I have my dock on the left side of my screen) This is both annoying and renders the TotalTerminal useless.

This is all due to a bug fix in 1.1.1. There is a way to fix this issue.

Open a new terminal.app window and enter the following line:

defaults write com.apple.Terminal TotalTerminalVisorWindowOnHighLevel -bool YES 

Restart Terminal.app with TotalTerminal.

The TotalTerminal visor is now shown on top of the dock.

Source: GetSatisfaction