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

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)

  • 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

April 27, 2009

HTTP Status Codes

"

  • 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

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 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

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

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:










This is my webserver working on
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

April 2, 2009

Nagios - A Extensible Host and Service Monitoring

"7. Apache Security Preparation

Nagios has by default the authentication for the web interface activated.

That means after Nagios has been started and you try to access the web interface a login windows appears. Nagios has already a default user defined in the contacts.cfg (user: nagiosadmin) so we just have to create a apache password file where we store the password for it.

Do this with the following command and set the password to nagios:

# htpasswd2 -c /opt/nagios/etc/htpasswd.users nagiosadmin
Password: nagios

NOTE: LDAP can also be used for user authentication and requires just a view changes to the apache configuration. But the users still have to be defined in the contacts.cfg. LDAP is used just for verifying the password. I will cover this later.

NOTE: If you do not like to define every user in the contacts.cfg and security is not the case for you, you can modify the cgi.cfg and change all "authorized_for..." parameters to "authorized_for...=*". That will give all user that authenticate to the web server (or LDAP) all permissions even they do not exist in the contacts.cfg. After ny modification to the cgi.cfg restart Nagios.
8. Apache and Nagios Startup

So now all configurations are done and we can startup the applications.

During the Nagios installation an apache config file (nagios.conf) was placed in /etc/apache2/conf.d. So we first have to restart apache to activate that configuration.

# rcapache2 restart

After that we can start Nagios for the first time. In earlier version it was always a very good idea to do a configuration verify before restarting. Otherwise Nagios could be interrupted if there were errors in. In this new version now Nagios does this automatically when it is started or reloaded. If configuration errors were found the restart / reload operation is aborted and you get a information where the error is. Correct it and retry the operation.

As we use the default configuration and we made no mistakes Nagios should start up:

# /etc/init.d/nagios start

If you would like, add Nagios for automatic startup at system boot time:

# insserv nagios

9. Nagios Test

Now Nagios should be available at the following URL: http:///nagios

As you do have the authentication settings modified you should get an authentication window where you have to enter the user nagiosadmin with password nagios." novell.com

March 26, 2009

How to create a self-signed SSL Certificate

"Overview

The following is an extremely simplified view of how SSL is implemented and what part the certificate plays in the entire process.

Normal web traffic is sent unencrypted over the Internet. That is, anyone with access to the right tools can snoop all of that traffic. Obviously, this can lead to problems, especially where security and privacy is necessary, such as in credit card data and bank transactions. The Secure Socket Layer is used to encrypt the data stream between the web server and the web client (the browser).

SSL makes use of what is known as asymmetric cryptography, commonly referred to as public key cryptography (PKI). With public key cryptography, two keys are created, one public, one private. Anything encrypted with either key can only be decrypted with its corresponding key. Thus if a message or data stream were encrypted with the server's private key, it can be decrypted only using its corresponding public key, ensuring that the data only could have come from the server.

If SSL utilizes public key cryptography to encrypt the data stream traveling over the Internet, why is a certificate necessary? The technical answer to that question is that a certificate is not really necessary - the data is secure and cannot easily be decrypted by a third party. However, certificates do serve a crucial role in the communication process. The certificate, signed by a trusted Certificate Authority (CA), ensures that the certificate holder is really who he claims to be. Without a trusted signed certificate, your data may be encrypted, however, the party you are communicating with may not be whom you think. Without certificates, impersonation attacks would be much more common.

Step 1: Generate a Private Key

The openssl toolkit is used to generate an RSA Private Key and CSR (Certificate Signing Request). It can also be used to generate self-signed certificates which can be used for testing purposes or internal usage.

The first step is to create your RSA Private Key. This key is a 1024 bit RSA key which is encrypted using Triple-DES and stored in a PEM format so that it is readable as ASCII text.

openssl genrsa -des3 -out server.key 1024

Generating RSA private key, 1024 bit long modulus
.........................................................++++++
........++++++
e is 65537 (0x10001)
Enter PEM pass phrase:
Verifying password - Enter PEM pass phrase:

Step 2: Generate a CSR (Certificate Signing Request)

Once the private key is generated a Certificate Signing Request can be generated. The CSR is then used in one of two ways. Ideally, the CSR will be sent to a Certificate Authority, such as Thawte or Verisign who will verify the identity of the requestor and issue a signed certificate. The second option is to self-sign the CSR, which will be demonstrated in the next section.

During the generation of the CSR, you will be prompted for several pieces of information. These are the X.509 attributes of the certificate. One of the prompts will be for "Common Name (e.g., YOUR name)". It is important that this field be filled in with the fully qualified domain name of the server to be protected by SSL. If the website to be protected will be https://public.akadia.com, then enter public.akadia.com at this prompt. The command to generate the CSR is as follows:

openssl req -new -key server.key -out server.csr

Country Name (2 letter code) [GB]:US
State or Province Name (full name) [Berkshire]:New Jersey
Locality Name (eg, city) [Newbury]:EastOrange
Organization Name (eg, company) [My Company Ltd]:Mycompany
Organizational Unit Name (eg, section) []:IT
Common Name (eg, your name or your server's hostname) []:Mycompany.com
Email Address []:Jack@Mycompany.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

Step 3: Remove Passphrase from Key

One unfortunate side-effect of the pass-phrased private key is that Apache will ask for the pass-phrase each time the web server is started. Obviously this is not necessarily convenient as someone will not always be around to type in the pass-phrase, such as after a reboot or crash. mod_ssl includes the ability to use an external program in place of the built-in pass-phrase dialog, however, this is not necessarily the most secure option either. It is possible to remove the Triple-DES encryption from the key, thereby no longer needing to type in a pass-phrase. If the private key is no longer encrypted, it is critical that this file only be readable by the root user! If your system is ever compromised and a third party obtains your unencrypted private key, the corresponding certificate will need to be revoked. With that being said, use the following command to remove the pass-phrase from the key:

cp server.key server.key.org
openssl rsa -in server.key.org -out server.key

The newly created server.key file has no more passphrase in it.

-rw-r--r-- 1 root root 745 Jun 29 12:19 server.csr
-rw-r--r-- 1 root root 891 Jun 29 13:22 server.key
-rw-r--r-- 1 root root 963 Jun 29 13:22 server.key.org

Step 4: Generating a Self-Signed Certificate

At this point you will need to generate a self-signed certificate because you either don't plan on having your certificate signed by a CA, or you wish to test your new SSL implementation while the CA is signing your certificate. This temporary certificate will generate an error in the client browser to the effect that the signing certificate authority is unknown and not trusted.

To generate a temporary certificate which is good for 365 days, issue the following command:

openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Signature ok
subject=/C=US/ST=NewJersey/L=EastOrange/O=Mycompany Group/OU=IT/CN=Mycompanygroup/emailAddress=Jack@Mycompany.com

Getting Private key

Step 5: Installing the Private Key and Certificate

When Apache with mod_ssl is installed, it creates several directories in the Apache config directory. The location of this directory will differ depending on how Apache was compiled.

chmod 755 /etc/httpd/conf/ssl.crt/server.crt
mv /etc/httpd/conf/ssl.crt/server.crt /etc/httpd/conf/ssl.crt/server1.crt
cp server.crt /etc/httpd/conf/ssl.crt/server.crt
chmod 600 /etc/httpd/conf/ssl.crt/server1.crt
chmod 600 /etc/httpd/conf/ssl.crt/server.crt

chmod 755 /etc/httpd/conf/ssl.key/server.key
mv /etc/httpd/conf/ssl.key/server.key /etc/httpd/conf/ssl.key/server1.key
cp server.key /etc/httpd/conf/ssl.key/server.key
chmod 600 /etc/httpd/conf/ssl.key/server1.key
chmod 600 /etc/httpd/conf/ssl.key/server.key

Step 6: Configuring SSL Enabled Virtual Hosts

SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
CustomLog logs/ssl_request_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

Step 7: Restart Apache and Test

/etc/init.d/httpd stop
/etc/init.d/httpd start" dibaliklayar.blogspot.com

March 20, 2009

InnoSetup - exclude files

"Specifies a list of patterns to exclude, separated by commas. This parameter cannot be combined with the external flag.

Patterns may include wildcard characters ("*" and "?"). Note that unlike the Source parameter, a simple Unix-style pattern matching routine is used for Excludes. Dots in the pattern are always significant, thus "*.*" will not exclude a file with no extension (instead, use just "*"). Also, question marks always match exactly one character, thus "?????" will not exclude files with names less than five characters long.

If a pattern starts with a backslash ("") it is matched against the start of a path name, otherwise it is matched against the end of a path name. Thus "foo" will only exclude a file named "foo" at the base of the tree. On the other hand, "foo" will exclude any file named "foo" anywhere in the tree.

The patterns may include backslashes. "foobar" will exclude both "foobar" and "subdirfoobar". "foobar" will only exclude "foobar".
Examples:

Source: "*"; Excludes: "*.~*"
Source: "*"; Excludes: "*.~*,Temp*"; Flags: recursesubdirs
" downloadatoz.com

March 19, 2009

HOWTO: Automatically get svn revisions number under windows

"The example below shows how keywords in a template file are substituted in the output file.

// Test file for SubWCRev: testfile.tmpl

char *Revision = "$WCREV$";
char *Modified = "$WCMODS?Modified:Not modified$";
char *Date = "$WCDATE$";
char *Range = "$WCRANGE$";
char *Mixed = "$WCMIXED?Mixed revision WC:Not mixed$";
char *URL = "$WCURL$";

#if $WCMODS?1:0$
#error Source is modified
#endif

// End of file

After running SubWCRev.exe path\to\workingcopy testfile.tmpl testfile.txt, the output file testfile.txt would looks like this:

// Test file for SubWCRev: testfile.txt

char *Revision = "3701";
char *Modified = "Modified";
char *Date = "2005/06/15 11:15:12";
char *Range = "3699:3701";
char *Mixed = "Mixed revision WC";
char *URL = "http://tortoisesvn.tigris.org/svn/tortoisesvn/...
trunk/src/SubWCRev";

#if 1
#error Source is modified
#endif

// End of file
" tortoisesvn.net

Reloading profile - how to reload Unix profile

"Use the following command to reload a unix profile (/etc/profile, ~/.profile, ~/.bash_profile ...):
$ . ~/.profile
$ . /etc/profile

Notice: . (dot) is a command that originates from source command. On some unix flavours (FreeBSD 6 for example) source command works still:
$ source ~/.profile
$ source /etc/profile


.profile settings overwrite those in /etc/profile. You can also use .bash_profile in your home directory to customize your bash shell's profile.

Basically, if you need to load shell variables from any file just run the . (dot) command, followed by space and (the absolute path is necessary) the path to the file. (Be carefull what file you're loading variables from because you meight overwrite some important environment variables and your system could become unstable). " ivorde.ro

March 18, 2009

WORKED: Automated APPS to SD (EASY!!!!)

"1. Must have a rooted phone
2. Must have two partitions on the sd card (fat32 for everything, and ext2 for "expanding" the phone's memory).
3. Must have Android SDK installed (so that adb will work)

Ok.. So I got sick of all the commands running back and forth. I found that I'm wiping my phone several times testing out new things and didn't want to continuously put in all these commands to get the apps to sd thing to work.

Therefore, I created a file to automatically do it for me!!! I just run this file with the usb connected to the phone, and let it run all the commands.

I've attached a file "tmp.zip". Download this file and extract it to your c:

The folder it extracts NEEDS to be at c:/tmp

After extracting, navigate to the folder and double click on "appsToSD1.bat". Follow the instructions and you'll be on your way.
" forum.xda-developers.com

It worked for me.... ...but Im not sure if ext2 patitioon should be primary
http://forum.xda-developers.com/show...58#post3483058

...I made it primary and it worked...

$ df
/dev: 49520K total, 0K used, 49520K available (block size 4096)
/sqlite_stmt_journals: 4096K total, 0K used, 4096K available (block size 4096)
/system: 69120K total, 66180K used, 2940K available (block size 4096)
/system/modules: 1532K total, 1532K used, 0K available (block size 4096)
/system/xbin: 3172K total, 3172K used, 0K available (block size 4096)
/system/sd: 1033712K total, 5116K used, 1028596K available (block size 4096)
/data: 76544K total, 21760K used, 54784K available (block size 4096)
/cache: 69120K total, 1160K used, 67960K available (block size 4096)
/sdcard: 6172916K total, 588568K used, 5584348K available (block size 4096)

sdcard - 6GB
sd - 1GB

$ mount
rootfs on / type rootfs (ro)
tmpfs on /dev type tmpfs (rw,mode=755)
devpts on /dev/pts type devpts (rw,mode=600)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /sqlite_stmt_journals type tmpfs (rw,size=4096k)
/dev/block/mtdblock3 on /system type yaffs2 (ro)
/dev/block/loop0 on /system/modules type cramfs (ro)
/dev/block/loop1 on /system/xbin type cramfs (ro)
/dev/mmcblk0p2 on /system/sd type ext2 (rw,noatime,nodiratime,errors=continue)
/dev/block/mtdblock5 on /data type yaffs2 (rw,nosuid,nodev)
/dev/block/mtdblock4 on /cache type yaffs2 (rw,nosuid,nodev)
/dev/block/mmcblk0p1 on /sdcard type vfat (rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1000, fmask=0711,dmask=0700,codepage=cp437,iocharset=iso 8859-1,utf8)

$ cd /data
$ ls -al
ls: can't open '.': Permission denied
$ su
# ls -al
drwxrwx--x 1 1000 1000 2048 Oct 5 07:41 .
drwxr-xr-x 12 0 0 0 Mar 18 17:31 ..
drwxrwxrwx 1 1000 1000 2048 Oct 5 07:41 anr
lrwxrwxrwx 1 0 0 14 Mar 18 17:30 app -> /system/sd/app
lrwxrwxrwx 1 0 0 22 Mar 18 17:30 app-private -> /system/sd/app-private
drwxrwx--x 1 1000 1000 2048 Oct 5 07:41 dalvik-cache
drwxrwx--x 1 1000 1000 2048 Oct 5 07:41 data
drwxrwx--x 1 2000 2000 2048 Oct 5 07:41 local
drwxrwx--- 1 0 0 2048 Oct 5 07:41 lost+found
drwxrwx--t 1 1000 9998 2048 Oct 5 07:41 misc
drwx------ 1 0 0 2048 Oct 5 07:41 property
drwxrwxr-x 1 1000 1000 2048 Oct 5 07:41 system
drwxr-xr-x 1 1000 1000 2048 Mar 15 12:15 tombstones
#

Launchy: The 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

March 16, 2009

How To Install Firebug In Browsers Other Than Firefox

"Firebug Lite makes it possible to put Firebug into any web browser! You should be able to use it with Internet Explorer, Opera, Safari, Chrome, and any other browser that supports JavaScript. Firebug Lite is written in JavaScript, so you can include it on a webpage with the following code:



Or even better you can use this bookmarklet:

Firebug Lite" makeuseof.com

Firefox: Tab Scope

"Shows a popup on tabs and enables you to preview and navigate tab contents through popup. Major features are:

* Real-time preview of tab contents
* Navigate (Back/Forward/Reload/Stop) through popup
* Scroll pages or frames in preview with mouse wheel
* Click links or buttons directly in preview" addons.mozilla.org