Archive

Archive for the ‘Misc’ Category

Start collecting “space miles” with NASA

October 24, 2014 Leave a comment

Nasa is doing something funny and great at the same time. Get your ticket for a test-flight that will count for space miles to be spent in the future :-)

http://mars.nasa.gov/participate/send-your-name/orion-first-flight/?action=getcert&e=1&cn=1150667

Categories: English, Misc Tags:

Skype 4.2 for Linux: Unable to connect

August 4, 2014 3 comments

If your Skype 4.2 for Linux is reporting an “Unable to connect” error since about the 28th of July 2014 or so… that’s because you need version 4.3. There isn’t much documentation around about this, so I’m writing this short post.

To replace it on Ubuntu 13.10 or 14.04:

  • download version 4.3 from the Skype website
  • sudo apt-get remove skype
  • sudo dpkg -i skype-ubuntu-precise_4.3.0.37-1_i386.deb (this filename may vary slightly)

Done.

Categories: English, Misc Tags:

Using Chamilo juju charm to setup a dev environment on Digital Ocean

June 23, 2014 8 comments

If you’re in a hurry/on speed, know this:

  • this procedure is slightly more difficult (so longer) than installing the charm on Amazon
  • you can skip directly to “Installing Juju”
  • if you already have juju installed, you can skip to the last 2 lines of the “Installing juju” section
  • if you already have juju-docean installed and configured, you can skip directly to “Provisioning VMs”
  • otherwise, just continue reading, it’s worth a few minutes…

This tutorial regroups a lot of advanced notions, so if you want to know more about one of the following elements, please follow these links:

Before anything else, please note that the following is highly experimental. There are still a series of issues that should be worked out in order to make this process failproof.

Basic setup

Before we start using commands and stuff, you’ll have to note the following:

  • We are using a Chamilo Charm developed by José Antonio Rey (kudos to him) as a voluntary contribution to the project
  • Charms are configurations to install applications (and stuff) inside the Juju framework
  • The Juju framework is developed by the Ubuntu team, so we’re using an Ubuntu (14.04) desktop (or in this case laptop) to launch all the following
  • Digital Ocean is one cloud hosting provider, which is particularly cheap and good for development purposes. The “default” environment for Juju is Amazon, so we’ll have a few additional steps because of this choice. The Digital Ocean plugin to Juju is developed by geekmush on Github, and as far as I know he is not related to either Ubuntu nor Digital Ocean, so he is also worth praising for his contribution
  • Chamilo requires a web server and a database server. In this Charm, it is assumed that we want both of these on separate virtual machines, so you will need two of them (unless you change the parameters a little)
  • Juju is written in Go but relies on several Python libraries. As such, you’ll have to have python installed on your system and maybe Juju will shout because it is missing a few dependencies. Notably, I installed python3-yaml to avoid a few warnings (it is required for the following, although the installer for Juju says it’s optional)

Installing Juju

On a default Ubuntu desktop installation, you’ll have to install Juju first. Because we are going to use Juju connected to Digital Ocean, we need a recent version of Juju, so let’s add it the unconventional way (with the ppa), launching the following on the command line:

sudo add-apt-repository ppa:juju/devel
sudo apt-get update && apt-get install juju
juju version

For some reason, in my case, this created my home directory’s .juju/ folder with root permissions, which then prevented me to reconfigure my environment (requirement for the Digital Ocean Juju plugin), so I changed permissions (my user is “ywarnier”, so change that to your user):

sudo chown -R ywarnier:ywarnier .juju

Then we need to install the juju-docean plugin:

sudo apt-get install python3-yaml
sudo pip install -U juju-docean

Setting up Digital Ocean access

Now we need to configure our Digital Ocean (D.O.) API so the system will be able to call D.O. in our place and create instances (and stuff).

You first need to grab your API key, client ID and SSH key ID from the Digital Ocean interface. You can do that from the Digital Ocean API page. Obviously, you need a Digital Ocean account to do this and a few bucks of credit (although you can get $10 free credit from several places). If your API key says “Hidden”, that’s because you must have it stored somewhere already (for other services?). If you don’t, you’ll have to re-generate one. Your SSH key ID is the name you gave to the SSH key you use from your computer to connect to your new instances. If you don’t have it, that’s probably because you haven’t configured any. Please do in the “SSH Keys” menu item on the left side of your D.O. panel.

 export DO_CLIENT_ID=aseriesof21alphanumericalcharacters
 export DO_SSH_KEY="user@computer"
 export DO_API_KEY=aseriesof32characters

Setting up the Digital Ocean Juju environment

Now we need a bit of manual config to be able to use Digital Ocean (last bit, promised). Edit the ~/.juju/environments.yaml file and paste the following:

environments:
 digitalocean:
 type: manual
 bootstrap-host: null
 bootstrap-user: root

Just a note: the “type: manual” line implies it is a bit more complicated than on amazon later on, and we will have to launch a few more commands to provision new machines *before* we deploy Chamilo.

Generating the Juju environment

Now we’re going to create our Juju controller. The Juju controller can be an independent Virtual Machine (VM), or it can be the same as the one on which you will deploy Chamilo. It all depends on your budget and your requirements.

juju docean bootstrap --constraints="mem=1g, region=nyc1"
  2014/06/22 11:50.24:INFO Launching bootstrap host
  2014/06/22 11:51.29:INFO Bootstrapping environmen

Note that we took a decision to use a 1GB (RAM) VM here (mem=1g), in a datacenter in New York (region=nyc1). For the record, I tried creating them in nyc2, which is also a valid D.O. datacenter, but it failed miserably (sometimes not creating the VM, sometimes creating it without IP, sometimes creating it fully, but in the end never returning with a proper success response for my environment to be created), so sticking to nyc1 is probably a reasonable time-saver.

Provisioning VMs

To be able to deploy Chamilo, we’ll use two VMs: one for the web server and one for the database

juju docean add-machine -n 2 --constraints="mem=1g, region=nyc1"
2014/06/22 12:44.59:INFO Launching 2 instances
2014/06/22 12:46.42:INFO Registered id:1908893 name:digitalocean-8d14c9bc671555ff872d8d6731f84d68 ip:198.199.82.172 as juju machine
2014/06/22 12:49.08:INFO Registered id:1908894 name:digitalocean-a9ba29cfe55549f58e5f7e365199c5ed ip:208.68.39.19 as juju machine

Now, the “-n 2” above allows you to create these 2 instances, but you could also launch 2 different instances of different properties, doing it one by one. In our case, I suggest you use version Trusty of Ubuntu for the MySQL machine, to avoid a little bug in the Precise version of the charm:

juju docean add-machine --constraints="mem=2g, region=nyc1"
juju docean add-machine --series=trusty --constraints="mem=1g, region=nyc1"

The important thing here being that you can later identify the machine itself by a simple ID, using juju status:

juju status
environment: digitalocean
machines:
 "0":
  agent-state: started
  agent-version: 1.19.3
  dns-name: 192.241.142.154
  instance-id: 'manual:'
  series: precise
  hardware: arch=amd64 cpu-cores=1 mem=994M
  state-server-member-status: has-vote
 "1":
  agent-state: started
  agent-version: 1.19.3
  dns-name: 198.199.82.172
  instance-id: manual:198.199.82.172
  series: precise
  hardware: arch=amd64 cpu-cores=1 mem=994M
 "2":
  agent-state: started
  agent-version: 1.19.3
  dns-name: 208.68.39.19
  instance-id: manual:208.68.39.19
  series: trusty
  hardware: arch=amd64 cpu-cores=1 mem=994M

If you made a mistake at some point or just wanna try things out, you can destroy these instances with

juju docean terminate-machine 1

where “1” is the ID of the machine, as shown above before each of them.

Deploying Chamilo

Now we’ve got our machines, we just need to deploy the Chamilo Charm and the MySQL Charm (you need MySQL to run Chamilo):

juju deploy cs:~jose/chamilo --to 1
juju deploy mysql --to 2

Please note that the “–to n” option is to specify on which machine you want to deploy the selected service.

Now, we need to configure Chamilo a little. We’re going to give it a domain name (you’ll have to redirect this domain name to the IP of the first machine – the one with the Chamilo service – in order to use it when ready) and a password for the “admin” user (the user created by default):

juju set chamilo domain=test.chamilo.net pass=blabla

Now we still need to tell Juju to link the Chamilo service with the MySQL service:

juju add-relation chamilo mysql

And finally, apply all the above and expose the chamilo service to the public:

juju expose chamilo

If something goes wrong with a service, you can always remove it with:

juju destroy-service chamilo

You can replace “chamilo” by the service with which you are having the issue, of course. If that doesn’t work out, you can always remove (terminate) the machine itself (see above).

Useful tricks

You can connect at any time to any of your virtual machines through the command

juju ssh chamilo/0

where “chamilo/0” is the name appearing below “units” in your services.

You can check the status of all your instances with

juju status

Note that, sometimes, you might end up with dozens or hundreds of instances. In this case, it won’t be as practical to show the status of all instances (I have no solution for that now, but I’m sure there is a way to filter the results of a juju status).

You can launch a command on the virtual machines’ command line like this:

juju run --service chamilo "tail /var/log/juju/unit-chamilo-0.log"

This way, you are actually executing the command remotely and getting the results locally.

You can also see the error log locally, connecting in SSH (first) and then launching:

 tail /var/log/juju/unit-chamilo-0.log

Obviously, that gives you a little more flexibility.

Notes about unexpected errors

One of the “silent” things is that Juju considers the default machine to be Ubuntu Precise. In the case of MySQL, the default Charm is configured for Trusty. This means that if you want to install this package, you need to install a virtual machine in Trusty. Otherwise, you might get some other issues. In my case, the Precise Charm didn’t really work (missing yaml), so I decided to go for Trusty.

You can choose the distribution of your machine with –series=trusty, for example:

juju docean add-machine --series=trusty --constraints="mem=2g, region=nyc1"

We tested the chamilo charm relatively extensively.

Unmounting the whole thing

