Skip to content

Instantly share code, notes, and snippets.

View DylanLacey's full-sized avatar

The Gentlehacker DylanLacey

View GitHub Profile
@DylanLacey
DylanLacey / miniproxy.py
Created September 14, 2018 04:53
Proxy from localhost safely.
#! python
# encoding: utf-8
import sys
import logging
import logging.handlers
import urllib
from urlparse import urlsplit, urlunsplit, urljoin
@DylanLacey
DylanLacey / proxytest.bat
Last active September 19, 2018 05:01
Checking to see if we can write then run pyfon
certutil.exe -urlcache -split -f %1 proxytest.py
echo "fries"
certutil.exe -urlcache -split -f "http://127.0.0.1:19876/pac.js" pac.js
c:\python27\python.exe proxytest.py
#! python
import re
pattern = r"PROXY (\d+\.\d+\.\d+\.\d+):(\d+)"
f = open("pac.js", "r")
for line in f:
if re.search(pattern, line):
print("Match: %s" % line)
else:
@echo %time%
@DylanLacey
DylanLacey / ssltest.bat
Last active August 7, 2018 06:57
Test Why No Connect
@echo echo "Q" | openssl s_client -connect dev.portaldeassinaturas.com.br:443 -servername dev.portaldeassinaturas.com.br -showcerts
@DylanLacey
DylanLacey / compat.bat
Last active December 27, 2018 16:06
Compatibility Mode
REG ADD "HKCU\Software\Policies\Microsoft\Internet Explorer\BrowserEmulation\PolicyList" /v "google.com" /d "google.com" /t REG_SZ /f
REG QUERY "HKCU\Software\Policies\Microsoft\Internet Explorer\BrowserEmulation\PolicyList" /s
@DylanLacey
DylanLacey / sauce_capybara.rb
Created May 10, 2018 04:51
Capybara for Sauce Labs
module SauceCapybara
class Driver < Capybara::Selenium::Driver
# No need to clean up after sessions & no need to wait until all
# processes have ended to call close (and doing so can cause timeout
# problems on Sauce) so just quit now.
def reset!
quit
end
end
end
tracert google.com
#! /bin/bash
defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false
defaults write com.apple.safari PreloadTopHit -boolean false
echo "Set defaults"
@DylanLacey
DylanLacey / example.java
Created March 7, 2018 04:23
Encoding Usernames for RemoteWebDriver
// Add to the end of your imports
import java.net.URLEncoder;
public String username = "someone@company";
public String accesskey = "abc123-defgh4312-deftg";
// Inside your driver creation method
String seleniumServer = "ondemand.saucelabs.com:443";
String authenticatedURL = "https://" + URLEncoder.encode(username) + ":" + accesskey + "@" + seleniumUrl + "/wd/hub";