"this guide helps you to share your dsl/cable internet connection without a need of a wireless router using only a windows vista laptop that has a wifi adhoc capabilities
1st: go to control panel and hit on networking. click on manage connections and setup a new wifi adhoc network and for example we'll name it "wireless"
2nd: after your name the network profile its for you to have it secure or not.
3rd:save your network
4th: go to task scheduler and create a task name it as 'automatic adhoc'
5th: the program you need to run is called netsh.exe(you can find this at c:/windows/system32/)and add this following
command "wlan connect name=profilename" without the quotes ok. change the profilename into wireless
6th: do not start in windows startup but choose to start it in windows logon
7th: now you're good to go. everytime you turn on your laptop you can share it in you neighborhood" myownblogtech.blogspot.com
August 26, 2009
August 25, 2009
[cmd]Batch - Filename Parameter Extensions
"When a parameter is used to supply a filename then the following extended syntax can be applied:
we are using the variable %1 (but this works for any parameter)
%~f1 - expands %1 to a Fully qualified path name - C:\utils\MyFile.txt
%~d1 - expands %1 to a Drive letter only - C:
%~p1 - expands %1 to a Path only - \utils\
%~n1 - expands %1 to a file Name, or if only a path is present - the last folder in that path
%~x1 - expands %1 to a file eXtension only - .txt
%~s1 - changes the meaning of f, n and x to reference the Short name (see note below)
%~1 - expand %1 removing any surrounding quotes (")
%~a1 - display the file attributes of %1
%~t1 - display the date/time of %1
%~z1 - display the file size of %1
%~$PATH:1 - search the PATH environment variable and expand %1 to the fully qualified name of the first match found.
The modifiers above can be combined:
%~dp1 - expands %1 to a drive letter and path only
%~nx2 - expands %2 to a file name and extension only" ss64.com
we are using the variable %1 (but this works for any parameter)
%~f1 - expands %1 to a Fully qualified path name - C:\utils\MyFile.txt
%~d1 - expands %1 to a Drive letter only - C:
%~p1 - expands %1 to a Path only - \utils\
%~n1 - expands %1 to a file Name, or if only a path is present - the last folder in that path
%~x1 - expands %1 to a file eXtension only - .txt
%~s1 - changes the meaning of f, n and x to reference the Short name (see note below)
%~1 - expand %1 removing any surrounding quotes (")
%~a1 - display the file attributes of %1
%~t1 - display the date/time of %1
%~z1 - display the file size of %1
%~$PATH:1 - search the PATH environment variable and expand %1 to the fully qualified name of the first match found.
The modifiers above can be combined:
%~dp1 - expands %1 to a drive letter and path only
%~nx2 - expands %2 to a file name and extension only" ss64.com
August 17, 2009
[SOLVED]Eclipse and .svn Android AIDL Problem
Today after adding my android project to svn repository I got
syntax error entries /src/.svn line 1 Android AIDL Problem
After searching internet for solutions I installed subversion plug-in (did not helped) but this...
It is worked for me:
- Delete your project from eclipse (not from disk).
- "File"->"New.."->"Project"->"Android Project"
- in "New Adroid Project"-Dialog selected "create project from existing source" (find your project on HDD)->"Finish"
my .classpath-file
<?xml version="1.0" encoding="UTF-8"?><classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/></classpath>
August 11, 2009
Android ImageLoader - load images sequencially in the background
"A few days ago I started to learn android… and it’s been a fairly smooth transition from flash. Although I have to say, as flash developers we’re just spoiled. We take for granted all the background stuff flash does for us to make coding that much easier.
One of those things is Loading images. in flash we have the Loader class which makes loading images very easy.
var loader:Loader = new Loader();
loader.load(new URLRequest("myimage.jpg"));
In java/android it takes a few more lines
HttpURLConnection conn = (HttpURLConnection) new URL("myimage.jpg").openConnection();
conn.setDoInput(true);
conn.connect();
InputStream inStream = conn.getInputStream();
Bitmap bitmap = BitmapFactory.decodeStream(inStream);
inStream.close();
conn.disconnect();
The code above runs in the same thread so you’ll lock up your UI until the image has finish loading. Adding the Threading code adds quite a bit more code. So I decided to create an ImageLoader class to make my life just a little easier. Now I can load an image to an ImageView with one line of code.
ImageLoader.getInstance().load(myImageView, "myimage.jpg", true);
The last parameter tells the ImageLoader class to cache that the bitmap.
The ImageLoader class loads images sequentially so you don’t slow your mobile device down to a crawl. To cancel Loading simply call clearQueue() and to clear the cache call clearCache()
Here’s the class
package com.wumedia.net;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Queue;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Handler;
import android.widget.ImageView;
public class ImageLoader {
static private ImageLoader _instance;
static public ImageLoader getInstance() {
if (_instance == null) {
_instance = new ImageLoader();
}
return _instance;
}
private HashMap _urlToBitmap;
private Queue _queue;
private DownloadThread _thread;
private Bitmap _missing;
private boolean _busy;
/**
* Constructor
*/
private ImageLoader () {
_urlToBitmap = new HashMap();
_queue = new LinkedList();
_busy = false;
}
public Bitmap get(String url) {
return _urlToBitmap.get(url);
}
public void load(ImageView image, String url) {
load(image, url, false);
}
public void load(ImageView image, String url, boolean cache) {
if (_urlToBitmap.get(url) != null) {
if(image!=null) {
image.setImageBitmap(_urlToBitmap.get(url));
}
} else {
image.setImageBitmap(null);
queue(image, url, cache);
}
}
public void queue(ImageView image, String url, boolean cache) {
Iterator it = _queue.iterator();
if (image!=null) {
while (it.hasNext()) {
if (it.next().image.equals(image)) {
it.remove();
break;
}
}
} else if (url!=null) {
while (it.hasNext()) {
if (it.next().url.equals(url)) {
it.remove();
break;
}
}
}
_queue.add(new Group(image, url, null, cache));
loadNext();
}
public void clearQueue() {
_queue = new LinkedList();
}
public void clearCache() {
_urlToBitmap = new HashMap();
}
public void cancel() {
clearQueue();
if ( _thread != null ) {
_thread.disconnect();
_thread = null;
}
}
public void setMissingBitmap(Bitmap bitmap) {
_missing = bitmap;
}
private void loadNext() {
Iterator it = _queue.iterator();
if (!_busy && it.hasNext() ) {
_busy = true;
Group group = it.next();
it.remove();
// double check image availability
if (_urlToBitmap.get(group.url) != null) {
if (group.image!=null) {
group.image.setImageBitmap(_urlToBitmap.get(group.url));
}
_busy = false;
loadNext();
} else {
_thread = new DownloadThread(group);
_thread.start();
}
}
}
private void onLoad() {
if (_thread != null) {
Group group = _thread.group;
if (group.bitmap != null) {
if (group.cache) {
_urlToBitmap.put(group.url, group.bitmap);
}
if (group.image != null) {
group.image.setImageBitmap(group.bitmap);
}
} else if (_missing != null) {
if (group.image != null) {
group.image.setImageBitmap(_missing);
}
}
}
_thread = null;
_busy = false;
loadNext();
}
private class Group {
public Group(ImageView image, String url, Bitmap bitmap, boolean cache) {
this.image = image;
this.url = url;
this.bitmap = bitmap;
this.cache = cache;
}
public ImageView image;
public String url;
public Bitmap bitmap;
public boolean cache;
}
private class DownloadThread extends Thread {
final Handler threadHandler = new Handler();
final Runnable threadCallback = new Runnable() {
public void run() {
onLoad();
}
};
private HttpURLConnection _conn;
public Group group;
public DownloadThread(Group group) {
this.group = group;
}
@Override
public void run() {
InputStream inStream = null;
_conn = null;
try {
_conn = (HttpURLConnection) new URL(group.url).openConnection();
_conn.setDoInput(true);
_conn.connect();
inStream = _conn.getInputStream();
group.bitmap = BitmapFactory.decodeStream(inStream);
inStream.close();
_conn.disconnect();
inStream = null;
_conn = null;
} catch (Exception ex) {
// nothing
}
if (inStream != null) {
try {
inStream.close();
} catch (Exception ex) {}
}
disconnect();
inStream = null;
_conn = null;
threadHandler.post(threadCallback);
}
public void disconnect() {
if (_conn != null) {
_conn.disconnect();
}
}
}
}
" wu-media.com
One of those things is Loading images. in flash we have the Loader class which makes loading images very easy.
var loader:Loader = new Loader();
loader.load(new URLRequest("myimage.jpg"));
In java/android it takes a few more lines
HttpURLConnection conn = (HttpURLConnection) new URL("myimage.jpg").openConnection();
conn.setDoInput(true);
conn.connect();
InputStream inStream = conn.getInputStream();
Bitmap bitmap = BitmapFactory.decodeStream(inStream);
inStream.close();
conn.disconnect();
The code above runs in the same thread so you’ll lock up your UI until the image has finish loading. Adding the Threading code adds quite a bit more code. So I decided to create an ImageLoader class to make my life just a little easier. Now I can load an image to an ImageView with one line of code.
ImageLoader.getInstance().load(myImageView, "myimage.jpg", true);
The last parameter tells the ImageLoader class to cache that the bitmap.
The ImageLoader class loads images sequentially so you don’t slow your mobile device down to a crawl. To cancel Loading simply call clearQueue() and to clear the cache call clearCache()
Here’s the class
package com.wumedia.net;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Queue;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Handler;
import android.widget.ImageView;
public class ImageLoader {
static private ImageLoader _instance;
static public ImageLoader getInstance() {
if (_instance == null) {
_instance = new ImageLoader();
}
return _instance;
}
private HashMap _urlToBitmap;
private Queue _queue;
private DownloadThread _thread;
private Bitmap _missing;
private boolean _busy;
/**
* Constructor
*/
private ImageLoader () {
_urlToBitmap = new HashMap();
_queue = new LinkedList();
_busy = false;
}
public Bitmap get(String url) {
return _urlToBitmap.get(url);
}
public void load(ImageView image, String url) {
load(image, url, false);
}
public void load(ImageView image, String url, boolean cache) {
if (_urlToBitmap.get(url) != null) {
if(image!=null) {
image.setImageBitmap(_urlToBitmap.get(url));
}
} else {
image.setImageBitmap(null);
queue(image, url, cache);
}
}
public void queue(ImageView image, String url, boolean cache) {
Iterator it = _queue.iterator();
if (image!=null) {
while (it.hasNext()) {
if (it.next().image.equals(image)) {
it.remove();
break;
}
}
} else if (url!=null) {
while (it.hasNext()) {
if (it.next().url.equals(url)) {
it.remove();
break;
}
}
}
_queue.add(new Group(image, url, null, cache));
loadNext();
}
public void clearQueue() {
_queue = new LinkedList();
}
public void clearCache() {
_urlToBitmap = new HashMap();
}
public void cancel() {
clearQueue();
if ( _thread != null ) {
_thread.disconnect();
_thread = null;
}
}
public void setMissingBitmap(Bitmap bitmap) {
_missing = bitmap;
}
private void loadNext() {
Iterator it = _queue.iterator();
if (!_busy && it.hasNext() ) {
_busy = true;
Group group = it.next();
it.remove();
// double check image availability
if (_urlToBitmap.get(group.url) != null) {
if (group.image!=null) {
group.image.setImageBitmap(_urlToBitmap.get(group.url));
}
_busy = false;
loadNext();
} else {
_thread = new DownloadThread(group);
_thread.start();
}
}
}
private void onLoad() {
if (_thread != null) {
Group group = _thread.group;
if (group.bitmap != null) {
if (group.cache) {
_urlToBitmap.put(group.url, group.bitmap);
}
if (group.image != null) {
group.image.setImageBitmap(group.bitmap);
}
} else if (_missing != null) {
if (group.image != null) {
group.image.setImageBitmap(_missing);
}
}
}
_thread = null;
_busy = false;
loadNext();
}
private class Group {
public Group(ImageView image, String url, Bitmap bitmap, boolean cache) {
this.image = image;
this.url = url;
this.bitmap = bitmap;
this.cache = cache;
}
public ImageView image;
public String url;
public Bitmap bitmap;
public boolean cache;
}
private class DownloadThread extends Thread {
final Handler threadHandler = new Handler();
final Runnable threadCallback = new Runnable() {
public void run() {
onLoad();
}
};
private HttpURLConnection _conn;
public Group group;
public DownloadThread(Group group) {
this.group = group;
}
@Override
public void run() {
InputStream inStream = null;
_conn = null;
try {
_conn = (HttpURLConnection) new URL(group.url).openConnection();
_conn.setDoInput(true);
_conn.connect();
inStream = _conn.getInputStream();
group.bitmap = BitmapFactory.decodeStream(inStream);
inStream.close();
_conn.disconnect();
inStream = null;
_conn = null;
} catch (Exception ex) {
// nothing
}
if (inStream != null) {
try {
inStream.close();
} catch (Exception ex) {}
}
disconnect();
inStream = null;
_conn = null;
threadHandler.post(threadCallback);
}
public void disconnect() {
if (_conn != null) {
_conn.disconnect();
}
}
}
}
" wu-media.com
July 31, 2009
[ImageMagick] Montage, Arrays of Images (contact sheet)
"montage -label '%f' balloon.gif medical.gif logo: present.gif shading.gif \ -tile x1 -shadow -geometry '60x60+2+2>' label_shadow.jpg " imagemagick.org
July 7, 2009
Vista: Register DLLs Elevated Using the Context Menu
"To add the Register command in the context menu that’ll run the Regsvr32.exe command under elevated rights, you need to use the runas verb. Here is a REG file that I created, adds the runas verb for DLL and OCX file types in the following registry keys:
HKEY_CLASSES_ROOT \ Dllfile \ runas
HKEY_CLASSES_ROOT \ Ocxfile \ runas
1. Download the file register_runas.reg and save to Desktop.
2. Right-click on the file and choose Merge.
3. Click Yes when you’re asked for confirmation.
You should now see the Register (as Administrator) command in the right-click menu for DLL and OCX file types.
" winhelponline.com
HKEY_CLASSES_ROOT \ Dllfile \ runas
HKEY_CLASSES_ROOT \ Ocxfile \ runas
1. Download the file register_runas.reg and save to Desktop.
2. Right-click on the file and choose Merge.
3. Click Yes when you’re asked for confirmation.
You should now see the Register (as Administrator) command in the right-click menu for DLL and OCX file types.
" winhelponline.com
June 30, 2009
Remove ugly sound on HTC HERO boot (SuperHero)
You should write in your windows console (do not forget install Android SDK)
Alternatively you can replace boot image and sound
http://forum.xda-developers.com/showthread.php?t=508078
adb remount
adb shell
#cd /system/media
#rm boot.mp3
#reboot
Alternatively you can replace boot image and sound
http://forum.xda-developers.com/showthread.php?t=508078
June 23, 2009
Using a Horizontal Progress Bar in Android
"I was working on my Android downloader application yesterday, when I ran into a bit of a snag. I wanted to display a list of downloads (similar to the Firefox downloads window). Each item in the list should show the file name and a horizontal progress bar. I started to implement this, and several hours later stumbled upon the archaic solution. I wanted to share this, both to help anybody who may be trying to do something similar, and also to illustrate how the lack of good documentation is hurting aspiring Android developers.
I thought that I could put a ProgressBar instance in my xml, set it to be indeterminate, give it a max and a value, and be done. However, it wasn't nearly that easy. After a few hours of hunting on Google and the Android Groups, I stumbled upon the solution in an online preview of The Busy Coder's Guide to Android Development. In short, I had to set the following on my ProgressBar's XML:
WTF?
" http://bytecrafter.blogspot.com/2008/12/using-horizontal-progress-bar-in.html
to get horizontal progressbar just put
into your \res\layout\main.xml
I thought that I could put a ProgressBar instance in my xml, set it to be indeterminate, give it a max and a value, and be done. However, it wasn't nearly that easy. After a few hours of hunting on Google and the Android Groups, I stumbled upon the solution in an online preview of The Busy Coder's Guide to Android Development. In short, I had to set the following on my ProgressBar's XML:
style="?android:attr/progressBarStyleHorizontal"
WTF?
" http://bytecrafter.blogspot.com/2008/12/using-horizontal-progress-bar-in.html
to get horizontal progressbar just put
<ProgressBar
android:id="@+id/ProgressBar01"
android:indeterminateOnly="false"
android:progressDrawable="@android:drawable/progress_horizontal"
android:indeterminateDrawable="@android:drawable/progress_indeterminate_horizontal"
android:minHeight="20dip"
android:maxHeight="20dip" android:layout_width="fill_parent"></ProgressBar>into your \res\layout\main.xml
June 18, 2009
yGuard - Java™ Bytecode Obfuscator and Shrinker
"yGuard is a free Java bytecode obfuscator and shrinker that improves your software deployment by prohibiting unwanted access to your source code and drastically shrinking the processed Jar files at the same time.
Features
* yGuard is absolutely free! Contrary to expensive commercial products of our competitors providing the same amount of features as yGuard or less, yGuard is free.
* yGuard is an Ant task! Existing tools use proprietary mechanisms to invoke or configure the task of obfuscation. As an Ant task, yGuard can be seamlessly integrated into your deployment process using XML syntax.
* yGuard provides highly configurable name obfuscation that will protect your intellectual property from reverse engineering.
* yGuard provides elaborate code shrinking functionality through dependency analysis.
* yGuard 2.0 offers a new powerful and easy to use XML syntax that allows the effortless definition of code entities e.g. based on pattern sets or inheritance.
* yGuard will correctly obfuscate and shrink programs that depend on external libraries.
* yGuard can automatically rename and adjust textual resource files according to the obfuscation scheme.
* yGuard can scramble and unscramble or shrink line number table information. This means that debugging an obfuscated program is still achievable without weakening the obfuscation.
* yGuard can create patches! During each obfuscation run, yGuard produces XML output that can be used to create subsequent patches of already deployed obfuscated applications.
* yGuard supports JDK 1.5 features and correctly obfuscates classes compiled with its new features. " yworks.com
Features
* yGuard is absolutely free! Contrary to expensive commercial products of our competitors providing the same amount of features as yGuard or less, yGuard is free.
* yGuard is an Ant task! Existing tools use proprietary mechanisms to invoke or configure the task of obfuscation. As an Ant task, yGuard can be seamlessly integrated into your deployment process using XML syntax.
* yGuard provides highly configurable name obfuscation that will protect your intellectual property from reverse engineering.
* yGuard provides elaborate code shrinking functionality through dependency analysis.
* yGuard 2.0 offers a new powerful and easy to use XML syntax that allows the effortless definition of code entities e.g. based on pattern sets or inheritance.
* yGuard will correctly obfuscate and shrink programs that depend on external libraries.
* yGuard can automatically rename and adjust textual resource files according to the obfuscation scheme.
* yGuard can scramble and unscramble or shrink line number table information. This means that debugging an obfuscated program is still achievable without weakening the obfuscation.
* yGuard can create patches! During each obfuscation run, yGuard produces XML output that can be used to create subsequent patches of already deployed obfuscated applications.
* yGuard supports JDK 1.5 features and correctly obfuscates classes compiled with its new features. " yworks.com
May 18, 2009
How do I pass parameters to a batch file?
"A. When you call a batch file, you can enter data after the command that the batch file refers to as %1, %2, etc. For example, in the batch file hello.bat, the following command
@echo hello %1 boy
would output
hello john boy
if you called it as
hello john
The following table outlines how you can modify the passed parameter.
Parameter Description
%1 The normal parameter.
%~f1 Expands %1 to a fully qualified pathname. If you passed only a filename from the current directory, this parameter would also expand to the drive or directory.
%~d1 Extracts the drive letter from %1.
%~p1 Extracts the path from %1.
%~n1 Extracts the filename from %1, without the extension.
%~x1 Extracts the file extension from %1.
%~s1 Changes the n and x options’ meanings to reference the short name. You would therefore use %~sn1 for the short filename and %~sx1 for the short extension.
The following table shows how you can combine some of the parameters.
Parameter Description
%~dp1 Expands %1 to a drive letter and path only.
%~sp1 For short path.
%~nx1 Expands %1 to a filename and extension only.
To see all the parameters in action, put them into the batch file testing.bat, as follows.
@echo off
echo fully qualified name %~f1
echo drive %~d1
echo path %~p1
echo filename %~n1
echo file extension %~x1
echo short filename %~sn1
echo short file extension %~sx1
echo drive and directory %~dp1
echo filename and extension %~nx1
Then, run the file with a long filename. For example, the batch file run on the file c:\temp\longfilename.long would produce the following output.
fully qualified name c:\TEMP\longfilename.long
drive c:
path \TEMP\
filename longfilename
file extension .long
short filename LONGFI~1
short file extension .LON
drive and directory c:\TEMP\
filename and extension longfilename.long
This method also works on the second and subsequent parameters. You simply substitute the parameter for 1 (e.g., %~f2 for the second parameter’s fully qualified path name).
The %0 parameter in a batch file holds information about the file when it runs and indicates which command extensions you can use with the file (e.g., %~dp0 gives the batch file’s drive and path)." windowsitpro.com
@echo hello %1 boy
would output
hello john boy
if you called it as
hello john
The following table outlines how you can modify the passed parameter.
Parameter Description
%1 The normal parameter.
%~f1 Expands %1 to a fully qualified pathname. If you passed only a filename from the current directory, this parameter would also expand to the drive or directory.
%~d1 Extracts the drive letter from %1.
%~p1 Extracts the path from %1.
%~n1 Extracts the filename from %1, without the extension.
%~x1 Extracts the file extension from %1.
%~s1 Changes the n and x options’ meanings to reference the short name. You would therefore use %~sn1 for the short filename and %~sx1 for the short extension.
The following table shows how you can combine some of the parameters.
Parameter Description
%~dp1 Expands %1 to a drive letter and path only.
%~sp1 For short path.
%~nx1 Expands %1 to a filename and extension only.
To see all the parameters in action, put them into the batch file testing.bat, as follows.
@echo off
echo fully qualified name %~f1
echo drive %~d1
echo path %~p1
echo filename %~n1
echo file extension %~x1
echo short filename %~sn1
echo short file extension %~sx1
echo drive and directory %~dp1
echo filename and extension %~nx1
Then, run the file with a long filename. For example, the batch file run on the file c:\temp\longfilename.long would produce the following output.
fully qualified name c:\TEMP\longfilename.long
drive c:
path \TEMP\
filename longfilename
file extension .long
short filename LONGFI~1
short file extension .LON
drive and directory c:\TEMP\
filename and extension longfilename.long
This method also works on the second and subsequent parameters. You simply substitute the parameter for 1 (e.g., %~f2 for the second parameter’s fully qualified path name).
The %0 parameter in a batch file holds information about the file when it runs and indicates which command extensions you can use with the file (e.g., %~dp0 gives the batch file’s drive and path)." windowsitpro.com
May 15, 2009
svn:externals
"This assumes that your project layout looks something like this:
project/
branch/
production/
tag/
trunk/
* In the top of your project trunk, execute the following:
svn propedit svn:externals .
* This will open an editor session. In the file opened by your editor, each line indicates a different external svn repo to pull. The first segment of the line is the directory where you want the pull to exist. The last segment is the svn repo URL to pull. You can have an optional middle argument indicating the revision to use. Some examples:
o Pull framework repo from head:
framework http://framework.zend.com/svn/framework/trunk
o Pull framework repo from revision 2616:
framework -r2616 http://framework.zend.com/svn/framework/trunk
* After saving and exiting, update the repo:
svn up
* Commit changes:
svn commit
One thing to note: any directory you specify for an svn:externals checkout should not already exist in your repository. If it does, you will get an error like the following:
svn: Working copy 'sharedproject' locked
svn: run 'svn cleanup' to remove locks
" weierophinney.net
After that add default username for svn host (because we do not have username of external repository)
project/
branch/
production/
tag/
trunk/
* In the top of your project trunk, execute the following:
svn propedit svn:externals .
* This will open an editor session. In the file opened by your editor, each line indicates a different external svn repo to pull. The first segment of the line is the directory where you want the pull to exist. The last segment is the svn repo URL to pull. You can have an optional middle argument indicating the revision to use. Some examples:
o Pull framework repo from head:
framework http://framework.zend.com/svn/framework/trunk
o Pull framework repo from revision 2616:
framework -r2616 http://framework.zend.com/svn/framework/trunk
* After saving and exiting, update the repo:
svn up
* Commit changes:
svn commit
One thing to note: any directory you specify for an svn:externals checkout should not already exist in your repository. If it does, you will get an error like the following:
svn: Working copy 'sharedproject' locked
svn: run 'svn cleanup' to remove locks
" weierophinney.net
After that add default username for svn host (because we do not have username of external repository)
- Linux
vi ~/.ssh/config
Host svn.wn.d-o-m.org
User <svnuser>
- Windows - set default username for <svn-host> via putty
May 6, 2009
I got an error saying "This client is too old to work with working copy '...' ". How can I fix it without upgrading Subversion?
"Sometimes the working copy metadata format changes incompatibly between minor releases. For example, say you have a working copy created with Subversion 1.4.4, but one day you decide to try out Subversion 1.5.0. Afterwards, you attempt to switch back to 1.4.4, but it doesn't work — it just gives the above error.
This is because 1.5.0 upgraded your working copy format to support some new features (in this case, changelists, the keep-local flag, and variable-depth directories). Although 1.4.4 doesn't know anything about these new features, it can at least recognize that the working copy format has been upgraded to something higher than it can handle.
1.5.0 upgraded the working copy for a good reason: it realizes that 1.4.4 does not know about these new features, and that if 1.4.4 were to meddle with the working copy metadata now, important information might be lost, possibly causing corruption (see issue #2961, for example).
But this automatic upgrade behavior can be annoying, if you just want to try out a new release of Subversion without installing it permanently. For this reason, we distribute a script that can downgrade working copies when doing so is safe:
http://svn.collab.net/repos/svn/trunk/tools/client-side/change-svn-wc-format.py
Run that script with the "--help" option to see how to use it. As future versions of Subversion are released, we will try to keep this FAQ entry up-to-date with potential downgrade scenarios and their implications." subversion.tigris.org
This is because 1.5.0 upgraded your working copy format to support some new features (in this case, changelists, the keep-local flag, and variable-depth directories). Although 1.4.4 doesn't know anything about these new features, it can at least recognize that the working copy format has been upgraded to something higher than it can handle.
1.5.0 upgraded the working copy for a good reason: it realizes that 1.4.4 does not know about these new features, and that if 1.4.4 were to meddle with the working copy metadata now, important information might be lost, possibly causing corruption (see issue #2961, for example).
But this automatic upgrade behavior can be annoying, if you just want to try out a new release of Subversion without installing it permanently. For this reason, we distribute a script that can downgrade working copies when doing so is safe:
http://svn.collab.net/repos/svn/trunk/tools/client-side/change-svn-wc-format.py
Run that script with the "--help" option to see how to use it. As future versions of Subversion are released, we will try to keep this FAQ entry up-to-date with potential downgrade scenarios and their implications." subversion.tigris.org
April 27, 2009
HTTP Status Codes
"
see also : RFC2616 HTTP/1.1, RFC2324 HTCPCP/1.0
" status-code.com
- 100 Continue
- 101 Switching Protocols
- 102 Processing
- 200 OK
- 201 Created
- 202 Accepted
- 203 Non-Authoritative Information
- 204 No Content
- 205 Reset Content
- 206 Partial Content
- 207 Multi-Status
- 226 IM Used
- 300 Multiple Choices
- 301 Moved Permanently
- 302 Found
- 303 See Other
- 304 Not Modified
- 305 Use Proxy
- 306 (Unused)
- 307 Temporary Redirect
- 400 Bad Request
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 404 Not Found
- 405 Method Not Allowed
- 406 Not Acceptable
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 411 Length Required
- 412 Precondition Failed
- 413 Request Entity Too Large
- 414 Request-URI Too Long
- 415 Unsupported Media Type
- 416 Requested Range Not Satisfiable
- 417 Expectation Failed
- 418 I'm a teapot
- 422 Unprocessable Entity
- 423 Locked
- 424 Failed Dependency
- 425 (Unordered Collection)
- 426 Upgrade Required
- 500 Internal Server Error
- 501 Not Implemented
- 502 Bad Gateway
- 503 Service Unavailable
- 504 Gateway Timeout
- 505 HTTP Version Not Supported
- 506 Variant Also Negotiates
- 507 Insufficient Storage
- 510 Not Extended
see also : RFC2616 HTTP/1.1, RFC2324 HTCPCP/1.0
" status-code.com
April 23, 2009
WirelessKeyView - Recover lost wireless network key
"WirelessKeyView recovers all wireless network keys/passwords (WEP/WPA) stored in your computer by the 'Wireless Zero Configuration' service of Windows XP and by the 'WLAN AutoConfig' service of Windows Vista. It allows you to easily save all keys to text/html/xml file, or copy a single key to the clipboard.
" nirsoft.net
" nirsoft.net
April 22, 2009
Vi: Undo
"u | Undo the latest change. U | Undo all changes on a line, while not having | moved off it (unfortunately). :q! | Quit vi without writing. :e! | Re-edit a messed-up file." unix.t-a-y-l-o-r.com
April 21, 2009
April 20, 2009
XUL: XUL Explorer
"XUL Explorer is a XULRunner application that provides an easy way to experiment with XUL. It’s a simple editor that can preview XUL inline or in a separate popup window. It has a list of code snippets (small fragments of XUL or JavaScript) that can be quickly inserted into the editor. The XUL can be loaded from and saved to files. A XUL validator and the Error Console are both available to help debug problems. The help menu provides access to XUL information on MDC. There is even simple “keyword” help lookup for XUL elements. " developer.mozilla.org
XUL: Passing arguments and displaying a dialog
"The following code demonstrates how to pass custom arguments to a dialog, process those arguments in the dialog, and return user-modified arguments to the caller. The code to open a dialog named mydialog.xul and pass it arguments:
var params = {inn:{name:"foo", description:"bar", enabled:true}, out:null};
window.openDialog("chrome://myext/content/mydialog.xul", "",
"chrome, dialog, modal, resizable=yes", params).focus();
if (params.out) {
// User clicked ok. Process changed arguments; e.g. write them to disk or whatever
}
else {
// User clicked cancel. Typically, nothing is done here.
}
mydialog.xul:
mydialog.js:
// Called once when the dialog displays
function onLoad() {
// Use the arguments passed to us by the caller
document.getElementById("name").value = window.arguments[0].inn.name;
document.getElementById("description").value = window.arguments[0].inn.description;
document.getElementById("enabled").checked = window.arguments[0].inn.enabled;
}
// Called once if and only if the user clicks OK
function onOK() {
// Return the changed arguments.
// Notice if user clicks cancel, window.arguments[0].out remains null
// because this function is never called
window.arguments[0].out = {name:document.getElementById("name").value,
description:document.getElementById("description").value,
enabled:document.getElementById("enabled").checked};
return true;
}
" developer.mozilla.org
var params = {inn:{name:"foo", description:"bar", enabled:true}, out:null};
window.openDialog("chrome://myext/content/mydialog.xul", "",
"chrome, dialog, modal, resizable=yes", params).focus();
if (params.out) {
// User clicked ok. Process changed arguments; e.g. write them to disk or whatever
}
else {
// User clicked cancel. Typically, nothing is done here.
}
mydialog.xul:
mydialog.js:
// Called once when the dialog displays
function onLoad() {
// Use the arguments passed to us by the caller
document.getElementById("name").value = window.arguments[0].inn.name;
document.getElementById("description").value = window.arguments[0].inn.description;
document.getElementById("enabled").checked = window.arguments[0].inn.enabled;
}
// Called once if and only if the user clicks OK
function onOK() {
// Return the changed arguments.
// Notice if user clicks cancel, window.arguments[0].out remains null
// because this function is never called
window.arguments[0].out = {name:document.getElementById("name").value,
description:document.getElementById("description").value,
enabled:document.getElementById("enabled").checked};
return true;
}
" developer.mozilla.org
April 14, 2009
Open Source Keystroke Launcher
"Launchy is a free windows and linux utility designed to help you forget about your start menu, the icons on your desktop, and even your file manager.
Launchy indexes the programs in your start menu and can launch your documents, project files, folders, and bookmarks with just a few keystrokes!" launchy.net
Launchy indexes the programs in your start menu and can launch your documents, project files, folders, and bookmarks with just a few keystrokes!" launchy.net
April 5, 2009
Apache virtual hosts quick and easy
"Step 1: Creating the index pages
Like already mentioned before, we have to create subdirectory and page index files first. Suse normaly stores the web pages in the following directory:
/srv/www/htdocs
We will use the same directory but will create a subdirectory for every virtual host.
mkdir /srv/www/htdocs/server_port80
mkdir /srv/www/htdocs/server_port8090
mkdir /srv/www/htdocs/server_www
mkdir /srv/www/htdocs/server_www1
You can later store you content in this directories. Let’s just create a single file called index.html that contains a message about the type of the server. An example file could look like this:
Please change the content to your needs and save a modified index file in every subdirectory.
Step 2: Setup IP based virtual host
Suse stores the vhost configuration files in the following directory:
/etc/apache2/vhosts.d
During the start-up process, Apache will automatically use all files located in this directory for the final configuration.
You can easily create new vhost configuration files by using the template like this:
cd /etc/apache2/vhosts.d/
cp vhost.template vhost-port80.conf
This will copy the default template and will create a configuration file that we will later use for our IP-based virtual host running on port 80. I recommend using vi to edit the file. Please open it like this:
vi vhost-port80.conf
As you can see, the file has everything you need to setup a virtual host, but also includes a lot of explanations and comments. To get a slim file please delete it.
Here are the lines you should change for your Apache configuration:
VirtualHost – set IP address and port here
ServerAdmin - your webmaster’s email adress
DocumentRoot – path to your web page contend (see step1)
ErrorLog - path to the error log file
CustomLog - path to the access log file
UseCanonicalName - leave it to off in this case
ScriptAlias – if you like to run cgi scripts on your web page, this is the location.
The file could look like this:
ServerAdmin webmaster@myserver.comThis e-mail address is being protected from spam bots, you need JavaScript enabled to view it
ServerName server.myserver.com
DocumentRoot /srv/www/htdocs/server_port80
ErrorLog /var/log/apache2/server_port80.log
CustomLog /var/log/apache2/access_port80.log combined
HostnameLookups Off
UseCanonicalName Off
ServerSignature On
ScriptAlias /cgi-bin/ "/srv/www/htdocs/server_port80/cgi-bin/"
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
If you like to run you web page on a different port, please use the following configuration file:
ServerAdmin webmaster@myserver.comThis e-mail address is being protected from spam bots, you need JavaScript enabled to view it
ServerName server.myserver.com
DocumentRoot /srv/www/htdocs/server_port8090
ErrorLog /var/log/apache2/server_port8090.log
CustomLog /var/log/apache2/access_port8090.log combined
HostnameLookups Off
UseCanonicalName Off
ServerSignature On
ScriptAlias /cgi-bin/ "/srv/www/htdocs/server_port8090/cgi-bin/"
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
A web server normally listens on port 80. If you like to change this or to add port 8090, you have to hack the listen.conf file. Please see step 4 for more information.
Step 3: Setup a name-based virtual host
Create a new file using the default template similar to step2:
cd /etc/apache2/vhosts.d
cp vhost.template vhost-www.conf
Here are the important hacks you have to make:
ServerName – use name you would like to see in the URL
UseCanonicalName On
Remark:
With UseCanonicalName on Apache will use the ServerName and Port directives to construct the canonical name for the server. This name is used in
all self-referential URLs, and for the values of SERVER_NAME and SERVER_PORT in CGIs.
If you have more IP addresses for your server or if you like to use different ports, please change the following line:
VirtualHost 192.168.33.101:80
The file could look like this:
ServerAdmin webmaster@myserver.comThis e-mail address is being protected from spam bots, you need JavaScript enabled to view it
ServerName www.myserver.com
DocumentRoot /srv/www/htdocs/server_www
ErrorLog /var/log/apache2/server_www.log
CustomLog /var/log/apache2/access_www.log combined
HostnameLookups Off
UseCanonicalName On
ServerSignature On
ScriptAlias /cgi-bin/ "/srv/www/htdocs/server_www/cgi-bin/"
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Step 4: Hack the listen.conf file
The following file allows you to bind Apache to specific IP addresses and/or ports.
Please change the following lines here:
Listen - add the port or ports on which you would like to run you web pages
NameVirtualHost - this directive tells Apache on which IP address and, optionally, which port to listen for requests by clients containing the domain name in the HTTP header. The first argument can be a fully qualified domain name, but it is recommended to use the IP address. The second argument is the port and is optional. By default, port 80 is used and is configured via the Listen directive.
The file could look like this:
Listen 80
Listen 8090
Listen 443
NameVirtualHost 192.168.33.101:80
To trouble shot you configuration, you should run the following command from the linux console:
tail –f /var/log/messages
Please do not forget the restart Apache after changing the configuration using the following commands (watch for errors):
service apache2 restart
or
/etc/init.d/apache2 restart" linux-tip.net
Like already mentioned before, we have to create subdirectory and page index files first. Suse normaly stores the web pages in the following directory:
/srv/www/htdocs
We will use the same directory but will create a subdirectory for every virtual host.
mkdir /srv/www/htdocs/server_port80
mkdir /srv/www/htdocs/server_port8090
mkdir /srv/www/htdocs/server_www
mkdir /srv/www/htdocs/server_www1
You can later store you content in this directories. Let’s just create a single file called index.html that contains a message about the type of the server. An example file could look like this:
This is my webserver working on
Port 80.
Linux-Tip.net
Port 80.
Linux-Tip.net
Please change the content to your needs and save a modified index file in every subdirectory.
Step 2: Setup IP based virtual host
Suse stores the vhost configuration files in the following directory:
/etc/apache2/vhosts.d
During the start-up process, Apache will automatically use all files located in this directory for the final configuration.
You can easily create new vhost configuration files by using the template like this:
cd /etc/apache2/vhosts.d/
cp vhost.template vhost-port80.conf
This will copy the default template and will create a configuration file that we will later use for our IP-based virtual host running on port 80. I recommend using vi to edit the file. Please open it like this:
vi vhost-port80.conf
As you can see, the file has everything you need to setup a virtual host, but also includes a lot of explanations and comments. To get a slim file please delete it.
Here are the lines you should change for your Apache configuration:
VirtualHost – set IP address and port here
ServerAdmin - your webmaster’s email adress
DocumentRoot – path to your web page contend (see step1)
ErrorLog - path to the error log file
CustomLog - path to the access log file
UseCanonicalName - leave it to off in this case
ScriptAlias – if you like to run cgi scripts on your web page, this is the location.
The file could look like this:
ServerAdmin webmaster@myserver.comThis e-mail address is being protected from spam bots, you need JavaScript enabled to view it
ServerName server.myserver.com
DocumentRoot /srv/www/htdocs/server_port80
ErrorLog /var/log/apache2/server_port80.log
CustomLog /var/log/apache2/access_port80.log combined
HostnameLookups Off
UseCanonicalName Off
ServerSignature On
ScriptAlias /cgi-bin/ "/srv/www/htdocs/server_port80/cgi-bin/"
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
If you like to run you web page on a different port, please use the following configuration file:
ServerAdmin webmaster@myserver.comThis e-mail address is being protected from spam bots, you need JavaScript enabled to view it
ServerName server.myserver.com
DocumentRoot /srv/www/htdocs/server_port8090
ErrorLog /var/log/apache2/server_port8090.log
CustomLog /var/log/apache2/access_port8090.log combined
HostnameLookups Off
UseCanonicalName Off
ServerSignature On
ScriptAlias /cgi-bin/ "/srv/www/htdocs/server_port8090/cgi-bin/"
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
A web server normally listens on port 80. If you like to change this or to add port 8090, you have to hack the listen.conf file. Please see step 4 for more information.
Step 3: Setup a name-based virtual host
Create a new file using the default template similar to step2:
cd /etc/apache2/vhosts.d
cp vhost.template vhost-www.conf
Here are the important hacks you have to make:
ServerName – use name you would like to see in the URL
UseCanonicalName On
Remark:
With UseCanonicalName on Apache will use the ServerName and Port directives to construct the canonical name for the server. This name is used in
all self-referential URLs, and for the values of SERVER_NAME and SERVER_PORT in CGIs.
If you have more IP addresses for your server or if you like to use different ports, please change the following line:
VirtualHost 192.168.33.101:80
The file could look like this:
ServerAdmin webmaster@myserver.comThis e-mail address is being protected from spam bots, you need JavaScript enabled to view it
ServerName www.myserver.com
DocumentRoot /srv/www/htdocs/server_www
ErrorLog /var/log/apache2/server_www.log
CustomLog /var/log/apache2/access_www.log combined
HostnameLookups Off
UseCanonicalName On
ServerSignature On
ScriptAlias /cgi-bin/ "/srv/www/htdocs/server_www/cgi-bin/"
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Step 4: Hack the listen.conf file
The following file allows you to bind Apache to specific IP addresses and/or ports.
Please change the following lines here:
Listen - add the port or ports on which you would like to run you web pages
NameVirtualHost - this directive tells Apache on which IP address and, optionally, which port to listen for requests by clients containing the domain name in the HTTP header. The first argument can be a fully qualified domain name, but it is recommended to use the IP address. The second argument is the port and is optional. By default, port 80 is used and is configured via the Listen directive.
The file could look like this:
Listen 80
Listen 8090
Listen 443
NameVirtualHost 192.168.33.101:80
To trouble shot you configuration, you should run the following command from the linux console:
tail –f /var/log/messages
Please do not forget the restart Apache after changing the configuration using the following commands (watch for errors):
service apache2 restart
or
/etc/init.d/apache2 restart" linux-tip.net
Subscribe to:
Posts (Atom)