If this was just a test, and you’re happy, maybe you want to remove everything. If so, the quickest way to do that is to launch a destroy-environment command, but you will first need to destroy each machine and, before that, each services that :

juju destroy service chamilo mysql
juju destroy machine 1 2
juju destroy-environment digitalocean

This should reasonnably quickly remove the whole setup.

You should still check your Digital Ocean’s dashboard, though, as apparently it doesn’t always delete the nodes you created with Juju…

Quick commands list for the impatient

Assuming you’re running Ubuntu 14.04 and that you know which values to change in the commands below:

sudo add-apt-repository ppa:juju/devel
sudo apt-get update && apt-get install juju
sudo chmod -R 0700 .juju
sudo apt-get install python3-yaml
sudo pip install -U juju-docean
export DO_CLIENT_ID=aseriesof21alphanumericalcharacters 
export DO_SSH_KEY="user@computer" 
export DO_API_KEY=aseriesof32characters
juju docean bootstrap --constraints="mem=1g, region=nyc1"
juju docean add-machine --constraints="mem=2g, region=nyc1"
juju docean add-machine --series=trusty --constraints="mem=1g, region=nyc1"
juju deploy cs:~jose/chamilo --to 1
juju deploy mysql --to 2
juju set chamilo domain=test.chamilo.net pass=blabla
juju add-relation chamilo mysql
juju expose chamilo

And connect your browser to test.chamilo.net (that you must have redirected to the corresponding IP first) and login with admin/blabla.


								

Vim regexp: transforming multiple SQL inserts into a big one

If you ever face a very slow MySQL process based on a very long insert file and you want to optimize it by unifying a lot of queries, you can do something like the following.

Imagine you have a lot of these:

INSERT INTO `employee` (`cod_modular`, `sequential_pago`, `a_pater`, `a_mater`, `names`, `type_id_doc`, `document_number`, `cod_dre`, `desc_dre`, `cod_cgef`, `desc_cgef`, `nec`, `level`, `cod_ie`, `name_ei`, `esc_magisterial`, `cod_charge`, `desc_charge`, `situation`, `dias_licence`, `period`, `planner`) VALUES ('1991119073', 283001, 'PHILIPS', 'Castle', 'BETTY', 'DNI', '01712532', '21', 'SAN MARTIN', 'DX', 'CGEF A', '02', '3', 'DX023159', 'SCHOOL A', '0', '4006', 'PROFESSOR', 'Enabled', 0, 'May 2013', 'Active');
INSERT INTO `employee` (`cod_modular`, `sequential_pago`, `a_pater`, `a_mater`, `names`, `type_id_doc`, `document_number`, `cod_dre`, `desc_dre`, `cod_cgef`, `desc_cgef`, `nec`, `level`, `cod_ie`, `name_ei`, `esc_magisterial`, `cod_charge`, `desc_charge`, `situation`, `dias_licence`, `period`, `planner`) VALUES ('1991119084', 300003, 'MONTH', 'Roof', 'ESTHER', 'DNI', '01712482', '6', 'UCAYALI', 'EI', 'CGEF B', '02', '2', 'EI022330', 'SCHOOL B', '1', '4006', 'PROFESSOR', 'Enabled', 0, 'May 2013', 'Active');

And you want it rather like this:

INSERT INTO `employee` 
(`cod_modular`, `sequential_pago`, `a_pater`, `a_mater`, `names`, `type_id_doc`, `document_number`, `cod_dre`, `desc_dre`, `cod_cgef`, `desc_cgef`, `nec`, `level`, `cod_ie`, `name_ei`, `esc_magisterial`, `cod_charge`, `desc_charge`, `situation`, `dias_licence`, `period`, `planner`) 
VALUES 
('1991119073', 283001, 'PHILIPS', 'Castle', 'BETTY', 'DNI', '01712532', '21', 'SAN MARTIN', 'DX', 'CGEF A', '02', '3', 'DX023159', 'SCHOOL A', '0', '4006', 'PROFESSOR', 'Enabled', 0, 'May 2013', 'Active'),
('1991119084', 300003, 'MONTH', 'Roof', 'ESTHER', 'DNI', '01712482', '6', 'UCAYALI', 'EI', 'CGEF B', '02', '2', 'EI022330', 'SCHOOL B', '1', '4006', 'PROFESSOR', 'Enabled', 0, 'May 2013', 'Active');

And obviously you’d prefer to have like 250 of these inserts grouped together…

Well, here are good news: you can do it in a command (although you have to repeat it a few times) with VIM. Let’s assume that the fixed query part (the fields names, from the first backtick, to the end of the VALUES word) is actually 305 characters long (you’ll have to check that the first time, but the good news is it’s fixed). What you want to do is select the current line (do that with the “v” key), then issue a command that will replace the last character of the first line, then all the static SQL string by just a comma, and that you want to do this 250 times… You would then do this :

:'<,'>250s/;\nINSERT INTO .\{305\}/,/

This should work out of the box. If you have another number of chars for the static string, change the 305 correspondingly. If you want to do this more or less than 250 times (more is not advised as this might be a very heavy action for your VIM process), just change 250 to whathever you want.

