Skip to content

Instantly share code, notes, and snippets.

View markandrewj's full-sized avatar

Mark Jackson markandrewj

  • Canada
View GitHub Profile

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@markandrewj
markandrewj / gist:4239d56f39912a33c450
Last active August 29, 2015 14:11 — forked from BrennanRoberts/gist:1598992
Smart Updating of Collections with Backbone
Backbone.Collection.prototype.update = function(col_in){
var that = this,
ids = [];
var cur_ids = that.pluck('id'),
new_ids = _(col_in).pluck('id'),
to_remove = _(cur_ids).difference(new_ids);
this.remove(to_remove);
@markandrewj
markandrewj / nmap_poodle
Last active August 29, 2015 14:07
NMAP poodle, basic
nmap --script ssl-enum-ciphers -p 443 twitter\.com |grep "SSLv3: No supported" ||echo "Site vulnerable to poodle" # Check for Poodle vuln
local coroutine = require "coroutine"
local io = require "io"
local math = require "math"
local nmap = require "nmap"
local shortport = require "shortport"
local sslcert = require "sslcert"
local stdnse = require "stdnse"
local string = require "string"
local table = require "table"
local tls = require "tls"
@markandrewj
markandrewj / php_bycrpyt
Last active August 29, 2015 14:07
PHP bcrypt
<?php
// Usage 1:
echo password_hash("rasmuslerdorf", PASSWORD_DEFAULT)."\n";
// $2y$10$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// For example:
// $2y$10$.vGA1O9wmRjrwAVXD98HNOgsNpDczlqm3Jq7KnEd1rVAGv3Fykk1a
// Usage 2:
$options = array('cost' => 11);
echo password_hash("rasmuslerdorf", PASSWORD_BCRYPT, $options)."\n";
<?
$launchkey->ping();
?>
from scapy.all import *
print sr1(IP(dst="4.2.2.1")/ICMP()).summary()
@markandrewj
markandrewj / bash_bug_test
Created October 14, 2014 12:25
Check if bash bug has been patched
env 'VAR=() { :;}; echo Bash is vulnerable!' 'FUNCTION()=() { :;}; echo Bash is vulnerable!' bash -c "echo Bash Test"
// npm install bcrypt
var bcrypt = require('bcrypt');
var password = process.argv[2];
bcrypt.genSalt(function(err, salt) {
if (err) {
console.log(err);
}
console.log('salt: ' + salt + ' (length: ' + salt.length + ')');
@markandrewj
markandrewj / tmux.conf
Last active April 9, 2024 01:56
Basic Tmux Status Bar
# ----------------------
# Status Bar
# -----------------------
set-option -g status on # turn the status bar on
set -g status-utf8 on # set utf-8 for the status bar
set -g status-interval 5 # set update frequencey (default 15 seconds)
set -g status-justify centre # center window list for clarity
# set-option -g status-position top # position the status bar at top of screen
# visual notification of activity in other windows