Showing posts from 2014

Setup PXE Booting to Install Windows and Linux with Serva

A new utility has just appeared which makes installing Windows XP, 2003, Vista, Win 7, Win 8 or Win 2K8 via PXE very easy! It is called Serva. It does NOT require the Windows WAIK to be installed and is quite a small download - with it you can set up a RIS and WDS server on your Windows PC and you don't need to even touch any existing DHCP server or router!

UTF-8 for Linux Crontab Scripts

Do you get special characters problem when executing your bash script from a cron job? And does the same script work fine when it is directly executed from the command line?

How to Configure Subdomain in Tomcat

Nesting each web app as the root webapp within the in server.xml by giving path=""

How To Change TimeZone of MySQL

The MySQL server maintains several time zone settings

SSL Converter

Use this SSL Converter to convert SSL certificates to and from different formats such as pem, der, p7b, and pfx. Different platforms and devices require SSL certificates to be converted to different formats. For example, a Windows server exports and imports .pfx files while an Apache server uses inpidual PEM (.crt, .cer) files. To use the SSL Converter, just select your certificate file and its current type (it will try to detect the type from the file extension) and then select what type you want to convert the certificate to and click Convert Certificate.

Upload the Signed Certificate for Elastic Load Balancing

When you receive your server certificate from the certificate authority (CA), it might be in a format that is not supported by IAM. Typically you receive a public certificate, one or more intermediate certificates and a root certificate. The intermediate certificates and the root certificate can come bundled in a file or as separate files. The file names may vary depending on the type of SSL certificate you purchase and the certificate authority.

Extracting public and private keys from a Java Key Store (JKS)

Using the keytool utility, it is easy to extract the public key of an already created "public-private" key pair, which is stored in a keystore.

How to Print Stack Trace of an Exception using Log4j

Log4j exception FAQ: "How do I print the stack trace of an exception using Log4j or Commons Logging?"

Difference Between utf8_general_ci and utf8_unicode_ci

Between utf8_general_ci and utf8_unicode_ci, are there any differences in terms of performance?

Running Tomcat on Port 80

By default Tomcat's HTTP connector listens on port 8080. Changing to port 80 in Linux environment can be quite a tricky issue, since by default listening on any port under 1024 require a privileged user, and for security considerations it is not recommended to run Tomcat with elevated permissions. This article discusses how to use authbind to achieve this; it also describes the way all this configuration can be automated for the sake of the creation of a script which can be used to initialize a freshly installed Linux instance. This is especially advantageous on Amazon EC2, where we can use this init-script to initialize a fresh instance just launched from an AMI; and indeed, for the sake of this article Amazon's "Amazon Linux Image 1.0" was used for testing. Please note that this is a CentOS 6-based linux distribution, for other distributions there are slight changes, like replacing "sudo yum install tomcat7" with "sudo apt-get install tomcat7" o…

Setup Jenkins with Bitbucket on EC2

Jenkins CI is the leading open-source continuous integration server.

Add a User to a Group on Linux

How can I add a user to a group under Linux operating system using command line options? How to add an existing user into a group in Linux using command line options?

Create Large Dummy File

Fsutil.exe is a built in filesystem tool that is useful to do file system related operations from command line. We can create a file of required size using this tool.

Tomcat Context Container

The Context element represents a web application, which is run within a particular virtual host. Each web application is based on a Web Application Archive (WAR) file, or a corresponding directory containing the corresponding unpacked contents, as described in the Servlet Specification (version 2.2 or later).

Tomcat Set Context Path for Web Application

Add a file called ROOT.xml in $CATALINA_BASE/conf/Catalina/localhost/

Tomcat Access Control based on IP

To implement IP filtering Tomcat offers the RemoteAddrValve class for filtering on IP and the RemoteHostValve for filtering on host name.

Keeping ssh Access Secure

There are several worms which attempt to exploit vulnerable SSH servers, by logging in to a host with a collection of usernames and passwords such as "admin/admin", "test/test", "root/root", etc. These shouldn't be of much concern if you're keeping good passwords, but there are simple ways to prevent them regardless.

Limit ssh Access by IP Address

To limit ssh access to a linux box based on originating IP address, edit /etc/hosts.allow:

Tomcat SSL Certificate Installation

CSR and SSL Certificate Installation in Tomcat Web Server

The Most Common Java Keytool Keystore Commands

Java Keytool is a key and certificate management utility. It allows users to manage their own public/private key pairs and certificates. It also allows users to cache certificates. Java Keytool stores the keys and certificates in what is called a keystore. By default the Java keystore is implemented as a file. It protects private keys with a password. A Keytool keystore contains the private key and any certificates necessary to complete a chain of trust and establish the trustworthiness of the primary certificate.

9 Common Mistakes People Make On HTML

