Posts Tagged ‘door’

Automatic restart Tomcat on Windows script via TaskScheduler daily – A command line to add / remove new Windows “Cron” like job

Thursday, January 22nd, 2015

automatic-restart-Tomcat-on-Windows-via-TaskShcheduler-daily-weekly-monthly-a-command-line-to-add-remove-new-windows-cron-job
I'm responsbile for a project environment made up of 3 components which is occasionally dying. Here is a short raw overview of environment

  • Apache Reverse Proxy (entry door to app server)
  • Tomcat Server with an Application enabling web access
  • A Java Standalone application using SQLite database

 The Tomcat and Java Standalone application is running on top of Windows 2008 RC2 Standard, the overall environment is becoming inacessible periodically and in order to solve that the customer decided to implement a daily Windows server reboot in my opinion this is very bad approach as it is much better to just set an auto reboot of each of components using few tiny batch scripts and Windows Taskmgr, however as the customer is king and decided to implement the reboot its their own thing. 
However even fter the daily server reboot was set once a week or so the application was becoming inaccessible and a Tomcat server restart was necessery as a fix.

Finally as a work-around to the issue, I've proposed the logical thing to automatically restart Tomcat once a day early in morning, here is how Tomcat auto Restart was implemented on the Win server:

1. Check out the name of running Tomcat service

First thing is to use the sc command to find out the Tomcat application name:

 

how-to-show-tomcat-service-name-command-windows-screenshot

C:UsersGeorgi>sc query state= all| findstr "Tomcat"
SERVICE_NAME: Tomcat7_r2c
DISPLAY_NAME: Apache Tomcat Tomcat7_r2c

C:UsersGeorgi>

 

2. Create bat script to stop and start Tomcat service

Press keyboard Win-button + R, start notepad type inside:
 

@echo off
sc stop Tomcat7_r2c && sc start Tomcat7_r2c

