Skip to content

Instantly share code, notes, and snippets.

View ldx's full-sized avatar
🌪️
Wreaking havoc

Vilmos Nebehaj ldx

🌪️
Wreaking havoc
View GitHub Profile
@ldx
ldx / crs.go
Created November 1, 2024 16:28
Transform geojson data different coordinate reference systems in Go using go-geom and go-proj
package main
import (
"encoding/json"
"fmt"
"github.com/twpayne/go-geom"
"github.com/twpayne/go-geom/encoding/geojson"
"github.com/twpayne/go-proj/v10"
)
@ldx
ldx / dns.js
Last active May 17, 2021 18:55
const fs = require('fs');
const dns = require('dns');
const args = process.argv.slice(2)
const hostname = args[0]
fs.readFile('/etc/resolv.conf', (err, data) => {
if (err) {
console.dir(err);
} else {
@ldx
ldx / ssm-agent-daemonset.yaml
Created October 21, 2020 21:28
Install ssm-agent on EKS worker nodes via a Kubernetes daemonset.
# This is based on https://github.com/mumoshu/kube-ssm-agent, but installs ssm-agent directly at start time, instead of using a pre-built image.
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: ssm-agent
namespace: ssm-agent
labels:
k8s-app: ssm-agent
spec:
selector:
---
apiVersion: eksctl.io/v1alpha4
kind: ClusterConfig
metadata:
name: elotltest
region: us-east-1
nodeGroups:
- name: milpa
@ldx
ldx / build-via-milpa.sh
Created April 10, 2019 18:29
Jenkins managed build script to run jobs as Milpa pods
#!/bin/bash -e
# Install jq if missing.
JQ="/tmp/jq"
$JQ --version || {
echo "Can't find jq, trying to install it"
wget -O $JQ https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
chmod 755 $JQ
}
echo "jq version:" $($JQ --version)
@ldx
ldx / create-docker-config.sh
Last active December 12, 2018 00:00
Create docker configuration file with authentication info
#!/bin/bash
set -euo pipefail
if [[ "$DOCKER_USER" = "" ]]; then
echo "Please set \$DOCKER_USER"
exit 1
fi
if [[ "$DOCKER_PASSWORD" = "" ]]; then
echo "Please set \$DOCKER_PASSWORD"
exit 1
##
## Bundle of CA Root Certificates
##
## Certificate data from Mozilla as of: Wed Apr 20 03:12:05 2016
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
## file (certdata.txt). This file can be found in the mozilla source tree:
## http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt
##
char *jsonp_strndup(const char *str, size_t len)
{
char *new_str;
new_str = jsonp_malloc(len + 1);
if(!new_str)
return NULL;
memcpy(new_str, str, len);
new_str[len] = '\0';
Program received signal SIGABRT, Aborted.
0x00007ffff7218458 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
55 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff7218458 in __GI_raise (sig=sig@entry=6)
at ../sysdeps/unix/sysv/linux/raise.c:55
#1 0x00007ffff72198da in __GI_abort () at abort.c:89
#2 0x00007ffff7256fca in __libc_message (do_abort=do_abort@entry=2,
fmt=fmt@entry=0x7ffff734ec98 "*** Error in `%s': %s: 0x%s ***\n")
at ../sysdeps/posix/libc_fatal.c:175
from OpenSSL import SSL
import sys
import os
import socket
def verify_cb(conn, cert, errnum, depth, ok):
print 'Got certificate: %s' % cert.get_subject()
return ok