Skip to content

Instantly share code, notes, and snippets.

@royriojas
royriojas / telegram-mtproxy.md
Created March 23, 2024 22:27 — forked from rameerez/telegram-mtproxy.md
Up-to-date tutorial on how to set a Telegram MTProxy on an Ubuntu 22.04 sever using AWS Lightsail

How to set up a Telegram Proxy

This uses the native built-in proxy feature in the Telegram app.

The problem is the README in the official TelegramMessenger/MTProxy repo is outdated and fails at multiple points if you try following the steps described. Here's an updated version as of March 2024.

Instructions

  1. Launch a clean Ubuntu 22.04 instance. I'm using AWS Lightsail. ssh into the machine:
@royriojas
royriojas / _easing.scss
Created February 17, 2024 23:12 — forked from terkel/_easing.scss
Timing functions for CSS animations and transitions
// _easing.scss, CSS easing functions - gist.github.com/terkel/4377409
// Based on Caesar - matthewlein.com/ceaser
$linear: cubic-bezier( 0.250, 0.250, 0.750, 0.750 );
$ease: cubic-bezier( 0.250, 0.100, 0.250, 1.000 );
$ease-in: cubic-bezier( 0.420, 0.000, 1.000, 1.000 );
$ease-out: cubic-bezier( 0.000, 0.000, 0.580, 1.000 );
$ease-in-out: cubic-bezier( 0.420, 0.000, 0.580, 1.000 );
$ease-in-quad: cubic-bezier( 0.550, 0.085, 0.680, 0.530 );
@royriojas
royriojas / gsap-eases.css
Created January 10, 2024 03:44 — forked from jh3y/gsap-eases.css
GreenSock eases with CSS linear()
:root {
--none: linear(0, 1);
--power1-in: linear( 0, 0.0039, 0.0156, 0.0352, 0.0625, 0.0977, 0.1407, 0.1914, 0.2499, 0.3164, 0.3906 62.5%, 0.5625, 0.7656, 1 );
--power1-out: linear( 0, 0.2342, 0.4374, 0.6093 37.49%, 0.6835, 0.7499, 0.8086, 0.8593, 0.9023, 0.9375, 0.9648, 0.9844, 0.9961, 1 );
--power1-in-out: linear( 0, 0.0027, 0.0106 7.29%, 0.0425, 0.0957, 0.1701 29.16%, 0.2477, 0.3401 41.23%, 0.5982 55.18%, 0.7044 61.56%, 0.7987, 0.875 75%, 0.9297, 0.9687, 0.9922, 1 );
--power2-in: linear( 0, 0.0014 11.11%, 0.0071 19.24%, 0.0188 26.6%, 0.037 33.33%, 0.0634 39.87%, 0.0978 46.07%, 0.1407 52.02%, 0.1925 57.74%, 0.2559 63.49%, 0.3295 69.07%, 0.4135 74.5%, 0.5083 79.81%, 0.6141 85%, 0.7312 90.09%, 1 );
--power2-out: linear( 0, 0.2688 9.91%, 0.3859 15%, 0.4917 20.19%, 0.5865 25.5%, 0.6705 30.93%, 0.7441 36.51%, 0.8075 42.26%, 0.8593 47.98%, 0.9022 53.93%, 0.9366 60.13%, 0.963 66.67%, 0.9812 73.4%, 0.9929 80.76%, 0.9986 88.89%, 1 );
--power2-in-out: linear( 0, 0.0036 9.62%, 0.0185 16.66
@royriojas
royriojas / no-ssh-password-mac.txt
Created October 10, 2022 07:10 — forked from eegrok/no-ssh-password-mac.txt
disable password ssh authentication on mac os
make sure the following lines are set in /etc/sshd_config (or /etc/ssh/sshd_config on ubuntu)
(they all exist already, but are commented, some may have a value of yes)
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no
then restart the ssh server (uncheck / recheck 'Remote Login' in the 'System Preferences' -> 'Sharing' panel)
@royriojas
royriojas / .gitconfig
Last active April 5, 2020 21:03
dotfiles
[user]
# name = yourname
# email = <your@email>
[core]
whitespace = trailing-space,space-before-tab,cr-at-eol
excludesfile = ~/.gitignore_global
[color]
diff = auto
status = auto
branch = auto
@royriojas
royriojas / cloudSettings
Created April 5, 2020 20:45 — forked from MisaelRiojas/cloudSettings
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-12-01T18:40:07.609Z","extensionVersion":"v3.2.2"}
@royriojas
royriojas / cloudSettings
Last active April 5, 2020 20:47
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-09-25T07:36:27.222Z","extensionVersion":"v3.4.3"}
@royriojas
royriojas / commands.bash
Created November 25, 2018 09:04
Fix cannot find driver - Creative SoundBlaster Omni Control Panel issue
# If you receive the following error while trying to open the Creative SoundBlaster Omni Control Panel
#
# ==============================================================
# Cannot start the app because the audio driver cannot be found
# ==============================================================
# then this is the solution:
# In the command line execute:
#
sudo kextload -b com.Creative.driver.TruStudioPCUSBAudioPlugin
@royriojas
royriojas / rulers.js
Created February 21, 2017 02:49
rulers.js
$(`<script src="//code.jquery.com/ui/1.12.1/jquery-ui.min.js"
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
crossorigin="anonymous"></script>`).appendTo('head')
$(`<link href="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css" rel="stylesheet" type="text/css" />`).appendTo('head');
var createBox = () => {
const w = 100;
const h = 100;
const style = `
@royriojas
royriojas / example.js
Created October 27, 2015 06:11
async/await example
function isValidEmail(email) {
return email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/);
}
function getUserByEmail(email) {
return new Promise((resolve) => {
setTimeout(() => {
// keep rejections for exceptions only
if (email !== 'roy@someemail.com') {
return resolve(null);