Skip to content

Instantly share code, notes, and snippets.

View VityaSchel's full-sized avatar
🕶️
svelting

Viktor Shchelochkov VityaSchel

🕶️
svelting
View GitHub Profile
@JohnyDeath
JohnyDeath / Установка Outline VPN на Ubuntu 20.04.md
Created March 4, 2022 19:36 — forked from YPermitin/Установка Outline VPN на Ubuntu 20.04.md
Инструкция по развертыванию собственного VPN-сервиса на базе Outline VPN

Установка Outline VPN на Ubuntu 20.04

Outline VPN - это бесплатный инструмент с открытым исходным кодом, позволяющий развернуть собственную VPN на Вашем собственном сервере или на машине облачного провайдера. Подробную информацию Вы можете узнать здесь и здесь.

В своем составе имеет как графические инструменты, так и средства работы через командную строку. Позволяет использовать VPN как на настольных компьютерах, так и на мобильных устройствах.

Прежде чем начать

Вам нужен сервер. Да, его нужно арендовать, учитывая его местоположение. Например, если Вам нужно получать доступ к ресурсам, которые недоступны в текущем местоположении, но доступны, например, в Канаде, то смело арендуйте виртуальную машину в AWS, Digital Ocean или любом другом месте.

@VityaSchel
VityaSchel / Telegram Bot working on Nginx FastCGI template (NodeJS and JavaScript).js
Last active February 27, 2022 13:11
Telegram Bot working on Nginx FastCGI template (nodejs/javascript)
#!/root/.nvm/versions/node/v16.13.0/bin/node
import fss from 'fs' // DO NOT change to fs/promises because 'The "path" argument must be of type string or an instance of Buffer or URL. Received type number (0)'
import fs from 'fs/promises'
const __dirname = new URL('.', import.meta.url).pathname
console.log('Content-type:text/plain')
console.log('')
async function processBody() {
@Laiteux
Laiteux / ValidateTelegramUsername.cs
Last active May 12, 2024 08:52
C# method to validate a Telegram username using RegEx
using System;
using System.Text.RegularExpressions;
// NOTE: Change min length to 4 (instead of 5) in the RegEx if you want to include/allow NFT/Fragment usernames
bool ValidateTelegramUsername(string username)
=> Regex.IsMatch(username.TrimStart('@'),
@"^(?=.{5,32}$)(?!.*__)(?!^(telegram|admin|support))[a-z][a-z0-9_]*[a-z0-9]$",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
Console.WriteLine(ValidateTelegramUsername("Laiteux1")); // True
@stek29
stek29 / extract_telegram_macos.ipynb
Last active May 15, 2025 08:55
Extract Telegram messages from db_sqlite PostBox – made for Telegram for macOS, but should work with Telegram for iOS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@VityaSchel
VityaSchel / index.js
Last active April 9, 2023 16:09
JS Random range visualizer
/* RANGE VISUALIZER BY VITYASCHEL
This script is useful when you want to check equality of random results.
Run testingRandom with function and limit of checks
More checks = more accurate
Example: testingRandom(() => Math.random().toFixed(1), 10000)
Output:
0.0 *********
0.1 *******************
0.2 *******************
0.3 ******************
@dominikwilkowski
dominikwilkowski / README.md
Last active May 22, 2025 07:51
ANSI codes for cli controled output

ANSI escape sequences

ANSI escape sequences can be printed to a shell to as instructions. The below is a list of codes I have used often in my CLI programs and I find myself looking up over and over again.

A great article about it can be found here.

Content

@phiberoptick
phiberoptick / pritunl-server-custom-ssl_manually
Last active July 18, 2024 18:39
Use custom SSL cert in Pritunl Server Community
Ignore all that craziness below. These can be set from the cli with the "pritunl" command.
The commands below can be used to get/set the values of the cert, key, port and if the :80 -> "app.server_port" redirect is active.
# Get current SSL server cert:
pritunl get app.server_cert
# Get current SSL server key:
pritunl get app.server_key
@meain
meain / loading_messages.js
Last active May 30, 2025 10:41
Funny loading messages
export default [
"Reticulating splines...",
"Generating witty dialog...",
"Swapping time and space...",
"Spinning violently around the y-axis...",
"Tokenizing real life...",
"Bending the spoon...",
"Filtering morale...",
"Don't think of purple hippos...",
"We need a new fuse...",
@dmurawsky
dmurawsky / index.js
Last active April 22, 2025 13:06
How to make a page full height in Next.js
const FullHeightPage = () => (
<div>
Hello World!
<style global jsx>{`
html,
body,
body > div:first-child,
div#__next,
div#__next > div {
height: 100%;

Using Github with Two Factor Auth.

It's a fairly common complaint that after enabling github two factor authentication that command line utilities stop working. The underlying issue is command line utilities send your username and password with each request to github, using two factor authentication disables github from accepting just your username and password, so your command line utilities such as git appear to stop working. Github will still accept a personal access token instead of your password however.

Re-enabling your command line utilities (OSX)