Month: September 2009

Activating GMail as Basic HTML

I like to use GMail on Basic HTML mode. Why? Because I hate google Advertise, it process your email content and adjust the Advs to show “related” thing …

Also Basic HTML is more fast then full version (JS and others bull***shits), called standard view.

If you want do this just click:

“Basic HTML” at GMail foot page

Then to turn it default, click:

“Set basic HTML as default view” at header of the page.

PS.: sometimes I need to return temporarily to Standard view to create mailing list filter more easily, but as soon as it is completed I return to “Basic HTML” view.

Counting 447 patches

LTIB uses this patch definition on the spec file:

Patch1 : patch_name-bla-bla-bla.patch

%Prep
%setup
%patch1 -p1

But if you has 447 patches, like in our previous examples? Easy, use this bash command to create the right setup to apply these patches.

$ i=0; while [ $i -lt 447 ]; do i=$(($i + 1)); echo "%patch$i -p1" >> patch_spec; done

Salved by bash again

I was willing to create a incremental Patch numeration:

Original:
Patch :0001-ENGR00090813-1-merge-imx-2.6.24-2.3.0-to-2.6.26.patch
Patch :0002-ENGR00090813-2-Porting-changes-for-2.6.26.patch
Patch :0003-ENGR00090813-3-mx51-Add-core-mach-support.patch
Patch :0004-ENGR00086937-mxc_i2c-remove-unneeded-spinlock-and-p.patch
Patch :0005-ENGR00070687-1-ipuv3-add-serial-interface-support.patch
Patch :0006-ENGR00070687-2-mx51-add-ipu-and-lcd-support.patch
Patch :0007-ENGR00086541-mc13892-remove-debug-info-of-pmic-adc.patch

Result:
Patch1 :0001-ENGR00090813-1-merge-imx-2.6.24-2.3.0-to-2.6.26.patch
Patch2 :0002-ENGR00090813-2-Porting-changes-for-2.6.26.patch
Patch3 :0003-ENGR00090813-3-mx51-Add-core-mach-support.patch
Patch4 :0004-ENGR00086937-mxc_i2c-remove-unneeded-spinlock-and-p.patch
Patch5 :0005-ENGR00070687-1-ipuv3-add-serial-interface-support.patch
Patch6 :0006-ENGR00070687-2-mx51-add-ipu-and-lcd-support.patch
Patch7 :0007-ENGR00086541-mc13892-remove-debug-info-of-pmic-adc.patch

$ i=0; while read line; do i=$(($i + 1)); echo $line | sed “s/Patch0/Patch$i/” >> result_file; done < original_file

Thanks Rogerio for suggestion using "while read".

Creating remote git branch

I started using an internal git repository here at work, then today I want to create a remote branch, then I find out this tips:

Creating a Remote Branch

1. Create the remote branch

git push origin origin:refs/heads/branch_name

2. Make sure everything is up-to-date

git fetch origin

3. Then you can see that the branch is created.

git branch -r

This should show ‘origin/new_feature_name’

4. Start tracking the new branch

git checkout --track -b new_feature_name origin/new_feature_name

This means that when you do pulls that it will get the latest from that branch as well.

5. Make sure everything is up-to-date

git pull

6. If you want to remove a remote branch then run:

git push origin :branch_name

Source: http://www.zorched.net/2008/04/14/start-a-new-branch-on-your-remote-git-repository/

Renaming username on mediawiki

Log in your cPanel on your server then enter on phpMyAdmin and execute these SQL commands:

UPDATE LOW_PRIORITY user SET user_name=’NewUsername’ WHERE user_name=’OldUsername’;
UPDATE LOW_PRIORITY user_newtalk SET user_ip=’NewUsername’ WHERE user_ip=’OldUsername’;
UPDATE LOW_PRIORITY cur SET cur_user_text=’NewUsername’ WHERE cur_user_text=’OldUsername’;
UPDATE LOW_PRIORITY old SET old_user_text=’NewUsername’ WHERE old_user_text=’OldUsername’;
UPDATE LOW_PRIORITY archive SET ar_user_text=’NewUsername’ WHERE ar_user_text=’OldUsername’;
UPDATE LOW_PRIORITY ipblocks SET ipb_address=’NewUsername’ WHERE ipb_address=’OldUsername’;
UPDATE LOW_PRIORITY image SET img_user_text=’NewUsername’ WHERE img_user_text=’OldUsername’;
UPDATE LOW_PRIORITY oldimage SET oi_user_text=’NewUsername’ WHERE oi_user_text=’OldUsername’;
UPDATE LOW_PRIORITY recentchanges SET rc_user_text=’NewUsername’ WHERE rc_user_text=’OldUsername’;

Just replace the tables names with your prefix wiki used, for example case you used “boo” as prefix then the above table will be named foouser, fooarchive, fooipblocks and so on.