Skip to content

Instantly share code, notes, and snippets.

View Marcio2536's full-sized avatar

Edmond Marcio2536

View GitHub Profile
@Marcio2536
Marcio2536 / google_vpn.yaml
Last active January 13, 2024 03:26
Ruleset for Google One VPN. Source: https://outti.me/use_google_one_vpn
payload:
- '136.22.64.0/24'
- '136.22.65.0/24'
- '136.22.67.0/24'
- '136.22.76.0/24'
- '136.22.83.0/24'
- '136.22.85.0/24'
- '136.22.86.0/24'
- '136.22.87.0/24'
- '136.22.92.0/24'
@Marcio2536
Marcio2536 / ADF-Rearrange.py
Last active December 24, 2023 05:50
Rearrange the sequence of an ADF(Automatic Document Feeder)-produced PDF file into ascending order. For details, see the comments below.
import PyPDF2
import os
def rearrange_pages(pdf_path):
with open(pdf_path, 'rb') as file:
reader = PyPDF2.PdfReader(file)
writer = PyPDF2.PdfWriter()
num_pages = len(reader.pages) # Get the number of pages in the PDF file
for i in range(0, num_pages):
@Marcio2536
Marcio2536 / docker-backup.sh
Created February 5, 2023 11:13
Bash script for Docker-Autocompose on DSM 7
#!/bin/bash
file=/volume1/homes/backup/docker-compose-nas.yml # Change it to your own path
if test -f "$file"; then
cp /volume1/homes/backup/docker-compose-nas.yml /volume1/homes/backup/docker-compose-nas.yml.bak # Change it to your own path
fi
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/red5d/docker-autocompose $(docker ps -aq) > /volume1/homes/backup/docker-compose-nas.yml # Change it to your own path
@Marcio2536
Marcio2536 / Handoff for Windows.ahk
Last active January 21, 2023 11:18
Send clipboard to Apple devices using Bark
;iphone.txt and ipad.txt has to be located at the same directory
+d::
FileRead, iphoneurl, iphone.txt
FileRead, ipadurl, ipad.txt
clipboard = %clipboard%
If (InStr(clipboard,"http://") or InStr(clipboard,"HTTP://") or InStr(clipboard,"https://") or InStr(clipboard,"HTTPS://"))
{
copy := "?url=" . clipboard
clipboard := "Incoming URL Link"
} else {
@Marcio2536
Marcio2536 / discord-webhook.txt
Created January 14, 2023 02:46
Discord Template for Jellyfin Webhook Plugin
{
"content": "{{MentionType}}",
"avatar_url": "{{AvatarUrl}}",
"username": "{{{BotUsername}}}",
"embeds": [
{
"color": "{{EmbedColor}}",
"footer": {
"text": "From {{{ServerName}}}",
"icon_url": "{{AvatarUrl}}"
@Marcio2536
Marcio2536 / ipfs-docker.txt
Created January 4, 2023 14:46
Enable external/cross-site access for ipfs-kubo containers
docker exec ipfs-node ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://192.168.162.106:50238","http://192.168.162.106:50238","http://localhost:3000", "http://127.0.0.1:50238", "https://webui.ipfs.io"]'
docker exec ipfs-node ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST"]'
@Marcio2536
Marcio2536 / docker-compose.yml
Created January 4, 2023 14:44
Docker compose file for ipfs-kubo
version: '3.8'
services:
ipfs:
image: "ipfs/kubo:latest"
restart: unless-stopped
volumes:
- ipfs_path:/data/ipfs
- ipfs_fuse:/ipfs
- ipns_fuse:/ipns
environment:
@Marcio2536
Marcio2536 / vaultwarden.conf
Created January 4, 2023 11:14
Vaultwarden reverse proxy configuration for nginx docker containers
server {
listen 80 default_server;
server_name your.vaultwarden.com;
set_real_ip_from 172.16.0.0/12;
real_ip_header X-Forwarded-For;
location / {
proxy_pass http://192.168.12.3:10001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;