Saturday, August 31, 2024

generativeAI Links

 https://github.com/adib0073/GenerativeAI

https://github.com/adib0073/FastAPI_Docker_Deployment

Saturday, May 25, 2024

Monday, December 25, 2023

sequence of covid 19 symptoms

Sunday afternoon around 2:15 pm, 7th August, felt sore throat while talking to a friend .

Had bearable headaches on various sides of head on Saturday night and Sunday.
Specifically on the right side of head and top of the head. Did not took any medicine to suppress headache. It more felt like a headache after hangover.

Monday morning, went to office. Sore throat was still there and no fever. Decided to take paracetamol after lunch just to feel better in office and continue with office work though there was no fever.

Monday afternoon, had diarrhea, passed watery stool 2 times while in office.

Returned home at 9 pm . Had a feeling that fever is about to come . Fever came around 10 pm . Slept with no fan , Air-con . Took a light blanket. Fever was gone by 3 am, Tuesday, morning. Felt better by now.

phlegm started coming out .  coughing, sneezing kept coming in less numbers approximately once in 2-3 hrs. 
Chest pain kept coming and going in intervals of 2-3 hrs.
This continued till Tuesday night.
On Tuesday 11:00 pm , did ART test for COVID-19 which turned out to be positive .
Fever has not come back.
Tomorrow morning, will go to Doctor's clinic .

Updating the blog at 11:40 AM Wednesday, morning.Got a queue number for doctor's visit around 3:30 pm.
Now , occasionally getting a feeling of vomiting. Also, there is no desire to eat food.
As of now, main symptoms are chest pressure, occasionally coughing and feeling of vomiting.
At one moment, I feel better but another, I feel worst and feel like going to emergency .
Even at emergency, there will be long queue. So, will wait till 3:30 pm.

One major difference I felt between worst form of flu and COVID-19 is that flu comes and goes suddenly. Usually, a flu will show its worst form in 1-2 days and will recover fast. On the other hand, COVID-19 builds up slowly and doesn't go off that fast. 

Today is the fifth day of infection for me. 6th August was first day of infection and today is 10th August.
One more thing to share is that color of phlegm doesn't remains same all the times. Sometimes, it is white, sometimes it is off-white and sometimes yellow. 
 
Today is 15th August . There is no chest pain and fever. There is a little pressure in the chest . There is moderate cough . Phlegm keeps coming in moderate quantity.
Looks like this is going to continue for several days .
Covid-19 is more like a slow flu .

Today is 30th August,
I had tested negative within 14 days of infection.
Even today, I get bout of cough all of a sudden . It's not so often but it's like once in 2 days. Little phlegm comes out like once in a day.
Overall, I am feeling much better and hope that the cough will be completely gone in another one month.








Friday, March 3, 2023

short notes to solve a rubik's cube

1) Make a white cross by your own. There are 6 faces- Right , Left, Up, down, front ( facing)
2) Hold it keeping the white face up .
Bring the white corners in down one by one  if not already.
Rotate that white corner to just below the missing corner. Then do R'D'RD
First layer completed .
3)Keep the white face down .Match one of the  top layer edge piece  with  center . When white face is down , the yellow center will be at top. So, the edges with yellow on any one side will not go to the middle ( or second ) layer. So, you don't have to match the edge pieces  with yellow on any side with the center. You have to match only edge pieces with no yellow on any side.  Then depending on the direction of colour of the edge piece on the top , you have to do either of the following.At this point, the edge piece center is matching and facing you. Basically, what you do is to turn the edge piece from top layer by quarter to bring to second layer and match with second layer center.
Also note that , the below step is needed to be executed only one time to bring the edge piece from top layer to the second layer.
clockwise ( meaning the colour of edge piece on top is matching with center on right) - URU'R'U'F'UF
anticlockwise (meaning the colour of edge piece on top is matching with center on left)- U'L'ULUFU'F'
Above steps will be completed one by one depending on the colour of the edge piece matching the side whether left or right.
Second layer will be completed after you match all the pieces of second layer using the above approach.
4)Do FURU'R'F'
FRUR'U'F'
If while making yellow cross , two incorrect edges are adjacent to each other . Then put those edges in front and right and do
URUR'URUUR'
Basically, this step shifts edge piece on top layer facing you by quarter to the right.
 Yellow cross is completed
