Skip to content

Instantly share code, notes, and snippets.

View jboursiquot's full-sized avatar
👾

Johnny Boursiquot jboursiquot

👾
View GitHub Profile
@jboursiquot
jboursiquot / requirements.md
Last active September 23, 2020 14:27
BaltimoreGo Challenge: Build a Port Scanner

Your challenge is to write a port scanner in Go that uses a worker pool to efficiently scan multiple ports concurrently. It should meet the following requirements:

  1. Accepts a range of ports to scan as an argument (e.g. ./portscan -ports 8080-9090)
  2. Accepts a number of workers to use for performing the scans (e.g. ./portscan -workers 100)
  3. Outputs <PORT> CLOSED for closed ports as they are discovered.
  4. Outputs <PORT> OPEN for open ports as they are discovered.
  5. Extra credit: How could you informed the user of your port scanner of the likely service running on the open ports? (e.g. 5432 is likely a PostgreSQL server)

Hints:

package mypackage
import (
"context"
"fmt"
"os"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/dynamodb"
@jboursiquot
jboursiquot / go to
Last active September 21, 2019 13:51
bit.ly/gobridge-practical-go-workshop
bit.ly/gobridge-practical-go-workshop
@jboursiquot
jboursiquot / BaltimoreGo-090319-Challenge.md
Last active September 3, 2019 23:51
Baltimore Go Challenge for September 3rd, 2019 Meeting: Consume Maryland's Road Closures

Challenge: Consume Maryland's Road Closures

The state of MD exposes road closure data for you to do with whatever you'd like. Today, you'd like to fetch it and save it locally in a relational database (maybe sqlite?).

Head over to the site to explore the data.

Your mission (and success criteria):

  1. Consume the JSON endpoint for that data: https://opendata.maryland.gov/resource/nigh-m2sg.json
  2. Successfully parse each "closure" including its lat/long data, timestamps, etc.
@jboursiquot
jboursiquot / boursiquotj-cca630-p3-vpc.yaml
Created August 29, 2019 02:50
CCA 630 Project 3 VPC CloudFormation template
AWSTemplateFormatVersion: '2010-09-09'
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: "VPC Configuration"
Parameters:
- vpccidr
- publicacidr
@jboursiquot
jboursiquot / steps.md
Last active April 3, 2019 00:20
Setting yourself up to contribute to Open Source Go projects with Modules

Step 1: go get the project

$ go get github.com/GITHUB_USERNAME/GITHUB_PROJECT

Step 2: Fork the repo

  • Navigate to the project's GitHub page and fork it into your own account.
  • Clone the project locally.

Keybase proof

I hereby claim:

  • I am jboursiquot on github.
  • I am jboursiquot (https://keybase.io/jboursiquot) on keybase.
  • I have a public key whose fingerprint is 2F5A D69A 2F81 7E34 3A9C 424D CD6F A8BE 87F7 0649

To claim this, I am signing this object:

@jboursiquot
jboursiquot / keybase.md
Last active March 29, 2019 20:04
keybase.md

Please publicly post the following Gist, and name it keybase.md

Keybase proof

I hereby claim:

  • I am jboursiquot on github.
  • I am jboursiquot (https://keybase.io/jboursiquot) on keybase.
  • I have a public key ASDmOWpT1ggiUmnZeb52pnxbP3DEZh5pfFwDzBYpchU4Wgo

Red vs Blue: HTTP Showdown

Red Team: Build a temperamental HTTP server

Your mission, should you choose to accept it, is to build an HTTP server in Go that behaves erratically. Yes, your job is to write an HTTP server that misbehaves by doing the following in a non-deterministic fashion:

  • Delays responses to clients randomly between 10 and 30 seconds sometimes
  • Randomly errors out with HTTP 5XX responses
  • Rate-limits client requests adaptively in real time (for example, a client that makes 10 consecutive requests within 500 ms of each other should get throttled and receive an HTTP 429 status code)

Depth-First Search

Given the following Node struct and a slice of optional children nodes, implement a DepthFirstSearch method on Node that uses a depth-first search algorithm (navigating the tree from left to right) to return a slice of all the child node Name attributes in the appropriate order.

type Node struct {
	Name     string
	Children []*Node
}