Showing posts with label admin. Show all posts
Showing posts with label admin. Show all posts

Monday, December 29, 2008

Line Control

Man, ever since working with Open SuSE, I always wanted a solution that could allow remote clients to let a (non SuSE) Linux Gateway dis/connect from/to the internet. Thankfully I found a solution for Ubuntu that works just as well.

I don't know how many people who have a Linux Gateway have a need for something like this but I wondered if I would able to find something like this.
Let me first explain what I am blabbering on about.

I have multiple home PCs and each want internet access. Unfortunately my internet device is a USB one so I can't buy a router and use that, so I needed a PC that was dedicated to be on the internet when I want it. I didn't want the internet to be online 24/7 for security reasons and also connection stability reasons (sometimes the connection quality drops and so a quick disconnect & reconnect sometimes solves this problem).

OpenSuSE had a SMPPPd solution where you have KInternet clients (where KInternet is so far only a SuSE app) that connects to a SuSE Gateway which is running SMPPPd that handles the internet connection. Once a client has connected to that Gateway, s/he can control the internet connection and see what the traffic looks like in KB/s. The problem with this solution is... It's only for SuSE! So I needed something similar for Ubuntu.

The solution I found was by accident as one can see in this forum thread: Visual Real-time traffic monitor
I was looking for a realtime traffic monitor and hoped to just write my own app that can deal with the connections but thanks be to God (I have prayed for something like this, where I asked God to help me get this Gateway back up), I stumbled on an client app called QLineControl which is a Qt based app for Windows and Linux that acts as a client for Line Control. You can download the Windows version and you can get an "unstable" version from apt-get by adding the repository listed on that website.
From there I was led to LineControl (the server is called LineSrv) which is the Linux service which actually controls the internet connection. LineSrv (so far) is listed as an official Ubuntu package which you can get from apt-get.

It took a while to figure out what to do but thankfully I managed to get it to work.
The config file generated by the apt-get for LineSrv is faulty so you have to override with the default config file and go from there.
Here is what I did:

I copied the /usr/share/doc/linesrv/linesrv.conf to /etc/linesrv/.
Then I created 2 scripts for dialing up and disconnecting:

Dialup script
#!/bin/sh
ifup ib0 2> /dev/null > /dev/null


Hangup script
#!/bin/sh
ifdown ib0 2> /dev/null > /dev/null


I placed them in the /etc/ppp path.
The ib0 is my iBurst (internet device) interface, I have to do it like this otherwise it won't work, I am using the Debain dialer. Also LineSrv has to be root for this to work. Fortunately the init script that is setup via apt-get does that automatically.
I know the script looks funny but this is the script format that was followed in the sample scripts found in the LineSrv source files.

Then I modified the /etc/linesrv/linesrv.conf file:


  • I set user_accounting to no since I don't want ppl to authenticate when dialing up

  • I set currency to ZAR (Since I am from South Africa ;-) )

  • I uncommented the 'line T-Online' line, you can call it anything you want after the 'line' part

  • I uncommented the script_up, script_dn and interface and pointed them to the appropriate dialup, hangup scripts and the interface points to ppp0

  • I uncommented 'con_type' and set it to 'netdev'

  • I uncommented 'send_throughput' and set it to 'yes' since QLineControl client want this to know at what speed the internet traffic is heading

And then I ran the LineSrv service and there you go. I connected with QLineControl just fine without any hassles.

And now I am writing this post from this very configuration within Linux. I am quite surprised that such a solution even exists as I really thought that I would have to write my own app.

Well, there you go!
Cheers and God Bless!

Sunday, January 06, 2008

APT-GET for SuSE

We all know of Ubuntu-based distros to have apt-get for easy installation but what about SuSE?

I recently discovered that OpenSuSE actually has apt-get ability, not just RPM packages.
You can install this with YAST or follow this web page: Installing apt4suse

I installed a few things with it today and it seems to be working the same way Ubuntu's apt-get is working.

This makes SuSE 'lekker' to work with.

Wednesday, January 02, 2008

Hard Drive imaging

Formatting again maybe? Don't be so hard on yourself any longer. Start imaging!

What is that? It is to duplicate every bit on your hard-drive/partition in an image file for backup purposes. Why? Let me give you an example and maybe you'll discover what I mean:
Usually you format your hard drive, reinstall Windows and/or Linux with their software and settings the way you like it. All fine until something goes wrong and you have to go through it again! It can really take a very long time!
Now imagine just formatting once more, installing everything, backup your PC's hard drive (HD) with an image and later if something goes wrong, you just reload that image on your HD and there you go. Everything back to the way you wanted it. Saves you a lot of time and frustration!

