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:
- Devices
- Keyboard Layout: US
- Keyboard Events: User Session Events
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: computer, howto, linux, oss, osx, software
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: computer, linux, oss, software
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:
- RGB565 and RGB555 patch by Adalbert Prokop
- fg_new_compatible_frame patch by echoline
- mmap fix by me
- swig generated Python interface by me
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: c, code, computer, linux, oss, python, software
20080328
eeepc, likes and dislikes
Likes:
- nice and small
- all the hardware works, including sleep/suspend
- runs debian based OS by default
- can run an external monitor at decent resolution
Dislikes:
- uses fastinit which only boots into single user mode, so user "user" is always logged in. Endless frustration playing with X11 startup in vain to get a multiuser login screen
- when kmixer shows a speaker with a cross on top, it means built in speakers will be used. When it is a speaker with no cross on top, it means headphone jack will be used. Talk about counter-intuitive.
- keyboard truly sucks
Cheers,
Steve
Labels: computer, linux, oss, rant, software
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
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:
We now need to define a fourier series, f(x). It takes the generic form of:
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:
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: astronomy, code, computer, oss, science, software
20040714
Downloads
- html2pml
Converts simple html to pml
Features
- Works where python is available
- Works pretty well :-)
- Preserves bold and italic
- Small
- Works :D
- Portable to almost everything under the Sun
- Outputs in a format that can be easily pasted into mathpad or matlab for plotting
- Small
- Fast
- Portable to almost everything under the Sun
- Command line based
- Easily scriptable
- Works!
- Command line based
- Flexible format string
- up to 8 numerical replacements
- DNS lookup to reduce false positives
- Makes you hate me
- Opengl accelerated
- In game console
- GlUT library for portability
- Sorts files into directories based on specified fields of ID3v1/2 tag
- Sorts incrementally by artist/song/genre/album/etc, in any order
- File renamer to rename songs based on ID3v1 tag information
- File renamer supports format strings to create your own combination
- ID3Tag removal utility to remove ID3Tags
- Can be applied to entire directories
- ID3Tag Editor with single and multiple file support
- Can add id3v1 tags to files that doesn't have them
- Very cool busy animation :)
- Extensive online documentation included
- Opengl accelerated
- Scripting support
- Motion blurr
- Induces motion sickness in some ;)
- Command line based
- Detects unique, parametric solutions, as well as no solutions
- Prints unique and parametric solutions
- Works! :)
- Will print out working
- Small
- Command line based
- (Auto)scaling