Skip to content

Instantly share code, notes, and snippets.

View amolkhanorkar's full-sized avatar

Amol Khanorkar amolkhanorkar

View GitHub Profile
@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 / 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 / Apache tomcat setup
Created March 12, 2014 06:15
Apache tomcat setup
Apache tomcat setup
Pre-requisites
JDK (java) should be install.
1. To Install Java
Download tarball package.
Goto the downloaded directory. Extract tarball jdk-6u31-linux-x64.tar.gz
@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 / 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 / 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 / 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]
.
.
.
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 / PG::Error: ERROR: new encoding (UTF8) is incompatible
Last active November 29, 2023 17:57
Postgres PG::Error: ERROR: new encoding (UTF8) is incompatible
======= Prolbem =================================================================================================================
I have installed : ruby-2.0.0,postgres-9.2 , now in rails app when I execute:
rake db:create , command I get:
PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT: Use the same encoding as in the template database, or use template0 as template.
: CREATE DATABASE "my_db_name" ENCODING = 'unicode'.......
bin/rake:16:in `load'
Start and stop the server on Windows
Start and stop the server on Linux
Start and stop Apache
Start and stop the server on Windows
Start the server from the Start menu
Choose Start > All Programs > Adobe > Flash Media Server 4.5 > Start Adobe Flash Media Server 4.5.
Choose Start > All Programs > Adobe > Flash Media Server 4.5 > Start Flash Media Administration Server 4.5.
Stop the server from the Start menu