Fuse Mounts in Fedora 12

Read this bug report.

What’s wrong with that picture?

We’re dealing with a bug that prevents display of $HOME contents via Nautilus browsing and simple shell commands such as $ ls -al. Awesome, huh?

For a Linux distribution that promotes the use of the Gnome desktop environment, it sure does seem that Fedora, and it’s #fedora@freenode legion of bigoted IRC veterans, are dismissive of the bug; a casual mention for the wary does not count.

What this means is that whenever the bug rears it’s ugly head i.e. always, the user’s desktop experience is ruined - personal configurations for applications can’t be accessed.

Since 2009-04-02 05:39:58 EDT, this bug has remained officially unresolved.

A temporary solution for the casual home user that does not involve patching files is to # touch /forcefsckas root, for the next system boot to (hopefully) fix the problem for the duration of the computer’s uptime. Even then, successive reboots (expect to reboot often) requires the user to repeatedly issue the same command.

My non-geek of a girlfriend was not particularly pleased.

Logitech G5 in Fedora 12

In order to get the G5’s side buttons and 3rd button’s left/right tilt functional in both Firefox and Nautilus, in /etc/X11/xorg.conf:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Section "ServerLayout"
#...
InputDevice "Configured Mouse" "Pointer"
EndSection
Section "InputDevice"
Identifier "Configured Mouse"
Driver "evdev"
Option "CorePointer"
Option "Name" "Logitech USB Gaming Mouse"
Option "ZAxisMapping" "4 5 6 7"
Option "Emulate3Buttons" "false"
EndSection

NB: F12 does not ship with a /etc/X11/xorg.conf file by default; see Fedora’s guide on how to create one.

Additionally, you need to modify $HOME/.Xmodmap to show:

1
2
pointer = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Also, after:

# yum install xbindkeys xdotool

.. in $HOME/.xbindkeysrc, have:

1
2
3
4
5
6
7
8
# Nautilus:Back
"xdotool key alt+Left"
b:8
# Nautilus:Forward
"xdotool key alt+Right"
b:9

Upload Github Gists

To upload gists from the command-line, follow these instructions. The given usage example shows:

$ gist < file.txt
$ echo secret | gist --private # or -p
$ echo "puts :hi" | gist -t rb
$ gist script.py
$ gist script.js notes.txt
$ pbpaste | gist -p # Copy from clipboard - OSX Only
$ gist -
the quick brown fox jumps over the lazy dog
^D

Delete Github Repo via Curl

Github allows users to interact with their online profile (account details, repo details etc) via several APIs separate from the standard web-interface. This proves useful, if, say, you need to remove a problematic repo entirely from Github, and the web interface won’t let you access the repo page, citing error: page not found.

From the instructions given:

$ curl -F 'login=ootput' -F 'token=_API_TOKEN_HERE_' https://github.com/api/v2/json/repos/delete/_REPO_NAME_

(The API_TOKEN_HERE can be found in Account Settings, under Administrative Information.)

If the curl command succeeds, it will return something similar to {"delete_token":"abcdefgh"}. Use this token in the following:

$ curl -F 'login=ootput' -F 'token=_API_TOKEN_HERE_' -F 'delete_token=abcdefgh' https://github.com/api/v2/json/repos/delete/_REPO_NAME_

If all goes well, curl will return {"status":"deleted"}

You can use the -k (or --insecure) option for curl to bypass certificate verification.

Farewell, NanoBlogger

With recent developments, I no longer have a need for NB. While it was a nice run, my faith in the longevity of the software waned when I read:

February 12, 2010 8:52 PM

Fight Bit Rot - Join The NanoBlogger Development Team Today!

In all seriousness, I’m looking for two or more people to take on developer roles. Specifically people who have skills in programming and debugging shell scripts. Even if writing code isn’t your cup of joe, just helping patch and push new releases out would be a huge boost to the project’s vitality.

I have a backlog of bugs that need fixing and can’t seem to find the time to sit down and start widdling away at them. So, anybody out there interested?

… to which there hasn’t been a single reply.

Farewell, NB, and thanks for all the fish.

Readernaut in Chyrp

Readernaut is the easiest way to share what you’re reading with friends.

Chyrp’s Readernaut module provides a sample twig:

Twig, a language specifically created for Chyrp, that is put through a compiler to produce PHP.

… that is unnecessarily complicated - it essentially tries to fit both the book title and book cover into a table column. I’d much rather allocate space for the book’s cover than it’s details given the small area to work with.

Ultimately, I modified themes/$theme/content/sidebar.twig to show:

To restrict the book listing to only show books that are currently being read, in modules/readernaut/readernaut.php:

1
2
3
4
5
6
## The actual data
public function books($limit=10) {
$config = Config::current();
$xml = simplexml_load_string(get_remote('http://readernaut.com/api/v1/xml/'.$config->readernaut_user.'/books/reading/?limit='.$limit));
return $xml->reader_book;
}

.. essentially changing the path to the reading list from books/ to books/reading/.

Backup and Restore MySQL Databases

To export a MySQL database into a dump file:

$ mysqldump -u username -ppassword db_name > db_name.sql

(No, that’s not a typo; there is no space between -p and password.)

Data, tables, structures and database of database_name will be backed up into a SQL text file named db_name.sql.

To import a MySQL database, upload the dump file to the MySQL server, and use the following command to import the databases back into the MySQL server:

$ mysql -u username -ppassword db_name < db_name.sql

Backup of Chyrp

With NB, off-line backup was rather easy - essentially I was dealing with textual content from two sources that could be easily synchronized with basic shell tools.

Chyrp, on the other hand, required that I duplicate both the MySQL database and the static content, and that I had a web browser handy to access the graphical markup tools provided.

I had to dump the contents of the remote MySQL database to a local file, which could then be used to recreate the on-line database if ever the need arose. I created the following script for that purpose:

1
2
3
4
5
6
7
8
#!/bin/sh
MYSQLBACKUP=/home/$USER/.mysql_backup
DB_NAME=dump.sql
[ -f $MYSQLBACKUP/$DB_NAME.1 ] && mv -f $MYSQLBACKUP/$DB_NAME.1 $MYSQLBACKUP/$DB_NAME.2
[ -f $MYSQLBACKUP/$DB_NAME.0 ] && mv -f $MYSQLBACKUP/$DB_NAME.0 $MYSQLBACKUP/$DB_NAME.1
[ -f $MYSQLBACKUP/$DB_NAME ] && mv -f $MYSQLBACKUP/$DB_NAME $MYSQLBACKUP/$DB_NAME.0
ssh USER@host mysqldump -h MYSQL.HOST -u USER -pPASSWORD DBNAME > $MYSQLBACKUP/$DB_NAME

With a rudimentary backup method in place, I could now completely migrate away from NanoBlogger.