Posts

Linux OS Backup and Recovery

Image
Source :http://relax-and-recover.org/documentation/getting-started This quick start guide will show you how to run Relax-and-Recover from the git checkout and create a bootable USB backup. Start by cloning the Relax-and-Recover sources from Github: git clone https://github.com/rear/rear.git Move into the rear/ directory: cd rear/ Prepare your USB media. Change /dev/sdb to the correct device in your situation. Relax-and-Recover will ‘own’ the device in this example. This will destroy all data on that device. sudo usr/sbin/rear format /dev/sdb Relax-and-recover asks you to confirm that you want to format the device: Yes The device has been labeled REAR-000 by the ‘format’ workflow. Now edit the ‘etc/rear/local.conf’ configuration file: cat > etc/rear/local.conf < Now you are ready to create a rescue image. We want verbose output. sudo usr/sbin/rear -v mkrescue The output I get is: Relax-and-Recover 1.13.0 / $Date$ Using log file: /home/jeroen/tmp/

Deploying Jenkins in CentOS

1. Download the software to "/usr/src" and Install Java JDK - jdk-6u30-linux-i586.rpm     $ rpm -ivh jdk-6u30-linux-i586.rpm 2. Download the software to "/usr/src" and Install Apache Tomcat     $ cd /usr/src     $ tar -xzvf apache-tomcat-6.0.35.tar.gz     $ mv apache-tomcat-6.0.35 tomcat 3. Download the software to "/usr/src" and Install grails-1.3.7.zip     $ cd /usr/src     $ unzip grails-1.3.7.zip 4. Edit "/etc/profile" and add the path below     $ nano /etc/profile     JAVA_HOME=/usr/java/jdk1.6.0_30     export JAVA_HOME     PATH=$JAVA_HOME/bin:$PATH     export PATH     TOMCAT_HOME=/usr/src/tomcat     export TOMCAT_HOME     PATH=$TOMCAT_HOME/bin:$PATH     export PATH     CATALINA_HOME=/usr/src/tomcat     export CATALINA_HOME     PATH=$CATALINA_HOME/bin:$PATH     export PATH     GRAILS_HOME=/usr/src/grails-1.3.7     export GRAILS_HOME     PATH=$GRAILS_HOME/bin:$PATH     export PATH To maximized java memor

How to enable clustering in Openfire Enterprise?

Image
What is clustering? A cluster is when you have several servers hosting the same domain. Before Openfire 3.4.0 it was possible to only have one machine hosting a domain. Even though a single machine can scale to very big numbers (e.g. more than 100K concurrent users) there is still a limit in the number of users you can scale. Moreover, if that machine suffers a problem and the server stops then all users will be affected. When using clustering you avoid those two problems. You will be naturally distributing the load among several machines thus even if one of them goes down the entire service will still continue to respond. The users that were connected to the machine that went down will just reconnect to any of the remaining machines. How do I use clustering in Openfire? Clustering is a commercial feature that is available in the Openfire Enterprise 3.4.0 or later. That means that you need to get Openfire Enterprise to be able to use clustering. If you have an existing Openfire Enterpr

Scraping an Entire Website using LINUX

Web scraping (also called Web harvesting or Web data extraction) is a computer software technique of extracting information from websites. Usually, such software programs simulate human exploration of the Web by either implementing low-level Hypertext Transfer Protocol (HTTP), or embedding certain full-fledged Web browsers, such as the Internet Explorer (IE) and the Mozilla Web browser. Web scraping is closely related to Web indexing, which indexes Web content using a bot and is a universal technique adopted by most search engines. In contrast, Web scraping focuses more on the transformation of unstructured Web content, typically in HTML format, into structured data that can be stored and analyzed in a central local database or spreadsheet. Web scraping is also related to Web automation, which simulates human Web browsing using computer software. Exemplary uses of Web scraping include online price comparison, weather data monitoring, website change detection, Web research, Web content

Changing Date and Time in Linux

Syntex: 1. date -s "DD Mon YYYY hh:mm:ss" 2. date set="DD Mon YYYY hh:mm:ss" 3. date MMDDhhmmYYYY.ss Example: 1. date -s "28 NOV 2008 13:45:00" 2. date set="28 NOV 2008 13:45:00" 3. date 112813452009 Setting Time in Linux Syntex: date +%T -s "hh:mm:ss" Example: date +%T -s "10:13:13"

Deleting Files/Folders based on OWNERSHIP

1. List the files and directories. $ ls -lah total 52K drwxrwxrwt 11 root root 4.0K Nov 4 03:52 . drwxr-xr-x 25 root root 4.0K Oct 6 03:54 .. srwxr-xr-x 1 george george 0 Oct 8 00:47 .dguardianipc srwxr-xr-x 1 george george 0 Oct 8 00:47 .dguardianurlipc -rw-r--r-- 1 root root 0 Nov 4 03:52 file1 -rw-r--r-- 1 gopher gopher 0 Nov 4 03:52 file2 -rw-r--r-- 1 gopher gopher 0 Nov 4 03:52 file3 -rw-r--r-- 1 gopher gopher 0 Nov 4 03:52 file4 -rw-r--r-- 1 gopher gopher 0 Nov 4 03:52 file5 -rw-r--r-- 1 root root 0 Nov 4 03:52 file6 -rw-r--r-- 1 root root 0 Nov 4 03:52 file7 drwxrwxrwt 2 root root 4.0K Oct 1 07:55 .font-unix drwxrwxrwt 2 root root 4.0K Oct 1 07:55 .ICE-unix drwxr-xr-x 2 root root 4.0K Nov 4 03:43 test1 drwxr-xr-x 2 root root 4.0K Nov 4 03:51 test2 drwxr-xr-x 2 root root 4.0K Nov 4 03:43 test[2-7] drwxr-xr-x 2 root root 4.0K Nov 4 03:43 test2-7 drwxr-xr-x 2 george george 4.0K N

Easy way to extract Logs on a Date/Line Range in LINUX

Example: range of date to be extracted in the /var/log/message. Oct 26-27 our x will be Oct 26, y will be Oct 27 1. Get the first line number which will be our x reference (x - Oct 26). $ grep -n 'Oct 26' /var/log/messages | head The initial reference of x = 29933 Sample Output: 29933:Oct 26 00:00:00 postfix nagios: LOG ROTATION: DAILY 29934:Oct 26 00:00:00 postfix nagios: LOG VERSION: 2.0 29935:Oct 26 00:00:00 postfix nagios: CURRENT HOST STATE: localhost;UP;HARD;1;PING OK - Packet loss = 0% 29936:Oct 26 00:00:00 postfix nagios: CURRENT SERVICE STATE: localhost;Current Load;OK;HARD;1;OK 29937:Oct 26 00:00:00 postfix nagios: CURRENT SERVICE STATE: localhost;Current Users;OK;HARD;1 29938:Oct 26 00:00:00 postfix nagios: CURRENT SERVICE STATE: localhost;HTTP;WARNING 29939:Oct 26 00:00:00 postfix nagios: CURRENT SERVICE STATE: localhost;PING;OK;HARD;1;PING OK - Packet loss = 0% 29940:Oct 26 00:00:00 postfix nagios: CURRENT SERVICE STATE: localhost;Root