Skip to content

Instantly share code, notes, and snippets.

View jrwren's full-sized avatar
💭
🤯💯👍🔥🎉🤷‍♀️😍😕🕴🏽😵😞🤕🤮

Jay R. Wren jrwren

💭
🤯💯👍🔥🎉🤷‍♀️😍😕🕴🏽😵😞🤕🤮
View GitHub Profile
@jrwren
jrwren / jwt.go
Created April 22, 2020 18:33
bosses boss linked me to this... JWT in <50 lines of code.
package main
import (
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"encoding/base64"
"os"
)
@jrwren
jrwren / jsonmerge.go
Created December 10, 2019 21:39
merge json files into single json with filename minus .log as key
package main
import (
"encoding/json"
"flag"
"log"
"os"
"strings"
)
@jrwren
jrwren / permutecase.go
Created October 25, 2019 15:21
permute case
package main
import (
"fmt"
"strings"
)
func main() {
casePermute("ABCü123")
}
@jrwren
jrwren / main.go
Created October 4, 2019 21:42
crawler
package main
import (
"flag"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
"regexp"
@jrwren
jrwren / gist:c1cf9d5a938d56d5f410312031115c6c
Created September 26, 2019 15:57
Go tls is missing 3 ciphers that it could trivially support.
diff --git a/src/tls/cipher_suites.go b/src/cipher_suites.go
index 9eb699f1c..99c169a7a 100644
--- a/src/tls/cipher_suites.go
+++ b/src/tls/cipher_suites.go
@@ -13,6 +13,7 @@ import (
"crypto/rc4"
"crypto/sha1"
"crypto/sha256"
+ "crypto/sha512"
"crypto/x509"
@jrwren
jrwren / gist:e1c018e72786ab0e07947a246cc8304d
Created April 30, 2019 20:50
ah, c++, even the simplest, most basic code I can imagine and...
Undefined symbols for architecture x86_64:
"std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
std::__1::ctype<char> const& std::__1::use_facet<std::__1::ctype<char> >(std::__1::locale const&) in main.o
std::__1::ctype<char> const& std::__1::use_facet<std::__1::ctype<char> >(std::__1::locale const&) in decrypt_process.o
"std::__1::ios_base::getloc() const", referenced from:
std::__1::basic_ios<char, std::__1::char_traits<char> >::widen(char) const in main.o
std::__1::basic_ios<char, std::__1::char_traits<char> >::widen(char) const in decrypt_process.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(unsigned long, char)", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(unsigned long, char) in main.o
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(unsigned long, char) in decrypt_p
@jrwren
jrwren / hex.cc
Created April 11, 2019 20:05
all of the answers for using ostream_iterator and copy to turn a string to hex in c++ on Stack Overflow are wrong. This works.
#include <iostream>
#include <vector>
#include <algorithm>
#include <sstream>
#include <iomanip>
using namespace std;
template <typename T>
struct hexwrite
{
// Copyright 2012 Google, Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file in the root of the source
// tree.
// This binary provides sample code for using the gopacket TCP assembler raw,
// without the help of the tcpreader library. It watches TCP streams and
// reports statistics on completed streams.
//
@jrwren
jrwren / nats.go
Created November 12, 2018 17:15
a cmdline nats client
package main
import (
"flag"
"log"
"time"
"github.com/nats-io/go-nats"
)
@jrwren
jrwren / gist:1aff7c80ec83b903f77ce97e75852dbf
Created October 8, 2018 15:32
cisco ISR does weird DNS?
Oct 8 11:26:40 delays named[16621]: ../../../../lib/isc/unix/socket.c:2135: unexpected error:
Oct 8 11:26:40 delays named[16621]: internal_send: 192.168.15.35#53659: Invalid argument
Oct 8 11:26:40 delays named[16621]: client @0x7f45e0629a90 192.168.15.35#53659 (1-courier.push.appl
e.com): view all: error sending response: invalid file