Posts for Monday, August 3, 2009

A week of bash scripts – Crush


Header

Hello blogweb. This week I’ll be posting some of my bash scripts that I use on a regulare basis. I’m not sure I’ll get to every day but I’ll do what I’m able. With that:

Crush

I tend to do quite a bit of compressing files for uploading and I cannot always seem to remember the options and order of those options that tar needs. So I built a bash script that does it for me. I call it Crush and it’s syntax is basic:

crush <file1> <folder>… <archive-name>

If no archive name is given, crush will use the name of the last file entered.

#!/bin/bash # crush - archive and compress file/folder(s) # Extract last parameter (archive filename) for variable ARCHIVENAME="${!#}" # Remove last paramerter (archive filename) for file/folder list to compress length=$(($#-1)) FILES=${@:1:$length} # Usage - display usage if no parameters are given if [[ -z $@ ]]; then   echo "crush <file> <folder>... <compressed-name>.tar.gz"   exit fi # Tar the files, name archive after last file/folder if no name given if [[ ! -f $ARCHIVENAME ]]; then   tar -czvpf "$ARCHIVENAME".tar.gz $FILES; else   tar -czvpf "$ARCHIVENAME".tar.gz "$@" fi
avatar

Desktop Theming & Panels

Recently I’ve spent some time playing around with the theme and panels I use. I haven’t changed much from what I’ve been using for a while, but there were a couple of subtle changes.

Here’s what I’ve ended up with, on my laptop at least (from the default Ubuntu 9.04 settings):

  • Industrial Tango theme (apt: industrialtango-theme).
  • Compiz desktop wall, expose and scale plugins.
  • Reduced font size to 8pt for everything except window titles which is 9pt.
  • System monospace font set to Terminus (apt: xfonts-terminus).
  • 6 virtual desktops (3×2 grid)
  • Auto-hide bottom panel, which contains only a window list. Other panel items from here either get removed or moved to the top.
  • Customised applications menu, as I have some software not installed with APT.

It’s intentionally quite minimalist since I don’t like a lot of visual clutter. The window list is fairly redundant since I use the expose/scale plugins or alt+tab most of the time – hence the panel gets hidden. I have 6 virtual desktops for two reasons: I often have lots of windows open and to reduce the impact of being on my laptop and hence without 2 screens.

I’m still undecided as to whether I prefer the theme to be light or dark overall, especially having seen the Ubuntu Dust theme, however for the moment I’ve settled on light.

Here are some screenshots (click to view full size):

Clean:

desktop-clean

Busy:

desktop-busy

Expose:

desktop-expose

Scale:

desktop-scale

Making image thumbnails in Clojure

I'm making a new website (in Clojure of course) and I have a need to resize uploaded images to make thumbnails. At first I tried to use JMagick because I'm familiar with ImageMagick already and it seemed like an OK library. But on the crusty old OS my VPS uses, I had a really hard time getting it to build, and even once it built it started segfaulting like mad.

Should've gone with something simpler first. Java has built-in libraries for this. It only took a few seconds to adapt this code on Stack Overflow into Clojure code.

