Sunday, 30 October 2011

MySql Definer problems

This is an old post pulled from another blog for preservation

Recently whilst moving a legacy application, I had to make it more secure. In trying to make the database more secure I ran into one particular error in some of our Java code java.sql.BatchUpdateException: The user specified as a definer ('root'@'%') does not exist

The definer ('root'@'%') is the root of my problem (pardon the pun). Our application was accessing MySql as root user (so a compromised application could take control of all the databases on the server), even worse having root@% as a user in the database means that root access is not just restricted to local access.

Having given the application it's own user and remove root access from anywhere everything was running fine until we hit a page activated a trigger. Definers appear in a number of places in MySql including triggers, stored procedures and views (not sure what if any problems occur with a view if the defined no longer exists but will make a point to find out). My problem was an easy fix there was just one trigger that needed altering.

Although I have not had to yet, next time I run into this problem I would be looking to take an approach more similar to this one somewhere in that post or the comments there should be a working solution there to remove the definers from a MySql dump. I assume (would check) that the default definer if set by MySql would be the user credentials used to load the database again.

Fortunately the problem was spotted on a test server first.

Sunday, 21 August 2011

Turning Chinese, no such thing as a standard search?

Short but sweet, this one. I have already noticed the filtering bubble on one or two sites that I use, particularly I increasingly get the "Chinese influence". Because of my interest in Chinese language, language learning related things and particularly Chinese related things and people I get increasingly connected to Chinese things and Chinese people. This is actually starting to become a hindrance, from the point of view of some services the granularity of what I may be interested in Chinesewise is pretty low. For example I can usually work out why Linkedin is suggesting I want to link with most of its suggestions, however on more than one occasion now it throws in a random Chinese person, who I have not worked with, isn't interested in the same things as me (technology or otherwise) and isn't even geographically that close (although to be fair UK rather than China is somewhat closer than it could be).

How many ways, are decisions about what I see being influenced by what is on my profile? On one site in particular I seem to get a suspiciously high number of adverts regarding hair restoring products and eye-care/laser treatment/optician related links. I don't search for these things, but it wouldn't take much processing to target me based on my follically challenged, bespectacled profile picture.

Once we wrote content for people to read, then wrote content for machines to read, now write content for people that machines may decide they want to read.

The thing I find really interesting however is that, if you are considering search engine optimisation you also increasingly need to consider the profile of the person who is doing the searching, because all search results are not equal. Perhaps even more worryingly increasingly more of our lives are being determined by computer algorithms, we are moving closer to time when algorithms control the world.

Sunday, 14 August 2011

Getting around DNS

This is an old post pulled from another site (for preservation)

Jotting this down really, because it is the type of related problem that crops up every now and again and sometimes if my brain is not firing on all cylinders I get stumped for a while.

The problem

Really wanted to check out an open-source project NOW yet svn checkout couldn't resolve the host for the repository. My PC can't find the DNS, other PCs on our network can't find it, it was there yesterday (or rather it was there for me at home).

The solution

First checked that the site was available for some people by checking on http://downforeveryoneorjustme.org/ apparently it is just me (and a few others I guess). Next I need an IP address so searched in Google for sites that give IP address if you know the DNS (because I can't do this for myself right now), first one couldn't find it (down for them also it seems), the second one gave me an IP address(phew) Next problem is that the IP address just takes me to the server for their hosting company, so I need to add an entry in my own hosts file (/etc/hosts) on my Linux system and another entry for the svn. address I was originally trying to use there. Bingo now my PC knows how to find their server and make the request in a way that takes me to the pages and data I want (using the expected host). In the past have also resorted to trying different DNS servers (opendns or googledns) Additional later note: and of course I could always get a command-line on a remote server somewhere (we have a client server in Hong Kong for example) and use that location to do my investigation from.

Saturday, 13 August 2011

JavaScript

This is an old post pulled from another site (for preservation)

