Skip to content

Instantly share code, notes, and snippets.

View p4tin's full-sized avatar
💭
GO GO GO!!!

Paul Fortin p4tin

💭
GO GO GO!!!
View GitHub Profile
@p4tin
p4tin / groktunnel.go
Last active April 5, 2022 20:12
groktunnel
package main
import (
"bufio"
"context"
"crypto/rand"
"flag"
"fmt"
"io"
"log"
@p4tin
p4tin / main.py
Created October 3, 2020 15:17
Json Encode/Decode Python classes
import json
from json import JSONEncoder
class Student:
def __init__(self, first_name, last_name):
self._first_name = first_name
self._last_name = last_name
@property
@p4tin
p4tin / main.go
Created July 2, 2020 01:44
Create, Shuffle and Deal Deck of cards
package main
import (
"fmt"
"math/rand"
"os"
"time"
)
// Card holds the card suits and types in the deck
@p4tin
p4tin / index.html
Created March 25, 2020 11:39 — forked from Machy8/index.html
Apicart - minimum configuration - https://apicart.net
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Apicart vue bundle example">
<title>Vue default bundle example</title>
</head>
<body>
<!-- You can use custom layout. This is just for the example -->
@p4tin
p4tin / sshd.go
Created March 17, 2019 13:11 — forked from jpillora/sshd.go
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@p4tin
p4tin / README.md
Created November 30, 2018 16:18
Wordpress Kubernetes Cluster

Kubernetes Wordpress installation

Use minikube to test with

  • on macos: ** brew cask install minikube ** minikube start

Start the cluster and scale:

  • kubectl create secret generic mysql-pass --from-literal=password=YOUR_PASSWORD
@p4tin
p4tin / invoke_lambda.go
Created November 28, 2018 17:39
Invoke Lamdba in your local for testing
package golambdainvoke
import (
"encoding/json"
"errors"
"fmt"
"net/rpc"
"time"
"github.com/aws/aws-lambda-go/lambda/messages"
@p4tin
p4tin / sqsmv.go
Created August 16, 2018 16:01
Copy messages from one AWS Queue to another
package main
import (
"flag"
"fmt"
"log"
"os"
"sync"
"github.com/aws/aws-sdk-go/aws"
package main
import (
"strings"
"net/http"
"fmt"
"time"
"io/ioutil"
"net/url"
)
@p4tin
p4tin / clients-mongo,go
Created July 12, 2018 02:18
Mocking Mongo
package clients
import (
"github.com/globalsign/mgo"
"testapp"
)
// NewSession returns a new Mongo Session.
func NewSession() testapp.Session {
mgoSession, err := mgo.Dial("localhost:27017")