(use 'clojure.contrib.java-utils)
(defn make-thumbnail [filename new-filename width]
  (let [img (javax.imageio.ImageIO/read (as-file filename))
        imgtype (java.awt.image.BufferedImage/TYPE_INT_ARGB)
        width (min (.getWidth img) width)
        height (* (/ width (.getWidth img)) (.getHeight img))
        simg (java.awt.image.BufferedImage. width height imgtype)
        g (.createGraphics simg)]
    (.drawImage g img 0 0 width height nil)
    (.dispose g)
    (javax.imageio.ImageIO/write simg "png" (as-file new-filename))))

Slow Window Resizing with KWin Compositing on FGLRX

Amongst users of the proprietary ATI driver (FGLRX), it’s a well known problem that KDE4’s KWin’s desktop effects are unusable due to turtle slow window resizing. Unfortunately, bug reports and forum posts fail to come up with a clear answer as to why this happens, who is responsibility for fixing it, and which parts of the stack need to adapt for the bug. If you’re not already familiar with the problem, observe:


Direct YouTube Link

As you can see, the three second delay in window resizing, maximizing, and (perhaps) restoring makes compositing-enabled KWin unusable. Note that the problem still persists when disabling the “show window content while resizing” option.

It’s been particularly difficult to track down the route of this problem and who should be fixing it. From a lengthy discussion on Phoronix’s Forums, ATI’s “Bridgman” user acknowledges the problem but claims “It’s not a driver issue AFAIK, so not sure why we would mention it in the release notes.” He goes on to indicate that the problem was introduced during a hack to ensure KWin compatibility on Intel cards, to work around a glitch with garbage appearing on the screen, and a lengthy debate over the “107_fedora_dont_backfill_bg_none.patch” patch. Somewhere the stack was patched to support Intel cards at the expense of ATI cards, according to ATI’s “Bridgman”.

Over on the KDE bugzilla, we’re met with a curt response from the KWin team: “Driver bug then.” The bug is marked as “RESOLVED” and “UPSTREAM”.

And elsewhere on the Internet, we get a helpless string of “still not fixed” messages, over on the unofficial FGLRX bugzilla, other Phoronix forum posts, and distro forums.

So I ask my readers: who is responsible for this bug and how will it be fixed? If indeed it is neither FGLRX nor KWin and the problem exists in XOrg, why has XOrg been patched to support Intel cards at the expense of ATI cards? Is there anything FGLRX or KWin could be doing to mitigate the problem? Potential workarounds? Users have complained of this problem for over a year now perhaps, but not once has leadership from anywhere offered a compelling explanation or plan for the future. What to do?

Leave comments. The current discussion seems to be fruitful.

Posts for Sunday, August 2, 2009

Better Fox, Cat, and Weasel


Header

When I get my Firefox (Icecat, Swiftweasal…) up and running these are the tweaks I do get Firefox performing how I like it.

about:config

A few of these changes can be done in Firefox’s configuration page. Type ‘about:config‘ in the address bar to get to it.

Disable accidental middle clicks

Firefox by default will open a page in a new tab if you middle-click a link. However if you got something in the register (clipboard) and miss the link Firefox will try to load whatever is in the clipboard and you will usually get a “Firefox cannot find the page” message. To disable this set:

middlemouse.contentLoadURL false

New tabs loaded in the background

browser.tabs.loadDivertedInBackground true

External editor to view html source

view_source.editor.external true
view_source.editor.path /path/to/editor

One click to select all in address bar

browser.urlbar.doubleClickSelectsAll false
browser.urlbar.clickSelectsAll true

Disable zooming of images

Though I like the proportionality of images that zoom with text I often just need to read the text.

browser.zoom.full false

If the DPI for your monitor is lower than 96 DPI:

layout.css.dpi 0

Add-ons

I generally don’t add add-ons to keep my firefox light but there are a few I can’t do without, the first primarily being:

NoScript

NoScript blocks javascript by default. Blocking javascript will disable Flash, roll-over text adds, and alot of things. While javascript can be very useful it can also expose vulneralbilities (like the Firefox 3.5.0 exploit bug). I find it best to to use NoScript and then just allow the javascript I need.

Find Toolbar Tweaks

When I search a page I like all the matching text to be highlighted, Find Toolbar Tweaks does that.

Highlight Focus

I have a problem on when I switch back to Firefox of typing ‘/‘ to look for text on a page but often the focus is in the address bar or the search bar. While I have never found a way to fix this Highlight Focus will highlight the current text box in browswer box itself.

Everything together:

Thanks to all this week that helped to find all these things, and made my life better :) .

Posts for Saturday, August 1, 2009

Being a computer hobo

Being a homeless geek (i.e. without my own computer) is neither fun nor easy, but there's a few tricks that I learnt on the way. Here I'll try to share a few that I can remember of and comment them as well.

Most of the time my dad lends me his (Windows XP, brrr) laptop, but of course I cannot expect this to be true all of the time, so I had to find a solution that would a) let me move my data from different computers if needed and b) leave my dad's computer as clean of my clutter as possible.

Then I found (again actually, but forgot about it) PortableApps because they were nominated for sf.net's community awards. What they do is take FOSS programs, hack them so they're both smaller and that they store all their settings, cache and other files on the USB key itself. And this is all bundled into a menu launcher that can be ran under Windows.

The first try I gave it was quite pleasant, but on my little 256 MiB USB key I couldn't fit OpenOffice, if I wanted to have space for other applications on it and some for my documents as well. So when Ike (a friend of mine, co-geek and co-lawyer) gave me a spare 1 GiB key, I quickly formatted it and installed more apps on it, including OpenOffice Portable and for the moment use that as my primary

All in all I'm quite happy with the solution. It's relatively elegant, not too wasteful of resources and it's surprising how much apps you can fit on a stock USB key!