If you have a few groups like this to do, just press the down key, the : key and the up key to get the same action executed twice in a row.

If you have to repeat that a hundred time, then you might want to look for another selector than ‘<,’>.

Categories: English, Misc, Techie Tags: ,

The biggest challenges for start-ups in Peru

March 2, 2013 1 comment

Today I went to a conference organized by the Lima Valley coordinators team, hosted by PriceWaterHouseCooper Lima, and hosted by ex-entrepreneur-turned-speaker Bowei Gai.

Perú is a nice country: vast, with lots of different geographies, some of the deepest canyons in the world, adventure sports with not too much regulations, jungle, beach, mountains climbing around 6000 meters above see level, subtropical climate and extreme high-altitude climate (and gigantic lakes). There are around 30M people (and apparently more Twitter accounts than that, although that’s probably due to over-use of social marketing) and around 10M just in Lima, the capital. Nothing in comparison to Mexico DF, but still…

Recently, Peru has been considered as a very active hub of entrepreneurship, probably due, between others, to the existence of a very active team of entrepreneur-lovers called Lima Valley.

A little bit about me: I’m co-founder of Lima Valley (I was part of the team invited by Daniel Falcón to organize a few meeting and try to find a way to improve entrepreneurship in Peru back in 2008, but then stopped participating actively in mid-2009, so I couldn’t take much credit, really).

I have a start-up in Belgium and a start-up in Peru. I’ve been around in Perú since 2007 and I’m the leader of a famous free software (>open source) e-learning platform project called Chamilo. I have spent the last 10 years of my life “trying out” different business models around free software.

Although my financial success is nothing close to a miracle, I have been able to manage (obviously not alone) a project that now has 3.5M users around the world and generates (for our company alone) a reasonnable income per year (and almost no benefits given to the high amount we invest in research and development), with a steady growth year over year. That’s considering it’s a free platform, so not only our sales are more difficult to pitch, but we also make it easier for other companies to compete against us, because we think you can make a *honest* living out of services to improve education and that our product improves education and should be available for anybody who wants to put the extra effort of downloading and installing it. This is not our only source of revenue, but we are quite the experts in e-learning platforms in Latin America.

I’ve also been mentoring candidates for entrepreneurship at the Start-up Academy for several years, a project that was launched by Arturo Canez and Álvaro Zarate at the end of 2010, if I remember the date well. This has given me a wider and more profound view of what entrepreneurship is, what works, what doesn’t and which external elements can influence it.

One of the things I didn’t expect from today was Bowei asking, during the round table, for the public’s (about 80 people) thoughts about the biggest advantages and the biggest challenges in launching a start-up in Peru. I would have brought a long list of bullet points, but I’m the kind of very extensive speaker, not really ready for a one-minute speaking time style of his question to the public, so I decided to shut it up and write about it later on this blog.

One thing that kind of surprised me, though, is Bowei telling, as a conclusion address, that we didn’t need to wait for the government or any big organization to act in order to start our own business… I would have thought this was basic stuff for entrepreneurs! As if the only thing entrepreneurs were waiting for was a big funding enveloppe to start developing their ideas. Come on! I wouldn’t have assumed that (they didn’t know) in front of an entrepreneur crowd, but again, it’s better said than kept quiet.

The problem with funding in Peru is that it is practically impossible to get some as an IT start-up, unless you have very good friends in social sector A (B doesn’t even count). Money isn’t the source of the problem. Not having the right contacts is. You can be looking around and talking to people for years (in start-up time your project was born and dead twice) before you find people that combine the “believe in you” factor and the “I got that money to invest” factor. Having success as a start-up is not just about having a great idea *and* having the skills to build it (and that’s already difficult to find in one single person or great team). You also need massive amounts of good karma from a massive amount of people, and that’s where funding projects are useful (they already gather people ready for that).

Yes, you can definitely be successfull with a great idea and great skills, but this requires the 3rd element: good relationships. And that’s where most geeks fail, because it’s hard to be good technically and have a great social life at the same time, and that’s where you need the almost-impossible-match-without-money-being-involved: getting a social-life guy together with a geek in a relationship based on respect and mutual understanding. And this is where these funding projects get (very) useful.

Anyway, here is a list of challenges any start-up will meet in Peru. I’ll start with the ones quoted during the conference, either by panelists or by the public (with a little extra explanation from me):

  • Mindset for entrepreneurship: people do not have the entrepreneurship model embedded in their mindset, so it’s difficult to have other people support you (if they don’t understand what you do). It’s even more difficult to find people to ally with you. People having a good idea tend to think their work is done and the rest must be handle by the tech guys.
  • Funding by government: there is very little effort from the government to finance start-ups
  • Trust: it is difficult to develop trust-based relationships in Peru
  • Infrastructure: the current one, both in terms of roads and internet, make a huge number of initiatives impossible to implement. Even in Lima (only 30% of the national population), some areas do not have practical access to internet, nor proper roads network, for that matters
  • Skills: it is very difficult to find people able to produce technological products
  • Legal bluriness: a lot of legal processes linked to entrepreneurship are not defined or very complicated, which makes formalizing a real challenge. The chamber of commerce of Lima is currently hitting that nail very strongly for other businesses types as well, and I hope they will improve this situation for start-ups, as a side-effect. The government is also starting to involve the population in reducing the number of useless procedures (ver Trámite de más)