JavaScript has always been an important programming language for me, I use the term programming language rather than scripting language deliberately. Now I am taking the time to rationalise the technologies that I use and develop in (develop my skills in), I have to say that JavaScript is part of the core. JavaScript has often been associated with the web-browser and treated there as something to add a little bit of visual whiz-bang or tie together a few things that you might want to do in the browser that are not covered in standard HTML. bandwidth, performance, the danger of JavaScript being turned off, the single execution thread ("a script on this page appears to be busy") and other factors have contributed to a general feeling of "not wanting to do too much in JavaScript". These days performance appears to be much less of a problem, Linux on a PC emulator running in your browser for example. The single execution thread blocking problem is solved with HTML5 web workers. Various libraries from JQuery to Extjs allow you to create an interface entirely in JavaScript. You can build sophisticated mobile applications using Phonegap and Titanium. I feel that as more people develop for HTML5 factors like the scriptable video and SVG and going to drive a lot more development in JavaScript and of-course applications like node.js are continue to raise the profile of JavaScript in other areas. Something that has me really excited though and something I will definitely want to play with when I get a nice stretch of time is Quake2 in JavaScript. This project is based on Jake2 which was a Java port of the open sourced Quake2 code that did leave me with mixed feelings (the code very much looked like a conversion from C to Java mostly via implementing a bunch of static classes), however a long time ago I had some fun writing a mod and experimenting with the original Quake source code. The project looks like it needs a bit of effort to build but I am looking forward to enjoying that at some point.

Moving some posts in here

I recently started posting some random thoughts, comments etc, mostly about techie stuff else where. i think they are better posted here so I will drag those four articles into this blog shortly

Again the purpose of this blog is mainly just to collect together things I might want to come back to, being online it is accessible anywhere, and although nobody else reads it, it helps me to focus by knowing that in theory they can.

Saturday, 25 June 2011

Dropbox, more cross appliance goodness

Another short but sweet, after my last post about the Kindle I reaslized I had forgot to mention dropbox. Definitely worthy of a mention in the same thought as again I have had a wonderful experience from the service. Not only does drop box keep files synced and available for me across a number of devices it also provides extra functionality on my Ipod Touch, I can choose to save files there of various different types, actually open them etc. etc.

Now I am starting to sound like an advert for Kindle and Dropbox, have to think of something a bit gloomier and more negative for my next post.

Sunday, 12 June 2011

Whispersync and Kindle

Short but but sweet post this one, a while ago I bought a Kindle for my wife, she loves reading and loves books and always said she wasn't interested in Ebook readers. Well she grudgingly decided to try her new present and now a few months later there is no going back. The Kindle2 was a big big hit.

I don't have a Kindle of my own but have played with one a bit (when I am allowed ;)) and it is an excellent device in my opinion. Something else has impressed me even more though and that is the Whispersync technology. Our Kindle is attached to our Amazon account and I bought a few books for myself and installed the kindle application on my Ipod touch and Android Phone.
I haven't worked out exactly what the syncing does, I don't need to it just works. Very occasionally I pop-up just confirms that I want to jump to the last place I was in a book on another device but that is usually reference books where I am jumping around a lot. Basically it just works, nice one Amazon.

I am not suggesting that reading a book on a phone or Ipod is as good as reading it on the Kindle but it is very nice to be able to pick up reading where you left off if you miss or bus or for some other reason you suddenly have some unexpected free time on your hands and not many options.

Be interesting to see whether Apples new cloud thing works as smoothly, even if it does though Amazon where there first in my humble opinion.

Monday, 30 May 2011

Fractured Identities

I am back again, I think this blog is going to be updated much more frequently, I have a building pressure of thoughts to offload in this private (mostly) space. I re-read some of the material I posted a long time again and it is a very useful review process, so time to start dumping more half-baked thoughts and seeing what happens in my head.

Something that has bothered me for a long time and something I am going to think about in more detail for a while is on-line presence of the individual. A couple of weeks ago I went back to the place where I went to school and met up again with some guys I originally knew from over two decades ago. We meet up approximately once a year or so and have one or two shared interests in common even though we have all lead very different lives. Careers, interests, lifestyles, philosophy, outlook, are all very different. Every time we meet up we have a great time, but between times we communicate very little and know very little about each other. I am sure that the person we present to each other is relevant to the situation and that this is in part what makes it such a pleasure to meet again. We have little connection on-line (apart from the occasional email to make arrangements). The people we are when we meet are in many ways shaped by and relevant to the situation and the history we share.