Here's what I currently have on it (with comments):

  • 7-Zip (compressing tool) -- so far managed to work with everything that I could throw at it, but the GUI leaves a bit to be desired
  • CoolPlayer+ (music player) -- reminds a lot of early WinAmp and XMMP; doesn't seem to have many features, but works; the on-top, minimal/shaded view brings back nostalging memories ;)
  • Cornice (picture/album viewer) -- small and simple image viewer; again works, but don't expect a DigiKam, Gwenview or Picassa killer
  • DOSBox (DOS emulator) -- heh, I felt like playing some of my old DOS games ;]
  • Firefox (web browser) -- I still miss my Konqueror, but it's nice to have a pimped up FireFox to carry along with all the bookmarks, history and plugins
  • GIMP (image manipulation tool) -- the Windows version of GIMP, 'nuff said
  • Infra Recorder (CD/DVD burning tool) -- I haven't had time yet to test it, but from the looks of it, it seems quite nice; actually seems a lot nicer then most "free" (as in beer) burning tools for Windows
  • MPlayer (video/media player) -- the GUI looks rather ugly, but I've seen worse; otherwise works quite nicely; so far I didn't have any problems with the bundled codecs (I did with Windows Media Player though)
  • Notepad++ (text editor) -- rather advanced text editor; has tabs, syntax highlighting and plugins; I still like Vim and Kate a lot more, but I'm quite happy with it
  • OpenOffice (office suite) -- the whole OpenOffice packed into a small package; works just nicely; I could open my ODT files that I made in KOffice almost perfectly (one tabulator was missing, content and styling was fine), while when I tried AbiWord, it was completely garbled
  • (IM client) -- I'm usually using Kopete and Konversation (or Finch and Irssi when in the console), but I found using Pidgin for IM on Windows to satisfy my basic needs and runs nicely all the protocols I use; IRC-wise it shows the downsides of pretty much all IM clients that support IRC
  • PNotes (sticky notes) -- similar to KNotes, but it's harder to manage notes in it; does it job, but not sterling
  • PuTTY (SSH/Telnet client) -- essential for accessing the server; works like a peach
  • SpeedCrunch (advanced calculator) -- great calculator; exceeds my needs, but has all the features I need; I use it under GNU/Linux as well
  • SumatraPDF (PDF viewer) -- small and simple; so far opened all PDF I needed; GUI is not too nice and the full-screen shortuct (Ctrl+L) is not the most logic IMHO
  • Thunderbird (+ Lightening plugin) (e-mail/RSS reader + PIM) -- not bad, but still like KMail and the whole Kontact in general a *lot* better; handling mailing groups and filters is still inferior to KMail; e-mail scam prevention is a nice touch; RSS doesn't seem to be too predictable at times and is hard to organise; it's great that it has OPML import though, so I could just import my backed up Akregator list; adding events and tasks doesn't feel nice, although I like the time selection menu; overall the PIM bit feels quite rough, but it gets the job done I suppose
  • WinSCP (FTP/SCP client) -- essential to up- and down-load files to and from servers and other boxen via SSH or FTP
  • Xenon (file browser) -- small, tabbed browser; slow; pop-ups not informative enough (e.g. on deletion, copying etc.)

