Skip to content

Instantly share code, notes, and snippets.

View euberdeveloper's full-sized avatar

Eugenio Berretta euberdeveloper

View GitHub Profile
@euberdeveloper
euberdeveloper / .env
Last active January 11, 2024 21:20
Fix gh release not being done with release-it on wsl
GITHUB_TOKEN=<your_gh_token>
@euberdeveloper
euberdeveloper / git_groups_deep_clone.sh
Created January 5, 2024 23:26
A gist to clone groups and subgroups of gitlab
#!/bin/bash
# Syntax: [./git_groups_deep_clone.sh <gitlab_host> <gitlab_private_token> <root_group_id>
gitlab_host=$1
gitlab_private_token=$2
root_group_id=$3
git_shallow=" --depth 1 "
@euberdeveloper
euberdeveloper / euber.ahk
Last active January 11, 2024 21:11
My AutoHotKey Script
/*
Special characters for italian keyboards
*/
; -- Tilde
<^>!'::SendInput "~"
; -- BackTick
<^>!ì::SendInput "``"
/*
@euberdeveloper
euberdeveloper / portainerization.sh
Created October 17, 2023 19:58
A script to start portainer with SSL certificates
path_of_certs_folder="<INSERT_HERE>"
# note, if you want you can put 9000 for http
docker run -d -p 9443:9443 -p 8000:8000 \
--name portainer --restart always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
-v $path_of_certs_folder:/certs \
portainer/portainer-ce:latest \
--sslcert /certs/fullchain.pem \
--sslkey /certs/privkey.pem
port=80
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport $port -j ACCEPT
sudo netfilter-persistent save
@euberdeveloper
euberdeveloper / make-chinese-character-rank-by-sound-without-tones.js
Created July 17, 2022 15:48
A script that shows the ranking of the chinese characters, based on their sound without considering the tones
const https = require('https');
const fs = require('fs');
function analyzeInputData(charactersText) {
const ranking = charactersText.split('\n').map(line => line.trim()).filter(line => !!line).map(line => JSON.parse(line)).map(line => {
if (line.frequency_rank === '8220') {
line.pinyin = 'y\u01cen';
}
else if (line.frequency_rank === '9019') {
line.pinyin = 'ni\u00e1n';
#!/bin/bash
git fetch --tags -f
@euberdeveloper
euberdeveloper / fix-tab-copilot-md.json
Created February 5, 2022 16:55
On VSCode, the markdown extension is in conflict with the TAB of github copilot, so it does suggestions but you can not accept it. This fixes it.
// Add this to the shortcuts of VSCode
[
{
"key": "tab",
"command": "markdown.extension.onTabKey",
"when": "editorTextFocus && !inlineSuggestionVisible && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !suggestWidgetVisible && editorLangId == 'markdown'"
},
{
"key": "tab",
"command": "-markdown.extension.onTabKey",
@euberdeveloper
euberdeveloper / convert_webm_to_mp4.sh
Last active February 5, 2022 23:42
A scraper with Puppeteer that saves all the videos of the course "Program optimization" at TUM Informatik Msc. 2021/2022
#!/bin/bash
for filepath in ./*.webm; do
filename=$(basename -- "$filepath")
filename="${filename%.*}"
ffmpeg -i ${filename}.webm ${filename}.mp4
done
# Install phpenv
curl -L https://raw.githubusercontent.com/phpenv/phpenv-installer/master/bin/phpenv-installer \
| bash
# --- COPY WHAT IS DISPLAYED ON THE CONSOLE IN THE END OF YOUR BASHRC ---
# Install missing libraries used to install various php versions by phpenv
apt install libxml2-dev
apt install libjpeg-dev
apt install libonig-dev