Tuesday, November 09, 2010

Can’t establish a reliable data connection to the server (solved)

If your Android device says "Can’t establish a reliable data connection to the server" when you about to connect to Google Account, you may check the date and time setting.
Please set the correct date, time and time-zone manually. Your network may not be able to provide the correct date & time.

To do this, on you home screen, click "menu" button, click "setting" menu item, scroll down until you find the "Date and time" menu and click it.
And back to your GMail/Market/Account setting.

At least this method works on my Galaxy S.

Saturday, October 09, 2010

Connecting your Android device to Ubuntu

+ Download and install Android SDK for linux
+ Connect your Android device to your Ubuntu box, set to Debug mode on your device
+ Open your terminal at Ubuntu
+ Run "lsusb"
+ Look for your device. For my device is "Bus 001 Device 011: ID 22b8:41db Motorola PCS " . Take note on the ID XXXX:YYYY .
idVendor  : XXXX
idProduct :  YYYY

+ Create file /etc/udev/rules.d/51-android.rules
+ Write down one line :
    SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666"

or just copy these line  (hope your device listed here) :
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0e79", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="091e", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="24e3", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2116", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0482", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="17ef", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0409", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2080", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0955", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2257", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="10a9", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1d4d", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04da", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="05c6", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1f53", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04dd", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0930", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="19d2", MODE="0666"

+ sudo chmod a+r /etc/udev/rules.d/51-android.rules
+ sudo chown root. /etc/udev/rules.d/51-android.rules
+ sudo service udev restart
+ sudo killall adb

+ Go to "tools" folder on your Android SDK
   - cd /mypath/android-sdk-linux_86/tools
   - ./adb devices
Look for your device in the output,

List of devices attached
04037A281900D01A    device


That's it. Have fun ...

Wednesday, July 21, 2010

To switch back to the default app on android

I keep forgetting how to switch back to the default app after (accidentally)  set the default app to 3rd party app on android.

You need to go to Home screen > Settings > Applications > Manage applications > (3rd app name)  > Launch by default > Clear defaults.

Monday, May 10, 2010

Your Android target is missing when you create a new Android project on Eclipse

If your Android target is missing when you create a new Android project on Eclipse then try to change your screen resolution to at least 1024 x 768.
I try to create a new Android project with Eclipse on my netbook which the screen resolution is 1024 x 600 . I can not select the target due to there is no target listed. Then change the screen resolution to make it appeared.

Set 3G Network Only for Android

UPDATED : On Froyo / Gingerbread you can select the network via "Setting" > "Wireless and Network" > "Mobile Networks"  > "Network Mode" .

Annoyed by network auto selected to EDGE where 3G is available.
To set your Android mobile phone to use 3G Only network you need to install an app from Market.
Make sure you have a room in Home screen for one short cut icon.
Search for "Any Cut" and install it.
Run "Any Cut", add a short cut.
Select "Activity", wait for activity list.
Select "Phone info".

"Phone info" short cut should be appeared.
Run "Phone info".
Set the preferred network type : "WCDMA only"

That's it. Enjoy your 3G (if available).

Sunday, April 18, 2010

WSGI and mod_python

Some how WSGI and/or mod_python develop memory leak.
If you seen your memory & swap space all taken up by Apache that load WSGI and / or mod_python you might try this work around :

Set MaxRequestsPerChild in apache2 conf to some number instead of 0 (zero).
In my case I set MaxRequestsPerChild to 3 due to the Apache is quite fast to take the memory.

Search for all MaxRequestsPerChild directives, you might be found it at multiple places.

Update : Please read the comment from the creator of mod_wsgi below .

Thursday, July 16, 2009

To limit APT download

If you need to limit the apt-get / auto update, you can create /etc/apt/apt.conf.d/76download.
Put script bellow into it. Dl-Limit "25" means max download speed will be 25Kbps.


Acquire
{
Queue-mode "access";
http
{
Dl-Limit "25";
};
};

Sunday, June 07, 2009

dpkg: serious warning: files list file for package `package’ missing, assuming package has no files currently installed

If you have this kind of warning message :

dpkg: serious warning: files list file for package `package’ missing, assuming package has no files currently installed.

You only need to remove and install again the 'package' .

sudo apt-get remove package
sudo apt-get install package

Wednesday, June 03, 2009

To limit your network traffic bandwidth

If you need to limit your network traffic bandwidth.
You need to install iproute-2.6.27-2.fc10.i386 in Fedora .
The original script is from
http://www.torrentflux.com/forum/index.php?topic=2743.0

To use it you need to have root privileged.
E.g.
$ sudo sh tc.sh upload

=======
#!/bin/bash
#
# Created by Discovery for PSA
# Modified by Mige Harimurti
#
# Name of the traffic control command.
TC=/sbin/tc

# The network interface we're planning on limiting bandwidth.
IF=eth0 # Interface

# Download limit (in mega bits)
DNLD=1000mbps # DOWNLOAD Limit
#DNLD=10kbps # DOWNLOAD Limit

# IP address of the machine we are limiting the uploads on.
# IP=192.168.1.101 # Host IP

# Filter options for limiting the intended interface.
# U32="$TC filter add dev $IF protocol ip parent 1:0 prio 1 u32"

start() {

# We'll use Hierarchical Token Bucket (HTB) to shape bandwidth.
# For detailed configuration options, please consult Linux man
# page.

$TC qdisc add dev $IF root handle 1: htb default 10
$TC class add dev $IF parent 1: classid 1:1 htb rate $DNLD burst 15k
$TC class add dev $IF parent 1:1 classid 1:10 htb rate $DNLD ceil $DNLD burst 15k
$TC class add dev $IF parent 1:1 classid 1:20 htb rate $UPLD

$TC qdisc add dev $IF parent 1:10 handle 10: sfq perturb 10
$TC qdisc add dev $IF parent 1:20 handle 20: sfq perturb 10

$TC filter add dev $IF protocol ip parent 1:0 prio 1 handle 10 fw flowid 1:10
$TC filter add dev $IF protocol ip parent 1:0 prio 1 handle 20 fw flowid 1:20


#iptables -t mangle -A OUTPUT -p tcp --sport 1024:65535 -j MARK --set-mark 0x14
iptables -t mangle -A OUTPUT -p tcp --sport 9001 -j MARK --set-mark 0x14


# The first line creates the root qdisc, and the next two lines
# create three child qdisc that are to be used to shape download
# and upload bandwidth.

}

stop() {

# Stop the bandwidth shaping.
$TC qdisc del dev $IF root
iptables -t mangle -F
}

upload() {

read -p 'Enter Upload Speed [e.g.50kbps]: ' UPLD
}

restart() {

# Self-explanatory.
stop
sleep 1
start

}

show() {

# Display status of traffic control status.
$TC -s qdisc ls dev $IF

}

case "$1" in

start)

upload
echo -n "Starting bandwidth shaping: "
start
echo "done"
;;

upload)
#read -p 'Enter Upload Speed in kbps: ' UPLD
upload
echo "Upload is now set to: $UPLD"
echo -n "Restarting bandwidth shaping: "
restart
echo "done"
;;

stop)

echo -n "Stopping bandwidth shaping: "
stop
echo "done"
;;

restart)

echo -n "Restarting bandwidth shaping: "
restart
echo "done"
;;

show)

echo "Bandwidth shaping status for $IF:"
show
echo ""
;;

*)

pwd=$(pwd)
echo "Usage: tc.bash {start|upload|stop|restart|show}"
;;

esac

exit
==============

Tuesday, March 17, 2009

Sending simple email using python

Source http://snippets.dzone.com/posts/show/658

In my case, I can send simple email using smtplib but the I received empty/blank email which is without From/To/Body appeared on my email client (Thunderbird).

So you need to wrap your email with email.MIMEText as sample codes bellow:

import smtplib
from email.MIMEText import MIMEText