Here is my own list of challenges

  • Mindset of investment: You can analyze it however you want, but the proportion of successfull worlwide start-up that have started inside the USA is ridiculously high in comparation to those having started outside the USA. This is true for Europe as well. It is incredibly more difficult (but US people probably don’t get how much) to promote an innovative solution if you don’t start in the US market. Why? There are at least 3 reasons, which I’ve tried to test over the last 5 years: (1) racism (or the fact that you are not ready to invest in some people from the third world unless this ensures very big money); (2) propensity or easiness to buy, digitally (US people are much more ready to use digital payment systems than the rest of the world, which makes all kinds of micro-payment services work much better from the start, as you remove a huge problem for adoption); (3) language (it is true that Latin America has a larger audience than the USA, but face it, people in China have a much higher chance of knowing English than knowing Spanish, even more so for early-adopters profiles, making for a much larger user base from the very start – when the start-up needs it the most); (4) history (people around the world are much more likely to put their trust in a start-up from the USA because they’ve already heard so much about others reaching success).
  • Trust: It’s already been mentioned before, but trust is an incredible ally if you have it. A huge problem is Peru it that it is plagued by untrustable people who take each and every possibility to put you in a corner and kill you. Obviously, this is not a majority (far from that) but the existence of these people is enough to plague the whole society like cancer and make anyone doubt any alliance, even with their best friends. The lack of public voice against them encourages this behaviour. The “vivo” stereotype is pretty much accepted in society an there is almost nothing done about it. I believe this certainly achieves killing about 30-40% of any entrepreneurship project in Peru.
  • Keywords: this goes a little around the mindset point mentioned before. For some reason, people all around do not tie the term “start-up” with innovation yet. They seem to believe that a start-up is a little shop you open at the corner and that it is only meant to serve local people. Once you mention you are doing “innovation” (keyword), then they open their eyes and start listening to you (sometimes)
  • Copy-pasting-updating and the lack of legal boundaries: although innovation is present in Peru, and many people call it inventivity, a lot of cases are still copy-pasting what someone else did and quickly building up something similar. This has the very damaging effect of considering any innovation (at least in the computer-based-solutions) as a “cheap” process, which then makes it impossible to properly invest in doing innovation the right way and really “invent” stuff. This is further encouraged by the lack of enforcement of Peruvian laws: infringing a software patent is not even considered when building most web applications. If you find it on the web, then it’s free (as in freedom) to use. This encourages copy and reduces the benefits of innovation. I’m not saying software patents are a good thing (I, for one, am completely against them), but there needs to exist a mechanism by which the innovators are glorified (free software licenses encourage building up reputation and respect of the innovators), and an enforcement of such mechanism. If everybody uses Windows for free and does not question its security, philosophy or usability, then there is no incentive for anyone else to build a better product.
  • Payment systems: it is still very difficult to reach a large number of people as non-human-assisted payment methods are not accessible to all. There are efforts being made in this direction, but it seems like there is no real political intention to massively distribute it still (the plan has been around for 3 years already)
  • Internal racism: a cultural problem almost invisible to whom doesn’t analyse Peru’s society is internal racism, in particular towards people living in or coming from the Andes (“Serranos” as they are called). It is pretty difficult to get all these people together woking on the same team as they tend not to be able to trust each other. I won’t go into the details, but this is both a potential problem inside the start-up and outside it, as you try to develop the business based on people close to you
  • Government understanding: even though funding is not a requirement for start-ups, the problem is that the government representatives in power do not even begin to understand what innovation really is. Of course, there are a few exceptions (maybe 10 people in a relevant position) but that’s not nearly enough to support a culture of innovation. It goes even further than that: some gov staff actually believe that the government money is their money and that they should save it to avoid spending it on the wrong items.
  • Government funding: there are, at the moment, programs for funding of innovation, but if you compare the list of proposed projects an the list of projects which have been assigned funding, you find yourself in front of a huge amount of agronomical projects and maybe 1% of technological-services-based projects. It’s just that the judges for these grants do not even understand these projects, I’m sure, so they fall back to stuff they know. If you read about the numbers, you then realize that, any given year, the budget spent on innovation projects is about only 40% of the total budget they had on their hands. The rest goes to the national reserve (I hope).
  • Government politics about start-ups: so in reaction to what neighbouring countries do (Chile is a recent example), the Peruvian government decides to also promote a fund for start-ups, and they launch a program to do that… OK, so the program has been advertised in November 2012 by the minister of production, and you listen now (March 2013) that the “plan” is still not finished, and that they “hope” it will be ready in 9 months. Come on! Get serious. If the ministry of production understood start-ups, they would also understand that dozens of good projects will die in the meantime, and that the only right way to proceed is by trial and error (agile), improving the plan every year, but starting now. Ideally, they would also include real entrepreneurs in the team building this project, and not just government staff (which is rather the opposite mindset, by definition). The problem with these programs being politicalized is that, if badly managed, they confuse entrepreneurs and make them loose their time doing proposals oriented at the interests of the project for the government, finally to be discarded because the judges don’t even understand it. Even when you send a project that makes sense 3 months before the project deadline, it gets rejected on the basis of one block not being clear enough, but it gets rejected when there is no possibility for you to fix this. If the government is going to be left with more than 60% of the budget on their hands anyway, what’s the real point of asking for people in areas they don’t understand to participate?
  • Corruption: although it is always difficult to prove, corruption is present everywhere. Corruption doesn’t work (at all) with the start-up business models, based on transparency and rewarding efficiency. I put it last, however, because these last year corruption seems not to have touched that many start-ups.

