Skip to content

Instantly share code, notes, and snippets.

rjha / nginx-503.conf
Created June 17, 2012 06:35
Nginx configuration for 503 custom maintenance page
server {
listen 80;
# default catch-all domain
server_name _ ;
error_page 503 @503 ;
#return 503 ;
root /var/www/htdocs/ ;
rjha / MySQLSession.php
Created May 13, 2012 17:09
PHP MYSQL based session handler with locking using select for update
namespace com\indigloo\core {
use \com\indigloo\Configuration as Config;
use \com\indigloo\mysql\PDOWrapper;
use \com\indigloo\Logger as Logger;
* custom session handler to store PHP session data into mysql DB
rjha / gist:b7cda6312552c3e15486
Created December 26, 2015 20:45
makefile to compile Arduino Core into a static library
rjha /
Created December 30, 2020 15:13
Java program to print Very Large Fibonacci numbers by simulating addition in software
package com.yuktix.test.fib;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
* The Java program to print Large Fibonacci numbers by simulating addition
* of 2 integers using stacks to keep individual digits. Trivial
* implementations using native INT type will overflow because even F(100)
mysql 8.0.15 -> 8.0.16 upgrade error
1) The mysql server refused to start when we upgraded from 8.0.15 to 8.0.16
on Ubuntu 16.04
Apr 25 09:08:09 yuktix-apiv11devm1 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
rjha /
Created April 22, 2016 17:33
Yuktix public API python library
import time
from datetime import datetime
from datetime import timedelta
import json
import requests
import random
import sys
import traceback
import logging
import json
import requests
import random
import sys
import traceback
import logging
import logging.handlers
import yuktix
import time
rjha / avr.make
Created December 26, 2015 20:53
Arduino core and libraries inside AVR makefile target
wiznet: spi2
$(BIN)/avr-g++ $(CFLAGS) -I$(LIB)/arduino/SPI -I$(INC) -I$(LIB)/arduino/cores -I$(LIB)/arduino/variants/mega -I$(LIB)/wiznet $(LIB)/wiznet/w5100.cpp -o $(BUILD)/w5500.o -L$(BUILD)
$(BIN)/avr-g++ $(CFLAGS) -I$(INC) -I$(LIB)/arduino/cores -I$(LIB)/arduino/variants/mega -I$(LIB)/wiznet $(LIB)/wiznet/socket.cpp -o $(BUILD)/socket.o -L$(BUILD)
$(BIN)/avr-g++ $(CFLAGS) -I$(LIB)/arduino/cores -I$(LIB)/arduino/variants/mega -I$(LIB)/arduino/SPI $(LIB)/arduino/SPI/SPI.cpp -o $(BUILD)/SPI.o -L$(LIB)/arduino/build -larduino
ethernet: wiznet
$(BIN)/avr-g++ $(CFLAGS) -I$(INC) -I$(LIB)/wiznet -I$(LIB)/arduino/cores -I$(LIB)/arduino/variants/mega -I$(LIB)/arduino/Ethernet $(LIB)/arduino/Ethernet/Dns.cpp -o $(BUILD)/Dns.o -L$(BUILD) -L$(LIB)/arduino/build -larduino
rjha / gist:5735459
Last active December 18, 2015 05:49
Binary search tree (BST) in Java
package test ;
/* educational purpose Binary search tree */
/* @author */
public class bst {
private Node root ;
rjha / jquery.infinitescroll.hacked.js
Created September 12, 2012 13:52
infinite scroll hacked version for PHP pagination with 2 variables
Infinite Scroll
+ version 2.0b2.120519
+ Copyright 2011/12 Paul Irish & Luke Shumard
+ Licensed under the MIT license
+ Documentation: