Skip to content

Instantly share code, notes, and snippets.

View brandonweeks's full-sized avatar

Brandon Weeks brandonweeks

View GitHub Profile
C_INCLUDE_PATH="$(brew --prefix openssl@1.1)/include" LIBRARY_PATH="$(brew --prefix openssl@1.1)/lib" go run client.go -sim
@brandonweeks
brandonweeks / libcurl_client_cert.c
Created June 4, 2021 00:20
An example of how to use libcurl with a client certificate on Windows
#include <iostream>
#include "curl/curl.h"
int main()
{
CURL* req = curl_easy_init();
CURLcode res;
if (req)
{
curl_easy_setopt(req, CURLOPT_URL, "certauth.idrix.fr");
// Find the type (e.g. RSA) of the EVP_PKEY we've been provided.
let pkey_type = EVP_PKEY_type(EVP_PKEY_id(pkey));
// Create a new EVP_PKEY_METHOD.
let pmeth = EVP_PKEY_meth_new(pkey_type, 0);
// Find the default EVP_PKEY_METHOD for the type.
let default_method = EVP_PKEY_meth_find(pkey_type);
// Copy the default method into ours.
EVP_PKEY_meth_copy(pmeth, default_method);
// Overwrite _just_ the {sign_init, sign} methods.
EVP_PKEY_meth_set_sign(pmeth, sign_init, sign);
@brandonweeks
brandonweeks / gist:8b6c512fb743813d3f001f10528bf53f
Last active March 13, 2018 22:23
kubernetes make release output
$ make release
build/release.sh
+++ [0426 01:54:18] Verifying Prerequisites....
+++ [0426 01:54:18] No docker host is set. Checking options for setting one...
+++ [0426 01:54:18] docker-machine was found.
Host does not exist: "kube-dev"
+++ [0426 01:54:18] Creating a machine to build Kubernetes
Machine "kube-dev" is already running.
build/../build/common.sh: line 205: DOCKER_MACHINE_NAME: readonly variable
+++ [0426 01:55:21] A Docker host using docker-machine named 'kube-dev' is ready to go!
public class MainActivity extends AppCompatActivity {
static String TAG = "BLEScanner";
BluetoothAdapter mBluetoothAdapter;
BluetoothLeScanner mBluetoothLeScanner;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Keybase proof

I hereby claim:

  • I am brandonweeks on github.
  • I am weeks (https://keybase.io/weeks) on keybase.
  • I have a public key ASBYG28PqcyXPFs_OKulWicuGPn6SmodwgC9r9FKM0sv3Ao

To claim this, I am signing this object:

Checking that it builds... OK
Checking for files that need gofmt... OK
Checking for files that need boilerplate... OK
Checking for problems with flag names... OK
Checking for API descriptions... OK
Last login: Wed Apr 27 00:58:43 2016 from 74.122.187.227
CoreOS alpha (1029.0.0)
Update Strategy: No Reboots
Failed Units: 23
docker-01f453ac88f9c77b80a0bb3d0fc10c5e5beaa69302d9f20b1510b7f540e9c715.scope
docker-062669038b5e89781fdceb37da218e5b1906f588cae7285f321a14ffc8707722.scope
docker-09bb1c550cf29038bc68b41cd04258235ee4051b8988ba1fc94195f7d10e1757.scope
docker-1955cefaf9c1334d40d43fe4f454841ba647f8c435b9a616f762f20062445666.scope
docker-1aff4841f7070425d2590ff3b3d797313ec8858603507804ba862d25f488ed2b.scope
docker-21aa3a36aec5011f5a95efc1fbbcc31e3a6c3abeb8bfa510c288655c99422c7c.scope
- Logs begin at Wed 2016-04-27 00:49:55 UTC, end at Wed 2016-04-27 01:08:01 UTC. --
Apr 27 00:50:51 ip-10-0-0-50.us-west-1.compute.internal systemd[1]: Started Docker Application Container Engine.
Apr 27 00:50:51 ip-10-0-0-50.us-west-1.compute.internal dockerd[1085]: time="2016-04-27T00:50:51.546366410Z" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Apr 27 00:50:51 ip-10-0-0-50.us-west-1.compute.internal dockerd[1085]: time="2016-04-27T00:50:51.549673303Z" level=info msg="Firewalld running: false"
Apr 27 00:50:52 ip-10-0-0-50.us-west-1.compute.internal dockerd[1085]: time="2016-04-27T00:50:52.102048600Z" level=info msg="Loading containers: start."
Apr 27 00:50:52 ip-10-0-0-50.us-west-1.compute.internal dockerd[1085]: time="2016-04-27T00:50:52.102361268Z" level=info msg="Loading containers: done."
Apr 27 00:50:52 ip-10-0-0-50.us-west-1.compute.internal dockerd[1085]: time="2016-04-27T00:50:52.102568407Z" level=info msg="Daemon has completed initialization"
Apr 27 00:50:52 ip-10-0