Skip to content

Instantly share code, notes, and snippets.

View gabrielmocanu's full-sized avatar

Gabriel Mocanu gabrielmocanu

View GitHub Profile
#!/usr/bin/env python
Author: Andrei David
Basic program to upload files to Github Gists
Go to [1] to create a token
mrcomoraes /
Last active May 10, 2024 12:07
Clear cache Microsoft Teams on Linux
# This script cleans all cache for Microsoft Teams on Linux
# Tested on Ubuntu-like, Debian by @necrifede, Arch Linux by @lucas-dclrcq and Manjaro with flatpak by @danie1k. Feel free to test/use in other distributions.
# Tested Teams via snap package.
# Tested Teams via flatpak package.
# How to use in terminal:
# ./ ( deb-stable | deb-insider | snap | flatpak )
# or
Ryanb58 /
Last active May 17, 2024 13:42
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
v3.7.0-243-gf26e75a186 []
v3.7.0-229-g087f28e29d []
yuezhu / gist:47b15b4b8e944221861ccf7d7f5868f5
Created February 7, 2018 18:10
Generate self-signed certificate for HAProxy
# Generate a unique private key (KEY)
sudo openssl genrsa -out mydomain.key 2048
# Generating a Certificate Signing Request (CSR)
sudo openssl req -new -key mydomain.key -out mydomain.csr
# Creating a Self-Signed Certificate (CRT)
openssl x509 -req -days 365 -in mydomain.csr -signkey mydomain.key -out mydomain.crt
# Append KEY and CRT to mydomain.pem
jmmitchell /
Last active December 1, 2021 18:07
converting from decimal value to the ascii character and from the ascii character to the ordinal number in bash
# chr() - converts decimal value to its ASCII character representation
# ord() - converts ASCII character to its decimal value
chr() {
printf \\$(printf '%03o' $1)
ord() {
printf '%d' "'$1"
subfuzion /
Last active June 14, 2024 20:32
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.