Sunday, July 17, 2011

Drupal - Using uploaded files without manually changing file permissions

Short fix, followed by longer explanation:

Go to /admin/settings/file-system , set Download Method to "Private - files are transferred by Drupal", save the settings, and see if you are now able to access the uploaded files.

The longer explanation:

Depending on the setup of the web server, uploaded files will be saved with permissions 644, or 600, or maybe something else. Permissions 644 allow ALL server users to read the files, permissions 600 allow only the user that saved the files to read them.
The thing is - the user that "owns" the files (the one that saves them to disk) is a special one, used only by the web server program to do its work. It's not the account you use to administrate the web site - to login to cpanel or FTP. Because of this, sometimes even when you FTP to the site as admin, you cannot remove the uploaded files.
In my case, the files are saved with permissions 600, AND the user that owns them is not the same user Apache uses. So, the web server program cannot read them. I'm assuming my web hosting company uses different users for PHP processes and Apache processes, and the uploaded files are owned by the PHP user. For me, the simplest solution was to use PHP to read the files back to the user, by setting the download method to "Private - files are transferred by Drupal" in the admin page "/admin/settings/file-system".
Hope this helps.

Tuesday, July 12, 2011

Android update for lg gw620

I confirm that the update is available.
I've got some trouble for the update but now seems to work.
During the update i went through some problems:

  • windows alerted me that the software was not responding. i closed and restarted the update
  • after the update (at 99%) the mobile reboots. The first time it told me "linux kernel panic" (i was like omg!) but then the update software told me wat to do ("i lost the connection with te mobile, please remove the battery and restart the phone, then click restore")
Finally i have froyo on my phone

Some notes on the update:

  • after the download (about 150MB), during the install at 4% the mobile reboots in recovery mode (don't panic!)
  • restarting the install does not seem to be a problem
  • after the install (long time to turn on the first time) it restores prefs, contacts and so on.. (but please backup all the data anyway)
Related posts:

Monday, July 11, 2011

How to connect lg gw620 to windows for software updates

Recently lg announced an official android update to froyo for gw620!
you can read the news from their blog (in italian)

so it's important to know how to update your software
NOTE: from their post is clear that the update is available only by explicit request through email

So install the lg software from, from the setting menu of your mobile disable usb debug (menu -> settings -> application -> enable usb debug), install the drivers from the software selecting the model, connect your phone and it's done.

actually i'm waiting for the response from lg to get the official update.. i hope to update this post shortly!

Wednesday, July 6, 2011

How to add a wpa 2 enterprise network on android 1.5

Get root console access (look for that in this blog) and edit the /data/misc/wifi/wpa_supplicant.conf adding the network.
Wpa supplicant is standard unix so you can easily find informations on how to set up the network.
here is an example that worked for me (actually i have to test it on the mobile but i'm sure the wpa_supplicant works)

    ssid="yourssid (network's name)"
    ca_cert="/sdcard/cert/ca.pem file (the file of the CA)"
    private_key="/sdcard/cert/cert.p12 (the cert file)"
    private_key_passwd="password of the cert"

this sets the network for access with a certificate which is on the sd card in the cert folder

NOTE: i have tested this trick on my enterprise network and it did not work. After a few try the network manager crashed and the phone was not turning on (seems like lagging on the boot). I solved simply moving outside the range of the wifi network and disabling wifi on the phone. I hope to solve this problem quickly

Monday, July 4, 2011

How to root lg gw620

Original article:

rooting your LG Eve GW620 Now! (all credit to Zacpod)
Now onto the actual root. All this is taken from Zacpod’s excellent post found here: I’ll be copying it almost verbatim, and I hope he doesn’t mind
  1. Download the Superuser Whitelist ( and unzip it somewhere safe such as c:\SDK\tools\
  2. On the GW620 dial "3845#*620#" to get in to the secret menu
  3. Tap "Module Test" then tap "Stability Test" then tap "Enable Root Permission"
  4. Open a Command Prompt on Windows by pressing Windows Key + R, then type "cmd" in the empty field. Note, you should also run this with Administrator rights. Linux users can use Terminal.
Navigate to your installed Android SDK (ie: "cd c:\SDK\tools\").
  1. Type "adb shell"
  2. You should get a #. If you get a $ then something didn’t work. Shutdown the phone and PC and try again. If you get a # then all is well. Type "exit" to return to your PCs command prompt.
  3. Type "adb remount" to remount the GW620′s file system as read-write so we can make changes.
  4. Type "adb shell cat /system/xbin/su > /system/xbin/su.original" [Note: This step may give you a "could not find path" error. Just continue on with step 5 and the root will still work.] 
    1. NOTE: this step is very important: it backs up the original file which will be overwritten. You can try (it worked for me) to type "adb shell" getting the # root shell and then the command"cat /system/xbin/su > /system/xbin/su.original"
  5. Type "adb push bin/su /system/xbin/su"
  6. Type "adb push bin/su /system/bin/su"
  7. Type "adb shell chmod 4755 /system/xbin/su"
  8. Type "adb shell chmod 4755 /system/bin/su"
  9. Type "adb install bin/Superuser.apk"
Caution: I’m not the author, and any time you root your LG Eve GW620, you run the risk of bricking your phone. I will not be liable. However, if you need some help, go here.

Saturday, July 2, 2011

How to discover system info in terminal

Here some useful commands to discover hardware and software infos

  • cat /etc/*-release -> os version
  • uname -a -> os and kernel info
  • lscpu -> cpu info
  • cat /proc/cpuinfo -> cpu info
  • cat /proc/meminfo -> ram/mem info