Skip to content

Instantly share code, notes, and snippets.

@werty1st
werty1st / README.md
Created July 13, 2024 15:29 — forked from avoidik/README.md
Migrate Raspberry Pi from SD to USB

Raspberry Pi from SD to USB

How to switch over from SD-card to USB-attached device (USB thumbstick, USB enclosed SSD or HDD, etc.) to have more durable storage option.

Steps

  1. Connect USB device to your RPI

  2. Make sure USB device visible by the system

@werty1st
werty1st / README.md
Created October 16, 2023 11:56 — forked from triangletodd/README.md
k3s in LXC on Proxmox

On the host

Ensure these modules are loaded

cat /proc/sys/net/bridge/bridge-nf-call-iptables

Disable swap

sysctl vm.swappiness=0
swapoff -a
@werty1st
werty1st / app.js
Created January 23, 2019 13:32 — forked from goloroden/app.js
Async constructors for JavaScript
// In JavaScript, constructors can only be synchronous right now. This makes sense
// from the point of view that a constructor is a function that returns a newly
// initialized object.
//
// On the other hand, it would sometimes be very handy, if one could have async
// constructors, e.g. when a class represents a database connection, and it is
// desired to establish the connection when you create a new instance.
//
// I know that there have been discussions on this on StackOverflow & co., but
// the so-far mentioned counter arguments (such as: doesn't work as expected
@werty1st
werty1st / caddy-upstart-install.sh
Created November 20, 2018 17:50 — forked from HairAndBeardGuy/caddy-upstart-install.sh
Install Caddy Server on Ubuntu 14.04 with Upstart
apt install curl
curl https://getcaddy.com | bash -s cors,expires,filemanager,git,hugo,ipfilter,jsonp,jwt,locale,mailout,minify,multipass,prometheus,ratelimit,realip,search,upload
chown root:root /usr/local/bin/caddy
chmod 755 /usr/local/bin/caddy
setcap 'cap_net_bind_service=+ep' /usr/local/bin/caddy
mkdir /etc/caddy
chown -R root:www-data /etc/caddy
mkdir /etc/ssl/caddy
chown -R www-data:root /etc/ssl/caddy
chmod 0770 /etc/ssl/caddy
@werty1st
werty1st / run.php
Created June 18, 2018 15:55 — forked from dktapps/run.php
A basic UDP proxy used to bypass client-side Xbox Live authentication in MCPE 1.2.
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
@werty1st
werty1st / Origin to Upstream
Created April 9, 2018 08:56 — forked from javigomez/Origin to Upstream
Git command to rename the origin to upstream when you just forked a project
git remote rename origin upstream
git add remote origin git@github.com:user/fork.git
@werty1st
werty1st / bash.generate.random.alphanumeric.string.sh
Last active January 12, 2018 09:14 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@werty1st
werty1st / icinga2_check_wmi_plus.conf
Created April 17, 2016 22:31 — forked from dayreiner/icinga2_check_wmi_plus.conf
An example check_wmi_plus configuration for Icinga2. Check_wmi_plus (http://www.edcint.co.nz/checkwmiplus/) is a clientless plugin for monitoring Windows systems via WMI with Nagios and other monitoring platforms.
object CheckCommand "check_wmi" {
import "plugin-check-command"
command = [ PluginDir + "/check_wmi_plus.pl" ]
arguments = {
"--inidir" = "$wmi_inidir$"
"-H" = "$host.name$"
"-A" = "$wmi_authfile_path$"
"-m" = "$check_mode$"
"-s" = "$wmi_submode$"
@werty1st
werty1st / couchdb.conf
Created March 1, 2016 21:02 — forked from fredrick/couchdb.conf
Upstart script for CouchDB
# Upstart file at /etc/init/couchdb.conf
# CouchDB
start on runlevel [2345]
stop on runlevel [06]
pre-start script
chown -R couchdb /usr/local/etc/couchdb
chown -R couchdb /usr/local/lib/couchdb
chown -R couchdb /usr/local/var/log/couchdb
@werty1st
werty1st / gist:2647f12f355d5e5f8b98
Last active November 19, 2015 10:38 — forked from jamesmr89/gist:77851acecda208ecc780
pfSense 1to1 NAT OpenVPN setup
Goal of this document is to describe how to setup a vpn tunnel with two pfSense boxes
having the same LAN subnet, for the purpose of this doc we'll use 192.168.1.1/24 on
both firewalls LAN interfaces
We have to make some dummy networks here to NAT to so as far as Site A will be concerned,
site B will be 192.168.2.0/24, and as far as Site B is concerened site A will be 192.168.3.0/24
SiteA (LAN 192.168.1.1)
OpenVPN Server:
Standard Setup and we'll use 10.0.1.0/24 as the Tunnel Network (I can elaborate here later)