pChart Looks Promising

Linux — Jeff Eske on July 21, 2011 at 4:24 pm

I’m needing to create some reports for use with our implementation of FrontRange’s ITSM product.  ITSM has reports available via Crystal Reports, but these aren’t dynamic.  To make things dynamic, I decided to create my reports directly out of the MS SQL database, using php.  The one issue was how to easily create charts from the data I pull back.  I’ve done some with GD in the past, but it wasn’t terribly easy and didn’t look that great.  After some investigation, it looks like pChart (http://www.pchart.net/) may be the ticket.  I’ve just started messing with it, so I don’t know how well it will work for sure, but it looks promising.

Overcoming Terminal Server “Terminal server has exceeded maximum number of allowed connection” problem

Linux — Jeff Eske on June 26, 2009 at 9:43 am

Since Windows server only gives you 2 remote connections, it’s easy to end up “locked out” of the server.  To overcome that, you can actually use a third remote connection that allows you to get in and kill the other offending connections.

On Linux type:

rdesktop -0

where is the ip address of the server that you want to connect to.  Obviously, you need to have rdesktop installed and it should be a fairly recent version.

Mounting an external USB drive from the command line

Linux — Jeff Eske on June 24, 2009 at 11:27 am

The easiest way to mount an external USB drive from the commandline is:

sudo mount -t ntfs-3g /dev/sdc1 /media/red -o umask=0000

This actually sets it up so that’s completely readable/writeable by anyone.

Manually Update Time Via ntpdate

Linux — Jeff Eske on June 24, 2009 at 11:22 am

To update the server time, type:

sudo ntpdate -b pool.ntp.org

Starting LDM Manually

Linux — Jeff Eske on May 28, 2009 at 10:49 am
Logon, su to ldm (sudo su - ldm) and run:

ldmadmin start

If the queue is corrupt, the LDM will freak.  In this case,
do the following:

ldmadmin stop
ldmadmin delqueue
ldmadmin mkqueue
ldmadmin start

It's good to run: ldmadmin watch after that, just to verify that stuff is coming in.

Solving Fetchmailconf problem in Linux Mint 7

Linux — Jeff Eske on May 27, 2009 at 2:57 pm

Binary package hint: fetchmailconf
I installed fetchmailconf via the Package Manager and when I tried to run it, it would error out. Googling the problem revealed the answer…

From: https://bugs.launchpad.net/ubuntu/+source/fetchmail/+bug/371072/+viewstatus

“I have installed fetchmailconf 6.3.9~rc2-4ubuntu1 on Ubuntu 9.04; /usr/bin/fetchmailconf — a shell script to start the real Python script — fails to start because it looks for the real fetchmailconf script in the wrong place.”

/usr/bin/fetchmailconf as installed reads:

#! /bin/sh
exec /usr/bin/python /usr/lib/`pyversions -d`/site-packages/fetchmailconf.py “$@”

Changing “site-packages” to “dist-packages” fixes the problem and allows fetchmailconf to start.

Gempak Cleanup Process

Linux,Programming — Jeff Eske on May 27, 2009 at 10:44 am

If Gempak programs hang, you can run a cleanup process that is supposed to remove them.

1> Make sure you source the Gemenviron/Gemenviron.profile file first.

2> Type in: $NAWIPS/bin/cleanup -c

It should give you a couple of status messages if it works. i.e.
Checking for and removing IPC message queues . . .
Checking for and removing IPC semaphores . . .

Decoding Individual Sounding Files with Gempak Decoders

Linux,Programming — Jeff Eske on May 14, 2009 at 2:43 pm

I realize this post is pretty rough, but it tells ME what I need.

download/obtain sounding data in wmo format.

Open file and add beginning and ending headers/footers.

save as “soundings.txt”.

First Run: cat soundings.txt | dcuair  -d – YYYYMMDD_upa.gem

This will throw DATTIM errors because the archive date/time will be different than expected.  It will show you what the datafile time is, so you can correct your commandline to match it.

Next Run:  cat soundings.txt | dcuair -c 20090529/0000 -d – YYYYMMDD_upa.gem

Adjust this date/time to each required combination, until all of the records have been decoded.

Decoding Individual GRIB file with Gempak Decoder

Linux,Programming — Jeff Eske on May 14, 2009 at 11:29 am

I know that this post is rather rough, but it tells ME what I need to know.

copy grib files to a directory.

change to that directory.

Run:  dcgrib2 -c YYMMDD/HHNN -d dcgrib2.log  < input file name

creates directory structure within present directory.

Removing zero byte files in Linux

Linux — Jeff Eske on December 1, 2008 at 5:08 pm

I’m working on a project at work that includes several programs writing A LOT of files to disk.  If the programs can’t write to disk, they basically end up creating a 0 byte file.  When you have several programs, writing several files, you can quickly end up with a lot of empty files.  Right now, I’m trying to balance things out and have actually ended up with the partition going to 100% full.  When that happens, I get a lot of 0 byte files. At first, I was going into each directory and deleting the 0 byte files by hand – not good.  I did a little searching, to see if there was an easier way.   Thankfully, there is!  This page includes exactly what I was looking for.  Essentially, you use find to find the files and pipe them through xargs to actually remove them via rm.   Basically, to try it out, open a linux terminal window and navigate to the folder that you want to check and type: find . -type f -size 0 | xargs ls -ld

If it looks like it found what you wanted it to, change the ls -ld to rm so that rather than just listing them, it will remove them.  So type: find . -type f -size 0 | xargs rm

One last thing.  For it to work correctly, you’ll probably need to be root.  I tried it with sudo and it didn’t work.

UPDATE: Here’s an additional resource that talks about using find and xargs – http://www.kalamazoolinux.org/tech/find.html

Jeff Eske

Next Page »
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. | Jeff's Meanderings*