install the cvs client from http://www.wincvs.org/ its smaller than
the one from cygwin.
then do the following
http://qtwin.sourceforge.net/qt3-win32/compile-net.php
Requirements
* Windows 2000 or XP
* a cvs client (for example from http://www.cvsnt.org), when using the kde cvs server
* Visual Studio .NET or .NET 2003
Get the Q... sources
* by downloading a Q... source snapshot from the KDE-Cygwin snapshot area
* or from the cvs repository
first connect to the cvs server
c:\source> cvs -d :pserver:anonymous@qtwin.cvs.sourceforge.net:/cvsroot/qtwin login
enter empty password
then checkout the sources with
c:\source> cvs -z3 -d :pserver:anonymous@qtwin.cvs.sourceforge.net:/cvsroot/qtwin co -r QT_WIN32_3_3_BRANCH qt-3
Compiling Qt with command line tools
* Open a cmd shell
* Setup your compiler environment (please adjust the path to your needs)
c:\source> "c:\Programme\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat"
* Setup Q.. environment
c:\source> set QTDIR=< qt3 source root>
c:\source> set PATH=%QTDIR%\bin;%PATH%
c:\source> set QMAKESPEC=win32-msvc.net
* Configure and build the source
The script first creates link_includes.exe and configure.exe which are needed for bootstrap the build process. link_includes copies all relevant Qt-headers into the include-directory. configure.exe is the replacement for the ./configure-script unter Unix/Linux. After that, qmake.exe is build and the compilation gets started.
c:\source> cd < qt3 source root >
c:\source\qt-3> configure.bat [-fast] [-verbose]
configure knows some of the parameters of the x11 release configure script like -fast or -verbose.
For a full list see bin\configure.exe -help.
This should build the whole Qt release. If it breaks you can restart compiling with
c:\source\qt-3> nmake [< target >]
for a list of all available targets see the toplevel Makefile
* Start Q.. applications
c:\source\qt-3> designer
c:\source\qt-3> assistant
c:\source\qt-3> linguist
c:\source\qt-3> cd tutorial\t1
c:\source\qt-3\tutorial\t1> t1
Wednesday, November 22, 2006
Monday, November 20, 2006
timegettime and unix gettimeofday
here is what i used to replace windows timegettime
from advance progamming in the unix environment page 173
the gettimeofday function provides greater resolution (up to
a microsecond) than the time function.
#include
int gettimeofday(struct timevale *restrcited tp, void *restrict tzp);
here is my one off.
Uint32 ticks;
struct timeval now;
gettimeofday(&now, NULL);
ticks=(now.tv_sec-start.tv_sec)*1000+(now.tv_usec-start.tv_usec)/1000;
return(ticks);
i also found some helpfull information by looking at SDL library
look at the source file src/timer/unix/SDL_systimer.c
#ifdef HAVE_CLOCK_GETTIME
static struct timespec start;
#else
static struct timeval start;
#error "i do have it"
#endif /* HAVE_CLOCK_GETTIME */
void SDL_StartTicks(void)
{
/* Set first ticks value */
#if HAVE_CLOCK_GETTIME
clock_gettime(CLOCK_MONOTONIC,&start);
error "clock_gettime"
#else
gettimeofday(&start, NULL);
#error "gettimeofday"
#endif
}
Uint32 SDL_GetTicks (void)
{
#if HAVE_CLOCK_GETTIME
Uint32 ticks;
struct timespec now;
clock_gettime(CLOCK_MONOTONIC,&now);
ticks=(now.tv_sec-start.tv_sec)*1000+(now.tv_nsec-start.tv_nsec)/1000000;
return(ticks);
#else
Uint32 ticks;
struct timeval now;
gettimeofday(&now, NULL);
ticks=(now.tv_sec-start.tv_sec)*1000+(now.tv_usec-start.tv_usec)/1000;
return(ticks);
#endif
}
from advance progamming in the unix environment page 173
the gettimeofday function provides greater resolution (up to
a microsecond) than the time function.
#include
int gettimeofday(struct timevale *restrcited tp, void *restrict tzp);
here is my one off.
Uint32 ticks;
struct timeval now;
gettimeofday(&now, NULL);
ticks=(now.tv_sec-start.tv_sec)*1000+(now.tv_usec-start.tv_usec)/1000;
return(ticks);
i also found some helpfull information by looking at SDL library
look at the source file src/timer/unix/SDL_systimer.c
#ifdef HAVE_CLOCK_GETTIME
static struct timespec start;
#else
static struct timeval start;
#error "i do have it"
#endif /* HAVE_CLOCK_GETTIME */
void SDL_StartTicks(void)
{
/* Set first ticks value */
#if HAVE_CLOCK_GETTIME
clock_gettime(CLOCK_MONOTONIC,&start);
error "clock_gettime"
#else
gettimeofday(&start, NULL);
#error "gettimeofday"
#endif
}
Uint32 SDL_GetTicks (void)
{
#if HAVE_CLOCK_GETTIME
Uint32 ticks;
struct timespec now;
clock_gettime(CLOCK_MONOTONIC,&now);
ticks=(now.tv_sec-start.tv_sec)*1000+(now.tv_nsec-start.tv_nsec)/1000000;
return(ticks);
#else
Uint32 ticks;
struct timeval now;
gettimeofday(&now, NULL);
ticks=(now.tv_sec-start.tv_sec)*1000+(now.tv_usec-start.tv_usec)/1000;
return(ticks);
#endif
}
Sunday, November 19, 2006
interesting but not useful
the following came from http://home.earthlink.net/~huston2/dp/AdapterDemosCpp
but its limited can only work on a void function.
// Purpose. Adapter design pattern (External Polymorphism demo)
// 1. Specify the new desired interface
// 2. Design a "wrapper" class that can "impedance match" the old to the new
// 3. The client uses (is coupled to) the new interface
// 4. The adapter/wrapper "maps" to the legacy implementation
#include
class ExecuteInterface { public: // 1. Specify the new i/f
virtual ~ExecuteInterface() { }
virtual void execute() = 0;
};
template // 2. Design a "wrapper" or
class ExecuteAdapter : public ExecuteInterface { // "adapter" class
public:
ExecuteAdapter( TYPE* o, void (TYPE::*m)() ) { object = o; method =m; }
~ExecuteAdapter() { delete object; }
// 4. The adapter/wrapper "maps" the new to the legacy implementation
void execute() /* the new */ { (object->*method)(); }
private:
TYPE* object; // ptr-to-object attribute
void (TYPE::*method)(); /* the old */ // ptr-to-member-function
}; // attribute
// The old: three totally incompatible classes // no common base class,
class Fea { public: // no hope of polymorphism
~Fea() { cout << "Fea::dtor" << endl; }
void doThis() { cout << "Fea::doThis()" << endl; }
};
class Feye { public:
~Feye() { cout << "Feye::dtor" << endl; }
void doThat() { cout << "Feye::doThat()" << endl; }
};
class Pheau { public:
~Pheau() { cout << "Pheau::dtor" << endl; }
void doTheOther() { cout << "Pheau::doTheOther()" << endl; }
};
/* the new is returned */ ExecuteInterface** initialize() {
ExecuteInterface** array = new ExecuteInterface*[3]; /* the old is below */
array[0] = new ExecuteAdapter( new Fea(), &Fea::doThis );
array[1] = new ExecuteAdapter( new Feye(), &Feye::doThat );
array[2] = new ExecuteAdapter( new Pheau(), &Pheau::doTheOther );
return array;
}
void main( void ) {
ExecuteInterface** objects = initialize();
for (int i=0; i < 3; i++) objects[i]->execute(); // 3. Client uses the new
// (polymporphism)
for (i=0; i < 3; i++) delete objects[i];
delete objects;
}
// Fea::doThis()
// Feye::doThat()
// Pheau::doTheOther()
// Fea::dtor
// Feye::dtor
// Pheau::dtor
but its limited can only work on a void function.
// Purpose. Adapter design pattern (External Polymorphism demo)
// 1. Specify the new desired interface
// 2. Design a "wrapper" class that can "impedance match" the old to the new
// 3. The client uses (is coupled to) the new interface
// 4. The adapter/wrapper "maps" to the legacy implementation
#include
class ExecuteInterface { public: // 1. Specify the new i/f
virtual ~ExecuteInterface() { }
virtual void execute() = 0;
};
template
class ExecuteAdapter : public ExecuteInterface { // "adapter" class
public:
ExecuteAdapter( TYPE* o, void (TYPE::*m)() ) { object = o; method =m; }
~ExecuteAdapter() { delete object; }
// 4. The adapter/wrapper "maps" the new to the legacy implementation
void execute() /* the new */ { (object->*method)(); }
private:
TYPE* object; // ptr-to-object attribute
void (TYPE::*method)(); /* the old */ // ptr-to-member-function
}; // attribute
// The old: three totally incompatible classes // no common base class,
class Fea { public: // no hope of polymorphism
~Fea() { cout << "Fea::dtor" << endl; }
void doThis() { cout << "Fea::doThis()" << endl; }
};
class Feye { public:
~Feye() { cout << "Feye::dtor" << endl; }
void doThat() { cout << "Feye::doThat()" << endl; }
};
class Pheau { public:
~Pheau() { cout << "Pheau::dtor" << endl; }
void doTheOther() { cout << "Pheau::doTheOther()" << endl; }
};
/* the new is returned */ ExecuteInterface** initialize() {
ExecuteInterface** array = new ExecuteInterface*[3]; /* the old is below */
array[0] = new ExecuteAdapter
array[1] = new ExecuteAdapter
array[2] = new ExecuteAdapter
return array;
}
void main( void ) {
ExecuteInterface** objects = initialize();
for (int i=0; i < 3; i++) objects[i]->execute(); // 3. Client uses the new
// (polymporphism)
for (i=0; i < 3; i++) delete objects[i];
delete objects;
}
// Fea::doThis()
// Feye::doThat()
// Pheau::doTheOther()
// Fea::dtor
// Feye::dtor
// Pheau::dtor
Friday, November 17, 2006
java on debian
the following came from: http://www.crazysquirrel.com/computing/debian/java.jspx
Quick Guide
If you are fairly confident and don't want to read the whole document the following summary should probably be enought to get java working on your system. Lines 1 and 3 are preformed as root line 2 as a standard user.
apt-get install java-package
fakeroot make-jpkg.bin
dpkg -i.deb
Step 1 - Get the SunJVM
You could go with other JVM's like Blackdown or Kaffe if you want. I am not saying they aren't worth looking at but if you are serious about developing with Java you basically have no choice but to go with the Sun JVM. They provide it for free (as long as you sign you life away) so you might as well use the best.
You can get the latest Sun JVM from here http://java.sun.com/
Step 2 - Install the Required Builder Package
Installing Java on Debian is not the simplest thing in the world but fortunatly there is a package that will do most of the work for you (assuming it works). That heaven sent package is java-pacakge which can be installed with:
apt-get -u install java-package
Make sure that your repository is fully upto date before installing this package or you might run into problems installing the latest JVM. You also need fakeroot if you don't have it.
Step 3 - Create the .deb Package File
You have to perform this step as a non-root user so I suggest using your own account. Create a temporary directory and copy the java .bin installer file into it. then run the command:
fakeroot make-jpkg jdk-1_5_0-linux-i586.bin
changing the name of the java .bin package if you need to. You may see a few warnings while the package is being created (and it takes some time to actually create it - about 2 minutes). If you see a message at the end saying the package was created then the warnings are not a problem. The message will probably look something like this:
The Debian package has been created in the current
directory. You can install the package as root (e.g.
dpkg -i sun-j2sdk1.5_1.5.0+update00_i386.deb).
Step 4 - Install the Java .deb Package
You need to be root to perform this step so swtich now. Then execute the following command:
dpkg -i sun-j2sdk1.5_1.5.0+update00_i386.deb
Of course you need to specify the correct package name if yours doesn't match mine. You can find out what the package name is from looking at the success message.
Step 5 - Check it Works
This should be the simplest step. Just execute the command:
java -version
as both root and another user to make sure everything is installed correctly. You should see output not a million miles different to that shown below.
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
Quick Guide
If you are fairly confident and don't want to read the whole document the following summary should probably be enought to get java working on your system. Lines 1 and 3 are preformed as root line 2 as a standard user.
apt-get install java-package
fakeroot make-jpkg
dpkg -i
Step 1 - Get the SunJVM
You could go with other JVM's like Blackdown or Kaffe if you want. I am not saying they aren't worth looking at but if you are serious about developing with Java you basically have no choice but to go with the Sun JVM. They provide it for free (as long as you sign you life away) so you might as well use the best.
You can get the latest Sun JVM from here http://java.sun.com/
Step 2 - Install the Required Builder Package
Installing Java on Debian is not the simplest thing in the world but fortunatly there is a package that will do most of the work for you (assuming it works). That heaven sent package is java-pacakge which can be installed with:
apt-get -u install java-package
Make sure that your repository is fully upto date before installing this package or you might run into problems installing the latest JVM. You also need fakeroot if you don't have it.
Step 3 - Create the .deb Package File
You have to perform this step as a non-root user so I suggest using your own account. Create a temporary directory and copy the java .bin installer file into it. then run the command:
fakeroot make-jpkg jdk-1_5_0-linux-i586.bin
changing the name of the java .bin package if you need to. You may see a few warnings while the package is being created (and it takes some time to actually create it - about 2 minutes). If you see a message at the end saying the package was created then the warnings are not a problem. The message will probably look something like this:
The Debian package has been created in the current
directory. You can install the package as root (e.g.
dpkg -i sun-j2sdk1.5_1.5.0+update00_i386.deb).
Step 4 - Install the Java .deb Package
You need to be root to perform this step so swtich now. Then execute the following command:
dpkg -i sun-j2sdk1.5_1.5.0+update00_i386.deb
Of course you need to specify the correct package name if yours doesn't match mine. You can find out what the package name is from looking at the success message.
Step 5 - Check it Works
This should be the simplest step. Just execute the command:
java -version
as both root and another user to make sure everything is installed correctly. You should see output not a million miles different to that shown below.
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
Tuesday, November 14, 2006
subversion.
/etc/rcS.d
lrwxrwxrwx 1 root root 20 2006-11-14 12:58 S80svnserve -> /etc/init.d/svnserve
chown all files in the repos to svnserve user
then chmod-ed the db files read/write
configured the file
[general]
### These options control access to the repository for unauthenticated
### and authenticated users. Valid values are "write", "read",
### and "none". The sample settings below are the defaults.
anon-access = write
auth-access = write
lrwxrwxrwx 1 root root 20 2006-11-14 12:58 S80svnserve -> /etc/init.d/svnserve
chown all files in the repos to svnserve user
then chmod-ed the db files read/write
configured the file
[general]
### These options control access to the repository for unauthenticated
### and authenticated users. Valid values are "write", "read",
### and "none". The sample settings below are the defaults.
anon-access = write
auth-access = write
Monday, November 13, 2006
state machine fun!
BeginStateMachine
OnMsg(MSG_PrintError)
setState(STATE_Down);
State(STATE_Initialize)
OnEnter
if (paper_count <= 10)
setState(STATE_PaperLow);
else if (paper_count <= 0)
setState(STATE_PaperOut);
else
setState(STATE_Ready);
State(STATE_Ready)
OnEnter
// let device know
OnMsg(MSG_Print)
// print
setState(STATE_Print);
State(STATE_Print)
OnEnter
// let device know
// start printing
OnUpdate
// loop till printing is done
// maybe communicate with device to get progress
if (printing is done)
{
// decrement paper count
if (paper_count <= 10)
setState(STATE_PaperLow);
else if (paper_count <= 0)
setState(STATE_PaperOut);
}
OnExit
// do clean up for/with device
State(STATE_PaperLow)
OnEnter
// let device know
OnMsg(MSG_Print)
// print
setState(STATE_Print);
State(STATE_PaperOut)
OnEnter
// let device know
OnMsg(MSG_Print)
// return error message
setState(STATE_Down);
State(STATE_Down)
OnEnter
// let device know
OnMsg(MSG_Print)
// return error message
EndStateMachine
OnMsg(MSG_PrintError)
setState(STATE_Down);
State(STATE_Initialize)
OnEnter
if (paper_count <= 10)
setState(STATE_PaperLow);
else if (paper_count <= 0)
setState(STATE_PaperOut);
else
setState(STATE_Ready);
State(STATE_Ready)
OnEnter
// let device know
OnMsg(MSG_Print)
setState(STATE_Print);
State(STATE_Print)
OnEnter
// let device know
// start printing
OnUpdate
// loop till printing is done
// maybe communicate with device to get progress
if (printing is done)
{
// decrement paper count
if (paper_count <= 10)
setState(STATE_PaperLow);
else if (paper_count <= 0)
setState(STATE_PaperOut);
}
OnExit
// do clean up for/with device
State(STATE_PaperLow)
OnEnter
// let device know
OnMsg(MSG_Print)
setState(STATE_Print);
State(STATE_PaperOut)
OnEnter
// let device know
OnMsg(MSG_Print)
// return error message
setState(STATE_Down);
State(STATE_Down)
OnEnter
// let device know
OnMsg(MSG_Print)
// return error message
EndStateMachine
Thursday, November 09, 2006
ndiswrapper
ndiswrapper on Debian Sarge without having to compile anything
Written by MikeZila - 2005-06-13 20:40
Originally, I was trying to get the ndiswrapper source to compile with the stock Debian Sarge kernel. This didn't work because the kernel headers were absent. Even after installing them, compile failed with obscure errors. Getting the source didn't help either. Still no dice. I read around places and found that the kernel that comes with Debian Sarge has problems with ndiswrapper under certain situations. I made the safe assumption that I somehow had one of these "situations", and set out to get a new kernel.
You need a new kernel, but not to fear. The almighty apt-get has you covered from start to finish.
From this point on are instructions on how to get a new kernel and then get ndiswrapper playing ball with it. If you're unwilling to update your kernel, you can stop reading now. Please note that this kernel upgrade is very easy. There is no compile process and the whole deal takes about fifteen minutes; it isn't the usual kernel compile rigmarole. Also, it's totally safe to do the following. When the new kernel is installed, it makes an additional entry in your boot loader, it doesn't replace your current one. You're not stuck if it doesn't work.
Before we start, you should know that this guide assumes you're using a 686 CPU. Something like a P4, a P4 based Celeron, Pentium3, a PentiumPro, or similar. AMD Athlon people should be okay as well. Those with 64bit processors can try, but I have no idea if it will work. If your using a 586 or older, just replace every 686 in this guide with a 386. Everything will still work the same.
Ready? Let's do it.
First, you need to grab a new kernel. One is compiled and waiting for you in the apt repository. Do...
apt-get install kernel-image-2.6.8-2-686
It will download the deb containing the kernel and work it's magic. Before you know it a new kernel will be all setup and your boot loader will be configured with a new entry to boot it. Cool, huh? Your previous kernel and boot loader entry are preserved so you can boot it anytime you like.
Reboot and choose your new kernel at the bootmenu.
Now we'll grab the wireless-tools package. This will let us setup our card once it's working. You guessed it, apt-get has us covered.
apt-get install wireless-tools
The wireless tools will be downloaded and installed. You can check that they are by typing "iwconfig" and seeing if it gives you any output. It won't tell us anything good now, but it'll come in very handy later. Now we need to grab the ndiswrapper itself. Do...
apt-get install ndiswrapper-modules-2.6.8-2-686
If it suggests you install additional packages (it should suggest ndiswrapper-utils), type "Y" and hit enter to agree. It will download and install the packages. When it's done, try...
ndiswrapper -l
You should get a notice saying that no drivers are installed. This is normal, as we haven't yet given it the WindowsXP drivers to wrap. If you get a command not found error, then the ndiswrapper-utils package either wasn't suggested during the ndiswrapper-module install, or it failed for some reason. If it wasn't suggested (it was suggested to me), you can just get it yourself with...
apt-get install ndiswrapper-utils
Now try the "ndiswrapper -l" again. You should get the no drivers notice.
Now it's time to fix that no drivers notice. Get a hold of the WindowsXP drivers for your card. Don't use drivers included on the CD that came with your card, they won't work 99% of the time, and sometimes they cause kernel panics or other nasty things. Best to play it safe and grab the drivers known to work with your card. Go to the official ndiswrapper card list located here. Once you've got them, extract the driver files someplace (it doesn't matter where) and do the following in that directory. You'll need to run a...
ndiswrapper -i DRIVER.inf
..for a each .inf file required by your card. Usually you only need one. Your card's entry in the ndiswrapper card listing will tell you if you need more than one. I happen to need three. Once you have all the .inf files you need installed, you should do a...
ndiswrapper -l
...and check the output to make sure you see something like:
Installed ndis drivers:
lsbcmnds driver present
lsipnds driver present, hardware present
wmp11nds driver present
Your drivers will be have different names, and you may have more or less drivers installed. The important thing is that one of them says "hardware present". If you see a "hardware not present" you probably have bad drivers. If you see "cant see hardware", then you don't have wireless-tools. You should have downloaded them earlier in this guide, but if for some reason you didn't, just...
apt-get install wireless-tools
...and try "ndiswrapper -l" again. If all is well, move on.
It's time to load the module. Well, sorta. Remember installing the ndiswrapper-module package? It didn't actually install a module, but it did give us an ndiswrapper.ko, and that will work just as well.
You'll do this the old-school way...
insmod lib/modules/`uname -r`/misc/ndiswrapper.ko
The " ` " marks around "uname -r" aren't the " ' " next to your enter key, they're next to the " 1 " key, at the top left.
Doing this command probably won't give you any output, but it will give you the functionality of the ndiswrapper module. Now try...
iwconfig
You should now have an entry called "wlan0", and a bunch of information about it. If you see something like this...
wlan0 IEEE 802.11b ESSID:off/any
Mode:Managed Frequency:2.437 GHz Access Point: 00:40:05:C5:4E:03
Bit Rate:11 Mb/s Tx-Power:17 dBm
RTS thr:2347 B Fragment thr:2346 B
Encryption key:off
Power Management:off
Link Quality:100/100 Signal level:-69 dBm Noise level:-256 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:54 Invalid misc:512 Missed beacon:0
...then you're good to go. You may have additional entires without wireless extensions in the output, but this is normal.
Congratulations! Your card is up and running in Linux! Now to get it configured so you can be on your way. It's is simple enough.
At this point I recommend you turn off the ethernet connection. It can cause problems with the wlan0 interface if it's running when you try to configure the wireless card. Do...
ifdown eth0
If you've been using an ethernet connection to download the packages we've been installing, it will be lost. If for any reason you want it back, just...
ifup eth0
dhclient eth0
...and you'll be back to normal.
We'll get your new wireless running post haste. First we should make sure your AP (your wireless router or access point) is configured to have open access. Turn off WEP/WAP in your router or AP's configuration for the time being. Now let's set your SSID on the wireless card. It's simple. Do...
iwconfig wlan0 essid yourssidgoeshere
That will set the ssid. You won't get any feedback, but this is normal. Now run "iwconfig" again and check the ESSID in the top right of the block of information about your wireless card. It should no longer say "off/any", but the SSID you configured it to use. If it doesn't, try the command a few more times. Move your computer a little, do whatever you would normally do to get better signal. If "off/any" changed to your ssid, then you're good to go.
You don't have to bring up the wlan0 interface, but you do need to get an IP. Do...
dhclient wlan0
A bunch of stuff will go by, and at the end you'll either have errors, a long wait, or an IP on your network. If you get errors, then obviously something is wrong. Check the error and your system logs and hunt down the wrench in the works. If you get a long wait, your card is probably not talking to the router like it should, look in your logs and see if you can find out what's holding things up, it could just be that you aren't getting good signal. If you get no errors, and things finish in a reasonable time, you should be done. Open up a web browser and see if you can get to Google. If it works, then you're cooking with lasers, and everything is kosher. Congratulations!
If you want to make bringing up your wireless easy (this guide doesn't configure the ndiswrapper in a way that can be auto-loaded via normal means) dump the following in a text file and name it "loadwireless.sh". (really you can name it anything you want, just keep the .sh at the end) Make sure to put your ssid in place of "yourssidgoeshere"
#!/bin/sh
ifdown eth0
insmod /lib/modules/`uname -r`/misc/ndiswrapper.ko
sleep 2
iwconfig wlan0 essid yourssidgoeshere
sleep 2
iwconfig
chmod it executable and run it as root to bring your wireless up. If after several entries of "iwconfig" you still don't get your SSID set, try entering the config command again manually. Your card may not have started up in time to catch the command in the script. Just enter...
iwconfig wlan0 essid yourssidgoeshere
I'm sure there's a way to get this to be run automatically, but I'm done with my major accomplishments for the day. I'm cool just running this as root once the system is up and running. You don't have to be exclusively logged in as root for it to work, a root console in a normal user session will do fine.
That's all, folks. Post problems if you have them and I'll try to help you out. I'll do my very best, but keep in mind that I'm not a genius at this, I just happened to discover a correct way via experimentation and research. Like I said, ask and I'll try to help. I'm a nice guy, so don't be afraid to ask, no matter how small or large the question.
Thanks for reading my guide!
previous
up
Ndiswrapper in Fedora Core 5
Bookmark this post with:
delicious | digg | reddit | furl | google | yahoo
61 comments | Discuss Article | printer-friendly version
By martinj on Thu, 2005-06-16 11:58
This crashes my PC. I am running IPW2100
I do apt-get install ndiswrapper-modules-2.6.8-2-386
apt-get install ndiswrapper-utils
ndiswrapper -i w70n51.inf
ndiswrapper -l and it says the hardware is found
I do
apt-get install wireless-tools
ok
I do cd // and
insmod lib/modules/`uname -r`/misc/ndiswrapper.ko
and then it crashes
reply
Written by MikeZila - 2005-06-13 20:40
Originally, I was trying to get the ndiswrapper source to compile with the stock Debian Sarge kernel. This didn't work because the kernel headers were absent. Even after installing them, compile failed with obscure errors. Getting the source didn't help either. Still no dice. I read around places and found that the kernel that comes with Debian Sarge has problems with ndiswrapper under certain situations. I made the safe assumption that I somehow had one of these "situations", and set out to get a new kernel.
You need a new kernel, but not to fear. The almighty apt-get has you covered from start to finish.
From this point on are instructions on how to get a new kernel and then get ndiswrapper playing ball with it. If you're unwilling to update your kernel, you can stop reading now. Please note that this kernel upgrade is very easy. There is no compile process and the whole deal takes about fifteen minutes; it isn't the usual kernel compile rigmarole. Also, it's totally safe to do the following. When the new kernel is installed, it makes an additional entry in your boot loader, it doesn't replace your current one. You're not stuck if it doesn't work.
Before we start, you should know that this guide assumes you're using a 686 CPU. Something like a P4, a P4 based Celeron, Pentium3, a PentiumPro, or similar. AMD Athlon people should be okay as well. Those with 64bit processors can try, but I have no idea if it will work. If your using a 586 or older, just replace every 686 in this guide with a 386. Everything will still work the same.
Ready? Let's do it.
First, you need to grab a new kernel. One is compiled and waiting for you in the apt repository. Do...
apt-get install kernel-image-2.6.8-2-686
It will download the deb containing the kernel and work it's magic. Before you know it a new kernel will be all setup and your boot loader will be configured with a new entry to boot it. Cool, huh? Your previous kernel and boot loader entry are preserved so you can boot it anytime you like.
Reboot and choose your new kernel at the bootmenu.
Now we'll grab the wireless-tools package. This will let us setup our card once it's working. You guessed it, apt-get has us covered.
apt-get install wireless-tools
The wireless tools will be downloaded and installed. You can check that they are by typing "iwconfig" and seeing if it gives you any output. It won't tell us anything good now, but it'll come in very handy later. Now we need to grab the ndiswrapper itself. Do...
apt-get install ndiswrapper-modules-2.6.8-2-686
If it suggests you install additional packages (it should suggest ndiswrapper-utils), type "Y" and hit enter to agree. It will download and install the packages. When it's done, try...
ndiswrapper -l
You should get a notice saying that no drivers are installed. This is normal, as we haven't yet given it the WindowsXP drivers to wrap. If you get a command not found error, then the ndiswrapper-utils package either wasn't suggested during the ndiswrapper-module install, or it failed for some reason. If it wasn't suggested (it was suggested to me), you can just get it yourself with...
apt-get install ndiswrapper-utils
Now try the "ndiswrapper -l" again. You should get the no drivers notice.
Now it's time to fix that no drivers notice. Get a hold of the WindowsXP drivers for your card. Don't use drivers included on the CD that came with your card, they won't work 99% of the time, and sometimes they cause kernel panics or other nasty things. Best to play it safe and grab the drivers known to work with your card. Go to the official ndiswrapper card list located here. Once you've got them, extract the driver files someplace (it doesn't matter where) and do the following in that directory. You'll need to run a...
ndiswrapper -i DRIVER.inf
..for a each .inf file required by your card. Usually you only need one. Your card's entry in the ndiswrapper card listing will tell you if you need more than one. I happen to need three. Once you have all the .inf files you need installed, you should do a...
ndiswrapper -l
...and check the output to make sure you see something like:
Installed ndis drivers:
lsbcmnds driver present
lsipnds driver present, hardware present
wmp11nds driver present
Your drivers will be have different names, and you may have more or less drivers installed. The important thing is that one of them says "hardware present". If you see a "hardware not present" you probably have bad drivers. If you see "cant see hardware", then you don't have wireless-tools. You should have downloaded them earlier in this guide, but if for some reason you didn't, just...
apt-get install wireless-tools
...and try "ndiswrapper -l" again. If all is well, move on.
It's time to load the module. Well, sorta. Remember installing the ndiswrapper-module package? It didn't actually install a module, but it did give us an ndiswrapper.ko, and that will work just as well.
You'll do this the old-school way...
insmod lib/modules/`uname -r`/misc/ndiswrapper.ko
The " ` " marks around "uname -r" aren't the " ' " next to your enter key, they're next to the " 1 " key, at the top left.
Doing this command probably won't give you any output, but it will give you the functionality of the ndiswrapper module. Now try...
iwconfig
You should now have an entry called "wlan0", and a bunch of information about it. If you see something like this...
wlan0 IEEE 802.11b ESSID:off/any
Mode:Managed Frequency:2.437 GHz Access Point: 00:40:05:C5:4E:03
Bit Rate:11 Mb/s Tx-Power:17 dBm
RTS thr:2347 B Fragment thr:2346 B
Encryption key:off
Power Management:off
Link Quality:100/100 Signal level:-69 dBm Noise level:-256 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:54 Invalid misc:512 Missed beacon:0
...then you're good to go. You may have additional entires without wireless extensions in the output, but this is normal.
Congratulations! Your card is up and running in Linux! Now to get it configured so you can be on your way. It's is simple enough.
At this point I recommend you turn off the ethernet connection. It can cause problems with the wlan0 interface if it's running when you try to configure the wireless card. Do...
ifdown eth0
If you've been using an ethernet connection to download the packages we've been installing, it will be lost. If for any reason you want it back, just...
ifup eth0
dhclient eth0
...and you'll be back to normal.
We'll get your new wireless running post haste. First we should make sure your AP (your wireless router or access point) is configured to have open access. Turn off WEP/WAP in your router or AP's configuration for the time being. Now let's set your SSID on the wireless card. It's simple. Do...
iwconfig wlan0 essid yourssidgoeshere
That will set the ssid. You won't get any feedback, but this is normal. Now run "iwconfig" again and check the ESSID in the top right of the block of information about your wireless card. It should no longer say "off/any", but the SSID you configured it to use. If it doesn't, try the command a few more times. Move your computer a little, do whatever you would normally do to get better signal. If "off/any" changed to your ssid, then you're good to go.
You don't have to bring up the wlan0 interface, but you do need to get an IP. Do...
dhclient wlan0
A bunch of stuff will go by, and at the end you'll either have errors, a long wait, or an IP on your network. If you get errors, then obviously something is wrong. Check the error and your system logs and hunt down the wrench in the works. If you get a long wait, your card is probably not talking to the router like it should, look in your logs and see if you can find out what's holding things up, it could just be that you aren't getting good signal. If you get no errors, and things finish in a reasonable time, you should be done. Open up a web browser and see if you can get to Google. If it works, then you're cooking with lasers, and everything is kosher. Congratulations!
If you want to make bringing up your wireless easy (this guide doesn't configure the ndiswrapper in a way that can be auto-loaded via normal means) dump the following in a text file and name it "loadwireless.sh". (really you can name it anything you want, just keep the .sh at the end) Make sure to put your ssid in place of "yourssidgoeshere"
#!/bin/sh
ifdown eth0
insmod /lib/modules/`uname -r`/misc/ndiswrapper.ko
sleep 2
iwconfig wlan0 essid yourssidgoeshere
sleep 2
iwconfig
chmod it executable and run it as root to bring your wireless up. If after several entries of "iwconfig" you still don't get your SSID set, try entering the config command again manually. Your card may not have started up in time to catch the command in the script. Just enter...
iwconfig wlan0 essid yourssidgoeshere
I'm sure there's a way to get this to be run automatically, but I'm done with my major accomplishments for the day. I'm cool just running this as root once the system is up and running. You don't have to be exclusively logged in as root for it to work, a root console in a normal user session will do fine.
That's all, folks. Post problems if you have them and I'll try to help you out. I'll do my very best, but keep in mind that I'm not a genius at this, I just happened to discover a correct way via experimentation and research. Like I said, ask and I'll try to help. I'm a nice guy, so don't be afraid to ask, no matter how small or large the question.
Thanks for reading my guide!
previous
up
Ndiswrapper in Fedora Core 5
Bookmark this post with:
delicious | digg | reddit | furl | google | yahoo
61 comments | Discuss Article | printer-friendly version
By martinj on Thu, 2005-06-16 11:58
This crashes my PC. I am running IPW2100
I do apt-get install ndiswrapper-modules-2.6.8-2-386
apt-get install ndiswrapper-utils
ndiswrapper -i w70n51.inf
ndiswrapper -l and it says the hardware is found
I do
apt-get install wireless-tools
ok
I do cd // and
insmod lib/modules/`uname -r`/misc/ndiswrapper.ko
and then it crashes
reply
belkin card
Configuring Belkin F5D6020 (Version 3.0) 802.11b wireless PCMCIA card on MandrakeLinux 10.1
Submitted by akkumar on Thu, 12/16/2004 - 05:15. General Interest | How-to | Quick Tips & Newbies | Distributions
I had bought a Belkin Wireless PCMCIA Card – F5D6020 (Version 3.0) recently and wanted to configure the same in my favourite Linux distribution.
I downloaded and installed the MandrakeLinux 10.1 distribution released recently to the public (on December 6 2004 ). To get the latest version of MandrakeLinux visit the home page of MandrakeLinux, here. If you have a DVD writer, go for the DVD image. It would be much easier to maintain instead of playing around with the 3 CDs .
The installation was a breeze with MandrakeLinux 10.1 identifying my PCMCIA card attached to my laptop while installing the system. It did not load the right module corresponding to the PCMCIA card, though. So I had to find the right module to get that done. I did not get the Linux device driver from the manufacturer, but I did have the Windows driver.
Thanks to the ndiswrapper project at sourceforge, I was able to use the Windows device driver (already installed on my dual-boot system) for my Linux distribution too. I downloaded the latest source code of ndiswrapper from its sourceforge project page . The version that I had downloaded was 0.12 released on November 24 2004. The project documentation available at the site was pretty much clear to get things done.
1. Compiling ndiswrapper:
To compile ndiswrapper, you would need the source code of the kernel. By default, the kernel source was not installed. I installed the kernel source corresponding to the 2.6 tree (kernel-source-2.6.8.1-12mdk, to be exact) .
[akkumar@localhost tmp]$ pwd
/home/akkumar/tmp
[akkumar@localhost tmp]$ tar xzvf ndiswrapper-0.12.tar.gz
[akkumar@localhost tmp]$ cd ndiswrapper-0.12
[akkumar@localhost ndiswrapper-0.12]$ make install
This would compile the ndiswrapper utility and compile the module to be loaded later to identify the device.
2. Copying the Windows device drivers:
By default, MandrakeLinux identifies the NTFS parititions on your hard disk used by Windows. I am running Windows XP, and I had already configured my wireless card for the operating system. The windows device driver corresponds to two files, namely an INF file and a SYS file. Search for the following files in your Windows directory. ( C:\Windows\System ) .
* Bel6020.inf
* Bel6020.sys
Copy the two files to a directory of your choice in linux, say /home/akkumar/tmp .
Now go ahead to configure this Windows device driver using ndiswrapper as follows.
[akkumar@localhost tmp]$ ndiswrapper-0.12/utils/ndiswrapper -i Bel6020.inf
This would install the device drivers. To check the status of your device drivers, invoke the following command.
[akkumar@localhost tmp]$ ndiswrapper-0.12/utils/ndiswrapper -l
You should see something like this:
Installed ndis drivers
bel6020 hardware present
3. Load Modules:
To load the module, invoke the following command.
[akkumar@localhost tmp]$ modprobe ndiswrapper
Use the 'dmesg' command to view the kernel log to see if everything works fine till now. Refer to this documentation on the site to double-check the same.
Assuming everything goes fine, all that needs to be done is to specify a wireless SSID to connect to.
4. Configuring the wireless interface:
If you know your wireless SSID correctly, invoke the following command.
[akkumar@localhost tmp]$ iwconfig wlan0 essid MYESSID
At this point, the LED on your wireless card should start glowing, if everything works fine till now.
Once this happens the network interface ought to be brought up.
[akkumar@localhost tmp]$ ifup wlan0
Wait for a couple of seconds and then, you should be connected to the network right now. So yes, we had indeed succcessfully configured our wireless card to work with MandrakeLinux 10.1 , thanks to the ndiswrapper utility.
» login or register to post comments
Great tutorial ;-)
Submitted by k4m3leon on Sun, 06/19/2005 - 18:59.
Great tutorial ;-)
» login or register to post comments
Submitted by akkumar on Thu, 12/16/2004 - 05:15. General Interest | How-to | Quick Tips & Newbies | Distributions
I had bought a Belkin Wireless PCMCIA Card – F5D6020 (Version 3.0) recently and wanted to configure the same in my favourite Linux distribution.
I downloaded and installed the MandrakeLinux 10.1 distribution released recently to the public (on December 6 2004 ). To get the latest version of MandrakeLinux visit the home page of MandrakeLinux, here. If you have a DVD writer, go for the DVD image. It would be much easier to maintain instead of playing around with the 3 CDs .
The installation was a breeze with MandrakeLinux 10.1 identifying my PCMCIA card attached to my laptop while installing the system. It did not load the right module corresponding to the PCMCIA card, though. So I had to find the right module to get that done. I did not get the Linux device driver from the manufacturer, but I did have the Windows driver.
Thanks to the ndiswrapper project at sourceforge, I was able to use the Windows device driver (already installed on my dual-boot system) for my Linux distribution too. I downloaded the latest source code of ndiswrapper from its sourceforge project page . The version that I had downloaded was 0.12 released on November 24 2004. The project documentation available at the site was pretty much clear to get things done.
1. Compiling ndiswrapper:
To compile ndiswrapper, you would need the source code of the kernel. By default, the kernel source was not installed. I installed the kernel source corresponding to the 2.6 tree (kernel-source-2.6.8.1-12mdk, to be exact) .
[akkumar@localhost tmp]$ pwd
/home/akkumar/tmp
[akkumar@localhost tmp]$ tar xzvf ndiswrapper-0.12.tar.gz
[akkumar@localhost tmp]$ cd ndiswrapper-0.12
[akkumar@localhost ndiswrapper-0.12]$ make install
This would compile the ndiswrapper utility and compile the module to be loaded later to identify the device.
2. Copying the Windows device drivers:
By default, MandrakeLinux identifies the NTFS parititions on your hard disk used by Windows. I am running Windows XP, and I had already configured my wireless card for the operating system. The windows device driver corresponds to two files, namely an INF file and a SYS file. Search for the following files in your Windows directory. ( C:\Windows\System ) .
* Bel6020.inf
* Bel6020.sys
Copy the two files to a directory of your choice in linux, say /home/akkumar/tmp .
Now go ahead to configure this Windows device driver using ndiswrapper as follows.
[akkumar@localhost tmp]$ ndiswrapper-0.12/utils/ndiswrapper -i Bel6020.inf
This would install the device drivers. To check the status of your device drivers, invoke the following command.
[akkumar@localhost tmp]$ ndiswrapper-0.12/utils/ndiswrapper -l
You should see something like this:
Installed ndis drivers
bel6020 hardware present
3. Load Modules:
To load the module, invoke the following command.
[akkumar@localhost tmp]$ modprobe ndiswrapper
Use the 'dmesg' command to view the kernel log to see if everything works fine till now. Refer to this documentation on the site to double-check the same.
Assuming everything goes fine, all that needs to be done is to specify a wireless SSID to connect to.
4. Configuring the wireless interface:
If you know your wireless SSID correctly, invoke the following command.
[akkumar@localhost tmp]$ iwconfig wlan0 essid MYESSID
At this point, the LED on your wireless card should start glowing, if everything works fine till now.
Once this happens the network interface ought to be brought up.
[akkumar@localhost tmp]$ ifup wlan0
Wait for a couple of seconds and then, you should be connected to the network right now. So yes, we had indeed succcessfully configured our wireless card to work with MandrakeLinux 10.1 , thanks to the ndiswrapper utility.
» login or register to post comments
Great tutorial ;-)
Submitted by k4m3leon on Sun, 06/19/2005 - 18:59.
Great tutorial ;-)
» login or register to post comments
Wednesday, November 08, 2006
subversion inplace checkin
From the Subversion FAQ:
http://subversion.tigris.org/faq.html#in-place-import
Suppose, for example, that you wanted to put some of /etc under version control inside your repository:
# svn mkdir file:///root/svn-repository/etc -m "Make a directory in the repository to correspond to /etc"
# cd /etc
# svn checkout file:///root/svn-repository/etc .
# svn add apache samba alsa X11
# svn commit -m "Initial version of my config files"
This takes advantage of a not-immediately-obvious feature of svn checkout: you can check out a directory from the repository directly into an existing directory. Here, we first make a new empty directory in the repository, and then check it out into /etc, transforming /etc into a working copy. Once that is done, you can use normal svn add commands to select files and subtrees to add to the repository.
There is an issue filed for enhancing svn import to be able to convert the imported tree to a working copy automatically; see issue 1328.
note on using rapid svn i found that using file:/// is better than file:// !
http://subversion.tigris.org/faq.html#in-place-import
Suppose, for example, that you wanted to put some of /etc under version control inside your repository:
# svn mkdir file:///root/svn-repository/etc -m "Make a directory in the repository to correspond to /etc"
# cd /etc
# svn checkout file:///root/svn-repository/etc .
# svn add apache samba alsa X11
# svn commit -m "Initial version of my config files"
This takes advantage of a not-immediately-obvious feature of svn checkout: you can check out a directory from the repository directly into an existing directory. Here, we first make a new empty directory in the repository, and then check it out into /etc, transforming /etc into a working copy. Once that is done, you can use normal svn add commands to select files and subtrees to add to the repository.
There is an issue filed for enhancing svn import to be able to convert the imported tree to a working copy automatically; see issue 1328.
note on using rapid svn i found that using file:/// is better than file:// !
Thursday, November 02, 2006
uic trick
want to make the implementation and header files
make a pro file with:
FORMS += form1.ui
this will cause
/usr/share/qt3/bin/uic form1.ui -o form1.h
/usr/share/qt3/bin/uic form1.ui -i form1.h -o form1.cpp
make a pro file with:
FORMS += form1.ui
this will cause
/usr/share/qt3/bin/uic form1.ui -o form1.h
/usr/share/qt3/bin/uic form1.ui -i form1.h -o form1.cpp
Subscribe to:
Posts (Atom)