Skip to content

Instantly share code, notes, and snippets.

View manjeshpv's full-sized avatar
🇮🇳
in India

Manjesh V manjeshpv

🇮🇳
in India
  • LEADSchool.in
  • Bangalore
View GitHub Profile
@manjeshpv
manjeshpv / php-session-id-url-based-and-cookie-based.php
Created March 9, 2015 09:50
Handling Session ID in PHP using cookie based & URL based
@manjeshpv
manjeshpv / pinger
Created June 19, 2015 08:10
Bash Shell Script to Ping a ip/host continuously to keep connectivity
#/bin/sh
# Description: Cyberoam Ping Script
# save in /etc/init.d/pinger
# start : $ server pinger start
# status : $ server pinger status
# stop : $ server pinger stop
# Description: Cyberoam Ping Script
address=192.168.220.250
do_start()
{
<?php
/**
* Created by PhpStorm.
* User: ManjeshV
* Date: 10/23/2015
* Time: 12:19 PM
*/
$dsn = "mysql:host=localhost;dbname=mig";
$username = "root";
@manjeshpv
manjeshpv / awstats.sample.conf
Created November 10, 2015 16:30
AWSTATS sample file for easyengine - /etc/awstats/awstats.sample.conf
# AWSTATS CONFIGURE FILE 7.1
#-----------------------------------------------------------------------------
# Copy this file into awstats.www.mydomain.conf and edit this new config file
# to setup AWStats (See documentation in docs/ directory).
# The config file must be in /etc/awstats, /usr/local/etc/awstats or /etc (for
# Unix/Linux) or same directory than awstats.pl (Windows, Mac, Unix/Linux...)
# To include an environment variable in any parameter (AWStats will replace
# it with its value when reading it), follow the example:
# Parameter="__ENVNAME__"
# Note that environment variable AWSTATS_CURRENT_CONFIG is always defined with
@manjeshpv
manjeshpv / awstats.sh
Created November 10, 2015 16:34
Script to enable awstats for easyengine- $ ./awstats.sh mydomain.com
if [ $# -eq 0 ]
then
echo "No arguments supplied"
else
echo $1
cp /etc/awstats/awstats.sample.conf /etc/awstats/awstats.$1.conf
sed -i -e 's/XDOMAIN/'"$1"'/g' /etc/awstats/awstats.$1.conf
mkdir /var/lib/awstats/$1
echo '/usr/share/awstats/tools/awstats_buildstaticpages.pl -update -config='$1' -dir=/var/www/awstats.ayyayo.com/htdocs -awstatsprog=/usr/lib/cgi-bin/awstats.pl > /dev/null' >> /var/bin/awstats/awstats_update
fi
@manjeshpv
manjeshpv / nginx
Created November 10, 2015 16:41
Awstats for easyengine - prerotate - /etc/logrotate.d/nginx
/var/log/nginx/*.log {
size 10M
missingok
rotate 52
compress
delaycompress
notifempty
create 0640 www-data adm
sharedscripts
prerotate
@manjeshpv
manjeshpv / Gulpfile.js
Created December 1, 2015 04:51
Gulpfile for Express Dokku deploy
'use strict';
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
var os = require('os');
var gulp = require('gulp');
var open = require('gulp-open');
var copy = require('gulp-copy');
var nodemon = require('gulp-nodemon');
var jshint = require('gulp-jshint');
@manjeshpv
manjeshpv / Gulpfile.js
Created December 29, 2015 04:12
Gulpfile for build and deploy in dokku and heroku
'use strict';
/* https://github.com/angular-fullstack/generator-angular-fullstack
* You can use this simplified gulpfile for creating dist by $>`gulp build`
* Deploy to heroku or dokku using git or heroku toolbelt
*/
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
var os = require('os');
var gulp = require('gulp');
@manjeshpv
manjeshpv / util.js
Created January 2, 2016 06:11
Util for process directory in Yeoman, Bulk copy with Templates
'use strict';
var path = require('path');
var fs = require('fs');
var glob = require('glob');
var _ = require('lodash');
// this.sourceRoot(path.join(__dirname, 'templates'));
// genUtils.processDirectory(this, '.', '.');
@manjeshpv
manjeshpv / pods-employee.json
Created January 4, 2016 05:11
Pods Employee Information System - Install Pods Wordpress Plugin and Enable Migrate Packages -> Import
{"meta":{"version":"2.6","build":1451884220},"pods":{"4":{"id":4,"name":"user","label":"User","description":"","type":"user","storage":"table","object":"user","alias":"","fields":{"employee_id":{"id":5,"name":"employee_id","label":"Employee ID","description":"GIO-001","help":"","class":"","type":"text","weight":0,"pick_object":"","pick_val":"","sister_id":"","required":"0","unique":"0","text_allow_shortcode":"0","text_allow_html":"0","text_allowed_html_tags":"strong em a ul ol li b i","text_max_length":"255","admin_only":"0","restrict_role":"0","restrict_capability":"0","hidden":"0","read_only":"0","roles_allowed":["administrator"],"text_repeatable":"0"},"designation":{"id":101,"name":"designation","label":"Designation","description":"","help":"","class":"","type":"pick","weight":1,"pick_object":"custom-simple","pick_val":"","sister_id":"","pick_custom":"Executive Director\nBusiness Analyst\nDriver\nNetwork Engineer\nRecruitment Supervisor\nRecruitment Assistant\nSoftware Engineer\nUI Developer\n","required":