Skip to main content

Posts

Showing posts from February, 2012

Running HTTPS - Tomcat - Ubuntu 11.04

Today my friend wanted to setup HTTPS implementation on his tomcat server. So here how we did it. Installing Tomcat on Ubuntu 11.04 ahmed@ubuntu:~$ sudo apt-get install tomcat6 ahmed@ubuntu:~$ sudo apt-get install tomcat6-admin Here is complete information on howto install tomcat on Ubuntu 11.04. https://help.ubuntu.com/11.04/serverguide/C/tomcat.html Next once we have tomcat installed here is what we need to do. Creating KeyStore File ahmed@ubuntu:~$  keytool -genkeypair -alias tomcat -keyalg RSA -keysize 1024 -dname "CN=localhost, OU=Organization, O=Company Name, L=City, S=State, C=US" -validity 365 -keystore keystore Enter keystore password: <enter a new password here> Enter key password for <tomcat>         (RETURN if same as keystore password): <just hit enter here> The password you enter in the first password prompt will be the password for the " keystore " file where your server certificate i...

Code Jam @ Saggezza, Bangalore

Passionate about Java Coding? Join the day long fun on 25th Feb 2012 at Saggezza, Bangalore Office. For details: http://www.saggezza.com/codejam .

SVN Migration - one Server to Another

Today we were migrating our Repos from One server to Another.So though to share the information. If some might need it. Attached is the document which will help you migrate SVN. Taking SVN Dump etc. Creating_and_Migrating_SVN_Repository.pdf Download this file

Proxy Transaction - Proxy Server Handshake

A Picture say a thousand words. Here is the information about, Proxy Server Handshake.

MAC for specific Adapter on Linux

Today was working on getting a unique information for a system. And MAC would be enough for my requirement. (Need not go for a UID). Below is the code to find MAC for a specific Adapter. "eth0" for my case. Only different thing here is the structure ifreq which I used for the first time. Here is the struct information. struct ifreq {     char    ifr_name[IFNAMSIZ];/* Interface name */     union {             struct sockaddr ifr_addr;             struct sockaddr ifr_dstaddr;             struct sockaddr ifr_broadaddr;             struct sockaddr ifr_netmask;             struct sockaddr ifr_hwaddr;             short   ifr_flags;             int     ifr_ifindex;             int...

PostgreSQL Setup - Configuration

My friend wanted to setup PostGreSQL with Replication. (Master / Slave Setup). So I agreed to help him out. Since I have not done anything on PostgreSQL before, so though to document it as I go. First in this blog post, I will just cover. Setting up two virtual machines (MASTER / SLAVE). Getting both the VMs to have postgreSQL 9.1 installed and configured. Information about the VM Machines Master : 172.16.167.130 Slave : 172.16.167.129 Now Lets Start. First, Lets setup VMWare setup to. Installing VMware Player on Ubuntu 11.10. Install required packages build-essential and linux-headers sudo apt-get install build-essential linux-headers-$(uname -r) Download the latest VMware player and execute below command. $ gksudo bash ~/Downloads/VMware-Player-3.1.4-385536.i386.bundle This will bring up the installer interface and you can continue after that. Note: this assumes the location of your Downloads folder is ~/Downloads. Now lets install Postg...

Open ports on UFW (uncomplicated Firewall - Ubuntu)

Open ports on UFW (uncomplicated Firewall - Ubuntu). I wanted to unblock 5432 port for a PostGre SQL setup. Here is how you do it. To check status for firewall ahmed@ahmed-work-horse:~$ sudo service ufw status ufw start/running you can also use this command to check status ahmed@ahmed-work-horse:~$ sudo ufw status Status: inactive ahmed@ahmed-work-horse:~$ sudo ufw status Status: inactive ahmed@ahmed-work-horse:~$ sudo ufw enable  Firewall is active and enabled on system startup If the status is not  stopped/waiting , you can enable it using the below command ahmed@ahmed-work-horse:~$ sudo ufw enable To open a port say 5432: ahmed@ahmed-work-horse:~$ sudo ufw allow 5432 To block/close an opened port: ahmed@ahmed-work-horse:~$ sudo ufw deny 5432 To remove a rule, use delete followed by the rule: ahmed@ahmed-work-horse:~$ sudo ufw delete deny 5432 It is also possible to allow access from specific hosts or ...

SQUID on Ubuntu Setup with Authentication

Today, My buddy wanted to setup a proxy server for his project. So I volunteered to get it done. Here goes nothing. First lets install SQUID (on Ubuntu) ahmed@ahmed-work-horse:~$ sudo apt-get install squid By Default proxy will be running on port  3128 And will  deny  all connections :) you can change this by changing the line below in  /etc/squid/squid.conf  file. # is a comment in conf file   #http_access deny !Safe_ports Replace the above line with line below http_access allow Safe_ports or http_access allow all Creating a user First create a user password file using  htpasswd  command.  htpasswd  is used to create username and password for basic authentication of squid users. ahmed@ahmed-work-horse:~ $ sudo htpasswd -c /etc/squid/passwd proxy_user New password:  Re-type new password:  Adding password for user proxy_user Make sure squid can read passwd file: ahmed@ah...

GIT Create a Branch and Merging

My previous post was about basic Creating GIT repos server / client Before we start you can also get more information about Branching here  http://book.git-scm.com/3_basic_branching_and_merging.html Now lets create  Branches and Merge new branch to "master" branch. Later we will push this update to the remote GIT SERVER repos. [To setup remote server see my previous post ] I will keep it simple for now, later on as I learn complex GIT stuff, will post it :) Commands we will be using. $ git branch - lists all the branches in the current repos $ git branch - creates a new branch.   $ git checkout     - moves control the branch. $ git merge    - merges current branch with  . $ git push origin --all - pushes all data to the remote server repos. Create a Branch Lets create branch and lets call it "experiment" ahmed@ahmed-work-horse:~/ahmed/test.git/ test $ git branch  * master ahmed@ahmed-work...

Setting up GIT Server/Client

I was working my project today and came across GIT. So wanted to tryout as I had heard a lot about GIT. I am still learning about GIT this an initial doc to have anyone to get started. Before you start, I recommend you to go through the video below. http://youtu.be/HaSDIdNkCDQ   Here is the link to GIT  http://git-scm.com/ Few command you will see which are commonly used. $ git init - Initialize GIT repository $  git status - show status of the repository - modified files etc $ git add - Adds file/directory to staging area (ready for commit/check-in $ git reset - removes file from staging area (not ready for commit) - changes to file will not be affected. $ git commit  - Commits data to repository (LOCAL repos) $ git push origin -all - Push data from LOCAL repos to SERVER repos $ git clone - Pulls data from SERVER to LOCAL repos Setting up GIT Server create a directory ahmed@ahmed-work-horse:~/Desktop$ mkdir t...