Monday, July 26, 2010

Android System properties

Reference:
http://android-er.blogspot.com/2009/09/read-android-system-info-using.html
http://android-er.blogspot.com/2009/09/read-android-cpu-info.html
http://android-er.blogspot.com/2009/09/read-android-os-version.html
http://d.hatena.ne.jp/Kazzz/20100113/p1

http://strazzere.com/blog/?p=116
http://www.androidsoftwaredeveloper.com/2009/04/02/how-to-get-the-phone-imei/

Monday, July 5, 2010

Unix mail commands

Extracted from: http://www.cyberciti.biz/faq/linux-send-email-from-console/

To send an email from console you need to use mail command, which is an intelligent mail processing system which has a command syntax reminiscent of ed with lines replaced by messages. To send an email to somewhere@domain.com you need to type following command:

$ mail somewhere@domain.comOutput:

Subject: Hello
Hai,

How are you? Hope so you are fine :)

Take care

Babai

Vivek
.
Cc:

You need to type . (dot) to send an email. To send contains of file (such as /tmp/message) as mail body then use following command:
$ mail -s 'Hai' somewhere@domain.com < /tmp/messagePlease note that above command will NOT route an email if you do not have properly configured MTA/mail server.


*** Read mail ***
>>mail -f /var/spool/mail/ e.g., mail -f /var/spool/mail/root //root email
>>mbox //list all mails


Reference: http://www.computerhope.com/unix/umail.htm

Forward root email to external email

Extracted from: http://dettox.blogspot.com/2008/01/automatic-forward-to-another-email.html

Root account
editing the file /etc/aliases we can add an email alias for every account on the server

...
ftp-adm: ftp
ftp-admin: ftp
www: webmaster
webmaster: root
noc: root
security: root
hostmaster: root
info: postmaster
marketing: postmaster
sales: postmaster
support: postmaster
# Person who should get root's mail
root: root
...

so in this case we can write:

...
root: root, example@domain.com
...

running the command newaliases the change will take effect:

[root@localhost ~]# newaliases
/etc/aliases: 77 aliases, longest 22 bytes, 791 bytes total
[root@localhost ~]#

every mail to root@localhost will be forwarded to example@domain.com leaving a copy on the server.

User account

to forward user address without root privileges, just create the file .forward in the home directory with inside the name of the mail address:

[dettox@localhost ~]$ pwd
/home/dettox
[dettox@localhost ~]$ echo "example@domain.com" > .forward
[dettox@localhost ~]$ chmod 644 .forward
[dettox@localhost ~]$

every mail to dettox@localhost will be forwarded to example@domain.com without leaving a copy on the server.

Wednesday, June 30, 2010

Android Eclipse ADT

FAQ

Q: 'Gen' Folder missing. Set build path
A: Set the following
Project > Properties > Java Compiler > JDK Compliance > Compiler compliance level: 1.6

Q: Installation and uninstallation of Android application
A:

1. Start emulator and wait for bootup completion
C:\android-sdk-windows\tools\emulator.exe -avd1.5

2. Install application
C:\android-sdk-windows\tools\adb install F:\Projects\Citibank\CitiE2E_Android\library_export\CitiE2ETest.apk

3. Uninstall application
i) adb shell
ii) ls //Show all package installed.
iii) rm

Tuesday, June 1, 2010

How to setup a Mobile Browser Emulator in Windows Mobile 6

http://www.lancelhoff.com/how-to-emulate-windows-mobile-6/

Tuesday, May 25, 2010

c\c++ compiler w. netbeans

references:

http://cygwin.com/
http://royalexander.wordpress.com/2009/03/20/configuring-cygwin-cc-compiler-for-netbeans-65-under-windows/
http://netbeans.org/community/releases/68/cpp-setup-instructions.html
http://netbeans.org/kb/trails/cnd.html

Thursday, April 15, 2010

Signed Applet to Javascript

String lineSeparator = java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction(){
public String run() {return System.getProperty("line.separator");}});



