From the category archives:

Linux

Tethering Android Droid/Milestone without Root!

by Keiron on March 11, 2010

Two posts on the same day and both techie – don’t be put off, normal ranty service may well be resumed soon…

I’ve used my Windows Mobile in the past as a tethered modem for me eee pc when out and about without WiFi or o2 mobile broadband, it’s not always been easy but has been handy to have around!

I reinstalled my eee today, and was looking around for how I’m going to achieve this same functionality with the Milestone on Android, almost everything screamed “root your device” at me. I’m not a fan of rooting it for a lot of reasons the biggest being I don’t want to brick the device – so that’s a non-starter.

Then I spotted a handy guide from linux magazine on Tethering Android, it didn’t work straight off which was a little disappointing. So a little more digging on the Android forums, produced some additional instructions. I’m producing them here for my own benefit as well as yours – as I’m bound to forget.

  1. Install “Proxoid” app from Marketplace.

  2. Turn on USB debugging mode on your phone:

    Settings – > Application -> Development -> Enable USB Debugging

  3. On your Ubuntu machine create a 90-android.rules file:

    gksudo gedit /etc/udev/rules.d/90-android.rules

  4. Add the following to it (note this is the difference from the linux magazine tutorial):


    SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct} =="0c01", MODE="0666", OWNER="*insertyourusername"
    SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct} =="0c02", MODE="0666", OWNER="*insertyourusername"
    SUBSYSTEMS=="usb", ATTRS{idVendor}=="22b8", ATTRS{idProduct} =="41db", MODE="0666", OWNER="*insertyourusername"

    * insert your username as appropriate!

  5. Download and unpack the latest release of the Android SDK: http://developer.android.com/sdk/

  6. Connect the phone to the Ubuntu machine with your USB cable and start Proxoid on the phone.

  7. Open a Terminal, navigate to the tools directory in the Android SDK folder and run the following command:
    ./adb forward tcp:8080 tcp:8080

The proxy server should now be running, but to be able to use it with Firefox, you have to modify the browser’s proxy settings:

  1. In Firefox, choose Edit -> Preferences and switch to the Advanced -> Network section.

  2. Press the Settings button in the Configure how Firefox connects to the Internet group.

  3. Select the Manual proxy configuration option, then enter localhost in the HTTP Proxy field and 8080 in the Port field. Press OK to save the settings and close the window.

Now you can browse the Web using the created connection.

Given that I’ll need to remember how to do this, when I don’t have a connection. Here’s a handy PDF with the above guide to tethering android to put on your android device!!

{ 3 comments }

Neomail and mbox -> maildir

by Keiron on October 9, 2007

As far as webmail goes, I’m a Neomail user, have been for a long while. I don’t know what it is about it – it’s clean interface and quick loading speed maybe? But the time has come for change as cPanel are deprecating the mbox format, why I hear you ask?

Reasons for Deprecating mbox
The new system has several benefits,
- It’s the way forward
- Better performance
- Improved mailbox locking;
- Simultaneous IMAP account access
- Use of open source code.

Is it Necessary?
It is expected that cPanel will continue to support mbox, but will switch to maildir as the default soon. As such I feel I’m probably going to have to take the plunge.

We changed it on one server just recently, a necessary upgrade as part of a fix for another issue – I had no choice and had to do it with no warning to users of that server, I held my breath – no onslaught came. One user asked why neomail no longer worked, when I explained they simply agreed it sounded a better solution and would start to use Horde!

I’m including the remainder of this post, as a reminder to myself of a few things and notes I’ve found around the web. I had one server upgraded last week and the only issue with it was the one user who had mail set to remain on the server for 7 days – all of their old email had to be downloaded again.

Any Known Problems?
There’s always going to be problems in an upgrade of this magnitude in my opinion, the biggest reason for this probably being the millions of different configurations of cPanel servers out there. Generally a fix all for almost everyone seems to be to run the following scripts.

    /scripts/courierup –force
/scripts/eximup –force
(This has solved problems on all but one machine)

One of the notes I also picked up on in the cPanel forums was Outlook Error 0x8004DF0B, this is caused by the default courier imap config:

    /usr/lib/courier-imap/etc/imapd

This is because the maximum number of connections from a single IP that courier allows by default is 4. Take a look at the file above and change the line:
MAXPERIP=4
to:
MAXPERIP=20

During the conversion all mail (POP) will be blocked until the process ends.

HOWTO Perform the Conversion
I’ve read about one server admin team doing the following:

1.) /scripts/convert2maildir
A.) #1 Backup all mail folders on this server
B.) #3 Start maildir conversion process
2.) /scripts/courierup –force
3.) /scripts/eximup –force
4.) /scripts/upcp –force
5.) /scripts/convert2maildir
A.) #3 to convert partially converted mail accounts

