I bought that particular printer for its ability to directly print on CDs. The printer documentation says, that this needs the special driver (provided only for Windows), but still it should be able to print on standard paper from Linux.
Try 1: Plug & Play Connectivity
The Debian based Linux distributions nowadays do plug and play surprisingly well. So I gave it a try: connect the printer to a USB port, turn it on and see what happens:
A message box appeared "the ip4600 printer has been added with a text only driver". It offered "find driver", I accepted that offer, got asked for my password and voila, the printer configuration contained the ip4600_series.
Try 2: Manually Adding a Driver to CUPS
I connected my web browser to the local CUPS (https://localhost:631). The printer was there, but still with "generic text-only". Unfortunately, no search option turned out any results. So I looked into the aptitude package manager to install additional drivers.
I installed the package cups-driver-gutenprint, which pulled in ghostscript-cups.
The I chose the "add printer" dialog. Maker Canon, the model pixma ip4600 (gutenprint) was an offered choice which I chose. This created a new queue Canon_iP4600_series. I deleted the first automatic queue iP4600_series.
The first test print was a 6 page HTML file from Iceweasel (Firefox) which worked immediately.
2009-10-16
2009-10-02
Backup for Windows using a batch file
This batch file does a reliable backup of Windows Vista Users to an external hard drive. There will be a new directory for each day the script is run. For Windows language settings other than German, you will need to adapt the SET FULLDATE line. FULLDATE should be something like 2009_10_31.
SET TARGETPATH=F:\Sicherung
SET FULLDATE=%date:~6,4%_%date:~3,2%_%date:~0,2%
echo FULLDATE=%FULLDATE%
SET TARGET=%TARGETPATH%\%FULLDATE%
mkdir %TARGET%
rem robocopy C:\Users %TARGET% /S /V /R:0 /W:0 /PURGE
xcopy C:\Users %TARGET% /S /C /I /R /Y
SET TARGETPATH=F:\Sicherung
SET FULLDATE=%date:~6,4%_%date:~3,2%_%date:~0,2%
echo FULLDATE=%FULLDATE%
SET TARGET=%TARGETPATH%\%FULLDATE%
mkdir %TARGET%
rem robocopy C:\Users %TARGET% /S /V /R:0 /W:0 /PURGE
xcopy C:\Users %TARGET% /S /C /I /R /Y
2009-05-23
ToDo Lists GTD Style with TiddlyWiki, MonkeyGTD Style
In one of my previous posts, I wrote about TiddlyWiki MPTW-Style. Back then in February I started using another TiddlyWiki variant, called MonkeyGTD, as a todo list structuring tool. I use Thinking Rock in the office and would like to have something different at home, to avoid being reminded too often of the huge backlog of work in the office.
MonkeyGTD uses the taggly tagging technique of MPTW to link tasks with projects, areas, realms etc. This way it is really easy to put your todo list into a structure. I really needed to read the documentation before starting, but I got rewarded by knowing how to arrange lots of tasks into imaginable chunks.
For my style of use, the major drawback of MonkeyGTD is the lack of sorting orders. With a dozen projects, each having several possible next actions, I'm overwhelmed by the quantity of possible next actions. I want a system that makes an educated suggestion of what to do next. MonkeyGTD has the option of starring projects and actions, but that is only a little help to me.
MonkeyGTD uses the taggly tagging technique of MPTW to link tasks with projects, areas, realms etc. This way it is really easy to put your todo list into a structure. I really needed to read the documentation before starting, but I got rewarded by knowing how to arrange lots of tasks into imaginable chunks.
For my style of use, the major drawback of MonkeyGTD is the lack of sorting orders. With a dozen projects, each having several possible next actions, I'm overwhelmed by the quantity of possible next actions. I want a system that makes an educated suggestion of what to do next. MonkeyGTD has the option of starring projects and actions, but that is only a little help to me.
2009-04-18
Data Recovery with Scrounge NTFS
A friend asked me to try to recover data from an external 160 GB hard disk. It refused to show its contents on Windows XP, where it used to be used. In an earlier similar situation I had successfully used scrounge-ntfs. Scrounge NTFS is available as an out-of-the-box package for Debian Linux, which I run on my desktop computer at home. So I gave it a try in this case too. I connected the disk to a USB port of my computer, where it got the device ID /dev/sdb.
To use scrounge-ntfs, one needs some pieces of information (items copied from the author's website):
I got
Start Sector End Sector Cluster Size MFT Offset
63 312579729 8 6291456
So I changed into the directory where I wanted the recovered data to end up and entered
scrounge-ntfs -m 6291456 -c 8 /dev/sdb 63 312579729
Unfortunately, scrounge-ntfs just complained about an invalid mft-record and stopped.
There is the option of running scrounge-ntfs without telling it where the MFT is. But if run so, it places all recovered files into one single directory. Manually sorting more than 20,000 files is not particularly funny, so I wanted to aim for a better result.
According to Stef Walter, the author of scroungs-ntfs, sector 6291456 is a customary place for the start of the MFT. Given the error message, I assumed that the usual place happened to be on a damaged sector. After a little thinking, I dared to use a trick: let it look for the MFT one sector after the original one, i.e. scrounge-ntfs -m 6291457 -c 8 /dev/sdb 63 312579729
I didn't really expect this to work, but it did. Although every message about a recovered file is preceded by scrounge-ntfs: invalid mft record, all files were recovered and by far most of them ended up in a meaningful subdirectory. So my friend is happy of having his data back again.
To use scrounge-ntfs, one needs some pieces of information (items copied from the author's website):
- Start Sector: This is where the partition starts on your hard disk.
- End Sector: Where your partition ends on the entire hard disk.
- Cluster Size: This is the size of one 'block' of data on a partition
- MFT Offset: The position of the NTFS Master File Table.
I got
Start Sector End Sector Cluster Size MFT Offset
63 312579729 8 6291456
So I changed into the directory where I wanted the recovered data to end up and entered
scrounge-ntfs -m 6291456 -c 8 /dev/sdb 63 312579729
Unfortunately, scrounge-ntfs just complained about an invalid mft-record and stopped.
There is the option of running scrounge-ntfs without telling it where the MFT is. But if run so, it places all recovered files into one single directory. Manually sorting more than 20,000 files is not particularly funny, so I wanted to aim for a better result.
According to Stef Walter, the author of scroungs-ntfs, sector 6291456 is a customary place for the start of the MFT. Given the error message, I assumed that the usual place happened to be on a damaged sector. After a little thinking, I dared to use a trick: let it look for the MFT one sector after the original one, i.e. scrounge-ntfs -m 6291457 -c 8 /dev/sdb 63 312579729
I didn't really expect this to work, but it did. Although every message about a recovered file is preceded by scrounge-ntfs: invalid mft record, all files were recovered and by far most of them ended up in a meaningful subdirectory. So my friend is happy of having his data back again.
2009-02-02
Personal Notetaking with TiddlyWiki, MPTW Style
I developed the habit of trying to document everything I do. So I need a piece of software to quickly take notes and put them into relationships later. A wiki is likely to fill that need. While testing various server based wikis for my job (the largest branch is looking for a cantralized documentation system), I discovered an implementation I'd call an eye-opener: TiddlyWiki. The entire wiki is stored as a single, large (250 kB) HTML file. All the logic is implemented in JavaScript. I hadn't thought before that such an application could be feasible in JavaScript - that's why I call it an eye-opener.
Having all data in a single file and letting the browser run the logic makes it not well suited for group access, but ideal for personal use on a USB key. No installation required, just a decent web browser - optimized for Firefox, also working on IE. If you want to publish information contained in a TiddlyWiki, or just want a web hosting service for your private data, you can create a free account at tiddlyspot.com. I didn't try that, but many others have.
TiddlyWiki can be extended by plugins and these can be updated through the TiddlyWiki synchronisation feature. Several people have created such extensions, so there are many variants of TiddlyWiki around. All of them share the same core code.
After adding a few pages, I found it cumbersome to create the internal links. This is the reason, why I don't consider server based wiki an option for quick documentation writing (though wikis are great for documentation publishing and collaboration). Then I stumbled across a TiddlyWiki variant called MPTW. It contains a few function buttons which make life a lot easier for documentation:
Having all data in a single file and letting the browser run the logic makes it not well suited for group access, but ideal for personal use on a USB key. No installation required, just a decent web browser - optimized for Firefox, also working on IE. If you want to publish information contained in a TiddlyWiki, or just want a web hosting service for your private data, you can create a free account at tiddlyspot.com. I didn't try that, but many others have.
TiddlyWiki can be extended by plugins and these can be updated through the TiddlyWiki synchronisation feature. Several people have created such extensions, so there are many variants of TiddlyWiki around. All of them share the same core code.
After adding a few pages, I found it cumbersome to create the internal links. This is the reason, why I don't consider server based wiki an option for quick documentation writing (though wikis are great for documentation publishing and collaboration). Then I stumbled across a TiddlyWiki variant called MPTW. It contains a few function buttons which make life a lot easier for documentation:
- On the top of each page (called "Tiddler" in TiddlyWiki parlance), all tags of this page are listed, together with a drop down menu, listing all other pages having this tag.
- On the bottom of each page, there is a customizeable list of all pages having the title of current page as a tag. So I can create a page "VMware" containing an automatic listing of all other pages tagged with VMware.
- On every page there is a "New here" button that creates a new page, automatically tagged with the title of the previous page. So the newly created page will automatically be listed at the bottom of the parent page. This way you can create a logical tree of pages without any extra tagging or linking effort.
- The customizeable list of all child pages has an option ("sitemap") to display not only the direct children, but also the children of children and further generations. This mode really got me hooked.
- The customizeable list of all child pages has an option to include an excerpt (one line or so) of each child page, so you see even more what's up in your documentation forest.
2009-01-31
Distributed Address Management with Zoho
A friend of ours is a teacher and counsellor and needs to manage a collection of about 1000 addresses. He sends an email newsletter to about 500 of them every month and a paper mailing to about 200 of them twice a year. He asked my wife's office service to help him, so he can focus on spiritual tasks and doesn't need to spend much time for dry administration.
One option is to run a standard fat-client address management software (we're considering Optigem). But our friend lives about 15 km (10 miles) away, so driving there just to enter a single new address is not efficient. File server style access to an MS-Access database over an ADSL line (192 kbps upstream) or maintaining a Windows terminal server just for this purpose isn't either, so we'd have to copy the database to a USB key and physically exchange that in church on Sunday. This would imply, that between copies only one side is allowed to modify data. This would be acceptable, though not ideal. So I'm looking for a more elegant solution: a hosted address database on the web.
Looking for a Web Service: Zoho
There are some web services around, but the only free one I found to be able to manage categories was Zoho. They have a full CRM suite, but it was too big for this purpose. What thrilled me was Zoho personal (http://personal.zoho.com) - a complete work area with word processing, spreadsheet, mail etc. on the web. It does include a contact management component, separately accessible as http://contacts.zoho.com, with categories and permission groups. When editing a contact, you can add it to one or more categories and groups. Groups are for sharing data, so you could permit other Zoho users to see certain things in your workspace.
Sending an email message to an entire category is easy - but there is no Bcc option when composing messages. Bcc is a must, because you don't want your email address broadcast to many hundreds of other recipients of the newsletter.
So you need to export the contact data and compose the message in a conventional e-mail program like Thunderbird. This kind of export is possible for any single category. Formats offered include CSV, Outlook CSV and LDIF. LDIF is great for importing into Thunderbird as a new address book. To mail a newsletter in Thunderbird, you just need to enable the contact sidebar, select all addresses of the newly imported address book, right click on the selection and "add to Bcc".
With these possibilities, Zoho Personal is an acceptable choice as a contact management tool.
The only glitch I found was in localisation - my wife really prefers a German language user interface.
If you want the Zoho user interface in your language, as opposed to "English only", you need to login through personal.zoho.com, not through contacts.zoho.com. In personal.zoho.com, you can set a user interface language. But during the tests I could no longer get to the contacts application within the personal site. It just showed the form "please sign up". I sent a feedback to Zoho - and I'm curious whether there will be a response.
One option is to run a standard fat-client address management software (we're considering Optigem). But our friend lives about 15 km (10 miles) away, so driving there just to enter a single new address is not efficient. File server style access to an MS-Access database over an ADSL line (192 kbps upstream) or maintaining a Windows terminal server just for this purpose isn't either, so we'd have to copy the database to a USB key and physically exchange that in church on Sunday. This would imply, that between copies only one side is allowed to modify data. This would be acceptable, though not ideal. So I'm looking for a more elegant solution: a hosted address database on the web.
Looking for a Web Service: Zoho
There are some web services around, but the only free one I found to be able to manage categories was Zoho. They have a full CRM suite, but it was too big for this purpose. What thrilled me was Zoho personal (http://personal.zoho.com) - a complete work area with word processing, spreadsheet, mail etc. on the web. It does include a contact management component, separately accessible as http://contacts.zoho.com, with categories and permission groups. When editing a contact, you can add it to one or more categories and groups. Groups are for sharing data, so you could permit other Zoho users to see certain things in your workspace.Sending an email message to an entire category is easy - but there is no Bcc option when composing messages. Bcc is a must, because you don't want your email address broadcast to many hundreds of other recipients of the newsletter.
So you need to export the contact data and compose the message in a conventional e-mail program like Thunderbird. This kind of export is possible for any single category. Formats offered include CSV, Outlook CSV and LDIF. LDIF is great for importing into Thunderbird as a new address book. To mail a newsletter in Thunderbird, you just need to enable the contact sidebar, select all addresses of the newly imported address book, right click on the selection and "add to Bcc".
With these possibilities, Zoho Personal is an acceptable choice as a contact management tool.
The only glitch I found was in localisation - my wife really prefers a German language user interface.
If you want the Zoho user interface in your language, as opposed to "English only", you need to login through personal.zoho.com, not through contacts.zoho.com. In personal.zoho.com, you can set a user interface language. But during the tests I could no longer get to the contacts application within the personal site. It just showed the form "please sign up". I sent a feedback to Zoho - and I'm curious whether there will be a response.
2009-01-24
Magpie RSS: Include an RSS Feed on an HTML webpage
Rationale for a PHP Feedreader
Quite often, organisational websites are written in static html, which is fine for the purpose, but want to run some kind of news system to publish current events without having to edit the core pages. If a CMS is available, one can use that for the purpose. But if they do not want to run a CMS - there may be good reasons, e.g. security - there is the option of using a blog service like blogger.com as a backend. But what to use as a frontend, visible to website visitors?Telling people "please get a feedreader and subscribe to our blog" is creating an inadequate obstacle - many visitors of the target audience are barely capable of typing a URL into their browser, let alone manage bookmarks. So the feed needs to display automatically with the webpage. Including a Javascript feed reader would mean to require a client side script to pull data from a third party server (blogger.com), which is for good reasons blocked by default due to the "same origin policy".
So the feed needs to be included by a server side script. Nowadays PHP is available even with cheap shared hosting packages, so I could set out to create a PHP page blogfeed.php that pulls and displays the relevant items of the feed.
Magpie RSS
This task can't be unique, so I looked for a PHP script doing that. I found most refenrences for Magpie rss (http://magpierss.sourceforge.net/). This homepage also gives links to hints useful for RSS users and webmasters in general.The mapie project does not offer a real manual, but it does provide links to examples.
The provided example only shows how to display a list of titles. My plan is to show the first three or so news items in full text and only headlines for the rest.
The author of http://www.hiash.com/blogger.php (referred to on the Magpie links page) has exactly the same plans a I did: using blogger.com as a backend for another webpage.
That made me confident enough to try it. At first I did it on my home (intranet) webserver:
My First Try with Magpie
I downloaded magpie in its most recent version 0.72 from the Sourceforge download page. There I discovered that the current version dates from 2005. I researched a bit for alternatives, but found only very few, very simple (probably too simple) scripts, e.g. LastRSS. So I concluded, that Magpie's age may be a sign of matureness and robustness, rather than obsoleteness.All magpie users recommend this directory structure, so I set it up too:
magpie/rss_cache.inc
magpie/rss_fetch.inc
magpie/rss_parse.inc
magpie/rss_utils.inc
magpie/extlib/Snoopy.class.inc
The untarred download contains a nice file htdocs/cookbook.html.
For a first try, I created a little file http://www.home.stut.de/newsfeed.php (home intranet only) on the root directory of my home intranet webserver (apache2 with PHP5 on Debian Etch), copied almost literally from hiash.com:
define('MAGPIE_DIR', 'magpie/');
require_once(MAGPIE_DIR.'rss_fetch.inc');
$rss = fetch_rss( 'http://stut-tech.blogspot.com/feeds/posts/default' );
//display latest blog content:
$item = $rss->items[0];
$content = $item['atom_content'];
echo "<p>Latest Blog Entry:<br>$content</p>\n";
It really does show my last blog post. But I want to know more about the inner workings, so I try to look at the complete array contents using the print_r function:
MagpieRSS Object
(
[parser] => Resource id #9
[current_item] => Array
(
)
[items] => Array
(
[0] => Array
(
[id] => tag:blogger.com,1999:blog-3769163305311983690.post-6898517931677696103
[published] => 2009-01-17T15:25:00.003+01:00
[updated] => 2009-01-17T16:07:54.525+01:00
[app] => Array
(
[edited] => 2009-01-17T16:07:54.525+01:00
)
[title] => jbrout Photo Manager
[atom_content] => I'm no longer ... (full length article cut for brevity)
... you can really find the buried gems in your picture collection.
[link_related] => http://jbrout.free.fr/
[link_replies] => http://stut-tech.blogspot.com/feeds/6898517931677696103/comments/defaulthttp://stut-tech.blogspot.com/2009/01/jbrout-photo-manager.html#comment-form
[link_edit] => http://www.blogger.com/feeds/3769163305311983690/posts/default/6898517931677696103?v=2
[link_self] => http://stut-tech.blogspot.com/feeds/posts/default/6898517931677696103
[link] => http://stut-tech.blogspot.com/2009/01/jbrout-photo-manager.html
[author_name] => Martin Stut
[author_uri] => http://www.blogger.com/profile/09103658031822073197
[author_email] => noreply@blogger.com
[thr] => Array
(
[total] => 0
)
)
[1] => Array
(
[id] => tag:blogger.com,1999:blog-3769163305311983690.post-1064215087336461038
[published] => 2009-01-14T19:51:00.004+01:00
[updated] => 2009-01-17T15:24:55.524+01:00
[app] => Array
(
[edited] => 2009-01-17T15:24:55.524+01:00
)
[title] => Copy Audio CDs
[atom_content] => (full length article omitted for brevity)
[link_replies] => http://stut-tech.blogspot.com/feeds/1064215087336461038/comments/defaulthttp://stut-tech.blogspot.com/2009/01/copy-audio-cds.html#comment-form
[link_edit] => http://www.blogger.com/feeds/3769163305311983690/posts/default/1064215087336461038?v=2
[link_self] => http://stut-tech.blogspot.com/feeds/posts/default/1064215087336461038
[link] => http://stut-tech.blogspot.com/2009/01/copy-audio-cds.html
[author_name] => Martin Stut
[author_uri] => http://www.blogger.com/profile/09103658031822073197
[author_email] => noreply@blogger.com
[thr] => Array
(
[total] => 0
)
)
)
[channel] => Array
(
[id] => tag:blogger.com,1999:blog-3769163305311983690
[updated] => 2009-01-18T07:13:25.599+01:00
[title] => Martin Stut's IT Experiments
[subtitle] => Almost every Saturday, I'm experimenting with some IT stuff, usually open source software on Debian Linux. I'm planning to document and share my findings here. Tests of software, tweaks needed to get something going, bringing a buried gem to the attention it might deserve.
[link_http://schemas.google.com/g/2005#feed] => http://stut-tech.blogspot.com/feeds/posts/default
[link_self] => http://stut-tech.blogspot.com/feeds/posts/default
[link] => http://stut-tech.blogspot.com/
[author_name] => Martin Stut
[author_uri] => http://www.blogger.com/profile/09103658031822073197
[author_email] => noreply@blogger.com
[generator] => Blogger
[opensearch] => Array
(
[totalresults] => 2
[startindex] => 1
[itemsperpage] => 25
)
)
[textinput] => Array
(
)
[image] => Array
(
)
[feed_type] => Atom
[feed_version] =>
[encoding] => ISO-8859-1
[_source_encoding] =>
[ERROR] =>
[WARNING] =>
[_CONTENT_CONSTRUCTS] => Array
(
[0] => content
[1] => summary
[2] => info
[3] => title
[4] => tagline
[5] => copyright
)
[_KNOWN_ENCODINGS] => Array
(
[0] => UTF-8
[1] => US-ASCII
[2] => ISO-8859-1
)
[stack] => Array
(
)
[inchannel] =>
[initem] =>
[incontent] =>
[intextinput] =>
[inimage] =>
[current_namespace] =>
[last_modified] => Sun, 18 Jan 2009 06:13:25 GMT
[etag] => W/"A0UERHsycSp7ImA9WxVREkg."
)
Adding the newsfeed to an existing HTML-only website
I added a magpie folder (chmod 755) to the root directory of my website, and a blogfeed.php file to the root level of it.I was able to call blogfeed.php in Firefox, but non-ASCII characters were broken. I solved this by adding a meta tag to the head section, so the charset became defined.
<html>
<head>
<title>Blogfeed on stut.de</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h2>Current Posts in my Tech-Blog</h2>
<?php
define('MAGPIE_DIR', 'magpie/');
define('MAGPIE_CACHE_ON', 1);
require_once(MAGPIE_DIR.'rss_fetch.inc');
$rss = fetch_rss( 'http://stut-tech.blogspot.com/feeds/posts/default' );
//display latest blog content:
//
$numberOfFullyDisplayedItems = 1;
$itemCounter = 0;
foreach ($rss->items as $item) {
$itemCounter += 1;
if ($itemCounter <= $numberOfFullyDisplayedItems) {
echo '<h3><a href="'.$item['link'].'" target="_blank">'.$item['title']."</a></h3>\n";
echo "<p>".$item['atom_content']."</p>\n";
}
// only for the first item after the completely displayed ones:
if ($itemCounter == $numberOfFullyDisplayedItems+1) {
echo "<h3>More Items</h3>\n";
echo "<ul>\n";
}
if ($itemCounter > $numberOfFullyDisplayedItems) {
echo '<li><a href="'.$item['link'].'" target="_blank">'.$item['title']."</a></li>\n";
}
}
// if there were more items: close the UL
if ($itemCounter > $numberOfFullyDisplayedItems) {
echo "</ul>\n";
}
?>
</body>
</html>
Now this code needs to get on the front page. The first obvious way would be to include it on index.php - but what if the start page is called index.html and changing the name to index.php is not an easy option?
Answer: Include blogfeed.php as an IFRAME. This is straightforward (if you are fluent in HTML and CSS):
<div id="rightbar" style="float:right;width:30%;">
<img src="mst.jpg" alt="Portrait of Martin Stut (JPG 5.5kB)" height="169" width="112" align="right" />
<iframe src="blogfeed.php" style="margin:2em 0em 1em 0em;width:100%;border:0px;height:80%;" />Current
posts of my <a href="http://stut-tech.blogspot.com/" target="_blank">tech-blog</a></iframe>
</div>
You can view the result, together with a 1996 photo of me, at http://www.stut.de/martin.html
Subscribe to:
Posts (Atom)
