Skip to content

Instantly share code, notes, and snippets.

@jagregory
jagregory / gist:710671
Created November 22, 2010 21:01
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git
@denji
denji / http-benchmark.md
Last active July 18, 2024 09:01
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@pbssubhash
pbssubhash / Google XSS challenge solutions..
Last active August 2, 2023 03:38
Solutions of the Google XSS Challenge..
Hey All,
I am P.B.Surya.Subhash, a 17 Year coder,hacker and a student.
Recently I happen to see so many posts regarding this " Google XSS Challenge " and i was fortunate enough to complete them..
These are the solutions for the challenges ;)
##############################################################################
Level 1: Hello, world of XSS
https://xss-game.appspot.com/level1/frame
query=<script>alert('xss')</script>
@y0ug
y0ug / scapycdp.py
Created September 21, 2014 08:35
Scapy show CDP info
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import re
logging.getLogger("scapy").setLevel(logging.ERROR)
from scapy.all import *
@Erreinion
Erreinion / ldap_query_users.ps1
Created March 10, 2015 21:07
Powershell script to query LDAP (AD) for users. Accomplished without the ActiveDirectory plug-in from Quest.
# LDAP Query
# Look for all people. Excludes the DISABLED OU
$Searcher = New-Object DirectoryServices.DirectorySearcher
$Searcher.SearchRoot = 'LDAP://CN=Users,DC=example,DC=com'
$Searcher.Filter = '(&(objectCategory=person))'
$res = $Searcher.FindAll() | Sort-Object path
foreach ($usrTmp in $res)
{
@nerdalert
nerdalert / Netfilter-IPTables-Diagrams.md
Last active July 4, 2024 20:20
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

:global ConnCount0
:if ([:typeof $ConnCount0] = "nothing") do={
:set ConnCount0 0
}
:local ConnCount1 0
:foreach i in=[/interface wireless registration-table find] do={ :set ConnCount1 ($ConnCount1 + 1) }
:if ($ConnCount0 < $ConnCount1) do={
@Potherca
Potherca / debug-bash-scripts.md
Last active January 10, 2024 21:29
Sometimes you want to be able to debug a bash script. This gist gives an example of how to do this.

Introduction

Sometimes you want to be able to debug a bash script. Usually the -x option will suffice but sometimes something more sophisticated is needed.

In such instances using the DEBUG trap is often a good choice.

Attached to this gist is a example script to demonstrate how such a thing would work.

@olih
olih / jq-cheetsheet.md
Last active July 16, 2024 23:02
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@graysonchao
graysonchao / paramiko_yubikey.py
Last active October 14, 2023 13:58
RSA+YubiKey 2FA example using Paramiko
username = raw_input("Enter SSH username:")
yubikey_string = getpass.getpass('Enter YubiKey OTP:')
client = paramiko.client.SSHClient()
# Any means of getting the PKey will do. This code assumes you've only got one key loaded in your active ssh-agent.
# See also:
# - http://docs.paramiko.org/en/1.17/api/keys.html#paramiko.pkey.PKey
# - http://docs.paramiko.org/en/1.17/api/client.html#paramiko.client.SSHClient.connect
my_pkey = paramiko.agent.Agent().get_keys()[0]