Archive for the ‘My Posts and Articles’ Category
TrueCrypt is a powerful yet free Open-Source disk encryption Software. I am quite satisfied with the software that I decided to introduce it here in my blog, may all future releases remain free to use!
With TrueCrypt you can maintain an on-the-fly-encrypted volume (data storage device). On their website they explain ‘On-the-fly encryption’ as an automatic continuing encryption process to data right before it is saved and decrypted right after it is loaded. In simple words, you will end up having an encrypted volume to secure all your sensitive data inside. This volume can be mounted and accesses like any regular folder in your system each time you provide the right password and then dismounted to prevent access.
What I personally think makes this software special is the ease of using encrypted files right from the secured volume to the computer’s RAM. As such, if you have a video file, you will not wait until it is fully decrypted to play it, instead the stream will be decrypted right into the RAM while playing, the performance and speed is quite similar to playing any regular video file you have on your system. Brilliant, isn’t it?
Read the rest of this entry »
Unlike Telnet, Secure Shell (SSH) encrypts the connection between the remotely connected hosts and doesnt trransfer your password in plain text. As such SSH is more secure and must be used for remote connections. In this post I will install, configure and connect 2 computers running Ubuntu and CentOS. The connection will be tested with a password-based authentication followed by using public and private key pairs to establish trust between the hosts.
To start this trial, install OpenSSH server and client to Ubuntu using:
P.S. make sure you login as root when required.
apt-get install openssh-client apt-get install openssh-server
Leonardo Fibonacci was a talented Italian mathematician. He is best known for a number sequence named after him known as the Fibonacci Numbers.
These numbers take the following pattern:
0, 1, 1, 2, 3, 5, 8, 13, 21 …
The series is formed by adding two numbers in the series to generate the third.
The Rabbit Puzzle that Fibonacci investigated in the year 1202 is a great example to introduce you to the significance of the Fibonacci number series. Read the rest of this entry »
You can remotely access a Sisco IOS (Internetworking Operating System) in what is knows as an EXEC session to control a router using its CLI (Command Line Interface).
EXEC sessions are separated into a basic user EXEC level and a privileged EXEC level to run configuration and other critical commands.
Critical Cisco Router configuration commands
‘————’ is used to prefix comments in this small tutorial
Router>enable ———— enable is used to change into privileged level
Password: —————— if passwords is enabled
Router# ———————- # means we are in privileged level
Router#disable ———– switch to user EXEC level
Router>
Router>ping xxx.xxx.xxx.xxx ———— ping is supported
The show command is used to troubleshoot your Cisco router
Read the rest of this entry »
If your objective is to develop a software with highly customized Windows then start a new WPF application in Visual Studio (VS). Currently I am developing a new ‘Desktop Sticky Notes’ software hence it is important that my windows (notes) are designed like an e-replica of a real sticky note on your desktop.
As such I started a new WPF project, dragged a Grid control from the Toolbox and decided to set my WindowStyle property to None, AllowTransparency to True and finally ResizeMode to NoResize. These steps would generate the following XAML code in VS:
1 2 3 4 5 6 7 8 | <window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" ResizeMode="NoResize" AllowsTransparency="True" Opacity="1" WindowStyle="None"> <grid> <grid Height="311" HorizontalAlignment="Left" Name="grid1" VerticalAlignment="Top" Width="503" /> </grid> </window> |
First Fit algorithm is used to allocate jobs in the memory in arbitrary order. I will only explain it briefly assuming you wouldn’t be interested in the code unless you know what this algorithm is all about. It works by placing each job in the first memory block that can accommodate it (memory block is equal to or larger than job size).
Read the rest of this entry »
Few days ago I published (here) an applet to encrypt/decrypt Caesar’s cipher. An issue I faced was that an applet must be signed to access windows clipboard. However, a page with a singed applet welcomes you with a security warning! which I so want to avoid on my site. I think that visitors to my blog should not be asked to deal with security messages from their system. The problem now is that users can not copy/paste text from and to the applet unless they run it on their local machines. As such, I thought the applet is functional and can be tested online and if any user require to copy/paste text (s)he may download the applet’s jar file and execute it locally whenever they want. Running the applet on your local machine does not include security restrictions on the code.
To create an executable a jar file there should be a main class (a class with a main method) inside the jar to run the software. An applet has no main method since it is usually designed to work inside a web browser. To make the jar file executable I had to do two things:
- One
I created a new class inside the jar file as a main class which I called StartClass. The job of this class is to call and host the applet; hence if the jar file is executed, the applet method is invoked. Check out the following code that I used supported by few comments to explain what it does.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | package CaesarCodePackage; public class StartClass { public static void main(String [] args) { // create an object of type CaesarCode which is the main applet class CaesarCode theApplet = new CaesarCode(); theApplet.init(); // invoke the applet's init() method theApplet.start(); // starts the applet // Create a window (JFrame) and make applet the content pane. javax.swing.JFrame window = new javax.swing.JFrame("Caesar's Cipher"); window.setContentPane(theApplet); window.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE); window.pack(); // Arrange the components. window.setVisible(true); // Make the window visible. } } |
- Two
I had to edit the MANIFEST.MF file and add the following line to define my main class correctly
Read the rest of this entry »
In cryptography, Caesar cipher is one of the simplest encryption techniques. It is a substitution cipher in which each letter in the plaintext is replaced by a letter after a fixed number of positions down the alphabet. However, this applet shifts each character (letter, number of symbol) after a number of positions down the ASCII table. Caesar’s cipher is categorised as a symmetric encryption and the secret key in this case is the number of shifts!
- To encrypt, select the encode mode, number of shifts and click Run.
- You may encode a message multiple times.
- To Decrypt, select the Read the rest of this entry »
EditPlus is my ultimate friend when it comes to programming, especially for Java. While other IDEs such as Eclipse and NetBeans are features-rich and hard-to-replace by a light weight editor like EditPlus; you will always need a neat environment for your small projects. Think of all the wasted time and unnecessary code forced by NetBeans every time you start a new project!
EditPlus can be downloaded from: http://www.editplus.com/. To compile and run Java files go to
Tools -> Configure User Tools then click ‘Add Tool >>‘.
Now fill in the following Read the rest of this entry »

regex in notepad++
Searching a string using the ‘Find‘ or ‘Find & Replace‘ function in text editors highlights the relevant match (e.g. searching ‘le‘ highlights it inside words such as ‘apple‘, ‘please’ etc). However, some advanced editors such as Notepad++ (I mention Notepad++ in my examples since its my favourite so far!) supports the use of regex, which recently saved me hours of manually replacing strings and numeric values in files containing HTML and JacaScript codes.


