Skip to content

Instantly share code, notes, and snippets.

View esolitos's full-sized avatar

Marlon (Esolitos) Saglia esolitos

View GitHub Profile
@dangovorenefekt
dangovorenefekt / blockmetatwitter.md
Last active May 8, 2024 06:29
Block Meta and Twitter (nginx)
@andreaganduglia
andreaganduglia / disneyplus-on-linux.js
Created November 10, 2022 10:34
A Tampermonkey script to watch Disney+ on Linux
// ==UserScript==
// @name DisneyPlus on Ubuntu
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Set custom navigator.userAgent
// @author Andrea Ganduglia - Based on https://gist.github.com/moehlone/bed7dd6cb38fc55bd640
// @match https://www.disneyplus.com/*
// @grant none
// ==/UserScript==
@kanlukasz
kanlukasz / ssh-exit-codes.sh
Created March 28, 2022 05:39 — forked from asiegman/ssh-exit-codes.sh
Understanding SSH and exit codes in Bash scripts.
#!/bin/bash
#
# SSH Exit Codes
#
# Using SSH in scripting is pretty standard, but sometimes you want to stop execution of a script
# if a command inside an SSH session fails to exit cleanly (return 0). The key to remember is that
# the ssh command's exit code will be that of the *last executed* command inside the ssh session, just
# like a bash script ends with the exit code of the last command executed unless you specifically
# call exit.
#
@painor
painor / FastTelethon.py
Last active April 27, 2024 16:21
This will increase the download/upload speed when using telethon
# copied from https://github.com/tulir/mautrix-telegram/blob/master/mautrix_telegram/util/parallel_file_transfer.py
# Copyright (C) 2021 Tulir Asokan
import asyncio
import hashlib
import inspect
import logging
import math
import os
from collections import defaultdict
from typing import Optional, List, AsyncGenerator, Union, Awaitable, DefaultDict, Tuple, BinaryIO
@mparker17
mparker17 / fix-d8-empty-install-profile.md
Last active July 26, 2023 04:36
Fixing a Drupal 8 site with an empty install profile

Fixing a Drupal 8 site with an empty install profile

You'll probably notice this because of a series of errors like the ones below on the status report at /admin/reports/status:

    Notice: Undefined index: name in system_requirements() (line 59 of core/modules/system/system.install).
    Notice: Undefined index: version in system_requirements() (line 61 of core/modules/system/system.install).

To fix this...

  1. Check settings.php and settings.local.php in the order they are parsed for lines that look like $settings['install_profile']
@berkedel
berkedel / flow-error-icu4c-not-loaded.md
Created April 4, 2018 14:13
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

How to solve dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.60.dylib

brew uninstall --ignore-dependencies node icu4c
brew install node
@loilo
loilo / magic-methods.js
Last active April 25, 2024 13:58
PHP Magic Methods in JavaScript
function magicMethods (clazz) {
// A toggle switch for the __isset method
// Needed to control "prop in instance" inside of getters
let issetEnabled = true
const classHandler = Object.create(null)
// Trap for class instantiation
classHandler.construct = (target, args, receiver) => {
// Wrapped class instance
@esolitos
esolitos / 0.DRCMD.README.md
Last active May 4, 2022 14:27
Drush command "executor" on alias pattern. Built for Wodby aliases naming standard, but can work on other setups.

DrCmd - DrushComander

drush command runner for Wodby aliases

0. Install

Save the file in /usr/local/bin/ (or anywhere else as long as it is in your $PATH) and verify that it is executable.

a. Right click on "Raw" button (for drcmd) and copy the URL.

@geerlingguy
geerlingguy / ansible-role-test.sh
Last active January 18, 2024 17:37
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)

Trashing the Vodafone Station

How to replace the Vodafone Station with your very own router

Vodafone forces its customers to use their modem/router, the "Vodafone Station": using any other router is impossible because authentication is being done via a custom PPPoE setup.
In the PPPoE packet there is a field named Host-Uniq which is used to separate packets from different PPPoE sessions: Vodafone requires the Station serial number to be put in this field as authentication.

Hardware setup

A Linux router with root access is needed to replace the Station with. With an xDSL connection a modem with a custom firmware like OpenWrt has to be used, most likely one based on a Lantiq SoC.
For a FTTH internet connection then every machine with at least two gigabit ethernet interface and a decent CPU will do it.