Skip to content

Instantly share code, notes, and snippets.

@C0nw0nk
C0nw0nk / entware-synology-nas.sh
Last active February 2, 2023 14:20
entware synology nas add create scheduled task to run at boot custom script user root
# Create Autostart Task
#
# Create a triggered user-defined task in Task Scheduler.
#
# Goto: DSM > Control Panel > Task Scheduler
# Create > Triggered Task > User Defined Script
# General
# Task: Entware
# User: root
# Event: Boot-up
@C0nw0nk
C0nw0nk / remove_last_folder.cmd
Last active January 29, 2023 17:05
remove last directory folder from variable batch file command line
@echo off & setLocal EnableDelayedExpansion
set root_path="%~dp0"
set "remove_last_folder=%root_path:"=%"
::remove last back slash
set "remove_last_folder=%remove_last_folder:~0,-1%"
::last folder into var
set "last1=%remove_last_folder:\=" & set "lastfolder1=%"
::remove last folder from var
@C0nw0nk
C0nw0nk / privateinternetaccess-PIA.txt
Last active January 26, 2023 18:17
Private Internet Access Streaming Optimization sub domains to use
You can use these in ovpn files wireguard as remote connection point you will be appointed a random streaming optimized IP address upon connection
United Kingdom UK streaming Optimized servers
uk-2.privacy.network
Sweden Swiss streaming optimized servers
swededen-2.privacy.network
denmark danish streaming optimized servers
denmark-2.privacy.network
@C0nw0nk
C0nw0nk / privateinternetaccess
Created January 13, 2023 13:57
Private internet Access | PIA | Dedicated IP .ovpn .conf openvpn wireguard how to login and use dedicated IP
To login and use your dedicated IP with private internet access obviously specifying your custom IP is needed.
But you do not use your username use your dedicated hash token they provide to you with "dedicated_ip_DIP" at the start.
Username :
dedicated_ip_DIPxxxxxxxxxxxxxxxxx
Password :
YOUR PRIVATE INTERNET ACCESS ACCOUNT PASSWORD
#Openvpn file
@C0nw0nk
C0nw0nk / docker.sh
Last active December 31, 2022 14:20
sudo docker ps
sudo docker exec -ti emby1 bash
sudo echo 16384 | sudo tee /proc/sys/fs/inotify/max_user_watches
sudo echo fs.inotify.max_user_watches=16384 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
exit
sudo docker exec -ti plex1 bash
sudo echo 16384 | sudo tee /proc/sys/fs/inotify/max_user_watches
sudo echo fs.inotify.max_user_watches=16384 | sudo tee -a /etc/sysctl.conf
@C0nw0nk
C0nw0nk / watchtower.yml
Last active December 31, 2022 04:52
watchtower synology nas auto updater
# enable SSH access login then
# mkdir -p /volume1/docker/watchtower && cd /volume1/docker/watchtower && sudo docker-compose -f watchtower.yml up -d
# 1 on container name using synology nas docker to create images automatically puts a number there so you gotta use the number if created using docker
services:
watchtower:
image: containrrr/watchtower:latest
container_name: watchtower1
environment:
- TZ=Europe/London
- WATCHTOWER_CLEANUP=true
@C0nw0nk
C0nw0nk / undetectable-chromedriver-patcher.ps1
Last active December 3, 2022 20:01
Powershell Script to patch Chromedriver.exe for selenium to make it undetectable msedgedriver.exe and operadriver.exe
$regexA = 'cdc_.{22}';
$ThisFile = 'C:\Users\MEDIA-SERVER\Desktop\chromedriver.exe'
#$ThisFile = 'C:\Users\MEDIA-SERVER\Desktop\msedgedriver.exe' #Yes this can also be patched
#$ThisFile = 'C:\Users\MEDIA-SERVER\Desktop\operadriver.exe' #Yes this can also be patched
$new_date="10/10/2000 13:37:02";
if ( (Get-ChildItem $ThisFile).CreationTime -notlike $new_date ) {
Write-Output "Patching now";
} else {
Write-Output "is already patched";
@C0nw0nk
C0nw0nk / vivaldi_chromedriver_version.cmd
Created November 27, 2022 11:05
get vivaldi chromedriver current supported version
@echo off & setLocal EnableDelayedExpansion
::get vivaldi chromedriver version to extract the right file that will be compatible
set alias=REG QUERY ^"HKEY_CURRENT_USER\SOFTWARE\Vivaldi\BLBeacon^"
for /f "tokens=*" %%a in ('%alias% /s ^| FIND ^"version^" 2^>Nul') do (
set framework_version=%%a
::set "framework_version=!framework_version:~1,-1!"
set "framework_version=!framework_version:.=!"
set "framework_version=!framework_version: =!"
set "framework_version=!framework_version:Version=!"
@C0nw0nk
C0nw0nk / hybrid_batch_file_js_vbs_cmd.cmd
Created November 14, 2022 10:50
hybrid batch file for running batch code vbscript and javascript all inline in command line
@if (@This==@IsBatch) @then
@echo off & setLocal EnableDelayedExpansion
:: Copyright Conor McKnight
:: https://github.com/C0nw0nk/
:: https://www.facebook.com/C0nw0nk
:: Hybrid batch file for running inline batch code, VBScript and Javascript from the same .cmd or .bat file
set site="https://checkip.amazonaws.com/"
::Start Javascript Execution function and args
@C0nw0nk
C0nw0nk / batch_file_my_ip.cmd
Created November 14, 2022 07:11
batch file to get public facing ip address without any external files or help
@if (@This==@IsBatch) @then
@echo off & setLocal EnableDelayedExpansion & CHCP 65001 >NUL
:: Copyright Conor McKnight
:: https://github.com/C0nw0nk/
:: https://www.facebook.com/C0nw0nk
:: Execute Javascript without needing to install anything
:: store javascript output in batch file variable
set site="https://checkip.amazonaws.com/"
for /f "tokens=*" %%a in ('