Much ado about scripting, Linux & Eclipse: card subject to change

Showing posts with label fedora. Show all posts
Showing posts with label fedora. Show all posts

2020-02-07

Fedora 31 / Rawhide in Windows Subsystem For Linux

So you want to do Fedora stuff without the hardware headaches and all the vitualization crap? 

Well it's finally possible in Windows 10 to run Fedora 31 or even Rawhide (currently 32).

Here's what you need:

1. Update Windows 10 Pro to the latest. Reboot ad nauseum as required.

2. Enable the Windows Subsystem for Linux (WSL) if not already turned on. I used this guide. Reboot again.

3. Open the Microsoft Store and search for Fedora Remix for WSL. It was $5 when I bought it today - figured that was a small price to pay to avoid Alpine, Ubuntu and Debian WSL variants. Shoutout to Whitewater Foundry for the sale price. 


4. Launch the new app from Start > Apps > Fedora Remix for WSL

5. This is where things got a bit ... unexpectedly annoying, but I did finally resolve my issue.

6. At the command prompt, run these commands:
sudo su
dnf update -y
Then I tried to install more stuff...
dnf install -y buildah podman
... but that's when things went sideways:
RPM: error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch
7. After much googling, experimenting with db cache recovery, and learning way more low level rpm db commands than I ever wanted, I found a simple solution:
rm -f /var/lib/.rpm.lock
But somewhere along the way I had tried switching to Rawhide (didn't help!), so to go back to Fedora 31, I did this:
# see current release version at 32
cat /etc/*release 

# enable/disable repos by hand - no rawhide, only fedora.
cd /etc/yum.repos.d/; vim *.repo 

# out with the new, in with the old
yum remove generic-release

# re-enable any .repo files that were disabled by the uninstall of Fedora 32
for d in fedora*.rpmsave; do mv $d ${d/.rpmsave}; done

# reinstall removed packages
dnf history info $(dnf history | grep generic-release | grep Removed | \
  sed -e "s#[ ]*\([0-9]\+\) | remove.\+#\1#")

# determine which packages were removed
dnf history info $(dnf history | grep generic-release | grep Removed | \
  sed -e "s#[ ]*\([0-9]\+\) | remove.\+#\1#") | grep Removed | \
  grep @@System | sed -e "s#[ ]*Removed \(.\+\).\(noarch\|fc.\+\).*#\1#"

# reinstall them
yum install --releasever=31 audit fedora-gpg-keys fedora-repos fedora-repos-rawhide \
  generic-release generic-release-common initscripts setup shadow-utils  

# verify back to 31
cat /etc/*release 
9. Back in business, can now install without dnf errors from fc31 packages.
dnf -y install buildah podman
dnf -y install hub
dnf -y install python jq pip
...
10. Aside: to get a list of all the things you've installed in your Fedora machine, you can run:
for i in $(dnf history | grep -v "Altered" | grep install | \
  sed -e "s#[\t ]\+\([0-9]\+\)[\t ]\+|.\+#\1#" | tac); do
    dnf history info $i | grep Command | \
      sed -e "s#.\+ : #dnf -y #";
done
Next up... experimenting with an X server to do Fedora GUI apps inside Windows (without the need for VirtualBox 6.1, which seems to be much tetchier than 6.0 for multi-monitor support).

2020-01-14

Force Chrome to use hardware acceleration (performance enhancement under virtual box 6)

Moving to Fedora 31 on Virtual Box 6.1


Last week I got a new Thinkpad T490s, and to celebrate I grabbed the latest Windows 10 Pro updates, installed Virtual Box 6.1, and set up a new Fedora 31 VM

Everything was pretty smooth right out of the box but for two problems:

1. guest OS in Seamless mode slides UNDER Window's taskbar.
2. Chrome 79.0.3945.117 (Official Build) (64-bit) performance was insanely sluggish and unusable inside the VM.

Still working on a fix for the first one, other than to hide the Windows taskbar when working on a single screen, and to assign my VM's xfce4-panel to run on a different pimary monitor by default than Windows' primary monitor (so they don't overlap). 

But for the second issue, I found this solution - forcing my VM's Chrome to use hardware acceleration, by turning on a setting under chrome://flags:


And like that, voom. Chrome is responsive and useable again!

2011-09-01

HOWTO: Move around between desktops & windows with keyboard or mouse

Recently installed Fedora 15 KDE spin, partly because the XFCE spins wouldn't boot from CD but also because I've heard less-than-favourable things about Gnome3 and because I'm addicted to Konqueror as a graphical sftp/scp/ssh viewer, so figured might as well use kdm instead of xfwm4 or gdm.

Still having some problems getting my 1600x1200 (or 1920x1200) monitor to do anything more than 1024x768 on the VGA port of the video card (works fine on the DisplayPort connector, either directly or via a DP-to-DVI cable, but not on the VGA connector, even with xorg.conf hackery). That said the options for display/monitor management under KDE are much better than under XFCE, and this is the first time I've been able to get two monitors working without HOURS of hacking away at xorg.conf scripts. So... big props for this release *almost* Just Working.

Workaround I'm trying next is to install a second video card. Will update when/if that solves the problem once it arrives.

But video resolution aside, I did recently figure out how to set keyboard bindings for moving windows between desktops (thanks to David Fisco). From the K-menu, select System Settings > Shortcuts and Gestures > Global Keyboard Shortcuts > KDE Component: KWin > "Window One Desktop To The Left/Right":

... and for switching between desktops ("Switch To Next/Previous Desktop")

Also recently discovered some fun options for switching between windows (on all desktops). From the K-menu, select System Settings > Desktop Effects > Enable desktop effects > Effect for window switching: Present Windows (or any of the other options).

There's also System Settings > Window Behavior > Task Switcher > Effect: Present Windows:

You might want to set an animation for switching between desktops, though I find with multiple monitors this can be a bit dizzying. From the K-menu, select System Settings > Workspace Behavior > Virtual Desktops > Switching > Animation: Desktop Cube Animation. For something more subtle, try "Fade Desktop".

Finally, you may want to set screen edge behaviours, such as making Present Windows appear when you cursor to the top-center of your screen. System Settings > Workspace Behavior > Screen Edges > right-click a target zone:

2011-08-16

Mounting Linux LVM drives

Because my Thinkpad X200 has finally, after just under 3 years, decided to give up the ghost via a FAN ERROR and refusal to start (POST beeps & auto-shutdown), I'm now faced with the task of recovering all the data on the drive (about 120G) across multiple partitions.

Here's the drive layout, as per cfdisk:

                                   cfdisk (util-linux-ng 2.17.2)

                                        Disk Drive: /dev/sdb
                                 Size: 160041885696 bytes, 160.0 GB
                       Heads: 255   Sectors per Track: 63   Cylinders: 19457

     Name           Flags         Part Type    FS Type              [Label]            Size (MB)
 --------------------------------------------------------------------------------------------------
     sdb1                          Primary     NTFS                 [^B]                26214.44   *
     sdb2           Boot           Primary     Linux ext3                                 209.72   *
                                   Logical     Free Space                                   3.68   *
     sdb5                          Logical     Linux ext3           [HOME]             106043.70   *
     sdb6           NC             Logical     Linux LVM                                20970.48   *
                                   Logical     Free Space                                   1.09   *
     sdb4                          Primary     Compaq diagnostics                        6595.71   *
                                               Unusable                                     0.49   *

So, under a Fedora 13 LiveCD, the /boot (sdb2) and /home (sdb5) partitions automounted, along with the WinXP (sdb1) partition. But the root partition (/, part of sdb6) would not as it's part of a LVM. After a quick burst of googling, I found this solution, which digests down to simply this:

yum install lvm2 -y; # install support for lvm2
pvscan # scan vol groups
vgchange vg_x2lappy -a y # mark your vol group active
lvscan # scan for logical volumes 
mkdir /media/sdb6 # create a mount point
mount /dev/vg_x2lappy/lv_root /media/sdb6/ # mount the lv
cd /media/sdb6/; ls -la # take off every zig!

2011-06-06

HOWTO: get xorg.conf to work w/ 1600x1200 res and an old Intel card

  1. Check your hardware spec, and determine how much memory your card has[1]:
    # lspci -vv | grep "Intel" -A7 | grep "VGA controller" -A7 | egrep "controller|Region"
    00:02.0 VGA compatible controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02) (prog-if 00 [VGA controller])
     Region 0: Memory at e0000000 (32-bit, prefetchable) [size=128M]
     Region 1: Memory at d0000000 (32-bit, non-prefetchable) [size=512K]
  2. Use the above values to configure your /etc/X11/xorg.conf file - I suspect much of this is not needed, but here's what I have:
    Section "Device"
     Identifier "Intel"
     Option "AccelMethod" "UXA"
     VideoRam 130560
     #Driver      "intel"
     Driver      "vesa"
     VendorName  "Intel Corporation"
     BoardName   "82852/855GM Integrated Graphics Device"
     BusID       "PCI:0:2:0"
    EndSection
    
    Section "Monitor"
     Identifier "VGA"
     ModelName    "Sceptre 24"
            HorizSync    31 - 80
            VertRefresh  55 - 76
            Option      "DPMS" "true"
    EndSection
    
    Section "Screen"
     Identifier "Default Screen"
     Device "Intel"
     Monitor "VGA"
     DefaultDepth 16
            SubSection "Display"
                   Depth           16
                   Modes           "1920x1440_60" "1920x1200_60" "1920x1080_60" "1680x1050_59.883" "1360x768_59.8" "1600x1200_60" "1280x1024_60" "1024x768_60"
                   #Modes           "1920x1440" "1600x1200" "1280x1024" "1280x768"
            EndSubSection
    EndSection 
    
    Section "DRI"
            Mode         0666
    EndSection
    
    Section "Extensions"
            Option      "Composite" "Enable"
    EndSection
    
    Section "Module"
            Load  "dri"
    EndSection
  3. In /boot/grub/menu.lst, add the correct vga mode for 1600x1200 (vga=8). If you enter what you think is the correct mode based on this table, you'll be told it's wrong and can manually correct it, boot up, then fix the file & reboot.
    default=0
    timeout=5
    splashimage=(hd0,0)/grub/splash.xpm.gz
    
    
    title Fedora (2.6.34.7-56.fc13.i686)
     root (hd0,0)
     kernel /vmlinuz-2.6.34.7-56.fc13.i686 ro root=/dev/mapper/vg_xlappy-lv_root rd_LVM_LV=vg_xlappy/lv_root rd_LVM_LV=vg_xlappy/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet vga=8
     initrd /initramfs-2.6.34.7-56.fc13.i686.img
    
    title Fedora (2.6.34.7-56.fc13.i686) cmdline only, vga=8 = 1600x1200x16
     root (hd0,0)
     kernel /vmlinuz-2.6.34.7-56.fc13.i686 ro root=/dev/mapper/vg_xlappy-lv_root rd_LVM_LV=vg_xlappy/lv_root rd_LVM_LV=vg_xlappy/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us init=3 init 3 vga=8
     initrd /initramfs-2.6.34.7-56.fc13.i686.img

See also:

2010-10-25

In Which I Explain Once Again That Linux Is A Viable Alternative to Windows

I was recently asked this question:

Can linux be used for a normal computer, operating email programs, word processing, etc? I am quite frustrated with all the "improvements" that Windows keeps getting; each improvement making it slower and more prone to erratic behavior. I use a computer only for the above tasks, and would really like to get away from the problems.

As I've been telling friends, colleagues, family, and everyone who'll listen for about the past 5 years... YES.

  • Mail: Instead of Outlook, you can use Thunderbird.

  • Calendar: use Sunbird or go online w/ Google Calendar

  • Web: Instead of Internet Explorer, Firefox, Opera, Chrome, or Konqueror. None will "accidentally" install spyware for you.

  • Office: Instead of the bloated and dinosauric (20 years old!) MS Office's Word, Excel & Powerpoint, use Open Office's Writer, Calc & Impress. (Open Office is now 10 years old - old enough to be feature rich, young enough to be standards-compliant.)

  • Chat: instead of MSN, use pidgin (supports all IM protocols, including MSN, Yahoo, gtalk, IRC, Twitter, Facebook) and/or Skype (for audio/video chat)

  • Audio/Video playback & streaming: instead of Windows Media Player, VLC player.

  • Solitaire: PySol includes 200 solitaire games; Firefox "Cards" plugin contains dozens more.

More advanced users:

I personally use linux flavours designed for older machines so they're lightweight, faster, and less bloated. Then, if I need a more "bloated" app (like something from the KDE school instead of the XFCE or GDE school), I simply install that into the operating system as an add-on. Of course if you *want* eye candy (like 3D desktops and transitions when you open/close applications) you can get that too. It's pure eye candy, but it's available if you need Vista or Win7-like "bling".

If you want to try Linux before jumping in fully, I advise two options:

  • Xubuntu, designed for old machines and to stay more-or-less the same over time. Download and install it into Windows without having to reformat your hard drive. Good for your grandmother's desktop machine.

  • Fedora, designed for newer machines and to stay up to date with recent improvements in the Linux world. Can be installed onto a USB key so you can boot your system from that without having to touch your existing Windows install. Good for your parents or your machine, or for an office.

  • There are of course lots of other Linux distros out there...

2010-06-21

pogoplug network attached storage (NAS) for linux, mac, windows

A couple months ago I bought a PogoPlug. Because it's an ungodly pink colour and because I've been hella busy with other stuff, I finally unboxed it today, and discovered that while:

... setting it up for Linux was not entirely trivial.

While the above article helped, a couple points were not immediately obvious:

  • If you mount the drive as root, it's not accessible as anyone else; if you mount as the user, not even root can read it.
  • Use of a /etc/pogoplugfs.conf file is highly recommended, so that you can log in w/o having to key in your username and password every time. Create this file as root, and set it chmod 644 if not already:
    svcuser=you@email-provider.com
    svcpassword=web-login-password
    logseverity=10
  • To automount the drive on startup (eg., on my old xubuntu 6 system), as root, try creating a new file, /etc/init.d/pogoplug:
    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides:          
    # Required-Start:    $remote_fs $syslog
    # Required-Stop:     $remote_fs $syslog
    # Should-Start:      $named
    # Default-Start:     2 3 4 5
    # Default-Stop:      1
    # Short-Description: pogoplug fs mount as myusername
    # Description:       pogoplug fs mount as myusername
    ### END INIT INFO
    
    sudo -u myusername /usr/bin/pogoplugfs --mountpoint /media/pogoplug
    
    exit 0
  • Then, to activate this file, as root:
    chmod +x /etc/init.d/pogoplug; \
    for x in 2 3 4 5; do \
      cd /etc/rc${x}.d; ln -s /etc/init.d/pogoplug S99pogoplug; \
    done

With Fedora 12, I could simply create a startup task using System < Preferences < Startup Applications from the gnome menu.

2010-01-18

Monitor fail

Well, that's a week of my life I'll never have again. Spent most of last week playing with WinXP, LinuxMint 8, and Fedora 11 & 12 (both 32- and 64-bit) trying to find a solution to my external display issues.

Turns out that it's a software issue: the latest xorg intel driver has a bug.

Humorous Pictures

2009-10-19

Ontario [GNU] Linux Fest 2009

Annoyed that your boss didn't approve that expense to fly over to Germany for Eclipse Summit Europe? Well, fret no more!

Have we got a deal for you!

For only $40 you can attend Ontario [GNU] Linux Fest 2009 - a whole day of open source geekery from the following speakers! And, while there, stop by the Eclipse and Fedora tables for your chance to win some schwag!

I'd like to say we'll be giving away Slap-Chops or Sham-Wows too, but Vince will be rappin' & reppin' elsewhere. :)

2009-06-25

My love-hate with SVN, Part 4: Corrupt Metadata & Going Over Quota

Ever had one of those days where nothing seems to work? Most of June's been that way for me...

This week I decided to trust my OS and let Fedora update me automatically to the latest release, Fedora 11. I've never tried a distribution upgrade; in the past I've only ever done a clean install (be it Windows, Ubuntu, MEPIS, AntiX, or Fedora). But I figured if @dougschaefer could do it, so could I.

It was fairly smooth sailing, though the handy gui tool preupgrade only downloaded packages but didn't do the upgrade, so on reboot (still in F10) I had to run preupgrade-cli "Fedora 11 (Leonidas)". I suspect I must have fatfingered my hard drive password when I rebooted he first time because it worked like a charm the second time. Overall, way more successful than attempts so far to make a Mac Pro get Fedora'd, thatsfersure (grub, video, and network card issues, to name but a few).

Anyway, now I have updated versions of subversion and python, and as a result, my Subversive projects in Eclipse don't work. After much cursing and experimenting (and updating my CollabNet Subversion version to 1.6.3, the solution seems to be simply this:

Check out the projects anew within Eclipse, and if necessary, diff local changes from old project to new project.

But, if the project is too big (jbosstools trunk folder is over 1.1G) you may get a heap error. You can check the whole project out via commandline, but Eclipse (or Subversive? or Mylyn?) uses too much memory and the whole thing dies, despite my running Eclipse w/ a half-gig of heap:

/home/nboldt/eclipse/eclipse/eclipse -clean \
  -showLocation -data /home/nboldt/eclipse/workspace-jboss \
  -vmargs -Djava.library.path=/opt/CollabNet_Subversion/lib \
  -Xmx512M -XX:PermSize=512M

In this case, the solution is to check out the project without recursing into folders.

Commandline on in the Console view, that looks like this:

svn checkout "https://svn.jboss.org/repos/jbosstools/trunk@HEAD" -r \
  HEAD --depth empty  "/home/nboldt/eclipse/workspace-jboss/jbosstools-trunk"

You can then copy stuff you already checked out into the new target project, then refresh the project in Eclipse. Of course in my case Eclipse then thought all the files were new, so I had to Override and Update from the repo.

Another 24374 files or 1.1G to download. No wonder I went over my quota this month!

(Really, it was due to several different .iso torrent downloads for Fedora and CentOS, along with the movie Dead Alive, just in time for BLITEOTW day!)

So, unfortunately, I haven't been able to enjoy any of the 33 projects in this years' Eclipse Galileo release, unlike others on the Planet and the BirdsNest have. Hopefully next month will see calmer seas.

On the plus side now that I'm running Fedora 11, I can use Delta RPMs thanks to the yum-presto plugin... so next month's bill should be much, much smaller.

2009-06-24

HOWTO: Enable Firefox 3.0 extensions in Firefox 3.5 for great justice

Just updated to Fedora 11, and with it Firefox 3.5b4. Sadly, that meant most of my extensions (including mouse gestures!) no longer worked... until I found this:

In A.D. 2009,
Firefox 3.5 was beginning.
Captain: What happen ?
Mechanic: Fedora 11 repo set up us the beta.
Operator: We get signal.
Captain: What !
Operator: Main browser turn on.
Captain: It's you !!
FF35: How are you gentlemen !!
FF35: All your extensions are belong to 3.0.
FF35: You are on the way a vanilla Firefox.
Captain: What you say !!
FF35: You have no chance to survive wait for GA.
FF35: Ha ha ha ha....
Operator: Captain !! *
Captain: To put back every 'extension'!!
Captain: You know what you doing.
Captain: Install this.
Captain: For great justice.
Captain's Log - Additional: Here's the same extension for Thunderbird 3.0b2, though I had to disable the quicksearch toolbar box as it wouldn't close properly in TB3; also found some handy toolbar buttons here for filtering a mailbox for all/unread.

2009-05-28

Eclipse Community Survey: 4 More Insights

Ian blogged 6 insights from this year's Eclipse Community Survey; here are a few more to get us to a full Top Ten list.

  1. What is your primary operating system?

    Linux is certainly a strong player in both development (26%) and deployment (40%), beating Mac (7% and 3%) but losing to Windows (64% and 38%). More interesting to me is the fragmentation of Linux, showing that Ubuntu beats RHEL/Fedora by 10% in the desktop space (development), but loses in the server space (deployment).

  2. Where do you typically go to find Eclipse-related information?

    About 2/3rds said Google and/or the Eclipse home page, which suggests that the homepage has certainly improved - but a lot of people would rather just search. However, the survey didn't mention our finely crafted wiki.eclipse.org, or help.eclipse.org. Survey #FAIL.

  3. Are you or the organization you work for a member of the Eclipse Foundation?

    Five out of six respondents (83%) said No. So either we've done a terrible job of converting users into members, or people would rather give back in the form of testing, documentation, filing bugs, and writing articles. I suspect it's a little of both, but mostly the former.

    Kudos to the contributors, and shame on the corporate drones for not convincing their queen to send a little honey back to Eclipse.

  4. In the last year, how have you participated in the Eclipse community?

    While nearly a quarter of respondents (24%) said "I entered at least one bug into Bugzilla", more than 2/3rds said they "used Eclipse but didn't actively participate in the community." To me that's a clear sign we have more users than contributors. Is that because most Eclipse users are Windows folks who don't grok that Open Source works best when everyone sees themselves as part of the process, rather than just a consumer?

I've been reading More Joel On Software recently, thanks to winning a prize for bringing a bag purchased in Alaska to EclipseCon this past March. One article stands out from there in this context, Building Communities with Software, from March 2003. Here's an excerpt:

The social scientist Ray Oldenburg talks about how humans need a third place, besides work and home, to meet with friends, have a beer, discuss the events of the day, and enjoy some human interaction. Coffee shops, bars, hair salons, beer gardens, pool halls, clubs, and other hangouts are as vital as factories, schools and apartments ["The Great Good Place", 1989]. But capitalist society has been eroding those third places, and society is left impoverished.

...

So it's no surprise that so many programmers, desperate for a little human contact, flock to online communities - chat rooms, discussion forums, open source projects, and Ultima Online. In creating community software, we are, to some extent, trying to create a third place.

If you feel your third place is lacking, please consider contributing more to Eclipse, to Fedora or CentOS, to JBoss Tools, or whatever tickles your fancy. Just give something back. Your community will thank you, since, after all, "A rising tide lifts all boats."

UPDATE, 2009/05/30: Mike's right, calling our users "freeloaders" isn't fair. I just wish there was a more obvious way to convert users into contributors.

2009-01-29

HOWTO Create a Seam Web Project with JBoss Tools 2.0.0.CR2 or Developer Studio 3.0.0.CR2

As Max announced earlier today, JBoss Tools (JBT) 3.0.0.CR2 is now available.

In my continuing effort to automate - or at least document! - everything I do, here's a quick slideshow showing how to install and run JBoss Developer Studio (JBDS) 2.0.0.CR2 to quickly create a Seam Web Project. JBDS includes most of JBT, plus a few extra goodies.


view larger images

What else can you do with JBoss Developer Studio or JBoss Tools? Lots. Here's a list of the individual plugins, and the reference guides. There's even a jBPM/BPMN diagram editor, which I used recently to sketch out my Blackberry data sync flows:


click to enlarge

JBDS is available for Linux (gtk x86_32 and x86_64), Mac OS X (carbon), and Windows (32-bit). JBT is available for any platform that can run Eclipse 3.4.x. On Fedora, JBDS and JBT both run great with IcedTea (OpenJDK 6) and Fedora Eclipse 3.4.1.

If you're curious, the software involved here is: Virtual Box 2.1.0 running in Fedora 10, hosting a Windows XP Home guest, HyperSnap 6 to grab snapshots (works in Windows guest and through WINE - though not as well - in Linux host), Sun Java 6.0 to run JBDS (or Eclipse + JBoss Tools), Picasa 3 For Linux to crop, resize and upload images, then create the slideshow.

2009-01-06

Blackberry Linux Mail, Calendar, Tasks & Contact Sync, Part 2

Things have improved since my last post, despite the fact that I managed to kill Thunderbird along the way and lost a good chunk of today figuring out to restore it. Luckily I can read French, or I may never have found the solution to the elusive -203 problem.

Aside:

To recover from a corrupt Thunderbird profile, create a new profile using thunderbird -ProfileManager, then transfer your data to the new profile. Easy-peasy.

Next, reinstall all your extensions. I use these 15 extensions.

I've also managed to get barry to work for backing up my Blackberry on Fedora. Turns out the problem is that it simply needs root privileges.

Here's how the data flows, drawn with JBoss Tools' jBPM Graphical Process Designer:


click to enlarge

I don't yet have a solution for Zimbra contacts & calendar being accessible on the Blackberry, short of manually duplicating entries from one repo to the other. Still, 5 out of 7 data sources synched is pretty decent.

2009-01-03

Blackberry Linux Calendar & Contact Sync

Ugh, what a nightmare. Skip to solution. See also Part 2.


PocketMac for Blackberry, Linux Edition

Unfortunately, I missed the deadline to be a beta tester for this new app. Comes highly recommended by a Macolyte friend of mine; unfortunately until it's released I won't be able to come anywhere near it. :(

Blackberry Desktop Manager in VirtualBox

First, I tried to install Blackberry Desktop Manager into a VirtualBox 2.1 Win XP Home guest OS, running on xubuntu 8.04. Problem there was that OOTB the VB guest couldn't see my USB devices (ie., the mounted Blackberry). Solved [1], [2].

Unfortunately, while the Windows guest could see the Blackberry, it couldn't sync with it. I keep getting prompted for my password to enter "mass storage mode", then ultimately the backup failed, as the connection was dropped midway through.

Hoping that the story would be better on my newer x200 Thinkpad, I tried again -- same result. Additionally, though the VirtualBox Windows guest found my bluetooth adapter, I couldn't make it work under Windows to connect to the BB.


barry

I tried installing barry, the Blackberry Desktop For Linux project. I installed 0.14-4.fc10 and 0.14-6.fc11, but it didn't work - perhaps the Bold is too new?

(-1, error sending control message: Operation
not permitted): Probe: GetConfiguration failed

So, for now, the only way to backup/restore is via my wife's WinXP laptop.

UPDATE, 2009/01/05: Turns out you have to run barry w/ root privileges. I can now backup on linux. W00t!

But surely there's another way to sync?


OpenSync

Next, I tried OpenSync. This didn't work either. I tried 0.22 on xubuntu 8.04, with KitchenSync 0.1, but it couldn't connect to the device. Then I tried 0.36 on the x200 Fedora 10 box with msynctool, but it too couldn't connect to the device (even though I'd already paired the BB with the Thinkpad over bluetooth), perhaps because my settings were incorrect? Either way, both front ends left a lot to be desired for a total noob user. XML config files are fine, but better in-file documentation would be nice.
msynctool 
msynctool --listplugins
msynctool --addgroup BB
msynctool --enable-objtype BB syncml-obex-client
msynctool --addmember BB syncml-obex-client
msynctool --enable-objtype BB google-calendar
msynctool --addmember BB google-calendar
msynctool --enable-objtype BB file-sync
msynctool --addmember BB file-sync
msynctool --showgroup BB
msynctool --configure BB 1
msynctool --configure BB 2
msynctool --configure BB 3
msynctool --sync BB

... still failed to connect to device :(

Funambol

Then I discovered the Funambol web-based sync option, and signed up. This worked, and I now have my contacts and BB calendar synched with their server. OK, that's great, but what I really wanted was to sync w/ my desktop apps and/or with Google Calendar. So, I tried the Funambol Mozilla Plugin 0.8 for synching contacts and calendar with Sunbird 0.9 (or Thunderbird 2.0 with Lightning 0.9). It worked on my home xubuntu 8.04 machine (one email address, no calendars) but failed to install on my work Fedora 10 machine (two email addresses, two calendars, RSS feeds & newgroup subscriptions). Bummer.

UPDATE, 2009/01/05: My Thunderbird profile had been corrupted. Creating a new one, importing from the old one, and reinstalling all extensions fixed this problem. But because I can use Google Sync for Contacts and Calendar, I'm only using Funambol for Tasks now. Details here.


Google Sync

Finally, checking my Google Calendar online I noticed a new "Sync" link in the top right. I found that Google has released an early Xmas present: Google Sync for your BlackBerry. Finally, a solution!

BBToday

If you would like to have a snapshot of your mail, calendar, tasks, calls and optionally, battery status & weather in one convenient portal page, try BBToday 1.6.


Captured with CaptureIt

UPDATE, 2009/01/29: I've found a better Today screen, but it's not free. BOLD CrossBar Plus Xtreme - BOLD OS 4.6 by JC Designs / Gadgetbean. Combine this with WeatherEye from The Weather Network, and you've got weather, mail, messages, calendar... all on one attractive screen! Best. Seven Bucks. Ever.

Continued in Part 2...

2008-12-04

My love-hate with SVN, Part 3: CollabNet Subversion (JavaHL)

Installing Subclipse w/ JavaHL (aka CollabNet Subversion)

  1. Download CollabNet Subversion for your operating system (Linux, Windows, MacOS X). This provides the JavaHL layer so that Subclipse can talk to SVN repos using pure Java (but not SVNKit). Install it.
  2. Download Eclipse 3.4.1 (or Fedora Eclipse). Start it up, making sure to pass in -Djava.library.path=/opt/CollabNet_Subversion/lib (linux only).
  3. Help > Software Updates... > Available Software > Manage Sites... > Add... > http://subclipse.tigris.org/update_1.4.x
  4. Install the whole site. Restart when prompted.
  5. Window > Preferences > Team > SVN > SVN Interface > Client > JavaHL (JNI)

Well, I feel I've been remiss in ranting about Subclipse. Turns out a fresh Eclipse + a fresh install (and a lot of trial and error / googling has fixed things.

You have not exactly given us a chance to help you with your Subclipse issues.
Mark, you're right, Subclipse does work -- it's just not the most straightforward thing to install. And when it breaks suddenly and for apparently no reason, losing hours of productivity to fighting w/ source control instead of writing and committing code, it's VERY frustrating, especially considering that Eclipse's CVS support Just. Works.
Does the JavaHL library exist in the folder you pointed to?
Well, given the wiki doesn't actually say what file(s) are supposed to be there, I had to guess. I have /usr/share/java/svnkit-javahl-1.1.4.jar and /usr/share/java/svnkit-javahl.jar (a symlink to the previous). Is that what Subclipse / Subversive are looking for? No idea.
Do the preferences say "Not available"?
They do. After much surfing, googling, testing, registering to download, waiting for a password, cursing, downloading and rpm -i ... I finally figured out that all I needed to do was get CollabNet Subversion Command-Line Client v1.5.4 (for Red Hat Linux), and (as noted in the wiki), add -Djava.library.path=/opt/CollabNet_Subversion/lib to my Eclipse startup. Could you save others this search by linking to the downloads page from the wiki? Or even linking to it from the Downloads page??
I think somehow an old version of their JAR is being loaded by your Eclipse and not the one in their plugin. Do you have their JAR installed in your Java extensions folder or something?
Reinstalling Eclipse and purging some jars of unknown pedigree & version seems to have worked. I have svnkit 1.1.4 in the above folder (/usr/share/java), and org.tmatesoft.svnkit_1.2.0.4949 in a linked folder in my dropins/.
Finally, as to your History error, Subclipse does not have this problem, but I know the cause. Your history view is setup to "Show Merged Revisions". I would assume that Subversive exposes this as an option in the UI that you can turn off. That is what we do in Subclipse.
I expected to find this as an option under Window > Preferences -- some digging showed me that, no, it's under the view's menu > Include Merged Revisions. Thanks for the tip!
Anyway, we also catch that exception when talking to older Subversion servers and just make the request again without asking for the merged revisions. If you have not already filed a bug report with Subversive you probably should.
Good idea -- see bug 257669. I just want something that will work, won't crash Eclipse, won't freeze up during an update, won't leave dozens of "not really there" files in my Synch view (that magically disappear when I click the 'collapse all' button in the view), won't throw errors when I try to look at file histories.

So, for the moment, I'm back to Subclipse. I've upped the permgen and heap for Eclipse to 400M and things are working again. Seems large projects + SVN = crashing/freezing/OOM errors. Maybe JavaHL won't be so greedy? We shall see.

2008-12-02

My love-hate with SVN

Since joining JBoss, a division of Red Hat, I've gotten to know the foibles of SVN rather intimately. Here are my two favourites, both encountered this week:

  1. This client is too old to work with working copy; please get a newer Subversion client.
    Problems reported while synchronizing SVNStatusSubscriber. 2 of 3
    resources were synchronized.
    An error occurred synchronizing /devstudio-workspace: Error
    getting status for resource P/devstudio-workspace
    org.tigris.subversion.javahl.ClientException: svn: This client is
    too old to work with working copy; please
    get a newer Subversion client

    This happens if you use SVN 1.5.4 and Subclipse 1.4.6 with SVNKit & JavaHL plugins. Solution? Switch to Subversive 0.7.5, or follow this advice (so I'm told, I haven't tried yet).

  2. Installing subversion-javahl-1.5.4-3.i386 (on Fedora 10 Rawhide) causes Ant 1.7.1 to fail to do SVN checkouts.
    (from /var/log/yum.log)
    Nov 27 19:51:47 Installed: subversion-javahl-1.5.4-3.i386
    [java] fetchElement:
    [java] #
    [java] # An unexpected error has been detected by Java Runtime Environment:
    [java] #
    [java] #  SIGSEGV (0xb) at pc=0x05984ec5, pid=24986, tid=3086982032
    [java] #
    [java] # Java VM: Java HotSpot(TM) Server VM (11.0-b15 mixed mode linux-x86)
    [java] # Problematic frame:
    [java] # C  [libapr-1.so.0+0x1fec5]  apr_threadkey_private_get+0x15
    [java] #
    [java] # An error report file with more information is saved as:
    [java] # /opt/public/jbt-jbds/nightly-20081128-0002/org.jboss.ide.eclipse.
             releng/builders/hs_err_pid24986.log
    [java] #
    [java] # If you would like to submit a bug report, please visit:
    [java] #   http://java.sun.com/webapps/bugreport/crash.jsp
    [java] # The crash happened outside the Java Virtual Machine in native code.
    [java] # See problematic frame for where to report the bug.
    [java] #
    [java] Java Result: 134
    (from /var/log/yum.log)
    Dec 02 11:19:23 Erased: subversion-javahl

    And now it works again!

2008-11-06

xorg.conf: Fedora edition

After installing a Fedora 10 preview spin on my new Thinkpad X200 last week, I got to learn yet another way to generate and test an /etc/X11/xorg.conf file. Every time I upgrade my OS, my xorg.conf file gets simpler. I expect one day I won't need one at all!

Where in the past for *ubuntu I've used dpkg-reconfigure -phigh xserver-xorg, with Fedora I needed to discover a new way. Here's what I did.

  1. First, run man startx to see a sample /root/.xinitrc file
  2. Next, create a /root/.xinitrc file
     #!/bin/bash
     xrdb -load $HOME/.Xresources
     xsetroot -solid gray &
     xclock -g 50x50-0+0 -bw 0 &
     xload -g 50x50-50+0 -bw 0 &
     xterm -g 80x24+0-0 &
     screenruler &
     twm
  3. To generate a new config file, you can run:
     startx -- :2 -configure
  4. To test a given config file (other than the default, /etc/X11/xorg.conf):
     startx -- :2 -config /root/xorg.conf.new

The above steps let you be booted graphically @ default resolution, then switch to another vt (CTRL-ALT-F2, for example), log in, and try a new xorg.conf on a different video port without affecting your running instance. To kill a trial X, use CTRL-ALT-BkSp. To switch from vt2 to the existing graphical instance, use CTRL-ALT-F1 or CTRL-ALT-F7 (it should be on vt1 or vt7).

Once I was statisfied that the xorg.conf file worked, I rebooted. On restart, using xfce or gnome, I can now graphically switch from laptop @ 1280x800 to 24" external monitor @ 1600x1200, or run both screens at 1024x768, eg., for presentations.

2008-10-16

Password management with ccrypt

Intro
Server
Client(s)
About ccrypt

For the past few years, the list of passwords I use for all the various websites, servers, and applications has been growing ever longer. Some people limit themselves to 3-4 passwords, or a handful of formulas for password generation. I used to do that, but it's insecure, and when you control the fate of numerous servers, it's irresponsible. These day, I generally create new passwords at random, and replace them every 3-4 months.

Every flavour of linux has its own system for managing passwords; for example, KDE has KWallet; Gnome has Keyring. Tuesday I started playing with Fedora for the first time in years, and discovered yet another way: System > Preferences > System > Authorizations (polkit-gnome-authorization). And, of course, even Mozilla (Firefox, Thunderbird) handles password management like this... but each application has its own repository, and each one will get out of sync in time.

So, for a password management system that doesn't care about window manager, application, or even OS (this works with under cygwin on Windows, too), I've designed my own method.

How do you remember 100s of passwords which have nothing in common? Store them in a database, encrypted by a passphrase/password, then use a simple query engine to retrieve them.

Here's how it works, and how you can set up something similar.

Home Server / CVS Server

First, define these 3 scripts.

  1. /home/user/passwds/PWget.sh
  2. #!/bin/bash
    dir=/home/user/passwds;
    mkdir -p $dir;
    echo -n "Retrieve latest? [y/N] "; read yn;
    if [[ $yn == "y" ]]; then
     scp user@home-server:$dir/passwds.cpt $dir
    fi
  3. /home/user/passwds/PWsearch.sh
  4. #!/bin/bash
    file="/home/user/passwds/passwds.cpt";
    ccrypt -c $file | grep -i "$1";
  5. /home/user/passwds/PWedit.sh
  6. #!/bin/bash
    file="/home/user/passwds/passwds";
    ccrypt -d $file.cpt; vi $file; ccrypt -e $file

Next, define 2 aliases -- one for password lookup, and one to modify the encrypted password file. I use ~/.alias, which I load as part of my ~/.bashrc file.

  1. /home/user/.alias
  2. alias PW='/home/user/passwds/PWsearch.sh $1'
    alias PWE='~/PWDs/PWedit.sh'

Now, on the home server, I can run `PW eclipse` to decrypt the file, look up any lines in the password file with "eclipse" in them, and return those entries to me. Or, I can run `PW | more` by itself to display the entire file (paged with `more`). To modify the file, I use `PWE` to decrypt, edit, and re-encrypt the file. I also periodically save this file into my CVS repository (cvs add -kb passwds.cpt; cvs ci -m "" passwds.cpt) so I can track changes.

Remote Client(s) / Other Servers

Well, you think, that's great for a single system, but I need my passwords on 3 or 4 different systems. Plus, my home server may or may not always be accessible (eg., only when I'm on my home network).

So, once again, we start with the same three bash scripts.

Next, define a different version of the `PW` alias:

  1. /home/user/.alias
  2. alias PW='/home/user/passwds/PWget.sh;/home/user/passwds/PWsearch.sh $1'

Now, on any other server which can reach the home server over ssh, `PW eclipse` can be used to (optionally) retrieve the latest version of the password file, then search it as in the example above. Can't reach the home server? That's fine, we keep a local cache of the encrypted password file -- good enough until the next synch.

Voila! Centralized encrypted password management for Windows & Linux clients!

About ccrypt

So, what handles the encryption, and how secure is it?

ccrypt is based on the Rijndael block cipher, which was also chosen by the U.S. government as the Advanced Encryption Standard (AES, see http://www.nist.gov/aes/). This cipher is believed to provide very strong cryptographic security.

 

If your linux or cygwin distro doesn't include ccrypt in its repositories, here are a couple places you can find it: