Archive

Posts Tagged ‘Customization’

GlassFish v2.1.1 & Custom Error Messages

There are times when you might want to enable custom exotic jazzy error messages instead of the boring 404 or 500 messages. It can be due to various reasons. Security, to avoid scarring the users, etc.,

You can enable custom error messages either server wide (all applications in a server) or only to a specific application in the server.

To enable it across all applications :

This is specific to Glassfish v2.1.1, for the other versions it may vary.

Method 1:  editing the domain.xml manually.

  1. goto glassfish\domains\{domain directory}\config\domain.xml
  2. copy the custom error message html files here.
  3. Open the domain.xml file located in the same folder.
  4. Find the tag “virtual-server”, which has an attribute “id” with the value “server”
  5. Add a sub element to that virtual-server element like this.

<property name=”send-error_1″ value=”code=404 path=404.html”/>

the name attribute value has to be of the format send-error_n where n is a number. for different errors increase the value of n and change the value of value attribute.    The value has two parts code and path.    code is the three digit HTTP response code, eg: 400, 404, 500, 502 etc..    the value of path is the path to the custom error html page. this path is relative to the position of this domain.xml.

Method 2:  Via Admin Console.

  1. login to Administration Console.
  2. In the tasks menu on the left, goto Configuration => HTTP Service => Virtual Servers => server
  3. In the right pane, scroll down to the bottom, and click on the Add Property button.
  4. under name enter “send-error_1″, and under value enter “code=404 path=404.html”
  5. similarly for every error add a property and enter the values, for explanation on values for name and value refer to Method 1.

To enable it to a specific deployed application :

Custom error messages can be enabled for a particular deployed application, by modifying the deployment descriptor file. In web.xml file, under the web-app element add the following,

<error-page>
          <error-code>404</error-code>
          <location>/404.html</location>
</error-page>

You can add multiple error-page element for each error. the location, is the path to the custom error page.   The path is relative to the docroot of the application.

Reference:
http://docs.oracle.com/cd/E13222_01/wls/docs81/webapp/web_xml.html
http://docs.oracle.com/cd/E19879-01/821-0183/abhaq/index.html
http://docs.oracle.com/cd/E19879-01/821-0183/abhfg/index.html

OMG! My Web Cam works!

Wow!  Lucid did its first wow, and may be the only wow i suppose.  My web cam works.  now i can use every piece of hardware that is present in my laptop.  I can’t say that the problem was linux.  Actually the problem was my webcam, it did not come with drivers for linux.  some wise geeks out there, had tried and had developed drivers for this brand, which had 3 variants, and mine was stamped as the hopeless variant (Genesys Logic – gspca_gl860).  After a valiant effort by me and my friends for 3 days during February, we gave up saying it was impossible.  We made the system to recognize the webcam, but to make it work, to make it show the view, we weren’t able to.   I took a pic of me

First Pic with my Laptop WebCam in Linux.

I used Cheese to take this picture.  I know it is not that great.  but come on, my web cam is working……….

An improved Desktop…..

Like i had said in the previous post, i installed xfce or xubuntu-desktop.  First i installed it in my laptop, and played around.  it was nice, Though i couldn’t find any difference in performance in my laptop (core 2 duo, 2 GB of Ram).  It was slightly different and interesting.  But after around an hour or so, i was stuck with my first 2 issues.

  1. My USB Hard drive / flash drives were not getting automatically mounted as in Gnome.
  2. In VLC i was not able to access the Playlist window or the Equalizer window when playing a movie.

I did check both right then and there by logging out and then logging back into GNOME.  There they worked.  i don’t know why.  But anyway other than these two i did not find anything else out of place or a reason to cause trouble when others in house would use it.  So i decided to get it into my desktop machine.

Well, i was expecting at least some improvement in the experience.  But it was still same as GNOME, slow and sluggish.  I couldn’t understand, how come?!!  there’s got to be at least some improvement.  Since the whole effort was down the drain, i decided to go ahead with the next logical step, to see if any unwanted things were running in the background.  I noticed GUAKE and Evolution alarm something running, which we never use.  so i switched them off from starting up during startup.  I went to

System -> Preferences -> Startup Applications

and unchecked the check box for the two applications.  and restarted the system.  Wow.  now the system was responsive.  so it had been GUAKE auto start which was causing the sluggish desktop.  well, now i can use the Desktop without having to worry about long wait times. atleast not 10 – 12 seconds…..

Firefox keeps prompting for Proxy Authentication

I have been facing this for a long time since 3.5. something.  Even after upgrading to 3.6 it continues.  Firefox would keep on asking for proxy authentication even though i had given the id and password and even it remembers.  But it will always ask for the id and password.  Today looked around to find a solution, and i came across this, which seems to working.  No popups for authentication for the past 2 or 3 hours.  go to about:config and search and the following properties.

network.proxy.share_proxy_settings – FALSE
network.automatic-ntlm-auth.allow-proxies – FALSE

You can read the full discussion here

update:

Setting these properties alone does not work.  you have to set one more property.

network.auth.use-sspi – FALSE

These setting works in Flock & Thunderbird 3 also.

AutoStart Guake during System Startup

Well, all those who love to use terminal or are in need of using terminal frequently, would know about Guake,  which bring terminal with a touch of a button.  But the thing is after it is installed, it does not start up automatically during system startup.  It was a bit frustrating for me, I searched Google for a few minutes and hit upon the answer,

type this is terminal

sudo cp /usr/share/applications/guake.desktop /etc/xdg/autostart/

This will make Guake start automagically during system startup.  I read this here.

Update:

After going thru the menus a little i found this can be done without going to terminal too in Ubuntu Karmic, don’t know abt the rest.

Goto System -> Preferences -> Startup Applications.

The Startup Application Preferences window opens. In the Startup Programs tab click on Edit Button.  Give a Name for the Application in the Name field, and then type “guake” without quotes in the command field and click Save.  Then close the Startup Application Preferences window and restat the machine, now Guake should start automatically on login.

Masquerading Ubuntu Karmic as Windows 7

ok.  Before i start,….  This is about having only the look of windows 7 on a linux rig.  nothing more. If you might take any offence, then leave without reading any further.  And this is not a total convert, just the look of the desktop.

Ok.  So, Today, out of the blue, i had a day off.  I didn’t know what to do.  Was just looking around since last night.  Tried a few things here and there, then suddenly i chanced upon this piece of software called GnoMenu.  Which kinda rekindled memories, a few things from the past.  So once again, i decided to try to make the desktop look a little different from the usual plain jane default desktop.   I know this aint’t cool what i have done.  But, i kinda like it.

What did it do?  Well i set off to change the appearance of the desktop to that of similar to Windows 7.  And i can say i kinda achieved it mostly.  Except the windows and icons look and stuff.  But looking at the desktop is sure to confuse if it is a linux gig or wat…

Take a look and say how is it…

My laptop does not have those 3d thingis, so i had to stop with this, i tried to install the themes and stuff, but they kinda depend on emerald, compiz and others.  So I am happy with wat i achieved.  Later i found out some more of those how to do stuff, i liked one of those, though it did not work out for me, because of the above mentioned reason, may be it helps you.  Take a look here.

Display a fortune message when you log in

This post is kinda notes to me.  The link which i had bookmarked for this has been gone…  So i am writing here whatever i can remember of what did.

This is to display a random text whenever you log in to the terminal.  or open a terminal window in GUI.

For this to work you need to have fortune installed.  Install it from you Distibutions repositories…  Then become root and open /etc/bashrc in any editor.  Add the following lines at the end of the file.

#Display a fortune message when terminal (shell) starts
echo “Welcome $(whoami)”
echo “——”
/usr/games/fortune
echo “——”

Now save the file and quit terminal and restart.   Now whenever you start / log into a terninal,  you will get some random funny messages welcoming you……

I first saw this in this site…

Categories: Linux Tags: , ,

Dom Inspector – Customizing Blogger Theme / Layout/ Template

After a long time looking at others blogs with fancy themes / layouts, today i set out to get my self one different theme, which is not there in the blogger’s default layout set. Since the aim was to get something out of the bloggers default arsenal, i was just looking around for some fancy layouts. and even got thru so many which i just fell head over heels.. But, as soon as applied them, it just felt as though they were not there for my blog.

Then i decided to do something which i would normally not do. play around with the css info in the xml to fit my requirement. first i went around with a fancy theme, but i couldn’t make heads or toes of it.

Since now i had my mind bent on customising a theme for me, i decided to start with a ver simple theme, a minimalistic theme which would have just a background and display. i found one, i can’t remember, from where i took this.. This is the current one, which was named redplanet… I did like the base template but not the splash image which was there at the top below the title.

I started off with Bluefish to edit the xml, and get out with my customization. But somewhere down the line, i remembered kavitha’s saying, something about Dom Inspector in Firefox. Since I’m using IceWeasel in Debian, which is pretty much based on Firefox and is also similar to it, i chanced upon seeing weather it has dom inspector in it. I pressed Ctrl+Shift+I and, lo behold, there appeared Dom Inspector, it was pretty much simple, working with it. Editing the theme was nearly a piece of cake with this Dom Inspector. I had seen kavitha, Sumathi, Santhosh all playing with Dom Inspector for editing / customising look and feel at work, but this is the first time i have used it Dom Inspector. It was interesting to see such a powerful tool hidden away in a browser. I already had a strong belief, as firefox is the browser for developers, and one more reason in my arsenal to drive my point home.

Try using it.

The iphone theme

 

hmmm.  successfully installed the iphone theme  on my rokr e6 yesterday night.  took less than 3 minutes.  The anxiety was too high when i was doing this, and i could have bricked my phone, but i didn’t.  Now the phone is working cool. 

i had to install and use linloader and a good lin script to install the theme.

if any of u need the theme file, leave a comment and i will send it to u, coz i don’t have any place that does not expire with time…..

the procedure was simple.  extract the theme and take it to mmc card.  make sure there are no spaces in the folder name.  then long tap the iphone.lin file and run it with loader.  leave the phone as such for a minute till the installation is complete.  you will get a popup saying installation complete.  now switch off the phone now u will be able to see the iphone switch off screen. now switch on and voila, u have the iphone theme installed……

this worked for me, and i am not facing any problems….  still there is a easy and safe way,  that uses a theme installer, which u can find in mobile junkies forums.  you will have to register (free) to download….

Follow

Get every new post delivered to your Inbox.

Join 90 other followers