Skip to content

Instantly share code, notes, and snippets.

@YouROK
YouROK / 1 Установка
Last active March 11, 2024 10:09
Install Antizapret to vps
Установка проверялась на Ubuntu 20.04, на других версиях может не работать
Для установки на впс зайдите на совой впс по ssh из под рута, скопируйте строку ниже и вставьте в терминал
rm install-az.sh; wget https://gist.githubusercontent.com/YouROK/21617b476ea914cc5b76d72903d6702f/raw/install-az.sh && chmod +x ./install-az.sh && ./install-az.sh
После установки, если нет подключения, то нужно добавить эти строчки перед ключами
pull-filter ignore block-outside-dns
route 8.8.8.8 255.255.255.255 vpn_gateway
route 77.88.8.8 255.255.255.255 vpn_gateway
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Single File Web Component</title>
<style>
body {
background-color: #eee;
font-family: Helvetica, sans-serif;
}
@kristoferjoseph
kristoferjoseph / single-file-web-component.html
Last active November 22, 2023 01:17
Single file Web Component
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Single File Web Component</title>
</head>
<body>
<template id=single-file>
<style>
h1 {
@dz4k
dz4k / discord_bot._hs
Last active August 24, 2021 10:35
Discord bot in _hyperscript
require discord.js as Discord
init immediately
make a Discord.Client from {
intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES]
}
set module discord to it
login(process.env.TOKEN) to discord
end
@p4bl0-
p4bl0- / 00_readme.md
Last active October 12, 2023 09:09
A complete compiler for a simple language (in less than 150 LoC)

This project is a tiny compiler for a very simple language consisting of boolean expression.

The language has two constants: 1 for true and 0 for false, and 4 logic gates: ! (not), & (and), | (or), and ^ (xor).

It can also use parentheses to manage priorities.

Here is its grammar in BNF format:

expr ::= "0" | "1"

@justinph
justinph / .htaccess
Last active February 3, 2021 18:25
Make wordpress shared password protected
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# send all users w/o this cookie to wall.php
RewriteCond %{REQUEST_FILENAME} !(wall\.php|.*\.jpe?g|.*\.m4v|.*\.png|.*\.gif)
RewriteCond %{HTTP_COOKIE} !^.*yourfancycookiename.*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^(.*Jetpack.*)$
RewriteRule .* /wall.php [NC,L,R=302]
@lega911
lega911 / bindings.md
Last active September 25, 2020 19:00
Svelte, Malina.js
Svelte Malina.js Shortcut / Comment
Reference to element
bind:this={ref} #ref
1-way binding
prop={prop} prop={prop}
{prop} {prop}
2-way binding
bind:value={value} bind:value={value} :value={value} / :value:value
bind:value bind:value :value
@nileshtrivedi
nileshtrivedi / home-server.md
Last active January 10, 2024 06:30
Home Server setup: Raspberry PI on Internet via reverse SSH tunnel

Raspberry Pi on Internet via reverse SSH tunnel

HackerNews discussed this with many alternative solutions: https://news.ycombinator.com/item?id=24893615

I already have my own domain name: mydomain.com. I wanted to be able to run some webapps on my Raspberry Pi 4B running perpetually at home in headless mode (just needs 5W power and wireless internet). I wanted to be able to access these apps from public Internet. Dynamic DNS wasn't an option because my ISP blocks all incoming traffic. ngrok would work but the free plan is too restrictive.

I bought a cheap 2GB RAM, 20GB disk VM + a 25GB volume on Hetzner for about 4 EUR/month. Hetzner gave me a static IP for it. I haven't purchased a floating IP yet.