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

Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

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

2010-01-12

Beyond Compare 3 for 64-bit ubuntu linux

Last week, I switched my xubuntu 8.04 (Hardy Heron) box to Linux Mint 8 (Helena), to see how things had evolved in the past 18 months. Unfortunately, I also decided to switch from 32- to 64-bit, and of course not everything works the way it used to.

Luckily, the good folks at Scooter Software pointed me to this hack to allow their 32-bit Linux flavour of Beyond Compare 3 to find the 32-bit libraries it needs to run.

So, here's an updated version of that hack for ubuntu 9.10 Karmic Koala or Linux Mint 8 Helena:

  1. Download the i386 libqt3-mt .deb package into /tmp
  2. Download the latest Beyond Compare 3 .deb package into /tmp
  3. $ sudo su
  4. apt-get install ia32-libs
    cd /tmp; dpkg-deb --extract /tmp/libqt3-mt*.deb libqt3-mt
    cp -R libqt3-mt/usr/lib/* /usr/lib32; rm -fr /tmp/libqt3-mt
    dpkg -i --force-architecture /tmp/BCompareLinux*.deb

2009-07-06

Learning to Love the Mac: 13 Tips

A month ago a very large package arrived in the mail: my first MacPro server. I at once fell in love with the case design - clean, simple, and dead-easy to take apart in order to add more drives and RAM. However, that's where the love boat ran aground.

To say it's been a gradual learning curve would be an understatement. Here are a few things I've learned over the past month of dealing with Mac hardware and OS, as well as retraining my fingers to use Mac keyboard bindings (META = Apple Key or Windows Key, depending on your keyboard).

  1. Use META-TAB instead of ALT-TAB to cycle applications
  2. Use META-LEFT/RIGHT instead of HOME/END to jump to start/end of a line
  3. Use ALT-LEFT/RIGHT instead of CTRL-LEFT/RIGHT to jump to prev/next word on a line
  4. META-A, META-X, META-C, META-V replace CTRL-A, CTRL-X, CTRL-C, CTRL-V for select all, cut, copy, & paste. META-L, META-T, META-N replace CTRL-L, CTRL-T, CTRL-N (jump to location bar, new tab, new window). But CTRL-TAB still switches tabs. However, if you have multiple Firefox windows open, there is no way to toggle between them with the keyboard. Same problem with multiple Terminal windows. META-TAB only switches between groups of applications, but not windows within an application.
  5. Sometimes ESC works to dispose a dialog; sometimes only clicking the red X works.

  6. Q replaces qemu, but doesn't seem to work very well for my existing vmware or Virtual Box images
  7. Virtual Box rocks on Windows, Linux and Mac

  8. XCode provides gcc, make, etc.
  9. Fink and DarwinPorts replace Debian/Ubuntu's apt-get and Gentoo's emerge, respectively. Once XCode and DarwinPorts are installed, you can port install vpnc (to fetch deps and compile on the fly) or apt-get install curl (to fetch deps and install).
  10. rEFIt replaces grub, and more or less works as I'd expect. /efi/refit/refit.conf approximately replaces /boot/grub/menu.lst at least as far as picking what partition to default-boot and how long to wait

  11. Java is in /System/Library/Frameworks/JavaVM.framework/Home instead of /opt/ or /usr/lib/jvm/java
  12. Subversion was easier to set up on Mac (using Fink) than on Fedora 10 (using yum), especially since there's now the Galileo+ Update Site from Cloudsmith so you don't have to download from multiple update sites to get it installed.
    However, the version of Subversion available via Fink doesn't work with projects checked out using Eclipse - seems that the commandline client (Subversion 1.4.4) and Subversive with SVNKit (SVN 1.6.1 w/ SVNKit 1.3.0.beta.r5741) are not compatible: svn: This client is too old to work with working copy '.'; please get a newer Subversion client. Using DarwinPorts to update the subversive client to 1.6.3 fixed this issue, but installed it into a different path (/opt/local/bin instead of /sw/bin or /usr/bin).
  13. Eclipse looks better on Mac than on Linux; however, I recently stumbled across a great tip for making Eclipse waste less screen space under gtk on Linux. Highly recommended bit of gtk hackery - one file makes a world of difference!
Do you have any other tips for Linux or Windows people, surviving the transition to Mac OSX? Is there any way to tell OSX to use Windows or Linux keyboard defaults so I don't have to retrain myself?

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.

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:

2008-07-22

xubuntu 8.04: easy enough for grandma

I'm in love with the newest ubuntu for xfce, xubuntu. So much so that I've decided to install it on my mother-in-law's desktop (which keeps getting virii and trojans). Yes, it's really that grandma-friendly. (Time will tell whether I'm on crack or if they agree.)

However, I have a few minor complaints -- the usual "close-but-no-cigar" usability tweaks.

1. If you log in two users in parallel (it lets you switch between them) for some reason there's a pc speaker (system bell / system beep) every couple seconds once the second user logs in. This is of course incredibly annoying, but there's an easy fix.

First, disable it:

modprobe -r pcspkr

Then, turn it off for good by blacklisting the pcspkr module in /etc/modprobe.d/blacklist:

blacklist pcspkr

2. I immediately installed OpenOffice 2.4 (because abiword and gnumeric suck) and upgraded the Firefox 3 beta to the full release.

3. I also combined the two default taskbars (top and bottom of screen) into a single one on the bottom, because that's less weird for Windows people.

4. I had to manually force mounting of their old C and D drives (in /etc/fstab), just in case they need them. Thunar is great for adding quick shortcuts into the file browser (see screenshot below).

/dev/sda1 /media/sda1 vfat rw,noexec,nosuid,nodev,quiet,uhelper=hal,utf8,shortname=winnt,uid=999,gid=100,umask=007 0 0 /dev/sda3 /media/sda3 vfat rw,noexec,nosuid,nodev,quiet,uhelper=hal,utf8,shortname=winnt,uid=999,gid=100,umask=007 0 0

5. I had to add the volume control applet to the taskbar. Sure, having to add it is nowhere as annoying as having to remove MEPIS/KDE's fish tank app, but c'mon -- shouldn't this be there by default?

6. Firefox doesn't come with the Flash player pre-installed, for obvious licensing reasons. However, the latest Firefox, combined with the latest xubuntu, lets me install the whole thing without having to revert to apt-get or tar -xzf. Finally, the Plugin Finder Service in Firefox actually works! It finds the plugin, prompts for password (to run the install as root), downloads it, and installs it. And on restart of Firefox -- YouTube works.

But other than these minor tweaks, it's pretty much xubuntu out of the box, and a viable replacement for Windows XP and its non-stop barrage of virii & trojans.

Because really, what does your grandma need on a computer? Firefox, Thunderbird, OpenOffice, a file browser like Thunar, and of course, some card games (thanks, PySol!).

2007-12-04

Eclipse Development All-In-One

I'm shocked. Check this out:

Twelve per cent [of those companies surveyed] said they focussed “exclusively” on .Net development while an additional 49 per cent focussed “primarily” on .Net. Only three per cent of enterprises were exclusively Java shops, while an additional 20 per cent focussed “primarily” on Java.
...
But as more companies adopt Microsoft Exchange as their messaging software and SQL Server as their database, the decision to use .Net develop tools is “almost a no-brainer,” Goodall said. (source).

This seems counterintuitive to me. Sure, there's entrenchment. Sure, there's comfort in using Microsoft products as for most people that's who provides their operating system, office tools, and mail software. But c'mon, which companies did they survey? I'd love to find out but I can't find a copy of their survey results online, and even if I could I'm not about to cough up $150 - $990 for a 200K PDF file. Begs the question -- who commissioned this report, and how deep are their pockets? IMHO, there's a fine line between market research and marketing.

Or... is it possible that OSS people just don't have time to answer surveys because they're too busy contributing to their community? ;-)

Pointed pontifications aside, perhaps the real point here is that Microsoft does a better job at selling the 'one stop shop' idea of operating system + office tools + database + mail tools + mail server + dev platform. Sure, all of that is also available in the FLOSS / LAMP world, but are we failing to market it it as a cohesive offering? Is it still too disparate, too complex?

And has anyone thought of building an ubuntu + Ganymede self-contained offering? I know there's some cool virtual appliances out there, such as Grandma's LAMP, but AFAIK there's never been an attempt to bundle Eclipse w/ an OS for an all-in-one offering. Now that there's an Eclipse Store and an Eclipse Donations site, isn't it time for some Eclipse DVDs to complete the trifecta? Along with the new EPP bundles planned for next July, wouldn't it be cool to have an Eclipse Ganymede + ubuntu 08.04 Distro DVD? A collector's item, for sure.

Oh, and with the advent of the EMF4Net proposal (yes, that's EMF for the .Net plaftorm), this all-in-one DVD would also allow people to develop C# apps as well as Java. And php. And perl. And ruby. And python. And C/C++. Whoops, there we go again with too many choices. ;-) Once again, maybe Microsoft continues to dominate mindshare not because they're better or more entrenched, but out of a sense of simplicity.

So, here's my new mantra:

Simple is sexy.
Options are overwhelming.

Agree? Disagree? Post your thoughts here, or blog them and/or link here. I'd love to know your experiences as a customer or as a vendor, as a client or as a developer.

2007-11-03

Lies, damned lies, and a side order of acronym soup

By my calculations, EMF has scored over 2 million download requests since 2006-01-01. That's a huge number, but it's also an inaccurate number because our stats gen was broken for a while so there's a big hole in the Update Manager download stats. As such it's probably much higher, given the traffic we've had since the stats tool was fixed.

Looking at the overall numbers for all the tracked Modeling projects, we've had 5 million download requests since 2006-01-01 for EMF + M2T + MDT ... and that's just the Update Manager requests!

It's also fun to see who's downloading our bits. As expected, the US tops the chart, with Canada a respectable 8th. To get a sense for where EMF is used consider where the following projects are developed:

  1. US: GMF, M2T-JET, WTP, TPTP, VE, ...
  2. China: MDT-EODM, TPTP
  3. France: EMFT, MDDi, M2M, GMT
  4. Canada: EMF & EMF-QTV, MDT (UML2 & OCL), M2T-JET, GEF, GMF, WTP, TPTP, ...
  5. The Netherlands: EMFT-Teneo
  6. Czech Republic: GMF, MDT-UML2 Tools

To paraphrase Ed and the Zulu people, "umuntu ngumuntu MDD!" ;-)

2007-10-14

Video Codecs & Unpacking Script

BitTorrent a lot?

Annoyed at always having to unrar, move the resulting video file, then move the source folder out of your incoming folder and into your 'ready to be deleted when share ratio is > 1' folder? (I use > 3.) I am. Here's a quick unpack script for doing the above in one simple command. Works with foo.rar and foo.part01.rar as the input file.

Secondly, do you find sometimes you can't play the videos you've downloaded? Or you try to share them with someone, and they work great for you but that someone can't play them? Here's a quick list of places to get a/v codecs/players for Windows. You may not need all of these, but if you can't play audio or video, try these. As always, YMMV.

  1. Install updated Windows Media Player & DivX Codec/Player Bundle
  2. Install codecs from c|net: [1], [2], [3] and Nimo

For linux users (*ubuntu, debian, etc.) see these walkthroughs for installing libdvdcss and w32codecs: [1], [2], [3].

2007-10-13

Linux in the Mainstream

You know Linux -- well, ubuntu, anyway -- is gaining mainstream acceptance when it gets a nod on a show like Veronica Mars.

Meanwhile, here's a collection of some Linux / "I'm a Mac..." spoof ads:

2007-10-10

Ubuntu 7.10 is coming