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))
# Chane group here
$group = "users"
$npipe = "\\.\pipe\docker_engine"
$fullControl =[System.Security.AccessControl.FileSystemRights]::FullControl
$allow =[System.Security.AccessControl.AccessControlType]::Allow
$dInfo = New-Object "System.IO.DirectoryInfo" -ArgumentList $npipe
$dSec = $dInfo.GetAccessControl()
$rule = New-Object "System.Security.AccessControl.FileSystemAccessRule" -ArgumentList $group,$fullControl,$allow
$dSec.AddAccessRule($rule)
$dInfo.SetAccessControl($dSec)
@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"
❯ ansible-playbook playbooks/nexus_vlans.yaml -vvvv ✘ 2
ansible-playbook 2.8.0
config file = /home/nsidhu/Documents/Development/AnsibleNXOS/ansible.cfg
configured module search path = ['/home/nsidhu/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/nsidhu/.local/lib/python3.6/site-packages/ansible
executable location = /home/nsidhu/.local/bin/ansible-playbook
python version = 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0]
Using /home/nsidhu/Documents/Development/AnsibleNXOS/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /home/nsidhu/Documents/Development/AnsibleNXOS/hosts as it did not pass it's verify_file() method
@navisidhu
navisidhu / st3.reg
Created September 26, 2018 21:40
Windows 10 - Open with Sublime Text 3 from Explorer
Windows Registry Editor Version 5.00
; Files
[HKEY_CLASSES_ROOT\*\shell\OpenWithSublimeText3]
@="Open With SublimeText 3"
"Icon"="C:\\Program Files\\Sublime Text 3\\sublime_text.exe,0"
[HKEY_CLASSES_ROOT\*\shell\OpenWithSublimeText3\command]
@="C:\\Program Files\\Sublime Text 3\\sublime_text.exe \"%1\""

Keybase proof

I hereby claim:

  • I am navisidhu on github.
  • I am navisidhu (https://keybase.io/navisidhu) on keybase.
  • I have a public key ASB907PFEL3k3hya-JNUJQQjHaLII5wnb4ZBa-juEH24jgo

To claim this, I am signing this object:

@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)
/ipv6 firewall filter
add action=accept chain=input comment="INPUT > Allow established connections" connection-state=established disabled=no
add action=accept chain=input comment="INPUT > Allow related connections" connection-state=related disabled=no
add action=accept chain=input comment="INPUT > Allow limited ICMP" disabled=no limit=50/5s,5 protocol=icmpv6
add action=accept chain=input comment="INPUT > Allow UDP" disabled=no protocol=udp
add action=drop chain=input comment="INPUT > DEFAULT DENY" disabled=no
add action=accept chain=forward comment="FORWARD > Allow any to internet" disabled=no out-interface=UFB-INTERFACE
add action=accept chain=forward comment="FORWARD > Allow established connections" connection-state=established disabled=no
add action=accept chain=forward comment="FORWARD > Allow related connections" connection-state=related disabled=no
add action=drop chain=forward comment="FORWARD > DEFAULT DENY" disabled=no