Also it'd be great if PortableApps would tweak the apps so that if they'd see that certain apps are also installed on the USB key that it would default to opening the according MIME types with the portable apps instead of locally installed ones. One such annoyance is that I cannot seem to convience Thunderbird Portable to open HTTP links in Firefox Portable, instead of the one installed on the laptop's harddrive. It'd be also great if it was possible (probably I just don't know how) for the user to tweak the PortableApps menu to e.g. manually remove all the OpenOffice component entries and just leave the OpenOffice suite entry.

The music I still get mainly from Jamendo and lately BlocSonic, so with the above tools and the free content online (and backups on SpiderOak) I somehow made myself a small shed on my lil' USB key, until I find a new home.

hook out >> going to bed

P.S. Another cool project (that sadly didn't win) is RepRap -- a FOSS powered and following FOSS principles 3D printer.
<!--break-->

Posts for Thursday, July 30, 2009

avatar

New Blog Engine, take N + 1

I have, once again, decided to switch blog engine, and this time I changed from the horrible Ikiwiki to the (so far) very nice Jekyll and my blog is now located on Github instead of in my developer space on one of the Exherbo servers.

One of the important requirements for the blog engine is that I should be able to create, edit and remove posts via my favourite editor (Vim) and my favourite SCM (Git), and Jekyll is doing a very good job at this so far.

It was fairly trivial to setup and I was being lazy and decided to just use the style sheets from my personal website, so the only things left to do was to create a couple of templates and wait a couple of hours for Github to do the initial page generation.

Another very nice feature of Jekyll is that it supports code highlighting via the Python library named Pygments. I tried to get Ikiwiki to do something similar, but after messing around for 30 minutes I decided that it was a waste of time and gave up.

Jekyll should also be able convert inline LaTeX commands into graphics in your posts, but I have no idea if this feature is enabled on Github or not.

Thanks to Ali for the hint about Jekyll. Hopefully I wont hate this as much as I hated Ikiwiki.

Fishing Trip...

So, taking a break from my Ubuntu development, I decided to go on a fishing trip with a friend of mine.

We went to a truely remote community in Newfoundland called Rencontre East. It's only accessible by Ferry, and it's a 3 hour car ride to get to the Ferry. It's an outport fishing town with a population of about 170 according to 2006 statistics, though I believe more recent numbers would put it closer to 120. Primary industry is the fishery - Cod, Caplin, Lobster, and Crab.

Wharves along the Harbour


It is an absolutely beautiful place to visit. The mountains and valley were forged by a glacier, and there is a fiord (lake) nestled between the mountains, which is 600 feet deep. The lake is home to sea trout and salmon, and possibly other species. Our desitination was to a small cabin at the far end of the lake, and required us to take a boat from the coastal side of the lake to its head.

Heading up the lake


We fished along the way, using a locally made spinner called a spoon spinner. It seems to be the only thing that works in this lake, for the majority of the fishing done here. We managed to catch 13 trout that afternoon, before finally setting foot on the far shore and the beach in front of our cabin.

Cabins on the beach


The next day, we had trout for breakfast, and they were quite a treat. There is nothing better than enjoying the fruits of your labor. After breakfast, we got geared up for a trek around the lake by foot. We have to cross two shallow rivers, as we trek to the left of the cabin, and around the lake. It's rough going, as the shoreline is peppered with fallen rocks and boulders from the sheer rock faces above. As well, there are many natual springs and spectacular waterfalls.

One of the many waterfalls


We fish along the coast for about 4 hours and it starts to rain. My friend is a short distance ahead of me, at what the locals call Duffy's point, while I have sought out the protection of a small overhang of rock, where I make a dry place to sit and have a snack while the rain falls effrortlessly on the lake. My friend makes his way back to my semi-dry shelter, and we enjoy a drink and some home made trail mix. We discuss my inability to land any trout today, and his many catch and releases and the 3 keepers he has so far. I am feeling a bit dismayed to say the least.

Not a Keeper, but funny none-the-less

After the rain let's up, we decide to turn back for the day, and fish our way back to the cabin. Part way back, I stop at a spot where I know there should be some good fishing. Since I'm not having any luck with the spinner, and I' tried every lure I have, I decide to try a plain old bobber and worm. The locals warned me that this never works and you can't catch anything without a spoon spinner here. So far, that seemed to be the case, but I was real desperate to not be shown up.

So, I set up my line and cast. No sooner than the line hit the water and I had a strike and lose it. Followed by several others, that I cannot land. My friend sees that I am now sitting on a rock and not following him back. I motion him to wait or come back, which he does the latter. By the time he get's back to me, I have landed my first keeper for the day. It's not huge, but it will do. We stay a bit longer and eventually I catch another worth keeping. So, you can catch by bobber here.. wish I had tried this earlier today.

Eventually, we get moving again, and after a total of 6 hours walking and fishing, we are back at the cabin. We set a fire and prepare a meal of chicken and some bottled moose. We play some cribbage, anbd have a few drinks before finally retiring for the night.

The next day, we plan to fish for the morning and then we will boat back to the other end of the lake and back to town. We had an offer to go out on the ocean and jig for Cod fish, and we are quite looking forward to this. The mornings fishing was uneventful, and my friend managed to land one trout, while my line lay bare. At least we had Cod jigging to look forward to.

While we never caught many trout, the trip was amazing. Anyone looking to get a real outport experience, simply must travel to Rencontre East. The people are super friendly, and the scenery is awe inspiring.

Posts for Wednesday, July 29, 2009

Vi(m) Reference Card


I use the Vi Reference Card all the time but I seem to have lost my copy and since my printer is broke I decided to make an html version of it:

Vi(m) Reference Card

New TACACS+ (tac_plus) server package

Over the last couple of weeks I have been working on packaging, testing and patching a TACACS+ server to work with Ubuntu Server.

I figured it was time to post up a quick blog about this package, and hopefully see what interest there was out there for this service.

What is TACACS+ and what does the tac_plus package provide?

TACACS+ (Terminal Access Controller Access-Control System Plus) is a protocol which provides access control for routers, network access servers and other networked computing devices via one or more centralized servers. TACACS+ provides separate authentication, authorization and accounting services.

This package provides the server (daemon) for TACACS+ which responds to authentication requests from a RAS (Remote Access Server). The daemon will validate the request against an SQL database, and provide authorization and the level of access, if the authentication passes. The RAS can also provide accounting information to the daemon, for logging purposes.

Please note, there are other implementations of the TACACS+ protocol out there, some of which are unmaintained. This particular version is maintained and is a complete re-write of the TACACS+ daemon from Cisco Systems, and has been implemented in C++. It is under heavy development, and there may be some bugs or missing features in this release. I am working with the author to ensure these things get properly reported and addressed as they are discovered.

Where is this package available for testing?

It is currently in beta testing in my PPA: https://launchpad.net/~roderick-greening/+archive/ppa

Where can I get the source?

The source is currently hosted at http://www.networkforums.net/, and you will need to register for an account to access the download area. I am working with the author to get this hosted in a proper prepository like sourceforge, github, launchpad, etc. Please be patient while we work these details out.

The Web UI for configuration is not yet packaged. You will need to get the tgz from main site until I get it packaged.

Why this version and not some other?

1) Fairly new project
2) Active development and maintenance
3) C++ :)
4) Has a Web UI for configuration (to be added to package shortly)
5) Uses a db to store configuration and AAA logs rather than plain text files

