Skip to content

Instantly share code, notes, and snippets.

View LazerPanther's full-sized avatar

Grimmjaw LazerPanther

View GitHub Profile
@LazerPanther
LazerPanther / ask.sh
Created March 9, 2016 20:51
Bash: General-purpose Yes/No prompt function ("ask")
# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.
ask() {
# http://djm.me/ask
while true; do
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
@LazerPanther
LazerPanther / 7z-ultra-folder.sh
Created January 31, 2016 23:37
A somewhat unnecessary script used to compress a folder into a 7zip archive with "ultra" settings.
#!/bin/sh +x
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 1 ] || die "1 argument required, $# provided"
[ -e "$1" ] || die "$1 does not exist"
_cwd=`pwd`
@LazerPanther
LazerPanther / 7z+tar.md
Last active January 31, 2016 23:36
Archive with tar + 7z + max compression

Overview

7-zip doesn't preserve the Linux/Unix owner/group of files and possibly other details. Use tar instead because it's designed to preserve these things, then just 7zip the tar archive.

Create the archive

tar cf - --exclude=\*.o -v directory | 7z a -si -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on directory.tar.7z

Code Signing

A few ways of checking code signatures on OS X.

Simple

$ /usr/bin/codesign --verify --deep --verbose /Applications/Xcode.app
/Applications/Xcode.app: valid on disk
/Applications/Xcode.app: satisfies its Designated Requirement
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
@LazerPanther
LazerPanther / linuxprivchecker.py
Created December 24, 2015 23:10 — forked from sh1n0b1/linuxprivchecker.py
linuxprivchecker.py -- a Linux Privilege Escalation Check Script
#!/usr/env python
###############################################################################################################
## [Title]: linuxprivchecker.py -- a Linux Privilege Escalation Check Script
## [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift
##-------------------------------------------------------------------------------------------------------------
## [Details]:
## This script is intended to be executed locally on a Linux box to enumerate basic system info and
## search for common privilege escalation vectors such as world writable files, misconfigurations, clear-text
## passwords and applicable exploits.
@LazerPanther
LazerPanther / GoogleHackMasterList.txt
Created December 22, 2015 00:37 — forked from cmartinbaughman/GoogleHackMasterList.txt
The definitive super list for "Google Hacking".
admin account info" filetype:log
!Host=*.* intext:enc_UserPassword=* ext:pcf
"# -FrontPage-" ext:pwd inurl:(service | authors | administrators | users) "# -FrontPage-" inurl:service.pwd
"AutoCreate=TRUE password=*"
"http://*:*@www&#8221; domainname
"index of/" "ws_ftp.ini" "parent directory"
"liveice configuration file" ext:cfg -site:sourceforge.net
"parent directory" +proftpdpasswd
Duclassified" -site:duware.com "DUware All Rights reserved"
duclassmate" -site:duware.com
#
# Uncrustify Configuration File
# File Created With UncrustifyX 0.2 (140)
#
# Alignment
# ---------
## Alignment
@LazerPanther
LazerPanther / .slate.js
Created December 4, 2015 17:43 — forked from leb2/.slate.js
My Slate Config
var MARGIN = 28;
// Fullscreen
slate.bind('f:cmd,alt', function(win) {
// ±4 to account for hidden Dock on left of screen.
win.doOperation(S.op('move', {
'x': 'screenOriginX - 4 + ' + MARGIN,
'y': 'screenOriginY + ' + MARGIN,
@LazerPanther
LazerPanther / gmailToSlack.js
Created December 2, 2015 22:49 — forked from rushimusmaximus/gmailToSlack.js
Google Apps Script to post filtered Gmail messages to Slack
/*
The intent of this script is for posting filtered Gmail messages to Slack.
This script could be used on its own with manually-marked messages, but it
is most useful it when combined with a Gmail filter. The script assumes that
target messages have had a specific label set on them and have been starred.
The Apps Script can then be set to run periodically.
2015/02 cmyers, rush