Skip to content

Instantly share code, notes, and snippets.

View kingster's full-sized avatar
🏠
Working from home

Kinshuk Bairagi kingster

🏠
Working from home
View GitHub Profile
@kingster
kingster / ifelse.asm
Created September 22, 2011 13:14
8051 Assembly IF/ELSE
CJNE A, #27, NOT_EQL
EQL: ;A=27
; Your Code Here
SJMP END_CMP
NOT_EQL: ; Your Code Here
JC A_LESS
A_GREATER: ;A > 27
; Your Code Here
SJMP END_CMP
A_LESS: ;A < 27
@kingster
kingster / prefix.c
Created August 28, 2012 15:07
Prefix Expression Evaluation in C
#include<stdio.h>
#include <stdlib.h>
#include <string.h>
#include<math.h>
#define STACK_MAX 500
#define OPERAND 10
#define OPERATOR 20
/* stack structure */
@kingster
kingster / dijkstra.c
Created November 5, 2012 11:27
DIJKSRTRA's ALGORITHM C
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string.h>
#include<math.h>
#include<time.h>
#include<string.h>
using namespace std;
#define IN 999
@kingster
kingster / jQuerySmartPoller.js
Last active December 23, 2020 05:38 — forked from defunkt/gist:158493
Jquery Smart Poller with Stop Support
/*
* a smart poller for jquery.
* (by github)
*
* simple example:
*
* $.smartPoller(function(retry) {
* $.getJSON(url, function(data) {
* if (data) {
* doSomething(data)
@kingster
kingster / crt2keystore.sh
Created July 19, 2014 17:09
SSL Private Key To Java Keystore
#!/bin/bash
#create pksc12 file
openssl pkcs12 -export -in website.crt -inkey website.key -out website.p12 -name tomcat -CAfile ca.crt -caname root -chain
#create java keystore. [ You may change website.jks to keystore or any existing keystores you have]
keytool -importkeystore -srckeystore website.p12 -srcstoretype pkcs12 -destkeystore website.jks -deststoretype JKS
@kingster
kingster / apsd
Created August 12, 2014 19:14
APS Demon File
#!/bin/bash
# /etc/init.d/aps
#
# description: APE Daemon
# processname: APE Daemon
# author : me@kinshuk.in
# Define where ape is installed.
APE_DIRECTORY=/var/aps/APS-Deploy
@kingster
kingster / ssh-key-enable.sh
Last active August 29, 2015 14:07
SSH Bulk Key Adder
#!/bin/bash
if [ $# -eq 0 ];then
echo "$0 host-prefix{1..5}-postfix.domain.com"
exit 1;
fi;
echo "User : `whoami`"
echo -n "LDAP password: "
read -s password;
@kingster
kingster / HttpPipeline.scala
Created February 25, 2015 09:01
HttpPipeline Spark
package com.flipkart.marketing.bro.mouth.pipeline.http
import akka.actor.{ActorRef, Actor, Props}
import akka.serialization.Serialization
import com.flipkart.marketing.bro.commons.data.models.RawEvent
import com.flipkart.marketing.bro.mouth.akka.AkkaEngine
import com.flipkart.marketing.bro.mouth.pipeline.StreamSource
import org.apache.spark.streaming.StreamingContext
import org.apache.spark.streaming.dstream.InputDStream
import org.apache.spark.streaming.receiver.ActorHelper
@kingster
kingster / bluetooth-agent.sh
Last active May 3, 2022 01:09
Raspberry PI Bluetooth Audio Player
### BEGIN INIT INFO
# Provides: bluetooth-agent
# Required-Start: $remote_fs $syslog bluetooth pulseaudio
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Makes Bluetooth discoverable and connectable to 0000
# Description: Start Bluetooth-Agent at boot time.
### END INIT INFO
#! /bin/sh
@kingster
kingster / tachyon.patch
Created November 17, 2015 22:09
Tachyon Path for Spark 1.4.1
Index: src/spark/sbin/start-master.sh
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/spark/sbin/start-master.sh (revision 3a38a61d8dafe1584992d10feb2dfb2154da911f)
+++ src/spark/sbin/start-master.sh (revision 652da5558b857355940906760e4112d8b7c2ce62)
@@ -34,6 +34,7 @@
exit -1