Skip to content

Instantly share code, notes, and snippets.

@C0nw0nk
C0nw0nk / js.cmd
Last active November 14, 2022 05:16
Batch file to run javascript open website grab contents
@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://www.youtube.com/watch?v=frFdisA68Lo&t=32s"
for /f "tokens=*" %%a in ('
@C0nw0nk
C0nw0nk / youtube-dl.cmd
Last active March 11, 2023 01:04
youtube-dl for windows to download into MP3 format music videos audio from youtube HQ HD Audio no need to download anything i made the script do it all just give it a url
@echo off & setLocal EnableDelayedExpansion
:: Copyright Conor McKnight
:: https://github.com/C0nw0nk/
:: https://www.facebook.com/C0nw0nk
:: Automatically sets up youtube-dl.exe ffmpeg.exe and aria2c.exe
:: all you need is the batch script it will download the latest versions from their github pages
:: simple fast efficient easy to move and manage
:: Script Settings
echo Input URL or Playlist URL:
@C0nw0nk
C0nw0nk / youtube-dl.cmd
Created November 10, 2022 21:55
youtube-dl.exe youtube-dl.cmd ffmpeg.exe batch file script.
:: youtube-dl.cmd [url[.txt]] [...]
:: download youtube-dl.exe from https://github.com/ytdl-org/youtube-dl/releases/latest/download/youtube-dl.exe
:: download ffmpeg.exe from https://github.com/C0nw0nk/youtube-dl-concurrent/raw/main/ffmpeg.exe
:: any combination of URLs and text files may be used.
:: text files are found and processed first, then all URLs.
@ECHO OFF
:: set target folder, else current folder is used
SET TargetFolder=D:\Downloads\YouTube
:: if defined will create folders for each text list entered
@C0nw0nk
C0nw0nk / elevate_loop.cmd
Last active November 10, 2022 05:23
Run batch command line script as admin automatically if user says no it will just ask again in a loop when the script ends or exits it will start again on loop
@echo off & setLocal EnableDelayedExpansion
TITLE ^start Admin elevation batch file and reboot script upon ^exit
:start
net session >nul 2>&1
if %errorlevel% == 0 (
goto :admin
) else (
@pushd %~dp0 & fltmc | find ^".^" && (powershell start '%~f0' ' %*' -verb runas 2>nul && exit /b)
@C0nw0nk
C0nw0nk / vramboost.sh
Last active November 5, 2022 14:04
RaspberryPI VRAM boost
#!/usr/bin/env bash
sudo wget -q https://git.io/vM1kx -O /tmp/rpizram && bash /tmp/rpizram
sudo nano /etc/sysctl.conf
vm.vfs_cache_pressure=500
vm.swappiness=100
vm.dirty_background_ratio=1
vm.dirty_ratio=50
@C0nw0nk
C0nw0nk / vpn_setup.sh
Last active November 5, 2022 14:04
RaspberryPI VPN setup PrivateInternetAccess
#!/usr/bin/env bash
#tweak for your own needs original guide was here but everybody has their own setup https://not-blog.heyitschris.com/how-to-properly-set-up-pia-vpn-on-a-raspberry-pi-with-a-killswitch-ckhi6vlp900kt1cs189cm5w7u
#Obtain openvpn file such as uk-london from https://www.privateinternetaccess.com/openvpn/openvpn.zip
#Directory to store vpn files /etc/openvpn/client/uk-london.conf
sudo apt update && sudo apt upgrade -y
curl https://ipinfo.io/
@C0nw0nk
C0nw0nk / raspberrypi_wifi.sh
Last active November 5, 2022 14:05
RaspberryPi Wifi Dongle Setup TP-Link AC600 USB Wi-Fi Dongle, Dual Band 5 GHz Wireless Adapter for PC, Desktop and Laptop, Supports Windows 11/10/8.1/8/7/XP, Mac OS 10.9-10.13 (Archer T2U Nano) ASIN B07LGSDBTF
#!/usr/bin/env bash
#https://www.amazon.co.uk/gp/product/B07LGSDBTF/
#Created this post as a refrence for anyone struggling to get it to work
sudo apt-get install -y raspberrypi-kernel raspberrypi-kernel-headers # slow
git clone https://github.com/aircrack-ng/rtl8812au.git
cd rtl8812au
@C0nw0nk
C0nw0nk / raspberrypi_bluetooth.sh
Last active November 5, 2022 14:06
RaspberryPi bluetooth dongle setup TP-link TP-Link Nano USB Bluetooth 5.0 Adapter for Multiple Devices, Long Range Bluetooth Dongle/Receiver for Windows 11/10/8.1/8/7, Plug and Play (UB5A) ASIN B09S15RLH5
#!/usr/bin/env bash
#https://www.amazon.co.uk/gp/product/B09S15RLH5/
#Created this post as a refrence for anyone struggling to get it to work
sudo apt update
sudo apt upgrade
sudo apt install bluetooth pi-bluetooth bluez blueman
cd /lib/firmware/rtl_bt
sudo wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtl_bt/rtl8761bu_config.bin