Common Complaints

  • Missing Neomail Address Books
    In most cases these can be found in:
        /home/<user>/.neomail/user/addressbook

    /scripts/neomail2hordeaddrbook
    Call it with a user as its argument and it does only that user’s addresses, call it with no argument it doeal all users serverwide

    The mail should also be in Horde or SquirrelMail (the user may need to subscribe to the folders again).

  • Root Boxes
    Users used to be able to login at http://mydomain.com/webmail with user mydom and password xyzzy. They’d then see the mailboxes for mydom@mydomain.com, as well as a subfolder for the mailbox and folders for their other email addresses such as joe@mydomain.com and sales@mydomain.com.

    This will no longer work straightaway – it was NOT a feature, it was a secuity hole and it’s gone now. Although it appears that Horde have officially added it as a feature in later builds of cPanel 11 (Simply log into Horde as the main account and in the drop-down box in the upper-right corner of the screen you’ll see many things, including email addresses of email accounts on the server you can check by simply selecting them from the drop-down).

{ 0 comments }

MyTop broken!

by Keiron on July 5, 2007

In a post way back in January of 2005, I discussed the software MyTop for monitoring connections on your MySQL server. I’ve had it installed and use it semi-regularly – however, it doesn’t always work – often I am greeted with the following error:

Cannot connect to MySQL server. Please check the:

* database you specified “test” (default is “test”)
* username you specified “root” (default is “root”)
* password you specified “” (default is “”)
* hostname you specified “localhost” (default is “localhost”)
* port you specified “3306″ (default is 3306)
* socket you specified “” (default is “”)

The options my be specified on the command-line or in a ~/.mytop
config file. See the manual (perldoc mytop) for details.

Here’s the exact error from DBI. It might help you debug:

Unknown database ‘test’

A pain in the butt, as I get it quite regularly and normally get one of the techs to tinker with it… Here’s the fix!

Simply enter the following command:

echo “db=mysql” > ~/.mytop

{ 0 comments }

Exim Restarting – PRM

by Keiron on March 2, 2007

Paragonhost has a very useful post on setting up custom PRM rules (Process Resource Monitor).

I think this maybe the cause of so much load on one of my servers recently, as the exim process is getting killed early and not being allowed to finish a queue run – resulting in a backlog of mail on the queue and an ever decreasing circle (not good!).

I’ve made a tweak and will see how it goes!

{ 0 comments }

Restarting Apache/httpd

by Keiron on March 2, 2007

Did a little bit of Apache reading after a client query yesterday, it seems restarting httpd is not all that it seems!

start – start httpd
startssl – start httpd with SSL enabled
stop – stop httpd
restart – restart httpd if running by sending a SIGHUP or start if
not running
fullstatus – dump a full status screen; requires lynx and mod_status enabled
status – dump a short status screen; requires lynx and mod_status enabled
graceful – do a graceful restart by sending a SIGUSR1 or start if not running

Is the normal course of events from apachectl, but what about if we want to restart with SSL?

A route around this as sugeested by someone is to remove all the stuff in the apache config file, or altertively edit the HTTPD definitiona tthe top of apachectl so that it ALWAYS passes -DSSL), then use normal start/restart/graceful

Now we’re on the subject of graceful, I have found out that it mean no existing or pendings connections are lost during the restart!

Apache: The Definitive Guide Setting Up LAMP: Getting Linux, Apache, MySQL, and PHP Working Together (Transcend Technique)

{ 1 comment }

Are magic quotes on?

by Keiron on February 28, 2007

One way to check if magic_quotes is running is to run get_magic_quotes_gpc(). It will return a 1 if it is on, or a 0 if it is off. You can use this result to print out the magic_quotes status, or to decided if you should run another function, such as addslashes.

< ?php
if (get_magic_quotes_gpc()==1)
{
Print “Magic Quotes gpc is turned on” ;
}
else
{
Print “Magic Quotes gpc is turned off” ;
}
?>

{ 0 comments }

Changing Linux User Passwords

by Keiron on February 28, 2007

I had reason to go looking for this today, having not done it in a long, long time (thanks to the delightful cPanel interface).

To change a password on behalf of a user, first sign on or “su” to the “root” account. Then type, “passwd user” (where user is the username for the password you are changing). The system will prompt you to enter a password. Passwords do not echo to the screen when you enter them.

You can also change your own password, by typing “passwd” (without specifying a username). You will be prompted to enter your old password for verification, and then a new password.

{ 0 comments }

The Slug! in Newcastle