Category Archives: Tips

rsync & permission denied/operation not permitted & arch linux

I use rsync to sync directories between machines but one of my machines kept screwing up the permissions, I finally get time to track the “Operation not permitted” issue and it turned out to my vfat backup drive not being mounted under the right uid.

Coming from the old school Unix background, I thought updating /etc/fstab would be enough but due to this auto mount system it is done differently ;-)

It turns out you need to change the rules for the auto mount via file /etc/udev/rules.d/11-media-by-label-auto-mount.rules

So what did I need to change? Well it turned out to be simple uid= to match the uid of my normal user (use id xxx, where xxx is your username)

Below are the changes:

ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs",
ENV{mount_options}="$env{mount_options},utf8,
uid=501,gid=100,umask=002"

New Gadget

Over the last couple of years I have not been getting on too well with my second generation iPod Touch but it has been a bit of a love hate relationship… I love it when works well with my mac’s at home but find it a real pain on Windows, it works but it feels like I’m forcing it to work… even the sound feel damp and uninspiring..

Anyway, I thought it time was to try something different out, so I had a look around and decided to pick up the Cowon J3.

So what do I think about it, well I had an interesting first day experience… I managed to brick… yes… completely brick it… even for me this was a first!

I used to have an old creative labs mp3 player and this used Microsoft’s MTP protocol and so did the new shinney J3… so I downloaded and built libmtp and started to play around with the protocol to see if I could automatically create some playlist… well that was my intention… a couple of hours later the cowon froze up on me and pressed the reset switch and the reset button… and the rest has gone down in brick laying history..

Using the guide at iaudiophile.net I manager to get the right tools and the firmware to try and repair it myself.

Using the tools above, I managed to install a new firmware but it still crashed with “checking albums” on startup.. so I decided to place the firmware on the micro sd card and I found it booted off this…. wow I thought its not completely bricked… Then I was able to mount the drive… re-format it as fat and then I re-installed the firmware… this time it worked!

Anyway, as you can imagine after this first day experience I really was not too impressed with myself, libmtp or the cowon.

Nows, its a couple of weeks later… I now have started to like my lovely cowon… at first I thought the user interface was childish but it has grown on me.. it simpy works when I need it to work.. however the nicest surprise is that I now love my music again but I have left libmtp alone!

Michael’s very own “Getting Started with Visual COBOL”

Michael Burgun over at his own blog space has started blogging about using Visual COBOL… Its worth a look as having meet Michael last year I can honestly say he is a very knowledgeable and experienced chap, so I am sure he will impart some of his own wisdom..

The articles are: .NET greenfield development in Micro Focus Visual COBOL 2010
and today’s article, Getting started.

DNS – Tweaks take 2

Although I have good results tweaking my DNS it appears it can have its side affects if you have a very fast internet connection and are doing some serious streaming… have a read of the following quoted article.

If I ever get a fast home connection then I will be aware of this… until that day…or just incase santa lays some fiber optic cables..

The experience of one Mac developer with his new Apple TV box, offers a reminder to the tech-savvy “power user” that Google DNS and OpenDNS may take a serious toll on performance video streaming.

On his blog, Joe Maller wrote that he had a fast Internet connection (15 – 20 Mbps), and so he was shocked when his Apple TV reported that it would be several hours before he could start watching his HD video. The culprit in his case was Google DNS.

It appears that Google DNS and OpenDNS don’t mix well with the way that distributed video is served up. This can be Apple TV or YouTube.

This totally makes sense. iTunes’ video content is delivered by Akamai who has distributed massive datastores around the world so those large files originate from nearby servers and spend less time getting switched around the network. Akamai somehow uses our DNS routing to determine our location. If Google DNS or OpenDNS routes everyone to Akamai the same way, then those Akamai nodes and the pipes leading to them get overwhelmed.

Ironically, people feel that they’re doing the right thing by switching over to OpenDNS or Google DNS. In this case, it appears to be the wrong choice. Maller points out, that in this case, it is the “tech-vanguard” that will take the hit here. Most non-savvy users will simply hook into their ISP’s DNS.

