Monitor the UPS in Ubuntu with Network UPS Tools

I just found this great project called Network UPS Tools or nut. It comes with fully loaded with tools for monitoring local UPS, remote UPS and displaying the status via a weg page.

My installation is using an Must PowerAgent 1060, connected via USB.

Installing the software is easy, just use the magic words:

sudo apt-get install nut nut-cgi

To configure nut on Ubuntu I start by reading this guide by a mysterious person named Shady Pixel.

First I checked my driver suitable for my model in the Hardware Compatibility List. The model I use is not in the list, but Must is related to Mustek and all Mustek models were using ‘blazer_usb’ driver. So I went for blazer_usb.

I added the following section in /etc/nut/ups.conf (you can replace must-pa-1060 with your preferred name for the UPS):

# /etc/nut/ups.conf
[must-pa-1060]
driver = blazer_usb
port = auto

I looked for the Bus and Device number together with Vendor and Product in ‘lsusb’

I changed the permission to ‘666′ for /dev/bus/usb/BID/DID (replace BID with your USB bus ID, and DID with device ID). To automatically set the permission for future connections I added the following udev rule:

#/etc/udev/rules.d/10-must-pa-1060.rules
SYSFS{idVendor}==”0665″, SYSFS{idProduct}==”5161″, MODE=”0666″

Then I started the UPS driver via:

$ sudo upsdrvctl start

If you get some errors like the one below, check the USB device permissions.

Can’t claim USB device [0665:5161]: could not detach kernel driver from interface 0: Operation not permitted
Driver failed to start (exit status=1)

Now that the UPS driver is started, let’s monitor it and export the status via the CGI script.

You will have to configure the mode in which nut will run. Edit /etc/nut/nut.conf and add your preferred mode.

# /etc/nut/nut.conf
MODE=standalone

Add an UPS daemon user via /etc/nut/upsd.users:

# /etc/nut/upsd.users
[ups_admin]
password = a password here
upsmon master

Configure the monitor to connect to this daemon via /etc/nut/upsmon.conf:

# /etc/nut/upsmon.conf
MONITOR must-pa-1060@localhost 1 ups_admin the_password_here master

Now you can start the nut daemon and ups monitor via ‘nut’ service:

sudo service nut start

To monitor the UPS via the web CGI script I added the following line to /etc/nut/hosts.conf:

# /etc/nut/hosts.conf
MONITOR must-pa-1060@localhost “Must PowerAgent 1060″

Now you can access the CGI script via:

http://HOSTNAME/cgi-bin/nut/upsstats.cgi

Enjoy!

This should be a good start, and from here you can take it to the next level… For example, if you have 2 computers connected to the same UPS, the second one will have to monitor the UPS daemon from the one connected via the usb to the UPS… make sure that the switch is allow connected to the UPS :)

Mikka, with Batteries By karmablue

Mikka, with Batteries By karmablue

FlossCamp 2011 se apropie

Am stabilit ultimele detalii legate de amplasare locurui de campare pentru FlossCamp 2011 și rămâne să ne vedem în weekendul 5-6-7 August, în apropiere de Șimon/Bran.

Pentru mai mutle informații despre FlossCamp consultați pagina evenimetului la adresa camp.softwareliber.ro

Vama Veche în extrasezon

M-am mutat cu birou din dormitor în Vama Veche și voi sta pe aici încă cel puțin 3 săptămâni. Fiind extrasezon, Vama Veche e cu totul altfel, e liniște, nu e lume, afară nu e chiar așa de cald. E chiar foarte fain.

Cam asta e vederea de pe lângă monitor:
img018

img016

Unity-2D on Ubuntu 10.10

I have tried and tested Ubuntu 11.04 during its development cycle and also after the final release and I really liked Unity 2D. It was the first shell that I did not felt the need for major customization. The fact that external monitor support is again broken, middle click emulation is no longer a default and that I can not adjust the brightness of my laptop screen, blocks me from using Ubuntu 11.04. I know that Ubuntu 11.04 and Ubuntu 11.10 are the future, but I just want to use my computer now :)

So being stuck with Ubuntu 10.10 I started using the Unity 2D team PPA repository. It worked quite well, until the team decided to stop supporting Unity 2D on Maverick. With valuable help from Unity 2D team I was able to build the latest Unity 2D on Maverick.

The result is available in the following PPA: ppa:adiroiban/unity-2d-maverick .

The code is available at lp:~adiroiban/unity-2d/unity-2d-maverick

The global menu is not working it the current Maverick build. Thanks to Olivier I found the problem and I will update the PPA soon.

