How to speed up dpkg on Ubuntu

10/03/2010

I found this wonderful little tutorial at Ubuntuforums.org. Some members have reported significant speed increase for dpkg -i. Thanks to forum member Peter Cordes who wrote it up. Please send all kudos to him, he’s the one who deserves it. Brickbats too.

dpkg -i and dpkg -S are slow when the FS cache is cold. Most of the time is spent reading ~2400 .list files from /var/lib/dpkg/info. It reads them in the order they’re listed in the status file, I suppose. Anyway, _not_ in alphabetical (info/*) or readdir (ls -f info) order.

Most filesystems allocate space in the same area of the disk for a set of files all written at the same time. So cp -a info info.new would generate a defragged copy of the directory. (not that any individual files in it were fragmented, they’re tiny, many smaller than the FS block size. ls -lhrS *.list | less, and type 50% for example, to see the median file size (~600B), or 90% to see the 90th percentile size (7kB).

But this doesn’t actually help, because the disk ends up having to seek back and forth because the files aren’t read in the same order they’re stored on disk. It doesn’t help much that the files are closer together. Maybe 18sec vs. 24sec, IIRC.

Here’s what I did:

cd
strace -efile -o dpkg.tr dpkg -S /bin/ls
cd /var/lib/dpkg
mkdir info.new
grep ‘^open’ ~/dpkg.tr | sed -r ‘/dpkg\/info/sX.*”(.*)”.*X\1Xp’ -n | xargs sudo cp -a -t info.new
# cmd line length limits prevent info/*. I could have used rsync -au info/ info.new
sudo cp -iau info/[a-k]* info.new/
sudo cp -iau info/[l]* info.new/
sudo cp -iau info/[m-z]* info.new/
diff -ur info info.new/
sudo rm -rf info
sudo mv info.new info

sync
echo 3 | sudo tee /proc/sys/vm/drop_caches
time dpkg -S /bin/ls

Result:

peter@tesla:~$ time dpkg -S /bin/ls
coreutils: /bin/ls

real 0m2.877s
user 0m0.264s
sys 0m0.168s

peter@tesla:~$ ll -d /var/lib/dpkg/info
drwxr-xr-x 2 root root 76K 2008-12-07 06:36 /var/lib/dpkg/info

Now dpkg -S (and presumably dpkg -i, too) takes
2.8s elapsed time. (Root FS = 1.5GB JFS, on a degraded RAID1 (md), at the beginning of a WD5000YS (RE2) supporting NCQ with depth 31, AMD64 Linux 2.6.28-2-generic (Intrepid user-space, Jaunty kernel), Core 2 Duo E6600 (2.4GHz), 4GB DDR2-800. But mainly it’s the HD and the FS that matter here)

I wonder how long this performance will last, as packages are upgraded. At least it doesn’t matter if readdir order changes as files are removed and added (since the file’s reading order doesn’t depend on that), but it does matter if the status file’s order changes. Since the files won’t reposition on disk, it’s only fast as long as they’re read in (mostly) the order they were written.

The directory itself can start to fragment, since it’s 76k = many filesystem blocks. XFS gets directory fragmentation fairly easily. (I use XFS for everything else, and it’s fast with a couple tweaks. e.g. -o logbsize=256k, and enabling lazy-count=1 with xfs_admin or at mkfs time.)

_gos=’c4.gostats.com’;_goa=354450;
_got=2;_goi=2;_goz=0;_gol=’Free hit counter’;_GoStatsRun();
Free hit counter
Free hit counter


Mobile Broadband on Linux

11/10/2009

Note: There’s more info on this subject here. So take a look if this post doesn’t do it for you.

Be aware that all my experience of this subject is based on Ubuntu. If you use another Linux distro, YMMV. If you’re using Windows or OSX… you’ll probably be better off looking elsewhere.

Some time ago I bought a new phone – Sony Ericsson K800i. It’s a 3G phone, so I was pretty stoked: at last I’d be able to get a decent connection speed when linking my PC to the internet through this baby. And I was right: I get between 40 and 100 Kps (320-800 Kbps). Maybe those of you with wired broadband connections think this is dead slow. It probably is, to you. But to someone who’s previously had to depend on a sluggish GPRS connection, my new phone is like amphetamine on crack.

And it is so much easier to connect via this phone than it was through my previous handsets. All I need to do with my K800i is:

1. Press Menu > Settings > Connectivity > USB > USB Internet;

2. Select USB Internet On;

3. Connect phone to PC with USB datacable (the K800i also has bluetooth and infrared, but my computer is not equipped for such things);

4. Select Phone Mode;

and that’s it! The Ubuntu network manager detects the phone and automagically sets up the connection. Sweet or what! (Remember, this is with the Sony Ericsson K800i. Other phones will be different.

Unfortunately, it isn’t always like that. I don’t know if it’s just my phone or what, but connection is very unreliable. It cuts out erratically, and I haven’t found a fix yet. So on bad days I find I have to use wvdial to connect. I’ve described this in detail before – I’m not going to go into it again. Click here to go to the wvdial tutorial.

Thing is, mobile phone service providers have got something against their customers using their cellphones this way. It’s called “tethering”, and it is generally banned in the Terms and Conditions they make you agree to when you get your phone. And some providers actively block tethering. My provider obviously doesn’t block it. But that might change any day.

Why do they dislike tethering? Because they want you to buy a Mobile Broadband USB modem, and pay an inflated rate for mobile internet connection. Rip-off merchants!

Because I wanted another way to connect to the internet other than my phone, I bought one of these USB modems – a Vodafone K3565, aka the Huawei E160X. To connect via this device, Vodafone (UK) charge me £15 per GB of data transferred. This is shockingly expensive compared to what I pay for connection through my cellphone (£2.50 for 5 days’ “unlimited” browsing). But it is a better connection much of the time, when I get Vodafone’s HSDPA signal. Transfer speeds over HSDPA can get as highh as 160 Kps (1280 Kbps). But if I’m in an area with no HSDPA or 3G signal, I get snail’s rate GPRS. Which hurts when you’re paying the con men so much.

It’s also extremely easy to connect an Ubuntu PC to the internet via a Huawei dongle. Similar to the phone: plug it in, wait a short while, and the network manager detects the device and connects. The first time you connect the dongle to the computer, network manager throws up a mobile broadband wizard, which asks you a few questions about your service provider etc. And that’s it. Well, usually that’s it. Sometimes you have to manually edit the settings before it’ll work. But that will depend on whose service you’re using.

Also, I understand that although Huawei devices play nice with Ubuntu, some other manufacturers’ models don’t. If that’s the case for you, wvdial is probably the answer. Again, click here to find out how to use wvdial.

There’s another solution, if you’re having problems: an app called Vodafone Mobile Connect. Don’t let the word “Vodafone” in the name put you off – it actually works with devices on any provider’s networks. I used it for a while very successfully. I can’t give you any real advice about it, as it’s in constant “beta” development. But the only reason I stopped using it was the fact that Ubuntu’s network manager does the job just fine. It’s certainly worth checking out if you’re having problems. There are binaries available for many Linux distros.

Well, I think that’s about it. So, let me just wish you the best of luck in connecting to the internet with your device. And I’ll bid you farewell!

_gos=’c4.gostats.com’;_goa=354450;
_got=2;_goi=2;_goz=0;_gol=’Free hit counter’;_GoStatsRun();
Free hit counter
Free hit counter


How to download & save streaming video from the internet, using Linux

30/03/2009

IMPORTANT: I HAVE UPDATED DOWNLOADING INFO. CHECK THIS LINK. BUT THIS POST IS STILL USEFUL.

The information in this post will help you download and save video files that are hosted on sites like Youtube, Supernovatube, Youku, Megavideo, and linked to by sites like SurfTheChannel.com, free-tv-video-online.info and watch-movies-links.net. It is a good idea to read the entire post before using any of these methods, as host sites have changed from time to time, and so have the methods you can use to download the streaming video files.

Seen the latest cool video on Youtube?  Want to save it on your hard drive so you can watch it again at your leisure or share it with your internetless friends?  Well, it’s simple – if you use Linux.  Everything I explain in this post was done on a computer running Ubuntu 8.10, but I think it will work with any distro.

Okay, let’s start with Youtube videos.  First, watch the video.  Then, before you navigate away from that web page, go and look in your system’s /tmp directory.  You should find a flash video file, named something like Flashbt0cVD.  That’s the file you want.  So move it to your home directory (or wherever you keep your videos) and rename it something more descriptive.

This trick will also work with the movie and TV videos  files streaming over the internet via sites like www.surfthechannel.com, www.free-tv-video-online.info, tv-video.net and www.watch-movies-links.net.

There is a problem.  One or two of the video links sites (like tv-video.net) delete temporary files when they have finished playing.  This means you can’t move the file out of /tmp after you’ve watched it.  The solution is to link the temporary file to one in your home directory before the temporary file is deleted.  So you start to play the video, then go look in the /tmp directory. You’ll find a randomly-named video file there.  You need to link it to your home directory.  Do this by running this command in terminal:

ln /tmp/Flashuh4G6s ~/video.flv

Now you have got the video file in your /home.  You have to make sure that the name you give to the new linked file does not already exist in the directory.  So in the example above, you would first check that there is no file called video.flv in your home directory.

But there’s another problem.  If you watch a video via the links sites that is hosted at Youku, the video will be delivered as a series of small files (12-13 MB each).  But this isn’t a serious problem.  When they’ve downloaded you can put the randomly-named files into the correct viewing order by checking the properties of the files, looking at the time when the files were created.

If you have any queries, feel free to leave Comments.

UPDATE: If you are a Windoze user and you want to learn how to save streamed media, you should check out this site. There you’ll find info on how to capture and save video from lots of websites, plus audio files from last.fm and other internet radio stations. I only use Linux, so I can’t verify the accuracy of the info. But it looks good.

UPDATE 2:
Here’s info about a couple more tools for downloading video from the web. One for grabbing BBC TV (and radio) content, and one for those Youtube videos we all know and love.

For some time now, users of any operating system have been able to watch BBC TV shows streamed over the internet by BBC iPlayer. But if you wanted to download programmes, you used Windows or you were shit out of luck.

Now, Linux users can download BBC content via the new iPlayer Desktop application. But I don’t like it. The content is crawling with DRM. And the player doesn’t work properly on my EEE PC. It might work okay on a better-specified computer. But iPlayer Desktop is compatible with just Intrepid and Jaunty and my desktop machine runs Hardy (I’m talking Ubuntu here – the app works on other distros too). Anyway, I don’t like the app so I’m not supplying a link to it. It’s my blog so blah! If you really want to try it for yourself, check out the “Labs” link on the iPlayer web page.

Anyway, if you want to download BBC TV and radio shows and you use Linux, there is an easy solution – get_iplayer.
This is how it works: Steve Jobs was desperate to sell his crappy iPhones in the UK. So he turned on his diabolical charm and convinced the BBC to offer iPlayer downloads to iPhones. This happened many moons ago, when only Windows OSes could download the content. But some dastardly fellow created a program that pretended to be an iPhone. Oh, and get this: the DRM that infects all the content downloaded from iPlayer is absent from the .mov files sent to iPhones and consequently computers running get_iplayer. It’s a command-line utility, which might put some people off. But as far as I’m concerned there isn’t much wrong with command-line utilities in Linux. So check it out!

The other video download solution I want to present here is the excellent pwnyoutube.com. The way this site works is simple. When you search for or go to watch a video on Youtube, you get an URL something like:
http://www.youtube.com/watch?v=ufzqypO2k_A
To download this video, you type that URL into your browser’s address bar, then add the letters “pwn” like this:
http://www.pwnyoutube.com/watch?v=ufzqypO2k_A
Go to that URL and you will find download links for the video in question. You can download the file in .flv flash format, and most are also available in mp4.

If you have an unreliable internet connection, you can marry pwnyoutube with wget to great effect. Let’s say you want a video of The Clash playing London Calling live. A search of Youtube may turn up this video URL:
http://www.youtube.com/watch?v=Idwibw0-lb4
So, you run the edited URL in your browser:
http://www.pwnyoutube.com/watch?v=Idwibw0-lb4
This brings you to a web page offering 2 download links. You want the “high quality” mp4 version. But your network connection is lousy. If you set the browser to download this file, chances are the connection will drop before the download completes. But this is no problem. Just right-click on the download link and select “Copy Link Location”. Now open a terminal and paste the download url into the following command:
wget -c http://deturl.com/save-video.mp4?http%3A%2F%2Fv18.lscache5.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cburst%252Cfactor%26itag%3D18%26ipbits%3D0%26signature%3D7ABACC132F8C18AAF6A0649B1669DB89EDFF0B83.AB3039808ECB20B7124585313CB75A55C2C7E4A1%26sver%3D3%26expire%3D1250665200%26key%3Dyt1%26factor%3D1.25%26burst%3D40%26id%3D21dc226f0d3e95be
Wget will download the file, and the -c flag means that if the connection is broken, you can run the same command when the link is resumed and wget will start the download where it left off.

Hope this helps.

UPDATE OF THE UPDATE: OMG they have ruined PWNYoutube!!! 😦

Back when I first wrote the review of PWNYoutube, it was simple, and great in its simplicity: you found the video’s URL, you added “pwn” to the URL, browsed to that URL… and you were given a couple of download links. I liked to right-click the link, copy it, then paste it into a wget command in the terminal. Brilliant, right?

But now, you do all that adding “pwn” to the URL stuff… but when you go to that URL, instead of getting a couple of simple download links, you are confronted with a bunch of complicated ridiculousness. “Use one of: SaveVid | YouDDL | ClipNabber | KeepVid…” etc etc etc. No simple download link. No simple wget. Just a bunch of downloading utilities/services/whatevers that I know nothing about, and which I want to know nothing about. Ruined, man. Ruuuiiinneddd!!!

I cast my weary eye over the options, and finally decided to try the bookmarklet. Dunno why, I guess maybe it sounded simple, or maybe unthreatening in its diminuitiveness. I successfully downloaded an mp4 (high quality) image file by using the bookmarklet – what you do is browse to a webpage that includes a Youtube video (it doesn’t have to be a web page actually on Youtube.com – many bloggers and webmasters have Youtube videos embedded in their own sites) and click on the bookmarklet. The resulting mp4 file played well in vlc, so I’ve got no issues in that regard. But changing the PWNYoutube interface so you no longer get a simple download link – that’s just bad. Shame on you, PWNYoutube!.

PWNYoutube – new interface. Boo!!

So, what’s the new PWNYoutube like? Well the bookmarklet works; I don’t know about the other utilities, if I get round to trying them I will post my verdict here. And I really should make an effort to try it all out. That’s what this blog post is all about, after all. But I’m so pissed off with PWNYoutube at the moment, I just don’t feel like doing it. If PWNYoutube can’t be bothered to provide me with a simple download link that works with wget, maybe I can’t be bothered to give them publicity. Fancy shmancy download utilities just don’t do it for me. I like wget. But PWNYoutube don’t like wget. Which makes it feel like PWNYoutube don’t like me.

YET ANOTHER UPDATE:

Here’s a couple more things relating to online video. First of all, some of the sites I have mentioned previously have become pretty crappy.  Surfthechannel.com is terrible nowadays.  All it seems to offer are links to buy videos from Amazon or watch videos streamed from Megavideo – and if you don’t sign up to become a member of Megavideo, you can’t watch anything longer than about 56 minutes.

But it’s not all bad news.  It has become easier to download videos from tv-video.net, and these downloaded files are in mp4 format and much better quality than the streamed flash videos.  To download these files, you need to use Firefox, and the Firefox add-on Video DownloadHelper.  When you’ve installed Firefox and the add-on, go to tv-video.net and navigate the site to watch the video you want.  When you click on “Play”, you’ll see the DownloadHelper icon change colour and start moving.  Click on the icon and you’ll get a drop-down menu with a number of options.  Choose to download the file.  Once the download has started, close the tab which contains the playing video: the download speed will increase considerably, and you won’t need the crappy flash version.

That’s all for now; but I’ll update this post as and when new video downloading methods come to light.

6 JUNE 2012: ANOTHER BLOODY UPDATE – but its not really a bad update:

The stuff I told you about at the start of this post, about grabbing video files out of the tmp directory, does not appear to work anymore.  Grr!  BUT:  If  you are using Firefox and have the DownloadHelper add-on, go to Project Free TV and select the TV show/movie you wanna save.  Start watching it; when it’s started properly, the DownloadHelper icon will become all colourful and rotating.  Click on that, and select Copy URL.  Now, go to a terminal and type in something like wget -c -O movie.flv then, before hitting Enter, right-click and select Paste.  That will paste in the actual URL of the movie you want.  Hit Enter, and wget will start downloading the movie.flv file (or whatever name you chose) to your Home directory. Note: in that wget command, the -O is a capital letter O, not a zero.  This seems to work with all the sites Project Free TV link with.  Dunno how long the trick will last, so get going while the going’s good!  Oh yeah, one you’ve got wget downloading the file, close the Firefox tab that’s playing the movie.  Otherwise the download will take much longer.  Good luck!!

bmc-purple


ha ha bonk!!

26/08/2008

Linux tutorial #56: sudo

To help you get your head round the command “sudo”, there’s an excellent example of its usage below:

The cartoon is from the webcomic xkcd.com.  For your homework assignment go check it out!  The cartoon on the front page today (26 Aug) is funny too.  If you don’t get it, google “2 girls 1 cup”… or is it “1 cup 2 girls”?  Whatever, once you’ve seen it you’ll wish you hadn’t!


Some Common Linux Commands

16/07/2008

Linux has a well-developed graphical user interface – in fact it has several GUIs, the most popular of which are Gnome (on which Ubuntu is based) and KDE (Kubuntu‘s desktop).  But Linux also has a powerful command-line interface – also known as the console or terminal – and a great many commands to use in the CLI.

Here’s a little “cheat sheet” of common, basic Linux commands – just to get you started – you’d be wise to study this subject further if you’re serious about administering a Linux box.

Moving around in the file system
Command Action
pwd “Print working directory” – show what dir you’re in.
ls List the contents of a dir.
ls -l List the contents of a dir and show additional info of the files.
ls -a List all files, including hidden files.
cd Change directory.
cd .. Go to the parent directory.
Examining files
Command Action
file Determine the type of a file.
cat Concatenate a file.
less View text files and paginate them if needed.
Manipulating files and directories
Command Action
cp Copy a file.
cp -i Copy a file and ask before overwriting.
cp -r Copy a directory with its contents.
mv Move or rename a file.
mv -i Move or rename a file and ask before overwriting.
rm Remove a file.
rm -r Remove a directory with its contents.
rm -i Ask before removing a file. Good to use with the -r option.
mkdir Make a directory.
rmdir Remove an empty directory.

Linux Tutorial: How to use a cellphone as a modem

15/02/2008

avatar666.pngavatar666.pngavatar666.pngavatar666.png

Note: There is more up-to-date info on this subject, especially concerning mobile broadband HSDPA modems and 3G cellphones, to be found here. But the info on this page is still relevant. In particular, this page covers the program wvdial, which can be used if your network manager doesn’t detect your HSDPA modem.

I learnt how to connect to the internet through my cellphone because it was the only way I could get online from my home – at the time I was living in a flat where I wasn’t permitted to have a regular phoneline installed. And I still sometimes find it useful: if I’m out and about with my laptop, and I can’t find a wifi “hotspot” to use, I can generally get a GSM signal – in the UK it’s possible to get a signal in just about every urban area, and in a lot of rural areas too – and a GSM signal means you can connect to the internet via GPRS.

Some mobile service plans charge for internet access on a per MB of transferred data basis. This can turn out very expensive, as there is a lot of data transferred during an internet session. Especially if you download a 3 GB movie DVD!! However, many mobile plans charge a set fee for unlimited net access. My mobile provider, Orange, charge me £1 for one day’s unlimited access or £5 for a week’s access. And I believe in the USA it’s much cheaper.

So how do you use a mobile phone as a modem? With Windows, I haven’t got a clue. But with Linux, you establish a PPP connection with the mobile service provider’s servers, by using a dialler like wvdial. Wvdial comes included with a default installation of Ubuntu (my particular distro) and probably other Linux flavours too.

Connect your phone to the computer. I do this with a USB datacable that came with the phone, but some people use Bluetooth. The phone should be ON. My phone is a Sony Ericsson – when it’s linked to the computer, I have to choose between File Transfer and Phone Mode. To use the phone as a modem, I have to select Phone Mode. However, I sometimes use a Nokia phone, and there’s no mode-choosing necessary with that model.

Open a terminal and get yourself root status. Then type in the command

wvdialconf

This will cause wvdial to scan the computer for modems. You’ll get output something like this:

root@x-box:~# wvdialconf

Scanning your serial ports for a modem.

ttyS0<*1>: ATQ0 V1 E1 — failed with 2400 baud, next try: 9600 baud
ttyS0<*1>: ATQ0 V1 E1 — failed with 9600 baud, next try: 115200 baud
ttyS0<*1>: ATQ0 V1 E1 — and failed too at 115200, giving up.
Modem Port Scan<*1>: S1 S2 S3
WvModem<*1>: Cannot get information for serial port.
ttyACM0<*1>: ATQ0 V1 E1 — OK
ttyACM0<*1>: ATQ0 V1 E1 Z — OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 — OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 — OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 — OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK
ttyACM0<*1>: Modem Identifier: ATI — Sony Ericsson W300
ttyACM0<*1>: Speed 4800: AT — OK
ttyACM0<*1>: Speed 9600: AT — OK
ttyACM0<*1>: Speed 19200: AT — OK
ttyACM0<*1>: Speed 38400: AT — OK
ttyACM0<*1>: Speed 57600: AT — OK
ttyACM0<*1>: Speed 115200: AT — OK
ttyACM0<*1>: Speed 230400: AT — OK
ttyACM0<*1>: Speed 460800: AT — OK
ttyACM0<*1>: Max speed is 460800; that should be safe.
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK

Found an USB modem on /dev/ttyACM0.
/etc/wvdial.conf<Warn>: Can’t open ‘/etc/wvdial.conf’ for reading: No such file or directory
/etc/wvdial.conf<Warn>: …starting with blank configuration.
Modem configuration written to /etc/wvdial.conf.
ttyACM0<Info>: Speed 460800; init “ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0”
ttyACM1<Info>: Speed 460800; init “ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0”
root@x-box:~#

[Note: I’ve edited the output, to cut down on its length.]

Wvdial found my cellphone (“Modem Identifier: ATI — Sony Ericsson W300”), and reports that the phone is on port ttyACM0.

Then wvdial created a configuration file (/etc/wvdial.conf) and put some config info about the phone in it.

Edit /etc/wvdial.conf with your mobile service provider’s information. When I ran wvdialconf, the program created a wvdial.conf file as below:

root@x-box:~# cat /etc/wvdial.conf

[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
; Phone = <Target Phone Number>
ISDN = 0
; Username = <Your Login Name>
Init1 = ATZ
; Password = <Your Password>
Modem = /dev/ttyACM0
Baud = 460800

The program filled in some fields, but some have been left for you to do: specifically, the info needed to log in to your mobile service provider’s web servers. I edited the file to look like this:

[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
Phone = *99#
ISDN = 0
Username = A
Init1 = ATZ
Password = B
Modem = /dev/ttyACM0
Baud = 460800
Stupid Mode = Yes

The number in the Phone field is the number that the phone needs to call to access my mobile provider’s GPRS service. Your mobile network may use a different number – you’ll have to ask them.

My mobile network does not require usernames and passwords to access the web servers. But wvdial doesn’t like empty fields. So I put “A” and “B” in them.

I added the last line: Stupid Mode = Yes, otherwise wvdial will simply cycle when run without ever connecting.

*IMPORTANT* All the output recreated above is from a system that did not have any other modems connected. Most laptops have a modem or network card built-in, which wvdialconf will detect. But you’ll be able to see what information relates to your phone, and edit your wvdial.conf file accordingly.

So, now you can connect to the internet. To do this, open that terminal and, as root, type in the command

wvdial

You’ll get output like this:

root@x-box:~# wvdial
WvDial<*1>: WvDial: Internet dialer version 1.56
WvModem<*1>: Cannot get information for serial port.
WvDial<*1>: Initializing modem.
WvDial<*1>: Sending: ATZ
WvDial Modem<*1>: ATZ
WvDial Modem<*1>: OK
WvDial<*1>: Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
WvDial Modem<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
WvDial Modem<*1>: OK
WvDial<*1>: Modem initialized.
WvDial<*1>: Sending: ATDT*99#
WvDial<*1>: Waiting for carrier.
WvDial Modem<*1>: ATDT*99#
WvDial Modem<*1>: CONNECT
WvDial Modem<*1>: ~[7f]}#@!}!}!} }8}#}$@#}(}”}’}”}”}&} } } } }%}&}$AUSgn~
WvDial<*1>: Carrier detected. Starting PPP immediately.
WvDial<Notice>: Starting pppd at Wed Jan 16 15:45:03 2008
WvDial<Notice>: Pid of pppd: 10689
WvDial<*1>: Using interface ppp0
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: local IP address 172.23.108.122
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: remote IP address 194.33.25.101
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: primary DNS address 193.36.81.37
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: secondary DNS address 193.36.81.38
WvDial<*1>: pppd: ��[06][08]��[06][08]

The program will appear to “hang” – the above text will just freeze on the monitor. But wvdial is actually holding the connection open until you terminate the link by hitting Ctrl-C.

Now you can use the connection by, for example, starting up your web browser; or open another terminal and run telnet or ssh, or do whois or ping commands. All these activities will run a lot slower than you’re used to – but they will run.

When you’re finished, hit Ctrl-C and wvdial will end with a closing message like this:

Caught signal 2: Attempting to exit gracefully…
WvDial<*1>: Terminating on signal 15
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: Connect time 0.8 minutes.
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: pppd: ��[06][08]��[06][08]
WvDial<*1>: Disconnecting at Wed Jan 16 15:45:50 2008
root@x-box:~#

Data connections via GPRS over GSM are very slow – mine often average about 5 K/sec. But 3G/UMTS is much faster. Nowhere near the performance over a landline, of course, but 3G will probably be the best bet. However, be warned: some mobile providers don’t like their customers to link to the internet this way, and I’ve been told that 3, a UK company, actively prevent it. Their customers can pay extra to get a GPRS modem, but linking a normal cellphone on a standard plan is not permitted. Tmobile also don’t like their customers to use their phones as modems. So beware! Or, better yet, use a network that doesn’t have such stupid rules!!

_gos=’c4.gostats.com’;_goa=354450;
_got=2;_goi=2;_goz=0;_gol=’Free hit counter’;_GoStatsRun();
Free hit counter
Free hit counter


%d bloggers like this: