After going to a Dorset computing event I was told that twitter was the best thing in the world. I remember testing it and I really didn't like it as I don't have to know what some guy I meet 2 Years ago had for breakfast. But after all these guys seamed to love it, I will try it again. Lets see what will happen. So if you are interested in my breakfast follow me under https://twitter.com/ribalba
Google generally does a great job, so they deserve their success wholeheartedly, but I have to tell you: Google's current position as the start page for the internet kind of scares the crap out of me, in a way that Microsoft's dominance over the desktop PC never did. I mean, monopoly power over a desktop PC is one thing -- but the internet is the whole of human knowledge, or something rapidly approaching that. Do we really trust one company to be a benevolent monopoly over.. well, everything?from http://www.codinghorror.com/blog/archives/001174.html
Markup Validation Service not used
I was wondering why my blog was not displaying correctly on Safari so I thought I might have put some invalid html code somewhere. So off I go to http://validator.w3.org/ and put my blog address in.
Result: 654 Errors, 372 warning(s)Sweet. That can't all be my work and it is not. So next try, google.com
Result: 66 Errors, 8 warning(s)Ok, on the front page of Google there are 66 errors. No wonder my blog doesn't show up. And nearly all of them are absolutely stupid errors that could be fixed with just some little additions to the code. So if someone from Google is reading this you might be interested to fix this.
T-Dose website security issue
I am giving a talk at T-Dose while trying to add my user credentials I found this little error in the programming.
Please never take parameters unchecked in any programming language. But at least the T-Dose people added <%=h text => so you can't easily cross site script
Add return codes to your shell prompt
How many times do you type 'echo $?' to check if the command you have just run really didn't silently exit with an error? When I do sys admin stuff I frequently do this. So now I just added the return code to my shell prompt. So if something goes wrong I see it right away. I have a FreeBSD box so this may vary from setup to setup.
export PS1='[\u@\h \w] $(echo $?) \$ 'the trick is the
$(echo $?)I know this forks a new echo process every time you get a shell prompt. But the idea is that you enable this when you are doing important selected stuff. Possibly on a live system where you are not allowed to make any errors.
Ahhh Google
I just got my new iMac. Quite a nice pice of kit. Even if I couldn't cope with the mouse and the keyboard. But I tried to add my Gmail account to the mail client and the iCat. But it keept failing with "Invalid Credentials (Failure)" After some googleing and looking around someone suggested you should unlock a captcha. https://www.google.com/accounts/UnlockCaptcha?
And now everything works fine. WTF is that? Anyway now back to searching where my iCat window has gone
Ruby on Rails with text_field_with_auto_complete
I spent some time trying to figure out how to get a little text field with auto complete in Rails. Now I wanted many fields to have the same suggestions in one form. So here are some code samples. For some information. I have a model that is called Locations, basically this is just a collection of names of cities a person should be able to travel to.
In my controller I need
So that is for the controller. Now we need to create the partial. You can call this what ever you want but for now I called it names. So you need a file named '_names'
This is quite simple it get's the array @names we built in the controller and builds an unordered list out of the elements.
Next we have to add a little helper method to the app/helpers/application_helper.rb file. This is basically the wrapper for the 'real' auto_complete_field.
So now we should have everything that is needed to create our little textbox. Now in the view you just add
Thank you to Wolfmans Howlings for posting all this.
http://blog.wolfman.com/articles/2006/10/17/having-multiple-text_field_with_auto_complete-in-the-same-view
http://wiki.rubyonrails.org/rails/pages/How+to+use+text_field_with_auto_complete
In my controller I need
# The first value is the model the second the name of the field
auto_complete_for :location, :name
# As of rails version > 2.0 forgery protection is activated by default. As the
# AJAX stuff won't work otherwise you have to disable it for one method
protect_from_forgery :except => [:auto_complete_for_location_name]
# This is the method called my the AJAX obj
def auto_complete_for_location_name
leg= params[:location].keys[0] # get index as its always only one at a time
auto_complete_responder_for_name params[:location][leg][:name]
end
# This does the real magic. It queries the database and then renders a
# partial 'names' with the list of values to display. With some sql knowledge
# you should be able to understand the query
private
def auto_complete_responder_for_name(value)
param= '%' + value.downcase + '%'
find_options= {
:conditions => [ 'LOWER(name) LIKE ?', param ],
:order => 'name ASC',
:limit => 10
}
@names = Location.find(:all, find_options)
render :partial => 'names'
end
So that is for the controller. Now we need to create the partial. You can call this what ever you want but for now I called it names. So you need a file named '_names'
<ul class="autocomplete_list">
<% for name in @names -%>
<li class="autocomplete_item"><%= name.name %> </li>
<% end -%>
</ul>
This is quite simple it get's the array @names we built in the controller and builds an unordered list out of the elements.
Next we have to add a little helper method to the app/helpers/application_helper.rb file. This is basically the wrapper for the 'real' auto_complete_field.
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
def my_text_field_with_auto_complete(object, method, tag_options = {}, completion_options = {})
if(tag_options[:index])
tag_name = "#{object}_#{tag_options[:index]}_#{method}"
else
tag_name = "#{object}_#{method}"
end
(completion_options[:skip_style] ? "" : auto_complete_stylesheet) +
text_field(object, method, tag_options) +
content_tag("div", "", :id => tag_name + "_auto_complete", :class => "auto_complete") +
auto_complete_field(tag_name, { :url => { :action => "auto_complete_for_#{object}_#{method}" } }.update(completion_options))
end
end
So now we should have everything that is needed to create our little textbox. Now in the view you just add
<%= my_text_field_with_auto_complete :location, :name, {:index => '1'} %>And you increment the index value for every new field you add in that view.Thank you to Wolfmans Howlings for posting all this.
http://blog.wolfman.com/articles/2006/10/17/having-multiple-text_field_with_auto_complete-in-the-same-view
http://wiki.rubyonrails.org/rails/pages/How+to+use+text_field_with_auto_complete
Hacking tip 2035
In my flat in Geneva I have a very comfortable chair. It is made out of leather and I really enjoy sitting in it. So today I go up and didn't want to dress as it was already 35 degrees in my room. So I sat in my chair and started hacking. 3 hours later I needed to get up for something to drink. Now here is the problem. My skin and the leather decided they wanted to join. I am presuming this is encouraged through the heat. Now I was stuck to the chair. If I tried to get up it started to pull of my skin. Very painful I tell you. So conclusion: I now had a professional back peeling. And a tip for all you with leather chairs never sit on them without at least a t-shirt.
Why Debian is not Ubuntu and vice versa
Reading the arch Linux newsletter (http://www.archlinux.org/static/newsletters/newsletter-2008-Aug-04.html) and talking to some of my friends. I was noticing that many people now see ubuntu as debian, they are now seen as one thing. Many people that complain about ubuntu could just run debian. It has been quite a long time since I had a debian install but I think you can even install it without X. So if you don't want the bloated windows copy, that ubuntu is, but you still like the pakages why not install debian. Ubuntu might be using debian as a base source of packages but please don't say
(As of this writing, I'm still unaware of any bloat-free editions of Ubuntu.)beacuse that is debian.
Froscon 2008
Another talk I am giving.
http://programm.froscon.org/2008/events/208.de.html
http://programm.froscon.org/2008/events/208.de.html
The wiimote is a versatile and unique device as it is stuffed with electronic components that seldom are seen together. Because of this, the device has a myriad of uses and we will discuss one of them: using the wiimote as a universal presentation tool.
Hopefully, we can turn this presentation in a funny and amusing showcase of the possibilities of the Wiimote for giving presentations.
dnbradio
$ host 74.86.155.182
182.155.86.74.in-addr.arpa domain name pointer save.your.complaints.for.someone.who.gives-a-shit.com.
Cern Week x
So I haven't posted for a while. So what did I do this week.
My ldap cluster went out of warranty so we had to retire the machines. Installing the new cluster tunes out to be quite a pain. The idea was to have the new machines just take the templates from the old machines and reinstall them. But the new machines are blades and the install is not that easy. Because of not specifying the network interface in the kickstart file the install can not get the network interface. So all installs stop at boot and ask you which interface to use on the console. So I had to connect to every machine and tell it to use eth0. Now the next problem comes in that the machines will be using SLC5 and this is the first service to move to the new SLC version so loads of errors cropped up. Further when you reinstall a machine you totally forget how many little hacks you did while the machine was up that you didn't document. You just ssh in and change one value somewhere in a file. Now I was trying to remember what I did 7 month ago.
I also spent some time working on the Wii controller.
My ldap cluster went out of warranty so we had to retire the machines. Installing the new cluster tunes out to be quite a pain. The idea was to have the new machines just take the templates from the old machines and reinstall them. But the new machines are blades and the install is not that easy. Because of not specifying the network interface in the kickstart file the install can not get the network interface. So all installs stop at boot and ask you which interface to use on the console. So I had to connect to every machine and tell it to use eth0. Now the next problem comes in that the machines will be using SLC5 and this is the first service to move to the new SLC version so loads of errors cropped up. Further when you reinstall a machine you totally forget how many little hacks you did while the machine was up that you didn't document. You just ssh in and change one value somewhere in a file. Now I was trying to remember what I did 7 month ago.
I also spent some time working on the Wii controller.
How true
Quote by Stephen C. Johnson.
From http://www.computerworld.com.au/index.php/id;1191304205;pp;3
From http://www.computerworld.com.au/index.php/id;1191304205;pp;3
Given GNU's desire to replicate Unix, I think Bison was inevitable. I am bemused that some GNU people are so irritated that GNU's contribution to Linux is not recognized, but yet they have failed to recognize their debt to those of us who worked on Unix...
Fun with stupid people

You know how sometimes some idiot tries to chat with you through msn and then tries to find out stuff about you. I was getting annoyed by these idiots as they kept trying to chat with me. So here a little chat I had today.
Conversation with gipuzkoa25cam@hotmail.com
(17:25:12) mmmmmmmmmmm: hola
(17:25:17) mmmmmmmmmmm: como te llamas?
(17:25:24) mmmmmmmmmmm has nudged you!
(17:28:48) didi: do I know you?
(17:29:18) mmmmmmmmmmm: you dont anderstand me?
(17:29:31) mmmmmmmmmmm: where are you from
(17:29:38) didi: who are you
(17:29:49) mmmmmmmmmmm: i´m david
(17:30:01) mmmmmmmmmmm: i´m from spain and you?
(17:31:32) Offering to send troy.exe to mmmmmmmmmmm
(17:31:48) mmmmmmmmmmm: no thanks
(17:31:53) mmmmmmmmmmm: is a troyan
(17:31:59) didi: you need this to communicate with me
(17:32:03) mmmmmmmmmmm: i´m not stupid
(17:32:04) didi: muhaaaaa
(17:32:34) mmmmmmmmmmm cancelled the transfer of troy.exe
(17:32:41) mmmmmmmmmmm has removed you from his or her buddy list.
The file was just
cat /dev/urandom > troy.exeby the way and you are stupid.
Democratic Linux
All the current Linux, BSD distributions I know are pretty much dictatorships. There is either one person or a small group of developers that make all the important decisions. The most important group of people is mostly never asked about the change, the users. The attitude is we
"We make it, you deal with it" + "By all means you can always fork it and make your own distro"
From : http://www.eubios.info/biodict.htm
I think this fits pretty much all *NIX distros, I know of. So why has no one come up with the idea of having a democratic distro. Where the users can vote on what they want the developers to do. This of course might not be as fun for the developers, but surly you can get a better OS out of this.
So my idea is that with the install you get a little vote tool. Here you can get some information on what you can vote on and then you submit your vote to a central server. Through this the developers can get a good impression on what the community wants.
Of course there are some problems:
"We make it, you deal with it" + "By all means you can always fork it and make your own distro"
From : http://www.eubios.info/biodict.htm
DICTATORSHIP : When dictatorship relates to a mode of governing in modern states, it labels the unrestricted power of one person (or a group of individuals), who actually monopolizes and exercises all political powers. Dictators shape rules without being subjugated to them, and their actions cannot be sanctioned by anyone. All these features stand in sharp contrast to DEMOCRACY. Dictatorship can also refer to a particular mode of exercising power within a community or an ad hoc group of people, which is unrestrained by exterior forces and not dependent on the will formation within the group. (BP)
I think this fits pretty much all *NIX distros, I know of. So why has no one come up with the idea of having a democratic distro. Where the users can vote on what they want the developers to do. This of course might not be as fun for the developers, but surly you can get a better OS out of this.
So my idea is that with the install you get a little vote tool. Here you can get some information on what you can vote on and then you submit your vote to a central server. Through this the developers can get a good impression on what the community wants.
Of course there are some problems:
- How can you be sure no one has n virtual machines and votes n times
- What should you be able to vote for (People, package changes, etc ..)
- Should it be more like direct democracy or do you vote a representative every n months
- etc...
Cern Week 44
* ncm-authconfig
* sin2pwd
* perl in traint mde
* template migration, same tpl for SLC4 and SLC5
* new PrepareInstall tests
* Sourceforge migration
* ncm-accounts usermod fix (chomp missing)
* sin2pwd
* perl in traint mde
* template migration, same tpl for SLC4 and SLC5
* new PrepareInstall tests
* Sourceforge migration
* ncm-accounts usermod fix (chomp missing)
That's it eBay
Remember the time when everyone thought eBay would take over the world. People bought everything from it. A PC, House and so on. Now after all this when was the last time I bought from eBay. I just bought a Nintendo Wii and I briefly though about using eBay then I remembered all the hassle I already had with it and what about warranty and then I went into a good old shop and bough it there. No I read this
http://www.theregister.co.uk/2008/06/05/ebay_counterfeit_ruling/
Ok that is it for eBay then. The last real stand for it was that you could buy faked, stolen, cheep stuff of it. I think it is going to become site where a few people will sell a few old, collector style things
http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=260....5%26fvi%3D1
I might buy some parts for my motorbike from there because someone is selling out his garage. But I definitely will not buy something like a car, laptop, etc...
The stock market doesn't seam to think so. The last trade was 29.89 that is well in the 52wk Range: 25.10 - 40.73. I will follow up on thins. But I would predict that the shares will fall in the long run, if eBay doesn't through off a huge profit.
http://www.theregister.co.uk/2008/06/05/ebay_counterfeit_ruling/
Ok that is it for eBay then. The last real stand for it was that you could buy faked, stolen, cheep stuff of it. I think it is going to become site where a few people will sell a few old, collector style things
http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=260....5%26fvi%3D1
I might buy some parts for my motorbike from there because someone is selling out his garage. But I definitely will not buy something like a car, laptop, etc...
The stock market doesn't seam to think so. The last trade was 29.89 that is well in the 52wk Range: 25.10 - 40.73. I will follow up on thins. But I would predict that the shares will fall in the long run, if eBay doesn't through off a huge profit.
Subscribe to:
Posts (Atom)
