Skip to content

Instantly share code, notes, and snippets.

View amolkhanorkar's full-sized avatar

Amol Khanorkar amolkhanorkar

View GitHub Profile
@amolkhanorkar
amolkhanorkar / Postgresql Database Backup & Restore
Last active August 29, 2015 14:00
Postgresql Database Backup & Restore
First take dump using this method
Dump schema of database:
pg_dump -Fp -s -v -f abc-schema.sql -U postgres dbname
Dump contents of database:
pg_dump -Fc -v -f abc-full.dump -U postgres dbname
Then restore using this methodology
@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'
I got an error while setting up an site, which is having some changes with their file names (Diff. in Upper/Lower case).
[Thu Oct 31 00:29:59 2013] [error] [client x.x.x.x] script '/var/www/www.abcd.com/wwwroot/mlbteamstandings_data.php' not found or unable to stat, referer: http://demo-abcd.xyz.com/index.php?option=com_content&view=article&id=86&Itemid=839
So, issue has been resolved by adding apache2 CheckSpelling and CheckCaseOnly module into the virtualhost file.
<VirtualHost *:80>
ServerName demo-abcd.xyz.com
DocumentRoot /var/www/www.abcd.com/wwwroot
<Directory /var/www/www.abcd.com/wwwroot>
Nagios check nrpe error could not complete ssl handshake
When you are tying to connect remote host from nagios server using check_nrpe you may get following error.
$ /usr/lib/nagios/plugins/check_nrpe -H remotehostIP
Output:
check_nrpe error could not complete ssl handshake
I got the error while I am trying to send mail using postfix on ubuntu 12.04 LTS server.
I checked the mail logs, below are the logs:
Sep 26 02:02:12 git postfix/qmgr[17117]: 85F4E56C1E10: removed
Sep 26 02:17:23 git postfix/master[17113]: terminating on signal 15
Sep 26 02:17:23 git postfix/master[17271]: daemon started -- version 2.9.6, configuration /etc/postfix
Sep 26 02:17:44 git postfix/pickup[17274]: 5758F56C1E0F: uid=1000 from=<git@weboniselab.com>
Sep 26 02:17:44 git postfix/cleanup[17280]: 5758F56C1E0F: message-id=<5243d1884f8d3_18943f8eb79cde7c7042@git.mail>
Sep 26 02:17:44 git postfix/qmgr[17275]: 5758F56C1E0F: from=<>, size=885, nrcpt=1 (queue active)
Sep 26 02:17:44 git postfix/local[17282]: 5758F56C1E0F: to=<>, relay=local, delay=0.25, delays=0.01/0/0/0.24, dsn=5.1.1, status=bounced (unknown user: "")
Installing the Cacti Server Monitor on Ubuntu 12.04 Cloud Server
inShare
What the Red Means
The lines that the user needs to enter or customize will be in red in this tutorial!
The rest should mostly be copy-and-pastable.
Introduction
Cacti is a network monitoring tool that creates customized graphs of server performance. It is accessed and managed through a web front-end. Cacti can be used to log and graph multiple cloud servers from a single, unified interface.
Table of Contents
Install Flash Media Server
wget http://download.macromedia.com/pub/flashmediaserver/updates/4_5_1/Linux_64/FlashMediaServer4.5_x64.tar.gz
tar xvf FlashMediaServer4.5_x64.tar.gz
cd FMS_4_5_1_r484/
sudo ./installFMS
If you got the error of libcap is not installed, then
ln -s /lib/x86_64-linux-gnu/libcap.so.2 libcap.so.1
@amolkhanorkar
amolkhanorkar / Installation Of GitLab On Ubuntu 12.04
Last active December 22, 2015 07:18
Installation Of GitLab On Ubuntu 12.04
#Installation Of GitLab On Ubuntu/Debian
This installation guide was created for and tested on Debian/Ubuntu operating systems. Please read doc/install/requirements.md for hardware and operating system requirements.
This is the official installation guide to set up a production server. To set up a development installation or for many other installation options please consult the installation section in the readme.
The following steps have been known to work. Please use caution when you deviate from this guide. Make sure you don't violate any assumptions GitLab makes about its environment. For example many people run into permission problems because they changed the location of directories or run services as the wrong user.
If you find a bug/error in this guide please submit a pull request following the contributing guide.
Overview
The GitLab installation consists of setting up the following components:
1. Packages / Dependencies
@n1shantshrivastava
n1shantshrivastava / readme.md
Last active August 13, 2021 19:56
Send Mail Configuration : Disable Local Delivery

What I did to disable local delivery. I'll be using the example.com domain.

Requirements:

  • example.com A entry pointing to IP address assigned to one of the eth interfaces.
  • /etc/hosts defining example.com assigned to the very same IP address as above
  • example.com MX records pointing to Google servers (ASPMX.L.GOOGLE.COM, etc)
  • default sendmail installation (mine was on Ubuntu)
@vparihar01
vparihar01 / setting_hostname_sendmail_in_ubuntu.md
Created June 27, 2013 11:55
For changing the mail hosts name from your local machine name to domain name.Setting the hostname in sendmail.

If you need to change the hostname that Sendmail announces itself as, just add the following to sendmail.mc:

define(`confDOMAIN_NAME', `mail.yourdomain.com')dnl

For example-: Your domain name is www.xyz.com, then

define(`confDOMAIN_NAME', `www.xyz.com')dnl