Skip to content

Instantly share code, notes, and snippets.

@janert
janert / hugo-survival-guide.md
Last active May 23, 2025 16:00
A Hugo Survival Guide

A Hugo Survival Guide

Hugo is a static site generator: it takes some plain-text content, marries it to a bunch of HTML templates, and produces a set of complete, static HTML pages that can be served by any generic, stand-alone web server. Simple.

Or maybe not. Hugo does a lot of things automatically, relying on conventions and implicit rules, rather than on explicit configuration. For example, it tries to match each piece of content with the most

@aegis1980
aegis1980 / lora_node.ino
Created October 18, 2021 20:49
Lora node sketch for XC4392 Arduino shield
#include <dht.h>
#include <SPI.h>
#include <RH_RF95.h>
// Singleton instance of the radio driver
RH_RF95 rf95;
float frequency = 915.0; //frequency settings
dht DHT;
#define DHT11_PIN A0
float temperature,humidity,tem,hum;
@aegis1980
aegis1980 / lora_gateway.ino
Created October 18, 2021 20:47
Duinotech XC4392 LoRa gateway
/*
Private LoRa protocol example :
Support Devices: LG01 Single Channel LoRa Gateway
This sketch is running in LG01. LG01 with firmware version v4.3.3 or above
Example sketch shows how to get sensor data from remote LoRa Sensor and Store the data into LG01.
The LG01 has daemon script to check the data periodically and update the data to IoT server.
The LoRa Protocol use here is private LoRa protocol which base on RadioHead Library.
Created 26 March 2018
by Dragino Tech <support@dragino.com>
@safebuffer
safebuffer / install.sh
Created September 7, 2021 10:00
Install FortiClient 7.0 VPN on Kali Linux
curl -p --insecure "http://ftp.br.debian.org/debian/pool/main/liba/libappindicator/libappindicator1_0.4.92-8_amd64.deb" --output libappindicator1_0.4.92-8_amd64.deb
curl -p --insecure "http://ftp.br.debian.org/debian/pool/main/libi/libindicator/libindicator7_0.5.0-4_amd64.deb" --output libindicator7_0.5.0-4_amd64.deb
wget https://filestore.fortinet.com/forticlient/downloads/forticlient_vpn_7.0.0.0018_amd64.deb
sudo dpkg -i libindicator7_0.5.0-4_amd64.deb
sudo apt-get install libdbusmenu-gtk4
sudo apt-get install libgconf-2-4
sudo dpkg -i libappindicator1_0.4.92-8_amd64.deb
sudo dpkg -i forticlient_vpn_7.0.0.0018_amd64.deb
@sinbad
sinbad / backup_gitea.sh
Created August 9, 2020 14:58
My Gitea Backup & Restore Scripts
#!/bin/bash
# `gitea dump` doesn't currently back up LFS data as well, only git repos
# It primarily backs up the SQL DB, and also the config / logs
# We'll backup like this:
# * "gitea dump" to backup the DB and config etc
# * tar / bzip all the repos since they will be skipped
# * Not rotated because git data is immutable (normally) so has all data
# * rsync LFS data directly from /volume/docker/gitea/git/lfs
# * No need for rotation since all files are immutable

Install Ceilometer + Gnocchi with backend Ceph

In Controller node

  • Create database
mysql -uroot -pWelcome123

CREATE DATABASE gnocchi;
GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'localhost' IDENTIFIED BY 'Welcome123' WITH GRANT OPTION ;
@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active May 1, 2025 14:42
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@mdonkers
mdonkers / server.py
Last active June 12, 2025 05:21
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@claudiok
claudiok / OpenStack_consumer_GPU_passthrough.md
Last active March 26, 2023 08:20
Consumer-grade GPU passthrough in an OpenStack system (NVIDIA GPUs)

Consumer-grade GPUs in an OpenStack system (NVIDIA GPUs)

Assumptions

This assumes you have GTX980 cards in your system (PCI id 10de:13c0 & 10de:0fbb per card). Just add more IDs for other cards in order to make this more generic. This also assumes nova uses qemu-kvm as the virtualization hypervisor (qemu-system-x86_64). This seems to be the default on OpenStack Newton when installed using openstack-ansible.

We assume OpenStack Newton is pre-installed and that we are working on a Nova compute node. This has been tested on an Ubuntu 16.04 system where I installed OpenStack AIO version 14.0.0 (different from the git tag used in the instructions!): http://docs.openstack.org/developer/openstack-ansible/developer-docs/quickstart-aio.html

Prepare the system for GPU passthrough (set up IOMMU/vfio/...)

Note: This is heavily based on information from https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Enabling_IOMMU adapted for Ubuntu 16.04

@tamurray
tamurray / tmurray_16VM_unix_Only_no_heat_scalTest-01.py
Created July 26, 2016 16:54
simple test script to spin up 16 vms in Openstack using python API clients
#!/usr/bin/python
import os
import sys
import time
from pprint import pprint
from concurrent import futures
from keystoneclient.v2_0 import client as ks_client
from novaclient import client as nova_client
from neutronclient.neutron import client as neutron_client