Installing Ubuntu 12.04 on a SD card

I installed Ubuntu 12.04 on a 64GB Class 10 SD Card.
I would not recommend it. I installed preload, took off the swap, disabled disk cache on browsers but it was still slow. But it worked, and that’s probably what you want.
My story:
Had windows on a 128GB SSD
Wanted Ubuntu on a 64GB SDCard.

If you wanna go this way you gotta make sure GRUB (and not the windows boot.cfg) is your boot manager.
Follow the steps on this thread that modify the kernel to load the sdcard modules
http://ubuntuforums.org/showpost.php?s=5cc607fc26815ce5fd89bddee599b84f&p=11915401&postcount=22
and it should work.

../lib/.libs/libcurl.so: undefined reference to `SSLv2_client_method’

I was trying to install hiphop-php, and while compiling curl, ran accross this issue
../lib/.libs/libcurl.so: undefined reference to `SSLv2_client_method'

So I went over to github and fixed my file. Their new file is here
https://github.com/bagder/curl/blob/26b487a5d6ed9da5bc8e4a134a88d3125884b852/lib/ssluse.c

So if you edit your own file, around line 1457, you will see a line that looks like this(github line 1461):
case CURL_SSLVERSION_SSLv2:
....
break;

Change your case/break statement to only contain what is in the following snippet

#ifdef USE_TLS_SRP
if (data->set.ssl.authtype == CURL_TLSAUTH_SRP)
return CURLE_SSL_CONNECT_ERROR;
#endif
#ifdef OPENSSL_NO_SSL2
failf(data, "openSSL was compiled without SSLv2 support");
return CURLE_SSL_CONNECT_ERROR;
#endif
req_method = SSLv2_client_method();
use_sni(FALSE);

Shazam! Good luck curling!

Installing Zend Server Community (Zend CE) on Ubuntu 11.10 [Tutorial]

First, you need to add the Zend Key to your Aptitude (So you can use their repository), and for this we need root.

Enter Sudo Console
sudo bash

Add the key to our local key storage (Zend’s key was unavailable, so I put one on my server.. Got it from pastebin
wget http://anebg.net/zend.key -O- | sudo apt-key add -

After downloading the download script from zend,

http://www.zend.com/en/products/server-ce/downloads

Extract it,go to the directory where you extracted it on the terminal and Install Zend CE for PHP 5.3
./install_zs.sh 5.3 ce

TCPDF returns an empty page with just the headers when writing HTML

First, make sure your HTML is valid.
Second, make sure your encoding is true to what your TCPDF construction, for example :

$pdf = new TCPDF('L', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

Is creating a UTF8 pdf document. So, before you pass in your $html variable, utf8 encode it.

$pdf->writeHTML(utf8_encode($html), true, 0, true, 0);

I use it in a site where lots of users input pasted text from MS Word, and it seems that it comes with a bunch of weird characters that break TCPDF, utf8 encoding fixed a bunch of seemingly ‘random’ blank generated PDFs.

How to Wifi tether – Wireless tether your XPERIA X10 Mini Pro

This was tested on a XPERIA X10 Mini Pro Running Eclair (2.1)

1. Root your phone. (Install the app z4root from the market and do a permanent root)

Here is z4root.1.3.0.apk

2. Install the ‘barnacle’ app, from the market as well. If you have trouble finding it use the code below (or click to download the apk)

Success stories in the comments :)

How to remove preinstalled apps on Xperia X10 Mini Pro

With this tutorial you will be able to remove stock apps that come when you buy your phone(goldrush, wisepilot, creatouch, roadsync) for this you need to root your phone (If you haven’t –follow this simple guide).

Then…

Open the shell by running “adb shell” on your command prompt.

adb shell

Change directory to /system/app

cd /system/app

List the currently installed apps

ls

And to remove an app,  run the command

rm –r [appname].apk

The apps I uninstalled were:

rm -r rollercoaster.apk
rm -r peggle.apk
rm -r california-gold-rush.apk
rm -r roadsync.apk
rm -r creatouch-2.apk

And that is it… (Simple, right?)

Make sure to not uninstall system-wide apps such as Timescape or Homescreen, as this may break your android and you might have to reinstall stock firmware and start all over again…)

Install pdo_mysql on CentOS

I tried installing it by runing pecl install pdo_mysql but I got this error:

configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
ERROR: `/root/tmp/pear/temp/PDO_MYSQL/configure' failed

The problem is that the /tmp and /var/tmp directories are noexec, which prevents pecl build scripts from running.

Here is what can be done to resolve the problem (assuming root account)

mkdir /root/tmp.pear

mkdir /root/tmp.pear-build-root

rm -rf /tmp/pear*

ln -s /root/tmp.pear /tmp/pear

ln -s /root/tmp.pear-build-root /tmp/pear-build-root

pecl install pdo_mysql should now work.