Skip to content

Instantly share code, notes, and snippets.

@anuj-apdev
anuj-apdev / openssl-cheat-sheet.md
Last active December 21, 2023 18:42
openssl-cheat-sheet.md

Certificate Authority

# Generate an RSA key(private) only
openssl genrsa -out ca.key 2048

# Request a new X509 format certificate for the given key
openssl req -new -x509 -days 365 -key ca.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=Acme Root CA" -out ca.crt
STDERR.puts "HELP, I AM TRAPPED IN A CRYSTAL MAZE!"
Design a service which receives as input a list of URLs, scrapes those URLs for links to other pages and references images, then returns a mapping of page URLs to a list of image URLs.
Your service does not need to download and store the images.
Your service should follow links to other pages from the original submitted pages, and return the images on
those 2/3/nth level pages as if they were on the first level page.
The API contract is defined as:
POSTing to /jobs with a body of a JSON array of URLs to start scrapin0
@lizrice
lizrice / hello_map.py
Last active July 19, 2023 08:20
eBPF hello world
#!/usr/bin/python
from bcc import BPF
from time import sleep
# This outputs a count of how many times the clone and execve syscalls have been made
# showing the use of an eBPF map (called syscall).
program = """
BPF_HASH(syscall);
@ncdc
ncdc / cluster.yaml
Created May 9, 2019 19:35
Cluster API 9 May 2019 webinar example yaml files
apiVersion: "cluster.k8s.io/v1alpha1"
kind: Cluster
metadata:
name: demo1
spec:
clusterNetwork:
services:
cidrBlocks: ["10.96.0.0/12"]
pods:
cidrBlocks: ["192.168.0.0/16"]

Setup

curl -sSL -o clone.c goo.gl/G45N5X

Net Namespace

# on host
@julz
julz / main.go
Created November 20, 2015 12:39
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@ctoestreich
ctoestreich / gist:1337648
Created November 3, 2011 20:08
Testing storage of millions of keys in Redis using Custom Number Encoder
@Grapes([
@Grab('redis.clients:jedis:1.5.1'),
@GrabConfig(systemClassLoader=true)
])
import redis.clients.jedis.*
performTest("unencoded", null) {n, e->
n.toString()
}
@mikeyk
mikeyk / gist:1329319
Created October 31, 2011 22:56
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])