Posted by Jorge Bernal August 15, 2008
I’ve found this today at the shoes website, and I think it’s not the first time I see someone using the Ubuntu logo or name to refer to a Linux system.
If rms already had a bad time trying to convince people to use GNU/Linux instead of Linux, it seems he is getting more work to do 
Posted in Open Source, Ubuntu | 13 Comments »
Posted by Jorge Bernal August 15, 2008
I’ve been trying to give rebirth to an old internal project at my company, abandoned circa 2006, and this is one of the code pieces I think it could be useful to others.
I wanted to store country information as an ISO code, so here is the plugin to make it work
It’s translated using the translation from the iso-codes package, so I guess it’s as good as it can get by now. If you want to contribute, please do it to the iso-codes package and let me know, so I can update it too.
iso_countries - Store countries using ISO 3166 codes
This rails plugin enables you to store country info only with the country’s ISO-3166 code
Example
class Company < ActiveRecord::Base
iso_country :country
end
c = Company.new :country => "es"
c.country # => "es"
c.country_name # => "Spain"
c.country_name = "France"
c.country # => "fr"
ISO::Countries.set_language "es"
c.country_name # => "Francia"
Download
You can get it from http://github.com/koke/iso_countries/tree/master

Posted in Development, Open Source | No Comments »
Posted by Jorge Bernal July 22, 2008

Since I didn’t have any MySQL public courses planned this summer, I’ve been using my work time from the last week in the new eBox website.
I’m still far away from what I’d like, but I’m proud my design skills have improved considerably.
For those of you who still don’t know what it is, eBox is a server for the easy administration of corporate networks. eBox was included with the last release of Ubuntu. See eBox in Ubuntu
Posted in Open Source, Technology | 2 Comments »
Posted by Jorge Bernal July 20, 2008
Yesterday, I wrote a simple web application to buy from amazon using your iPhone. It’s meant to help if you are in a store and want to check the price of a product in Amazon and buy it from there.
That’s why you enter the barcode directly. I’ll probably add some search by title or author, but for now, it works for its original purpose: save money.
Check it out at http://amedias.org/ibuy/


It’s an early release so it can be buggy. If you have found a bug or have some suggestions, leave a comment
Posted in Innovation, Technology | 22 Comments »
Posted by Jorge Bernal May 22, 2008
I keep on with my productivity little tricks. This time I’m sharing some of my firefox shortcuts. I’m not in the mood for explaining how to actually install these, so check out the excellent article Firefox and the art of keyword bookmarking, if you need help.
# Dictionary search
dict http://dictionary.reference.com/search?q=%s
# Yahoo finance stock
fi http://finance.yahoo.com/q?s=%s
# Wikipedia page
wp http://en.wikipedia.org/wiki/Special:Search?search=%s
slang http://www.urbandictionary.com/define.php?term=%s
# Search in MySQL website/manual
my http://mysql.com/%s
# BitTorrent search
bt http://www.yotoshi.com/?keyword=%s
code http://www.google.com/codesearch?q=%s
# Ruby documentation
ri http://www.google.es/search?hl=es&client=firefox-a&rls=org.mozilla%3Aes-ES%3Aofficial&hs=3zt&q=%s+site%3Aruby-doc.org&btnI=B%C3%BAsqueda&meta=
# Google search (experimental version with keyboard shortcuts)
g http://www.google.com/search?q=%s&esrch=BetaShortcuts
# Google search (I'm feeling lucky)
gg http://www.google.com/search?q=%s&esrch=BetaShortcuts&btnI=Lucky
# eBay search
ebay http://search.ebay.es/search/search.dll?satitle=%s
# Post current page in delicious
pkd javascript:location.href='http://del.icio.us/koke?v=3&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)
# My delicious (with tag support)
kd http://del.icio.us/koke/%s
as https://www.google.com/adsense/report/overview
gr http://www.google.com/reader/view/
fb http://www.feedburner.com/fb/a/myfeeds
ga https://www.google.com/analytics/home/
By the way, I haven’t typed all these urls. In your firefox user dir (~/.firefox or ~/.mozilla), there should be a places.sqlite file.
Some sqlite love actually helps
sqlite> SELECT k.keyword, p.url FROM
moz_bookmarks b
JOIN moz_places p ON p.id = b.fk
JOIN moz_keywords k ON k.id = b.keyword_id
WHERE b.keyword_id IS NOT NULL;

