Archive

Posts Tagged ‘ubuntu’

Ubuntu 9.10 on an hp mini 110-1125nr

January 26th, 2010 Ivan Villareal No comments

I got this new mini 110, it came with Windows 7 Starter, and after a day of using it I was very frustrated because it was very limiting, for example, I was unable to change my Desktop background, the network management is confusing and frustrating, and it had a lot of crapware, except for the hp games, that some of them are fun.

Anyway, right now I don’t have time to spend getting a new OS on this machine, I just want something that works, I don’t plan using this to work, but I would like to have some of the tools I use into this.

So my options were, trying Ubuntu remix or Windows Xp, after checking that hp had the drivers for XP, I was going to change Windows 7 to Xp, but I was reading how to create a USB boot drive, and it was too much hassle for me. (I’m very lazy for any Microsoft stuff).

My next option was Ubuntu remix, I’m not a big fan of Ubuntu, but I wanted something to just worked out of the box, also this little netbook comes with splashtop, a really nice feature for checking stuff online fast, and I didn’t want to loose this so I really didn’t knew how well this was going to work.

I started downloading Ubuntu 9.10 Karmic yesterday night, just in case, Today after more frustrating things, I decided to give Karmic a try.

I grabbed my usb pendrive, a 1gb  kingston traveler, mounted the iso and ran usbinst.exe, it was pretty straightforward, my only advice to you would be to avoid saving space for your documents in the usb, my first try I set this to 30Mb and the boot failed, so I set the do not save feature.

It took about 40 minutes to finish copying the files, after it was done, I restarted the netbook with the pendrive connected, and at the first boot screen I pressed F9 key for booting options, selected the pendrive and that was it.

After testing ubuntu from the pendrive, it ran pretty well and everything but the wifi worked, I did an installation, keeping the windows partition and the hp restore partition, just in case.

The installation was pretty smooth, no issues at all, after the first boot I just installed the broadcom drivers, it was pretty easy with the driver manager in ubuntu, and the wifi was working

Update: My hp mini was stolen by a couple of elderly people, I saw the video :( , so I’m unable to play more with this, but the time I had this I was very happy with it, it performed well.

Categories: Hardware, Linux Tags: , ,

File Type Detection in PHP

December 24th, 2009 Ivan Villareal No comments

I’m working on a project where the users can upload files, and I need to know the type of file they are uploading, a simple solution would be to check the extensions of the files, but this has many flaws, so I was looking for a reliable way to detect the type of file, and I found a PECL extension called file info this extension is enabled by default in PHP 5.3, unfortunately I’m runing PHP 5.2.10, and the prod server also has this version.

So what I did to install this on ubuntu 9.10 karmic was the following:

 

root@mini:/etc/php5/apache2# apt-get install php5-dev libmagic-dev php-pear
....
root@mini:/etc/php5/apache2# pear channel-update pear.php.net
...
root@mini:/etc/php5/apache2# pecl install Fileinfo
....
Build process completed successfully
Installing '/usr/lib/php5/20060613+lfs/fileinfo.so'
install ok: channel://pear.php.net/Fileinfo-1.0.4

 

and finally I added the extension to php.ini

extension=fileinfo.so

I restarted the apache server, and tested with this

          <!--DVFMTSC-->$fileInfo = new finfo(FILEINFO_MIME); <!--DVFMTSC--> 
$mimeType = $fileInfo->buffer(file_get_contents($uploadedFile));

 

Categories: Linux, PHP Tags: , , ,