Anyway, feel free to test it out. Also, please give me feedback on how this works for you. Remember, you need to get the Web UI tgz after installing this package and set it up. Hopefully, I'll get this packaged in the next week or so, time permitting. There is a man page (man tac_plus) and a readme (README.Debian) which should help in getting things up and running.

Posts for Tuesday, July 28, 2009

C++ Const Curiosity


GCC will accept the following (look closely at S::f’s signature in both places):

struct T
{
    void foo()
    {
    }
};

struct S
{
    void f(const T);
};

void
S::f(T t)
{
    t.foo();
}

int main(int, char *[])
{
    T t;
    S s;
    s.f(t);
}

The question is, should it?

Update: and the answer is, yes, it should, according to [dcl.fct] in the standard. This is both useful and annoying.

Posted in hate Tagged: c++, cplusplus
avatar

Artec DVB USB in Linux

So I unboxed my Artec TV tuner card, now I have to get it working!

You need firmware and kernel modules. You can download the firmware for it here:
http://www.wi-bw.tfh-wildau.de/~pboettch/home/files/dvb-usb-dib0700-1.20.fw

Use wget or some way of getting it. Then move the file to /lib/firmware.

You also need the v4l-dvb kernel drivers (compatible with kernel 2.6.16 and up). In Gentoo, emerge media-tv/v4l-dvb-hg. Other distributions have instructions here.

Now insert the card. udev will handle loading the correct modules. My syslog output looks like this:
usb 1-3: Product: ART7070
usb 1-3: Manufacturer: Ultima
usb 1-3: SerialNumber: 001
usb 1-3: configuration #1 chosen from 1 choice
dvb-usb: found a 'Artec T14BR DVB-T' in cold state, will try to load a firmware
usb 1-3: firmware: requesting dvb-usb-dib0700-1.20.fw
dvb-usb: downloading firmware from file 'dvb-usb-dib0700-1.20.fw'
dib0700: firmware started successfully.
dvb-usb: found a 'Artec T14BR DVB-T' in warm state.
dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
DVB: registering new adapter (Artec T14BR DVB-T)
DVB: registering adapter 0 frontend 0 (DiBcom 7000PC)...
DiB0070: successfully identified
input: IR-receiver inside an USB DVB receiver as /class/input/input7
dvb-usb: schedule remote query interval to 50 msecs.
dvb-usb: Artec T14BR DVB-T successfully initialized and connected.
Look for a line similar to dib0700: firmware started successfully. If you see Cannot find firmware file then make sure you downloaded the firmware properly, and check your system's firmware directory. Also check the firmware file name, as it might want a slightly different firmware file.

That's it! From there I plugged in an antenna, loaded MythTV, and watched some HD TV!
avatar

SynCE 0.14 in Gentoo

I just tested app-pda/synce-gvfs-0.3 in Gentoo with gnome-base/gvfs-1.2.3. This is the first ebuild for the SynCE 0.14 release (announcement here), and it's available in the SynCE overlay.

synce-gvfs works without upgrading other SynCE components to 0.14. For me, it fixes a gvfs crash when trying to copy files off your device.

Comments welcome :) The rest of SynCE 0.14 will happen eventually :)
avatar

Mass-amateurisation of the Internet

I cannot pretend it isn’t a commonly known fact that the Internet (and technology in general) has led to the mass-amateurisation of many professions – journalism has become blogging, we see photography websites, animation portals due to the advent of Flash, writers, graphic and sound artists, and of course 10 year old programmers.

I recently arrived in Jakarta to visit my relatives. In Jakarta and most Asian countries it’s quite normal to have a maid in the house. They are treated much as part of the family and are normally full-time. The maid in my aunt’s house has a boy around my age and a baby girl who loves to play hide and seek with me – or maybe she’s too scared to come out all the time. The maid’s name is “L”, mainly because I feel it disrespectful to call her “the maid” in this post – she is a very pleasant person.

Anyway, I had some free time and so I opened up my laptop. Unable to get online just yet I decided to start up my local server and began coding a new feature into Eadrax. P, who is L’s son wandered into the room and peeked at my screen. I had just switched to a new tab in Firefox and was testing out some MySQL queries in PHPMyAdmin. Without a moments hesitation he said:

“Dion, itu SQL iya?”

Translated into English, this means:

