Skip to content

Instantly share code, notes, and snippets.

View bossjones's full-sized avatar
💭
Learning every damn thing I can

Malcolm Jones (bossjones/Tony Dark) bossjones

💭
Learning every damn thing I can
View GitHub Profile
@Erisa
Erisa / node_exporter.sh
Last active December 13, 2023 23:50 — forked from galexrt/node_exporter.sh
Simple Prometheus node_exporter install script (Updated for 1.0.1)
#!/bin/bash
set +x
version="${VERSION:-1.6.1}"
arch="${ARCH:-linux-amd64}"
bin_dir="${BIN_DIR:-/usr/local/bin}"
wget "https://github.com/prometheus/node_exporter/releases/download/v$version/node_exporter-$version.$arch.tar.gz" \
-O /tmp/node_exporter.tar.gz
@joemiller
joemiller / Dockerfile
Last active February 11, 2024 11:45
convert RFC 3164 syslog messages to RFC 5424 for ingestion into Loki/promtail
FROM balabit/syslog-ng:3.35.1
COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
@BoredHackerBlog
BoredHackerBlog / docker-compose.yaml
Last active March 28, 2024 17:20
grafana loki docker-compose file and vector settings
version: "3"
networks:
loki:
services:
loki:
image: grafana/loki:2.4.0
volumes:
- ./loki:/etc/loki
@p1nox
p1nox / pytorch_rtx_3060.md
Last active December 17, 2023 02:27
PyTorch on RTX 3060

After researching a lot on how to use PyTorch with a RTX 3060 card, specially with older versions or torch (0.4.0) and torchvision (0.2.1), I noticed that it was either impossible or very hard to do. RTX 3060 and these packages apparently doesn't have compatibility with the same versions of CUDA and cuDNN. I tried to do this by using different combinations with compiled versions available in conda, but didn't work, maybe it could work if you recompile from source these versions.

After all this, actually I was able to use RTX 3060 effectively with latest versions of all these dependencies with two methods:

  1. Using a conda env, and latest versions published in pytorch site (https://pytorch.org/get-started/locally):
conda create -n rtx_3060 python=3.6.5
conda activate rtx_3060
conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia
@christophersjchow
christophersjchow / pipeline.conf
Last active May 22, 2024 19:51
Logstash pipeline and grok patterns for Unifi Dream Machine (UDM) 1.8.6
input {
udp {
port => 10514
type => unifi_syslog
}
}
filter {
if [type] == "unifi_syslog" {
grok {
@superseb
superseb / k3s-etcd-commands.md
Last active June 5, 2024 20:52
k3s etcd commands

k3s etcd commands

etcd

Setup etcdctl using the instructions at https://github.com/etcd-io/etcd/releases/tag/v3.4.13 (changed path to /usr/local/bin):

Note: if you want to match th etcdctl binaries with the embedded k3s etcd version, please run the curl command for getting the version first and adjust ETCD_VER below accordingly:

curl -L --cacert /var/lib/rancher/k3s/server/tls/etcd/server-ca.crt --cert /var/lib/rancher/k3s/server/tls/etcd/server-client.crt --key /var/lib/rancher/k3s/server/tls/etcd/server-client.key https://127.0.0.1:2379/version
@superseb
superseb / intermediate-ecdsa-certificate-rancher.md
Created October 26, 2020 15:59
Generate ECDSA CA, intermediate CA and server certificate with DNS alt names using Terraform in Docker and launch Rancher

Generate ECDSA CA, intermediate CA and server certificate with DNS alt names using Terraform in Docker and launch Rancher

Generate ECDSA CA, intermediate CA and server certificate

docker run --rm -v $PWD/testcerts:/tmp/certs/files -e TF_VAR_ip_addresses='["127.0.0.1"]' -e TF_VAR_dns_names='["yolo.seb.local"]' superseb/intermediate-ecdsa

Run Rancher

@mikestecker
mikestecker / optimising-unifi-performance.md
Last active April 22, 2024 13:32
optimising-unifi-performance

optimising-unifi-performance

NOTE: Content below is written by Adrian Mace. Click here for an updated version.

Below are the key settings that I apply on any unifi installation for optimal performance.

Settings

Settings > Site

  • Ensure Enable Advanced Features is enabled
    This allows you to follow along with the guide in it's entirety.
@iedmrc
iedmrc / async.py
Last active May 15, 2024 14:28 — forked from phizaz/async.py
Python turn sync functions to async (and async to sync)
import functools
import asyncio
from concurrent.futures import ThreadPoolExecutor
def to_async(func):
"""Turns a sync function to async function using event loop"""
@functools.wraps(func)
async def run(*args, loop=None, executor=None, **kwargs):
if loop is None:
@superseb
superseb / minio-nginx-selfsigned.sh
Last active February 23, 2024 06:52
Minio + NGINX in Docker using self signed certificates
#!/bin/bash
if [ "$#" -lt 0 ]; then
echo "Usage: $0"
exit 1
fi
echo "Generating nip.io based on found external IP"
FOUNDIP=$(docker run --rm --net=host appropriate/curl https://api.ipify.org)
APIFQDN="minio-api.${FOUNDIP}.nip.io"
FQDN="minio.${FOUNDIP}.nip.io"