Starting JBoss with remote access enabled

>run.sh -b 0.0.0.0

Mysql : Writing query results to a file

To write results to a file in the server.
> select * from foo into outfile ‘results.txt’
To write into a csv file
> select * from foo into outfile ‘results.csv’ fields terminated by ‘,’

To write results to a file a client system
> mysql -e “select * from mydb.foo” > results.txt

installing jwspd in debian, error with tail

There is an error the comes up due to the incorrect use of tail. A fix is available here.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6392008&submit=View+Bug

Setting up svn system

Here are some quick commands

Creating a repository

>svnadmin create [path to repo]

Eg :
>svnadmin create /usr/local/svn/myrepo

svnadmin is a server side command. So we have to give paths here and not url

Importing files to repository

Used to import files to the repository mostly at the initial setup.

>svn import [dir name] [repo url] -m ”Message”

It is necessary to physically copy files to the server before importing it.

Eg:
> svn import myproj file:///usr/local/syn/myrepo -m “Initial Import”

Checking out files from repositories

>svn checkout [repo url]

Eg : >svn checkout svn://svnhost.example.com/myrepo

Committing files to repository

This will push the updated local files to repository and will be made available to other team members.

>svn commit [reponame] -m “Message”

Eg: >svn commit myrepo -m “JSP Files Update”

Updating files from repository

This will pull the files newly updated by others in the team to your local working directory.

>svn update [repo name]

Eg: svn update myrepo

Setting up user/password for a repository

Edit file svnserve.conf in repositories conf directory. Uncomment these lines
# password-db = passwd
# realm = My First Repository

Then edit passwd file.

Running simple svn server

The easiest option is to run it as a standalone server. The default port it connects is 3690
>svnserve -d -r[path of repo]

Eg :
>svnserve -d -r /usr/local/repos

Then it can be accessed remotely like
>svn checkout svn://host.exmple.com/myrepo

Hosting multiple repositories

I have a folder named svnrepos in which I create all the repositories say abc and xyz. Now when I start the svnrepos with svserve like
> svnserve -d -r [path]/svnrepos
all the repositories get started. They can be accessed like
> svn list svn://[host name]/abc

Some random problems :

After setting up svn i was able to checkout the files and work on them. But when i try to commit it would say ‘connection is read only‘. I had to edit svnserve.conf file in the conf directory of the repository. I uncommented password-db=passwd line and realm=xyz line though the latter step may not be necessary. Then I added a passwd file to the conf directory with the following contents.
[users]
myname=mypassword

But then it says ‘section header expected‘. So I also uncomment [general] line from svnserve.conf and it works fine.

Regular Expressions

Regular Expressions can come very handy while dealing with text search. Here is a quick start tutorial for that.

http://www.regular-expressions.info/quickstart.html

And here is the complete tutorial

http://www.regular-expressions.info/tutorial.html

Verifying the integrity of downloaded software with key

Here is how to do it.

http://blogs.ittoolbox.com/eai/software/archives/verifying-integrity-of-the-open-source-software-3151

Managing Certificates with keytool

When ssl connections are present to a web service, we need to install the certificates before connecting to them. It will usually say something like ‘unable to find valid certification path to requested target’. To fix this

  1. Download the certificate using the browser.
  2. Install the certificate using keytool

Downloading the certificate :

Try to connect to the url using browser. It will show a lock button near the address bar and we will be able to download from that. In case of test certificates there could be some problems. I had to use an old ie browser to download a test certificate as the newer versions refused to do it.

Here are instructions for exporting and importing certificates

http://docdb.fnal.gov/ILC-public/DocDB/DocDBInstructions?set=import

Installing certificates :

The command for installing the certificate is

> keytool -import -alias <alias> -keystore <keystore> -file <cert file name>

Eg:

> keytool -import -alias mycert -keystore c:\jdk1.4\jre\lib\security\cacerts -file abc.cer

It will ask for password. ‘changeit’ is the default password. To check if the certificate is added or list the certificates installed in a keystore, use this command.

> keytool -list -keystore <keystore>

The keystore file to add the certificate is usually cacerts. There may be more than cacerts in java installation. In my system there were two cacerts,one in $JAVA_HOME/jre/lib/security and another in $JAVA_HOME/jre/javaws directory. While standalone programs were loading the former, tomcat server was loading the latter. In that case certificate has to be added to both files.

If there is more than one instance of java installed in your system, it can get more interesting. Make sure that you run with the same version of java you had installed the certificates to.

Here is more information about using keytool.

http://java.sun.com/j2se/1.3/docs/tooldocs/win32/keytool.html

Installing PFX (pkcs12 format) Files.

This can not be done with keytool. We will need pkcs12import tool. This comes with JWSDP package from sun. Install JWSDP first and then follow instructions here.

http://java.sun.com/webservices/docs/1.5/tutorial/doc/XWS-Security8.html

Linux command to find version

This will give kernel version
> uname -a

This will give the linux flavor and version
> cat /etc/issue

The following could also give some info
> cat /proc/version

Configuring wireless in linux

Screw the gui tools and try these commands…. :)

>iwlist scanning

The wireless scans for networks and returns information of these networks. It requires sudo in ubuntu.

>cat /etc/network/interfaces

interfaces file has configuration of the network interfaces

>ifconfig

Used to configure kernel-resident network interfaces. It displays currently active interfaces. With -a it shows all interfaces even inactive ones.

>ifconfig <device> down

Brings down the devicd

>ifconfig <device> up

Brings up an interface

> iwconfig

Like ifconfig but used to configure wireless interfaces only

Links :

http://www.linuxquestions.org/questions/linux-laptop-and-handheld-25/wireless-not-working-ubuntu-gutsy-7.10-597188/

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch13_:_Linux_Wireless_Networking

Tableless web layout

On Wikipedia

http://en.wikipedia.org/wiki/Tableless_web_design

How To
http://www.w3.org/2002/03/csslayout-howto.html.en

Inspiration

http://www.csszengarden.com/

Tutorials

http://www.htmldog.com/