“Dion, that’s SQL, yes?”

You have to understand that he has never owned his own computer (until very recently I was informed). He  is unfortunately not privileged to have high-end education, and only pops into the Cybercafe once in a while to “learn how to use the computer” for his university course – unrelated to computing. And of course, he’s 17.

Further probing found he had two blogs (here and here), knew some Windows command prompt commands, knew about SQL injection (uhhh – well…), knew about Linux and Ubuntu, and was quite familiar with the concept of ripping off HTML codes (or any client-side visible code really) to implement in his own fashion.

I’m sorry, but 99% of the people in my school don’t know about SQL injection. I would say 95% don’t know any command prompt commands of any sort (well, knowing `ping` or `ipconfig` doesn’t count), 80% don’t know how to rip and implement source code, 60% won’t know about Linux, let alone Ubuntu, and well – I guess only 50% don’t have a blog of some sort.

Talk to the average government school student and you would find those percentages skyrocket – except for the blog one maybe.

There is of course the chance that I have stumbled upon an irregularity but I do believe that this is a trend we are all underestimating.

Similar experiences, anyone?

Related posts:

  1. Is your ISP causing slow Internet?

avatar

Artec USB DVB-T tuner card

I just purchased the Artec T14BR HD DVB-T TV tuner dongle for turning my old laptop into a MythTV box. It cost $46.90 including GST and postage from Deals Direct.

I now have a High Def set top box, with 80Gb hard drive for (essentially) $46.90. And if I want to make it a twin tuner HD STB, it's just another $46.90.

Here is the picture of the box:


And here are all the contents (note, no aerial, but I knew that):


And finally a close up of the interesting stuff:


The dongle has a window on either side, presumable for the IR reciever in the middle somewhere.

Support for Linux is supposedly good (stay tuned, haha!). lsusb identifies it as "Bus 001 Device 025: ID 05d8:810f Ultima Electronics Corp." The syslog output when I plug it in looks like this:
usb 1-3: new high speed USB device using ehci_hcd and address 25
usb 1-3: New USB device found, idVendor=05d8, idProduct=810f
usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-3: Product: ART7070
usb 1-3: Manufacturer: Ultima
usb 1-3: SerialNumber: 001
usb 1-3: configuration #1 chosen from 1 choice
This isn't "the" laptop, so I don't have any drivers installed for it, hence that's all for now.

I'll let you know how it works in my next post.

Posts for Monday, July 27, 2009

new planet larry design

Many thanks to David Molanphy, my brother-in-law, who designed a new theme for Planet Larry.  I just pushed it live, and it's running on the new server.  Personally, I think it's awesome. :)

I've taken the old theme, which was in a competition by itself to see how ugly things could get, and unceremoniously shot it behind a barn.

Installing an avr cross compiler in gentoo

One could think that this is as easy as

crossdev avr

but it is not, so i write here how I did it for future reference, and hopefully this will also be useful to other people.

The first problem is that it does not check compatibility between toolchain members (binutils, gcc, …). Understandably, this is somehow difficult, and i don’t blame crossdev. The second problem is that by default crossdev install headers, which are needed  for libc, which is needed for gcc… and headers requires gcc… so you have a loop and if fails.

Finally, i needed the c++ part, and by default crossdev only go as far as stage 3 (plain C), so i’m asking him to go farther with ‘-s4′

Finally i did:
sudo crossdev --b 2.19.51.0.8 --g 4.4.1 --without-headers --target avr -s4

Posts for Sunday, July 26, 2009

Paludis 0.38.2 Released


Paludis 0.38.2 has been released:

  • Failures installing qt-core on Gentoo have been fixed.
Posted in paludis releases Tagged: paludis

KDE 4.3 Looking Good

I just installed KDE 4.3 and it's looking good. Some features returned that I was missing. You can now once again display applications by name rather than description in the K-menu. You can now enable a nice kcontrol-like tree-view in the System Settings.

Some things are still missing though... like different wallpapers on different desktops. There are "Activities" which can have different wallpapers, but I can't for the life of me figure out how I'm supposed to be using them. I also lag and/or crash every time I Zoom Out in the cashew, possibly thanks to 3840x1200 screen resolution. I'm going to assume Activities are still a work-in-progress.

I was horrified to open Kopete and see that configuring the contact list window now uses the same completely broken configuration dialog that Amarok 2 uses for their playlist. Oh how I hope someone rethinks this.

There's a new Qt and Plasma theme in KDE 4.3 that looks pretty nice. Overall every release of KDE4 seems to become more stable, more polished, more eye-candy (if you want it).

avatar

The Road to KDE Devland (Moult Edition) #0

Well then. I’ve been motivated by Hans Chen who originally decided to walk the path to a KDE developer and to do my own. For the technophobes, KDE is an actively developed desktop interface (for want of a better description) which is pushing ahead what the desktop is capable. It is also a community for everybody – the programmers, the artists, the PR folks and most importantly, the users.

Somebody once said that open-source will truly succeed when anybody and everybody will have the capability to create the environment around them completely as they see fit. I’m not denying that this’ll result in a lot of crappy environments (or not to my liking) but it basically says contribution shouldn’t be limited to those who mutter binary in their sleep.

I’m going to see if I am able to make this contribution. Let’s start by giving you the case study:

I do know PHP and do web-development. I have coded a black jack CLI game in C++ (well it was a start). I do graphics design and am proficient in The GIMP. I once touched Python but probably have forgotten a lot. I am a student and have no intention of going into programming as a career and have been self-taught. I have no deadlines, no clear goals nor any roadmap for this project, and am always juggling a variety of other projects on the side.

That, sounding quite like the commitment level proffered by most individuals seems like a vague and – well, truly realistic to be honest. I shall post my progress here with no fixed schedule and see how things go along :)

I’m thinking of starting by reading “Accelerated C++” – mainly because whoever thought up that title got the 100% keyword efficiency award for word estate. 2 buzzwords in 2 words. Eeeexceeelent.

No related posts.

Posts for Saturday, July 25, 2009

Best Skins Ever

Best Skins Ever is a great company that provides thin “skins” for all kinds of electronic devices. From cameras to portable gaming devices to cell phones to laptops, Best Skins Ever covers them all.

After my old iPhone case broke and I purchased a brand new iPhone 3GS, I decided that I needed to replace the broken case. I paid $30 for that case at the Apple store and it lasted about 6 months. I was extremely disappointed with its quality. The rubber around the headphone jack was what finally broke, but the rubber around the bottom bezel of the phone was also wearing thin. Overall, it was a bad experience.

And then I ran into Best Skins Ever. I read reviews for their skins and saw not even one negative review of their skins. I read that their skins were reasonably priced, their durability was great, and their customer service was exceptional. I even heard that people who botched their install received free replacements.

These skins are unlike ordinary skins. They contain an adhesive that sticks to your phone permanently, but does not damage the phone when removed. Any attempt to move the skin once it has dried will stretch the skin. Aside from the application process, these skins are perfect.

So I decided to obtain two of them. They had many different options on their iPhone page (which I don’t describe here); and I chose the hardest one to apply (but also the best one once applied). The skins are $7.99 a piece. Much cheaper than $30 for that bulky case that I bought at the Apple store! So I bought two just in case I messed up the first one.

The install process requires that you soak the skin with soapy water, so that you can adjust it as you place it on your device and so that you do not get fingerprints on the sticky side of the skin. Once the skin dries onto the phone, it sticks firmly; all dust and bubbles are permanently trapped in there. I went through the install, not really knowing what to do. Amazingly, I was able to install it about 90% perfectly on my first try. It took me about 5 minutes to put the front screen protector on (it even covers the home button!) and about an hour to situate the back skin. The reason it takes so long is that it wraps around the bezel, around the top SIM slot, and around the bottom charge port.

I ended up with some small bubbles and a bit of blue fuzz stuck behind the back of the phone, but that is no big deal; especially when compared to having no protection at all and ending up with tons of scratches. The screen protector is not as smooth as the plastic screen protectors and it causes a little extra glare at some angles. But the protection that the back receives is amazing. My phone is now thinner than it ever was with a case and it is much more comfortable to hold. It’s great that I can now see the phone in an almost case-less state.

I highly recommend purchasing a BSE for any device that you want minimal protection!

Pictures (although not the best) are located below. As you can see, my install is not perfect. I have some small bubbles (those are not scratches) on the bottom bezel. Also, some of the outer wrappings overlap.

More work on the Git tutorial

Ok, hopefully this will be the last mention of this for a bit. I've gone back and completely rewritten and expanded greatly on my old Git tutorial. It's still at the same place, Mindstab's Git Guide, just with a new name. It still needs lots more work and expanding, which will eventually happen, but probably not right now. As it is it's now good enough to let stand on its own while I get back to cl-pack. It has everything you need to set up a repository and get it on a server in one of many configurations. It just doesn't have a lot on longer term development and multi team management of multiple repositories and branches. Haha, I also recast it as an Alice and Bob story.

Importing a Git tree into a Subversion repository

Recently I worked on some new project, and as always I created a local Git repository as a start. After working on it several days, creating lots of commits, I had to publish it into the central Subversion repository (which is one of the VCSs we got). I could have done this by creating a new folder in SVN and add the latest version of all files of the project to it, but that way all history would be gone, which I didn’t like.

Git has a feature to work with SVN repositories, git-svn, but that’s intended to check out existing code from SVN and work on it, not publishing an existing Git tree into a Subversion repository.

A first rather naive approach didn’t work out (as somewhat expected), but then I figured out how to achieve this anyway.

As a test, let’s first create an empty SVN repository and a Git repository with some commits:

$ svnadmin create repo
$ svn co file:///Users/nicolas/Temp/git_to_svn/repo svn_repo
Checked out revision 0.
$ cd svn_repo
$ svn mkdir trunk tags branches
A         trunk
A         tags
A         branches
$ svn commit -m "Create repository structure"
Adding         branches
Adding         tags
Adding         trunk

Committed revision 1.
$ cd ..

$ mkdir project; cd project
$ git init
Initialized empty Git repository in /Users/nicolas/Temp/git_to_svn/project/.git/
$ echo "foo" > test.txt; git add test.txt; git commit -m "Initial version"
master (root-commit) 88464cf] Initial version
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 test.txt
$ echo "bar" > test.txt; git commit test.txt -m "Second version"
master cb62866] Second version
 1 files changed, 1 insertions(+), 1 deletions(-)

We now can set up git-svn:

$ git svn init -s file:///Users/nicolas/Temp/git_to_svn/repo/
$ git svn fetch
r1 = 741ab63aea786882eafd38dc74369e651f554c9c (trunk)

Depending on the layout of your SVN project, you might need to drop the -s parameter and add -t, -T or -b flags, see the git-svn manpage.

A little naive we could try to push everything to the SVN repository now:

$ git svn dcommit
Unable to determine upstream SVN information from HEAD history.
Perhaps the repository is empty. at /opt/local/libexec/git-core/git-svn line 439.

This fails since the git svn command can’t figure out which commits to push: there’s no link between our original Git repository and the Subversion heads.

To fix this, we can use a Git graft to link them. We’ll tell Git the commit which created the SVN folder in which we want to store the project is the parent commit of the first commit in our Git repository:

$ git show-ref trunk
741ab63aea786882eafd38dc74369e651f554c9c refs/remotes/trunk
$ git log --pretty=oneline master | tail -n1
88464cfdf549a82b30ee7c52e53e2b310f0d9ec4 Initial version
$ echo "88464cfdf549a82b30ee7c52e53e2b310f0d9ec4 741ab63aea786882eafd38dc74369e651f554c9c" >> .git/info/grafts

If now you execute git log, you’ll see the “Create repository structure” SVN commit is displayed after our “Initial version” commit.

Pushing to SVN now works fine:

$ git svn dcommit
Committing to file:///Users/nicolas/Temp/git_to_svn/repo/trunk ...
	A	test.txt
Committed r2
	A	test.txt
r2 = 8c72757dd3a7d550ed8ef393bb74c0350d22dbac (trunk)
No changes between current HEAD and refs/remotes/trunk
Resetting to the latest refs/remotes/trunk
test.txt: locally modified
	M	test.txt
Committed r3
	M	test.txt
r3 = ca0fc06d477bcd4dd5c6f6d2ae6d94356b510280 (trunk)
No changes between current HEAD and refs/remotes/trunk
Resetting to the latest refs/remotes/trunk

All set :-)

Posts for Friday, July 24, 2009

avatar

Tech tip #3: Rip audio from an .FLV file.

Well folks, here’s another quick tech tip that I use once in a while. How do you rip only the audio from an .FLV file? .FLV files, or Flash Video files are the format used in browser-embedded videos, common on video-sharing sites such as YouTube or Vimeo (and Eadrax!) For whatever reason if you have an .FLV file of your favourite music video, now you can get the music rocking solo.

mencoder a.flv -o a.mp3 -of rawaudio -oac mp3lame -lameopts cbr:br=192 -ovc copy

I’ll stay off tech tips for a while as the weekend is coming up.

Related posts:

  1. Tech tip #2: MPlayer play music recursively in a directory.
  2. Tech Tip: Speed up Firefox to use less CPU.

Ruby 1.9.1 and Diakonos

Tonight, I've gone ahead and done some work on dev-lang/ruby, and I've gotten ruby 1.9.1 into funtoo unstable. Along with the new ruby comes an updated eselect-ruby, and a transition from the "/usr/bin/ruby18" suffix to the "/usr/bin/ruby1.9" suffix (notice the dot.) It seems the dot is popular these days. And I also figured that python uses the dot, so why not ruby too? Seems worthwhile to be consistent.

I've also added the diakonos editor - written in ruby and dependent on ruby-1.9 - into the funtoo unstable tree. I also think it's worth mentioning that diakonos was first submitted to bugs.gentoo.org by Pistos, its author, on October 22, 2005. Three years, nine months and one day later, it's in funtoo. Better late than never.

Planet Larry is not officially affiliated with Gentoo Linux. Original artwork and logos copyright Gentoo Foundation. Yadda, yadda, yadda.