Skip to content

Instantly share code, notes, and snippets.

View wheelerlaw's full-sized avatar
💻
Probably writing code

Wheeler Law wheelerlaw

💻
Probably writing code
  • Chicago
  • 03:25 (UTC -05:00)
View GitHub Profile
@wheelerlaw
wheelerlaw / wineries.ts
Last active February 23, 2024 22:21
wines of argentina
import * as fs from 'fs';
import axios, {AxiosResponse} from "axios";
import * as csv from 'csv-stringify'
import { JSDOM } from 'jsdom'
/************************************************************
* WINE LIST
*/
export type WineryListRequest = {
columns: Column[];
@wheelerlaw
wheelerlaw / Vagrantfile
Last active April 19, 2023 21:52
Golang 1Password CLI error reproduction
# To replicate the issue with running the `op` command directly from a Golang app
Vagrant.configure("2") do |config|
config.vm.box = "generic/fedora37"
config.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.memory = "2048"
vb.cpus = "2"
vb.customize ["modifyvm", :id, "--graphicscontroller", "vmsvga"]
end
config.vm.provision "shell", privileged: false, inline: <<~'EOF'
INFO global: Vagrant version: 2.3.3
INFO global: Ruby version: 2.7.6
INFO global: RubyGems version: 3.1.6
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/bin/vagrant"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_LOG="debug"
WARN global: resolv replacement has not been enabled!
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/plugins/commands/autocomplete/plugin.rb

Keybase proof

I hereby claim:

  • I am wheelerlaw on github.
  • I am wheelerlaw (https://keybase.io/wheelerlaw) on keybase.
  • I have a public key ASDUsg6Oo40-8JyT3JPFH55hgTohmetoJDUJTpV7wYE8Kgo

To claim this, I am signing this object:

#!/usr/bin/env python3
# from dns import resolver, rdatatype
import dns, dns.resolver, dns.message, dns.query, dns.flags
import sys
import itertools
import socket
if len(sys.argv) < 2:
quit()
@wheelerlaw
wheelerlaw / parse-certs
Last active April 28, 2019 06:59
Split a PEM-formatted CA certificate chain into their individual certificates and place them in a temporary folder to use by other applications.
#!/usr/bin/env bash
set -o pipefail
export cert_dir=$(mktemp -d -t certs.XXXXXXXXX)
trap 'rm -rf $cert_dir; trap - ERR EXIT' EXIT
cd $cert_dir
cat | csplit -z -s -f corporate-indv-cert- - '/-----BEGIN CERTIFICATE-----/' '{*}'
import java.util.Scanner;
public class DetectSubsequence{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int[] substring = new int[sc.nextInt()];
int[] data = new int[sc.nextInt()];
for(int i=0; i<substring.length; i++){
#!/usr/bin/env bash
#!/usr/bin/env bash
function getCertChain() {
curl -fsSL <url_to_ca_certificate_chain_pem>
}
getCertChain | csplit -f paychex-indv-cert- - '/-----BEGIN CERTIFICATE-----/' '{*}'
alias gs='git status'
alias gpl='git pull'
alias gpsh='git push'
alias gf='git fetch'
alias gc='git commit'
alias gcm='git commit -m'
alias gcam='git commit -am'
alias ga='git add -A'
alias gco='git checkout'
alias gcob='git checkout -b'
!#/usr/bin/env bash
apt-get update
apt-get install nginx
ufw allow 'Nginx Full'
ufw allow 'OpenSSH'
ufw enable
apt-get install reprepro gnupg dpkg-sig