Skip to content

Instantly share code, notes, and snippets.

View ScribbleGhost's full-sized avatar

ScribbleGhost ScribbleGhost

View GitHub Profile
cd /d %LOCALAPPDATA%\Microsoft\OneDrive\ & OneDrive.exe /shutdown
REG DELETE "HKLM\SOFTWARE\Policies\Microsoft\OneDrive" /V "FilesOnDemandEnabled" /f
Option Explicit
Dim objshell,path,DigitalID, Result
Set objshell = CreateObject("WScript.Shell")
'Set registry key path
Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
'Registry key value
DigitalID = objshell.RegRead(Path & "DigitalProductId")
Dim ProductName,ProductID,ProductKey,ProductData
'Get ProductName, ProductID, ProductKey
set SUBLIMEDIR=C:\Portable\sublimetext\sublime_text.exe
rem OPEN FILES WITH SUBLIME TEXT
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%SUBLIMEDIR%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%SUBLIMEDIR% \"%1\"" /f
rem OPEN FOLDERS WITH SUBLIME TEXT
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%SUBLIMEDIR%,0" /f
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%SUBLIMEDIR% \"%1\"" /f
Option Explicit
Dim objshell,path,DigitalID, Result
Set objshell = CreateObject("WScript.Shell")
'Set registry key path
Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
'Registry key value
DigitalID = objshell.RegRead(Path & "DigitalProductId")
Dim ProductName,ProductID,ProductKey,ProductData
'Get ProductName, ProductID, ProductKey
504b 0304 1400 0000 0800 3994 6e4f dd7e
b86b cd00 0000 4a01 0000 2d00 0000 4469
7361 626c 654f 6666 6963 6533 3635 5369
6d70 6c69 6669 6564 4163 636f 756e 7443
7265 6174 696f 6e2e 7265 6755 905d 4a03
3118 45cf b3e0 1e4a 1720 16a9 0f82 0f45
2d05 5161 b416 718a d476 4682 b591 e90c
c5cd abc7 0f41 2484 e4fe e426 375f 9f33
121b 5664 766c e951 50f1 22b7 a5a5 e143
e642 3589 b2b8 c7bd 7aa3 9ac4 1bf1 9003
@ScribbleGhost
ScribbleGhost / Remove HTML in local files
Last active December 31, 2019 01:26
For all files in folder of spesific file type, remove all HTML tags and save as new files. Article here: https://scribbleghost.net/2019/12/31/remove-html-from-local-files-with-python
# Import OS so we can write to files
import os
# Import Beautiful Soup 4 so we can parse HTML
from bs4 import BeautifulSoup
# Set the path where the target files are located
path = r'C:/some_folder'
# Set the file extension to look for
@ScribbleGhost
ScribbleGhost / youtube-dl_download_video_with_cookies.bat
Created January 1, 2020 16:19
Sample youtube-dl batch script for downloading videos with cookies
@echo off
rem You can use "Export Cookies" to get a cookie file: https://github.com/rotemdan/ExportCookies
rem Replace these variables and make sure the cookie file is in the same folder as the script
rem The link of the audio/video you want to download
set link=https://www.somelink.com
rem The location where you want to save the video
@ScribbleGhost
ScribbleGhost / Sync viewer and file selection in Directory Opus.js
Created January 3, 2020 17:02
Sync viewer and file selection in Directory Opus
// Viewer Select
// (c) 2016-2017 Leo Davidson
// This is a script for Directory Opus.
// See https://www.gpsoft.com.au/DScripts/redirect.asp?page=scripts for development information.
// See https://resource.dopus.com/viewtopic.php?f=35&t=27361 for information about this specific script.
// Called by Directory Opus to initialize the script
function OnInit(initData)
{
@ScribbleGhost
ScribbleGhost / Looping Through Multiple Pages.py
Created January 19, 2020 21:53
Script from scrapethissite.com
import requests
from bs4 import BeautifulSoup
def scrape():
page = 1
page_has_data = True
while page_has_data:
r = requests.get('https://scrapethissite.com/pages/forms/', params = dict(per_page=25, page_num=page))
soup = BeautifulSoup(r.text, 'html.parser')
@ScribbleGhost
ScribbleGhost / autounattend.xml
Last active January 23, 2020 21:54
Install script for Windows 10 that makes an admin user called "User" and sets the region and keyboard to Norwegian with English OS language.
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Reseal>
<Mode>Audit</Mode>
</Reseal>
</component>
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>0414:00000414</InputLocale>