Skip to content

Instantly share code, notes, and snippets.

View kpcyrd's full-sized avatar

kpcyrd

View GitHub Profile
@kpcyrd
kpcyrd / ct-sub-domains-0.1.0.patch
Created March 14, 2019 19:04
rickmer/ct-sub-domains-0.1.0.patch
--- a/ct-sub-domains.lua
+++ b/ct-sub-domains.lua
@@ -6,10 +6,17 @@
function run(domain)
session = http_mksession()
- request = http_request(session, 'GET', 'https://api.certspotter.com/v1/issuances?include_subdomains=true&expand=dns_names&expand=issuer&expand=cert&domain=' .. domain['value'], {
+ request = http_request(session, 'GET', 'https://api.certspotter.com/v1/issuances', {
+ query={
+ include_subdomains='true',
@kpcyrd
kpcyrd / gist:b1abfbc5fe92c3bbce029118ad10a611
Created February 6, 2020 01:31
work in progress gps distance calculation
// Cargo.toml: geo = "0.12.2"
use geo::*;
use geo::prelude::*;
fn main() {
let polygon = Polygon::new(LineString::from(vec![
Point::new(9.764785766601562, 53.63975308945899),
Point::new(9.827270507812, 53.59494998253459),
Point::new(9.9151611328125, 53.663153974456456),
@kpcyrd
kpcyrd / repro.sh
Last active June 26, 2021 20:04
Test repro alpine raspi images
#!/bin/sh
set -ex
## this needs to be run once for ./mkimage.sh to work
# doas cp -v /usr/share/apk/keys/armhf/* /etc/apk/keys/
mkdir -p ~/out
rm -vf ~/out/*/* ~/out/diff.html
for x in 1 2; do
#!/usr/bin/env php
<?php
require __DIR__ . '/vendor/autoload.php';
use Aws\S3\S3Client;
$s3 = new S3Client([
'version' => 'latest',
'endpoint' => 'https://s3.eu-central-1.amazonaws.com',
// RUSTFLAGS="-C panic=abort" cargo build --release --target x86_64-unknown-none && ./target/x86_64-unknown-none/debug/hello-world; echo $?
#![no_std]
#![no_main]
use core::arch::asm;
use core::slice;
pub const STDOUT_FILENO: u32 = 1;
@kpcyrd
kpcyrd / main.rs
Last active October 21, 2023 12:18
3-2-1 code review html scraping
// updated code for https://github.com/unbeschwert/3-2-1
use std::{fs, io::Write};
use anyhow::{Result, Context};
use dirs::home_dir;
use scraper::{Element, Html, Selector};
static URL: &str = "https://jamesclear.com/3-2-1";
const QUESTION_HEADLINE: &str = "1 QUESTION FOR YOU";