Monday, September 16, 2024

BASIC Commands for Liberty profile

 BASIC Commands for Liberty profile


server start <AppName>

server stop <AppName>

CLEAN CACHE

server stop <AppName>

server start <AppName> --clean

server stop <AppName>

server  start <AppName>

Version Info

productInfo.sh --version


Client

client run <clientName>

client help


Manual Mustgather

server javadump <AppName> --include =heap

server package <AppName>




Saturday, March 18, 2023

Overview of One-Way SSL and Two-Way SSL

  Useful SSL Tutorial link


An Overview of One-Way SSL and Two-Way SSL | TutorialsPedia

Commonly used openssl commands are as follows:

Commonly used openssl commands are as follows: 


Check a certificate

openssl x509 -in certificate_name -text -noout

Get all certificates from a server

openssl s_client -connect host:ssl_port -showcerts

Convert a DER format certificate to PEM format

openssl x509 -inform der -in path_to_DER_certificate -out path_to_PEM_certificate

Convert a .pfx file to a JKS store

keytool -importkeystore -srckeystore path_to_.pfx_file -srcstoretype pkcs12 -destkeystore path_to_the_jks_file -deststoretype JKS -srcstorepass pfx_passwd -deststorepass pfx_passwd

Convert a .jks file to PKCS12 format

keytool -importkeystore -srckeystore path_to_.jks_file -destkeystore full_path_to_.p12_file-srcstoretype JKS - deststoretype PKCS12 -deststorepass pkcs12_store_password

Extract a private key from a .pfx file

openssl pkcs12 -info -in path_to_.pfx_file -nodes -nocerts -out private_key_file_name

Extract a public certificate from a .pfx file

openssl pkcs12 -in path_to_.pfx_file -out path_to_certificate_file -nokeys

Simple Bash Script

 

Bash is a Unix command line interface for interacting with the operating system, available for Linux. Bash scripts help group commands to create a program. All instructions that run from the terminal work in Bash scripts as well.

Bash scripting is a crucial tool for system administrators and developers. Scripting helps automate repetitive tasks and interact with the OS through custom instruction combinations. The skill is simple to learn and requires only basic terminal commands to get started.

Please find the below sample script of backuping the txt file .

#!/bin/bash

Path=/opt/folder1/folder2

cp $path/folder3/test.txt test.txt_backup_original

Linux Directory Structure

 Useful Information of Linux Directory Structure.




root directory:


/bin – binary or executable programs.

/etc – system configuration files.

/home – home directory. It is the default current directory.

/opt – optional or third-party software.

/tmp – temporary space.

/usr – User related programs.

/var – log files.


System Configuration Files:


/etc/bashrc – It is used by bash shell that contains system defaults and aliases.

/etc/crontab – A shell script to run specified commands on a predefined time interval.

/etc/exports – It contains information on the file system available on the network.

/etc/fstab – Information of the Disk Drive and their mount point.

/etc/group – It is a text file to define Information of Security Group.

/etc/grub.conf – It is the grub bootloader configuration file.

/etc/init.d – Service startup Script.

/etc/lilo.conf – It contains lilo bootloader configuration file.

/etc/hosts – Information of IP and corresponding hostnames.

/etc/hosts.allow – It contains a list of hosts allowed accessing services on the local machine.

/etc/host.deny – List of hosts denied to access services on the local machine.

/etc/inittab – INIT process and their interaction at the various run level.

/etc/issue – Allows editing the pre-login message.

/etc/modules.conf – It contains the configuration files for the system modules.

/etc/motd – It contains the message of the day.

/etc/mtab – Currently mounted blocks information.

/etc/passwd – It contains username, password of the system, users in a shadow file.

/etc/printcap – It contains printer Information.

/etc/profile – Bash shell defaults.

/etc/profile.d –  It contains other scripts like application scripts, executed after login.

/etc/rc.d – It avoids script duplication.

/etc/rc.d/init.d – Run Level Initialisation Script.

/etc/resolv.conf – DNS being used by System.

/etc/security – It contains the name of terminals where root login is possible.

/etc/skel – Script that initiates new user home directory.

/etc/termcap – An ASCII file that defines the behavior of different types of the terminal.

/etc/X11 –  Directory tree contains all the conf files for the X-window System.


User Related Files:


/usr/bin – It contains most of the executable files.

/usr/bin/X11 – Symbolic link of /usr/bin.

/usr/include – It contains standard include files used by C program.

/usr/share – It contains architecture independent shareable text files.

/usr/lib – It contains object files and libraries.

/usr/sbin – It contains commands for Super User, for System Administration.


Virtual and Pseudo Process Related Files:


/proc/cpuinfo – CPU Information

/proc/filesystems – It keeps the useful info about the processes that are running currently.

/proc/interrupts – it keeps the information about the number of interrupts per IRQ.

/proc/ioports – Contains all the Input and Output addresses used by devices on the server.

/proc/meminfo –  It reports the memory usage information.

/proc/modules – Currently using kernel module.

/proc/mount – Mounted File-system Information.

/proc/stat –  It displays the detailed statistics of the current system.

/proc/swaps –  It contains swap file information.


Version Information File:


/version – It displays the Linux version information.


Log Files:


/var/log/lastlog – It stores user last login info.

/var/log/messages – It has all the global system messages.

/var/log/wtmp – It keeps a history of login and logout information.

Useful HTTP Status Codes

 What are Useful HTTP Status Codes?

  • 1xx – Informational Response (These status codes are all about the information received by the server when a request is made).
  • 2xx – Success (This status code depicts that the request made has been fulfilled by the server and the expected response has been achieved).
  • 3xx – Redirection (The requested URL is redirected elsewhere).
  • 4xx – Client Errors (This indicates that the page is not found).
  • 5xx – Server Errors (A request made by the client but the server fails to complete the request). 

100 Continue 

101 Switching Protocol 

102 Processing (WebDAV) 

103 Early Hints 


200 OK 

201 Created 

202 Accepted 

203 Non-Authoritative Information 

204 No Content 

205 Reset Content 

206 Partial Content 

207 Multi-Status (WebDAV) 

208 Already Reported (WebDAV)

226 IM Used (HTTP Delta encoding) 


300 Multiple Choice

301 Moved Permanently 

302 Found

303 See Other

304 Not Modified 

305 Use Proxy 

306 Unused 

307 Temporary Redirect 

308 Permanent Redirect 


400 Bad Request 

401 Unauthorized 

402 Payment Required 

403 Forbidden 

404 Not Found 

405 Method Not Allowed

406 Not Acceptable 

407 Proxy Authentication Required

408 Request Timeout

409 Conflict 

410 Gone

411 Length Required 

412 Precondition Failed 

413 Payload Too Large 

414 URI Too Long 

415 Unsupported Media Type 

416 Range Not Satisfiable 

417 Expectation Failed 

418 I’m a teapot

421 Misdirected Request

425 Too Early 

426 Upgrade Required 

428 Precondition Required

429 Too Many Requests 

431 Request Header Fields Too Large

451 Unavailable For Legal Reasons 


500 Internal Server Error 

501 Not Implemented 

502 Bad Gateway

503 Service Unavailable 

504 Gateway Timeout 

505 HTTP Version Not Supported 

506 Variant Also Negotiates 

507 Insufficient Storage (WebDAV)

508 Loop Detected (WebDAV) 

510 Not Extended 

511 Network Authentication Required

Useful WEB Error Codes

 How to find the WEB Error Codes?

Please find the below Codes.

1. 400 : Bad Request

2. 401: Unauthorized Error

3. 402: Payment Error

4. 403: Forbidden Error

5. 404: Not Found

6. 405: Method not allowed

7. 406 : Not acceptable

8. 407 :Proxy authentication required

9. 408: Request Timeout

10. 409 : Conflict

11. 410: Gone

12. 411: Length Required

13. 412: Precondition Failed

14. 413: Payload Too Large

15. 414: URL Too Long

11. 500 : Internal Server Error

12. 501 : Not Implemented

13. 502 :Service Temporarily Overload

14. 503: Service Unavailable