Some of the advantages of Peru mentioned by panelists or the public:

  • Inventivity of the people (I really don’t agree with that being an advantage of Peru, as it could be said of any developing country: by essence, they have to do more with less, but that has nothing to do with being more inventive, in my opinion, it’s just a matter of opportunity)
  • Biodiversity (true, but that’s also doingthe case for Brazil, Madagascar, Thailand, and a long list of others with anything like “jungle” in their geography)
  • Cultural diversity (true, but that can also be a disadvantage)
  • Food (true, but it still lacks a large-scale improvement in distribution, conservation and hygiene before it can be massified and treated as an advantage to the outside world)

My opinion on Peru’s advantages for start-ups (work in progress):

  • Virgin market: many things can be “tried out” here without much impact in case of failure. Don’t abuse it: most farmaceutical companies still sell drugs here that have been prohibited from sale in the USA or Europe. That’s not the kind of “trying out” that I feel comfortable doing…
  • Low fares: the cost of production for many things is very low (more so out of Lima), so if you  are “starting up” with something that involves local goods, production costs will be low. However, don’t rely too much on exportations, as the corresponding processes are really out of proportion and mostly accessible only to large businesses. Watch out for the cost of highly-skilled staff, though, as these can be in complete disproportion to the rest of the workforce and the cost of living (demand is very high, offer very low)
  • Delivery costs: Mobility is very low cost (if it doesn’t involve air transport) inside Peru, so hiring a team to deliver products on a motorbike in Lima, for example, can be extremely inexpensive (in comparison to Europe, where delivery was considered, 10 years ago, not to be possible under 30€/hour)
  • One language to in the commerce bind them: Latin America, to a few exception (the most notable being Brazil) is a huge continent where everyone speaks Spanish. That’s a huge advantage in terms of commerce over Europe, although not so much over USA+Canada or China. It also has tons of local languages (there are more than 35 languages still alive in Peru alone).

In conclusion, as for any market, if you want to have success as a start-up, you have to know the market and find the best advantage points for your case. Peru is certainly not a paradise for start-ups, and current entrepreneurs here can certainly be hailed for there ability to go against the current. Levelling up the skills of staff in general would really improve the situation exponentially, though. No… really!

Categories: English, Management, Misc Tags: ,

Installing SoulFu on Ubuntu 12.04 64bit

September 23, 2012 Leave a comment

If you ever want to install the amazing multiplayer SoulFu medieval-fantasy game from Aaron Bishop (up to 4 players with joysticks & keyboard on a single computer) on your Ubuntu 12.04 (Precise) 64bit, follow the howto below. The most problematic point is that it depends on libjpeg62 compiled in a 32bit version. To install this one (although you’re running on 64bit) you need to issue a specific “apt-get install libjpeg62:i386” command (instead of the same version without :i386).

Follow the guide here: http://www.playdeb.net/updates/Ubuntu/12.04#how_to_install. Namely, issue the following commands:

wget -q -O- http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
sudo echo "deb http://archive.getdeb.net/ubuntu precise-getdeb games" >> /etc/apt/sources.list.d/playdeb.list
apt-get update
apt-get install soulfu libjpeg62:i38

Then launch SoulFu to start playing:

soulfu

Retrospectiva de TechCamp Lima 2012

La semana pasada he participado a uno de los eventos más gratificantes de desarrollo de “responsabilidad social” para llamarlo algo que no es exactamente correcto pero que, en falta de mejores palabras, tendrá que ser mi descripción corta.

Presidente ESAN y embajador de EEUU en Perú

El TechCamp es una iniciativa del Departamento de Estado de los Estados Unidos de América con la cual se busca desarrollar colaboraciones duranderas entre instituciones de la sociedad civil y tecnólogos con un fuerte sentido de responsabilidad ciudadana.

Kiko Mayorga, co-organizador y el genio en la botella de Escuelab

La organización es simple:

  1. los tecnólogos exponen un tema cada uno (en metodología de cita-rápida)
  2. representantes de organizaciones de la sociedad civil escogen un tecnólogo que parece poder solucionar problemas comunes que enfrentan
  3. se desarrollan modelos para solucionar estos problemas

Speed-dating de tecnólogos e instituciones

Esto se hace en un ambiente convivial, poniéndo de lado los asuntos comerciales, buscando soluciones o compartiendo problemas para elaborar soluciones que cubran las necesidades de varias organizaciones en conjunto (de esta forma es mejor aún ya que permite lograr una sostenibilidad mayor, dividiendo los costos de implementación y mantenimiento a futuro, si estos existieran en la solución propuesta).

Esta actividad se desarrolla durante dos días completos (más una noche de preparación y unas horas de retrospectiva). El Departamento de Estado se encarga de financiar razonablemente (para el contexto laboral local se podría decir generosamente en este caso) los tecnólogos, de tal forma que puedan dedicar toda su energía durante estos 2 días (y un poco más) en encontrar soluciones.

Los temas tratados durante este TechCamp fueron variados (creo que fueron 11 temas en total):

  • la problemática de la traducción (localización) en idiomas nativas, tema crítico para un país como Perú que cuenta con más de 30 idiomas indígenas usados a nivel nacional, de las cuales solo 3 son reconocidas.
  • la elaboración de sistemas automatizados para la propagación de noticias (“robots”)
  • el propio uso de redes sociales para la difusión de sus actividades
  • el uso de mapas para representar datos de forma atractiva
  • … una serie de otras que no recuerdo bien (pues tuve que concentrarme en lo mio) …
  • el uso de la tecnología para capacitar a personas en lugares poco accesibles

Hagamos un “fast-forward” para llegar a la conclusión de 2 días de trabajo intenso para mi grupo. Yo me encargué (obviamente, debido a mi especialización en el campo de la capacitación a distancia) del último tema.

Durante este TechCamp, llegamos a las siguientes constataciones

  • las instituciones de la sociedad civil tienen dificultad en armar propuestas que permitan a sus empleados o sus miembros desarrollarse como profesionales, pues no tienen un mecanismo que permita enseñar a distancia y la movilización de los recursos humana es costosa o impráctica (pasajes, seguridad, grupos locales de pocas personas pero presencia nacional dispersa, …)
  • una plataforma como Chamilo puede solucionar una parte de estos problemas. Sin embargo, representa un costo mantener un sistema de este tipo y el tiempo necesario para rentabilizar un nuevo modelo de capacitación puede ser largo
  • Chamilo es (también) una asociación sin fines de lucro, por lo que comprende la situación de las instituciones como las de mi mesa, y justamente soy representante legal de esta asociación
  • Las instituciones que tienen esta necesidad tienen contenidos de cursos que permitirían lanzar distintos cursos rápidamente si una plataforma de enseñanza a distancia les estuviera proveida, dado el know-how de como gestionar estos contenidos

El equipo de tecnólogos trabaja hasta tarde en la noche para clasificar y validar los problemas que aparecieron durante el primer día

Estas llevaron a una feliz conclusión:

  • La asociación Chamilo, a través de mi persona, se compromete a mantener un portal de capacitación abierto a todas las instituciones presentes (y posiblemente más) y a capacitar (brevemente) las instituciones presentes en el manejo de cursos en línea
  • Las instituciones, a cambio, se comprometen a desarrollar cursos de acceso gratuito y libre (licencia Creative Commons BY-SA) destinados a sus públicos respectivos, pero con libertad para otros de registrarse en ellos
  • Las insituciones podrán promocionar sus actividades a través de estos cursos
  • Escuelab provee el espacio para la capacitación

Pizarra de estructura de cursos elaborada durante mesa de trabajo

Hemos quedado en organizar una capacitación en Escuelab en 4 semanas de este evento (ya va una semana) y de ahí tener cursos corriendo a las 8 semanas. A través de un intercambio dinámico, se espera lograr un proyecto funcional, eficiente y atractivo con el cual las instituciones lograrán:

  • reducir sus costos de capacitación
  • mejorar el acceso a la capacitación para todos sus miembros, empleados o el público en general
  • promocionar mejor sus servicios a través de estos cursos gratuitos y de buena calidad
  • aumentar la calidad de vida de los ciudadanos peruanos a través de mayores logros, gracias a un acceso a la información aumentado y medible

Me acordaré con mucho enthusiasmo de este evento que no solo me ha permitido aportar mis competencias al servicio del ciudadano, sino también me ha permitido aprender sobre problemas en el campo en términos de conectividad, idiomas nativos como el Yime Yame (los que viven cerca de los árboles) que no conocía, y mecanismos para lograr financiamientos municipales (SNIPs) en Perú.

Equipo involucrado durante estos dos días – algunos faltaron en la foto

Lo que mejoraría:

  • más tiempo de preparación para los tecnólogos (permitir más intercambio entre ellos)
  • un mini-fondo para cubrir las necesidades de los distintos proyectos que surgen (o el compromiso de los tecnólogos en reservar parte de su financiamiento para esto)
  • ambiente distinto (con más separaciones)
  • grabar cada una de las mesas de trabajo

La nube y sus defectos

September 16, 2010 2 comments

Acabo de ver un video de descripción en Español de lo que es el “Cloud Computing”, o mejor dicho, las ventajas que provee a los negocios que quieren adoptarlo.

Pues he sido muy desilusionado por la poca sinceridad de este video. Lo pongo aquí:

