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 / sf_to_wp_sso.md
Created May 1, 2015 19:00
Set up Salesforce as an Identity Provider for Single Sign On with Wordpress

##Wordpress Side:

  1. On WP install the plugin SAML 2.0 Single Sign-On

  2. Once installed, copy and paste into an email the section “Your SAML Info”

  3. Make sure to check only the box labeled ‘Allow SSO Bypass’.

  4. Click Service Provider tab and put a check in the “Generate new certificate and private key for me.” then click update at the bottom of the page.

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” 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 / generate_requires_setuppy.py
Created April 7, 2015 14:59
Automatically generate setup.py install_requires and dependency_links from a requirements.txt file.
import os
import re
def which(program):
"""
Detect whether or not a program is installed.
Thanks to http://stackoverflow.com/a/377028/70191
"""
def is_exe(fpath):
return os.path.exists(fpath) and os.access(fpath, os.X_OK)
@cmbaughman
cmbaughman / nc.md
Created January 6, 2015 17:18
Netcat (nc) cheatsheet

##Netcat Commands

NOTE: - If on Ubuntu, you need the REAL nc package, to get it use:

sudo apt-get -y install netcat-traditional
sudo update-alternatives --config nc
# Select the nc.traditional option
@cmbaughman
cmbaughman / find_date.md
Created February 1, 2024 15:39
Linux copy files based on date

To copy some files from one directory to another can be done kinda nicely with the find command.

  1. First define the start date: touch --date "2024-01-01" /tmp/start
  2. Define the end date: touch --date "2024-02-01" /tmp/end
  3. Now simply craft a find command like this:
find /var/logs/some_dir -type f -newer /tmp/start -not -newer /tmp/end -exec cp "{}" /opt/another/directory \;

NOTE: In the above command, the -exec part of the find uses "{}" as where it puts each filename

@cmbaughman
cmbaughman / TextBookSearch.md
Last active January 30, 2024 06:23
Searching for Text Books

Note: I found this on the /r/Piracy subreddit (https://www.reddit.com/r/Piracy/comments/3i9y7n/guide_for_finding_textbooks/?sort=confidence) however I am including a copy here just in case.

So you have a list of books you need to buy for college. There are some really great resources for finding them online, but I'm going to run through the easiest methods for searching all of them here.

First, let's start off by using the method that will allow you to find the vast majority of books. Google. It tends to be easier if you can search multiple sites at once, and this is the easiest way to do it.

There was a search engine that /u/ratokursi made 3 years ago, but by now most of the sites are either dead or have changed the url. I decided to make a new one, this time after reviewing 100+ sites and adding to working ones to the custom search engine.

https://cse.google.com/cse/publicurl?cx=011394183039475424659:5bfyqg89ers

@cmbaughman
cmbaughman / getbadguys.sh
Created February 10, 2020 23:49 — forked from JeremyMorgan/getbadguys.sh
Get a list of IP addresses trying to attack your CentOS server
#/usr/bin/bash
# strings to look for in our file
# Note: you could just parse the whole file. But if you put in a bad password your IP
# could end up on the bad guy list
declare -a badstrings=("Failed password for invalid user"
"input_userauth_request: invalid user"
"pam_unix(sshd:auth): check pass; user unknown"
"input_userauth_request: invalid user"
"does not map back to the address"
"pam_unix(sshd:auth): authentication failure"
@cmbaughman
cmbaughman / README.md
Created March 20, 2019 23:33 — forked from takikoo/README.md
Export bookmarks from Google Chrome with a batch script

Export chrome bookmarks

This is a script to export bookmarks from the web browser Google Chrome to a users home drive in a Windows environment with clients and domain controllers. Most of the script comes from this article

Instruction

  • Double-click on the bat-file.
  • Go the home drive on the users new computer.
  • Double-click on openChromeFolder.bat which will take you to the chrome directory on that machiene.
  • Copy the file Bookmarks to the newly opened window.
@cmbaughman
cmbaughman / winshare.md
Created January 18, 2023 14:04
Mounting Windows Shares With CIFS

How To Use Windows Network Shares From Linux

This is the fastest way to set up Windows network (AD) shares with Linux using cifs-utils

Setup

  1. sudo apt update && sudo apt install cifs-utils -y
  2. sudo mkdir /mnt/win_share_name
  3. Create a credentials file: sudo nano /etc/win-credentials and enter the following contents:
@cmbaughman
cmbaughman / GifInject.py
Created May 21, 2019 23:20
Inject JavaScript into a GIF
#!/usr/bin/env python2
#============================================================================================================#
#======= Simply injects a JavaScript Payload into a GIF. ====================================================#
#======= or it creates a JavaScript Payload as a GIF. ====================================================#
#======= The resulting GIF must be a valid (not corrupted) GIF. =============================================#
#======= Author: marcoramilli.blogspot.com ==================================================================#
#======= Version: PoC (don't even think to use it in development env.) ======================================#
#======= Disclaimer: ========================================================================================#
#THIS IS NOT PEP3 FORMATTED
#THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR