NotesApp Android

December 29, 2013 Leave a comment

Since it’s the Christmas time & folks are having a hard time keeping a tab on the gifts inventory and the associated notes around the same, thought of venturing into the Android world by creating a NotesApp which does the following:

  • The NotesApp stores the notes in the Android Internal storage as well as SQLLite database.
  • Once the app loads, it loads the saved notes in the textView as well as the list of notes previously saved in the SQLLite database.
  • There are three buttons for saving, deleting (earliest one) the notes in the database, saving the notes in the internal storage.

Github: NotesApp

If anyone would like to collaborate on taking this to a level where it could be released on Google Play, have few ideas around the same.

sshot2

Categories: Android, Java

Graceful Apache Server reboot from shell

November 28, 2013 1 comment

The command to gracefully restart apache2 web server under Red Hat | CentOS | RHEL | Fedora Linux as a root user is:


apachectl -k graceful

In order to view logs command under CentOS | RHEL:
tail -f /var/log/httpd/error_log
For Debian | Ubuntu Linux:
tail -f /var/log/apache2/error.log

Output:

[Sun Nov 24 04:02:02 2013] [notice] Digest: done
[Sun Nov 24 04:02:02 2013] [notice] Apache/2.2.3 (CentOS) configured — resuming normal operations
[Wed Nov 27 18:44:48 2013] [notice] Graceful restart requested, doing restart
[Wed Nov 27 18:44:48 2013] [notice] Digest: generating secret for digest authentication …
[Wed Nov 27 18:44:48 2013] [notice] Digest: done
[Wed Nov 27 18:44:48 2013] [notice] Apache/2.2.3 (CentOS) configured — resuming normal operations
[Wed Nov 27 18:52:57 2013] [notice] Graceful restart requested, doing restart
[Wed Nov 27 18:52:57 2013] [notice] Digest: generating secret for digest authentication …
[Wed Nov 27 18:52:57 2013] [notice] Digest: done
[Wed Nov 27 18:52:57 2013] [notice] Apache/2.2.3 (CentOS) configured — resuming normal operations

Categories: System Administration Tags:

Booting Solaris from System Console

November 17, 2013 Leave a comment

System Controller displays the results of boot diagnostics and initialization.
System Console, one per computer, is a means to interact with the lower-level of the system that affect the firmware and alter the system behavior.
From System Controller, one can reach the System console by the ALOM system controller break and command pair.
From the System Console ok prompt, one can issue the boot command to boot the operating system. One can also pick a disk to boot from by issuing show-disks at the ok prompt followed by appending the target to the disk path.

ok show-disks
a) /pci@0/pci@0/pci@2/scsi@0/disk0
b) /pci@0/pci@0/pci@1/pci@0/pci@1/pci@0/usb@0,2/storage@2/disk
q) NO SELECTION Enter Selection, q to quit: q
ok

ok boot disk0
ok boot disk0

Boot device: /pci@0/pci@0/pci@2/scsi@0/disk@0 File and args:
SunOS Release 5.10 Version Generic_127127-03 64-bit
Copyright 1983-2007 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Hostname: hostname
NIS domain name is x.x.x.x

hostname console login:

Host name resolution, virtual hosting in Tomcat

October 13, 2013 Leave a comment

In order to be able to type URL’s instead of typing http://localhost:8080//index.jsp , one needs to change the DNS server settings to point the hostname to the static ip-address, the one that identifies the server when identified in the context of one’s LAN. However DNS resolves only IP addresses and not port numbers therefore either anything other than port 80 must be explicitly declared or one needs to switch the tomcat listening port to 80 instead of 8080.

Further, the IP software checks the local hosts file, residing at /etc/hosts for Linux, before asking DNS to resolve a host name.

Related to this, there is a name based virtual hosting concept in Tomcat wherein all your sites can share a common IP and the server inspects the Http request headers to decide which site to serve. The configuration would involve adding a <Host ..> directive in the $TOMCAT_DIR/conf/server.xml file

<Host name=”localhost” debug=”0″ appBase=”webapps”

unpackWARs=”true” autoDeploy=”true”

xmlValidation=”false” xmlNamespaceAware=”false”>

</Host>

In the above example, name is the domain name & appbase is the directory where all the webapps resides.

If you don’t need to have more than one virtual hosts, you can set the default Host to localhost and only that one <Host> defined. It is a better configuration because you can support arbitrary hostnames as long as your DNS is setup correctly.

Categories: Web Server Tags: ,

Get value of CollectionOfElements annotation Map

Here is the HQL query to retrieve the value of CollectionOfElements annotation field Map attributes within object ObjectUnderConsideration.

SELECT elements(t.attributes) FROM ObjectUnderConsideration as OurObject INNER JOIN t.attributes as attributeField WHERE CONDITION=’your-condition’

Releasing Web Applications

September 17, 2012 Leave a comment

MS DOS script to close batch file upon execution

MS DOS batch script to restart Internet explorer followed by closing the parent batch file even though the child process has not been closed.

start “” taskkill /im iexplore.exe
start “” “C:\Program Files\Internet Explorer\iexplore.exe” google.com
CLS
EXIT

Categories: Scripting Tags:
Follow

Get every new post delivered to your Inbox.