Skip to content

Instantly share code, notes, and snippets.

@valesi
valesi / le-auth.conf
Last active November 23, 2018 04:59
Let's Encrypt alias webroot location for nginx
# /etc/nginx/snippets/le-auth.conf
location /.well-known/acme-challenge {
# Create a ".well-known" dir in /etc/letsencrypt
alias /etc/letsencrypt/.well-known/acme-challenge;
location ~ /.well-known/acme-challenge/(.*) {
add_header Content-Type application/jose+json;
}
}
@valesi
valesi / 80lol.txt
Last active December 9, 2016 03:30
hagfy
.+MMMMMMMM.=MO7OM=OMMM$MMMMIMMMM,M$ZMMMMM:8MMMMMM7 =MO7OM=.MMMMMMMMMMMMMMMM,
M. M. .=N. . . .M M. .M. =:..M. MM ... MM . .. M .M 8 =
.M. M =M .M. M .M M. M.:ON . .MM M NM. M M. .M MM= MM
.M. M. =M M. M M .M. MMD+ .M .MM .M MM M M. .M N:~ I..
.M. =M M. MO .7. O MZ:D M .+M 7MM M M. .M N~= I
.M. M. =M M. MM . .~ = MN M .M . M .M. .M M M. .M N~= I
.M. M =M M. MM M M.~M ... M .M. .M M M: .M .8~= I
.M. M =M .O MM M. .I:.,8 M. M .. .M. O .MD , +~= I
8 M .~:M . ..M.? MD. M..~ D. O ~M.M ..M =N....I8.,~ . =
. . . .O.,.,,: .. . :MM?,.......................NMM . ..,,. .. .
@valesi
valesi / bitcoind.service
Created March 22, 2017 19:47
bitcoind systemd
[Unit]
Description=Bitcoin daemon
After=network.target
[Service]
User=bitcoin
Group=bitcoin
Type=forking
PIDFile=/srv/bitcoind/bitcoind.pid
@valesi
valesi / Web.xml
Last active February 21, 2023 17:28
Plex Web Client FLAC Direct Play Support
<?xml version="1.0" encoding="utf-8"?>
<Client name="Web">
<!-- Author: Plex Inc. -->
<TranscodeTargets>
<VideoProfile protocol="hls" container="mpegts" codec="h264" audioCodec="aac,mp3" context="streaming" />
<VideoProfile protocol="dash" container="mp4" codec="h264" audioCodec="aac" context="streaming" />
<VideoProfile protocol="http" container="mkv" codec="h264" audioCodec="aac,mp3" context="streaming" />
<MusicProfile container="mp3" codec="mp3" />
<PhotoProfile container="jpeg" />
<SubtitleProfile container="ass" codec="ass" context="all" />
@valesi
valesi / znc_buffextras.lua
Last active May 4, 2018 23:40
ZNC 1.7.0 buffextras for HexChat in lua
hexchat.register('ZNC Buffextras', '1.2.1', "Format messages from ZNC's buffextras module")
-- TODO: parse out raw modes to proper hexchat event (maybe...)
hexchat.hook_server_attrs('PRIVMSG', function (word, word_eol, attrs)
if not word[1]:match('^:%*buffextras!') then
return
end
local channel = word[3]
@valesi
valesi / no-timeslices.patch
Created April 21, 2019 07:28
E-X no time slices
diff --git a/electrumx/server/session.py b/electrumx/server/session.py
index 45a1839..e335946 100644
--- a/electrumx/server/session.py
+++ b/electrumx/server/session.py
@@ -770,10 +770,14 @@ class SessionManager(object):
def add_session(self, session):
self.session_event.set()
# Return the session groups
- groups = (
- self._session_group(self._timeslice_name(session), 0.03),
@valesi
valesi / tor-and-window.patch
Created April 21, 2019 08:40
E-X separate Tor + time slice window env -- is_tor(): return False in aiorpcX SessionBase
diff --git a/electrumx/server/session.py b/electrumx/server/session.py
index 45a1839..9c0e50f 100644
--- a/electrumx/server/session.py
+++ b/electrumx/server/session.py
@@ -758,7 +758,7 @@ class SessionManager(object):
return '.'.join(ip_addr.split('.')[:3])
def _timeslice_name(self, session):
- return f't{int(session.start_time - self.start_time) // 300}'
+ return f't{int(session.start_time - self.start_time) // self.env.timeslice_window}{"_tor" if session.is_tor() else ""}'
@valesi
valesi / ntpd.conf
Last active May 5, 2019 22:18
pfSense split PPS/GPS
#
# pfSense ntp configuration file
#
tinker panic 0
# Orphan mode stratum
tos orphan 12
# PPS Setup
server 127.127.22.0 minpoll 4 maxpoll 4 prefer