Archive for November, 2005

Howto leave Cingular

Wednesday, November 30th, 2005

Cingular is not a ‘nice’ company. I don’t like them anymore.
How to leave them?

How to have one phone number/contact ID forever?

skype. (in/out/forwarding/voicemail)
pocketpc w/ wifi and bluetooth and/or laptop w/ wifi and bluetooth
bluetooth headset.
prepaid cell phones.

Ultimate Address Book

Tuesday, November 29th, 2005

I want a universal address book that every program/device I ever use will be able to automatically access.

So, my own permanent LDAP server always connected to the net.

Plus, my laptop should keep a cached version of this address book on the hard drive, so I can work without an internet connection.
My laptop should automatically synch up w/ the main LDAP server whenever I connect to the Net again.

Plus, my next 4GB cell phone should synch with this LDAP server as well.

I should be able to synch data from my friends in MySpace, Friendster, Tribe, and chat programs, as well.

My webmail accounts should also check my universal address book.

Webdav in IIS 6

Tuesday, November 22nd, 2005

Is shady. Damn, I wish they could get this right. It’s insanely slow over the net. Most tutorials for setting it up are flawed with permissions setup. Just a pain to get going.

And how can MS still let an IE hangup freeze every single Windows Explorer window that is open? So, webdav via IE basically freezes a large part of my machine in order to show me the contents of a web folder. wtf?

Windows roaming profiles and folder redirection

Tuesday, November 22nd, 2005

Are fucked. Don’t lose your users data trying to use this buggy software. When you get past the simple test users, and try something real, it craps out and loses data in ways I’d never seen. Plus, it’s a royal pain to remove it from users after you try it out.

Setting Windows Batch Script Priority

Thursday, November 10th, 2005

How to control priority of windows batch scripts:

example:
This script runs hivm at low priority. After hivm’s execution completes, it starts MS Word up at low priority.
If you don’t put in the Wait switch, it will spawn new cmd windows to run everything in the batch script simultaneously.

#make the library
start /WAIT /LOW hivm.exe

#open Word
start /WAIT /LOW winword.exe

http://www.robvanderwoude.com/index.html

(haven’t tried this add on.)
http://www.beyondlogic.org/solutions/processutil/processutil.htm

Script to remove blank lines from a text file

Thursday, November 10th, 2005

grep -v “^$” filename > newfilename

The ^$ within the quotes is a regular expression: ^=beginning of line, $=end of line, with no characters between.

Note: Running this RegEx to clear blank lines from inside applications doesn’t seem to work.
Tested on OpenOffice, TextPad, MS Office. Have to run this one cmd line for some reason.

btw, TextPad’s RegEx Search has a lot of bugs and/or just missing functionality.

Howto install cppunit for MS Visual Studio.Net 2003

Thursday, November 10th, 2005

cppunit: VS7 Instructions for INSTALL-WIN32.txt

VS7 Instructions for INSTALL-WIN32.txt
2005-07-24 15:25
For newbies to cppunit-1.11.0 and Visual Studio 2003:

Old Instructions:

Frequently Asked Questions: See doc/FAQ

At the current time, the only supported WIN32 platform is
Microsoft Visual C++. You must have VC++ 6.0 at least.

Quick Steps to compile & run a sample using the GUI TestRunner:
- Open examples/examples.dsw in VC++ (contains all the samples).
VC7 will ask you if you want to convert, anwser ‘yes to all’.
- Make HostApp the Active project
- Compile
- in VC++, Tools/Customize…/Add-ins and macro files/Browse…
- select the file lib/TestRunnerDSPlugIn.dll and press ok to register
the add-ins (double-click on failure = open file in VC++).
- Run the project

New Instructions for Visual Studio.Net 2003:

Frequently Asked Questions: See doc/FAQ

Quick Steps to compile & run a sample using the GUI TestRunner:
- Open cppunit-1.11.0/examples/examples.dsw in VC++
( VC7 will ask you if you want to convert, anwser ‘yes to all’ ).
- Make HostApp the Active project
(Open Solution Explorer, Right-click HostApp Project, and click ‘Set as
Startup Project’ )
- Ignore old comments on registering TestRunnerDSPlugIn.dll
- Compile (Build > Build Solution ) (F7)
- Debug > Start (F5)
-TestRunner window will start. Click Browse and Select the tests you
want to run. Choose tests from drop down window and click Run.

System:
Windows XP SP2

Ed
Aug 23, 4:51 pm show options

You still need more steps to run cppunit on your own personal project
in Visual Studio.Net. You must run the previous example first to create
the appropriate libaries for your system.

Steps:
1. Create a new Unmanaged C++ Project.
New > Project > Visual C++ Project > Win32 > Win32 Console Project

1a. Build > Build Solution

2. Open Solution Manager Tab > Right-click the project name >
Properties > Debug

