For about a month now I and other people have been unable to use the blogger api to update our blogs. This is one of a raft of problems caused by a recent update of the blogger system, and some other ones (including the fact my OpenID is broken) are still outstanding. However, the OpenID thing isn't a big deal, whereas the api blog posting is something I use a lot.
I can happily report that the Blogger/Google people have come through for us and found the problem. I had been losing hope, because as a linux user I'm used to having people break stuff, and then say the problem is that I'm running linux. But, though it's admittedly taken them a while, google's blogger team have dug to the bottom of the problem and found the cause. Maybe I should have more faith in future, we'll see.
If you've found that your blogger API client program has stopped working in the last month, then what follows is what you need to do to get it working again.
Saturday, 18 June 2011
Friday, 27 May 2011
Google's Blogger Service is Broken
Since about 2011/05/22 google's "Blogger" service (where this blog is hosted) has been experiencing serious problems. You can see a list of increasingly irate people here . It's a weird fault that hits different people in different ways. Some can't log in, some can't log out, some can log in but can't post.
I've not been as heavily affected as some, I can still log in to the website and post to my blog. However, I can't use the 'blogger api' to post from applications. Other people using blogging applications like MacJournal or ScribeFire are having the same problem.
The amazing thing is how long it's taking google to fix this, days. Also it seems to me (though I may be wrong) that this is linked to a recent decision by google to turn on 'Spam Checking' on everyone's blog comments. They didn't ask us if we wanted this turned on, they didn't suggest we turn it on, they just went and turned it on for us. They did this a while back with 'google buzz', turning it on and in the process revealing users gmail contacts to the whole world. I conclude from this (assuming I'm right about the cause) that google learns nothing from history.
But there's a bigger issue there. We're told that everything is moving into 'the cloud', that big competent companies will 'look after our data' and make thing effortless for us. You know, big competent companies like BP, or Toyota, or Enron, or Sony, or Google, or any bank, or...
These big companies aren't exactly covering themselves with glory these days. Would you really trust them with your business critical data?
I've not been as heavily affected as some, I can still log in to the website and post to my blog. However, I can't use the 'blogger api' to post from applications. Other people using blogging applications like MacJournal or ScribeFire are having the same problem.
The amazing thing is how long it's taking google to fix this, days. Also it seems to me (though I may be wrong) that this is linked to a recent decision by google to turn on 'Spam Checking' on everyone's blog comments. They didn't ask us if we wanted this turned on, they didn't suggest we turn it on, they just went and turned it on for us. They did this a while back with 'google buzz', turning it on and in the process revealing users gmail contacts to the whole world. I conclude from this (assuming I'm right about the cause) that google learns nothing from history.
But there's a bigger issue there. We're told that everything is moving into 'the cloud', that big competent companies will 'look after our data' and make thing effortless for us. You know, big competent companies like BP, or Toyota, or Enron, or Sony, or Google, or any bank, or...
These big companies aren't exactly covering themselves with glory these days. Would you really trust them with your business critical data?
Tuesday, 10 May 2011
Things I wish people had told me about 1: Bind Mounts
Stuff I wish people had told me about No. 1
Bind Mounts
Quite often I find myself wanting to run processes in a chroot. This is especially true for file services being served up by ftp or http. Unfortunately I often find that files I want people to get access to are outside the directory that I want to chroot them into.
Now, symbolic links won't work across chroot, and though you can use a hard-link to make files individually available within a chroot, it becomes a lot of work for a lot of files.
Just recently though, I discovered that you can do this:
mkdir /home/PublicData
mount --bind /home/PublicData /home/chroot/PublicData
These 'bind mounts' allow you to 'mount' a directory onto another directory. So, you create an empty directory with a particular name, then call the mount command to mount another directory onto your empty directory, so that when people enter the 'empty' directory, they are teleported to the other directory.
This means that you can choose which directories to make available to people who are in some kind of chroot jail. Very useful!
I wish someone had told me about this earlier.
Bind Mounts
Quite often I find myself wanting to run processes in a chroot. This is especially true for file services being served up by ftp or http. Unfortunately I often find that files I want people to get access to are outside the directory that I want to chroot them into.
Now, symbolic links won't work across chroot, and though you can use a hard-link to make files individually available within a chroot, it becomes a lot of work for a lot of files.
Just recently though, I discovered that you can do this:
mkdir /home/PublicData
mount --bind /home/PublicData /home/chroot/PublicData
These 'bind mounts' allow you to 'mount' a directory onto another directory. So, you create an empty directory with a particular name, then call the mount command to mount another directory onto your empty directory, so that when people enter the 'empty' directory, they are teleported to the other directory.
This means that you can choose which directories to make available to people who are in some kind of chroot jail. Very useful!
I wish someone had told me about this earlier.
Tuesday, 12 April 2011
Root's bash profile not working when su
A reaccuring annoyance for me is getting root's bash_profile to work, and everytime I fix it, I promptly forget what I did, so here's a post for me to refer to if noone else!
Things like the users PATH and other environment variables can be set up in a file in their home directory called .bash_profile. If they're using the Bourne Again Shell then this file gets read when they login, and any commands in it are run to set up their environment. But in my experience it never works for root.
There's a difference between root and other users though, I almost never login as root, I login as another user and then 'su' to root. Turns out that an 'su' doesn't count as a login, and '.bash_profile' only gets read and run for login shells. If other types of shell get started up, say by being launched from a program or whatever, then another file '.bashrc' is read instead. So, if I put the same commands in /root/.bashrc that I normally would in /home/user/.profile, then they will work when I 'su'.
Finally there are 'global' bashrc and profile files that can be put in /etc, and these will be run for all users before any profile or bashrc in their home directory is run. Note that these files don't have the leading '.', so instead of /home/user/.bashrc, it's /etc/bashrc. And for the profile, it's /etc/profile instead of /etc/bash_profile as you might expect! Oh, and finally, these global files don't seem to work for /root.
So, to get the PATH and prompt etc set for everyone, create /etc/profile for all users but root, and then copy it to /root/.bashrc, and /root/.bash_profile and that should cover 'su' and 'login' shells for root too.
Things like the users PATH and other environment variables can be set up in a file in their home directory called .bash_profile. If they're using the Bourne Again Shell then this file gets read when they login, and any commands in it are run to set up their environment. But in my experience it never works for root.
There's a difference between root and other users though, I almost never login as root, I login as another user and then 'su' to root. Turns out that an 'su' doesn't count as a login, and '.bash_profile' only gets read and run for login shells. If other types of shell get started up, say by being launched from a program or whatever, then another file '.bashrc' is read instead. So, if I put the same commands in /root/.bashrc that I normally would in /home/user/.profile, then they will work when I 'su'.
Finally there are 'global' bashrc and profile files that can be put in /etc, and these will be run for all users before any profile or bashrc in their home directory is run. Note that these files don't have the leading '.', so instead of /home/user/.bashrc, it's /etc/bashrc. And for the profile, it's /etc/profile instead of /etc/bash_profile as you might expect! Oh, and finally, these global files don't seem to work for /root.
So, to get the PATH and prompt etc set for everyone, create /etc/profile for all users but root, and then copy it to /root/.bashrc, and /root/.bash_profile and that should cover 'su' and 'login' shells for root too.
Monday, 4 April 2011
Nvidia drivers fail without 'smp_lock.h'
If you install a very recent kernel from www.kernel.org, and then try to install the NVIDIA graphics drivers, you may find that the driver install fails. The NVIDIA installer actually compiles the drivers against your kernel source tree, but recent kernels seem to have dropped a file that's called 'smp_lock.h'. Unable to find this file that it expects to have, the NVIDIA driver compile process fails.
A quick and dirty solution that worked for me was to simply locate 'smp_lock.h either under /usr/include/linux, or in an old kernel source tree, and drop it into the include/linux directory of your new kernel source tree. If you can't get a copy of a the file, then try making an empty file with the same name, I think even that will probably work. You should then find that the NVIDIA install process gets by that hurdle at least. It worked for me!
A quick and dirty solution that worked for me was to simply locate 'smp_lock.h either under /usr/include/linux, or in an old kernel source tree, and drop it into the include/linux directory of your new kernel source tree. If you can't get a copy of a the file, then try making an empty file with the same name, I think even that will probably work. You should then find that the NVIDIA install process gets by that hurdle at least. It worked for me!
Monday, 7 February 2011
I'm up on "Daily Science Fiction"
Well, on Friday my story "Imaginary Enemies" went out on the Daily Science Fiction mailing list. My first pro-paying publication. What feed-back I've seen from readers is good, no one hated it, many people are saying they liked it. I'd like to thank my friends and family, and Sainsbury's for doing the catering. I'm sure my sudden success won't change me.
Actually, I was kinda hoping it would change me, but no signs yet.
Anyways, in a week or so it's apparently going to get posted to the Daily SF website for everyone to see, even those who aren't on the mailing list, and no doubt then the bidding war for film rights will start!!
Friday, 28 January 2011
Broadband speedtests that don't need flash or java
Look, I don't want to install flash or java just to find out how fast my internet connection is. I just want something that downloads a file and gives me a result. Here are some websites that do this basic thing.
1) Tracert.org
http://www.tracert.org/bandwidth_meter/
For me the best one, almost magical in fact. You just click 'start test', and it works. Works in old versions of firefox without flash, and seems to produce results that agree with other tests.
2) Ten Meg
http://tenmeg.myby.co.uk/
Yes, it requires you to watch a couple of images downloading and click a button when they're done, but it works in browsers without flash, java, activex, siverlight, perl, ruby, php, gtk, etc, etc, etc, etc.
3) ISP GEEKS
http://www.ispgeeks.com/wild/modules.php?name=Bandwidth_Meter_DSL
Described as their 'Mobile Speed Test', doesn't seem very accurate (perhaps because they're in the USA and I'm in the UK), but it gives a rough idea and doesn't need flash etc.
4) Broadband speed checker
http://www.broadbandspeedchecker.co.uk/
Seems to work in I.E. without flash, though it says it would like to have flash 8. Unfortunately seems to be broken in earlier versions of firefox.
5) Toast.net
http://performance.toast.net/
Again, not massively accurate, but simple and kinda fun waiting for the picture to download!
6) Mobile test
http://i.dslr.net/iphone_speedtest.html
Aimed at mobile phone browsers, but if you click the 'wifi' option, it seems to give a fairly accurate result (but that could be a co-incidence).
1) Tracert.org
http://www.tracert.org/bandwidth_meter/
For me the best one, almost magical in fact. You just click 'start test', and it works. Works in old versions of firefox without flash, and seems to produce results that agree with other tests.
2) Ten Meg
http://tenmeg.myby.co.uk/
Yes, it requires you to watch a couple of images downloading and click a button when they're done, but it works in browsers without flash, java, activex, siverlight, perl, ruby, php, gtk, etc, etc, etc, etc.
3) ISP GEEKS
http://www.ispgeeks.com/wild/modules.php?name=Bandwidth_Meter_DSL
Described as their 'Mobile Speed Test', doesn't seem very accurate (perhaps because they're in the USA and I'm in the UK), but it gives a rough idea and doesn't need flash etc.
4) Broadband speed checker
http://www.broadbandspeedchecker.co.uk/
Seems to work in I.E. without flash, though it says it would like to have flash 8. Unfortunately seems to be broken in earlier versions of firefox.
5) Toast.net
http://performance.toast.net/
Again, not massively accurate, but simple and kinda fun waiting for the picture to download!
6) Mobile test
http://i.dslr.net/iphone_speedtest.html
Aimed at mobile phone browsers, but if you click the 'wifi' option, it seems to give a fairly accurate result (but that could be a co-incidence).
Wednesday, 25 August 2010
ALSA drivers not working for Cirrus Logic CS46xx soundcard
If you are using OSS emulation for ALSA on a laptop with a CS46xx card, and are getting no sound, then read on.
I use a really old laptop (Ascentia M-Series dating from 1998) that I carry about in places where I think anything nicer would get stolen/drowned in spilled tea/rolled over by a forklift. One thing that has long annoyed me about this laptop though, is that the sound doesn't work. Things would appear to be working, mplayer would claim it was playing .mp3 files, but no sound would come out.
The sound card is a cirrus logic CS4624B, and everyone says that these are a pig to get working, requiring lots of meddling with old-style Plug-and-Pray settings because, in these old laptops, the soundcard is on an isa bus.
Funny thing is though, that back in the day when I used OSS for sound, rather than ALSA, the soundcard worked fine. Why would ALSA suddenly have irq or resource issues that require me to mess with isapnp, when OSS didn't?
In the end, the problem turned out to have nothing to do with irq's, io-ports or plug-and-play. Basically there is a bug in ALSA. For these cards, ALSA sets everything to 'Mute' by default. This doesn't mean it sets the sound level to zero, it seems to be more than that, it actually does some magic 'mute' thing to the card that you have to unlock. Unfortunately, the OSS compatibility module that makes the sound-card visible to programs that use the old OSS interface, doesn't know how to mute/unmute, so the card stays muted no matter what you do.
Or it might not be the mute, it might be the fact that one of the volume controls 'Master' doesn't appear to be exported to the OSS emulation, under ALSA volume control programs you see the 'Master' setting, but under OSS volume controls, you don't.
The only solution I've found is to install the alsa libraries, and use 'alsamixer' to initially set up the card and volume levels. Suddenly BINGO! It works! No need to meddle with irq's and isapnp.conf.
However, I didn't really want to install the ALSA libraries, that's why I'm using OSS emulation. But, more and more these days Linux is becoming another O.S. of you-will-do-as-we-say. IF you want to use software X, you will install lots of libraries and now you're going to have to upgrade your computer. If I have to upgrade my computer, then why not just put windows on it or get a mac and be done with it, hmmm??
I use a really old laptop (Ascentia M-Series dating from 1998) that I carry about in places where I think anything nicer would get stolen/drowned in spilled tea/rolled over by a forklift. One thing that has long annoyed me about this laptop though, is that the sound doesn't work. Things would appear to be working, mplayer would claim it was playing .mp3 files, but no sound would come out.
The sound card is a cirrus logic CS4624B, and everyone says that these are a pig to get working, requiring lots of meddling with old-style Plug-and-Pray settings because, in these old laptops, the soundcard is on an isa bus.
Funny thing is though, that back in the day when I used OSS for sound, rather than ALSA, the soundcard worked fine. Why would ALSA suddenly have irq or resource issues that require me to mess with isapnp, when OSS didn't?
In the end, the problem turned out to have nothing to do with irq's, io-ports or plug-and-play. Basically there is a bug in ALSA. For these cards, ALSA sets everything to 'Mute' by default. This doesn't mean it sets the sound level to zero, it seems to be more than that, it actually does some magic 'mute' thing to the card that you have to unlock. Unfortunately, the OSS compatibility module that makes the sound-card visible to programs that use the old OSS interface, doesn't know how to mute/unmute, so the card stays muted no matter what you do.
Or it might not be the mute, it might be the fact that one of the volume controls 'Master' doesn't appear to be exported to the OSS emulation, under ALSA volume control programs you see the 'Master' setting, but under OSS volume controls, you don't.
The only solution I've found is to install the alsa libraries, and use 'alsamixer' to initially set up the card and volume levels. Suddenly BINGO! It works! No need to meddle with irq's and isapnp.conf.
However, I didn't really want to install the ALSA libraries, that's why I'm using OSS emulation. But, more and more these days Linux is becoming another O.S. of you-will-do-as-we-say. IF you want to use software X, you will install lots of libraries and now you're going to have to upgrade your computer. If I have to upgrade my computer, then why not just put windows on it or get a mac and be done with it, hmmm??
Wednesday, 2 June 2010
M. T. Urself
So, I had a server that was misbehaving in a truely weird way. I was accessing this server via and ADSL line, connecting into it using Secure Shell. Any large amount of data pulled from it caused the network connection to drop. But I could push as much data to it as I liked. Huge uploads worked fine, but downloads would get me disconnected instantly. Logging in and typing 'ps ax' would normally only get me half the page of output before the connection froze up. Also, anything that posted information to websites, like logging into googlemail for instance, seemed to freeze as well.
I tried altering the firewall, the router, the routing table on the server, recompiling the kernel, etc, etc, all to no avail. After each new attempt the problem would seem to go away, cruely making me think I'd fixed it, before returning again.
Now, often in the past when there's been network problems, some old unix-hacker with open-toed sandals and a grateful-dead t-shirt has been around to say; "You know man, could it be, like, the MTU?"
The MTU. That thing they had on modems, remember? No, I don't suppose you would.
I tried altering the firewall, the router, the routing table on the server, recompiling the kernel, etc, etc, all to no avail. After each new attempt the problem would seem to go away, cruely making me think I'd fixed it, before returning again.
Now, often in the past when there's been network problems, some old unix-hacker with open-toed sandals and a grateful-dead t-shirt has been around to say; "You know man, could it be, like, the MTU?"
The MTU. That thing they had on modems, remember? No, I don't suppose you would.
Friday, 16 April 2010
Quick and Dirty Webcam monitoring
Just thought I'd mention a very quick and dirty way to get 'webcam monitoring' going. I've done this with axis webcams, but it should work with any webcam that allows you to fetch a jpeg image from a url.
This will, of course, be working under linux. It's only using the standard 'Borne' shell and a program called 'links' so it should work under FreeBSD and Mac OSX too.
The command-line webbrowser, 'links' has an option called -'-source'. This has the effect that a webpage or item fetched using http with links is written in raw format to stdout. So
links -source http://media.libsyn.com/media/djsteveboy/the_swing_set.mp3 > TheSwingSet.mp3
Will download the example .mp3 file.
Most axis webcams allow you to download an image from http://<webcamip>/axis-cgi/jpg/image.cgi, so we can use links to Grab an image thusly:
links -source http://192.168.5.4:1000/axis-cgi/jpg/image.cgi > snapshot.jpg
Of course, what's best is to get images every couple of seconds and put them into a date/timestamped file. Here's the script I've been using, it creates directories for each hour of a day, and puts timestamped .jpg files in them.
#! /bin/sh
cd /home/Public/AxisWebcam
while [ 1 = 1 ]
do
DIR=`date "+%d_%m_%Y_Hour-%H"`
FILE=`date "+%H_%M_%S.jpg"`
mkdir $DIR
links -source http://192.168.5.4:1000/axis-cgi/jpg/image.cgi > $DIR/$FILE
sleep 2
done
One issue is that links doesn't have any way (that I know of) of expressing a username/password to access a website. Fortunately, Axis cameras have a setup option under 'Setup->Users' called 'Enable anonymous viewer login'. This allows access to the image without having to supply a username and password.
If you're going to leave this script running, you may want to periodically run a command like:
find -mtime +7 -exec rm -f {} \;
This command will delete any files older than a week.
And that's it!
This will, of course, be working under linux. It's only using the standard 'Borne' shell and a program called 'links' so it should work under FreeBSD and Mac OSX too.
The command-line webbrowser, 'links' has an option called -'-source'. This has the effect that a webpage or item fetched using http with links is written in raw format to stdout. So
links -source http://media.libsyn.com/media/djsteveboy/the_swing_set.mp3 > TheSwingSet.mp3
Will download the example .mp3 file.
Most axis webcams allow you to download an image from http://<webcamip>/axis-cgi/jpg/image.cgi, so we can use links to Grab an image thusly:
links -source http://192.168.5.4:1000/axis-cgi/jpg/image.cgi > snapshot.jpg
Of course, what's best is to get images every couple of seconds and put them into a date/timestamped file. Here's the script I've been using, it creates directories for each hour of a day, and puts timestamped .jpg files in them.
#! /bin/sh
cd /home/Public/AxisWebcam
while [ 1 = 1 ]
do
DIR=`date "+%d_%m_%Y_Hour-%H"`
FILE=`date "+%H_%M_%S.jpg"`
mkdir $DIR
links -source http://192.168.5.4:1000/axis-cgi/jpg/image.cgi > $DIR/$FILE
sleep 2
done
One issue is that links doesn't have any way (that I know of) of expressing a username/password to access a website. Fortunately, Axis cameras have a setup option under 'Setup->Users' called 'Enable anonymous viewer login'. This allows access to the image without having to supply a username and password.
If you're going to leave this script running, you may want to periodically run a command like:
find -mtime +7 -exec rm -f {} \;
This command will delete any files older than a week.
And that's it!
Subscribe to:
Posts (Atom)