def sendTextMail(to,sujet,text,server="localhost"):
fro = "Expediteur "
mail = MIMEText(text)
mail['From'] = fro
mail['Subject'] =sujet
mail['To'] = to
smtp = smtplib.SMTP(server)
smtp.sendmail(fro, [to], mail.as_string())
smtp.close()

sendTextMail("toto@titi.com","hello","cheers")


Warning: mkdir() [function.mkdir]: Permission denied on Fedora

Source http://gallery.menalto.com/node/42302#comment-176477

The problem in my case was that I had the SELinux's security features enabled in my Fedora Core 4 setup. I switched SELinux to permissive mode by editing /etc/sysconfig/selinux -
putting SELINUX=permissive.

There's probably a nicer way than just disabling the security but I was after a simple solution. SELinux FAQ is here.

You need to reboot to make it effective.

Friday, January 16, 2009

IBM Lotus Symphony

One more alternative for free Office Suite on Ubuntu Linux is IBM Lotus Symphony.
We can get it on http://symphony.lotus.com/ .

Thursday, January 15, 2009

Setting up Bridged Network

I need to set up bridged network for my VirtualBox guess OS to have a network connection attached to host interface.

So I install bridge-utils package :

$ sudo apt-get install bridge-utils 

I need to add some lines in /etc/network/interfaces

auto br0
iface br0 inet static
address 192.168.10.102
netmask 255.255.255.0
bridge_ports eth0

You have to bring up br0 manually for now.


sudo /etc/init.d/networking restart
sudo ifup br0


I think, that's it. VirtualBox 2.1.0 doesn't need TAP or TUN interface.
br0 will recognized in the Host Interface list in network setting part for guess OS.
Due to I set my br0 to static IP, I also need to set my network interface in guess OS to static IP (e.g 192.168.10.101) .

Wednesday, January 07, 2009

Disable Touchpad on Gnome

It's annoying when you typing some thing suddenly your pointer fly-away somewhere else coz you inadvertently touch the touch-pad with part of your hand.

There are two way to disable/enable thouchpad in Gnome :
1. Go to menu on "System" -> "Preferences" -> "Mouse"
Click on "Touchpad" tab and [un]check "enable Touchpad" below "General" section.

2. Open Terminal [Command line box / console].
To disable, execute :
gconftool -t bool -s /desktop/gnome/peripherals/mouse/touchpad_enabled "f"


To enable, execute :
gconftool -t bool -s /desktop/gnome/peripherals/mouse/touchpad_enabled "t"

Friday, August 08, 2008

Cingular 3G LaptopConnect Card Option GT Max(R) 3.6

Update for Ubuntu 8.10

It's a great discovery that 8.10 can handle Cingular 3G LaptopConnect Card Option GT Max(R) 3.6 out of the box. You don't need to use application from forge.betavine.net .

You just need to fill out the form that pop-ups.
Great jobs for Ubuntu 8.10 team, two thumbs up !!

__________________________
If you have Cingular 3G LaptopConnect Card Option GT Max(R) 3.6 then you need the driver and application to use it on Ubuntu Hardy Heron.
You can get it at :
https://forge.betavine.net/projects/vodafonemobilec/

And then follow the Download link.
In my case I use vodafone-mobile-connect-card-driver-for-linux-2.0.beta3-ALL-i386-installer.run one. You may find newer version.
You just run it and enjoy the HSDPA connection.

Thursday, July 31, 2008

To change the default application to open a certain file type

In my case, I want to change the default application to open my PDF file with Adobe Reader 9 instead of Evince Document Viewer (default from clean Ubuntu installer).

First, open the folder where your file (my PDF file) is reside. Then, right click on the file. And then select the "Properties" menu.
A new window will pop-up, and you need to select the "Open with" tab.
Then select the application you want to open the file by default of double click it.

Monday, June 02, 2008

Modem Conexant HSF di Ubuntu 8.04

