my life

day to day

Archive for the 'HOWTO' Category

Installing CPAN Packages for Debian

Thursday, June 19th, 2008

If you want to install CPAN modules as Debian packages, this HOWTO is for you.

First, install dh-make-perl:

apt-get install dh-make-perl

Then build & install the package. For example, if you wish to install the module Nagios::Plugins::Memcached from CPAN, simply run:

dh-make-perl --install --cpan Nagios::Plugins::Memcached

You’re done.

add to del.icio.us    add to technorati favs   email this

Configuring Mutt for IMAP support

Monday, December 31st, 2007

Configuring Mutt with IMAP is as easy as editing your .muttrc and adding the following lines.

set spoolfile=imap://username:password@host/INBOX set folder=imap://username:password@host/INBOX

You can then change folders inside of Mutt by pressing ‘c’ and then ‘?’ to get a folder list.

add to del.icio.us    add to technorati favs   email this

Unknown table engine ‘InnoDB’

Sunday, December 23rd, 2007

I was getting the error “ERROR 1286 (42000): Unknown table engine ‘InnoDB’” when trying to create/alter tables with the InnoDB engine. You can check for this warning by issuing the create or alter statements and then running

show warnings;
in the same mysql client session.

Check if you have InnoDB support enabled:

mysql> show variables like ‘have_innodb’; +—————+———-+ | Variable_name | Value    | +—————+———-+ | have_innodb   | DISABLED | +—————+———-+

The problem is that InnoDB is not enabled by default in Debian distributions of my.cnf.  To enable it, simply comment the following lines under the [mysqld] section.

#skip-innodb

add to del.icio.us    add to technorati favs   email this

HOWTO Find the Network Printer

Monday, November 26th, 2007

This is the easiest way to find a JetDirect printer on port 9100 on your local network. Useful in those cases you’re on site with a client and need to print something.

nmap --open -p 9100 192.168.240.* -T insane

add to del.icio.us    add to technorati favs   email this

Debian trying to overwrite add-shell with passwd

Saturday, September 8th, 2007

Preparing to replace debianutils 2.8.4 (using …/debianutils_2.23.1_i386.deb) … Unpacking replacement debianutils … dpkg: error processing /var/cache/apt/archives/debianutils_2.23.1_i386.deb (--unpack):  trying to overwrite `/usr/sbin/add-shell’, which is also in package passwd Errors were encountered while processing:  /var/cache/apt/archives/debianutils_2.23.1_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

Simply run

dpkg -r --force all passwd apt-get -f install

add to del.icio.us    add to technorati favs   email this

DJabberd + Google Talk (GTalk) HOWTO

Monday, August 27th, 2007

Since GTalk is totally complaint with Jabber, all you need to do to make your jabber server communicate with it is enable S2S in your DJabberd configuration. Also, you might need to setup a SRV record so remote jabber servers know how to communicate back to your vhost.

Add this to your djabber.conf VHost section at the top.

S2S enable

Next, add the SRV records. More information can be found by following…

http://jabberd.jabberstudio.org/2/docs/section05.html#5_7

Which means, you essentially add this (on BIND servers) to the domain configuration.

_jabber._tcp.some_domain.com. 86400 IN SRV 5 0 5269 host.some_domain.com. _xmpp-server._tcp.some_domain.com. 86400 IN SRV 5 0 5269 host.some_domain.com. _xmpp-client._tcp.some_domain.com. 86400 IN SRV 5 0 5222 host.some_domain.com.

Check that they took by running…

dig @localhost _jabber._tcp.some_domain.com any +short

Now start adding your contacts just by using the GMail email address.. e.g

add to del.icio.us    add to technorati favs   email this

DJabberd Debian HOWTO

Saturday, August 11th, 2007

Checkout the latest SVN copy

svn co http://code.sixapart.com/svn/djabberd/ /usr/src/djabberd/

First install dependencies

apt-get install openssl libdbd-sqlite3-perl  libnet-ssleay-perl libnet-dns-perl libdigest-sha1-perl  libxml-sax-perl libxml-libxml-perl liblog-log4perl-perl subversion libdigest-hmac-perl libdanga-socket-perl libsys-syscall-perl

Now install DJabberd

cd /usr/src/djabberd/trunk/DJabberd/ perl Makefile.PL make all install

Now create the SSL certificates

mkdir /etc/djabberd cd /usr/src/djabberd/trunk/ openssl req -x509 -newkey rsa:1024 -keyout /etc/djabberd/server-key.pem -out /etc/djabberd/server-cert.pem -days 365 -nodes htdigest -c /etc/djabberd/djabberd.users djabberd [your-username-without-at-sign]

Create the server configuration file /etc/djabberd/server.conf

OldSSL  enable
# health checks from this IP (directive can be repeated) won't log and
# won't allocate a connection id
DeclareMonitor 127.0.0.1
AdminPort 5200
ClientPort 5222
ServerPort 5269
SSLCertificateFile    /etc/djabberd/server-cert.pem
SSLCertificateKeyFile /etc/djabberd/server-key.pem 

<VHost alliance.com>
  S2S enable
  RequireSSL yes
  <Plugin DJabberd::Authen::HTDigest>
    Realm djabberd
    HtDigest /etc/djabberd/djabberd.users
  </Plugin>
  <Plugin DJabberd::RosterStorage::SQLite>
    Database /etc/djabberd/djabberd.sqlite
  </Plugin>
  <Plugin DJabberd::Authen::MySQL>
    DBName               djabberd
    DBHost               127.0.0.1
    DBPort               6723
    DBUsername           dbusername
    DBPassword           dbpassword
    DBTable              user
    DBUsernameColumn     username
    DBPasswordColumn     password
    DBEncryptedPasswords 1
    DBWhere              canjabber = 1
  </Plugin> 

</VHost>

Start the server

/usr/local/bin/djabberd --conf=/etc/djabberd/server.conf --daemon

add to del.icio.us    add to technorati favs   email this