Skip to content

Instantly share code, notes, and snippets.

@surajchhetry
surajchhetry / README.md
Created Dec 18, 2019 — forked from mikeando/README.md
Output buffer as binary, similar to xxd in java
View README.md

Simple XXD Style output from a ByteBuffer.

Refactored here without testing, so probably no-longer compiles - but should be a good starting point should I need it again.

@surajchhetry
surajchhetry / auto_update.md
Created Aug 12, 2019 — forked from kriztan/auto_update.md
Android auto update apk implementation
View auto_update.md
public class UpdateApp extends AsyncTask<String,Void,Void>{
private Context context;
public void setContext(Context contextf){
    context = contextf;
}

@Override
protected Void doInBackground(String... arg0) {
      try {
@surajchhetry
surajchhetry / 01_basic.go
Created Jun 11, 2019 — forked from reagent/00_README.md
Custom HTTP Routing in Go
View 01_basic.go
package main
import (
"io"
"log"
"net/http"
)
func main() {
@surajchhetry
surajchhetry / 1_kubernetes_on_macOS.md
Created Feb 22, 2019 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry
View 1_kubernetes_on_macOS.md

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@surajchhetry
surajchhetry / PingIP.java
Created Dec 22, 2015 — forked from madan712/PingIP.java
Java program to ping an IP address
View PingIP.java
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class PingIP {
public static void runSystemCommand(String command) {
try {
Process p = Runtime.getRuntime().exec(command);
BufferedReader inputStream = new BufferedReader(
@surajchhetry
surajchhetry / some_links.md
Created Dec 22, 2015 — forked from rponte/some_links.md
Some interesting articles about JPA/Hibernate Multi-Tenancy
@surajchhetry
surajchhetry / WatermarkImage.java
Created Dec 11, 2015 — forked from madan712/WatermarkImage.java
Simple Java program to Watermark an Image
View WatermarkImage.java
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
public class WatermarkImage {
View AES.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* MCrypt API available online:
* http://linux.die.net/man/3/mcrypt
*/
#include <mcrypt.h>
View AES.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* MCrypt API available online:
* http://linux.die.net/man/3/mcrypt
*/
#include <mcrypt.h>
View syncHttp.h
/***************************************************************************
* Copyright (C) 2005 by Iulian M *
* eti@erata.net *
***************************************************************************/
#ifndef ETKSYNCHTTP_H
#define ETKSYNCHTTP_H
#include <QHttp>
#include <QEventLoop>
#include <QBuffer>