Skip to content

Instantly share code, notes, and snippets.

Carlin Scott carlin-q-scott

Block or report user

Report or block carlin-q-scott

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@carlin-q-scott
carlin-q-scott / save_facebook_group_photos.rb
Created Nov 11, 2019
Save Facebook group photos to Downloads folder using Firefox and Selenium WebDriver
View save_facebook_group_photos.rb
# This script will download all the photos owned by a group from Facebook.
require 'json'
require 'selenium-webdriver'
if ARGV.length != 3
print "please provide all the command arguments: {facebook group id} {first photo to download, often '1'} {last photo to download}"
exit 1
end
@carlin-q-scott
carlin-q-scott / query.bat
Last active Jul 10, 2019
Retrieve campsite availability by month for US Federal campgrounds
View query.bat
curl "https://www.recreation.gov/api/camps/availability/campground/234485/month?start_date=2019-07-01T00"%"3A00"%"3A00.000Z" -H "Accept: application/json, text/plain, */*" --compressed
View CIDR4Domain.sh
whois `nslookup facebook.com | grep Address | cut -d$'\n' -f 2 | cut -d ' ' -f 2` | grep CIDR | grep -o
'[^ ]*$'
View list-additional-functions.js
/*
This function will list all of the functions on an HTML DOM Element that are non-standard.
temp0 is set by the Firefox Inspector when you right click on an element and choose "use in console";
You need to do that before running this script.
*/
var functionList = "";
var element = document.createElement('div');
for(var p in temp0){
@carlin-q-scott
carlin-q-scott / Connect to OpenVPN.xml
Last active Mar 7, 2019
OpenVPN Connection Management
View Connect to OpenVPN.xml
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2018-12-20T17:30:53.9213074</Date>
<Author>Carlin Scott</Author>
<URI>https://gist.github.com/carlin-q-scott</URI>
</RegistrationInfo>
<Triggers>
<EventTrigger>
<Enabled>true</Enabled>
@carlin-q-scott
carlin-q-scott / docker-relay.sh
Last active Nov 17, 2018 — forked from jwilson8767/install_WSL_docker.sh
Docker or Docker Toolbox for Windows and Windows Subsystem for Linux (aka Bash on Windows)
View docker-relay.sh
#!/bin/sh
exec socat UNIX-LISTEN:/var/run/docker.sock,fork,group=docker,umask=007 EXEC:"npiperelay.exe -ep -s //./pipe/docker_engine",nofork
@carlin-q-scott
carlin-q-scott / Enum.js
Created Oct 10, 2018
Attempt at creating an enum using Proxy and Class
View Enum.js
class Enum extends Proxy {
constructor(...names) {
let members = Object.create(null);
members.tryParse = name => {
if (!members[name]) {
throw new Error(`Unable to parse '${name}' as an Enum member.`);
}
return members[name];
};
View GitBranchFromTag.sh
# Problem: Build servers check out tags to build them but we need to deploy our code based on the branch the code came from.
# Solution: Get branches containing the tag, figure out which one has the tagged commit as its head
$ git branch --contains tags/some-tag
* (HEAD detached at some-tag)
demo/carlin
demo/steve
$ git diff --shortstat demo/steve some-tag
View GetDomainAccountCredentials.ps1
$credential = $Host.ui.PromptForCredential("Need your domain account credentials", "Please enter your domain user name and password", $null, "NetBiosUserName")
# use -Credential $credential for some of the powershell commandlets. Copy-Item takes in this param but can't use it.
View ActionFluentAssertions.cs
/// <summary>
/// Note that if this is the end of your assertion chain then append () or .Invoke() to the end
/// </summary>
/// <param name="action"></param>
/// <param name="time"></param>
/// <param name="precision"></param>
/// <returns></returns>
public static Action ShouldTakeCloseTo(this Action action, TimeSpan time)
{
You can’t perform that action at this time.