Skip to content

Instantly share code, notes, and snippets.

View mamins1376's full-sized avatar
🤨

min mamins1376

🤨
View GitHub Profile
@AndrewFasano
AndrewFasano / extract-vmlinux.sh
Created September 28, 2018 21:23
Extract vmlinux from a zimage file
#!/bin/sh
# Given a linux zimage, extract the vmlinux file. Useful for getting symbols into gdb when debugging linux kernels
# Requires binwalk for extracting the slightly malformed xz data
set -e
file=$1
# Get 2nd offset of 7zXZ
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active June 25, 2024 12:19
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@kodekracker
kodekracker / json_encoder.py
Last active November 20, 2018 12:36
A Custom SqlAlchemy JSON encoder class to encode models instances in json format which supports major object instances useful in developing api's in flask.
# To use this custom JsonEncoder class, you have to create a __json__() named
# function in each sqlalchemy model class, which basically return a list of model
# class attributes to be parsed, otherwise all attributes are processed present
# in `dir(class_name)`.
#
# Model Example:
# class User(db.Model):
# id = db.Column(db.Integer, primary_key=True)
# name = db.Column(db.String(100))
# email = db.Column(db.String(100))
@taldanzig
taldanzig / gitpushpull.md
Created January 23, 2013 06:38
Make push/pull work with a remote non-bare repository

Make push/pull work with a remote non-bare repository

Sometimes it is necessary (and desireable) to work on a git repository on multiple development machines. We want to be able to push and pull between repositories without having to use an intermediary bare repository, and for this to work symetrically in both repositories.

First clone we clone an existing repository:

git clone ssh://user@hostname:/path/to/repo

By default this will name the remote as origin, but let's assume we want to reserve that name for a master repository that commits will eventually get pushed to: