Archive

Archive for the ‘Sysadmin’ Category

Getting SNMPD to work on Ubuntu

June 22nd, 2010 No comments

Setting up snmpd on ubuntu seems easy, but i never got it full working. It was working locally, but not for a cacti setup from another server. The problem was that the default install of snmpd on Ubuntu starts the demon on the loopback interface only, refusing connections from other computers.

Edit /etc/default/snmpd to fix that:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# This file controls the activity of snmpd and snmptrapd
 
# MIB directories.  /usr/share/snmp/mibs is the default, but
# including it here avoids some strange problems.
export MIBDIRS=/usr/share/snmp/mibs
 
# snmpd control (yes means start daemon).
SNMPDRUN=yes
 
# snmpd options (use syslog, close stdin/out/err).
#SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid'
 
# snmptrapd control (yes means start daemon).  As of net-snmp version
# 5.0, master agentx support must be enabled in snmpd before snmptrapd
# can be run.  See snmpd.conf(5) for how to do this.
TRAPDRUN=no
 
# snmptrapd options (use syslog).
TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
 
# create symlink on Debian legacy location to official RFC path
SNMPDCOMPAT=yes

that’s it. To restart the snmp server enter $ sudo /etc/init.d/snmpd restart

Categories: Sysadmin Tags: , , ,

Enable your webserver to feed iPhone with MP4 videos

March 23rd, 2010 No comments

I’m using iPhone OS 3.x on my iPhone and recently i had problems to get my .mp4 files displayed in mobile Safari. I tried different settings for encoding the files but not a single one worked. When i clicked the link to the .mp4 file in mobile Safari, all i got was the “file can’t get downloaded” error. After some googling i found a clue that it might has something to do with MIME types and the apache server hosting the videos.

Solution:

  1. encode your videos for iPhone / iPod Touch (Compressor, Quicktime, Adobe Media Encoder, …)
  2. test them on the device (add the video to your iTunes library and upload it to your iPhone and watch it!)
  3. upload the video to your webserver
  4. make sure you have the following line in your apache config or in a .htaccess file in your directory on your webserver:
?View Code APACHE
1
AddType video/mp4 mp4 mp4v mpg4 m4v

That’s it, now progressively watching .mp4 videos from your webserver on your iPhone should work (again).

Using CentOS 5.4 as a Webserver

February 1st, 2010 No comments

The first troubles i ran into was SELinux. For the sake of securing your server, it’s a good idea to leave it enabled, but it’s a pain in the ass at the beginning. So start reading the SELinux Manual.

rpmforge package repository

A lot of useful tools can’t be found with the yum command, because these packages don’t reside in the default CentOS repositories. rpmforge is a third-party repository of thousands of rpm packages, but to use it, we need to install it first:

instructions on how to to that can be found here

After your Apache server is up and running, we want to add a statistic tool for your webserver’s log files:

awstats 6.x on CentOS 5.4

1
2
3
sudo yum install awstats
sudo yum install perl-Geo-IP
sudo yum install GeoIP-data
Categories: Sysadmin Tags:

Mac OS X 10.5: Setting a custom umask

July 21st, 2009 2 comments

umask is a UNIX command to set the default permissions for newly created files and folders. Especially when you have to share your files with other users on your computer or on a network share the default umask of 022 which Mac OS X uses is not very handy, it would be better if all users of a group could write files by default. For that a umask of 002 is needed.

Apple has a knowledge base article addressing this issue. It’s quiet easy, all you have to do is to create two files in /etc in your terminal. You need to have administrator level on your system to do that:

/etc/launchd-user.conf

1
umask 002

/etc/launchd.conf

1
umask 002
Categories: Mac OS X, Sysadmin Tags: ,

Re-Flash LaFonera with original Firmware

January 3rd, 2009 No comments

After playing around with my LaFonera and ddWRT i decided to go back to the original LaFonera firmware. I liked ddWRT for it’s feature-richness, but as my requirements changed i don’t need the router to sit inside the LaFonera and thought it would be good to re-join the fon community ;-)

I found most of the commands to achieve this on Stefano Testi’s Blog in this article. I ran into some problems because i tried this on Mac OS X, so i added some steps to this procedure to succeed.

