Uncategorized


I have been trying to find drivers for old laptops: Sony PCG-C1 VS/BW and Toshiba Portege 4000, and luckily found these sources:

Sony:

  1. a great article talking about how to find and install drivers for the exact type of laptop I am doing :-)
  2. drivers for windows 2000 – site a
  3. drivers for windows XP – site a, site b
  4. a guide how to open the toy

Toshiba:

  1. drivers download
  2. a discussion on Toshiba support forum

It seems pretty easy to reveal WEP passwords by software if you have used that password before connecting to a certain wifi access point. But if the wireless router filters MAC addresses, you need to get around that by changing your device MAC address. It is pretty simple to do on windows platforms. However, for an iPhone or iPod Touch, these steps may be taken (haven’t been verified yet):

  1. Install the Terminal app on your device, load it up and type the following at the prompt:
    ifconfig en0 lladdr 00:00:00:00:00:01
  2. The command will change your MAC address to “00:00:00:00:00:01″ so substitute it for whatever you want.
  3. This change will not be reflected in the Settings menu but typing “ifconfig” will confirm the change.
  4. Now all you have to do is to write a script to execute the command every time your device restarts.

For those who have got passwords only in hex, you can just type that hex code in or add a ‘$’ at the beginning of the code (try another if one doesn’t work).

Now comes to the hardest part: is there a way to hack into a wireless network that I have never got access before? Here is an article you might have interest reading.

Installing this USB adapter seems not straightforward. A bad USB cable almost made me believe that the adapter was broken and throw it away. After installing the driver, Novell login was replaced and an error occurred which didn’t allow me to login to the domain correctly. I had to bypass the Novell login and logged in as a normal local user to Windows XP.

Also creating a wireless ad-hoc network seems impossible for this USB unit. I tried it on both XP and Server version, and neither worked, even though its specification says it supports that. Maybe there are some security policies on the domain restricting that.

How to create a wireless ad-hoc network, here is an article for XP, and this one is for Vista. Don’t forget to connect to that ad-hoc network after you have created it.

I finally got an ipod touch instead of an iPhone because as a mobile iPhone is a bit too big and it is double price of an ipod touch which provides most functions. iPod touch can’t make calls like iPhone because it doesn’t have a microphone and bluetooth either. However there are still workarounds to get a iPod touch to make phone calls. First of all, you need to buy a microphone extension such as IVoiceIII (however you need to do a bit modification on IVoiceIII). You may also use a Bluetooth extension to solve the issue.

In order to make VoIP, you have to jailbreak the iPod touch to get its full power. How to do that? Here is a very good tutorial. I followed it and it worked. I didn’t download the firmware for free, instead I paid on Apple Store to get the newest firmware and then worked on it.

Then you can use SFTP, WinSCF or PC Suite to connect to your iPod touch to install applications or backup your iPod.

Finally here are some useful tips:

  1. Where does Itunes save iphone firmware?
    “C:\Documents and Settings\*USER HERE*\Application Data\Apple Computer\iTunes\iPhone Software Updates”

Another small task to play a beep or tones (waveform audio) by using C# or C++. I found there are a few ways to do that according to MSDN. I did two examples:

  1. Using .NET class SoundPlayer. The key point is to use PlaySync() method to play the sound instead of Play() because the latter plays sound asynchronously (by starting another thread) then you may not hear the sound when the program is ended. The sound file is embedded. In order to read the sound file from resource folder, you need to be careful with the path to the sound file (GetManifestResourceStream needs it as a parameter). You may also use ResourceManager class to achieve the same purpose.
  2. Using Win32 APIs, such as WAVEFORMATEX, waveOutOpen, waveOutPrepareHeader, waveOutWrite, etc. Here is a detailed tutorial on how to use those functions. The difficult part is to find out the wave generation mathematic expressions for different sound waves. Here is another tutorial on how to do that. Also you can use a tool called ETG to get such expressions (of course you have to modify them, not sure how to create delays as demonstrated in the tool).

You may use DirectX to implement the function. Here is a simple example with just a few lines of code.