Posted in Technology | 1 Comment »
Posted by Jorge Bernal May 22, 2008

Yes, you read it right, website. I know that sounds like 90s, and today trends are blogs and social networks, but I felt I needed some semi-static place to hold some info about who I am.
It’s not finished yet, I have more ideas for it, but it’s been sitting in my hard drive in a decent state for a while, and I think it’s time to obey the release early, release often motto.
Go there, if you want: www.jorgebernal.info
Posted in Personal | 2 Comments »
Posted by Jorge Bernal May 21, 2008
Update: I forgot to mention, the source code for the server part is available at flickr-commentr
flickr commentr is a simple tool to allow you post flickr pictures on flickr comments, or any other forum or blog
To install it, drag this bookmarlet to your bookmarks bar
flickr comment
When you are browsing a flickr photo, click the bookmarklet and you’ll see a popup like the following screenshot, where you can select the size and attributes to show, and copy the HTML code to post the picture.

Posted in Open Source | No Comments »
Posted by Jorge Bernal May 20, 2008
# Enable some colors
alias ls="ls -G"
# Gimme details and size in KB, MB or GB, I'm not good reading bytes
alias l="ls -lh"
# SSH aliases
alias moe="ssh moe.warp.es"
# I always misspelled that one
alias mow=moe
alias ebox="ssh root@ebox"
alias amedias="ssh amedias.org"
alias rssh="ssh -l root"
# Git alias
ci="git ci" # Formerly svn ci
# Jump to github from repository
alias github="git config -l | grep 'remote.origin.url' | sed -n \
's/remote.origin.url=git@github.com:\(.*\)\/\(.*\).git/https:\/\/github.com\/\1\/\2/p' \
| xargs open"
# MySQL
alias myserver="sudo /usr/local/mysql/support-files/mysql.server"
# Start webserver on localhost:8000 sharing current directory
alias webshare='python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"'
# Rails server
alias ss="./script/server"
alias sss="screen ./script/server"
alias sr="screen -r"
Posted in /dev/random | 5 Comments »
Posted by Jorge Bernal May 13, 2008
Update: I’ve been suffering some ungly and stupid bugs today, so I’ve fixed them and released version 0.2. It also includes a new script wp-update-home.

I’ve just published some scripts that help me manage my personal wordpress installations, and publish some plugins I’m working on.
Warning: these are early versions which I use for small tasks. If you find
a bug or have suggestions, contact me at jbernal@warp.es
Download version 0.1 version 0.2 or browse the wordpress-scripts git repository.
wp-dump
wp-dump helps you to backup your wordpress database. Just tell where is the wordpress directory and where to put the dump file
Syntax
$ wp-dump wordpress-dir outfile
outfile will be a gzipped SQL dump, so you should use the .sql.gz extension
wp-import
wp-import helps you to restore your wordpress database. Just tell where is the wordpress directory and where to read the backup file
wp-import expects the backup to be a gzipped dump
Syntax
$ wp-import wordpress-dir infile
publish.sh
publish.sh is useful if you:
- Manage your plugins with git
- Want to publish versions to a remote server using scp
Syntax
$ publish.sh plugin_name version
publish.sh will replace version numbers in your code (see Requirements), tag
the release with git, create a tarball and upload it to the specified server.
Requirements
First, you need a config file called ~/.wpplugins. An sample way to do this is
$ echo myserver.example.com:public_html/plugins/ > ~/.wpplugins
where myserver.example.com is your server and public_html/plugins/ is the
path (relative from your $HOME) to upload the tarballs
publish.sh can also replace version numbers in your plugin. It will detect these two cases
- Plugin header: Version 0.1
- Version constant: define(plugin_name_version, ‘0.1’);
wp-update-home
When you are syncing wordpress databases, one of the fundamental things to change is the siteurl and home options with the remote URL.
Syntax
$ wp-update-home wordpress-dir myhost.example.com
It’s been a while since I last released some open source project (beyond small patches) and it feels as good as ever 

Posted in Open Source | 1 Comment »
Posted by Jorge Bernal May 08, 2008
Updated: I’ve added some –exclude options to ignore svn and git directories. Also be sure to check out the comments, there are pretty nice variations there.
Add this to your ~/.bashrc
rgrep () { grep -rin --exclude=\*.svn\* --exclude=\*.git\* "$*" . }
And you get a handy grep replacement
$ rgrep function wp_head ./general-template.php:785:function wp_head() {
Posted in Technology | 6 Comments »