How can one do that? Here is a tutorial containing a link to a downloadable boot CD to get you started: http://www.howtoforge.org/back_up_restore_harddrives_partitions_with_ghost4linux

Ghost4Linux (G4L) makes this imaging process possible. When you want to begin, make sure you have an extra hard drive or a local FTP Server on a different machine than the one you are imaging. The FTP server has to be on your network otherwise you are going to wait like forever! :(
Just because it contains the word 'Linux' doesn't mean that you have to have a Linux distro on your machine or anything, all it means is that it uses a compact Linux version to run its Ghost application to backup your HD.

It is really simple to use and make sure when compressing, you use something like GZip and not the other compress options, they compress more but take longer (Bz2 take MUCH, MUCH longer and doesn't necessarily make the image size MUCH smaller than GZip). It is important though that you do compress your image. I imaged my 160GB hard drive to my local FTP server and ended up taking 4 GB of space (because of the compression).

Now don't think that you'll get the same results, though! I had to do a very good Low Level Format (LLF or filling my HD with 0's). This makes the compression more effective! If you start to image your HD after using it for years, you definitely won't have the same result as I had. Even if you delete files, the data remains on the HD, it is just marked/removed from the File Table of the File System. So when you image your HD, even if you are just using 20% of it, your image file size will be close to your HD's capacity. So do a LLF first. It takes long to do that however (like Seagate's Disk Wizard took 6 hours to fill my 160GB SATA drive with 0's [because it writes 0's on a part of the HD multiple times to make sure the data isn't recoverable]), other software just writes a 0 once and it ends up taking a fraction of the time.
If your HD or FTP server has a lot of space, then it probably won't matter to you.

I remember having to image multiple machines at university 2 years ago. It sure saved a lot of time doing that because UDP has this broadcasting capability. The server just sends 1 packet and the network medium duplicates that packed and sends them to all PCs. We used something that came with DELL PCs which helped do the job well. We could redo like 30 PCs in 30 minutes. Imagine having to format, reinstall Windows and all its applications on each PC at a time, on top of that, you have to carry them all, set them up, configure them for the network, get them on the Active Directory Domain, etc.

I always wanted to be able to image my PC and I am glad that I came across that tutorial to do that. Let me know how you found it.

UPDATE (2008-05-01):
Today I re-imaged my PC because Windows was getting slow (don't we all know) and a bit buggy I reckon. However, after the 30-min re-image session I am back to my backed-up state and my PC a whirling again! Now it takes me about 2 hours to get my PC back the way it was again instead of the whole freekin day! Yay to Imaging! Yay to G4L!

Thursday, November 02, 2006

Installing Linux from Windows

Who would have ever thought! Installing Linux from Windows! Yeah I stumbled across this article and found it pretty interresting to mention here for those who are interrested.
You can either read the long document or load instlux to install Linux from Windows. The author did mention that it would be a very good idea to backup everything!
I myself haven't tried this but if I am in the mood and I have some time available, I think I'll give it a go! Unless some of you would or have. In that case please tell me how it is. Is it easier, better, ... ?

Article: http://marc.herbert.free.fr/linux/win2linstall.html
Instlux: http://sourceforge.net/projects/instlux

Well see yah everyone!

Saturday, May 20, 2006

I'm so relieved!

Man I am so thankful to the Lord who have helped me...
I had a huge struggle of setting up my home gateway on a Linux Server.
Through many tries and scouting the web I finally got to a place where someone was able to help me. I was so happy when I finally saw my internet work when I browsed a page that I was shouting it out to my family in joy.

You check the following site if you are interrested : http://mybroadband.co.za/vb/showthread.php?t=43939

Thursday, May 18, 2006

My Linux questions answered (part 1)

Hi.
I have a couple of links here that I have made at Linux Questions.org's forums which I hope you might find useful.
SAMBA Sample
Problem setting up iBurst USB-terminal on SuSE Remote connection to KInternet
Kernel module with multiple source files compilation problem
Compiling a Kernel Module for User Mode Linux
A program to rip audio to a RAW file (Linux Programming)

Yes these are all Linux type questions, so if you have problem with stuff like that, then I hope this would be useful to you.

EDIT: I've updated the title to a more associative one.