Skip to content

Instantly share code, notes, and snippets.

View nbari's full-sized avatar
🪴

nbari

🪴
View GitHub Profile
@ivormetcalf
ivormetcalf / upload_stream.rs
Last active April 25, 2024 20:28
Rust Module to upload a stream to Amazon S3.
use rusoto_core::ByteStream;
use rusoto_s3::{S3Client, S3};
use futures::{future, stream, Stream, StreamExt, TryStreamExt};
pub async fn upload_stream(
client: S3Client,
bucket: String,
key: String,
data_stream: impl Stream<Item = String>,
@PiDroid-B
PiDroid-B / actions_blacklist-update.conf
Last active May 2, 2024 23:54
OPNsense Custom script and Cron (example : an Alias Table URL with high frequency refresh)
[reload]
command:/usr/local/bin/flock -n -E 0 -o /tmp/filter_update_tables_blk.lock /usr/home/blacklist-update.sh
parameter:
type:script_output
message:IP Blacklist Update
description:Centralized Blacklist IP Update from my own service
@huehnerhose
huehnerhose / patroni
Last active January 3, 2024 16:51
patroni FreeBSD rc.d script
#!/bin/sh
# PROVIDE: PATRONI
# REQUIRE: ETCD
# BEFORE: LOGIN
# KEYWORD: shutdown
# https://www.dbi-services.com/blog/patroni-on-freebsd-13/
. /etc/rc.subr
@dlangille
dlangille / nginx.conf
Created November 11, 2019 14:56
Poudriere configuration
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
# Allow gzipping js, css, log, svg and json files.
@tuxfight3r
tuxfight3r / 01.trust_policy.MD
Last active March 11, 2021 20:11
Importing a VM into AWS EC2 from S3 Bucket

NOTE: Assuming .vhd image is already uploaded to s3 bucket, the following is the process to import the image when the vmimport role is missing

#create a role policy json file

{
   "Version":"2012-10-17",
   "Statement":[
      {
         "Sid":"",
 "Effect":"Allow",
@johnbianchi
johnbianchi / pfctl-cheatsheet.txt
Last active October 9, 2024 12:52
pfctl cheat sheet
#### General PFCTL Commands ####
$ pfctl -d disable # packet-filtering
$ pfctl -e enable # packet-filtering
$ pfctl -q # run quiet
$ pfctl -v -v # run even more verbose
#### Loading PF Rules ####
$ pfctl -f /etc/pf.conf # load /etc/pf.conf
$ pfctl -n -f /etc/pf.conf # parse /etc/pf.conf, but dont load it
$ pfctl -R -f /etc/pf.conf # load only the FILTER rules
$ pfctl -N -f /etc/pf.conf # load only the NAT rules
@Mygod
Mygod / export-ble-infos.py
Last active November 14, 2024 14:54
Export your Windows Bluetooth LE keys into Linux!
#!/usr/bin/python3
"""
Copyright 2021 Mygod
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@0xjac
0xjac / private_fork.md
Last active November 15, 2024 13:06
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@tsaarni
tsaarni / openssl-notes.txt
Created October 22, 2016 08:50
Generate self-signed certs with different key types
*** RSA
# Generate self-signed certificate with RSA 4096 key-pair
openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout rsakey.pem -out rsacert.pem
# print private and public key
openssl rsa -in rsakey.pem -text -noout
# print certificate
openssl x509 -in rsacert.pem -text -noout
@jozic
jozic / gist:4f781632d52e868e986217866024d82e
Last active August 18, 2023 08:45
netcat: listen to a request and return 200 HTTP response
## test is the program that returns response body
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; sh test; } | nc -l 8909; done
## test sample
#!/bin/bash
echo "************PRINT SOME TEXT***************\n"
echo "Hello World!!!"
echo "\n"