UPDATE :
Dell has the driver that easy to install at
http://linux.dell.com/files/ubuntu/hardy/modem-drivers/hsf/

To install should be as easy as :
sudo dpkg -i hsfmodem_7.68.00.09oem_i386.deb
___________________________________________
This
link is in Bahasa.
I translate it a little bit.

To install the Conexant Modem Driver you need to do these steps :

sudo apt-get update

sudo apt-get install build-essential

wget http://www.linuxant.com/alsa-driver/alsa-driver-linuxant_1.0.16.1-1_all.deb

sudo dpkg -i alsa-driver-linuxant_1.0.16.1-1_all.deb

wget http://www.linuxant.com/drivers/hsf/full/archive/hsfmodem-7.68.00.09full/hsfmodem_7.68.00.09full_i386.deb.zip

unzip hsfmodem_7.68.00.09full_i386.deb.zip

sudo dpkg -i hsfmodem_7.68.00.09full_i386.deb

Done. And restart your Ubuntu box.

Web page screenshot grabber for Firefox

Do you need a screen shot to grab the whole page in an important website ?
You only need to get a add-on module for your Firefox. It's a Screengrab!

Enjoy it.

Wednesday, May 14, 2008

Invalid MIME gxine.desktop

On Ubuntu 8.04 I try to install opera
opera_9.27-20080331.6-shared-qt_en_i386.deb
At the end of installation there is a message like below:

File '/usr/share/applications/gxine.desktop' contains invalid MIME type 'x-content/video-vcdx-content/video-vcd' that has more than one slash

I open the file and insert a semi-colon, so it become like this :
x-content/video-vcd;x-content/video-vcd

Sunday, May 11, 2008

Ubuntu 8.04 broken Intel ProWireless 3945 driver

It is a great disappointment that Ubuntu 8.04 has a broken driver. It is only for the first time installed, the driver is working. But after I pushed the wireless button to disable the wireless it never get up again.

So, I search for the workaround and I found it.
But the way is not good enough for me. The wireless button light is always off although the wireless is on.
You can run these command :
sudo rmmod iwl3945; sudo modprobe iwl3945

Then I use ndiswrapper to use win32 driver for Intel ProWireless 3945.
It's OK then.
-------------------------------
Update

Install ndiswrapper.

$ sudo apt-get install ndiswrapper-utils-1.9

Get the win32 driver. I got it from www.intel.com. Search the driver for "Intel ProWireless 3945". Unpack the package.

Run the ndiswrapper, from "System" -> "Administration" -> "Windows wireless driver".
Select the one *.INF file. For me it was the "NETw4x32.INF" .

If there is no error then it should be OK.
Have fun with your wireless.

----------------------------------
More update

From : http://moustafaemara.wordpress.com/2008/06/09/fixing-intel-wireless-card-3945abg-defination-in-ubuntu-804-hardy/

When i First Installed Ubuntu 8.04 i was really happy , but i got shocked when i found that my intel wireless card is not working , The system appears to see it but i cant connect nor search for networks .

After a lot of search in the ubuntu , I found that this was a formal ubuntu 8.04 Bug… Here It is

So I found a Solution Here , I tried making it more usable , Here it is , Open up your lovely Terminal

* sudo bash ( Just to make it more easy )
* modprobe -r iwl3945
* Navigate to /etc/modprobe.d command ::: cd /etc/modprobe.d
* Create file named iwl3945 command ::: touch iwl3945
* Open The File command : gedit iwl3945
* Add The Following To the File
o alias wlan0 iwl3945
o options iwl3945 disable_hw_scan=1
* Save The File and exit
* modprobe iwl3945
* sudo ifconfig wlan0 up

Now You will find networks jumping into your wireless networks list
---------------------------
Update for 8.10

In my case, it still can not work properly.
The workaround I use is the last update I wrote.
I add a shortcut to run "sudo ifconfig wlan0 up".
So, after I click the wireless button to turn-off the wireless I still can not to turn-on by clicking it again. But I can turn the wireless on by running this shortcut.