I have multiple twitter accounts including twitter like accounts in Chinese etc. I struggle with Facebook, the concept that there is a single me that can be represented, distilled and relevant to all the real people I know. How can the various circles in which I move, the various persona's and interests, the professional links converge on one spot in a meaningful way? If I am interested in someone on a language learning basis, I want to read a blog or follow a twitter feed that is mostly relevant to this aspect, not filter through the chuff that is the rest of their lives or get asked if I want to connect with friends of theirs that they go diving with. Perhaps I will meet them and connect more fully (and then be interested in more aspect) but perhaps they will lose interest (even if only online) in languages and the feed will dry up (effectively vanishing from my radar).

I don't want to connect with my teenage sons on Facebook, I should be connecting with them in real life, I am pretty sure that connecting with them on Facebook would dilute the experience on both sides.

Ex-coworkers have largely nothing to do with people I meet to learn foreign languages, my messages to them, links for them, information I share with them (hey I might want to work with them again some time) should not mix. In fact it would seem that in a lot of cases the only reason to mix is to say to one group "hey look how well rounded I am" by exposing them to the edited highlights of the rest of my life. Regardless of tagging etc. I don't have many good ways to separate the life-streams without spending too much time organising (organising something that works better if spontaneous) or expecting people following me to somehow organise theirs. So we are polluting each others lives with spam. No better than inviting someone around in the 1970's to watch the 4 hour sideshow of your holiday (unless there is special interest after the first 10 mins they don't really care).

If I follow the public, social feed of some guy who is known for developing a cool programming platform, anything not related to that platform is spam to me, time wasting spam, we are not related, we are not friends, I don't have a reason to be interested.

Maybe this seems a little harsh, maybe a little extreme, and there are some focused feeds out there, and people who are not afraid to set-up multiple focused on-line presences. Perhaps I could be accused of not being interested in people? Nothing is further from the truth, I enjoy finding out about people, I just find that face to face, with all the feedback mechanisms we have evolved to gauge interest the experience is order of magnitude better.

Facebook of course is a harder place to fracture, or even linkedin (which is admittedly more focused on fabricating an image for yourself that may make you more employable). Maybe I am over reacting, a lot of the information requires some action to pull it out, but it seems to me that there is still too much I have to actively ignore or too many distractions.

Saturday, 18 December 2010

Why Blog?

Introduction

I have been writing posts on various blogs since 2006, most of the more popular ones were related to language learning. Blogging sucks up quite a lot of time and in many cases I am talking to noone in particular. This does beg the question why blog? There isn't a single answer to that question there are many reasons for blogging. I have consistently blogged over a number of subjects and accounts for many years now, there are a variety of reasons for each one and some fall by the wayside (some get picked up again) but why do I do it?

Not for profit

I don't blog for profit (yet, maybe one day). Quite some time ago I experimented with Google ads and found that with little effort I could make maybe £20 per month. I work in internet technologies sometimes helping drive traffic to sites. With some effort there was potential there I guess and a bit more thought should come up with better ways to make money off of the back of blog posts. Just thinking about these things changed the nature of what I posted, made me start thinking about sensational blog titles that may drive traffic, reciprocal links with other sites (just for the sake of links). Two things made me remove the ads, one was that I didn't want to write just to drive traffic, the other simply that making significant amounts of money would be hard work doing things that I didn't want to do in my spare time. I also have a problem in that I am not driven by money, I am rubbish at making money, once I have enough to get by (+ for anybody dependent on me, I find it hard to care too much about money) these days that is considered a character flaw.

Not for the sake of literature

I have said it before and I will doubtless write it again, most of my blog-posts in any area are wrote fast, spare time is precious, I speed-type, I think something and at some point I may write it. Spelling and grammar, checking, I leave for other areas where I have to apply fingers to keyboard. I understand the motivation for more literary blogs but that is not what I am about so far. Each post is a reference to a thought to come back to, somewhere I have a little traffic is an invite to discuss and learn from other opinions.

On occaision I will go back to recent posts and edit them, especially if I think that there is the remote possibility that someone else may read one

Not for the sake of fame

Whilst there is often an element of "look at me" in many things that people do publicly that is not a strong driver for me. I wrote many posts on this blog even after finding out that virtually nobody but me ever reads them. There are useful to me though, putting the thoughts down sometimes crystallizes them. Some rough posts become the basis of more formal writing for work etc.

For conversation

Sometimes (with my language learning blogs for example) I just want to attract a few comments, start a small conversation. Generally in more crowded spaces like technology I don't have the talent, dedication or time to attract a significant audience.

For reflection

Writing things down helps the thought process, making them public acts as a bit of a focus. Sometimes stating something in public provides enough of an impetus to actually do it.

For career

In places it may just help a little for employment, increasingly some kind of online presence is expected.

Summary

So I guess that there is some reflection, some "look at me" and sometimes need for conversation. Up until now that is why I blog.


Thursday, 5 February 2009

Against the Spam Argument

I have been thinking about Intranets and Web2.0 a lot over the last few months. One thing that really bugs me is that I can do some much learning, networking and collaborating over the Internet, the benefits are so apparent and so obvious, why can I not do the same at work? I will soon be moving to small company where these problems are not likely to apply, but how is it that so many medium to large companies completely resist new ways to use technology amongst their employees? The larger the company, the more likely there is to be someone who can help me, unfortunately without the right technology the less like I will be able to find them.

I will be posting a series of thoughts tagged with "why_not_at_work" for a while to vent my frustration and suggest ways in which social technologies could help.

One common argument against things like micro blogging/social networking etc. at work is that when managers (of the traditional Corporate nature) are introduced to it they quickly come to the conclusion that it is largely spam and irrelevance, not serious enough for real work etc. this is usually after only gaining a trivial understanding of what is going on.

Of course this is the case but this does not invalidate the new method of communication because maybe every communication medium has been the same, it is the nature of communication between people. Who would argue against the importance of snail mail in its time, yet consider the junk mail problem, consider the huge resource spent to deliver greeting cards with pointless messages, holiday postcards that don't really say anything etc. Spoken language itself is largely phatic communication that doesn't really mean anything of significance. Telephone lines are saturated with meaningless twaddle ......

Don't blame the communication medium for human nature that makes us blather away, we need that, it maintains and creates connections, we will still need it right up to the point that we can make direct data connections between the lumps of jelly that sit in our skulls. Think instead that a traditional letter that had worth would have to be sent to a newspaper (or other medium) deliberately and published to be made available to to a wide audience, yet a single tweet can be plucked from the maelstrom and instantly made available on a Newspaper website. A single undirected micro-blog post about a piece of software can elicit an immediate response from the author of the software. a carefully selected RSS search in my feed reader can alert me when two people I don't know comment on something I said in a presentation months ago. How easy would it be for me stop listening to a source of traditional snail mail? It is the searching, categorization, scalability, and personal control that give the Web2.0 technologies their power.

If all you see is spam and a trivial waste of time then maybe you just don't know how to look yet.

Tuesday, 30 December 2008

Gaming and the Web

Been very busy recently but finally getting around to re-thinking about dconstruct 2008, yes that is some lag but I fully expect to have completed writing up my thoughts by September of 2009 ;). Actually lots of people complain about information over-load etc. etc. my favorite way of coping with that is simply to put aside quite long periods of time for just reviewing and going over things I have squirreled away. Making connections between old and new is also hugely useful.