If 2 incorrect edges are opposite to each other, 
Then , execute 
URUR'URUUR' twice. After first execution, incorrect edges will be adjacent to each other . Then , put the incorrect edges in front and right and execute URUR'URUUR'

5) Putting the yellow corners 
 pieces

Only the last layer corners are left unsolved. First we have to get them to the right spot, so don't worry about the orientation in this step.

Find a piece which is already on the right place, move it to the right-front-top  corner then apply the following algorithm to switch (cycle) the three wrong pieces marked with grey on the image.

Do this twice to do an inverse rotation of the pieces. If none of the yellow corners is on the right place then execute the algorithm once and look for a good piece again.

URU'L'UR'U'L
6)
Now , we have to orient yellow corners

Start by holding the cube in your hand having a misaligned yellow corner in the highlighted Front-Right-Up spot (see image).
Repeat the R' D' R D algorithm until this piece comes to the correct position with the yellow sticker upwards.

Turning only the Up face, move another wrong yellow corner to the highlighted spot and repeat the R' D' R D algorithm until that yellow piece is oriented correctly.
Move other misaligned yellow corners to the marked spot one by one and do the formula until all corners are solved.

The puzzle might seem to be scrambled between the moves but don't worry because everything will come together when all yellow corners are oriented properly.



Sunday, July 19, 2020

A great tip to increase ubuntu peformance

Ubuntu hides most of the system’s default autostart entries from this dialog. To view them, run the following command in a terminal:

Run the command
sudo sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop


image

Disable entries by unchecking their check boxes instead of clicking the Remove button







image

Copied from the link
https://www.howtogeek.com/115797/6-ways-to-speed-up-ubuntu/


Friday, June 26, 2020

A great way to increase swap on ubuntu

The article is copied from ubuntu community as it is .

In case you don't want or you're not sure how to create a swap partition, you can create a swap file which will work in the same way as partition. Here are the steps (using terminal):
  1. Create an empty file (1K * 4M = 4 GiB).
    sudo mkdir -v /var/cache/swap
    cd /var/cache/swap
    sudo dd if=/dev/zero of=swapfile bs=1K count=4M
    sudo chmod 600 swapfile
    
  2. Convert newly created file into a swap space file.
    sudo mkswap swapfile
    
  3. Enable file for paging and swapping.
    sudo swapon swapfile
    
    Verify by: swapon -s or top:
    top -bn1 | grep -i swap
    
    Should display line like: KiB Swap: 4194300 total, 4194300 free
    To disable, use sudo swapoff swapfile command.
  4. Add it into fstab file to make it persistent on the next system boot.
    echo "/var/cache/swap/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab
    
  5. Re-test swap file on startup by:
    sudo swapoff swapfile
    sudo swapon -va
    
    Note: Above commands re-checks the syntax of fstab file, otherwise your Linux could not boot up properly.

Thursday, June 25, 2020

Making ubuntu as default OS on windows 10

I was able to successfully  install ubuntu  by following the documentation
from ubuntu website but my computer was not  booting  ubuntu by default .

After struggling a lot, Step 3 worked for me . You can directly go to step 3 instead of trying Step 1 and 2

1)  I executed the below instructions which I found after searching in google
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
 
The above steps installed boot-repair and executed the 
boot-repair utility. 
 
2) The above step did not help me and my computer was still booting to 
Windows 10 by default. 
Then I did the below step after rebooting to windows 10. 
Ran the command prompt as administrator and executed the below step
 

bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi
 
Basically the above step made the GRUB as default bootloader 
instead of Windows Boot Manager which is also referred as 
OS boot Manager in the BIOS.
This step was advised in the step 1 by boot-repair utility itself 
if the boot-repair does not work.

 
 
