Skip to content

Instantly share code, notes, and snippets.

View sgnn7's full-sized avatar
🤔
ǝʌᴉʇɔǝdsɹǝd ɹnoʎ ǝƃuɐɥƆ

Srdjan Grubor sgnn7

🤔
ǝʌᴉʇɔǝdsɹǝd ɹnoʎ ǝƃuɐɥƆ
View GitHub Profile
@sgnn7
sgnn7 / nginx.conf
Last active September 12, 2023 02:33
NGINX caching
# vim:ff=unix:ts=2:sw=2:ai:expandtab
# Cache location setup - this should be the NAS
proxy_cache_path /var/cache/nginx
levels=1:2
keys_zone=bundle-cache:8M
max_size=100000M
inactive=3M
loader_threshold=330
loader_files=1000;
@sgnn7
sgnn7 / BoringCrypto_Windows_DLL
Last active July 10, 2023 02:42
Build BoringCrypto / BoringSSL DLL on Windows 10
PS ...\boringssl> mkdir build
PS ...\boringssl> cd build
PS ...\boringssl> # Create build_boringssl.ps1
PS ...\boringssl\build> powershell -executionpolicy bypass -File .\build_boringssl.ps1
...
DLL is at ...\boringssl\build\outx64\ssl\ssl.dll
@sgnn7
sgnn7 / ClassLauncher.java
Created December 16, 2011 17:57
Android - opening activity from class name
package org.sgnn7.util;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
public class ClassLauncher {
private final Context context;
public ClassLauncher(Context context) {
@sgnn7
sgnn7 / Dockerfile
Last active November 19, 2021 20:47
Datadog Agent integrations live Python interpreter profiling
FROM python:3.8-slim-bullseye
RUN apt update && \
DEBIAN_FRONTEND="noninteractive" apt install -y procps && \
apt clean
RUN pip3 install py-spy==0.3.11
RUN mkdir -p /output
@sgnn7
sgnn7 / .dockerignore
Created October 18, 2021 16:24
OpenSSL FIPS Canister - Ubuntu 20.04
*.sw[po]
@sgnn7
sgnn7 / go_deps.go
Last active September 3, 2021 07:37
Golang deps enumeration
package main
import (
"bufio"
"bytes"
"context"
"fmt"
"io"
"os"
"os/exec"
@sgnn7
sgnn7 / testcheck.py
Created June 8, 2021 21:56
Datadog Agent check that exercises the multiprocessing library
import logging
import os
import sys
import time
import multiprocessing as mp
from multiprocessing import Process, Queue
try:
from datadog_checks.base import AgentCheck
@sgnn7
sgnn7 / aws_ec2_wait.sh
Last active December 17, 2020 15:17
Wait for AWS EC2 snapshot or volume for longer than 20 mins
#!/bin/bash -e
EC2_REGION="us-west-1"
DEFAULT_PROGRESS_WAIT=5
# ========== SNAPSHOT WAIT ==============
snapshot_id="snap-testtesttest"
while [ "$snapshot_progress" != "100%" ]; do
sleep "$DEFAULT_PROGRESS_WAIT"
package log
import (
"bytes"
"fmt"
"reflect"
"regexp"
"strings"
"testing"
@sgnn7
sgnn7 / golang_loop.go
Last active October 7, 2020 15:56
Simple async golang loop
package main
import (
"log"
"math"
"os"
"strconv"
"time"
)