Pobice’s Computer Stuff

July 11, 2007

inputlirc

Just found a package for a bit of software in ubuntu called inputlirc.

Ubuntu lists it as:

Zeroconf LIRC daemon using input event devices
This is a small LIRC-compatible daemon that reads from /dev/input/eventX
devices and sends the received keycodes to connecting LIRC clients. Inputlircd
needs no configuration, it uses the standardised names for the keycodes as
used by the kernel. Many USB remote controls that present HID devices, as well
as multimedia keyboards should work out of the box.

Why is this good, well I just install this package and well I get full remote support - once I’ve configured the applications, which is still a pain in the arse. Now if the applications could be written to work with the zeroconfig lirc with well zero config the world will be great (well ok less un-great).

Filed under: Software, Thumbs Up, Ubuntu, Linux, Debian — Pobice @ 7:37 pm

May 21, 2007

Yet Another Cacti Update

Well I’ve now got cacti pretty much sorted. Its finally running on a server with enough disk i/o to cope (it still > 3 years old, but at least it works). Its also now become important enough to be moved onto a server with support as some point. Once we’ve vitalised our File Servers, and maybe the odd DC and Citrix server.

Its now running on Debian for the next Cacti box (assuming it doesn’t have the gd bug).

What has helped with the new Cacti box is a combination of a few things - the new 1 min poller patch spreads I/O out better, and allows me to poll device which don’t do 64bit SNMP counters yet have gigabit ethernet ports every min, and leave everything else at 5 min. Improvements on plugins and a switch to cactid (a c version of the poller) has also really helped. The system now process ~400 hots in 35 seconds, dealing with ~4100 data sources and ~2200 rrd each min. Not bad.

There are a couple things that need improving however:
1) The threshold system now inspects data straight from the db before writing to the rrd files, which unfortunately causes the graphs in the email to be 1 cycle out of date (ie not show the data the emails about).
2) The Uptime+Threshold system host down email only works by patching files yourself at present when using cactid

As for ubuntu - either stop shipping cactid, or compile it again the correct version of the libraries. I’d much rather the package not be there than for it to not work, it gives people a bad impression.

Filed under: Software, Thumbs Up, Ubuntu, Linux — Pobice @ 7:23 pm

HOWTO: NUT & CPU Throttling/Frequency Scaling

After a couple of power cuts lasting long enough for my UPS to shutdown my PC, I’ve been meaning to get NUTs to set my CPU to lowest speed possible when running on battery power, this week I finally got round to it. Please note these instructions are based on Debian 4.0 (Etch) and may require extra steps to work on different distro’s.

(more…)

Filed under: Hardware, Linux, Debian, Howtos — Pobice @ 7:03 pm

May 9, 2007

WordPress: Stopping the Sidebar from Printing

If there’s one thing that really winds me up on the net is that when printing web-pages you end up with a load of crap you didn’t want usually. For example with blogs you usually get a page or two with the content on the blog sidebar, which frankly I don’t need on a print out.

Well I’ve done something about it (well at least on my blog) - I’ve changed my theme so that on browsers the do css and media types the sidebar shouldn’t print out. Here’s how you can add this to you’re WordPress blog

  1. Create a file print-style.css in the directory for you’re current theme with the following content
    .dontprint{ display: none; }
    div#menu{ display: none; }
  2. In wordpress, goto Presentation, Theme Editor and select the file Header
  3. Just bellow the line setting the css style sheet - should be something like this :
    <style type="text/css" media="screen">
    @import url( %lt;?php bloginfo('stylesheet_url'); ?> );
    <style>

    add the lines
    <style type="text/css" media="print">
    @import url(<?php bloginfo('template_directory'); ?>/style-print.css);
    </style>
  4. Hopefully this should be enough, but if the theme author hasn’t used the div’s in the sidebar file you may have to add this line <div id="menu"> to the top of the file and this line </div> to the bottom of the file
Filed under: Rants, WordPress, Howtos — Pobice @ 9:46 pm

December 9, 2006

PHP5 + Mostwanted

I’ve recently upgraded from PHP4 to PHP5 to allow me to test out a couple of web apps on the same machine that runs things blog. All in all it went well, had to specify timezone in a config file for some of the code I’ve done myself - and my TV recording system doesn’t do the full list of items to record (will fix at some point). It also borked the most wanted panel on this blog.

Anyway I have a fix for this now - simply call mostwanted using these two lines of php:
$mostwanted = new MostWanted;
$mostwanted->mostwanted(7, 30, true);

in replace of

MostWanted::mostwanted(7, 30, true);

Filed under: Software, bugs — Pobice @ 7:57 pm

December 2, 2006

WUFTP Rule for fail2ban

