Skip to content

Instantly share code, notes, and snippets.

View navisidhu's full-sized avatar
:bowtie:
Handling Interrupts

Navi Sidhu navisidhu

:bowtie:
Handling Interrupts
View GitHub Profile
@navisidhu
navisidhu / middleware_mux.go
Created January 4, 2025 22:37 — forked from vladnik/middleware_mux.go
ServeMux with middleware support
package handlers
import (
"container/list"
"net/http"
)
// MiddlewareType specifies middleware interface
type MiddlewareType func(http.ResponseWriter, *http.Request, func(http.ResponseWriter, *http.Request))
@navisidhu
navisidhu / git-unsorted-log.go
Created November 20, 2020 08:36 — forked from michael-k/git-unsorted-log.go
An example of howto use git2go (https://github.com/libgit2/git2go) which is a libgit2 (https://libgit2.github.com/) bindings package for golang.
/*
requires libgit2
*/
package main
import (
"github.com/libgit2/git2go"
"fmt"
@navisidhu
navisidhu / laravel-queue.service
Created August 17, 2016 04:42 — forked from thomasjsn/laravel-queue.service
Laravel queue worker using systemd.
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker
@navisidhu
navisidhu / main.rs
Created February 17, 2016 09:31 — forked from wwalexander/main.rs
Sends a UDP datagram containing the UTF-8 string "Hello, world!" from port 34254 to port 34255 on localhost
use std::net::Ipv4Addr;
use std::net::SocketAddrV4;
use std::net::UdpSocket;
use std::str::from_utf8;
use std::thread::spawn;
const MESSAGE: &'static str = "Hello, world!";
fn main() {
let localhost = Ipv4Addr::new(127, 0, 0, 1);
@navisidhu
navisidhu / xenserver_create_jessie_template_64bit.sh
Last active February 1, 2016 20:33 — forked from jniltinho/xenserver_create_jessie_template_64bit.sh
Script to install a Debian Jessie 8.0 template on Xenserver 6.5 (NZ Mirror)
#!/bin/bash
## Script to install a Debian Jessie 8.0 template on Xenserver 6.5
# Add your favourite mirror here
MIRROR=http://ftp.nz.debian.org/debian/
# No need to edit something below
WHEEZY=$(xe template-list name-label=Debian\ Wheezy\ 7.0\ \(64-bit\) --minimal)
if [[ -z $WHEEZY ]] ; then
WHEEZY=$(xe template-list name-label=Debian\ Wheezy\ 7.0\ \(64-bit\)\ \(experimental\) --minimal)