Skip to content

Instantly share code, notes, and snippets.

View eoli3n's full-sized avatar
🍕
I wish to be a ninja turtle in my next life

Jonathan Kirszling eoli3n

🍕
I wish to be a ninja turtle in my next life
View GitHub Profile
@eoli3n
eoli3n / multiple-push-urls.md
Created June 25, 2023 10:14 — forked from bjmiller121/multiple-push-urls.md
Add multiple push URLs to a single git remote

Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.

Once you have a remote set up for one of your upstreams, run these commands with:

git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]

Once set up, git remote -v should show two (push) URLs and one (fetch) URL. Something like this:

@eoli3n
eoli3n / gist:30e689333db4980cf5845282474a7e48
Last active May 22, 2023 09:32
Give the ability to a unprivileged user to manage a website
--- For the demonstration ---
root@work /# mkdir /var/www
root@work /# useradd www-data
root@work /# chown www-data:www-data /var/www
# Add the user to the www-data group
root@work /# usermod -a -G www-data user
# Use the setgid bit to let subdirectories inherit from the group
@eoli3n
eoli3n / gist:8282fef9864a3f093ccd21a4b0734a94
Created January 1, 2023 10:15
Install Ansible in Termux
# Update repos
termux-change-repo
# Upgrade packages
pkg upgrade
# Install deps
pkg install python3 python-cryptography rust libffi libssl build-essential
# Upgrade pip
@eoli3n
eoli3n / root-podman-wayland.sh
Last active January 28, 2024 10:14
Run an application with dbus and wayland sockets in a rootless podman container
# Install docker or podman package on your distro (podman doesn't need a daemon like dockerd to work). All args are exactly same, just replace ``podman`` with ``docker`` in command if you want to.
sudo pacman -S podman
# Run an archlinux container with dbus and wayland sockets.
sudo podman run \
--volume "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY":/tmp/wayland-0 \
--device /dev/dri \
--volume /run/user/1000/bus:/tmp/bus \
--rm -it archlinux /bin/bash
@eoli3n
eoli3n / symlinker.sh
Last active May 2, 2020 14:39
Organize http://archzfs.com/archive_archzfs/ as Arch Linux Archives
#!/bin/bash
# Written by github.com/eoli3n
# Script stops if any error
set -e
############
### Test ###
# Here i tried to keep you current uploaddir and just generates a new one with symlinks
# To test without symlink actual datas, just use "-s"
@eoli3n
eoli3n / encryption.php
Last active April 1, 2024 20:08
Encrypt - Decrypt AES from/to Python PyCryptodome from/to PHP openssl
<?php
// use to generate key : 'openssl rand -hex 32'
function my_encrypt($data, $passphrase) {
$secret_key = hex2bin($passphrase);
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));
$encrypted_64 = openssl_encrypt($data, 'aes-256-cbc', $secret_key, 0, $iv);
$iv_64 = base64_encode($iv);
$json = new stdClass();
$json->iv = $iv_64;