Skip to content

Instantly share code, notes, and snippets.

View Sam-Lane's full-sized avatar

Sam Lane Sam-Lane

View GitHub Profile

Keybase proof

I hereby claim:

  • I am Sam-Lane on github.
  • I am samlane (https://keybase.io/samlane) on keybase.
  • I have a public key whose fingerprint is 260F 60C2 05A8 5FCE 27E3 8774 BCAA 8BA7 35FB 589C

To claim this, I am signing this object:

# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# Enable mouse mode (tmux 3.1 and above)
set -g mouse on
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
@Sam-Lane
Sam-Lane / censor_flag.py
Created July 11, 2019 11:28
Censor a CTF flag by changing chars * except first and last n chars
import sys
def print_usage():
print("censor_flag.py <hash> [i]\nhash = hash you wish to censor\ni = optional amount you wish to keep plain text in censored string.")
def censor(hash, uncensor_amount=3):
uncensor_amount = int(uncensor_amount)
hash_length = len(hash)
censored_hash = hash[:uncensor_amount]
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#source - https://stackoverflow.com/questions/23894221/upload-file-to-my-dropbox-from-python-script
import dropbox
class TransferData:
def __init__(self, access_token):
self.access_token = access_token
@Sam-Lane
Sam-Lane / 2dListTo2dArray.java
Created December 19, 2017 11:23
Function to take a 2D list to a 2D array
private String[][] listToArray(List<String[]> list) {
String[][] array = new String[list.size()][];
for (int i = 0; i < list.size(); i++) {
String[] row = list.get(i);
array[i] = row;
}
return array;
}
@Sam-Lane
Sam-Lane / subnet.py
Created February 27, 2017 13:07 — forked from Lyrain/subnet.py
Script to "cheat" at sub-netting.
#!/usr/local/bin/python3
import sys
import ipaddress as ip
def print_help():
print("Usage: ")
print("main.py address [computers]\n")
print("address: must be an IPv4 network address (including netmask in shorthand e.g. 192.168.211.0/27)")
print("computers: optional - Number of computers on subnet. Will only print first and last host address.")