The first talk at dconstruct2008 that came to mind is actually the second, it was presented by Aleks Krotoski, at the time it was probably the talk that made the least impact on me although looking back I find it much more interesting. Reviewing material from Dconstruct is easy now since eventually both podcasts and transcripts have appeared for all the presentations.  

The main gist of the presentation was that web developers and game developers do not mix although they have a lot to learn from each other, maybe the web has borrowed some ideas from the games industry but the flow of information in the other direction has not been so great. The thing that sparked my mind into reviewing this presentation was simply watching my children playing (and starting to play myself) Little Big Planet for the PS3. I was struck by the community aspects of the game and by the very web like use (and very useful implementation imho) of tagging and commenting  for content developed by other players.Once I found out that there was a huge amount of community content out there I immediately got my sons to show me how you could search (and re-find) that from within the game interface, as soon as I saw the tagging it made perfect sense that it should be there.


Actually I find it hard to pull out juicy points from the presentation although there was much I agree with and that sparked more thinging, Joshua March gives a good summary and Aleks wrote about it herself. A minor highlight for me after the fact is simply that Little Big Planet made me think of the talk and that when I got around to reading the transcript Little Big planet was raised in the brief question and answer session, it is certainly a game that was worth mentioning in this context so well done to man1. 

Watching the development of games and community aspects on a games console via the PS3 is certainly an elightening and highly useful experiance.