Skip to content

Instantly share code, notes, and snippets.

View xor-gate's full-sized avatar
👽

Jerry Jacobs xor-gate

👽
View GitHub Profile
@xor-gate
xor-gate / reverse_shell.c
Created March 24, 2019 09:50 — forked from 0xabe-io/reverse_shell.c
Simple C code to create a reverse shell
/* credits to http://blog.techorganic.com/2015/01/04/pegasus-hacking-challenge/ */
#include <stdio.h>
#include <unistd.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#define REMOTE_ADDR "XXX.XXX.XXX.XXX"
#define REMOTE_PORT XXX
@xor-gate
xor-gate / helpers.cmake
Created March 20, 2019 18:42 — forked from abravalheri/helpers.cmake
CMake examples
if(NOT HOME)
if(WIN32)
string(REPLACE "\\" "/" HOME "$ENV{USERPROFILE}")
else()
set(HOME $ENV{HOME})
endif()
endif()
### Useful Functions and Macros ###
# Prints a list of messages, each one in a new line
@xor-gate
xor-gate / sshtunnel.go
Created November 13, 2018 13:17 — forked from iamralch/sshtunnel.go
SSH tunnelling in Golang
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"
@xor-gate
xor-gate / sha256frompubkey.py
Created October 30, 2018 23:24 — forked from StevenMaude/sha256frompubkey.py
Generate SHA256 fingerprint from a public key
#!/usr/bin/python
# coding=utf-8
# sha256frompubkey.py: Displays SHA256 fingerprint of public key in Python 2/3.
# Modified by Steven Maude from
# https://github.com/joyent/python-manta/blob/4de7445277c0971c7ff43ef246018d055ef21d20/manta/auth.py
# MIT licence.
# Usage: obtain a public key using ssh-keyscan <host> > key.pub
@xor-gate
xor-gate / main.go
Created October 22, 2018 20:41 — forked from mschoebel/main.go
Snippet: login/logout (Golang)
package main
import (
"fmt"
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
"net/http"
)
// cookie handling
@xor-gate
xor-gate / file_response_writer.go
Created September 13, 2018 09:46 — forked from ismasan/file_response_writer.go
Write backend HTTP response to http.ResponseWriter and File
// fileResponseWriter wraps an http.ResponseWriter and a File
// passing it to an http.Handler's ServeHTTP
// will write to both the file and the response.
type fileResponseWriter struct {
file io.Writer
resp http.ResponseWriter
multi io.Writer
}
@xor-gate
xor-gate / resp3.md
Created September 8, 2018 23:19 — forked from antirez/resp3.md
RESP3 protocol draft

RESP3 specification

Versions history:

  • 1.0, 2 May 2018, Initial draft to get community feedbacks.

Background

The Redis protocol has served us well in the past years, showing that, if carefully designed, a simple human readable protocol is not the bottleneck in the client server communication, and that the simplicity of the design is a major advantage in creating a healthy client libraries ecosystem.

Yet the Redis experience has shown that after about six years from its introduction (when it replaced the initial Redis protocol), the current RESP protocol could be improved, especially in order to make client implementations simpler and to support new features.

@xor-gate
xor-gate / pid, uid and gid of a remote unix-socket connection in golang.md
Created August 17, 2018 21:38
getting the pid, uid and gid of a remote unix-socket connection in golang
package main

import (
        "fmt"
        "net"
        "reflect"
        "runtime"
        "syscall"
)
@xor-gate
xor-gate / webdavserv.go
Created July 18, 2018 14:05 — forked from staaldraad/webdavserv.go
A small webdav server in go
package main
import (
"flag"
"fmt"
"log"
"net/http"
"os"
"golang.org/x/net/webdav"
@xor-gate
xor-gate / nextcloud-install-sid.sh
Created July 12, 2018 21:22 — forked from yottu/nextcloud-install-sid.sh
Installing nextcloud 12.0 on Debian GNU/Linux (sid) [lighttpd/mariadb]
### Written: 2017-06-13
### Updated: -
### Get, verify and unpack, delete and move the distribution package (12.0)
wget https://download.nextcloud.com/server/releases/nextcloud-12.0.0.tar.bz2
wget https://download.nextcloud.com/server/releases/nextcloud-12.0.0.tar.bz2.sha256
sha256sum -c nextcloud-12.0.0.tar.bz2.sha256 < nextcloud-12.0.0.tar.bz2.sha256
tar xvf nextcloud-12.0.0.tar.bz2 && rm nextcloud-12.0.0.tar.bz2
sudo mv nextcloud /var/www/html