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.