Epiphany – New Smartbookmarks

January 31, 2008 at 9:45 am (Linux)

I talked before about “Smart Bookmarks”, “Smart Bookmarks” are custom searches that can be queried directly from the Epiphany location bar. I found that there are a few bookmarks that aren’t listed on the Galeon site and I submitted them. Since Galeon is no longer developed, I’m not sure they’ll be added, so here they are.

Creative Commons Search

Thesaurus.com Search

Gentoo Bug Search

Chris Peschke has a good package.gentoo.org alternate (with a Search function!) :)
pEbuilds Portage Search

Epiphany - New Smartbookmarks

I updated the Epiphany post I made, adding how to change the default search engine and a couple other tidbits. Also I updated the stjerm post to reflect keyboard shortcuts and how to turn off auto-hiding.

Permalink 1 Comment

Command Line Dictionary

January 30, 2008 at 8:01 am (Linux)

If you are a regular user of the command line, a command line dictionary and thesaurus can come in very handy. I like to use a command line dictionary because: 1) You don’t have to navigate several server pages, or a drop box before entering a search; 2) You don’t have to be on the internet to do a search.

Sdcv

StarDict has created a command line-only version of their client that (like their full-featured version) has access to a host of different dictionaries. I’d been hassling with my own scripts creating a command line dictionary (you’ll know if you read this post previously) so many thanks to StarDict for making this alot easier.

Sdcv is in most distributions’ repositories so add it however you need to with your package manager. Then (if your repositories have them) install the dictionaries you need (this post focuses on the English WordNet and Moby Thesaurus dictionaries). In Arch Linux you can do this by:

pacman -S sdcv
yaourt -S stardict-wordnet stardict-moby-thesaurus

If your repositories don’t have them, you’ll need to add manually. You can do this by going to the StarDict files page and downloading them. Then extract the archive and place them in the StarDict ‘dic’ folder. For example:

tar xvf stardict-dictd-moby-thesaurus-2.4.2.tar.bz2
mv stardict-dictd-moby-thesaurus-2.4.2/* /usr/share/stardict/dic/

The folder may be different depending on your distro so don’t just run this command :).

To use sdcv you need to specify the dictionary:

sdcv -u WordNet hello
sdcv -u "Moby Thesaurus II" hello

You can list the dictionaries with the ’sdcv -l’ command.

Sdcv Scripts

To ease the process of entering the command and to give better formatting, I’ve created a couple scripts. You’ll need aspell installed (on most distributions it already is) of your language type to give misspelled word suggestions.

Define

#!/bin/bash
# define - command line dictionary

# Program name from it's filename
prog=${0##*/}

# Text color variables
txtbld=$(tput bold)             # Bold
bldred=${txtbld}$(tput setaf 1) #     red
bldwht=${txtbld}$(tput setaf 7) #     white
txtrst=$(tput sgr0)             # Reset
warn=${bldred}!${txtrst}

sedbldwht='\c[[1;37m'           # Sed white  - bold
sedtxtrst='\c[[0m'              #     text reset

# Display usage if full argument isn't given
if [[ -z "$@" ]]; then
  echo " $prog <word-to-lookup> - command line dictionary"
  exit
fi

# Suggest possible words if not in dictionary, otherwise define
wordchecknum=$(echo "$1" | aspell -a | sed '1d' | wc -m)
wordcheckprnt=$(echo "$1" | aspell -a | sed '1d' | sed 's/^.*: //')

if [[ $wordchecknum -gt "3" ]]; then
  echo -e "$warn ${bldwht}"$1"${txtrst} is not in the dictionary.  Possible alternatives:"
  echo -e "\n$wordcheckprnt" | fmt -w 76 | sed 's/^/  /g'
  echo
  exit
fi

# Lookup word and reformat/highlight
sdcv -u "WordNet" $1 | \
# lookup, delete extrenous first lines, delete last empty line
sed '1,3d' | sed '/^*$/d' | \
# print more obvious word type
sed "h; :b; \$b ; N; /^${1}\n     n/ {h;x;s// ${sedbldwht}Noun${sedtxtrst}\n/; bb}; \$b ; P; D" | \
sed "h; :b; \$b ; N; /^     v/ {h;x;s// ${sedbldwht}Verb${sedtxtrst}\n/; bb}; \$b ; P; D" | \
sed "h; :b; \$b ; N; /^     adv/ {h;x;s// ${sedbldwht}Adverb${sedtxtrst}\n/; bb}; \$b ; P; D" | \
sed "h; :b; \$b ; N; /^     adj/ {h;x;s// ${sedbldwht}Adjective${sedtxtrst}\n/; bb}; \$b ; P; D" | \
# reformat to left (ok, there's gotta be a better way to do this)
sed 's/^     / /g' | \
sed 's/^      /    /g' | \
sed 's/^      /    /g' | \
sed 's/^     /    /g' | \
# rename single entry for conformity
sed 's/^ : / 1: /g' | sed "/^${1}.*/d" | sed "s/^ \[/    \[/g" | \
# and coloring
sed "s/${1}/${sedbldwht}${1}${sedtxtrst}/g"

The WordNet print formatting isn't the best and I used sed quite a bit to get it in decent shape. Anyone that can use sed more efficiently or know of a better way to do this please let me know.

Thes

#!/bin/bash
# thes - command line thesaurus