Even the best coders make mistakes sometimes. When it comes to the markup language HTML, there are some mistakes that are more common than others. You should try and avoid these.

20 Iptables Examples For New SysAdmins

Linux comes with a host based firewall called Netfilter

cURL with HTTPS in Windows

If you want to use cURL with HTTPS in Windows, you can setup it easily

Linux Kernel /etc/sysctl.conf Security Hardening

How do I set advanced security options of the TCP/IP stack and virtual memory to improve security and performance of my system? How do I configure Linux kernel to prevent certain kinds of attacks using /etc/sysctl.conf? How do I set Linux kernel parameters?

CentOS Iptables Firewall Configuration Tutorial

How do I configure a host-based firewall called Netfilter (iptables) under CentOS / RHEL / Fedora / Redhat Enterprise Linux?

Allowing MySQL on Amazon EC2 to Accept Remote Connections

Amazon's EC2 is a really great platform for well, everything!

SSH Tunnel to Remote MySQL (Port Forwarding)

We block access to production MySQL servers over port 3306 for security reasons. Here is an example, use ssh tunnel to remote MySQL, connection string that proxies localhost port 13306 to port 3306 on the target system (port forwarding)

How to Support Full Unicode in MySQL Databases

Are you using MySQL's utf8 charset in your databases? In this write-up I'll explain why you should switch to utf8mb4 instead, and how to do it.

Tomcat - Redirecting Port 8080 to 80

Tomcat often sits behind an HTTP server such as Apache, which serves static content and proxies requests for dynamic content to Tomcat. Another popular option is to use squid as a reverse proxy. If for any reason you want Tomcat to serve all HTTP requests, you need it to listen on port 80 (and possibly 443). However, only the superuser can bind to TCP ports below 1024 on Linux, so making Tomcat listen on port 80 requires some extra work.

18 Top Tools for Java Developers

It's as true for Java developers as it is for woodworkers: You can't do the job right without the right tools. Fortunately, there are plenty of Java tools designed to make it significantly simpler to write good Java code and help you make your Java code even better.

Selenium Automating Web Applications for Testing

Selenium automates browsers. That's it! What you do with that power is entirely up to you. Primarily, it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) also be automated as well.

19 Things Java Developers Must Concentrate On

The term 'java developer' covers a wide range of candidates. It starts with fresh graduates looking for jobs and goes up till experienced Java Enterprise Edition developers.

Watir Automated Testing

Watir (Web Application Testing in Ruby), pronounced water, is an open-source family of Ruby libraries for automating web browsers. It allows you to write tests that are easy to read and maintain. It is simple and flexible.

jQuery Validation Wait Ajax Complete Before Submitting Form

A tip of jQuery Validation

Eclipse Tips and Tricks

This is a collection of Eclipse Tips and Tricks which I've learnt over time. You will be surprised how you can boost your productivity by learning just a few simple tecqniques!

JBoss Application Server Remote Debugging from Eclipse

Eclipse and JBoss supports standard debug mechanism: JPDA. Here is how to connect both and debug web application developed in Eclipse, deployed on JBoss.

Install apt-cyg for Cygwin

For a more convenient installer, you may want to use apt-cyg as your package manager.

JDBC: Insert Unicode UTF-8 Characters into MySQL

Just a quick heads up if you're looking to insert for example Japanese characters into a MySQL database.

Setup MongoDB

MongoDB (from "humongous") is an open-source document database, and the leading NoSQL database

Setup Ambari

Apache Ambari is a tool for provisioning, managing, and monitoring Apache Hadoop clusters. Ambari consists of a set of RESTful APIs and a browser-based management interface.

Snippet CSS

With snippet CSS, you can free your mind

Set MySQL Character Set and Collation to UTF-8 (RDS)

These are notes for how to set UTF-8 (UTF8) collation and character set in MySQL database server. There are also notes on how to set the dfeault collation and characters set to UTF-8 on Amazon RDS MySQL database instances.

Installing Linux Malware Detect (LMD) on CentOS

Malware is known as malicious software. It can be any script, app or anything which is harmful for our system and data in any kinds. Linux Malware detect (LMD) is a malware scanner for linux released under the gnu GPLv2 license, that is intended around the threats faced in hosted environments. It uses threat data from network edge intrusion detection systems to extract malware that's actively getting used in attacks and generates signatures for detection.

How Do I Enable Remote Access To MySQL Database Server

By default remote access to the MySQL database server is disabled for security reasons. However, some time you need to provide remote access to database server from home or a web server. This post will explain how to setup a user account and access mysql server remotely.

Crontab in Linux with 20 Useful Examples to Schedule Jobs

Linux crontab is similar to windows task schedulers. Crontab are very useful for routine tasks like scheduling system scanning, daily backups etc. Crontab executes jobs automatically in backend on specified time interval.

One Time Task Scheduling using "at" Command in Linux

At command can be useful for shutdown system at specified time, Taking one time backup, sending email as reminder at specified time etc. This article will help you to understand the working of at command with useful examples.Commands used with at:at : execute commands at specified time.atq : lists the pending jobs of users.atrm : delete jobs by their job number.Schedule first job using at commandBelow example will schedule "ls -l" command to be executed on next 9:00 AM once. # at 9:00 AM at> ls -l at> ^d job 3 at 2013-03-23 09:00 Use ^d to exit from at prompt.List the scheduled jobs using atqWhen we list jobs by root account using atq, it shows all users jobs in result. But if we execute it from non root account, it will show only that users jobs. # atq 3 2013-03-23 09:00 a root 5 2013-03-23 10:00 a rahul 1 2013-03-23 12:00 a root Fileds description:First filed: job id Second filed: Job execution date third filed: Job exectuion time Last fileld: User …

Parallel Processing and Multi-Core Utilization with Java

In order to harvest the full power of a multi-core processor the software application must be able to execute tasks in parallel utilizing all available CPUs. Parallelization of a process consist of breaking up a large single process into multiple smaller tasks that can run in parallel and once finalized can be combined obtaining an overall improvement in performance. The result is the execution of a single task or process by multiple processors or CPUs "Parallel Processing", not to be confused with concurrency.

Java Concurrency - Executors and Thread Pools

We'll learn how to start new threads cleanly and to manage thread pools.

Multi Schemas in Seasar

Config multi-database in an Web Application using Seasar framework

Snippet MySQL

With snippet MySQL, you can free your mind

Using OAuth 2.0 to Access Google APIs

Google APIs use the OAuth 2.0 protocol for authentication and authorization. Google supports common OAuth 2.0 scenarios such as those for web server, installed, and client-side applications.

How To Change TimeZone of Linux

We run CentOS for many of our server builds and this question often comes up. Hope this helps.

10 Awesome SSH Hacks

Secure Shell (SSH) is widely used by network administrators to control Web and other kinds of servers remotely. The UNIX-based command interface and protocol can also be used to tunnel your traffic, transfer files, mount remote file systems, and much more. We have compiled here a list of 10 awesome SSH Hacks.

Generate Google API Refresh and Access Tokens in PHP

You are able to access private user information through Google API by means of an access token which expires after 3600s. So what happens when you want to retrieve information offline like what most web applications do? Here comes the refresh token. This guy does not expire and you are able to generate a new access token using REST.

Doubleclick for Publishers - Java Google APIs

DoubleClick for Publishers (DFP) Small Business is a free ad management solution that helps growing publishers sell, schedule, deliver, and measure all of their digital ad inventory.

Helpful Eclipse Shortcuts

Every new IDE requires some time to learn and become accustomed to. After using Eclipse for many years, we have found the following shortcuts speed up software development significantly.

10 Tips For Java Debugging Using Eclipse

Java debugging is an important part of programming in the language. You can use the Eclipse IDE for this purpose. It helps you find out where you have made a mistake and lets you keep the code clean

Troubleshoot Web Server

With troubleshoot of Web Server, you can free your memory

Ant build.xml Example

Writing a Simple Buildfile

Maven pom.xml Example

Simple Project's pom.xml example file

Snippet Maven

With snippet Maven, you can free your mind

What is My Public IP

Lots of times you need to determine your public IP address, if you are using Linux operating system to power your PC, you may use some good console commands to guess your public IP address.Most of these methods will return you the local IP and not the public IP of your proxy if you are behind one

12 Advanced Commands For Linux Server Admins

So, you've read many tutorials and watched many videos and now you are an advanced Linux user. Well, congratulations. But there's still more to learn! Here is a list of Linux commands that will come in handy when you are the almighty admin!

5 Superfast Linux Command Line Shortcuts

Those who are deep into Linux know how powerful the command line is and once you get used to it, nothing is as easy as doing stuff from command line. So if you are someone who spends most of their time on command line, here we bring to you some handy short cuts which will not only save your time but will also make your interaction with the Linux command line much more interesting

12 Penetration Testing Add-Ons For Firefox

Firefox is not popular only for its open source nature but it can also be turned into a very effective penetration testing tool. Mozilla has its own section for add-ons and all of the following are available.

10 Extensions To Make Google Chrome A Penetration Testing Tool

While the open source browser has many options, Google's Chrome browser isn't too far. Take a look at these 10 add-ons that can make the Chrome browser into a pen testing giant!

10 Ways To Become A Good Programmer

A good programmer is not a word that can find its definition in the dictionary. Good programming skills are essential to success and in discovering the joys of programming. As seen with many successful programmers over the past, here are some points that can be followed by those who are in pursuit of a successful career in programming