Setting Up Blog Again

June 14th, 2009

Any one who has been reading the Live Journal site will now I haven’t been well.  Because of that I couldn’t be bothered the fix blog.pobice.co.uk when it failed due to a Debian upgrade.

Well things have change, I’m slowly getting around to setting up my wordpress blog again, but on a better address.  I intend for this to be my home page as some point in the future too, as the old site isn’t really relevant to me today and is rather, well dead.

This means stuff doesn’t really work yet.  It’ll get fixed at some point soon I promise.

Update

Stuffs mostly fixed.  Thats enough work for now

inputlirc

July 11th, 2007

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).

Yet Another Cacti Update

May 21st, 2007

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.

HOWTO: NUT & CPU Throttling/Frequency Scaling

May 21st, 2007

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.

Read the rest of this entry »

WordPress: Stopping the Sidebar from Printing

May 9th, 2007

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 that supports 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
    &lt;style type="text/css" media="print">
    @import url(&lt;?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

PHP5 + Mostwanted

December 9th, 2006

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);

WUFTP Rule for fail2ban

December 2nd, 2006

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*)

GVIM/Ubuntu/Debian Syntax Highlighting

November 20th, 2006

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

Ubuntu + Printing (lp etc)

October 1st, 2006

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 :)

Cacti Update

September 17th, 2006

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.