After switching from Google DNS, Maller said his Apple TV rentals were ready in less than 30 seconds.

http://www.zdnet.com/blog/apple/reminder-google-dns-can-slow-down-apple-tv-streaming/8960?alertspromo=&tag=nl.rSINGLE

AzureKit and COBOL

AzureKit is a nice piece of source code released on CodePlex by Mark Rendle. The AzureKit makes life much easier for creating, searching, deleting elements in your Azure’s Table Storage.

My idea was that if the AzureKit was easy enough to use, then it could give us a nice way of accessing Azure’s table storage without to hosted in Azure itself.

Given, this idea I recently spend a bit of time exploring the APIs and how they could be used from COBOL and to be honest it was a pleasure to use, so thank you Mark for the good work.

For anyone not familar with Azure Table Storage, it is a structured storage that uses tables.. sounds obvious. It does not have a SQL interface, so it is marked as a NoSQL storage mechanism.

The normal Azure Table Storage APIs are fine but reasonably complicated… perhaps too complicated for most people to use.

The APIs Mark has put together really does make life easier.

The AzureKit provides you with an IDictionary, IEnumerable and IQueryable style interface which for anyone familar with .Net this API style will feel very natural to them, so I think it gives you a nice programming model.

This combined with Visual COBOL’s support for doing ‘perform thru’ on IQueryable objects make its easy to use.. Anyway enough talking time for some code…

      program-id. Program1 as "AzureKitExample.Program1".

       data division.
       working-storage section.
       01 movieTable    type AzureKit.Table.
       01 movie         type IDictionary[string, object].
       01 movieQuery    type IEnumerable[
                                   type IDictionary[string, object]].
       01 movieIQuery   type System.Linq.IQueryable[
                                   type IDictionary[string, object]].
       
       procedure division.
           set type Azure::Account to "mystorageaccount"
           set type Azure::SharedKey to "myverylargesharedkey.........."
           set movieTable to new type AzureKit.Table("Movie",
                            type AzureKit.IfTableDoesNotExist::CreateIt)
           
           *> Delete ALL
           perform varying movie thru movieTable::GetAllRows()
               invoke movieTable::Delete(movie)
           end-perform
           
           *> All two items
           set movie to type AzureKit.Table::NewRow(
                                   "Jaws: The Revenge",
                                   type Guid::NewGuid()::ToString())
           set movie::Item("Year") to 1987
           set movie::Item("Director") to "Joseph Sargent"
           set movie::Item("Rating") to "Worst Movie Ever!"
           invoke movieTable::InsertRow(movie)
           
           set movie to type AzureKit.Table::NewRow(
                                   "Empire Strikes Back",
                                   type Guid::NewGuid()::ToString())
           set movie::Item("Year") to 1982
           set movie::Item("Director") to "George Lucas"
           set movie::Item("Rating") to "Best Movie Ever!"
           invoke movieTable::InsertRow(movie)
           
           *> query
           set movieQuery to movieTable::Query(
                                 "PartitionKey eq 'Jaws: The Revenge'")
           
           set movieIQuery to type System.Linq.Queryable::AsQueryable[
                                 type IDictionary[
                                     string, object]](movieQuery)
           
           set movie to type System.Linq.Queryable::FirstOrDefault[
                                 type IDictionary[
                                     string, object]](movieIQuery)
           
           display movie::Item("PartitionKey") " -> "
                                   movie::Item("Director") " -> "
                                   movie::Item("RowKey")      
         
           *> show the results
           perform varying movie thru movieQuery
                  display movie::Item("PartitionKey") " -> "
                                  movie::Item("Director") " -> "
                                  movie::Item("RowKey")              
           end-perform
           
           goback.
           
       end program Program1.

That’s pretty easy… now what shall I do with the APIs… answers on the comment strip!

http://blog.markrendle.net/

http://azurekit.codeplex.com/

http://msdn.microsoft.com/en-us/library/dd179423.aspx