# Program name from it's filename
prog=${0##*/}

# Text color variables
txtbld=$(tput bold)             # Bold
bldred=${txtbld}$(tput setaf 1) #  red
bldwht=${txtbld}$(tput setaf 7) #  white
txtrst=$(tput sgr0)             # Reset
warn=${bldred}!${txtrst}

# Display usage if full argument isn't given
if [[ -z "$@" ]]; then
  echo " $prog <word> - command line thesaurus"
  exit
fi

# Suggest possible words if not in dictionary, otherwise define
wordchecknum=$(echo "$1" | aspell -a | sed '1d' | wc -m)
wordcheckprnt=$(echo "$1" | aspell -a | sed '1d' | sed 's/^.*: //')

if [[ $wordchecknum -gt "3" ]]; then
  echo -e "$warn ${bldwht}"$1"${txtrst} is not in the dictionary.  Possible alternatives:"
  echo -e "\n$wordcheckprnt" | fmt -w 76 | sed 's/^/  /g'
  echo
  exit
fi

# Lookup word and reformat/highlight
sdcv -u "Moby Thesaurus II" $1 | \
# lookup, delete extrenous first lines, delete last empty line
sed '1,3d' | sed '2d' | sed '/^*$/d' | \
# delete indent to reformat, add newlines at 76th character, and reident
sed 's/^   //g' | fmt -w 76 | sed 's/^/  /g'

Permalink 6 Comments

Blog Jacking?

January 29, 2008 at 4:59 am (Linux)

I don’t mind news aggregators, in fact I rather like the idea, but I recently discovered a post of mine had be re-published lately. It is attributed… kinda (it links the original post at end of the article). And though the site doesn’t appear to be affiliated commercially, I am thrown off by this.

I discovered this as I was looking through comments that been posted and saw a message that was left with no name and no comment – only a link to the site.

I like blogging. Creating articles and documentation and seeing people being able to use them is why I like doing this. I like writing about open source because it is about sharing in the free and responsible way – I don’t believe this republication carries in that thought – using anothers post as their own.

I looked to see if any others had any similar issues. And I began to think about a basic license system for blogs – and if it’s really necessary. I came across coker’s blog (another open source blogger) and began to understand that other people are having this issue too. Its lofty, yes, but the frustration I can understand – bloggers who share ideas like to be protected against replication, not of the ideas, but of content.

The post links to an article that points out that their are people using blogging content others have created to create money for their own site. People that do this, called scrapers, can use scripts that extract the information from an RSS feed and often adding comment systems and such. Its something I have never thought of before writing a blog.
The article “Fighting Scrapers” also points out a few tips to help prevent scrapers.

So, do any readers have any suggestions about licensing? Have any out there had issues with content being redistributed? Or as an open source blogger am I being too close to vest.

Permalink 3 Comments

Ya-what?

January 25, 2008 at 9:03 am (OffTopic)

I used to like Yahoo, in fact, I still have an email address there. But what is happening to Yahoo? I heard the president of Yahoo yesterday morning on CNBC. When asked about open standards she talked about widgits for phones, when asked what their main competition was, if it’s Microsofts MSN or Google she totally evaded the question. Is Yahoo being sunk?

Permalink 4 Comments

Gentoo – A Quick User’s Perspective

January 23, 2008 at 11:34 pm (Gentoo)

I don’t usually get involved with politics on this blog, but I’d like to clarify how I think about Daniel Robbins offer to resume leadership of Gentoo, and Gentoo’s reply.

Gentoo is a great distribution. Gentoo is now run by developers who in there spare time contribute. This usually and almost always means working on portage. The developers producing ebuilds and creating portage primarily do it to create good systems for themselves. We as users benefit from this and to this point have little complained. But users are beginning to think of themselves as the red-headed step childs of the Gentoo family – mostly left to our own to enjoy the roof over our heads. And I think we users have become sick of it.

I have been reading developer blogs and am disturbed by their writings. Some quickly criticized saying Drobbins has no right to tell developers what to do, quickly citing the past incident when Drobbins previously returned. Most others just dodged the topic of a Gentoo leader and talked about the developer gap between users.

Grant Goodyear, the only real member of the Foundation, failed to file the paperwork for the Gentoo charter as whose only real function anymore is to file this paperwork – then shooed it in his blog.

Daniel tooks Grant’s blog as a no, and probably rightly so. It’s mostly defensive and defers the discussion to a mailing list.

Now some of the Developers have responded by creating the Gentoo User Relations page. It basically states that the developers are interesting in improving user relationships… But it appears is a reactionaryresponse and not a naturally motivated one. A marking of territory of sorts!?

Gentoo is a headless oligarchy. Meaning it has NO leadership, a bunch of priests acting in forced times as Pope. The current GMN will not last, the Gentoo user relations will not last, and the same dilapidated structure of Gentoo will deteriorate Gentoo if not fixed.

Permalink 5 Comments

Abandoning vixie – fillin fcron

January 21, 2008 at 2:17 am (Linux)

Perhaps cron doesn’t get used much anymore, but Gentoo’s vixie-cron is broke. Vixie-cron works just fine as a daemon executing commands in /etc/cron.*, but for the user it’s not. Yes I was sure to be added to the cron and crontab group, followed Gentoo Cron Tutorial, but vixie-cron would bark, “Permission Denied” when I tried to edit the crontab. The only way I could fix this as user was to change the permission of /var/spool/cron/crontabs to that of user:crontab this however broke it for the daemon – a problem I could not recover from. I re-installed vixie-cron to no effect.

I would report this as a bug but I happened to look at vixie-cron details on it’s ftp and discover it hasn’t been updated for 3 years so I’m not going to bother. The Gentoo Cron Tutorial actually references dcron and fcron more often so I imagine Gentoo is going away from it. Anyways, I got fcron installed and it works nicely, tyvm.

Abandoning vixie - follow fcron

Fcron is a built with a slightly more ambitious than vixie choosing, for example, to rather to use a binary for a system crontab and not the standard /etc/crontab. Gentoo developer jer provides some nice instructions in the ebuild to adapting the system. I took the time to write in plain text his instructions and put it on the wiki.

Gentoo Wiki Fcron

Permalink 7 Comments

Cron Alarm Clock

January 19, 2008 at 11:57 pm (Gentoo)

Unhappily, I’m sorry to say the there are a lack of alarm clocks in Linux. I’ve tried a few but really was impressed with none. So I decided to go with what the Linux uses for some of it’s timed events: Cron. Cron can be a good alarm and its easy to use.

The application “crontab” is used to create and edit cron jobs and the cron daemon checks for cronjobs a the top of every minute. A command line mp3 player can be used here but I like use Audacious. Cron will need to be told what X display to play Audacious on to discover the current display:

env | grep DISPLAY

Then as regular user edit crontab.

crontab -e

Here’s a simple comment to represent the cronjob layout:

#   minute (0-59),
#   |   hour (0-23),
#   |   |   day of the month (1-31),
#   |   |   |   month of the year (1-12),
#   |   |   |   |   day of the week (0-6 with 0=Sunday).
#   |   |   |   |   |   commands

Enter the time (multiple times, days need to be separated with commas) and script to execute for the alarm. The asterik can be used (*) to satisfy all variables. Here’s mine for audacious:

07  21  *   *   1,2,3,4,5   env DISPLAY=:0.0 audacious /home/user/My\ Music/Other/Alarms/301gq.mp3

I found some good alarm tracks at this site the were perfect for the task.

I like vim as my system editor but any can be used. In Gentoo edit the /etc/rc.conf to change it. To list the crontab.

crontab -l 

Additional Information:

Other Options

Wmtimer

Wmtimer works well for Gnome users (KDE has kalarm) it leaves a small window on the screen which can’t be hidden but it is able use the system beep or execute a command on an alarm/timer event. Starting it from the command line is pretty easy:

wmtimer -a -t 18:39:00 -e "mpg321 ~/Music/Other/Alarms/301gq.wav"

timer-applet

Timer-applet is a python application that adds a the ability to put a timer on the Gnome panel. Bugzilla has an ebuild for it, but I couldn’t get it to add to the gnome panel.

USE="libnotify sounds" emerge timer-applet

Audacious

Audacious also has alarm ability but it’s buried DeeeEEep in it’s preferences ( Preferences > Plugins > General ).

Alarm Clock

Thats actually its name. Despite the grey name, Alarm Clock is a very nice addition. Its a python script for the Gnome desktop that has the ability to run an application, display a message and to use as a tray icon. Its a good application and easy to install.

Alarm Clock requires python, pygtk, pynotif (notify-python in portage)
pygst (gst-python in portage).

alarm-clock.png

Zenity Alert

Zenity is Gnome’s notification program. This won’t get a person out of bed but it can be good for reminders. In crontab enter:

Note: I wasn’t able to get this to work. If anyone can figure it out please let me know.

    23  15  *   *   * env DISPLAY=:0:0 notify-send -i gtk-info "libnotify          example" "An example of libnotify notification thingy."

Permalink 2 Comments

Yahoo as default email client

January 17, 2008 at 10:41 pm (Gentoo)

I’ve had a Yahoo account since Yahoo was best of search engines (yes quite a bit ago) – I still like it. Instead of using my ISP provided email address I’ve just used Yahoo. Yahoo Mail can be used as the default email client instead of using Evolution, Thunderbird… in Gnome. In other words links that point to “mailto:” will open in mail.yahoo.com.

I use a hidden folder at home that contains all my scripts:

gedit ~/.bin/yahoo-mailto

This nice bash script will direct Epiphany mailto links to yahoo:

#!/bin/bash
qs=`echo $1 | sed ’s/mailto:/To=/’ | sed ’s/\?subject=/\&Subject=/’`
epiphany –new-tab “http://compose.mail.yahoo.com/?$qs”

Here’s an alternate as the above for some doesn’t always work:

#!/bin/bash
URL=$(echo $1 | sed ’s#mailto:##;s#?#\&#;s#\&subject=#\&Subj=#;s#(##;s#)##i;’)
epiphany –new-tab “http://us.f585.mail.yahoo.com/ym/Compose?To=$URL”

Make the script executable:

chmod +x ~/.bin/yahoo-mailto

To set it to the default application for mail in Gnome open Preferred Applications and select the script appended with a %s.

set email client

The script can also be used from the command line:

yahoo-mailto mailto:person@site.com

Thanks to Dhonn who built this bash script.

Permalink 9 Comments

“About Inkscape”

January 16, 2008 at 6:04 pm (Linux)

Inkscape developer Bryce Harrington talks about how Inkscape has, since it’s early releases, always choosen a unique “About Inkscape” picture. These images are created in Inkscape. To cut to the quick Inkscape “About” screens are now designed by users with a new one choosen for every release. A collection of previous “About Inkscape” pictures can be seen and the my basic Inkscape projects look like crayons in compare.

Byrce Harrington Blog

Permalink Leave a Comment

Thunar for Nautilus

January 14, 2008 at 9:13 pm (Linux)

When I decided to install Gnome 2.20 as my desktop. I knew of Xfce and Fluxbox but I was familiar with Gnome so on a 350mHz laptop I was taking a risk. The decision has been a pretty good experience and Gnome 2.20 runs ok except for a couple items, one of them being Nautilus.

Nautilus shows it size as a file manager with each Nautilus window taking about 5 seconds to load. Thunar is Xfce’s file manager and is a lighter than Nautilus. Since Xfce uses the GTK backend, I looked into if Thunar could be used to replace nautilus. I found this post where a small bash script can be used for the purpose.

The tricky bit about Nautilus is that is also manages the desktop (which it does well at) the script thankfully only uses Thunars file manager properties leaving the desktop aspects to Nautilus.

Load times now are much improved though folders on the desktop still load in Nautilus – I’ll just create launchers for them, I guess.

Thunar for Nautilus

Permalink 2 Comments

A Look Into Linux Blogging Software

January 14, 2008 at 3:11 am (Linux)

This is largely in response to Alex Bogak’s blog post Linux Blogging Sucks I read not too long ago. I had never used Linux blogging software before but I thought I would give it a try. How bad could it be?

Blogger lists three Linux blogging apps and they are all in portage: Gnome Blog, BloGTK, and Drivel. In short Alex is right. Most of these programs are pretty limited and a couple of them haven’t been developed in quite some time, but I do use one now and and it’s not too bad. Here’s a look at them:

Gnome Blog aka Blog Entry Poster

Gnome Blog is designed to work as an applet in the Gnome panel. Clicking on the applet will bring up a small WYSIWYG editor. Unfortunately Gnome Blog is one of the blogging apps that hasn’t been developed in a bit and in Gnome 2.20 couldn’t be added to the panel. Fortunately there is a menu entry for it that can be run in a separate window.

The nice bit about Gnome Blog is that it gives the preview of the post and doesn’t show the markup. This is a nice feature but for me, not really necessary. Unfortunately since I use a bold font for my system font, I wasn’t able to tell the difference between bold and regular fonts, but it was nice to be able to drag and drop my pictures onto it.

  • (+) WYSIWYG editor
  • (+) Support for numerous blogging types
  • (-) Did some odd formatting when transferring some writings from the notepad.
  • (-) No Blogger2 support
  • ?? – No ability to undo.

Drivel

Drivel is also not developed anymore but is the best coded app of the three. At first, I was set back by it’s very basic-ness but then began to like it.

Drivel has support for Blogger, Blogger 2, WordPress, Movable Type and a couple others. It also has the ability to pull up previous post to update them and can alert technorati of your posts.

  • (+) Simple, easy to learn, has most abilities most users need.
  • (+) Multiple Blog support.
  • (+) Super nice feature: Recent Entries. Very nice if I have to go back and update an entry.
  • (-) Only posts can be edited, no support for pages.
  • (-) Only single tagging available.
  • ?? No shortcut to link a url?

BloGTK

BloGTK has all the features of drivel. BloGTK hasn’t been developed though in quite some time and may not work for most blogs. After I wrote my post BloGTK refused to upload my blog nor give me any information as to why it couldn’t.

  • (-) Archaic spelling support.
  • (-) No tag recognition support – I had to create my own.
  • (-) Oddly, BloGTK disconnected after about 30 or so minutes writing the entry.
  • (-) Preview Post is a very poor preview.

Blog with Vimpress

Vimpress is a vim plugin that can be used to upload your entry to a blog server. I covered Vimpress in another post.

Adding Posts to Commercial WordPress

If you have a blog on the commercial wordpress site you can still access it with these applications. Just specify the php file in for your wordpress upload:

http://name.wordpress.com/xmlrpc.php

Conclusion

What did I choose and why? Drivel. The thing I like about Drivel is it is perfect lightweight solution. It has most the options I need and I like how lightweight it is. I had until this time always used WordPress’s web editor which is painfully slow on my iBook. Drivel has turned out to be a really good alternative to it. If I could choose one thing I would like in Drivel is the ability to link to old posts. None of the other Blogging apps have this either but this is something which I discovered I use quite a bit.

Vimpress is also a good tool, if you can remember all the html definitions you need.

Lately I’ve gotten a faster computer and have been using Arachnophilia (a java html editor) to write my posts then just pasting them into WordPress’s editor. I cover Linux HTML editors in another post.

Other Resources:

Permalink 4 Comments

Next page »