Skip to content

Instantly share code, notes, and snippets.

View VityaSchel's full-sized avatar
:electron:
reacting

Viktor Shchelochkov VityaSchel

:electron:
reacting
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
@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
Created September 5, 2020 02:57
ANSI codes for cli controled output

ANSI escape codes

ANSI escape codes 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 April 20, 2024 21:51
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
@dmurawsky
dmurawsky / index.js
Last active May 22, 2024 19:01
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)

@rxaviers
rxaviers / gist:7360908
Last active June 26, 2024 12:22
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: