terminal whispering and pudb

| No Comments
I just watched a talk on doing cool things with terminals in python. That talk mentioned pudb, an interactive debugger for python. That looks even more useful than just pdb (which is already very useful). I'm looking forward to trying it. Maybe soon I'll change my habits and replace "import pdb; pdb.set_trace()" with "import pudb; pudb.set_trace()".

Especially as http://stackoverflow.com/questions/22412416/how-to-debug-unittests-with-pudb-debugger suggests that's only way to debug your unittests with pudb.

Another thing from that talk that looks interesting is ptpython (written using PPT). 

KeePass2 selections

| No Comments
I use KeepassX to store passwords for personal passwords, and for work. On recent OS X installs KeePassX dropped support for the version 1 file format. But on my linux desktops there is no new KeePassX that supports the version 2 file format.

Fortunately someone packaged KeePass2 for Debian, a .NET app that runs under Mono. Unfortunately there is a problem with copying the password from KeePass2 into applications. http://ubuntuforums.org/showthread.php?t=1891919 is another user having the problem. http://www.sparrowtail.com/linux-and-its-schizophrenic-clipboards is where someone worked out what was going on, an explained it. http://www.nongnu.org/autocutsel/ is some software that provides the solution.

It seems in an X-Window system there is an old and deprecated cutbuffer, where applications can store text. Then there is a modern scheme called 'selections'. Supposedly applications these days use a 'PRIMARY' or a 'CLIPBOARD' selection, and perhaps the mono app uses the cutbuffer. the autocutsel tracks the cutbuffer and a selection (defaulting to CLIPBOARD) and copies text between them.

But that explanation from sparrowtail.com is from 2010, and autocutsel doesn't sort this out for me. The autocutsel package includes a "cutsel" tool that shows you what is in the cutbuffer and the selections. My testing shows that if I highlight something in a gnome terminal, it does show up in the PRIMARY selection. If I do a Shift+Ctrl+C copy it does show up in the CLIPBOARD selection. In KeePass2 if I do a copy it also shows up in the CLIPBOARD selection, (until a timer, and then KeePass2 removes the selection, and 'cutsel' reports Nobody owns the selection.

And while the copied password is in the CLIPBOARD selection (owned by KeePass2) I can past it in GVIM. But I still can't paste it into a terminal. 

After reading https://en.wikipedia.org/wiki/X_Window_selection, I suspect an active selection process is occurring, and for some reason KeePass2 is refusing the paste when the other application is a terminal. Continuing to read that suggested I might be able to run xclipboard (to take over the selection). But I'm told another clipboard is already running when I launch it. https://lildude.co.uk/howto-use-xclipboard-with-gnome/ suggests gnome includes it's own clipboard manager now. So I installed glipper, which describes itself as a "Clipboard manager for GNOME". Given that gnome is already a clipboard manager, I'm assuming this will expose some GUI controls so I can interact with the clipboard.

And it kind of does. It keeps a copy of your clipboard. I still can't paste to gnome terminal when KeePass2 has control of the selection, but I can click on the glipper icon in the notification area to select the password from the history list, and then I can paste it. 

So now I've got sensitive passwords being kept in a history, but I can paste them where I need to. This seems to have been a very unhealthy dose of yak shaving.

html slides presentation software

| No Comments
I've submitted a talk proposal for http://2015.pycon-au.org/, and yesterday I was notified it was accepted. Hurray! I figured I will need to write some slides. After a bit of googling I decided I wanted to try out https://code.google.com/p/io-2012-slides/. Downloading it was easy, but the README says to edit the CSS they use something called SCSS, with a ruby compiler, and that I should run:
sudo gem update --system
sudo gem install compass
Now, I don't really understand ruby or gems, so I tried this without using sudo. And it didn't work. That's probably my fault.
But instead of doing that, I did amkvirtualenv landslide, then did pip install landslide. And now I'm going to use https://github.com/adamzap/landslide instead.

configuring ST546 for public IP address ranges

| No Comments
Somehow I misconfigured my OpenWRT based router on the weekend, and it stopped allowing any packets through. I did have a shell session open on it at the time, which should have let me recover, but I didn't really understand the gravity of the situation, and wasn't able to recover the situation in time.

This meant I had no Internet access at home, which was only slightly annoying. However it also meant that suburbia.org.au and cromp.id.au were down, which was more of a problem.

To work around this I reconfigured my speedtouch ST546 ADSL modem. It was easy to reconfigure the ADSL modem to terminate the pppoe connection using it's web wizard. It wasn't hard to add to the local network interface a subnet for suburbia. It was easy (though annoying) to use the web interface to add in port forwards for all the services on cromp.id.au.

However to get the modem to forward on packets on the suburbia network wasn't working, and I was miffed about why. Eventually I worked out how to get it working mostly through an inspired guess. On the CLI of the modem, I did:
nat mapadd intf=Internet type=nat outside_addr=203.24.247.0/24 inside_addr=203.24.247.0/24 foreign_addr=0.0.0.0/24

Now I get to pull apart my OpenWRT router, and hook up a serial console to it. More fun for me.

Update: Seems there is a factory reset procedure I can follow for the router, which will avoid trying to get a serial console working. Which sounds much simpler.

PuppetDB, why?

| No Comments
I've recently setup PuppetDB. It seems to be a java process that provides a REST API to a database. It's only used by other puppet components, so it's got me wondering, why did they choose this implementation instead of writing a ruby library to access a database. In fact, that is where they have come from. In the past they used the ruby ActiveRecord libary to connect to a MySQL database.

In the blog post that announces Puppet DB they talk a lot about how it's faster, and more reliable. But it seems like a lot of overhead to read and write from a database, even if you do get metrics on how fast or slow your intermediate java technology is. They also make a point of how it's asynchronous, freeing up the puppet master to go and compile more catalogs. But I can't help but think if you took a page out of the zeromq book, and wrote a library that forks a thread to do your database updates you would get the same benefit.

PuppetDB does give you an API to access the data from other sources, but again, I'm wondering why PuppetDB has to be a gatekeeper for the master, and why a separate process couldn't just use the same library as the master to provide this API.

| No Comments

Sleep time, or save the world

| 2 Comments
I was driving home, and both my girls were asleep in the back seat, which was nice. So I drove the long way home, and let them sleep a bit longer as I know Andrea hasn't been sleeping particularly well over the last few nights.

Now I'm asking myself, what the hell was I doing? Burning the environment down just for some extra nap time is short term thinking if ever I heard it. Besides, Taylah kept sleeping in the car when we got home. If I hadn't banged the rear hatch three times (trying to close it to softly the first time didn't work) she would have kept sleeping.

I'm sure I'll have further opportunities to visit this dilemma in the future.

UDF instead of FAT on USB storage

| No Comments
I just stumbled across http://tanguy.ortolo.eu/blog/article93/usb-udf. This makes a good argument for using the UDF file system on portable drives instead of FAT. I reckon I'll be doing that next time I have to format some USB storage.

blessing Linux boots on iMacs

| No Comments
I've just worked out how to get my iMacs to boot into linux by default. Previously I've blogged about my efforts to install Debian on an iMac and a macbook air. The arch linux people have documented how to bless you're linux boot loader. They say you need to boot into Mac OSX, and then mount the efi volume. Over on themacadmin.com they describe how to mount the efi volume.

So I ended up doing the following commands:
diskutil list # Which showed /dev/disk0s1 is the efi volume
sudo mkdir /Volumes/efi
sudo mount -t msdos /dev/disk0s1 /Volumes/efi
sudo bless --folder=/Volumes/efi --file=/Volumes/efi/EFI/boot/bootx64.efi

I'm going to have to do this on all my Debian running macs now!

| No Comments

Find recent content on the main index or look in the archives to find all content.

Recent Comments

  • GregoryO: Uh, who is this Taylah? Methinks we have been out read more
  • Phillip: As long as you don't think its a good idea read more
  • Geoff Crompton: I think there are a few answers to the question read more
  • smplguy: I haven't finished, (obviously as I just finished Rands conversation read more
  • Geoff Crompton: Really, you thought the book wasn't very good, just because read more
  • Phillip: Nope the book sucked. To many unexplained questions at the read more
  • Geoff Crompton: I've fixed that up, and made a number of other read more
  • Phillip: Did you read this blotchy post before publishing it? Anishing? read more
  • Phillip: Since you've finished and I'm the only person reading your read more
  • Geoff Crompton: You know, I almost wrote down in my post that read more

Recent Assets

  • classics-challenge-v3-50.png
  • kona.JPG
  • IMG_0558.JPG
  • DSC_0118-small.JPG
  • DSC_0141-small.JPG

Categories

Powered by Movable Type 5.14-en