Wednesday, February 29, 2012

How to run Acronis Alignment Tool (WD Align) from a pendrive or USB drive

I'll make it quick:

Download RMPrepUSB, then format the pendrive as FAT32. Within RMPrepUSB install grub4dos on the pendrive.

Then copy the ISO the acronis program generated to the root of the pendrive.

Now, boot the pendrive and in the grub console just type (rename acronis_boot.iso to whatever you have named your ISO):

map --mem (hd0,0)/acronis_boot.iso (hd32)
map --hook
chainloader (hd32)
boot


This maps (or copy) the ISO to RAM and run the ISO from there. You can go without the --mem but the program crashed without it being ran on RAM.

Cheers

Tuesday, February 21, 2012

PHP exec() function hangs when running external program in the background

Well, this was a case of not reading the PHP documentation, because it clearly states that:

"If a program is started with this function, in order for it to continue running in the background, the output of the program must be redirected to a file or another output stream. Failing to do so will cause PHP to hang until the execution of the program ends."

So, normally when you run a program with exec(), it finishes it's normal execution and you're good, but if you are trying to run something in the background (like creating an ssh tunnel in my case) you need to redirect it's output (stdout and stderr) to another file.

I solved it by adding this to my command:

> /dev/null 2>&1 &

Which redirects stdout to /dev/null and then redirects stderr to stdout (which goes to /dev/null) and then telling the command to run in the background with the ampersand.

Done ! exec() doesn't hang anymore ;-)

Carlos

Thursday, February 2, 2012

Configure Belkin F5D7050 / F5D7050B on Debian Squeeze (and possibly Ubuntu too)

You just need to add the "non-free" component to /etc/apt/sources.list like this:

# Debian Squeeze/6.0
deb http://ftp.us.debian.org/debian squeeze main contrib non-free

# Debian Lenny/5.0
deb http://ftp.us.debian.org/debian lenny main contrib non-free

Then do an update and install a couple packages:

apt-get update
apt-get install firmware-ralink wireless-tools

And without blacklisting the rt2500usb module I couldn't make my adapter to work (it seems this module should not be autoloaded for some reason, don't know why exactly), so the last step is modifying /etc/modprobe.d/blacklist.conf and add:

blacklist rt2500usb

Save the file, remove and plug again your adapter, or reboot if nothing seem to help at this point.

Your Belkin adapter should be working now and you should see it with an iwconfig.


Carlos

Followers

About me

Santa Fe, Argentina
Programador Web, PHP, MySQL, JQuery, Administrador Linux. LAMP, Lighttpd, Nginx.