Skip to content

Instantly share code, notes, and snippets.

@tolgig
tolgig / telegram-mtproxy.md
Created June 7, 2025 11:06 — forked from rameerez/telegram-mtproxy.md
Telegram Proxy How-To: complete and up-to-date MTProxy tutorial

How to set up a Telegram Proxy (MTProxy)

This tutorial will teach you how to set up a Telegram MTProxy on an Ubuntu 22.04 sever using AWS Lightsail, although you can use any other Linux distribution and cloud provider.

Using a Telegram proxy is a safe, easy and effective way of overcoming Telegram bans. It's useful, for example, to keep using Telegram under tyrannical regimes, or to circumvent judges' decisions to block Telegram.

Telegram proxies are a built-in feature in all Telegram apps (both mobile and desktop). It allows Telegram users to connect to a proxy in just one or two clicks / taps.

Telegram proxies are safe: Telegram sends messages using their own MTProto secure protocol, and the proxy can only see encrypted traffic – there's no way for a proxy to decrypt the traffic and read the messages. The proxy does not even know which Telegram users are using the proxy, all the proxy sees is just a list of IPs.

public async updateProfile(profileDto: EditProfilDto): Promise<IUser> {
const userFromDb = await this.userModel.findOne({
email: profileDto.email,
});
// Dont found any user with this email
if (!userFromDb)
throw new HttpException('COMMON.USER_NOT_FOUND', HttpStatus.NOT_FOUND);
if (profileDto.username)
userFromDb.username = profileDto.username.toLowerCase().trim();
if (profileDto.username)
@tolgig
tolgig / distributed-mediasoup.js
Created September 6, 2020 17:18 — forked from gurupras/distributed-mediasoup.js
mediasoup horizontal scaling
onServerStartup () {
const { serverId, ip } = getServerInfo() // serverId does not change across restarts
this.serverId = serverId
// We don't have any routers or producers (yet). Clear any value that exists in the DB related to our serverId
clearSharedDB(serverId, 'routers')
clearSharedDB(serverId, 'producers')
// Update the DB with our serverId and ip so that others will know how to reach us
registerServerInDB(serverId, ip)
@tolgig
tolgig / database.rules.json
Created September 2, 2020 17:35 — forked from codediodeio/database.rules.json
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@tolgig
tolgig / README.md
Created July 17, 2020 19:03 — forked from CodingDoug/README.md
Example code from the video "Use async/await with TypeScript in Cloud Functions"

Example code from the video "Use async/await with TypeScript in Cloud Functions"

This is the example code from my video about using async/await with Cloud Functions. I've placed it here in a gist so it's easier to compare the "before" and "after" states for each case.

Watch the video here

The code in this project is licensed under the Apache License 2.0.

Copyright 2018 Google LLC
@tolgig
tolgig / README.md
Created October 22, 2019 12:04 — forked from agustif/README.md
NextJS sitemap generator with dynamic URL

NextJS sitemap generator

Install

The current setup has been tested on Next Js 7.0.0.

You need to install Axios.

$ npm install axios
@tolgig
tolgig / germany-cities.json
Created October 20, 2019 11:24
All Cities In Germany JSON
[
"Aach (BW)",
"Aachen (NW)",
"Aalen (BW)",
"Abenberg (BY)",
"Abensberg (BY)",
"Achern (BW)",
"Achim (NI)",
"Adelsheim (BW)",
"Adenau (RP)",
@tolgig
tolgig / component.js
Created September 5, 2019 21:42 — forked from l0gicgate/component.js
Redux + Websockets
import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import { initializeSocket } from './redux/socket.js';
class App extends React.Component {
static propTypes = {
dispatch: PropTypes.func.isRequired,
socket: PropTypes.object.isRequired,
};
# remove and prune all
docker ps -q | xargs docker stop ; docker system prune -a