Skip to content

Instantly share code, notes, and snippets.

View stokito's full-sized avatar
Self-hosting become easier 🤗

Sergey Ponomarev stokito

Self-hosting become easier 🤗
View GitHub Profile
@phansson
phansson / !README.md
Created February 26, 2017 20:21
SafeHtml utility class for making strings safe to use in HTML

SafeHtml

This small Java class is a utility class for escaping strings so that they are safe to use in HTML. There's a single static method, htmlEscape(), which does the job.

I've found that all existing solutions (libraries) I've reviewed suffered from one or several of the below issues:

  • They escape too much ... which makes the HTML much harder to read and takes longer time.
  • They don't tell you in the Javadoc exactly what they replace.
  • They do not document when the returned value is safe to use (safe to use for an HTML entity?, for an HTML attributute?, etc)

Исходные данные: роутер имеет адрес 192.168.1.1, tor и i2pd подняты на 192.168.1.10 (если роутер достаточно мощный, можно поднять их прямо на нём, соответственно скорректировав адреса)

В LEDE для загрузки списка заблокированных доменов проще всего использовать поставляемую по умолчанию утилиту uclient-fetch. Необходимо лишь добавить ей поддержку SSL:

opkg update
opkg install libustream-mbedtls

Впрочем, вы можете использовать wget или curl, если предпочитаете. Особенности wget см. ниже.

@Manouchehri
Manouchehri / rfc3161.txt
Last active May 7, 2025 17:06
List of free rfc3161 servers.
https://rfc3161.ai.moda
https://rfc3161.ai.moda/adobe
https://rfc3161.ai.moda/microsoft
https://rfc3161.ai.moda/apple
https://rfc3161.ai.moda/any
http://rfc3161.ai.moda
http://timestamp.digicert.com
http://timestamp.globalsign.com/tsa/r6advanced1
http://rfc3161timestamp.globalsign.com/advanced
http://timestamp.sectigo.com
@hongkongkiwi
hongkongkiwi / generate-dropbear-key
Last active September 28, 2024 17:58
Generate SSH Key in Dropbear with some options (by default it uses default id_dropbear as the name and ed25519 as the type)
#!/bin/sh +ux
# We set the sh +ux flags so that we error on undefined variables and error on bad commands
help() {
echo >&2 "$0 [-f] [-p] [-q] [<priv_key_file>] [<key_type>] [<key_comment>]"
echo >&2
echo >&2 "-q / --quiet to silent all output (except -p if passed)"
echo >&2 "-p / --pubkey to output public key after generation"
echo >&2 "-f / --force to force replacing existing key"
echo >&2
@makeev
makeev / create_pkcs7_sign.py
Created March 28, 2016 13:25
Creating a PKCS #7 detached signature of the manifest file for safari push package in python
import M2Crypto
def main():
manifest_path = 'path/to/manifest.json'
signature_path = 'path/to/signature'
# to convert .cer to .pem
# openssl x509 -inform der -in certificate.cer -out certificate.pem
# to combine certificate and key
# cat PushChatCert.pem PushChatKey.pem > ck.pem
@ukautz
ukautz / cert_load.go
Created March 2, 2016 18:55
Go: Load all .pem files containing private key and certificate(s) from directory
package common
import (
"crypto"
"crypto/ecdsa"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"encoding/pem"
"fmt"
@zhehaowang
zhehaowang / Creating and Configuring OpenWRT virtualbox
Last active August 11, 2022 18:59
Creating and Configuring OpenWRT virtualbox
Creating and Configuring OpenWRT virtualbox
http://hoverbear.org/2014/11/23/openwrt-in-virtualbox/
Given the setup, accessing local openwrt via ssh
ssh root@localhost -p 2222
scp -P 2222 somefile root@localhost:
@jamielaundon
jamielaundon / create-pfx
Created January 22, 2016 22:02
Create IIS .pfx from Let's Encrypt fullchain and privkey
sudo openssl pkcs12 -export -in /etc/letsencrypt/live/domain.com/fullchain.pem -inkey /etc/letsencrypt/live/domain.com/privkey.pem -out domain.com.pfx
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active April 28, 2025 16:43
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@egel
egel / get-gravatar-image.sh
Last active February 12, 2021 22:46 — forked from kristopherjohnson/gravatar.sh
Download Gravatar image for an email address
SIZE=500
EMAIL="[email protected]"
curl "http://www.gravatar.com/avatar/$(echo -n ${EMAIL} | md5sum | awk '{print $1}')?s=${SIZE}" > gravatar.png