(MyApp-Tomact-Restart-bat-file-ms-windows-screenshot

Don't be confused from screenshot that I have Tomcat7_MyApp instead of Tomcat7_r2c, but I made screenshot in hurry for another app.
Save the file, somewhere (preferrably) in application folder/bin/  it is best to save it once with bat extension MyApp-Tomcat_Restart.bat and once as MyApp-Tomcat_Restart.xml (XML format file is later needed for import to Task Scheduler which understands .XMLs). The .bat file is good to have because it is useful to somtimes restart Tomcat manually by running it (in case of some sudden Tomcat Appserver occurs even though the auto-restart script).
 

3. Create new Task using command line (cmd.exe)


Task can be created also from command line using following syntax:
 

schtasks /Create [/S [/U [/P [  ]]]]
/XML <xmlfile> /TN <taskname>

Simple way to create a new Windows task is shown in below command, it will set my Tomcat Restart script to run everyday in 05:00 early morning when no employees are using the system:

schTasks /Create /SC DAILY /TN "My Task" /TR "C:UsersGeorgiDesktopmyApp-Tomcat_Restart.bat" /ST 05:00
SUCCESS: The scheduled task "Tomcat Restart Task" has successfully been created.

 

import-new-windows-task-scheduler-task-from-command-line-windows-add-new-cronjob-command-screenshot


4. Create / Import new Windows "Cron" job 

Alternative way is to use Task Scheduler GUI frontend and create new (Basic Task) or  import just created script

To run Windows Task Scheduler from comamnd line :
 

Taskschd.msc

taskschd_windows-run-from-command-line-screenshot

To import already existing .XML formatted file for Task scheduler, right click on the Task Scheduler (Local) and select Import task

task-scheduler-local-task-import-microsoft-2008-r2-windows-screenshot

Import the myApp-Tomcat_Restart.XML previously created file

task-scheduler-import-tomcat-restart-xml-file-windows-server-2008-r2-screenshot

Adjust settings to suit your needs, but what change atleast:

  •         the path to the myApp-Tomcat_Restart.bat file in Actions tab
  •         the Local User account with which script will be running (administrator) in General tab

Task-Scheduler-windows-general-local-user-account-with-which-task-will-be-running

After making all changes you will be prompted for server Administrator account password 

5. check existing Win Cron job from command line

To see the configured (Scheduled Tasks) in command line mode with a command:

Schtasks.exe

schtasks-windows-equivalent-command-to-linux-unix-crontab-screenshot

The command is Windows equivalent to UNIX / Linux's crontab, e.g.:

crontab -u root -l


6. Delete existing Windows Task Job from Command line

If you happen to need to delete just created task or any other task from command line (Assuming that you know the previously created task name), use cmd:

C:>schtasks /Delete /TN "Tomcat Restart Task"
WARNING: Are you sure you want to remove the task "Tomcat Restart Task" (Y/N)? y

SUCCESS: The scheduled task "Tomcat Restart Task" was successfully deleted.


Task completed, Tomcat will auto-restart on Windows host at your scheduled time. Feedback is mostly welcome 🙂
Enjoy  

 

Sick again – Hoping God to solve it all – and no desire to study

Thursday, September 27th, 2007

Yesterday I was out for a coffee with Tony an old frined from the Old metal days, after that I went outwith Lily I drinked 200 gr of Vodka and a Beer. I was pretty desparate actually and I got very drunk I got home 04:10 and got to bed at 4:30. What can I say life is hard. Today Mitko called at dinner time and we drinked a coffee on the fountain. The night we went out in the Central park and drinked a beer per man. I’m starting to think about the meaningless of my life again, since my life seems without a real purpose and seems not going nowhere ( we humans are so weak ). Yesterday I have almost taken the decision to suicide. It almost a miracle after I send lily to her home and was going back home with the idea of my mind to suicide. Lily called and said she can’t unlock the door and everyone inside is sleeping and she didn’t want to disturb them. So we spend more than an hour outside. Today I feel terrible physically again. I really can’t take it anymore I need Jesus to bless me with a healing (Save me Holy Lord, Lord Jesus son of the Blessed God have mercy over me the sinner heal me Lord and Deliver me from all sickness and affliction and pain Heal my Soul, Body and Spirit, make me whole to be able to serve you again :[ Amen) My computer went down twice today I have a problem with the cooling. The cooler should be cleaned but I guess this will happen after our Room’s repair is completed. By the way Both Pc-Freak and Jericho are on the terrace. Because repair works are being done into the room. Day after day I ask my self the question when I will be healed again. I do smoke a lot of cigarettes for which I’m ashamed of myself (But it’s an act of desperation). By the way I don’t have any desire to study anymore I’d like to do things with FreeBSD and learn stuff. If God is merciful to me and heals me probably I’ll continue to live otherwise I guess I’ll end badly. Very often come to the point Nobody out there cares, them I feel the presence of God’s spirit I remember the Bible’s instruction towards doubtful mind and try return back to the Faith of the Eternal, It’s like a sort of schizofrenia (I believe, I don’t believe). I’m sure both cannot be true. Very often I think I deserve more but since God’s rightous probably that’s what I deserve. I tried do good for so many people and to care for as much people I’m very discouraged because as a reward I see it like receiving this infirmity and sickness … Something have to change or I’ll be gone …END—–

The last two weeks

Saturday, December 16th, 2006

Heya. Few weeks I can’t take the courage to write on the blog. But today I’m spiritually (Praise be to God!). So I was able to write that. The day passed away in a very traditional way. I went to the collage in 10:15 instead of 08:15 again I was not able to stand up from the bed. We had some International Law lectures up to 11:30, after that we drank coffee with Nomen. Smoked few cigarettes. Later on I had a Deutsch 12:30 to 15:45. We made a test the time between 14:15 – 15:45 ( I was not ready for that test ofcourse :] ). No matter price be to God I succeded to write stuff in the test. After that I spoke fo 1.5 h with the College Sys Admin we discussed mine idea to migrate some Windows 98 boxes to just dumb terminals connecting to a central Terminal Server. In monday maybe we’ll start doing the terminal server. Other things I saw Nomen and Habib in 17:10 in the college. Mitko give a promise to Malin to check something on his computer, so we had to go Malin’s home. So we went there nothing special their we put Habib in front of the Malin’s home door and he rang we with mitko hide and watched. Dori (The woman of Malin), went out looking shocked at Habib, she was possible wondering who is that strange (nigga like guy). Habib said: “Malin, Vkyshti” :]. Dori said: “Malin ne vkyshti” then we showed ourself and laughed;] We tried to fix the malin’s problem with the Audio Drivers but was not able the problem seemed to be a hardware one. After that we went to Mino’s coffee we saw Miro and Gosho with Zuio Kiro and Maya. We drinked some beer and went our homes. End of story. The last days were hard for me. I really have no idea where my life is going into nomatter I hope God will think about me a good way the best way. I had a big spiritual pain over the last days, and I said to God a lot of times I hope he will take me away, from this hellish earth. But I guess his plan is another for me. Will live and will see. Now God Even now you see me. Please help me fix the mess I am into and forgive me for all my awful deeds. Will go now. Blessings in the name of Jesus Christ.

