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
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:
- encode your videos for iPhone / iPod Touch (Compressor, Quicktime, Adobe Media Encoder, …)
- test them on the device (add the video to your iTunes library and upload it to your iPhone and watch it!)
- upload the video to your webserver
- make sure you have the following line in your apache config or in a .htaccess file in your directory on your webserver:
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).
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
/etc/launchd.conf
I use a public plain apache server with mod_rewrite to serve my wordpress as i don’t trust php enough to expose it to the world
I wrote and updated a previous post describing what i’ve done to make things work for me, but now with WordPress 2.8 it’s broken, so i had to figure out a fix for this problem again. This is how i’ve done it:
on my public webserver i use this line in the virtual host config:
1
| RewriteRule ^(.*)$ http://sotf.labnet.uclv.net/wordpress$1 [L,P] |
The magic is done in my wp-config.php file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| /* That's all, stop editing! Happy blogging. */
// hack for using wordpress behind another apache / mod_rewrite
// config hack:
// set subdir of this worpress installation absolute to this webserver (normally /wordpress)
$local_subdir = '/wordpress';
// set subdir on remote server (normally /)
$remote_subdir = '/';
//print_r($_SERVER);
if ( isset( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ) {
$old_host = $_SERVER['HTTP_HOST'];
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
$_SERVER['SCRIPT_URI'] = str_replace($old_host, $_SERVER['HTTP_X_FORWARDED_HOST'], $_SERVER['SCRIPT_URI']);
}
$_SERVER['REQUEST_URI'] = str_replace($local_subdir.'/', $remote_subdir, $_SERVER['REQUEST_URI']);
$_SERVER['SCRIPT_URL'] = str_replace($local_subdir.'/', $remote_subdir, $_SERVER['SCRIPT_URL']);
$_SERVER['SCRIPT_URI'] = str_replace($local_subdir.'/', $remote_subdir, $_SERVER['SCRIPT_URI']);
$_SERVER['SCRIPT_NAME'] = str_replace($local_subdir.'/', $remote_subdir, $_SERVER['SCRIPT_NAME']);
$_SERVER['PHP_SELF'] = str_replace($local_subdir.'/', $remote_subdir, $_SERVER['PHP_SELF']);
// end of hack
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
require_once(ABSPATH . 'wp-settings.php'); |
IMPORTANT: the hacking of the $_SERVER variables has to be done before requiring wp-settings.php!
Update
I had some trouble that rewriting pretty permalinks didn’t work at first. The problem was that I had to enable the use of .htaccess for my wordpress directory in the apache config of my local server:
1
2
3
| <Directory /data01/www/wolfgang.reutz.at />
AllowOverride FileInfo
</Directory> |
And i had to enter the public webaddress into both of the blog url fields in the general settings of the wordpress admin interface. After that i had to manually tweak my .htaccess file in my wordpress installation:
1
2
3
4
5
6
7
| # BEGIN WordPress
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
# END WordPress |
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…
I had the need to move my blog running wordpress 2.0.x to a different server, but keeping the domain name on the “old” server. I used mod_rewrite and with a lot of trial and error and some updates i finally got this working solution:
Read more…
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
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!
today i noticed after a reboot (i do that very rarely), that my iStats Menu CPU monitor shows me heavy CPU load. I fired up Activity Monitor and found that syslogd is using 90% – 100% cpu power – bad syslogd!
I did some research on the net and found quiete some hints relating Time Machine to that behavior. It was suggested to stop Time Machine in the system preferences and quit syslogd within Activity Monitor. I did that and this seemed to work, but after starting e.g. Console syslogd was at 100% again. Therefore Time Machine was not causing this (at least for me).
Further investigation led me to a file named /var/log/asl.db which is the database file for Apple’s new “Apple System Log facility” and i found that mine had about 23 MB! A big asl.db file could cause syslogd to max out, according to some websites i browsed to (can’t remember which ones).
And this is my fix for now (in Terminal):
1
2
| cd /var/log
sudo rm asl.db |
I don’t like this very much, but it worked, because right after deleting this file, it was recreated, but with far smaller size. I guess i lost some logging infos, but for now i think i’m fine with it.
I had again some troubles with my XSan. I have 1 MDC (client/controller) and 2 clients and 2 Volumes on the XRaid. All clients and all volumes automounted as expected, except one volume on one of the clients
I saw the client in the list for that particular volume in the XSan Admin application, but when i hit “mount read and write” the status of that client shows “mounting” for a short time and then “unmounted”. No luck until today.
The problem is easy to solve, but anyoing to find:
I started Terminal and browsed to the /Volumes directory. There was the folder for the troublesome XSan volume and at the second sight i found out, that the folder is not empty! That caused XSan admin to mount without any luck. The cause for the folder not being empty was a folder called “Qmaster_Cluster_Storage”. And now i knew what went wrong
I have a QMaster cluster set up on this server as well and have the cluster storage set to a directory on one of the XSan volumes. Maybe sometime the server restarted without the XSan volume mounted and QMaster created the (now) missing cluster storage folder. After deleting the /Volumes/<name of my Xsan volume> folder i could successfully mount the volume for this client in XSan Admin.
Easy to solve, but a pain in the ass