I’ve put to gather a rule for wuftp for fail2ban v0.6 (ie the version in backports for sarge - http://backports.org/). The regexp is straight from the version available in debian unstable. Seems to do the trick.

[WUFTPD]
# Option: enabled
# Notes.: enable monitoring for this section.
# Values: [true | false] Default: true
#
enabled = true

# Option: logfile
# Notes.: logfile to monitor.
# Values: FILE Default: /var/log/auth.log
#
logfile = /var/log/auth.log

# Option: port
# Notes.: specifies port to monitor
# Values: [ NUM | STRING ] Default:
#
port = ftp

# Option: timeregex
# Notes.: regex to match timestamp in SSH logfile. For TAI64N format,
# use timeregex = @[0-9a-f]{24}
# Values: [Mar 7 17:53:28]
# Default: \S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}
#
timeregex = \S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}

# Option: timepattern
# Notes.: format used in "timeregex" fields definition. Note that '%' must be
# escaped with '%' (see http://rgruet.free.fr/PQR2.3.html#timeModule).
# For TAI64N format, use timepattern = tai64n
# Values: TEXT Default: %%b %%d %%H:%%M:%%S
#
timepattern = %%b %%d %%H:%%M:%%S

# Option: failregex
# Notes.: regex to match the password failures messages in the logfile.
# Values: TEXT Default: (?:Authentication failure|Failed (?:keyboard-interactive/pam|password)) for(?: illegal user)? .* from (?:::f{4,6}:)?(?P\S*)
failregex = wu-ftpd\[\d+\]:\s+\(pam_unix\)\s+authentication failure.* rhost=(?P<host>\S*)

Filed under: Linux, Debian — Pobice @ 3:42 pm

November 20, 2006

GVIM/Ubuntu/Debian Syntax Highlighting

It appears in the Edgy Eft and Debian Etch that Syntax highlighting in gvim has been switched off by default.

To add it back add the following line to /etc/vim/gvimrc

" Also switch on highlighting the last used search pattern.
if has("syntax") && (&t_Co > 2 || has("gui_running"))
syntax on
set hlsearch
endif

Filed under: Ubuntu, Debian, Howtos — Pobice @ 7:35 pm

October 1, 2006

Ubuntu + Printing (lp etc)

It appears when when I created the first printer in ubuntu it didn’t set it as default and hence nothing that used the likes of lp would print.

Easy to fix - log on. Goto system > administration and set a default printer. Still you’d have though that when I only have one printer, and its the first printer I added it would be the default, by well default :)

Filed under: Software, Ubuntu — Pobice @ 6:55 pm

September 17, 2006

Cacti Update

Well that was easy. I’ve just moved two tables to the type Memory/Heap and cacti runs like it used to (in fact a hell of a lot better than it has been doing recently.)

The two tables moved are: snmp_counter64* and poller_output. Both these tables can afford to loose the data on restart - they hold data before it is moved into the rra and holds at most 5 mins worth of data (IE one cycle).

It also improves the situation if the server restarts as if data is left in the poller_output table it can push the the php poller over its memory limit and stop it working properly, so its a good idea to start with it empty.

Snmp_counter64 also needs emptying every now and again - as when you remove devices from cacti it does not get removed from here

The SQL code to achieve this is:

alter table cacti.snmp_counter64 engine=heap;
delete from cacti.poller_output;
ALTER TABLE cacti.poller_output MODIFY COLUMN output VARCHAR(255);
alter table cacti.poller_output engine=heap;

Warning
Some graphs may stop updating if the script used to generate data for the output more the 255 characters If you use MYSQL 5, then you can use something like VARCHAR(1024) instead.
This may cause data to be lost from the current run.

The server now copes pretty well. I haven’t tried anything new to it yet, but it generally appears to be working better then it has done for past couple of months. I would like to re do the disk structure, but for now this will do.

*This table is from a patch - most people won’t have this table.

Filed under: Software, Networking — Pobice @ 2:44 pm

September 12, 2006

Cacti

Well our age’ed Dell server has finally hit a limit with cacti.

Currently it has:
Hosts:354 Data-Sources:16943 RRDs Processed:8744

And has hit a limit with Disk i/o.

What I plan to do is: Move it onto a temp virtual server. Completely rebuild the old dell with two RAID 1 sets each on 2 disks - One for the RRA and one for the DB and see how it put up with that. The rebuild should help on the disk layout too - due to all the network changes and low disk space its likely the disk could have a few few frags.

If this doesn’t work and it still struggles, then I’ll use one of the various other spare dells (might have to be one without a raid card - so it’ll be software raid) and stick the database and possibly front end on it.

Once we have it stable again - I suppose I better look into a better way of coping with gigabit Ethernet cards in windows - currently we use the SnmpProxy2.pl hack - may just be a case of limiting it to Windows servers some how and not all 64bit Ethernet counters.

Filed under: General, Software, Networking — Pobice @ 8:17 pm
Next Page »

Powered by WordPress