Play Terminal Velocity (Terminal Reality) 3D shooter DOS game on Debian Squeeze GNU / Linux

Wednesday, February 15th, 2012

Terminal Velocity Game title logo dosbox Debian Linux

Some of the computer DOS geeks certainly should remember Terminal Velocity / (Terminal Reality Inc. – TRI) DOS 3D Realms (ex Apogee company) game. For those who are younger or for any reason miss to play TV here is a short review. Terminal Velocity is an addictive fast pace 3D Flight Simulator game.
The ship one navigates has a mean to accelerate or down-accelerate flying speed. There is also an AFTER BURNER mode which accelerates the ship movement speed drastically while in use. TRI's AFTER BURNER game feature create unique feeling whilst in game, raising gamers adrenaline and giving feeling of great dynamics 😉
The game graphics are a bit low, the game can be switched between VGA and SVGA from within the internal game menus, anyways for the year 1995 the game graphics looks fine.

Terminal Velocity TV DOS game screenshot

TV supports network games of up to 8 Network Players and for 1995 is among the few 3D games supporting so high number of network players simultaneously. As most of the games of its time TRI supports modem network game play. I don't know about you, but for me Modem Network game DooM peered plays brings up some nice memories 🙂

Every now and then in the levels, there are holes (Tunnels) you can enter, the tunnels is one of the most exciting part of the game as it reminds me tracking mods music culture, Future Crew's Second Reality graphics demo and the rest of the old glorious Assembly Demos – if not familiar with the aforementioned be sure to check the link cause you've missed a lot!

The ability to enter Tunnels while in the midst of the game makes TV unique and sets it apart from the rest of the games which were bombarding the 3D game flight simulator market in '95s.
Terminal Velocity DOS Level Tunnels screenshot
Terminal Velocity MINIMUM HARDWARE REQUIREMENTS are:

486 with 8 megs of memory.
For SVGA graphics (provided only by registered game version) require 486 DX4/100 or Pentium to display at acceptable frame rate.

Terminal Veolocity on Disk technical support manual

This requirements are nothing and even looks funny while compared to today's available hardware. Nowdays an Android ver. 2.2 OS running (PriVileg) mobile "smart" phone runs at at least 400 Mhz CPU and has a giga of memory.
Its quite interesting to see (from historic point of view) how thoroughful the TV Help manual is, and how well organized software documentation used to be in these old DOS days. If you want to take a look at it launch TVHELP.EXE (you will notice it along with other game .EXE files after extracting)

The game soundtrack is amazingly cool and is one of the main things that add to the great gaming experience.

It took me a while to find Terminal Velocity, as the game download link provided on 3drealms.com/downloads is broken and most of the websites with mirror of 3dtv12.zip file was no longer active.

After about half an hour of search!, I've finally found and managed to download 3dtv12.zip.
In order to preserve Terminal Violocity game from disappearing I've made a mirror of 3dtv12.zip you can download from here

Thanks to dosbox DOS Emulator , is playable on both GNU / Linux, FreeBSD, Mac OS and Windows.
I did not have the time to check if the game runs fine on other operating system architectures besides mine – a Debian GNU / Linux codename (Squeeze). On my aptop Thinkpad R61 with hardware configuration (Dual core x 1.8 Ghz with 2 GB of Memory), the game runs smoothly with both good playable graphics frame rate and properly timed sound/music.

For all those who want to play the game in the Linux realm, you will have to have earlier installed dosbox dos emulator. Once dosbox is there you can further proceed download / unzip / run and enjoy Terminal Velocity on your Linux Desktop:

1. Download and unzip 3dtv12.zip

hipo@linux:~$ mkdir TV
hipo@linux:~$ cd TV
hipo@linux:~/TV$ wget https://www.pc-freak.net/files/3dtv12.zip
hipo@linux:~/TV$ unzip 3dtv12.zip
Archive: 3dtv12.zip
� � ������ � � ����� ������ � ������ �����
� � � � � � � � � � �
�� �� �� �� ����� �� �� � �� �� � �� �
�� �� �� � �� � �� �� � �� �� � ��
������ �� ������ �� � �� �� � �� �� � �����

Running VADV 2.10 ���� ���� ������
� � � � � VirtualNet 1801001
4 Telnet nodes ����� ����� ������ FidoNet 1:311/2
VADV-PHP Website �� � �� � �� BattleNet 169:1/120
����� ����� �����

Telnet/web: lightningbbs.com
Alt: lightning-bbs.darktech.org

Full access on the first call. Simple, short and to the point newuser
questionaire. Over 50 door games online, all of them are registered.

Fun RPG games like LORD, Usurper, TEOS, Trade Wars, Clans, and Quest for Nora.

Strategic war games like BRE, FE, Global Wars, ISA, and Colonies.

Adult door games like Strip Poker, Bordello, Studs and Studette.
...

After unzip is complete you will have the following list of files and directories:

hipo@linux:~/TV$ ls -1
FILE_ID.DIZ
INSTALL.EXE
LICENSE.TXT
TV/
TV12S.SHR

As you can read in the unzip notice the .zip file was taken from Telnet/web: lightningbbs.com
I was happy to find out that lightningbbs.com BBS is still up and running in both web and telnet mode! I took the time to telnet to lightningbbs.com and it was charming. lightningbbs.com is a real place of "living computer history"! For people who have never experienced the days of BBS use, I warmly recommend you do telnet lightningbbs.com and check it out. Issue in console/terminal:

hipo@linux:~/TV$ telnet lightningbbs.com
��VADV32 v4.4.110325 - (c) 2004-2011 Aspect Technologies - www.vadvbbs.com
o NetFoss - Revision 5 FOSSIL - Com Eng v1.03 - (c) 2001-2010 pcmicro.com
Connected @ 11520 to Lightning BBS on line 3

Virtual Advanced 2.10 for DOS
Multi-User Multi-Network Graphical Bulletin Board System
Serial #99608791
...
...

2. Run and enjoy Terminal Velocity 😉

The game itself is extracted automatically in TV sub directory. To launch it directly enter TV/ and run GAME.EXE , e.g.

hipo@linux:~/TV$ cd TV/
hipo@linux:~/TV/TV$ dosbox GAME.EXE

Terminal Velocity Screenshot Debian GNU / Linux 6.0 Squeeze Dosbox dos emulator

Terminal Velocity game screenshot dosbox GNU / Linux

Running the game through the game launcher TV.EXE or GAME.EXE worked but the game sound was missing music and sound FX 😐
The no-music and sound issues were however pretty normal and expected. Back in the DOS era setting your exact Sound Card device type was required before the first game launch.
Configuring the exact screen resolution (EGA / VGA / SVGA) and Sound Blaster or PC Speaker type (Sound Blaster 16 / Sound Blaster Pro) in TV is done through running SETUP.EXE .
3D Realms Terminal Velocity Screenshot Level 5 Debian Linux Squeeze dosbox

Actually SETUP.EXE used to be like a standard for almost all DOS games I've encountered.

To make Terminal Velocity sound work I had to choose from SETUP.EXE main menu:
Sound Setup -> Sound Blaster 16
or
Sound Setup -> Sound Blaster Pro

Choosing any of the two SBs produces the same sound / music effects. I guess this is the case becase dosbox emulates a number of sound cards compatible with soudn blaster.
After choosing the SB you should select Save and Launch TV to run the game with sound.
Terminal Velocity TV, dosbox setup.exe sound blaster setup program screenshot

If you quit the game and try to relaunch it with dosbox GAME.EXE unfortunately runs the game without sound fx and music again. Hence the only way to make TRI run properly with music is to everytime configure sound blaster type with SETUP.EXE . TV also supports joystick and it was nice my Genius JoyPad worked like a charm with TV under dosbox emu 😉
To play the game in full screen mode with dosbox press ALT + ENTER simultaneously. 

An interesting fact which is not related to the game is Terminal Velocity is a physics term, here is a quite from Wikipedia:

"In fluid dynamics an object is moving at its terminal velocity if its speed is constant due to the restraining force exerted by the fluid through which it is moving."

On 3drealms.com, I've found also a collection of Terminal velocity mod musictvmods.zip. For the sake of preservation tvmods.zip from disappearance I've made a mirror of tvmods.zip on here

TV has also 20 cheat code words which can be typed in while playing the game for various goodies like Invisinbility, Shield Restore, Power up all weapons, skip level etc. Complete list of Terminal Velocity cheat codes is here
If you're an absolute TV addict and you want to set a TV screenshot on background Check the TV Planet 1024×768 Background resolution

TV has also a game editor, could be valuable if you want to make yourself some custom game levels here is a mirror you can download tvcad10.zip.
I've made also a quick research if someone in the Open Source / Free Software realm is not busy working on a fork of TV, but as of time of writting it seems there is no effort to make an "open source" Terminal Veolocity game. As TV is starting to disappear from the scene and 3DRealms are not existing for so many years now, it would be nice/wise if the company publish some of their prior games source. If they don't, so many great games (like TV)'s source code will be probably lost in max 10 / 15 years time.

We know 3DRealms release some of their source code for Duke Nukem 3D, I think it is now time to release source of TRI and the other old forgotten games.

Pingus – A Lemmings like arcade game for GNU / Linux and FreeBSD (Free Lemmings Clone)

Monday, January 2nd, 2012

Some might remember Psychosis Lemmings that we used to enjoy back in the glorious days of DOS 😉 I remember Lemmings used to be among the played game in one line with other top arcades like Dangerous Dave, Commander Keen, Xenon etc.
The game used to be quite unique for the time and it was quite cool that it worked on quite old machines lime my old 8086 XT with 640kb of memory. It even supported two player mode! 😉

Lemmings arcade screenshot

I was happy to find out actually Lemmings remake is available in the Free Software OS realm . These Lemmings clone game is called Pingus
Instead of governing a group of lemmings which had to move to an exit door by making a save path using various tools and combination of team member character skills, the main heroes in Pingus are cute little penguins 😉

Screenshot Pingus, Lemmings game clone for Linux and FreeBSD

Pingus is built on TOP of SDL libraries and has a combination of awesome graphics and enjoyable music soundtrack and as a game play is a way better than its original predecessor.
If i have to to rank this game I would put it among the best 20 free software games ever produced for Linux / BSD.

ScreenShot Pingus on Debian Linux

pingus is available for almost all kind of Linux distritubions as well as is included in the FreeBSD port tree:

On Debian its available as a package ready to be installed with aptitude or apt by issuing:

debian:~# aptitude install pingus

For FreeBSD pingus is installed via ports tree, by running cmds:

freebsd# cd /usr/ports/games/pingus
freebsd# make install && make install clean

By default pingus will run in a Windowed mode, to run the game in fullscreen you will have to run it with the -f switch via terminal, or by pressing ALT+F2 in GNOME and typing:

$ pingus -f

The game is quite hard to complete in that resembling the lemmings. It has an embedded Mapeditor , by which new levels can be easily constructed and sent to the game developers (in that way helping the game development).

Pingus is also multi-platform, licensed under GPL2 and is also ported for Mac OSX and MS Windows, allowing others non free software users enjoy.
Pingus Windows and MacOS X binary as well as source can be downloaded here

Pingus Lemmings like Free Software Game for Linux BSD level screenshot

Playing Pingus has few benefits, one is it can be nice to kill some boredom (for sysadmins) or / and bring some good past gaming memories. It's also good for developing some elder people strategic thinking as well as very suitable for little children to help develop their intellectual (thinking) in solving complex consequential tasks. Pingus could also be beneficial for teens to develop organizational and math skills.

Thomas Sunday (Doubting Thomas) the end of the bright Paschal Week

Sunday, May 1st, 2011

St Apostle Thomas touching the wounds of our saviour Christ

Today in the Orthodox Church, we commemorate the great miracle of our saviour Christ appearing to st. Apostle Thomas, who failed to believe to the rest of the holy apostles that they have seen our saviour alive.

Thomas wanted said that he won’t belief if he doesn’t touch and see the incorruptable risen body of our saviour Jesus.

Our Lord by his great mercy has appeared once again to the pupils dinnering with them.
Thomas was with the teachers and the door was locked (as the fear of persecution for Christ’s testimonial was among the aposltes).
Suddenly our Saviour entered the room where all the pupils were gathered through the locked door (a Glorious miracle inconceivable for our minds).

As the Lord knew about Thomas weak belief and his disbelief in his prophecised Resurrection in the third day, when Christ entered he has addressed Thomas and told him to come forth and see and touch his wounds and see that a spirit has no bones and flesh, (obviously Thomas erroneously thought that the resurrection from the death would be in spirit and no physical body will be present (this kind of belief today is also wide-spread inside many heretical christian groups)).
The Lord continued on and told Thomas, “Thomas you have seen and believed, now blessed is those who haven’t seen me and believed”!

Here is part of the daily troparion:

Touch my rib with a hand, Thomas, speaks Christ, and come and touch (feel) the scars from the nails.
With faith do test it, and be a believer and not a non-believer. Thomas has touched with a finger to the Master and loudly shouted:
"You are my Lord and my God, most merciful Glory to you!"

This Sunday is also the day marking the end of the bright week of the Resurrection.
Let we all the Orthodox Christians be a believers as Thomas and be blessed in accordance to our saviour’s word, as we haven’t seen the Lord’s Risen glorified body as Thomas and the rest of the holy apostles did.