3) The above solution only worked for one time and again the computer 
started to boot windows 10 by default.
Then I tried the below solution which finally worked for me
 
Invoke terminal
Sudo su 
cd  /boot/efi/EFI
mv Boot Boot_bak
cp -Rf ubuntu Boot
cd Boot
mv  shimx64.efi bootx64.efi 
cd ../
mv Microsoft Microsoft_bak
 


Sunday, May 20, 2018

Links

Backing up and restoring profile in IBM WebSphere

This is an incomplete article but will give you a good idea about moving WebSphere Application Server profiles from one system to another .
For WebSphere questionaires  refer to site http://www.doubleshout.com and http://middlewareplay.appspot.com


Taking a backup of profile

D:\IBM\WID7_WTE\runtimes\bi_v7\bin>

manageprofiles.bat -backupProfile -profileName qwps -backupFile qwpsBackup

INSTCONFFAILED: Cannot backup profile: For more information, consult D:\IBM\WID7
_WTE\runtimes\bi_v7\logs\manageprofiles\qwps_backupProfile.log.

In windows , you may have problem related to long paths . Therefore shortening the path of the backup file to D:\backupfile.zip   and executed the command again

 D:\IBM\WID7_WTE\runtimes\bi_v7\bin>manageprofiles.bat -backupProfile -profileName qwps -backupFile D:\backupfile.zip



INSTCONFSUCCESS: Success: The profile backup operation was successful.

D:\IBM\WID7_WTE\runtimes\bi_v7\bin>

Restore
  1. In a command prompt, browse to the \bin directory. Type cd \bin.
    For example: cd c:\Program Files\IBM\WebSphere\AppServer\bin
  2. Restore the profile. Type manageprofiles -restoreProfile -backupFile . For example
    manageprofiles -restoreProfile -backupFile c:\backup\AppSrv01yymmdd.zip
    The manageprofiles command-line tool always restores to the same path from which the profile was backed up.
  3. Verify that the profile is restored. Browse to the \profiles directory. For example: \profiles\AppSrv01. If the profile is restored successfully, a folder for the restored profile is displayed.

Note this method does not work across the hetrogenous platforms . If you have backed up in windows , then you can only restore in Windows.



Exporting and importing WAS profile

Server must be running
wsadmin.bat -port SOAP CONNECTOR PORT
where SOAP CONNECTOR PORT  is a variable depending on your server configuration
AdminTask.exportWasprofile(['-archive','D:/qwps.car'])


 Importing to my another standalone profile on Solaris platform where wsadmin.sh is evaluating JACL .I am not interested  to change wsadmin.properties from JACL to Jython. So I will just use the JACL version of the command.

$AdminTask importWasprofile {-archive /export/home/wps/qwps.car}
 
$AdminConfig save 


In order to regenerate the default certificates , change the hostname of node.
Refer to below link
http://ashandish.blogspot.sg/2015/06/changing-host-name-of-websphere-node.html 


Admin Console may not be working after importing the profile .I have imported the profile from Windows to Solaris.May be that's the reason I am not able to access admin console.

use the below command to install the admin console
wsadmin.bat –f deployConsole.py install

IBM link for the same is
http://www.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/tcon_console_inst_uninst.html 

It says composition unit with name isclite already exists.

I will try to remove and install

wsadmin.sh –f deployConsole.py remove
 
Remove is failing with the error that isclite.ear does not exists 
 
Now , I did a search for files with isclite as string 
 
I removed the directories cus and blas inside 
WAS_INSTALL_ROOT/profiles/PROFILE_NAME/config/cells/CELL_NAME/ ,

Now did again 

wsadmin.bat –f deployConsole.py install 
 
That is also not working and giving the error Virtual Host not found. I am aware of this
error but I can not modify the virtual host until I have admin console .

Before trying something else , I have decided to create a profile with same name , same 
cell name and same node name and then do the import . This way , it will be much cleaner .
 
After creating the profile , I have taken the backup before doing the import .
Started the server1 and now going to do the import .
 
 
 