3. Configuration Properties > C++ > General > Additional Include
Directories > (your cppunit directory)\include;(your cppunit
dir)\include\msvc6

example:
C:\workspace\PrsvmCvs\cppunit\include;C:\workspace\PrsvmCvs\cppunit\include\msvc6

4. Configuration Properties > Linker > General > Additional Library
Directories > c:\(location of cppunit on your machine)\lib

-example: C:\workspace\PrsvmCvs\cppunit\lib

5. Configuration Properties > Linker > Input > Additional Dependencies

> cppunitd.lib testrunnerd.lib


note: The CppUnit gui doesn’t work for me, but the tests compile and
run in an external cmd line window. I put a breakpoint at the end of
TestRun.cpp, so that the results aren’t erased immediately after the
tests run. I get the correct filename and line number of failed tests
in the command line window.

Ok, now you can make the TestRun.cpp file that manages your unit tests,
and an actual Unit Test class. This unit test tests does a simple test
of a function in a string tokenizer class.

TestRun.cpp

//cppunit required includes
#include
#include
#include

//add includes to your personal unit test files here
#include “TestStringTokenizerAdapter.cpp”

class TestRun
{

public:

bool TestRun::run()
{

CppUnit::TextUi::TestRunner runner;

CppUnit::TestFactoryRegistry &registry =
CppUnit::TestFactoryRegistry::getRegistry();

runner.addTest( TestStringTokenizerAdapter::suite() );
runner.addTest( registry.makeTest() );

bool wasSucessful = runner.run( “”, false );
return wasSucessful;
}

};

——————–

#include

#include “../StringTokenizerAdapter.h”

class TestStringTokenizerAdapter : public CppUnit::TestFixture

{

CPPUNIT_TEST_SUITE( TestStringTokenizerAdapter );

CPPUNIT_TEST( testConstructors );
CPPUNIT_TEST( setString );

CPPUNIT_TEST_SUITE_END();
CPPUNIT_TEST_SUITE_REGISTRATION( TestStringTokenizerAdapter );

private:

public:
void setUp()
{
}

void tearDown( )
{

}

//@fn open the default options text file
// initialize internal classes
void TestStringTokenizerAdapter::testConstructors(){

//test what the default constructor does
{
StringTokenizerAdapter a;
}

{
StringTokenizerAdapter b( “abc,def,hij,k”, “,” );
CPPUNIT_ASSERT( “abc” == b.nextToken() );
CPPUNIT_ASSERT( “def” == b.nextToken() );
CPPUNIT_ASSERT( “hij” == b.nextToken() );
CPPUNIT_ASSERT( “k232323″ == b.nextToken() );//should fail
}
}

void TestStringTokenizerAdapter::setString(){

StringTokenizerAdapter a;
//now perform some tokenizer functions to see if it worked.
CPPUNIT_ASSERT( “” == a.nextToken() );

a.setString( “abc,def,hij,k”, “,” );

//now perform some tokenizer functions to see if it worked.
CPPUNIT_ASSERT( “abc” == a.nextToken() );
CPPUNIT_ASSERT( “def” == a.nextToken() );
CPPUNIT_ASSERT( “hij” == a.nextToken() );
CPPUNIT_ASSERT( “k33″ == a.nextToken() );//should fail
}

};

In your main class, add:

TestRun t;
t.run();

Ed

And here’s the cmd line window output:

!!!FAILURES!!!
Test Results:
Run: 2 Failures: 2 Errors: 0

1) test: TestStringTokenizerAdapter::testConstructors (F) line: 64
c:\workspace\prsvmcvs\unit_tests\teststringtokenizeradapter.cpp
assertion failed
- Expression: “k232323″ == b.nextToken()

2) test: TestStringTokenizerAdapter::setString (F) line: 80
c:\workspace\prsvmcv
s\unit_tests\teststringtokenizeradapter.cpp
assertion failed
- Expression: “k33″ == a.nextToken()

Making a SAMBA scanner and a Windows 2000 Domain work together

Thursday, November 10th, 2005

We have a Ricoh Aficio 2232c fancy printer, scanner, copier at the office. I don’t actually know which version on SMB (SAMBA) that the printer runs. The network is Windows 2000 SP4.

Here’s how to keep the security high, while letting the SMB connect to the server. For the Active Directory user that is used by the SMB client to connect, these are some Group Policy Security settings that work without compromising the domain security.

Computer Configuration > Windows Settings > Security Settings > Security Options >

Policy Computer Setting

LAN Manager Authentication Level Send NTLMv2 response only\refuse LM
Secure channel: Digitally encrypt or sign secure channel data (always) Enabled
Secure channel: Digitally encrypt secure channel data (when possible) Enabled
Secure channel: Digitally sign secure channel data (when possible) Enabled
Secure channel: Require strong (Windows 2000 or later) session key Enabled
Send unencrypted password to connect to third-party SMB servers Enabled