Skip to content

Instantly share code, notes, and snippets.

View cmbaughman's full-sized avatar
🧐
I may be slow to respond.

Chris Baughman cmbaughman

🧐
I may be slow to respond.
View GitHub Profile
@cmbaughman
cmbaughman / query.cls
Last active May 11, 2017 06:01
Salesforce Apex Query with Wildcard
public static String getAllQuery(String query) {
String result = '';
String regex = '^select\\s+\\*\\s*(?:,\\s*[^\\s]+\\s*)*\\s+from\\s+([^\\s]+)(.*)$';
Matcher m = Pattern.compile(regex).matcher(query.toLowerCase());
if(m.matches()) {
String sObjectName = m.group(1);
Schema.SObjectType targetType = Schema.getGlobalDescribe().get(sObjectName);
Map<String, Schema.SObjectField> fieldMap = targetType.getDescribe().fields.getMap();
@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@beaugunderson
beaugunderson / cool-modules.md
Last active February 2, 2023 19:58
cool modules from nodeconf

from streams session

  • end-of-stream - specify a callback to be called when a stream ends (which is surpsingly hard to get right)
  • duplexify - compose a Duplex stream from a Readable and a Writable stream
  • pump - pipe streams together and close all of them if one of them closes
  • pumpify - combine an array of streams into a single duplex stream using pump and duplexify
  • through2 - tools for making Transform streams
  • from2 - tools for making Readable streams

from "participatory modules" session

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
@cmbaughman
cmbaughman / osx-for-pentesting.sh
Last active October 15, 2016 17:26 — forked from gabemarshall/osx-for-pentesting.sh
A fork of osx-for-hackers for my personal pentesting setup preferences
# OSX for Pentesting (Mavericks/Yosemite)
#
# A fork of OSX for Hackers (Original Source: https://gist.github.com/brandonb927/3195465)
#!/bin/sh
# Ask for the administrator password upfront
echo "Have you read through the script prior to running this? (y or n)"
read bcareful
@jdforsythe
jdforsythe / connect.ps1
Last active February 19, 2024 11:05
Remote Desktop Auto Login Powershell Script
cmdkey /list | ForEach-Object{if($_ -like "*target=TERMSRV/*"){cmdkey /del:($_ -replace " ","" -replace "Target:","")}}
echo "Connecting to 192.168.1.100"
$Server="192.168.1.100"
$User="Administrator"
$Password="AdminPassword"
cmdkey /generic:TERMSRV/$Server /user:$User /pass:$Password
mstsc /v:$Server
#!/usr/bin/env python
# Rulz.py
# Author: Nick Landers (@monoxgas) - Silent Break Security
import os
import sys
import argparse
import re
import binascii
import codecs
@hanovruslan
hanovruslan / file.sh
Last active April 17, 2020 22:37
Create ansible deb package from source and install it
apt-get install libxml2-utils sshpass devscripts python-yaml python-paramiko python-jinja2 cdbs debhelper dpkg-dev git-core reprepro asciidoc
git clone git://github.com/ansible/ansible.git --recursive
cd ./ansible
git checkout [branch-with-desired-version] # stable-1.9 etc.
git pull --rebase
git submodule update --init --recursive
make && make deb
dpkg -i deb-build/[some-path]/ansible[some-build-details].deb
@Chandler
Chandler / slack_history.py
Last active March 26, 2024 14:35
Download Slack Channel/PrivateChannel/DirectMessage History
print("UPDATE AUG 2023: this script is beyond old and broken")
print("You may find interesting and more up to date resources in the comments of the gist")
exit()
from slacker import Slacker
import json
import argparse
import os
# This script finds all channels, private channels and direct messages
@dantman
dantman / gist.css
Last active April 17, 2018 22:07
Material Design sp units (px unit that scale to the user's font settings) using rems
html {
font-size: 14px;
}
/**
* PostCSS
* Use a custom PostCSS to convert #sp to rems by dividing the number by 14 and expressing it as #rem
*/
body {