Skip to main content

Posts

Exporting SSL certificates of a website

Exporting a SSL certificate can be a rather challenging if you are a mac user since the browsers such as chrome does not provide that option. Instead you can only view the certificate. This is the work around I found. command -  echo -n | openssl s_client -connect www.linkedin.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /Users/dinukshakandasamanage/Documents/$SERVERNAME.cert echo -n gives a response to the server, so that the connection is released. This will save the certificate to /Users/dinukshakandasamanage/Documents/$SERVERNAME.cert. You can define the path you want the certificate to be saved. sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'   will extract only the necessary content that is preferred by the key stores.

Blockchains Explained Simply

Introduction Blockchain is a decentralized database or a distributed ledger that holds transactions. A blockchain is typically distributed over a peer to peer network where each node in the network hold identical real-time copy of their ledger. A block in a blockchain is similar to a page in a ledger. It may represent a transaction/contract/certificate of ownership/state of authenticity/proof. Each block in the blockchain is linked to the hash of the previous block. Once a block is chained it cannot be modified or removed from the chain. There can be two ways to corroborate the accuracy of the ledger. Permissioned (where participants that contribute are preselected) Unpermissioned (where anyone can contribute) Unpermissioned ledger Anyone can contribute to the ledger. In bitcoin, the actors can contribute through a process called mining. This means that no single person has control over any transaction. Permissioned ledger When a new record is added, ...

Algorithm Simulator for Selection Sort and Insertion Sort using Java

This is an Algorithm Simulator coded in Java as my Design Analysis and Algorithm Project (2nd Year). It simulates Selection Sort and Insertion sort using animations which are written from scratch using java threads. It also supports both Ascending and Descending sorting. This is the link to the GitHub Repo: https://github.com/dinuish94/AlgorithmSimulator.git

Student Information System - Java (SLIIT - ST2 PROJECT)

Student Information System (Github Project) This system is developed in Java and mySQL as a group project by me and 3 other members during a period of 1 month. The system allows the administrator to,  enroll students to the system  update enroll information  add/update course and degree program details  generate reports  create exams and edit relevant information  calculate gpa of the relevant exam  assign lecturers to courses  add lecturers/update details Lecturers to,  assign course grades  view their feedback  generate reports  view student / course / degree program details Students to,  view their profile  view their grading information  give feedback to lecturers   view lecturer / course / degree program details and other features. Below are some interfaces of the project. (Splash Screen) (Login) (Admin View) (Student Re...

SIMPLE BLACKJACK GAME IN JAVA (CONSOLE)

import java.util.Scanner; class BlackJack{     public static void main(String[] args)      {         int player_random1 = 100;         int player_random2 = 100;         while(player_random1 >= 12 || player_random2 >= 12  || player_random1 < 3 || player_random2 <3)         {             player_random1 = (int)(Math.random()*100);             player_random2 = (int)(Math.random()*100);         }                  int player_total = player_random1 + player_random2;                  System.out.println("You get a "+player_random1+" and a "+player_random2);         System.out.println("Your total is "+player_total); if(player_total==21)  ...

HANGMAN USING JAVA (CONSOLE)

SOURCE CODE import java.util.Scanner; class Hangman {     public static void main(String[] args) {         String words_list = "cheese puppies hello tree mango pineapple flowers basket lamp ceiling";         String[] wordsAsArray = words_list.split(" ");         int index;                  //to pick a random integer which is less than the number of array elements and greater than or equal to 0         do{             index =(int) (Math.random() * 10);         }         while(index<0 || index>=wordsAsArray.length);                  //To pick the word that corresponds to the random index picked         String randomWord = wordsAsArray[index];             ...

TIC TAC TOE GAME IN JAVA (CONSOLE)

SOURCE CODE import java.util.Scanner; class TicTacToe {     public static void main(String[] args) {         char[][] main = new char[3][3];                  for(int i=0; i<3; i++){             for(int j=0; j<3; j++){                 main[i][j]=' ';             }         }                  for(int i=0; i<4; i++){             if(input(main, 'O')){                 return;             }             if(input(main, 'X')){                 return;             }         }         //1st...