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 / Dockerfile
Created June 21, 2022 17:22
vagrant-m1
# Docker image to use with Vagrant
# Aims to be as similar to normal Vagrant usage as possible
# Adds Puppet, SSH daemon, Systemd
# Adapted from https://github.com/BashtonLtd/docker-vagrant-images/blob/master/ubuntu1404/Dockerfile
FROM ubuntu:18.04
ENV container docker
RUN apt-get update -y && apt-get dist-upgrade -y
# Install system dependencies, you may not need all of these
@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 / cryptopp.rb
Created March 18, 2022 06:16
Cryptopp Brew Formula
# Based on https://raw.githubusercontent.com/Homebrew/linuxbrew-core/f204b6b30d3981259a764a29dca1a4b403524c9d/Formula/cryptopp.rb
class Cryptopp < Formula
desc "Free C++ class library of cryptographic schemes"
homepage "https://www.cryptopp.com/"
url "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_1_0.tar.gz"
sha256 "8a4e4773a39b0c07d7cea1b8be7a3f7a9d126bd3ac9a9f072f82d3a53a474a87"
license "BSD-3-Clause"
# https://cryptopp.com/wiki/Config.h#Options_and_Defines
@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 */
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
@kingster
kingster / wheezy-mipsel-toolchain
Last active August 28, 2021 22:50 — forked from fgrep/wheezy-mips-toolchain
Debian wheezy mipsel cross-compile toolchain
# Debian 7 MIPSel Toolchain
# http://cdimage.debian.org/cdimage/archive/7.8.0/amd64/iso-cd/debian-7.8.0-amd64-CD-1.iso
# Basic install + SSH Server + Standard system utilities
# Pre
apt-get update
apt-get upgrade
apt-get install build-essential
# Update
@kingster
kingster / cleanup-tags.sh
Created June 20, 2016 22:21
cleanup all git tags
#!/bin/bash
# This script will delete *all* local and remote tags from any git repo you run
# it in starting with "release"
#
# This script will not delete branches; just tags.
set -e
REMOTE='origin'
@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 / 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
/*
<javascriptresource>
<name>Batch Divide Scans save as TIFF...</name>
<about>divide scans and save as TIFF</about>
<category>Layers</category>
<menu>automate</menu>
</javascriptresource>
*/
#target Photoshop