after doing the reinstall of admin console , I found that   several variables have been created twice like WAS_INSTALL_ROOT , WBI_INSTALL_ROOT and location of few derby databases which were used in windows system such as MEDB , EVENTDB , WPRCSDB , Business Space was imported as it is .
The values of WAS_INSTALL_ROOT , WBI_INSTALL_ROOT can be observed from Environment --> WebSphere Variables
 
 


WBI_INSTALL_ROOT not found
Getting error
EJB Timer Service not started
First component in name DefaultEJBTimerDataSource not found
Viewed the DefaultEJBTimerDataSource by changing preferences to show built-in resources
While doing Test connection , getting error EJBTimerDB not found
used the below command to create all derby databases
setupEventCollector.bat -conntype none -profileName rwps 
whichever was giving error during the test connection  .
Used the same database name as per the datasource parameters
Uninstalled wpsFEMgr_7.0.0 as this is giving errors . I only want to run a web application .
Uninstalled BPCECollector_qnode_server1 as well.
Uninstalled the BSpacewebformsEnabler_qnode_server1
Resources-->Schedulers-->Create tables
 
 







Wednesday, July 12, 2017

Get connection pool usage in WebSphere

./wsadmin.sh -f test.jy -lang jython -port 8879 >> log.txt

Contents of test.jy will be

objectName=AdminControl.queryNames("*:type=DataSource,*")
templateArray=objectName.split('\n')
for object in templateArray: print AdminControl.invoke(object,'showPoolContents')

Now log.txt will contain the connection pool information for all the datasources.

This may be very useful when you want to know the connection pool usage of datasources.

 Usually , you will have security enabled  in your environment. In those cases, give the username and password fields as below.

 ./wsadmin.sh -f test.jy -lang jython -port 8879 -username admin -password password >> log.txt

 Otherwise  , you may keep checking the log.txt to see for any prompts . If there is any prompt for certificate acceptance or username, password.
Then you give the values accordingly on the prompt and connection pool datasource log will be generated after that.

Wednesday, March 1, 2017

Fixing indentation errors in python

Check for indentation error in python
python -m tabnanny yourfile.py
 
Then if you are using PyCharm as text editor then 
go to Code , reformat code 


There will be similar options in other text editors as well

Wednesday, February 15, 2017

Get rid of windows user getting locked everytime

If  you have recently changed your password and your user id is getting locked on a windows system in a LAN network.
 Then, this can be due to your connection  to a network share.
 The connection is using the old password from cache and  locking your ID  everytime .

Procedure to fix is as below :

type "net use" in command prompt
This will display all your connected sessions to network share

Now, Disconnect the network drive
Once again , type "net use" in command prompt .

Now type "klist purge" in command prompt.
This will remove the Kerberos authentication ticket from the machine . This was the one which was locking you everytime.

Thats it.

Thursday, February 2, 2017

Learning Java

Static methods in java belong to the class (not an instance of it). They use no instance variables and will usually take input from the parameters, perform actions on it, then return some result. 

Instances methods are associated with objects and, as the name implies, can use instance variables.


My Observation:
 If you try to invoke a static method using an instance object, you only get a warning that static method must be accessed in  a static way . Code will still run.  


An abstract class can have method implementations.
 

An abstract method does not have any implementation.
Serialization will convert the object into byte array and that can be saved  on disk which can be deserialized later . 

EJB is a part of JAVA EE or J2EE (Enterprise edition) .
J2SE is the standard edition of JAVA.
Hibernate is the open source api developed in Java only .
Basically in EJB , you have a remote interface ( to call the EJB remotely ) ,
a local interface or Home interface  ( to call the EJB locally ) and an implementation class.

A message driven bean only has an implementation class.

All the three Enterprise Java Bean's namely session bean, entity bean and message driven beans are collectively called as Enterprise beans as well .

sql commands

Find version of Oracle database instance 
 
SELECT * FROM V$VERSION
or
SELECT version FROM V$INSTANCE
 
 
Find the current ORACLE_SID you are logged in 
 
