Google Plus

Script to speed up mobile internet connexion in Linux

Written by M. Zinoune on . Posted in Linux tutorials

For people who use an USB stick or mobile phone to surf the internet on the go, it’s often reported that the connection is sloppy or unresponsive. Wireless features pings linux-logoover 200 ms as it is, however, it’s not that what causes this ‘lag’.

For example, if you open an audio stream from the internet and then decide to browse some pages, you’ll notice that your connection behaves in a much more responsive manner.

One way to fix this issue is having a ‘ping’ command running in the background which probes a host (eg. Google.com) continuously. This keeps the connection ‘active’ as it always sends a few packets of data.

We’re going to be creating a script that will keep the connexion active.

To begin, get your favorite text editor and open up a random file in your system. I’m going to choose /opt/stayonline.sh for this tutorial.

$ sudo nano /opt/stayonline.sh

Copy/ past the following onto the file.

 

# /bin/bash 
while [1] do
/bin/ping -c 3 -s 1 google.com
sleep 30
done

Save it and close. We now need to make this file executeable. Just run the following.

$ sudo chmod +x /opt/stayonline.sh

All we need to do now is set it up in such a way where it gets called every time a network connection is established.

Open up your /etc/ppp/ip-up file for editing. Add ‘/opt/stayonline.sh’ at the very end of it (Be careful not to remove anything from the file). Here’s a screenshot if you’re confused -

That’s it. Now each time your connection is active, it’ll maintain a constant ping command with a remote host and hopefully, make your online experience more fluid and responsive.

Learn about high speed business DSL options that may be available.

Usefull links: lffl.org

For questions please refer to our Q/A forum at : http://ask.unixmen.com

  • http://n/a thomixcy

    Shouldn’t that be more like:

    /bin/ping -c 3 -s 1 google.com

    in the script?

  • solord

    In the lines :

    "/Bin/bash"
    and
    "/Bin/ping -c 3 -s 1 google.com"

    The ‘B’ in ‘/Bin’ should be in lowercase.

  • ExITSec

    Right, so what what does this do to the battery life?

  • http://elkom08.x10.bz Zaf

    gud tips :)
    thanks

  • http://newbietricks.blogspot.com newbie-tricks

    nice tips dude, may I place your tips in my blog? the credit is for you of course, and if you don’t mind I will be happy to put your website link in my blog. My best regards

    • Zinovsky

      Yes, it is possible :)

      • http://dualplatform.blogspot.com newbie-tricks

        thank you very much, awesome blog ^_^

  • ahmad

    hi, I’m Ahmad from Indonesia
    I’ve tried this tutorial
    but at the last step I’m confused, precisely in order "[u]Add ‘/opt/stayonline.sh’ at the very end of it[/u]"
    when i press enter it says "[u]E486: Pattern not found: opt[/u]"
    please help me
    Thank you very much

  • ahmad

    hi, I’m Ahmad from Indonesia
    I’ve tried this tutorial
    but at the last step I’m confused, precisely in order "[u]Add ‘/opt/stayonline.sh’ at the very end of it[/u]"
    when i press enter it says "[u]E486: Pattern not found: opt[/u]"
    please help me
    Thank you very much

  • ahmad

    hi, I’m Ahmad from Indonesia
    I’ve tried this tutorial
    but at the last step I’m confused, precisely in order "[u]Add ‘/opt/stayonline.sh’ at the very end of it[/u]"
    when i press enter it says "[u]E486: Pattern not found: opt[/u]"
    please help me
    Thank you very much

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

Etescartz

|

Hi! I stumbled on this article and I really want to try elgg on a ubuntu server, but I’m at a standstill . I’m a newbie when it comes to linux and I tried installing the packages mentioned in the article, but the must be different in the Ubuntu repositories.. Any help would be greatly appreciated.

SK

|

Did you add the IP range(Not ip address) in your cacti.conf file? If yes, check your apache log files. You may find the errors. Good luck.

David

|

Hi SK,
thanks for your post :)
I did all the steps one by one but I got error 500, also I disable the selinux,and iptabels
In addition I cannot success to get the cacti in localhost.
Any idea?
Thanks

Richard

|

I have been searching for a solution to that problem too but with videos. I can’t see anyway to make VLC do this. And nobody can tell me how.
However, I did find a media player called Movist that does it. I will never understand why VLC, the best in my opinion, does not design this feature into their player.

cave

|

it can be used to talk or chat through the internet,

it is using strong encryption.

but for example TOR is using some obfuscation because some countrys try to block all outgoing connections which can not be scanned with DPI

And the TOR Project is facing an arms race in obfuscation and encryption detection.

 
IDG Tech Network
Copyright © 2008-2013 Unixmen.com .
Maintained by Anblik .