Hay un limite a la simplificación de los temas complejos, no? Pasado un cierto nivel, empieza a ser engaño, en mi opinión.
Aquí los autores me parecen “olvidarse” de una serie de problemas importantes del cloud computing:

  • no todas las aplicaciones o todos los tipos de aplicaciones soportan este tipo de arquitectura
  • una aplicación compartida genera riesgos de mezcla de información entre usuarios, que son más peligrosos todavía cuando la aplicación propuesta no se puede revisar (=código cerrado) como los últimos casos de Apple siendo robado de montones de datos relacionados con el iPad en EE.UU. (perdieron datos de sus clientes en un ataque de seguridad)
  • el desarrollo de una aplicación propia (de no encontrar el tipo de aplicación deseado) toma mucho más tiempo desarrollar para este concepto (ver analizis de Drupal + Amazon en acquia.com por ejemplo) porque genera una serie de paradigmas distintos que surgen al momento de implementar la aplicación

Los argumentos: más seguro, más barrato, más flexible solo se aplican a soluciones ya existentes desde hace mucho. Los mismos argumentos valen para un servidor único (en modo no-cloud) con aplicaciones compartidas (modo ahora “clásico” del Application Service Provider).

En resumen, aunque el cloud computing sea útil para volumenes muy altos de datos, en muchos casos no se revela necesario para proporcionar un excelente nivel de calidad a bajo costo.

Un reciente artículo de Symantec reporta faltas graves en la adopción del cloud por las direcciones informáticas de grandes empresas. Ver el artículo de resumen de Indexel (en Francés) aquí

phpxml2form, or how to quick-build an HTML form from any XML document

August 25, 2010 2 comments

I’ve been trying to find the kind of PHP library that allows you to quick-generate an HTML form a basic XML structure. Apparently there is no such thing, so here you can find some code that will help you do that (you still have to build the form tags from outside the function). This code is LGPL

/**
 * This function builds and prints an HTML form from a given XML Element (loaded by simplexml_load_file())
 * @param    object    A SimpleXML object
 * @param    int        Iteration (to know what level of recursivity we're in and print margins accordingly)
 * @param    string    The basename (prefix) to use for the input names
 * @example
 * $xml = simplexml_load_file($xml_file_path);
 * echo '<form action="" method="POST">';
 * xml2form($xml);
 * echo '<input type="submit" name="submit" value="Submit">';
 * echo '</form>';
 */
function xml2form($xml,$iter=0,$basename='') {
 global $attributes_non_editable; // an array of elements to "disable" in the form
 $s = '- '; // the symbol to repeat to show a tree-like structure
 foreach ($xml->children() as $c) {
  $n = $c->getName();
  $id = 0;
  $attribs = '';
  if ($c->attributes()) {
   foreach ($c->attributes() as $k => $e) {
    if ($k == 'id') {
     $id = $e;
    }
    $attribs .= str_repeat($s,$iter+1).'<label for="'.$basename.'['.$n.']['.$id.']['.trim($k).']">'.trim($k).'</label>';
    $dis = '';
    if (in_array($k, $attributes_non_editable)) {
     $dis = 'disabled="disabled"';
    }
    $attribs .= '<input type="text" name="'.$basename.'['.$n.']['.$id.']['.trim($k).']'.'" value="'.trim($e).'" '.$dis.' />';
    $attribs .= '<br />';
   }            
  }
  if (!empty($n)) {
   echo str_repeat($s,$iter).'<label for="'.$basename.'['.$n.']['.$id.']'.'">'.$n.'</label>';
   echo '<br />';
  }
  if ($c->children()) {
   echo $attribs;
   if (empty($basename)) {
    xml2form($c,$iter+1,$n.'['.$id.']');
   } else {
    xml2form($c,$iter+1,$basename.'['.$n.']['.$id.']');
   }
   echo '<br />';
  } else {
   if (isset($c[0])) {
    echo '<input type="text" name="'.$basename.'['.$n.']['.$id.']'.'" value="'.trim($c[0]).'" /><br />';
   }
   echo $attribs;
  }
  echo "\n";
 }
 if ($iter == 2) { echo '<hr />';}
 return true;
}

Many things can be improved (styling-wise) and it would be better with a function to wite the XML as well, but this should be enough for now…

Yahoo! Pipes in JQuery: jsPlumb

March 23, 2010 5 comments

Those of you who have been following me will know that I’ve been looking a lot into JS libraries that can manage visual boxes and links between them. Well, it looks like there’s a new kid on the block! Thanks to Marco for passing me a link to the jsPlumb demo site, where you can see three different demos of how blocks and their relations would look like.

The scripts don’t take too long to load, which is great (in comparison to previous libraries I had tried). Apparently, the structure doesn’t need to be tree-based (although I might be wrong here), which means it could enable the implementation of several types of links between elements. Finally, every link and every block can take a different color, which means it can be even clearer to present the elements.

Of course, there are a few drawbacks, like the fact that it doesn’t have a kind of “natural reordering” effect when dropping one of the draggable boxes. But that’s a minor problem for now.

Categories: English, Misc, open-source Tags: , , ,