Some tips:

  • In C# or VB.NET, to use Win32 API, you need to import dlls, for example:
       [DllImport("CoreDll.DLL", EntryPoint="PlaySound", SetLastError=true)] 
       private extern static int WCE_PlaySound(string szSound, IntPtr hMod, int flags);
  • In Visual Studio IDE, debug (System.Diagnostics) outputs normally go to Immediate Window (you can type ‘immed’ to bring Immediate Window). You may also redirect the contents in Output Window to Immeidate Window by changing VS options.
  • How to handle problems between TCHAR and std::string can be found in this blog. Generally speaking, define a tstring type in your C head file:
       #ifdef _UNICODE
       #define tstring wstring
       #else
       #define tstring string
       #endif
  • Here is a good reference on how to use std::string functions.

Just had a small task to do last weekend. The useful part is how to use XMLHttpRequest which is the essential part of AJAX. I have uploaded some code snippets to CodeKeep. Here are something I have leant just for future references:

 

1.       The brief overview on XMLHttpRequest can be found here. It also gives some solutions on how to solve cache issues, for example, by adding a random string on the end of the url in the query.

2.       The replace string function in Javascript takes a regular expression as the first parameter (not a string).

3.       It is possible for XMLHttpRequest’s onreadystatechange method to take parameters. Please check out this.

4.       Hiding/displaying the controls can use:

a)       document.getElementById(“”).style.display=“none”

document.getElementById(“”).style.display=“inline”

or

b)      document.getElementById(“”).style.visibility=“visible”

document.getElementById(“”).style.visibility=“hidden”

The difference between the two is by using the 1st option, it hides the controls and the space occupied by the controls also gets removed, i.e. if a control has a certain height and is contained in a table row, the row gets collapsed and when displayed, the control will again take it’s place and the row will again retain its height by displaying the control in it.

On the other hand if 2nd option is used, the control will get hide but the space occupied by the control will remain as it is and the row will not collapse, i.e. the row will still be displayed as blank containing the control in hidden mode.

5.       How to debug javascript is talked at here.

6.       If want to intercept the key before anything happens, use onkeydown, and if you want to do something after the key has done whatever to the field, use onkeyup. So if want to capture keys like “backspace” or “delete”, you have to use onkeyup event. If you want to capture those keys in keypress event, I guess you need to write your own keypress handler (testing if (e.keyCode == 8 ) for backspace and if (e.keyCode == 46 ) for delete, etc.). And when calling it, you have to pass ‘event’ parameter, like this: onkeypress=’x(event)’, otherwise it won’t work in Firefox while it doesn’t affect IE.

7.       w3school and w3school Chinese are excellent websites for learning all the web-related stuff.

8.       When using XMLHttpRequest to post data to server, the parameter in send(data) method should be a XMLDOM object or xml text. And on the server side, load() method should be used instead of loadXML() which will give you a mistype error.

9.       I found IIS 5 on Windows XP doesn’t support writing XML file using XMLHttpRequest send method (you may get a error message telling that uploading size exceeds the maximum allowed, which is misleading), but IIS 6 on Windows Server 2003 has no problems at all if you set permission correctly.

I have two USB bluetooth dongles: Dlink DBT-120 and a non-brand one with ISCC chipset. I thought it was easy to install by just plugging them into the computer and installing the drivers. However, it is not that easy. First of all, Dlink DBT-120 needs a security license to install its own driver. Since it is a second-hand unit, I cannot find the code. There are two choices of bluetooth software, one is from widcomm and another is called BlueSoleil. Both of them need license. I finally managed to find patched drivers on the Internet and get both installed. DBT-120 is working fine but the other cannot find any bluetooth devices (although the driver seems starting properly, I suspect it might be a fake product). I guess my DBT-120 (dev A2) doesn’t have Audio service, so it needs a firmware upgrade. Originally I bought it for my Mac, but later realized that only dev B2 (or later) can work fine with Mac OS X.

Here are some tips for installing DBT-120:
1. Use patched Bluesoleil_3.2, it works very well. However, be careful with the driver (use the driver Bluesoleil provides). Here is the VID: 0A5C, but PID varies: 200A (current one) or 2033.
2. Following Jon’s guide, it should work in most cases. This time, a generic Broadcom bluetooth driver will be installed.
3. If the driver is messed up, try to use Dlink official driver to recover. Then uninstall the software, but the driver remains.
4. No time to upgrade firmware, guess it can add Audio service into DBT-120 dev A2 (I guess it uses CSR chipset, so a generic CSR firmware may be helpful, check this out).