sqlplus sys as sysdba;

select name from v$database;
select instance from v$thread;
select ora_database_name from dual;
 
Find the current schema name you are logged in 

select sys_context('userenv','instance_name') from dual; 
select user from dual; 
select * from global_name; 
 
 
Find location of alert logs, alert log file name will be alert_ORACLE_SID.log
 
show parameter background;  
 
 
To find out the location of diagnostic info like trace , logs etc. 
select * from v$diag_info; 

Wednesday, February 1, 2017

MicroSoft Office Tips and Tricks

In Word 2013 and Word 2010 you can go to specific page in the Word document using the Find and Replace dialog.
To display the Find and Replace dialog, Navigate to Home menu and click on the drop down arrow under Find menu at the right corner


Microsoft excel go to next line in cell
  1. Double-click the cell in which you want to insert a line break.
  2. Click the location where you want to break the line.
  3. Press Alt+Enter to insert the line break.



Tuesday, January 31, 2017

Create first hibernate project

Create a Java Project



Click Next and Finish


Right Click the project and create new folder lib


Download hibernate with all dependencies  from the below link



And copy paste to the lib folder


Create a new Java Package


Create a new Class


We have a table login with two columns

Accordingly that
We write the following code in aHibClass.java
package aHibPackage;

public class aHibClass {

   private String UserId;
   private String Password;
   
   public String getUserId()
   {
   return UserId;
   }
   public void setUserId(String UserId)
   {
   this.UserId=UserId;
   }
   public String getPassword()
   {
   return Password;
   }
   public void setPassword(String Password)
   {
   this.Password=Password;
   }

The file aHibClass.class is also referred to as persistence class file .
   
Right Click the package , create a new file login.hbm.xml and click finish




The file login.hbm.xml is also referred to as mapping file .
In the mapping file , we have mentioned about the table and its columns . The id tag is used for the column which is the primary key and rest of the columns are referred as property.

Now , we will create the configuration file .

Right click the src under the project and create a new file hibernate.cfg.xml  with the contents as below
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
oracle.jdbc.driver.OracleDriver
jdbc:oracle:thin:@localhost:1521:bph
ashish
password
org.hibernate.dialect.Oracle10gDialect
false
false
update




create .If we are assigning this value as create,it will create table in database automatically when we run the application.

Download the Oracle  JDBC driver jar file and add it to the build path of the project for the driver class file.


Now , we create the test class that inserts the record
HibTest with the main method

package aHibPackage;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

public class HibTest {
public static void main(String[] args) {
       Configuration cfg = new Configuration();
         cfg.configure("hibernate.cfg.xml");
         SessionFactory factory = cfg.buildSessionFactory();
        Session session = factory.openSession();
        aHibClass login = new aHibClass();
        login.setUserId("Ashish1");
        login.setPassword("Password2");
         Transaction tx = session.beginTransaction();
           session.save(login);
            tx.commit();
           session.close();
           factory.close();
           System.out.println("Objectis  saved successfully");
   }

}

Right click the project and make sure all the jars added earlier into lib folder are present in the build path of the project. If not , add them manually.


Getting the error
The type java.lang.AutoCloseable cannot be resolved. It is indirectly referenced from required .class files   .



Added an alternate JRE System Library (JDK 1.7.0_80) as my default JRE System library seemed to be out of date







Getting the error

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/hibernate/cfg/Configuration : Unsupported major.minor version 52.0
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
   at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:358)



Downloaded the jdk 1.8 version and added it to the project build path .

Final build path looks as below
Earlier , I have removed the JBoss related jars but I have to add them later as I was getting few Class Not Found exceptions .


Now , we can run HibTest.java as a Java application and test the Sample Hibernate Java code.

This code is simpler in a way than EJB as in EJB , we have to define objects mapped to database also in a java class file whereas here we have the mapping in a xml file .


Hibernate is perfectly suited for creating mapping files . Later , we can use either Hibernate or J2EE ( EJB session beans ) to include logic and DML statements.