Read more…

Categories: Sysadmin Tags: , , , ,

Icecast2 listener statistics script for Cacti

July 25th, 2008 No comments

I found a script for cacti to monitor the number of current listeners of an icecast2 server. The script was ok, but had a problem that sources where counted as listeners and it only showed the total number of listeners.

I did some work on the script and it now has:

- show all listeners when entering “all” into the filter field
- filter for mountpoints or parts of the mountpoint name
- the script now sums the listeners of each mountpoint in the filter – positive sideeffect: if you filter for “all”, all mountpoints get summed resulting in the correct number of listeners for all your mountpoints :-)

download: cacti_icecast2_v2.zip

Categories: Sysadmin Tags: ,

Installing Flash Media Server 3 on Ubuntu Server

April 14th, 2008 No comments

In the past i had to install Flash Media Server 2 on Ubuntu and Markus Bertheau’s Blog came to help with publishing a patch to make this work.

Time went by and now i had to install Flash Media Server 3 on my Ubuntu box. Again Markus has a patch for the fms3 installer script available, Markus’s article can be found at http://www.bluetwanger.de/blog/2008/02/11/flash-media-server-3-on-ubuntu-710-gutsy/:

first make sure you have libnspr4-dev installed, if not:

1
sudo apt-get install libnspr4-dev

download and unzip the Flash Media Server 3 app from adobe and upload FlashMediaServer3.tar.gz to your Ubuntu server, then:

1
2
3
4
5
tar xfz FlashMediaServer3.tar.gz
cd FMS_3_0_0_r1157
wget http://www.bluetwanger.de/~mbertheau/flash-media-server-3-ubuntu.patch
patch -p1 < flash-media-server-3-ubuntu.patch
sudo ./installFMS

thanks again Markus for providing these patches!

Categories: Sysadmin, Webdev Tags: , ,

Compile Python 2.4.4 on Mac OS X 10.5 (Leopard)

October 29th, 2007 1 comment

Recently i upgraded my OS to Leopard and had to recompile python 2.4.4 for my Zope 3 buildout setup (i need a clean python for that). The problem was, that python 2.4.4 won’t build on leopard, Jodok Batlogg from Lovely Systems had the same problem and instantly found the solution. As he hasn’t posted it to his blog, i will post it here:

1
./configure

add this line to pyconfig.h in the same directory:

1
#define SETPGRP_HAVE_ARG 1
1
2
./make
./make install

that’s it!

Technorati Tags: , ,

Ubuntu: networking tip

February 26th, 2007 No comments

I upgraded one server to new hardware by changing the complete HP machine, but using my harddrive from the “old” server. As these two machines are almost identically, except for the processor (dual core now) this should have worked like a charm – and it did! (almost)

I rebooted on the new hardware, all services and serves came up, no problems so far. But when i tried to ping some other machine, this didn’t work :-(

I checked /var/log/messages and the onboard Broadcom Interface showed up as eth1, but i was not able to start it. When i ran $ sudo /etc/init.d/networking restart i got some error messages like:

SIOCSIFADDR: No such device eth1
eth1: ERROR while getting interface flags: No such device

No clue what went wrong, i googled a lot and finally i stumbled upon this forum entry: http://ubuntuforums.org/showthread.php?t=221768

Then i ran: $ ifconfig -a
and got a list with my network interfaces and more importantly with it’s MAC address.

Then i edited /etc/iftab and changed the MAC address of the old hardware to the new onboard interface’s MAC address.

restart the networking with $ sudo /etc/init.d/networking restart

YESS, it works!

Categories: Sysadmin Tags: , , ,

Ubuntu Server insecurity?

February 19th, 2007 No comments

i just found out that my Ubuntu Server 6.10 has login shells for almost all users set in the /etc/passwd file!

That’s a very bad idea because this maybe enabled someone to install “Data Cha0s Back Backdoor” on my machine :-(

I checked this with 2 other fresh Ubuntu Server 6.10 installations and both had the login shells for users like daemon, mail, www-data and so on. Especially www-data should not have a chance to create a shell in my opinion!

So i changed /bin/sh to /usr/sbin/nologin and hope this makes it a bit more secure.

Categories: Sysadmin Tags: , , ,