... using Blosxom to retrace my steps

tstigers.net - Home :: Entries :: Feeds :: Photos
June 2017
Sun Mon Tue Wed Thu Fri Sat
       
 


Mon, 29 Jun 2009

Backing up Delicious.com posts

From BinnyVA's txt collection.

Posted on 29 Jun 2009 at 15:21 in /technology/internet. -- Permalink

Sat, 30 May 2009

Twitter toolbox

Backtweets searches for links on Twitter - nice when you seem to remember you found some website because someone tweeted it, but can't remember who that was. It works fine with link shortening services like TinyURL and bit.ly.

Microplaza searches one's Twitter network for links, filtering out all tweets without links.

Tweetscan can be used for e-mail alerts (similar to Google alerts) - e-mails which collect tweets containing certain keywords. Tweetbeep does basically the same.

Flapstor charts trends for keywords on Twitter in a simple diagram, which can also be embedded in a website.

Twitnest creates a visualisation of one's Twitter network.

Tweetdeck is a kind of browser specifically for Twitter. Filling the whole screen, it's supposed to help you organise your Twitter stuff - display conversations, tweet yourself, follow certain topics etc. Too bad it needs Adobe Air to run on Linux.

An article at MBA Jobs lists several other Twitter tools, among them Tweetstats, Plodt, Twitterfriends, Monitter and Qwitter (which sends an alert when someone doesn't follow you any longer). Another article at Mashable gives an introduction to hashtags, with links to several tools which are useful in this context.

Posted on 30 May 2009 at 15:55 in /technology/internet. -- Permalink

Sun, 28 Sep 2008

How to find open wireless networks

"According to the latest stats on WiGLE, roughly 37 percent of the networks listed in its database are unencrypted and wide open for anyone to use," writes Brian Krebs in a Security Fix article. He introduces Wigle.net (Wireless Geographic Logging Engine), a database which can be searched for wireless networks by geographic area or SSID. I wonder how good it is for areas outside the U.S.

Posted on 28 Sep 2008 at 21:18 in /technology/internet. -- Permalink

Wed, 24 Sep 2008

CSS positioning - a long way to go

Home with bronchitis and not up to anything good anyway, I spent an awful lot of time today trying to create a more unified appearance for my several web pages. Basically I re-created shapes and colours from my "Entries" blog for the other pages. Apparently I still have a lot to learn when it comes to positioning boxes and stuff ...

Posted on 24 Sep 2008 at 20:29 in /technology/internet. -- Permalink

Mon, 22 Sep 2008

Now even safer!

Regarding my new online blog entry editor, I still had to do something about quotes (single and double), which got commented out so I ended up with ugly backslashes in my text and links wouldn't point at the proper URL. This was easy to solve with the PHP "str_replace(search, replace, subject)" function.

Then I also built in two basic security features: one makes sure I get an e-mail message whenever my editor page is used, the other asks for a password before displaying the form from which a user can post an entry.

Posted on 22 Sep 2008 at 19:07 in /technology/internet/blosxom. -- Permalink

Posting Blosxom entries online, without FTP

I've started experimenting with PHP again. I used the "import" function to use one single file for the navigation on most of the pages on my website, and another single file for the links in the right column of some of my "old blog" pages. Now I've just finished a kind of simple blog entry editor, where you can enter a title and some text and select a category, which will then be saved as a text file in the correct directory on the server.

Posted on 22 Sep 2008 at 18:43 in /technology/internet/blosxom. -- Permalink

Mon, 15 Sep 2008

A print style sheet

I learned something interesting from a book my brother-in-law gave me: "Advanced Professional Web Design", by Clint Eccher - how to create a style sheet for printing blog entries.

The following the style sheet (print.css) which I added to my "Entries" blog. It makes sure the font is big enough to be legible on the print-out and suppresses the header, sidebars, footer, the form where visitors can enter comments (basically an empty text field) plus the invitation to leave a comment, horizontal lines, the link to the comments feed and the trackback link.

p { font-size: 12pt; }
#header { display:none ;}
#sidebar-1 { display:none ;}
#sidebar-2 { display:none ;}
#footer { display:none ;}
form  { display:none ;}
hr  { display:none ;}
h4#respond { display:none ;}
span.commentsrsslink { display:none ;}
span.trackbacklink { display:none ;}

I also added a line to the file header.php (which is one of the files of the K2 theme I'm using) - a normal style sheet link:

link rel="stylesheet" type="text/css" media="print" href="print.css"

Some PHP code before "print.css" ("echo get_template_directory_uri();") simply makes sure the style sheet is found. (There are a few backslashes too many in this line as it is displayed here - I haven't yet found a way to display code properly in Blosxom.)

Posted on 15 Sep 2008 at 20:07 in /technology/internet. -- Permalink

Wed, 10 Sep 2008

Making a Wordpress blog more secure

I found some good hints at Maketecheasier.com. The AskApache plugin (mentioned there), however, acted strangely when I tried to use it with Wordpress 2.6 on two different remote servers. Also, the wp-security-scan plugin was consistently unable to act on its own recommendation and change the table prefixes in the database used by Wordpress. Maybe this was due to my being consistently incapable of granting the necessary privileges to the respective users? But if so, I guess I ran into a problem with the MySQL database "wizard". Anyhow - safer now, I think.

Posted on 10 Sep 2008 at 18:47 in /technology/internet. -- Permalink

Fri, 05 Sep 2008

Running Wireshark as a non-root user

As pointed out on the Wireshark Wiki, in order to capture data, Wireshark needs root privileges. Running Wireshark as root isn't particularly safe. Wireshark even warns you when you do that. A safer method involves capturing data using dumpcap (included with Wireshark) as root, then later looking at the saved captured data using Wireshark as a non-root user. In this way, at least those parts of Wireshark which parse the data don't run with root privileges. I wonder whether there really isn't any more comfortable method - one which allows you to look at the data in real time without being root - but maybe there just isn't.

Posted on 05 Sep 2008 at 17:30 in /technology/internet. -- Permalink

Sat, 23 Aug 2008

Google hacking myself

Reading "The Google Hacker’s Guide" (by Johnny Long; available for download as a PDF) and trying out a few searches, I found an open directory listing on my website, which gave away not just the names and details of all the files in that directory but also the version number of my remote webserver and similar information. Immediately closed this security hole by uploading a (basically) empty index.html file to that directory.

All directories on the Ai De website which at first glance seemed to be open were, in fact, safe: clicking on the relevant Google search result led to a "You don't have permission to access ..." plus "404 Not Found error" message.

Posted on 23 Aug 2008 at 18:53 in /technology/internet. -- Permalink

Wed, 20 Aug 2008

Nexty

BinnyVA has given us Nexty, a really, really good task manager (what is often called a "GTD" or "Getting Things Done" application). And you can't just download it free and install it on your own local or remote server, you can even sign up to it on the internet and use Nexty online, with Binny paying for your storage and bandwidth. I like Nexty a lot and find it extremely useful.

Posted on 20 Aug 2008 at 18:55 in /technology/internet. -- Permalink

Backing up my MoinMoin wiki

With SSH access to the remote server, this works like a breeze. Using SSH, create tar.gz files (tar czf filename.tar.gz path/to/directory) of the following directories on the server, then download them and public_html/cgi-bin/moin.cgi using sftp://

lib/python2.3/site-packages/MoinMoin/
share/moin/wiki/data/
share/moin/config/
share/moin/ (This, of course, contains share/moin/config/ and I guess it's optional - I'm erring on the side of "just get it all" ...)

Note that this doesn't include the configuration files of my webserver (Apache). It would probably better to back these up, too.

In order to restore the whole MoinMoin thing, it will suffice to upload these tar.gz files and moin.cgi to the server and put/expand them in the correct directories.

This is based on the "Backup" section of the MoinMoin HelpOnUpdating page.

Posted on 20 Aug 2008 at 18:29 in /technology/internet. -- Permalink

Wed, 13 Aug 2008

Ai De website upgraded, too

I finally got round to upgrading Wordpress and K2 (to 2.6/RC 7, respectively) for the Ai De website, too. The old version of K2 had caused errors when you did certain things, e.g. clicked on "Older" to see, uh, older posts; so the website hadn't been fully functional for several months. The reason I didn't upgrade earlier was that I knew this wouldn't be a completely trivial thing. I had made some changes to two PHP files of K2 - header.php and sidebar.php, and of course these files were among those which had been changed by the authors of K2 as part of the upgrade. So I had to incorporate my changes into the new files.

This took me quite a while, but turned out to be much more straightforward than I had anticipated. What really kept me working on the upgrade for hours, though, was the fact that the header part of every page (which displays the blog title, blog description, header image and navigation) is apparently put together in a different way from before - with the result that the upper part of my header image disappeared under the title/description/calligraphy part. I tried a few CSS tricks (position: absolute etc.) but didn't get anywhere. Eventually I realised that doing just 2 simple things might solve the problem: adding 60 pixels of empty space to the top of my image and inserting a line into my extra stylesheet to override the standard height of the image, which is set in the stylesheet which comes included with K2 (#header { height: 260px; }). I was lucky - it works.

Since I still haven't found a way to put one of my narrow columns to the left of the main column in the new K2, the Ai De website has one single sidebar now instead of two. I placed the list of categories and the RSS feeds below the search window, archives and links. It's not as good as before but still OK.

Posted on 13 Aug 2008 at 18:17 in /technology/internet. -- Permalink

Mon, 11 Aug 2008

Upgrading to Wordpress 2.6 and K2 RC 7 (2)

It would have been so nice if I had just needed to go to the "K2 Options" in the blog admin (under "Design") and select my stylesheet under the "Style" heading. Hmm ... Doing this did give me back my colours, fonts etc., but not my arrangement of "widgets" (i.e. recent entries, blogroll, archives, categories ...) in the columns to the left and right of the main column. Apparently I need to put everything into place again manually, using the "K2 Sidebar Manager". Which is very slow and does strange things sometimes. Well, I guess that's not too bad for a major upgrade of both Wordpress and K2, and obviously I'm willing to pay a price for using this great theme.

Posted on 11 Aug 2008 at 18:00 in /technology/internet. -- Permalink

Upgrading to Wordpress 2.6 and K2 RC 7

Nothing very remarkable here - I was surprised that the blog looked like nothing had happened after the Wordpress update (from, if I'm not mistaken, 2.3). However, when I logged in and the usual database upgrade had finished successfully, too, I ended up with a "fatal error" caused by the file "dashboard.php":

Call to undefined function wp_register_sidebar_widget()

In other words, the "dashboard" didn't work anymore. I was still able, though, to go to other admin pages, e.g. edit.php, and browse from there to the plugins section (I'm sure I could have gone to plugins.php directly), where I disabled all plugins before going ahead with updating my K2 theme. It's great that K2 is documented so well: K2 Release Candidate 7 Released. Now, after I've installed and activated the new "k2-disable-widgets.php" plugin, I can access the dashboard again and everything looks fine.

On the admin side, that is. On the visitor side, my blog now has the standard K2 look, which together with the "widgets" I use looks rather confusing. I'll still need to put my own stylesheet into place again and see what has become of my arrangement of widgets in the three columns.

Posted on 11 Aug 2008 at 17:38 in /technology/internet. -- Permalink

Kubuntu

A few days ago, I decided it was time again to wipe my hard disk and start from scratch once more. Somewhat bored with Ubuntu/Gnome (which I found great - but sometimes I just like trying something new), and made curious by what I had read about the new KDE (version 4.1), I went for Kubuntu. Liked it right away. However, after I had tried and failed to get wireless internet access to work, I was left without any internet access at all. After a few repair attempts I just installed Kubuntu again, this time going for the suggested Ubuntu plus Kubuntu install.

Installing KDE 4.1 was easy: you just need to invoke apt-get twice (install KDE 4, then dist-upgrade). KDE 4.1 isn't yet completely stable - but it's lovely! The only really bad thing which has happened to me so far was a text file (about 50 lines) whose content disappeared without a trace when I tried to save it (I ended up with an empty file). I guess that Kate is to blame; it had already acted funny in other ways before eating my file.

Posted on 11 Aug 2008 at 17:37 in /technology/internet. -- Permalink

Fri, 18 Jul 2008

HTML headers and PHP

That was easy ... Months ago I played around with PHP and coded an RSS feed for my photo galleries. Everything looked fine but Google Reader just wouldn't let me subscribe to the feed. I wondered why and somehow got the idea that it might have something to do with headers.

Turns out I was right. Today, when I read Binny VA's post, "Rules for Creating an RSS Feed", I realised that PHP has a function to send headers. It's called, er, header.

So I looked it up in the PHP manual ("header - Send a raw HTTP header") and then had another look (using wget) at both my photo feed and a feed which I knew to be technically OK. This still didn't give me a clue. However, I found a line in my feed which I had commented out - for what reason totally beats me - and which started "header" ... Deleting the 2 commenting-out slashes and uploading the file again was all that was necessary to make the feed acceptable to Google Reader.

D'oh!

(The feed for my photo galleries is here.)

Posted on 18 Jul 2008 at 22:06 in /technology/internet. -- Permalink

Wed, 23 Apr 2008

Wuala

Today, after some weeks of impatience, I finally received an e-mail inviting me to be an "early adopter" of the alpha version of Wuala. Wuala is an application for different operating systems which makes storing and sharing files and folders over the internet quite easy. The idea is basically to trade some space on one's own HDD for space on other people's computers, but even without this you get 1 GB from Wuala. All files are encrypted in order to protect them from people who haven't been authorised to access them by their owner.

"After a quick download, Wuala is ready." In Windows XP, I found this to be the case - not quite in Linux, though. Apart from some packages (portmap, nfs-common and a few dependencies) I had to install, which are mentioned in a Readme file, and adding a line to my fstab, I also had to get a certain version of Java (sun-java6-jre) and finally copy a file into a different directory; this I only learned after searching the Wuala forum for the error messages I had got. Still, this is just the amount of trial and error which is normal for Linux (and is part of the fun!) - and so far Wuala is only an alpha version.

Once it works it's great. Very useful, very convenient, very easy to use, very fast. I'm impressed.

Posted on 23 Apr 2008 at 22:35 in /technology/internet. -- Permalink

Fri, 14 Mar 2008

Latest Snort on an ancient box

I installed Snort on my old laptop, finally got registered as a user, downloaded and installed up-to-date Snort rules. Now running Snort doesn't bind any resources on the computer I'm using every day and everyone on my network can feel safe from those evil hackers - although this set-up probably won't help reduce our electricity bills.

Posted on 14 Mar 2008 at 17:39 in /technology/internet. -- Permalink

Sat, 09 Feb 2008

My Taiwan wiki thing

These days I'm "working" on my personal Taiwan wiki thing, which is why I seldom post stuff here. I'm getting to know MoinMoin better and better - it's a really nice piece of software, very very well thought out, fun to use. Finding out more and more about Taiwan and adding relevant information to my wiki is a lot of fun, too. What I read about this country, mainly on Wikitravel pages, is very promising.

I look forward to our trip. Should I take my computer? The AC adapter will work fine with Taiwan's different voltage (115 V).

Posted on 09 Feb 2008 at 21:31 in /technology/internet. -- Permalink

Fri, 01 Feb 2008

MoinMoin wiki, personal Taiwan wiki

Yesterday I installed a MoinMoin wiki on this server. I was a bit surprised that installing MoinMoin is somewhat less straightforward than installing WordPress (even though the former doesn't even use a database). In part, this seems to be the flip side of MoinMoin's flexibility; but I think there's some room for improvement regarding the documentation, too. In any event, it's always interesting to learn the basics of how such a thing works.

I think a wiki will be useful for taking notes in a structured way, e.g. in preparation of our next trips (to Taiwan and to Sicily). My personal Taiwan wiki is found at http://tstigers.net/cgi-bin/moin.cgi/Taiwan.

Posted on 01 Feb 2008 at 17:47 in /technology/internet. -- Permalink

Thu, 24 Jan 2008

Too stupid to use a computer

That's what I guess I am. After this Paypal problem I described yesterday and now, the solution to the weird Wordpress problem which I described in detail, and which has given me day after day of trouble, it's the only plausible explanation.

The solution: logged onto Wordpress, clear the cache and reload the page. All the icons I missed are back and, miraculously, I can save and publish posts without any problems.

I should have known: why didn't I try this earlier? What's the first thing you do after an update, even before you start fumbling with the Wordpress plugins?

Posted on 24 Jan 2008 at 17:43 in /technology/internet. -- Permalink

Wed, 23 Jan 2008

PayPal puzzle

We're getting a lot of spam e-mails at the office, some of which are phishing messages which appear to come from Paypal. In order to be on the safe side, I changed the "primary" e-mail address of our account and removed the office e-mail address. Unfortunately, Paypal doesn't warn you that this may lead to problems. In my case, the problem was that the "Make a donation" link on our website still used the old e-mail address, with the result that a donation was cancelled. (Paypal informed me by e-mail - to the old address - of both the donation and the cancellation.)

This kind of thing is really annoying because, apart from fees which have to paid although the money doesn't get through, there's always the risk of putting donors off. What I find most remarkable about the whole event, though, is the fact that it didn't get recorded in any way on the account. When I log in and view "all activity", there's no indication that a donation was made or cancelled. It seems that the Paypal system was unable to find our account - just because I changed the e-mail address.

Apparently, the only way for a "Make a donation" button to "know" which account the money is supposed to go to is the e-mail address associated with that account. But if this is so, then I don't understand why this isn't pointed out to a user when they change this e-mail address.

Posted on 23 Jan 2008 at 20:17 in /technology/internet. -- Permalink

Tue, 22 Jan 2008

Smart card relay attack

I found this interesting article on the Light Blue Touchpaper blog. Will I ever use any card again to pay for anything?

University of Cambridge, Computer Laboratory, Security Group.

Posted on 22 Jan 2008 at 16:25 in /technology/internet. -- Permalink

Mon, 21 Jan 2008

Online banking (2)

So far, so good. aqhbci-tool works fine - but I can't enter what I believe is myPIN: it's too long. However, this might not be my PIN at all; if it isn't, I'm afraid I just don't know my PIN. Anyway it seems I have added a PIN/TAN medium, which isn't what I normally use, but with my key file I'm getting nowhere. No idea how to tell aqhbci-tool to use this file.

Helpful websites:

Konsolenbasiertes Online Banking mit Linux

AqBanking/aqhbci-tool - LinuxWiki.org (most of which is identical to the above website)

AqBanking - LinuxWiki.org

FinTS (provides HBCI details of your bank)

Posted on 21 Jan 2008 at 14:53 in /technology/internet. -- Permalink

Online banking: GnuCash

I'm trying to get GnuCash to work with my bank account, which I can access via HBCI. Installing GnuCash the "normal", Synaptic way didn't get me there. Downloading and compiling the gwenhwyfar (great name, isn't it!), ktoblzcheck (great in a different way!) and aqbanking libraries myself seems to work better.

Posted on 21 Jan 2008 at 14:14 in /technology/internet. -- Permalink

Survived an attack

I'm sometimes running Snort just for fun. Today, it recorded an attempted maclicious intrusion into my network. The "just for fun" times are over! Ignorance is bliss? I don't think so. From now on, Snort will run all the time.

01/20-20:48:09.670188 [*] [1:2329:6] MS-SQL probe response overflow attempt [*] [Classification: Attempted User Privilege Gain] [Priority: 1] {UDP} 84.134.212.178:11878 -> 192.168.1.101:40763
01/20-20:48:31.097220 [*] [1:2329:6] MS-SQL probe response overflow attempt [*] [Classification: Attempted User Privilege Gain] [Priority: 1] {UDP} 84.134.212.178:11878 -> 192.168.1.101:40763
01/20-20:48:33.606816 [*] [1:2329:6] MS-SQL probe response overflow attempt [*] [Classification: Attempted User Privilege Gain] [Priority: 1] {UDP} 84.134.212.178:11878 -> 192.168.1.101:40763
01/20-20:48:37.844447 [*] [1:2329:6] MS-SQL probe response overflow attempt [*] [Classification: Attempted User Privilege Gain] [Priority: 1] {UDP} 84.134.212.178:11878 -> 192.168.1.101:40763
01/20-20:48:46.226764 [*] [1:2329:6] MS-SQL probe response overflow attempt [*] [Classification: Attempted User Privilege Gain] [Priority: 1] {UDP} 84.134.212.178:11878 -> 192.168.1.101:40763
01/20-20:48:48.389560 [*] [1:2329:6] MS-SQL probe response overflow attempt [*] [Classification: Attempted User Privilege Gain] [Priority: 1] {UDP} 84.134.212.178:11878 -> 192.168.1.101:40763

Posted on 21 Jan 2008 at 00:02 in /technology/internet. -- Permalink

Wed, 16 Jan 2008

Anonymous communication

I'm reading "A survey of anonymous communication channels", by Claudia Diaz and George Danezis, which I found on the Conspicuous Chatter blog ("Introducing Anonymous Communications"). It's an introduction to different methods used for anonymous communications - highly interesting reading.

Posted on 16 Jan 2008 at 17:05 in /technology/internet. -- Permalink

Fri, 11 Jan 2008

Nautilus as FTP client

Although I like to use command-line tools, I've taken to uploading stuff to the web using Nautilus, the Gnome file manager. Copy and Paste (or even Drag and Drop) makes it very comfortable to use, and it has SFTP support.

Posted on 11 Jan 2008 at 16:44 in /technology/internet. -- Permalink

Thu, 10 Jan 2008

K2 problem solved, sort of ...

I dragged the categories, search, recent posts and links widgets into the relevant boxes (great that the left box refers to the right sidebar and the right to the left ...); now everything in the sidebars is displayed again, even on static pages and with individual entries. In other words, I had to set up the sidebars from scratch. So far, so good - but how did this happen in the first place? I didn't update or change anything, neither WordPress nor K2, and updating WordPress didn't make anything better or worse.

Posted on 10 Jan 2008 at 14:43 in /technology/internet. -- Permalink

K2 sidebar problem

Suddenly, my "entries" blog has a problem with the sidebars. The theme I'm using is K2 (Release Candidate 3). Its sidebar manager has always been very slow and somewhat tricky to use. Now, the left sidebar (which I set to display the categories) has disappeared almost completely, only a blue bar at the top of the column is left. The right sidebar, which contains the search field, latest posts, blogroll and links, is displayed on the start page (also for older articles) but not on the other (static) pages or with individual posts. The sidebar editor ("Widgets" in the "Presentation" section) displays "Default sidebar" for both sidebars, informing me that the "usual sidebar" of this theme will be displayed because the 2 boxes are empty but I can drag widgets into them. I'm afraid that doing so would mess things up completely. (The problem is the same on different computers and in different browsers, so probably unrelated to the Amity website problem.) What now?

Posted on 10 Jan 2008 at 14:26 in /technology/internet. -- Permalink

Weird Firefox problem

The Amity website displays without any style information and without any pictures in my Firefox under Linux (2.0.0.11, Ubuntu 7.10/Gutsy). Nothing seems to be wrong with the website - it looks perfectly fine both in Galeon and in Firefox under Mac OS X, even after clearing the cache. Other websites look fine in Firefox under Linux, too. After killing and restarting Firefox, exactly the same problem. What the heck is going on here?

Posted on 10 Jan 2008 at 14:08 in /technology/internet. -- Permalink

Updating WordPress using Subversion

I just updated my "entries" blog using Subversion for the first time. Worked without a hitch and took no longer than a few seconds. I'm very pleased.

Posted on 10 Jan 2008 at 14:02 in /technology/internet. -- Permalink

Tue, 08 Jan 2008

NAN-Webserver

Yesterday I somehow stumbled on the website of Michael W. Kühn, a German maths teacher. Maybe I was looking for a Windows-based picture gallery application, which my father could use to post his photos on the web. This website is very well made and offers some real gems.

Following a link from Mr. Kühn's commented selection, I found the "NAN-Webserver", which I installed and tested today. It's a small, free webserver for Windows and the really nice thing is that it can run on a USB stick or external hard disk. It doesn't need any installation, you just unzip the downloaded file. The application comes with a "php" folder, where you can unzip the zipped Windows version of PHP, and with a "file" folder, where you can put the files you want to access at localhost. (Pointing the server to a different place is very easy, too.) This makes for a very nice portable testing environment for web pages written in PHP. Too bad the documentation is in German only, even though personally I don't mind ...

I also tried Mr. Kühn's picture gallery program. Personally, I far prefer jigl; this wonderful command-line tool can actually be made to work under Windows, but it's way too complicated for my father. I just might be able to convince him to use BilderGalerie (and FileZilla), though.

Posted on 08 Jan 2008 at 23:05 in /technology/internet. -- Permalink

Sat, 08 Dec 2007

FTP preserving file attributes

In order to preserve files attributes when downloading them over FTP, simply tar them, then download the tar file. It seems you can't do anything interesting without shell access ...

Posted on 08 Dec 2007 at 10:54 in /technology/internet. -- Permalink

Fri, 07 Dec 2007

Relative links in Blosxom (4): fixed

The version of the rename command on my remote server is from 2000 or so and doesn't understand perl expressions. Instead, it works like "from to file".
So I had to change the last line of my script to:

rename txt.new txt *.new

I then ran the script in each directory. Now everything seems OK. Good-bye, relative paths!

Posted on 07 Dec 2007 at 16:40 in /technology/internet/blosxom. -- Permalink

Relative links in Blosxom (3)

The final version of my little shell script is here ... I had to keep the original files in order to set the timestamps of the corrected files back. This is why the original files couldn't simply be overwritten with the corrected ones. In the end, however, obviously the original files had to be discarded and the corrected files had to be given the same names as the original ones.

#/bin/bash
for i in *.txt;
do sed 's/href="blosxom\.cgi/href="http://\/\/tstigers\.net\/cgi-bin\/blosxom\.cgi/g' $i > $i.new;
touch -r $i $i.new;
done;
rm *.txt;
rename 's/\.new//' *.new

This works fine locally. If anything goes wrong when I run it on my remote server, I'll have wrecked my whole Blosxom blog. But what's the alternative? Blosxom's dependence on file timestamps makes it difficult to create backups. I guess I should have a look at low-level copying.

But maybe it's enough to write a script which copies all files and folders of the Blosxom blog and sets the timestamp of each copied file according to the timestamp of the original file. Such a script wouldn't change anything in the original place - no writing there, only reading.

So the problem of recursively entering directories comes up again. Well, I guess it's still easier to run such a script in every single directory and pass it the correct path to the original files every time.

Posted on 07 Dec 2007 at 14:08 in /technology/internet/blosxom. -- Permalink

Relative links in Blosxom (2)

I found writing a script which changes relative to absolute paths less trivial than I had anticipated.

Editing multiple files in vim ("argdo") is OK - but what happens when your command doesn't apply to all open files (e.g. because you want to substitute something which in some of these files just isn't there)? vim doesn't just skip them but refuses to do anything in any file.

Regarding sed, at first I didn't realise that by default all output is written to standard output, so you have to pipe the output into a file if you want your substitutions to be permanent. Now I've got a simple shell script which loops through all file names in a directory, substitutes relative links with absolute ones and writes the result in a new file:

#/bin/bash
for i in *.txt;
do sed 's/href="blosxom\.cgi/href="http://\/\/tstigers\.net\/cgi-bin\/blosxom\.cgi/g' $i > $i.new;
done

I'm sure that this is not the most elegant solution - but it works. It would be nicer to have a script which does the trick recursively for all directories; but with the handful of directories I have, entering every directory by hand and running the script there is probably easier than writing and testing such a fully automatic script.

Next step: reading the timestamp of each original file and setting the timestamp of each new file to the timestamp of the corresponding original file. It shouldn't be too difficult to do this by incorporating a "touch" command into my script. Finally, I'll need to run this script on my server: downloading all Blosxom text files to my local machine changes the timestamps, of course.

Posted on 07 Dec 2007 at 13:19 in /technology/internet/blosxom. -- Permalink

Thu, 06 Dec 2007

Bad Behavior - no solution - oh yes, a solution!

Acting on instructions I found on the Bad Behavior website, I accessed the databases of my two websites and searched the Bad Behavior table for my (workplace) IP address. On one of the websites, I found one completely innocent entry - in the other website, nothing at all.

Am I looking in the wrong place? "bad_behavior_log table" it says on the Bad Behavior website, and this table should have a "denied_reason" field. I can't see either.

Oh well. Found something after all. I had to look through other users' comments to the instructions I mentioned. Some of them had the same problem as I. One of them, however, mentioned another post on the same website, which I then found. Well, that's convenient ... :-(

Apparently, the creator of Bad Behavior ruined his own plugin by mistake yesterday and, as a result, found himself locked out of his blog, too. Now he's made a new version available for download. However, only his latest post provides a download link to the updated version.

I mean, this guy offers a great WP plugin for free and I'm obviously very grateful for that. However, a link or just a few words on the page where most people will probably start looking for help when they find themselves blocked by Bad Behavior - this would have saved me, and presumably a lot of other people, hours of googling, reading, searching their databases, trying this and that ...

Posted on 06 Dec 2007 at 15:50 in /technology/internet. -- Permalink

Relative links in Blosxom

I realised I made a stupid mistake - I used relative paths instead of absolute ones for the internal links on this blog. The relative links work fine when you click on them from the main page; they lead to nirvana when you're on a different page, e.g. after clicking on a category path. The reason is that Blosxom creates a pseudo-path for such a page, appending stuff to the name of the Blosxom script file (blosxom.cgi).

Fixing this will be quite a hassle: editing the relevant files (using sed or just vim) is easy enough but resetting the timestamp individually for each file will be cumbersome. Can I do this automatically with a script?

Posted on 06 Dec 2007 at 13:02 in /technology/internet/blosxom. -- Permalink


Powered by Blosxom RSS feed: technology/internet/index.rss