http://www.raditha.com/java/sandbox/unsigned.php
http://stackoverflow.com/questions/852453/accesscontroller-doprivileged
http://chriswongdevblog.blogspot.com/2009/08/invisible-applet.html
http://forums.sun.com/thread.jspa?threadID=5434324
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4406607
http://forums.devshed.com/java-help-9/saving-file-into-local-disc-using-applet-613357.html
http://lwjgl.org/forum/index.php?action=printpage;topic=3186.0
http://stackoverflow.com/questions/1068271/signed-applet-gives-accesscontrolexception-access-denied-when-calling-from-java
http://www.snowbound.com/tech_tips/g_security_applet_java.html
http://java.sun.com/j2se/1.4.2/docs/api/java/security/AccessController.html

Wednesday, January 20, 2010

RPM commands

Some common rpm commands

1. Install
rpm -i

2. Remove
rpm -e

3. List all installed packages
rpm -qa[ i ]

Monday, January 18, 2010

Installing default EJBCA on Fedora 10

Installation packages
- jdk 1.5
- ejbca 3.9.2
- JBOSS 5.1
- Ant 1.7.1 >= 1.6.5
- install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 5.0 http://java.sun.com/j2se/1.5.0/download.jsp

-----------------------------------------------------------------------------------

1) Install the following packages:

yum install ant-nodeps
yum install xdoclet
yum install xjavadoc //optional

2) install sun java 1.5 and Unlimited strength policy(readme.txt in zip).
3) unzip jboss 1.5 and ejbca to required folder.
4) Add the following lines to /etc/profile

# User specific aliases and functions
# The following are the environment variables for Java and JBOSS

export JAVA_HOME=/usr/java/jdk1.5.0_22
export PATH=$PATH:$JAVA_HOME/bin

export JBOSS_HOME=/opt/jboss-5.1.0.GA
export PATH=$PATH:$JBOSS_HOME/bin

export APPSRV_HOME=$JBOSS_HOME
export ANT_OPTS=-Xmx512m

export EJBCA_HOME=ejbca_3_9_2

5) In $APPSRV_HOME/bin/run.conf, edit the following:
JAVA_OPTS="-server -Xms128m -Xmx512m" //Optional

6) JBoss 5.x have a bug causing issues with the BC JCE provider. To work around this you can copy the files EJBCA_HOME/lib/bc*.jar to JBOSS_HOME/server/default/lib/.
cp -s EJBCA_HOME/lib/bc*.jar JBOSS_HOME/server/default/lib/.

7) $EJBCA_HOME/ant bootstrap //Compile, jar, war, ear everything and deploy it to JBoss.

8) Start JBOSS
$APPSRV_HOME/bin/./run.sh -b 0.0.0.0 //bind(b) allow access via ip address instead of localhost only.
JBoss should deploy the ear without errors.

9) $EJBCA_HOME/ant install //generate all certificates, keys, etc
admin keys will be stored in ${ejbca.home}/p12
Adds data to jboss/server/default/data/hypersonic database
*Only run once.
tomcat.jks is for the servlet container (don't bother with it)
truststore.jks is for the servlet container (don't bother with it)
superadmin.p12 should be imported in your browser, that's your administration certificate.

10) Stop JBoss

11) $EJBCA_HOME/ant deploy
deploy everything again and configure the servlet container with the keystore file(HTTPS) (this is why we needed to stop the container).

12) Import the certificate from $EJBCA_HOME/p12/superadmin.p12 into the browser. This is for administration access.
Default password for superadmin.p12: ejbca //configured in ejbca.properties

13) Start JBoss
https://:8443/ejbca //admin-GUI *superadmin.p12 provide the admin login.
http://localhost:8080/ejbca //public page w/o administration

*To add recognised CA signed SSL
$ant -Dca.name="My CA Name" javatruststore
- adds the CA certificate to p12/truststore.jks
- copies this 'truststore.jks' to $JBOSS_HOME/server/default/conf/keystore
- Stop and start tomcat

------------------------------------------------------------------------------------
Tips:
version of EJBCA - $EJBCA_HOME/ant ejbcaversion

EJB CA properties - conf/ejbca.properties
Database properties - conf/database.properties

Files deployed
- ant bootstrap
- deploy/ejbca-ds.xml
- deploy/ejbca-mail-service.xml
- deploy/ejbca.ear

- ant deploy
- Files from ant bootstrap
- conf/keystore/keystore.jk
- conf/keystore/truststore.jks
- deploy/jboss-web.deployer/server.xml

------------------------------------------------------------------------------------
Reference
http://www.ejbca.org/installation.html