20080920

A relatively pain free Linux/OS X VNC setup

Ever since I got my 2nd monitor, I been using VNC to work on my laptop. Leopard's inbuilt VNC server isn't really VNC compliant, and has many issues when used with a normal VNC client. I have found Vine server to be an excellent replacement. The client side is a little interesting. RealVNC didn't work too well for me, in that often the screen would stop responding, or it would not receive key events. The best setup I have found is to use tightvnc with the following Vine server settings:

The client and server will happily share the clipboard if you enable it. Settings are accessed via F8 in the client, and via Preferences in the server. The client is smart enough to synchronise clipboards only when it loses focus - which would be you switching away to say, paste a url into firefox. All in all it is a fairly painless experience.

Cheers,
Steve

Labels: , , , , ,


20080724

grub, xfs, debian

Running grub-install with a XFS partition will likely fail - there is a reason lilo is used when XFS is root! The issue is grub-install creates the stage files in /boot/grub, which grub then expects to find when it accesses the disk directly using its own file system drivers. For most file systems sync is sufficient to force this to be true, but not with XFS - unless grubs's XFS drivers replays the journal, grub won't find the files. The detailed why of this is covered in this thread. To get around this, one needs to effectively replace sync with mount -r -o remount /; mount -w -o remount /. A quick a nasty way to get grub going with XFS partition is as follows:

  • init 1 # need single user mode to be able to remount root
  • cp /usr/sbin/grub-install /tmp # make a copy of grub-install to butcher
  • vim /tmp/grub-install
  • # now butcher grub-install as follows:
  • # 1. find the line that says "Sync to prevent GRUB from not finding stage files
  • # 2. deleted everything after sync
  • # 3. add exit 0 after sync for good measures
  • /tmp/grub-install # invoke our amputated grub-install to just produce the stage files
  • mount -r -o remount / # flush everything by mount as read only
  • mount -w -o remount / # remount since grub needs it to be rw
  • grub # invoke the grub shell
  • root (hdx,y) # manually specify the disk x partition y where /boot/grub/* is located
  • setup (hdx) # install grub into the disk x's MBR. DO NOT specify a partition number, XFS's sector 0 is NOT reserved for boot loaders!!
  • quit # exit grub
  • reboot # should work now

Cheers,
Steve

Labels: , , ,


20080716

unoffical libfg repository

I have set up an unofficial git respository for libfg patches and new swig generated python interface, as Gavin Baker (the author) appears to be busy with other things. This is a maintance only repository as far as libfg goes - I don't plan on adding any more features (since all the ones I need are there already). I will however work to produce a more pythonic interface to libfg, as the swig generated interface is a straight port of C api into Python.

Currently the repository contains the following fixes and enhancements:

If you have a patch against libfg, please post it at the libfg project's page first, and then to me if Gavin does not respond. I do not intend to take over development of libfg, and it is my hope Gavin will in the future make this obselete/redundant.

Cheers,
Steve

Labels: , , , , , ,


20080328

eeepc, likes and dislikes

Likes:

Dislikes:

Cheers,
Steve

Labels: , , , ,


20080107

Finally, PIC under Linux made Easy

I have been looking for software to work with my PIC-PG2 programmer under Linux for a while now. Previously I have been using windows and PICPROG which while nice, still involved messing with windows and stuff. The situation back then (around 2006) was bleak - there were no up to-date and actively maintained Linux software for PIC developers. Now there is.

PikLab is a fantastic piece of work which does for Linux what MPLAB does for Windows. Big thanks to Nicolas Hadacek and Alain Gibaud and all contributors for producing a much needed piece of software.


Cheers,
Steve

Labels: , ,


20060318

Fourier fitting with gnuplot

gnuplot can be used to fit a fourier series to a series of data points. In my case it was an observation log for the star BE Lyncis from the Bossom Observatory, curtsey of Geir Klingenberg.

Firstly one needs to define a time function t(x) such that as x progresses from its minimum value to its maximum value t(x) ranges from 0 to 2PI. In my case minimum value of x was 2453416.20172 and maximum value was 2453416.42447. So my t(x) was constructed as follows:

t(x)=(x-2453416.20172)/0.22275*2*pi

We now need to define a fourier series, f(x). It takes the generic form of:

f(t)=c+a0*cos(t)+a1*sin(t)+a2*cos(2*t)+a3*sin(2*t)+ ...+{a#*cos((#+1)*t)+a(#+1)*sin((#+1)*t)}

Where #=0,1,2,3... infinity, and is the degree of the fourier series. Now we can use gnuplot's fit function to determine the values of all co-efficients and the constant c:

fit f(t(x)) 'be_lyn-2005.txt' using 1:2 via c,a0,a1,a2,...,a#,a(#+1)

A quick explanation: we are trying to fit f(t) where t=t(x) using data from the file be_lyn-2005.txt with data from the first and second column. The order of 1:2 is significant as it is in the form of x:y. Thus 2:1 means the first column is y value, second column is x value. (This is from experience, if any one knows better, tell me!)

Co-efficient values and the constant will be computed and shown, along with various statistic data. An plot of the fourier series and the observed data is shown below.

The plain text file be_lyn-2005.txt has 3 columns: JD, instrumental magnitude, and error estimate, the later of which was not used.

Cheers,
Steve

Labels: , , , , ,


20040714

Downloads

Here is a summary of some stuff I wrote for one reason or another. Source is provided where I am not overly embrassed by the code :) Please submit bug reports etc by commenting on this entry :)

Labels: , ,


This page is powered by Blogger. Isn't yours?