Please note that the Unity 2D on Maverick is not supported by the Unity 2D team.
In the same time, I am a junior Ubuntu packager so the package might have some bugs.

PS: To bad that for now, the version of Unity that works on everyone’s computers is a second class citizen in Ubuntu.
PPS: I have the default video card that comes with the core i3 CPU… nothing fancy, but it looks like I can not escape the curse of the external monitor… but is working Maverick.

Oliver with Arms Extended by Mr. T in DC

Oliver with Arms Extended by Mr. T in DC

GMail Offline in Ubuntu 10.04, 10.10, 11.04

Since offline storage for web browsers is still not standard across major web browser it looks like the only way to use GMail offline on latest Ubuntu version (10.04, 10.10 and 11.04) is to install Google Gears extension for Firefox and install Firefox 3.6.

Here is a short how-to:
* Download Firefox 3.6
* Extract the Firefox archive in ~/.local/firefox
* On Lucid install the xul-ext-gears package from the official repository
* On Maverick and Natty download and install the Google Gears Extension for Firefox from the Lucid official repository (this is the Lucid package but will also work on Natty)
* Start Firefox from ~/.local/firefox/firefox and you should see the Google Gears extension.
* Done

Red Panda | Firefox by Adam Foster | Codefor

Red Panda | Firefox by Adam Foster | Codefor

FLOSSCamp 2011 - Rezultate feedback

În primul rând doresc să mulțumesc tuturor celor care au părticipat la sondajul inițial pentru pregătirea FLOSSCamp 2011.

Se pare că gusturile sunt impărțite destul de bine și nu există un consent.

FLOSSCamp se dorește un eveniment în natură, mai departe de electricitate și civilizație de aceea foarte probabil locul ales va favoriza cei care preferă cortul.

În același timp este de notat că numărul celor care preferă pensiunea este semnificativ și vom luam în considerare și organizarea unui eveniment mai formal, cu cazare și tot tacâmul.

Vom reveni cu decizile în ceea ce privește data și eventual locul.
Până atunci mai jos sunt câteva grafice cu rezultatele sondajului:

Unde ne ducem traiul

Unde ne ducem traiul

Cand am vrea să se întâmple toată treaba asta?

Cand am vrea să se întâmple toată treaba asta?

Cort sau Pensiune/Motel?

Cort sau Pensiune/Motel?

Mingle with GTKSourceView

In the last years, Gedit was my trustful companion. It does not has all the bling-bling of Anjuta or Eclipse but with some extra modules, Gedit can be a reputable text editor.

For me, the most important feature of a text(code) editor is syntax highlighting and Gedit together with GTKSourceView offers a nice syntax highlighter.
Now, if you want to edit GTKSourceView language and scheme file from within Gedit … well… this is a bit complicated .

So I took an PyGTK GTKSourceView example kindly provided by Iñigo Serna and hosted by Python Code Snippets and continue building a text editor that will apply the new style as soon as the scheme and language file is saved.

After a few hours I ended up with … TADA…

gtksourceview-mingler

Now this beauty which for now I will call it GTKSourceView Mingled, will not win any UI design context but I hope that I will help you to improve your productivity.

In case you are asking how to use it, here are a few tips:

0. Grab the code from my +junk bzr branch dedicated to this issue.
1. Make sure your language and scheme files are in your home folder
The default files are located somewhere in /usr/share/gtksourceview-2.0
and you should not have write access there… for your own good.
Copy the files that you intend to modify to:
* ~/.local/share/gtksourceview-2.0/styles
* ~/.local/share/gtksourceview-2.0/language-specs

2. Start the script
3. Open a sample file for the language that you want to edit (Ctrl+O)
4. Choose a style from the Styles menu.
5. Edit the language and scheme file
6. Save (Ctrl+S)
7. Observe the changes
8. If you are not happy with the result go back to step 4, otherwise just
go to next step.
9. Admire your beatiful result
10. Profit!

There are also some command line options… start with the –help option.

What it does
————

* When you start the application it looks at the default style (or the one
speficied in the command line) and applies it to the bottom panel.

* When you choose a style from the menu, it search the style file, loads
the style file into the top right panel and applies the style to the
bottom panel.

* When you load a file, it looks for the file mime-type and loads the
langauge file associated with the file type.

* When you save something, it stores the changes on disk and then applies
the changes on the bottom panel.

What other things I would like it to do
—————————————-

* Press Ctrl+F and prompt you with a nice incremental search box. That would be really awesome!

And by the way, this post really deserves a cat picture:

Oliver Highlighting by Mr. T in DC

Oliver Highlighting by Mr. T in DC

Categories

Archives