Skip to content

Instantly share code, notes, and snippets.

View amolkhanorkar's full-sized avatar

Amol Khanorkar amolkhanorkar

View GitHub Profile
LDAP server setup
1] Setup Ubuntu Server 64-bit (Use "Minimal install" in "Modes".)
2] sudo apt-get install slapd ldap-utils migrationtools
You will be prompted for the LDAP admin password. Please remember it.
3] sudo mv /etc/ldap/slapd.d /etc/ldap/slap.d.orig
4] sudo dpkg-reconfigure slapd
@amolkhanorkar
amolkhanorkar / Redirect Rule in Apache2
Last active August 29, 2015 13:57
Redirect Rule in Apache2
<VirtualHost *:80>
.
.
.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com$1 [R=301,NC,L]
.
.
.
@amolkhanorkar
amolkhanorkar / Change MySQL Collation
Created March 12, 2014 06:05
Change MySQL Collation
Change MySQL Collation
On ubuntu when we install the mysql it takes the default database character set as swidish.
But we need the character set as UTF-8.
Read this article for more details : http://dev.mysql.com/tech-resources/articles/4.1/unicode.html
Also read this article for more information about storing the data in Indian launguages in your mysql database,
http://mrothouse.wordpress.com/2006/09/18/mysql-database-character-set/
@amolkhanorkar
amolkhanorkar / How to Create a New User and Grant Permissions in MySQL
Created March 12, 2014 06:06
How to Create a New User and Grant Permissions in MySQL
How to Create a New User
In Part 1 of the MySQL Tutorial, we did all of the editing in MySQL as the root user, with full access to all of the databases. However, in the cases where more restrictions may be required, there are ways to create users with custom permissions.
Let’s start by making a new user within the MySQL shell:
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
Sadly, at this point newuser has no permissions to do anything with the databases. In fact, if newuser even tries to login (with the password, password), they will not be able to reach the MySQL shell.
Therefore, the first thing to do is to provide the user with access to the information they will need.
@amolkhanorkar
amolkhanorkar / mongoDB Installation on Ubuntu
Created March 12, 2014 06:07
mongoDB Installation on Ubuntu
mongoDB
Installation on Ubuntu
sudo apt-get update
sudo apt-get install mongodb-10gen
OR
sudo apt-get install mongodb
@amolkhanorkar
amolkhanorkar / Capistrano Installation
Created March 12, 2014 06:26
Capistrano Installation
Capistrano
To get started, you need to install the capistrano gem:
gem install capistrano capistrano-ext
Once you have the gem installed go to your application’s directory and capify the app.
cd /path/to/app
capify .
@amolkhanorkar
amolkhanorkar / Cron
Created March 12, 2014 06:32
Cron job
Cron
Cron is a daemon that executes scheduled commands. Cron is started automatically from /etc/init.d on entering multi-user runlevels.
Cron searches its spool area (/var/spool/cron/crontabs) for crontab files (which are named after accounts in /etc/passwd); crontabs found are loaded into memory.
Note that crontabs in this directory should not be accessed directly - the crontab command should be used to access and update them.
command : crontab -e
Cron wakes up every minute, examining all stored crontabs, checking each command to see if it should be run in the current minute.
@amolkhanorkar
amolkhanorkar / Glassfish setup
Created March 12, 2014 08:43
Glassfish setup
Glassfish setup
Make sure you have at least 512 memory free!
1.) Install java
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
2.) Get GlassFish ZIP file
How To Monitor Remote Linux Host using Nagios 3.0
I explained the overview, installation and configuration of Nagios 3.0 on Red Hat Server.I’ll explain how to monitor a remote Linux host and the various services running on the remote host.  Also, please refer to all Nagios articles.
 
I. Overview
II. 6 steps to install Nagios plugin and NRPE on remote host.
1. Download Nagios Plugins and NRPE Add-on
2. Create nagios account
3. Install Nagios Plugins
4. Install NRPE
5. Setup NRPE to run as daemon
Nginx setup
Install Required Packages (Pre-requisite php & project required directory should be installed)
apt-get update
apt-get upgrade
apt-get install nginx php5-cli php5-cgi spawn-fcgi
Now we will do the fastcgi configuration with nginx. In this we are going to use tcp socket base communication.
i. Start fastcgi deamon
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/php-cgi.pid -C 6
ii. You can use below script to start fastcgi process