Writing thoughts

Writting about entrepreneurship, computing, music and life.

Migrations – In production environment

Something simple, just a tip for remembering it. If you want to do migrations in production server, just type:

rake db:migrate RAILS_ENV=production


Reset windows 7 password from linux

Today I had a little amount of time to invest in howto reset my windows 7 password and I have done it. These are the steps to achieve it:

  1. Get/Burn an Ubuntu live CD/DVD.
  2. Boot your PC with it
  3. Install ntpwch
  4. Mount your windows partition
  5. Got into /media/partition_label/Windows/System32/config
  6. Write ‘sudo mtpwch -u username SAM.
  7. Select option one (Clear (blank) user password).
  8. Confirm ‘Write hive files’ pressing ‘y’ key.
  9. Reboot your PC with Windows.

That’s all :-D


Rails mysql socket connection

When you are configuring a rails application, execute ‘rake db:migrate’ and receive the error ‘Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)’, execute the sentence ‘mysqladmin variables | grep socket’

the obtained response will be something like ‘| socket | /tmp/mysql.sock’ and change the value for the socket parameter in config/database.yml for the obtained one and you’ll be able to connect to the database.

WordPress: Disable Google Analytics in preview

If you don’t want to make your Google analytics a mess, you want to disable the javascript included in your page when you are in preview page. You can do it using this

<?php if (!is_preview()) { ?>
Codigo GATC
<?php } ?>

Good thing :-D



Avui ha nevat a Sant Cugat (ja ho havien dit a la previsió del temps). La Júlia s’ha despertat demanant pujar la persiana per veure si havia nevat i jo, amb tota la incredulitat del món la he aixecat pensant que tot estaria com sempre.

Doncs no, tot estava blanc i la nena flipava. Hem esmorzat i hem baixat per fer ninots de neu i tirar-nos boles de neu al cap, tot molt divertit.

Ara, a veure que passa dilluns (diuen que també nevarà).


New hosting

At last, I migrated this blog from a little VPS (which was very reliable and useful) to hostgator.

It has been a very pleasant migration because of the professionality and the good tools provided by this hosting service recomended by a person who I follow since almost a year, Franck Scipion, with his blog ‘Ingresos al cuadrado‘.

I’m so happy :-)


Thinking about a new post

Thinking about a new post without any idea in your head is one of the worst situations you have to face if you write constantly a blog.

There are entries which are written with blood, sweat and tears but, after publish or schedule it, the satisfaction makes it worth it.


Git tip: Push to remote repo

git push origin master

Git tip: How to create a remote repo

This is a tip in order to remember how to do create a remote repo from a local one.

cd my_project
git init
git add .
git commit -m "Creation commit"
cd ..
git clone --bare my_project my_project.git
scp -r my_project.git usuario@servidor:repos
cd my_project
git remote add origin user@server:repos/my_project.git

That’s it.


New idea

I had an idea one weeik ago about something I will use (so I’ll be the provider an the client at the same time). Is something very useful for entrepreneurship.

Follow the news about this ;-)

Just a tip

Hi there

Do you know that if you have an Gmail acount which is johndoe@gmail.com you can send an email to john.doe@gmail.com and this email will arrive to your inbox?

Don’t ask me how they do it because I have no clue, but there is a way :-D

Un nou bitxo a la ciutat

Ahir tornant de casa em vaig trobar una companyia que no esperava en absolut i que mai hauria cregut trobar aprop de casa…un porc senglar. El molt inconscient volia atravessar la carretera i com que venien dos cotxes i es va acollonir va optar per tirar enrera una altra vegada.

I es va trobar un altre bitxo al davant…que era jo :-D