Skip to content

Instantly share code, notes, and snippets.

View AbhishekGhosh's full-sized avatar

Abhishek Ghosh AbhishekGhosh

View GitHub Profile
AbhishekGhosh / ESP32-Web-Controlled-Servo.ino
Created July 1, 2023 09:31 — forked from elktros/ESP32-Web-Controlled-Servo.ino
Code for ESP32 Web Controlled Servo.
#include <WiFi.h>
const int servoPin = 16; /* GPIO16 */
const char* ssid = "ESP32-WiFi"; /* Add your router's SSID */
const char* password = "12345678"; /*Add the password */
int dutyCycle = 0;
//int position1 = 0;
AbhishekGhosh /
Created September 5, 2020 19:18 — forked from GAS85/
How to Enable HTTP/2 in Apache 2.4 on Ubuntu 16.04


  • A self-managed VPS or dedicated server with Ubuntu 16.04 running Apache 2.4.xx.
  • For Ubuntu 18.04 please read here -->
  • A registered domain name with working HTTPS (TLS/SSL). HTTP/2 only works alongside HTTPS because most browsers, including Firefox and Chrome, don’t support HTTP/2 in cleartext (non-TLS) mode.
AbhishekGhosh /
Created October 6, 2019 15:27 — forked from SQLadmin/
Automate xtrabackup for FULL/Incremental and restore
# This is my production backup script.
set -e
set -u
usage() {
echo "usage: $(basename $0) [option]"
echo "option=full: Perform Full Backup"
AbhishekGhosh / The-Indian-Penal-Code
Created May 24, 2018 11:18 — forked from allomics/The-Indian-Penal-Code
Central Government Act - The Indian Penal Code
Central Government Act - The Indian Penal Code
1. Title and extent of operation of the Code.—This Act shall be called the Indian Penal Code, and shall 1 [extend to the whole of India 2 [except the State of Jammu and Kashmir].]
2. Punishment of offences committed within India.—Every person shall be liable to punishment under this Code and not otherwise for every act or omission contrary to the provisions thereof, of which he shall be guilty within 3 [India] 4 [***].
3. Punishment of offences committed beyond, but which by law may be tried within, India.—Any person liable, by any 5 [Indian law] to be tried for an offence committed beyond [India] shall be dealt with according to the provisions of this Code for any act committed beyond [India] in the same manner as if such act had been committed within 6 [India].
7 [ 4 Extension of Code to extra-territorial offences. —The provi­sions of this Code apply also to any offence committed by—
8 [(1) any citizen of India in
AbhishekGhosh /
Last active June 14, 2017 07:25 — forked from roycewilliams/
AbhishekGhosh /
Created November 27, 2016 22:34 — forked from phette23/
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see:
AbhishekGhosh / ip_blacklist.lua
Created June 29, 2016 21:55 — forked from chrisboulton/ip_blacklist.lua
Redis based IP blacklist for Nginx (LUA)
-- a quick LUA access script for nginx to check IP addresses against an
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403.
-- allows for a common blacklist to be shared between a bunch of nginx
-- web servers using a remote redis instance. lookups are cached for a
-- configurable period of time.
-- block an ip:
-- redis-cli SADD ip_blacklist
-- remove an ip:
AbhishekGhosh /
Created April 3, 2016 07:00 — forked from kloon/
Github to plugin repo deploy
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here:
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
MAINFILE="camptix-payfast.php" # this should be the name of your main php file in the wordpress plugin
# git config
AbhishekGhosh / db-connect-test.php
Created February 29, 2016 18:19 — forked from chales/db-connect-test.php
Script for a quick PHP MySQL DB connection test.
# Fill our vars and run on cli
# $ php -f db-connect-test.php
$dbname = 'name';
$dbuser = 'user';
$dbpass = 'pass';
$dbhost = 'host';
$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
AbhishekGhosh / opcache.ini
Created February 10, 2016 05:59 — forked from tegansnyder/opcache.ini
OpCache settings for Magento on PHP 5.5.14. Store this file as /etc/php.d/opcache.ini
; Enable Zend OPcache extension module
; Determines if Zend OPCache is enabled
; Determines if Zend OPCache is enabled for the CLI version of PHP
; The OPcache shared memory storage size.