Skip to content

Instantly share code, notes, and snippets.

View ser's full-sized avatar
🎯
Focusing

ᎠᎡ. Ѕϵrgϵ Ѵictor ser

🎯
Focusing
View GitHub Profile
@Paraphraser
Paraphraser / Checking your Raspberry Pi's view of its power supply.md
Created June 13, 2022 06:53
Checking your Raspberry Pi's view of its power supply (sometimes it's not the wall-wart)

Checking your Raspberry Pi's view of its power supply

Sometimes it seems like the first (and sometimes only) advice you get offered for almost any problem with a Raspberry Pi is "check your power supply". You think something like:

"hey, I'm using an official power supply sold as being matched with my Pi so how can there be any problem?"

You look up the specs then stick a controlled load across your supply and confirm that it can deliver the required number of Watts.

Yet your problems persist…

@pojntfx
pojntfx / main.sh
Created May 17, 2021 09:46
Enable Wayland in Flatpak Firefox
sudo flatpak override --socket=wayland org.mozilla.firefox
sudo flatpak override --env MOZ_ENABLE_WAYLAND=1 org.mozilla.firefox
## NOTE! this works for me but has recieved very limited testing!
## Enable auto updates for GITEA:
# shell script to check github repo for "latest" tag and compare to current running gitea version
# assumes systemd is in use to manage gitea service
# assumes gitea binary file lives at: /usr/local/bin/gitea
# assumes Ubuntu 18.04 is in use (but should work on any debian / apt system)
# assumes your local gitea api instance is reachable at: "http://192.168.4.22:3000/api/v1/version"
# assumes your ok with downloading the latest binary from github without any validation
#
@stoivo
stoivo / README
Last active October 25, 2021 20:54
Syncoid icinga setup check_syncoid
This is a script build to be run by nagios/icinga plugin system. It takes check who log ago is that thas synoic snapshot. We build this to be run on our server being backed up, as we are buying backup solution and we want to check that it was been copied out. If we has access to the server backing up our server we could have used sanoid --monitor-snapshots to verify that is has uptodate snapshots.
example
./check_syncoid asdasd -w 60 -c 90 -h spike -z lxd -r
-r traverse over a dataset recursively
-z <s> sets s ZFS dataset to check
-w <n> sets n to minutes before it is warning
-c <n> sets n to minutes before it is critical
-h <s> sets s as the hostname in the syncoid snapshot name
@kabili207
kabili207 / Rclone systemd service.md
Last active May 6, 2024 03:20
Rclone systemd user service

rclone systemd service

Preparation

This service will use the same remote name you specified when using rclone config create. If you haven't done that yet, do so now.

Next, create the mountpoint for your remote. The service uses the location ~/mnt/<remote> by default.

mkdir ~/mnt/dropbox
@drmalex07
drmalex07 / README-fail2ban-keycloak.md
Last active March 1, 2024 17:14
Use fail2ban to block brute-force attacks to keycloak server. #keycloak #fail2ban #brute-force-attack

Add regular-expression filter under /etc/fail2ban/filter.d/keycloak.conf:

[INCLUDES]

before = common.conf

[Definition]

_threadName = [a-z][-_0-9a-z]*(\s[a-z][-_0-9a-z]*)*
_userId = (null|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})
@1kastner
1kastner / reflect.py
Last active April 3, 2024 13:52 — forked from huyng/reflect.py
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from http.server import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
#!/usr/bin/env python
import hashlib
import hmac
import time
import requests
import datetime
# Q. Do you have A Websocket API?
# A. Yes, and we strongly recommend you to use it. Please, check our JavaScript websocket implementation for our WebSocket API here:
# https://github.com/blinktrade/frontend/blob/master/jsdev/bitex/api/bitex.js
@phrawzty
phrawzty / 2serv.py
Last active May 2, 2024 12:27
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):