Installing GnuCash Without GNOME


Or at least without all of GNOME. I’m a big fan of GnuCash, but prefer Xfce to GNOME. As GnuCash has a lot of GNOME dependencies, this makes the build process somewhat trickier. Here’s what worked for me.

  • need XML::Parser
    cpan> install XML::Parser

  • need ltdl.h (from libtool-devel?)
    sudo apt-get install gnome-common (didn’t supply ltdl.h)
    sudo apt-get install gnucash (didn’t supply ltdl.h)
    sudo apt-get install libltdl3-dev (supplied ltdl.h)!

  • need g-wrap
    sudo apt-get install g-wrap

  • need gconf-2.0 >= “2.0″ (gconf-2.0.pc)
    sudo apt-get install libgconf2-dev

  • need libxml-2.0 >= 2.5.10
    sudo apt-get install libxml2-dev

  • need libgnomeui-2.0 >= 2.4
    sudo apt-get install libgnomeui-dev

  • need libgnomeprint-2.2 libgnomeprintui-2.2
    sudo apt-get install libgnomeprintui2.2-dev

  • need libgtkhtml-3.8
    sudo apt-get install libgtkhtml3.8-dev

  • after all that, GnuCash dies on startup with:
    : In procedure scm-error in expression (scm-error (quote misc-error) #f ...):
    : no code for module (g-wrap gw standard)

    The answer:
    sudo apt-get install guile-g-wrap


Linux Video


This is about just getting my video card to work at all; info on actually playing DVDs is here.

Laptop

Don’t get me wrong, I really do prefer Linux to that Other operating system…

X recognizes my 600m laptop’s video card as:
Chipset: ATI Radeon Mobility 9000 (M9) Lf (AGP) (ChipID = 0x4c66)
Device: ATI Technologies, Inc. Radeon R250 Lf [Radeon Mobility 9000 M9]

The last ATI driver to support the Mobility 9000 was 8.28.8 (for comparison: 8.29.6). The Dapper Installation Guide cover installation of this version, along with how to fix some of it’s brokenness. Following the directions for Method 1 won’t work, however, because sudo apt-get install xorg-driver-fglrx will now install a later version which does not support the Mobility 9000. In Method 2 you have to change all the version numbers back to the old version.

The easyubuntu ATI driver does not work.
Because it’s an ATI graphics chipset, 915resolution won’t work.

From http://wiki.cchtml.com/index.php/Ubuntu_Dapper_Installation_Guide:

Make sure the restricted repository is enabled in /etc/apt/sources.list or this guide will not work!

Help on enabling repositories can be found at https://help.ubuntu.com/community/Repositories/Ubuntu.

sudo apt-get update
# Okay if this next one is already installed
sudo apt-get install linux-restricted-modules-$(uname -r)
sudo apt-get install xorg-driver-fglrx
sudo depmod -a
sudo aticonfig --initial
sudo aticonfig --overlay-type=Xv

An alternative to the aticonfig --initial command is to edit /etc/X11/xorg.conf and replace the string “ati” with “fglrx” in the “Device” section. This way you won’t lose your old “Screen” and “Monitor” settings. Afterwards you can use aticonfig for setting overlay, etc.

Now Reboot your system:
sudo shutdown -r now

Confirm that it works:
fglrxinfo
display: :0.0 screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: RADEON 9600 Generic
OpenGL version string: 2.0.5814 (8.25.18)

Unfortunately OpenGL seems to be broken for R200 cards (everything below Radeon 9500) in this driver version which results in messages like
[fglrx] API ERROR: could not register entrypoint for Uniform2iARB
and similar when running OpenGL applications. This may be fixed by replacing /usr/lib/libGL.so.1.2 with libGL.so.1.2 from the previous driver version (8.24.8). To do so download this file: libGL.so.1.2 and then copy it to the /usr/lib/ directory.

It might be necessary to create a symlink to get accelerated OpenGL:
sudo ln -s /usr/lib/dri /usr/lib/xorg/modules/dri

It ends up looking something like this (note the xorg.conf backup locations–I had to use these to revert a bad change once):

steve@ghost:~$ sudo apt-get install linux-restricted-modules-$(uname -r)
Reading package lists... Done
Building dependency tree... Done
linux-restricted-modules-2.6.15-23-386 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
steve@ghost:~$ sudo apt-get install xorg-driver-fglrx
Reading package lists... Done
Building dependency tree... Done
xorg-driver-fglrx is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
steve@ghost:~$ sudo depmod -a
steve@ghost:~$ sudo aticonfig --initial
Uninitialised file found, configuring.
Using /etc/X11/xorg.conf
Saved back-up to /etc/X11/xorg.conf.original-0
steve@ghost:~$ sudo aticonfig --overlay-type=Xv
Warning: Option 'VideoOverlay' doesn't affect running session.
Warning: Option 'OpenGLOverlay' doesn't affect running session.
Using /etc/X11/xorg.conf
Saved back-up to /etc/X11/xorg.conf.fglrx-0
steve@ghost:~$

or (I think this is what I did last time I went through this):
# per http://wiki.cchtml.com/index.php/Ubuntu_Installation_Guide
sudo apt-get install xorg-driver-fglrx
# Okay if this next one is already installed
sudo apt-get install linux-restricted-modules-$(uname -r)
# Select the fglrx driver (64-bit users also deselect int10a) on this next one
sudo dpkg-reconfigure xserver-xorg


Desktop

I run a dual-monitor setup on my desktop, which has an Nvidia GeForce 8600 GT card. First install the driver like so: sudo apt-get install nvidia-glx-new (which probably installs a more specific package like nvidia-glx-180 or nvidia-glx-185). Then run nvidia-settings. I set my configuration to run TwinView at 1280 x 1024 1600 x 1200. One screen has position Absolute +0 +0 and the other Absolute +1280 +1600 + 0. If anything goes wrong log back in under recovery mode and run sudo dpkg-reconfigure -phigh xserver-xorg to fix back up your /etc/X11/xorg.conf.



Hard Drive Formatting


I just spent three hours trying to format a hard drive under Linux. It really shouldn’t be so difficult.. this is one task which is much easier to perform on Windows than Linux. My goal was to format a USB hard drive with two partitions, one ext3 and one FAT32.

Some things I learned:

Use fdisk to create partitions, or the curses-based cfdisk. These tools can also be used to simply view the current partition layout.

The /dev/sd# numbers are assigned in the order the partitions are created, regardless of where they reside on the disk.

Windows refuses to create FAT32 partitions larger than 32MB.

Set the volume label with e2label. This only works for Linux filesystems; for dos-based systems you set the volume label when you create the filesystem.

Expect a lost+found directory to be created in your new Linux filesystem.

My xubuntu system didn’t immediately update the /dev hierarchy to reflect my partition changes; a reboot fixed this.

What worked for me to create one ext3 and one vfat partition on my new hard drive (sudo required for most commands):
cfdisk
reboot -t now
mkfs -m 0 -j /dev/sda1
e2label /dev/sda1 externalHD
mkdosfs -F 32 -n externalHD2 -v /dev/sda2

To mount a partition automatically on boot you have to add it to the fstab file. The partition will be mounted as root, but if you chown the mount point after the mount, the mount point will retain those permissions on subsequent mounts.



Linux Install


Random notes from my Linux install:

Non apt-got software:

Other places to look for changes:

  • /etc/cron*
  • /etc/fstab
  • /etc/X11/xorg.conf
  • /var/www/ (unless symlinked elsewhere)
  • Apache configurations
  • Changes made to settings files (.zshrc, .vimrc, Firefox customizations, adblock config, etc.)
  • databases
  • SVN checkouts

Packages:

# shell (don't forget chsh: /bin/zsh)
sudo apt-get install zsh zsh-doc libpcre3

# system monitoring
sudo apt-get install gkrellm htop

# miscellaneous
sudo apt-get install sharutils realpath hexedit ubuntu-restricted-extras

# programming
sudo apt-get install g++ gcc make gcc-doc manpages-dev gdb
sudo apt-get install build-essential

# vim!
sudo apt-get install vim vim-runtime

# ruby
sudo apt-get install ruby ruby1.8-examples rdoc1.8 ri1.8 irb
sudo apt-get install rails rubygems

# apache2
sudo apt-get install apache2 apache2-doc

# "productivity software"
sudo apt-get install openoffice.org
sudo apt-get install openoffice.org-style-tango
sudo apt-get install openoffice.org-help-en-us openoffice.org-thesaurus-en-us
sudo apt-get install gnumeric gnumeric-doc
sudo apt-get install abiword abiword-plugins abiword-help

# java
sudo apt-get install sun-java6-plugin sun-java6-fonts
sudo apt-get install sun-j2re1.5 
cd /usr/lib/firefox/plugins;
sudo ln -s /etc/alternatives/firefox-javaplugin.so #didn't work

# network utils
sudo apt-get install traceroute whois xchat kismet wireshark elinks nmap

# music (change XMMS audio output plugin to ALSA XMMS has been removed from Ubuntu)
sudo apt-get install xmms xmms-skins xmms-oggre
sudo apt-get install lame easytag vsound streamripper streamtuner audacity 

# mysql
sudo apt-get install mysql-query-browser mysql-admin mysql-server
sudo apt-get install phpmyadmin
sudo apt-get install libapache2-mod-php5
# http://localhost/phpmyadmin/

# subveresion
sudo apt-get install subversion

# if running gnome
sudo apt-get install compizconfig-settings-manager nautilus-actions

#
# if needed...
#

sudo apt-get install libc6-dev

sudo apt-get install trac enscript python-docutils libapache2-mod-python python2.4-setuptools

# problems with GLIB?
sudo apt-get install libglib2.0-dev

# problems with GTK+?
sudo apt-get install libgtk2.0-dev

# for cpan
sudo apt-get install lynx ncftp expat libexpat1-dev

# digi cam (gtkam)
sudo apt-get install gphoto2 gtkam
sudo apt-get install gimp gimp-help-en inkscape gqview libjpeg-progs

# acrobat
sudo apt-get install acroread
sudo apt-get install mozilla-acroread
sudo apt-get install acroread-plugins

# gnucash
sudo apt-get install gnucash gnucash-docs 

# privacy
sudo apt-get install tor privoxy

# latex
$ sudo apt-get install tetex-base tex-common tetex-doc tetex-bin
Reading package lists... Done
Building dependency tree... Done
Suggested packages:
  tetex-extra gs-gpl gv postscript-viewer xpdf-reader
  pdf-viewer texinfo texi2html dvipng chktex lacheck
  rubber sam2p libapache2-mod-php4 libapache2-mod-php5
Recommended packages:
  dialog psutils perl-tk xpdf mozilla-browser www-browser

Getting Linux to talk to the video card deserves it’s own post.
As does DVDs on Linux.

Who uses which spell checker?
– OpenOffice (myspell)
– Evolution (gnome-spell -> aspell)
– Mozilla (myspell)
– Abiword (gnome-spell -> aspell)

In the olden days we had to mount our flash drives manually: sudo mount -t vfat /dev/sdb1 /mnt/usbdrive

More information on Linux on the Dell 600m: http://www.guilds.net/machines/600m/


# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda3 / ext3 defaults,errors=remount-ro 0 1
/dev/hda6 none swap sw 0 0
/dev/hdc /media/cdrom0 iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
/dev/hda5 /shared vfat defaults 0 0
/dev/sda1 /mnt/usbdrive vfat defaults,users 0 0


# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda2
UUID=7fb76b6b-b272-4a1a-86c2-5e6a72df4a07 / ext3 defaults,errors=remount-ro,relatime 0 1
# /dev/sda5
UUID=097fa7af-6982-41ef-917c-6a140a481d67 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec 0 0
/dev/sdb1 /media/ettan ext3 defaults,relatime 0 0
/dev/sdb2 /media/tvÄan ext3 defaults,relatime 0 0
/dev/sdb3 /media/trean ext3 defaults,relatime 0 0

Add additional repositories (example is for Breezy):

    sudo vi /etc/apt/sources.list
    # comment the line referring to cdrom
    # uncommment all other command lines
    # add lines:
    
    deb http://us.archive.ubuntu.com/ubuntu breezy multiverse
    deb-src http://us.archive.ubuntu.com/ubuntu breezy multiverse
    deb http://packages.freecontrib.org/ubuntu/plf/ breezy free non-free
    deb-src http://packages.freecontrib.org/ubuntu/plf/ breezy free non-free
    
    sudo apt-get update
    

This is now more easily done in Synaptic through Settings -> Repositories.



The Pragmatic Programmer :: Andrew Hunt and David Thomas


Great tips applicable to any language or project, and a good read too. The book includes scores of good tips, but since the Quick Reference Guide has to go back to the library with the rest of the book:

  1. Care About Your Craft
  2. Think! About Your Work
  3. Provide Options, Don’t Make Lame Excuses
  4. Don’t Live with Broken Windows
  5. Ba a Catalyst for Change
  6. Remember the Big Picture
  7. Make Quality a Requirements Issue
  8. Invest Regularly in Your Knowledge Portfolio
  9. Critically Analyze What You Read and Hear
  10. It’s Both What You Say and the Way You Say It
  11. DRY–Don’t Repeat Yourself
  12. Make It Easy to Reuse
  13. Eliminate Effects Between Unrelated Things
  14. There Are No Final Decisions
  15. Use Tracer Bullets to Find the Target
  16. Prototype to Learn
  17. Program Close to the Problem Domain
  18. Estimate to Avoid Surprises
  19. Iterate the schedule with the Code
  20. Keep Knowledge in Plain Text
  21. Use the Power of Command Shells
  22. Use a Single Editor Well
  23. Always Use Source Code Control
  24. Fix the Problem, Not the Blame
  25. Don’t Panic
  26. “select” Isn’t Broken
  27. Don’t Assume It–Prove It
  28. Learn a Text Manipulation Language
  29. Write Code That Writes Code
  30. You Can’t Write Perfect Software
  31. Design with Contracts
  32. Crash Early
  33. If It Can’t Happen, Use Assertions to Ensure That It Won’t
  34. Use Exceptions for Exceptional Problems
  35. Finish What You Start
  36. Minimize Coupling Between Modules
  37. Configure, Don’t Integrate
  38. Put Abstractions in Code, Details in Metadata
  39. Analyze Workflow to Improve Concurrency
  40. Design Using Services
  41. Always Design for Concurrency
  42. Separate Views from Models
  43. Use Blackboards to Coordinate Workflow
  44. Don’t Program by Coincidence
  45. Estimate the Order of Your Algorithms
  46. Test Your Estimates
  47. Refactor Early, Refactor Often
  48. Design to Test
  49. Test Your Software, or Your Users Will
  50. Don’t Use Wizard Code You Don’t Understand
  51. Don’t Gather Requirements–Dig for Them
  52. Work with a User to Think Like a User
  53. Abstractions Live Longer than Details
  54. Use a Project Glossary
  55. Don’t Think Outside the Box–Find the Box
  56. Listen to Nagging Doubts–Start When You’re Ready
  57. Some Things Are Better Done than Described
  58. Don’t Be a Slave to Formal Methods
  59. Expensive Tools Do Not Produce Better Designs
  60. Organize Around Functionality, Not Job Functions
  61. Don’t Use Manual Procedures
  62. Test Early. Test Often. Test Automatically.
  63. Coding Ain’t Done ‘Til All The Tests Run
  64. Use Saboteurs to Test Your Testing
  65. Test State Coverage, Not Code Coverage
  66. Find Bugs Once
  67. Treat English as Just Another Programming Language
  68. Build Documentation In, Don’t Bolt It On
  69. Gently Exceed Your Users’ Expectations
  70. Sign Your Work


The Fine Line


Truth is a very fine line. Often it is very hard to describe exactly, and we end up talking on one side or the other. This happens a lot in church, and someone inevitably chimes in with “yes that’s true, but…” or “and remember, we can’t forget about…” type comments. And while this is sometimes done with an “I’m so smart, look at what I pointed out” attitude, they usually do have a point–because the truth is somewhere in the middle.

In order to describe Truth we often make seemingly contradictory statements, which are in reality describing the same thing but from different side. All perspectives must be taken into consideration together to gain a complete view of Truth.

Sometimes a person holds to one side of Truth exclusively, and may even contend with others who point out the other side. Sometimes we ourselves focus too much on one aspect of Truth to the exclusion of others. Many times I have discovered that the truth is somewhere in the middle.

Paul puts it well:
[12] I know both how to be abased, and I know how to abound: every where and in all things I am instructed both to be full and to be hungry, both to abound and to suffer need. (Philippians 4)

Praying vs. Doing

We must “counsel with the Lord in all [our] doings” (Alma 37:37), but it doesn’t do to just sit at home and pray all day; you must go and do, but you shouldn’t do without praying.

Justice vs. Mercy

[22] But there is a law given, and a punishment affixed, and a repentance granted; which repentance mercy claimeth; otherwise, justice claimeth the creature and executeth the law, and the law inflicteth the punishment; if not so, the works of justice would be destroyed, and God would cease to be God. (Alma 42)

The good and the bad of Guilt

[29] And now, my son, I desire that ye should let these things trouble you no more, and only let your sins trouble you, with that trouble which shall bring you down unto repentance. (Alma 42)

I hope it goes without saying that guilt is not a proper motivational technique for leaders and teachers of the gospel of Jesus Christ. (M. Russell Ballard)

Satan is the “enemy to all righteousness”; thus he plants doubts about the nature of the Godhead and our relationship with Them. Jesus Christ prophesied that in the last days even the very elect would be deceived. Consider three examples of how Lucifer is “laying traps and snares to catch the holy ones of God.”

The snare of false inadequacy. A faithful young person feels unable to meet the expectations of others. At home and school, she is rarely praised and often criticized. The popular media tells her she is not beautiful enough or smart enough. Every day this righteous sister questions whether she is an individual worthy of Heavenly Father’s love, the Savior’s atoning sacrifice, or the Spirit’s constant guidance.

The snare of exaggerated imperfection. An outstanding missionary feels incapable of meeting the expectations of God. In his mind, this worthy elder imagines a stern Heavenly Father bound to irrevocable justice, a Savior capable of cleansing others’ transgressions but not this elder’s own, and a Holy Ghost unwilling to accompany an imperfect person.

The snare of needless guilt. A middle-aged woman is a devoted mother, a loving friend, a faithful Church servant, and a frequent temple patron. But in her heart, this sister cannot forgive herself of sins committed years ago that she has repented of and fully resolved with priesthood leaders. She doubts that her life will ever be acceptable to the Lord and has lost hope of eternal life in Heavenly Father’s presence.

If you have any thoughts and feelings similar to these good Saints, I invite you to become as a little child and feel again “the great and wonderful love made manifest by the Father and the Son in the coming of the Redeemer into the world.” Childlike faith in the perfect love of Heavenly Father and Jesus Christ will “divide asunder” Satan’s snares of inadequacy, imperfection, and guilt. (Anthony D. Perkins)

We are nothing, and yet we are everything

[21] I say unto you that if ye should serve him who has created you from the beginning, and is preserving you from day to day, by lending you breath, that ye may live and move and do according to your own will, and even supporting you from one moment to another — I say, if ye should serve him with all your whole souls yet ye would be unprofitable servants. (Mosiah 2)

[7] O how great is the nothingness of the children of men; yea, even they are less than the dust of the earth. (Helaman 12)

[10] …and he said unto himself: Now, for this cause I know that man is nothing, which thing I never had supposed (Moses 1)

[16] The Spirit itself beareth witness with our spirit, that we are the children of God: [17] And if children, then heirs; heirs of God, and joint-heirs with Christ…. (Romans 8)

[9] But ye are a chosen generation, a royal priesthood, an holy nation, a peculiar people; that ye should shew forth the praises of him who hath called you out of darkness into his marvelous light; (1 Peter 2)

How dare you or I have a low self-image! We are the sons and daughters of God! We belong to Him. We are His children. He gave us birth. He gave us life. That knowledge alone causes every man and every woman, when they understand it, to rise and walk with their head held high (M. Russel Ballard)

Faith and Works

[8] For by grace are ye saved through faith; and that not of yourselves: it is the gift of God: [9] Not of works, lest any man should boast. (Ephesians 2)

[17] Even so faith, if it hath not works, is dead, being alone. [18] Yea, a man may say, Thou hast faith, and I have works: shew me thy faith without they works, and I will shew thee my faith by my works. (James 2)

[23] …for we know that it is by grace that we are saved, after all we can do. (2 Nephi 25)



Python Template


Guido himself writes a short tutorial on good Python main functions at artima developer. Since he doesn’t include a final template incorporating all of his suggestions, here it is.

#!/usr/bin/python
"""Module docstring.

This serves as a long usage message.
"""
import sys
import getopt

def main(argv=None):
    if argv is None:
        argv = sys.argv

    # parse command line options
    try:
        try:
            opts, args = getopt.getopt(argv[1:], "h", ["help"])
        except getopt.error, msg:
            raise Usage(msg)
        # process options
        for o, a in opts:
            if o in ("-h", "--help"):
                print __doc__
                return 0
        # process arguments
        for arg in args:
            process(arg) # process() is defined elsewhere
    except Usage, err:
        print >>sys.stderr, err.msg
        print >>sys.stderr, "for help use --help"
        return 2

class Usage(Exception):
    def __init__(self, msg):
        self.msg = msg

if __name__ == "__main__":
    sys.exit(main())


Kindness


An interesting experience from the other day, with a lesson to be learned:

I was nearing a project deadline at work. I checked in my changes and when I did a production build, found that my coworker had checked in some code without fully testing it, and it broke the build.
I wrote him an email asking him to fix his code. I was tempted to mention how it was holding me up from deploying an important change and otherwise berate him for his laziness.. but thought better of it and changed the tone to something a little more pleasant. It turns out part of my change didn’t build either.. I had just missed it because my errors were farther down the log than his.

Every time I’ve resisted my first inclination to be a little angry, harsh, or even just put-off, and switch to something nicer, I’ve always been grateful afterward. As with President Lincoln’s never-sent letter to General Meade, the trick is just to resist that initial impulse, or even better, change the impulse so it never comes.


powered by WordPress     themed by Mukkamu     presented by ideaharbor.org     everything else by steve hulet