ISCC one has VID 1131 and PID 1001.

A useful forum: http://forum.gsmhosting.com/vbb/forumdisplay.php?f=237
A useful guide: http://bbs.btbbt.com/thread-3059793-1-1.html teaching how to let bluetooth software recognize new type of USB dongles.

This is taken from http://www.endymios.com/flash-gallery-module and modified a bit:

  • Download flash gallery module and copy it to your modules directory
  • Download Simpleviewer from Airtight Interactive. Unzip the package.
  • Create a new directory inside the flash_gallery directory in your modules directory called ’simpleviewer’ (modules/flash_gallery/simpleviewer/).
  • Copy ’swfobject.js’ and ‘viewer.swf’ to the simpleviewer directory. Do not copy any other files from the Simpleviewer package.
  • Make sure that you have image.module and image_gallery.module enabled before you enable flash_gallery.module.
  • Enable the module @ admin > modules
  • Change the settings @ admin > settings > flash galleries
  • Create a image gallery
  • Copy image files into the importer folder, and then import all the images into the gallery
  • Check ‘build thumbnail library’ in the miscellaneous section and hit save
  • Navigate to http://yoursite.com/fgallery to see the module in action
  • Suggestion: set a path alias for fgallery
  • Suggestion: disable all blocks on fgallery /* as this will give you more space to display your albums

Simple Viewer can also be used separately, here is the tutorial.

 

 

 

1.       go to http://subversion.tigris.org/ to download svn package for your particular Apache version (I have already got wamp server installed on my server with 2.2.8 version of Apache).

2.       copy mod_authz_svn.so and mod_dav_svn.so to modules folder under Apache installation, and do some changes on httpd.conf:

uncomment these two lines:

#LoadModule dav_module modules/mod_dav.so

#LoadModule dav_fs_module modules/mod_dav_fs.so

add these two lines:

#SVN

LoadModule dav_svn_module modules/mod_dav_svn.so

LoadModule authz_svn_module modules/mod_authz_svn.so

After restart Apache, you will see the Apache description has been changed in service list (…SVN/1/4/6 DAV/2).

3.       run subversion server as a windows service: find and download svnservice.exe.

4.       create a folder as the base subversion repository: svnadmin create c:\svn_repository

add this in httpd.conf file:

<Location /svn>

DAV svn
SVNParentPath “C:/svn_repository”
AuthType Basic
AuthName “Subversion Repositories”
AuthUserFile “C:/svn_repository/conf/passwd”
Require valid-user
</Location>

5.      create user/password by going to apache/bin folder, run:

htpasswd –c c:\svn_repository\conf\passwd lwang

later when adding another account into the passwd file, you need to use “–m” instead of “–c”

6.      how to set up multiple repositories for different projects, please refer to here, and how to setup up ssl access please refer to here.

7.      for TortoiseSVN, the general ignore pattern can be set like this: ”*/bin */obj *.bak *.*scc *.user *.suo *.webinfo bin obj *.dll *.pdb *.exe
debug Debug” (for TortoiseCVS, in order to use freepository.com, one has to use “:sserver;version=1:username@@freepository.com:11549/path”)

Problems:

1. After installing IIS, ASP.NET and WSS, I cannot open website on local host or other machines on the same local network;

2. After installing Wamp Server, I can open from localhost, but not from other machines on the same local network.

Solutions:

1. Found and followed this How To Troubleshoot a Web Server in Windows Server 2003. Firstly, you won’t find ‘Inetinfo.exe’ in the Task Manager. However, I knew IIS was working because you could check in both ‘Services’ and ‘Event Viewer’ which says so (all the required services have already been automatically started). Later I fixed a DCOM permission error related to IISAdmin, which requires a local activation permission for ‘Network Service’ role.

2. Changed some settings in httpd.conf: in <Directory> section, made “Allow from all”.

3. Installed DNS and WINS components from Windows Server 2003, however, that was not the key to solve the problems.

4. Checked all the permission and security settings in IIS Manager, however, still didn’t help.

5. Finally found out the key had two: the local host file and local firewall settings. For how to write a host file, please see this. Opened http and https service on the server, and all problems were solved.

6. For setting virtual hosts for Apache, please refer to 1, 2 and 3.

Next Page »