Skip to content

Instantly share code, notes, and snippets.

@opnchaudhary
opnchaudhary / disable_mysql_history.sh
Created January 18, 2014 11:57
Disable mysql history
rm $HOME/.mysql_history
ln -s /dev/null $HOME/.mysql_history
@opnchaudhary
opnchaudhary / mod_evavsive.conf
Last active January 3, 2016 16:29
Installing mod_evasive in fedora/centos to prevent DOS attacks yum install httpd-devel wget wget http://www.zdziarski.com/blog/wp-content/uploads/2010/02/mod_evasive_1.10.1.tar.gz tar -xzf mod_evasive_1.10.1.tar.gz cd mod_evasive apxs -cia mod_evasive20.c
#/etc/httpd/conf.d/mod_evavsive.conf
LoadModule evasive20_module /usr/lib64/httpd/modules/mod_evasive20.so
<IfModule mod_evasive20.c>
DOSHashTableSize 3097
DOSPageCount 3
DOSSiteCount 100
DOSPageInterval 3
DOSSiteInterval 5
DOSBlockingPeriod 300
@opnchaudhary
opnchaudhary / bruteforce.py
Created December 3, 2013 04:29
Used only for https://www.facebook.com/download/1485276195031896/hackme Challenge: Hackers! Are you ready to face a challenge? This is a program compiled for linux. Which -> accepts an integer from command line argument . -> compares that argv with a pre-stored 4-digit integer. -> prints a msg and returns 0 if they match -> returns 1 if they don…
#!/usr/bin/python
import os
var=0
while var<10000:
var+=1
temp='{0:04}'.format(var)
result=os.system('./hackme '+temp)
if result==0:
print "Found : "+temp
break
@opnchaudhary
opnchaudhary / webcamstreaming.xml
Created October 29, 2013 10:24
This xml file can be imported to Adobe Flash Media Encoder and can be used for streaming webcam's video along with microphone's audio to specified rtmp publish point
<?xml version="1.0" encoding='UTF-8'?>
<flashmedialiveencoder_profile>
<preset>
<name>uFame Live</name>
<description>For Webcam Streaming</description>
</preset>
<capture>
<video>
<device>USB Video Device</device>
<crossbar_input>0</crossbar_input>
@opnchaudhary
opnchaudhary / gmaps_v3_integration.html
Created July 5, 2013 04:32
Integrate Google maps 3 in website
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Maps</title>
<style>
#map_canvas {
width: 500px;
height: 400px;
}
@opnchaudhary
opnchaudhary / gmaps_3.html
Created July 5, 2013 04:26
Get latitude and longitude from google maps
<!doctyp html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Get Latitude and Longitude</title>
<script src="http://maps.google.com/maps/api/js?libraries=places&region=uk&language=en&sensor=true"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
</head>
<body>
@opnchaudhary
opnchaudhary / rand_helper.php
Last active April 18, 2018 03:52
Random String Generator : Helper File for Codeigniter
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// ------------------------------------------------------------------------
/**
* Random String Generator : Helper File for Codeigniter
*
* @author Paras Nath Chaudhary
* @link https://gist.github.com/opnchaudhary/4995012
*
*/
// ------------------------------------------------------------------------
@opnchaudhary
opnchaudhary / csv_helper.php
Created February 9, 2013 10:31
A helper class to assist in exporting data to csv file.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// ------------------------------------------------------------------------
/**
* CSV Helpers
* Inspiration from PHP Cookbook by David Sklar and Adam Trachtenberg
*
* @author Jérôme Jaglale
* @link http://maestric.com/en/doc/php/codeigniter_csv
@opnchaudhary
opnchaudhary / Numbertowords.php
Created February 6, 2013 11:18
A codeigniter library to convert number into words
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Numbertowords {
function convert_number($number) {
if (($number < 0) || ($number > 999999999)) {
throw new Exception("Number is out of range");
}
@opnchaudhary
opnchaudhary / numbertoword.js
Last active December 2, 2018 08:36
Converts Numbers to Words
// Convert numbers to words
// copyright 25th July 2006, by Stephen Chapman http://javascript.about.com
// permission to use this Javascript on your web page is granted
// provided that all of the code (including this copyright notice) is
// used exactly as shown (you can change the numbering system if you wish)
/*
Documentation: Usage
=====================
1. Import the javascript file: