Skip to content

Instantly share code, notes, and snippets.

View cmbaughman's full-sized avatar
🎯
Focusing

Chris Baughman cmbaughman

🎯
Focusing
View GitHub Profile
@cmbaughman
cmbaughman / psqlrc
Created December 30, 2014 00:56
From dotfiles, an awesome psql startup config!
-- Official docs: http://www.postgresql.org/docs/9.3/static/app-psql.html
-- Unofficial docs: http://robots.thoughtbot.com/improving-the-command-line-postgres-experience
-- Don't display the "helpful" message on startup.
\set QUIET 1
\pset null '[NULL]'
-- http://www.postgresql.org/docs/9.3/static/app-psql.html#APP-PSQL-PROMPTING
\set PROMPT1 '%[%033[1m%]%M %n@%/%R%[%033[0m%]%# '
-- PROMPT2 is printed when the prompt expects more input, like when you type
@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 / search.txt
Created January 13, 2015 23:38
Find FTP interesting info in github.
extension:conf ftp server configuration
extension:pem private
extension:xls mail
extension:sql mysql dump
# search for backdoor
stars:>1000 forks:>100 extension:php "eval(preg_replace("
@cmbaughman
cmbaughman / PlayVideoRemote.java
Created January 22, 2015 04:18
Android simple stream RTSP
public class PlayVideoRemote extends Activity
{
private VideoView vView;
private String vSource;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
//sets the Bundle
@cmbaughman
cmbaughman / NewGoogleDorks.md
Last active February 27, 2023 22:07
New Google Dorks for open directories.

Open Directories


Ebooks examples

Paste this in the search box or use the URL that follows:

+(.MOBI|.CBZ|.CBR|.CBC|.CHM|.EPUB|.FB2|.LIT|.LRF|.ODT|.PDF|.PRC|.PDB|.PML|.RB|.RTF|.TCR) PUT EBOOK NAME HERE intitle:"index of" -inurl:(jsp|pl|php|html|aspx|htm|cf|shtml) -inurl:(listen77|mp3raid|mp3toss|mp3drug|index_of|wallywashis)
@cmbaughman
cmbaughman / MMM_MetaData.cls
Created February 12, 2015 14:31
Apex Metadata API
public class MMM_MetaData {
public void initAllFields() {
List<MetadataService.CustomField> customs = new List<MetadataService.CustomField>();
MetadataService.CustomField customfield = new MetadataService.CustomField();
customfield.fullName = 'Product2.Magento_Product_OID__c';
customfield.externalId = true;
customfield.label = 'Magento Product OID';
cd
mkdir bin
export PATH=$PATH:$HOME/bin
git clone git://github.com/Araq/Nim.git
cd Nim
git clone --depth 1 git://github.com/nim-lang/csources
cd csources && sh build.sh
cd ..
bin/nim c koch
./koch boot -d:release
@cmbaughman
cmbaughman / ChangeOSXWallPaperJoke.sh
Last active August 29, 2015 14:18
ChangeOSXWallPaperJoke
#!/bin/bash
#osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/Library/Desktop Pictures/Earth Horizon.jpg"'
## OR
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/local/bin
size=1440
dest="/usr/local/share/backgrounds/wallpaperEAA.jpg"
curl -O 'http://cdn1.editmysite.com/uploads/4/0/3/4/40341331/background-images/717864058.jpg' > "$dest"
killall Dock
@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 / docker-nsenter.sh
Last active August 29, 2015 14:18
Forward all of Docker’s ports from the VM to localhost. (Boot2Docker)
#!/bin/bash
set -e
# Check for nsenter. If not found, install it
boot2docker ssh '[ -f /var/lib/boot2docker/nsenter ] || docker run --rm -v /var/lib/boot2docker/:/target jpetazzo/nsenter'
# Use bash if no command is specified
args=$@
if [[ $# = 1 ]]; then
args+=(/bin/bash)