Skip to content

Instantly share code, notes, and snippets.

View ilovefreesw's full-sized avatar
🎯
Focusing

Laxman ilovefreesw

🎯
Focusing
View GitHub Profile
@ilovefreesw
ilovefreesw / PS command
Created December 30, 2022 07:40
A PowerShell script to automatically backup Windows Event Logs. Add it to Windows Task Scheduler using the Command Below.
$trigger=New-JobTrigger -Weekly -At "7:00AM" -DaysOfWeek "Monday"
$action="PowerShell.exe -ExecutionPolicy ByPass -File D:\Logs\export-logs.ps1"
$sb=[Scriptblock]::Create($action)
Register-ScheduledJob -Name "Export Logs" -ScriptBlock $sb -Trigger $trigger
@ilovefreesw
ilovefreesw / reg.bat
Created March 24, 2022 07:17
A batch script for Windows to Fix "Some settings are managed by your organization". Works on Windows 10 and Windows 11.
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies" /f
reg delete "HKCU\Software\Microsoft\WindowsSelfHost" /f
reg delete "HKCU\Software\Policies" /f
reg delete "HKLM\Software\Microsoft\Policies" /f
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies" /f
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" /f
reg delete "HKLM\Software\Microsoft\WindowsSelfHost" /f
reg delete "HKLM\Software\Policies" /f
reg delete "HKLM\Software\WOW6432Node\Microsoft\Policies" /f
reg delete "HKLM\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Policies" /f
@ilovefreesw
ilovefreesw / WpBroken.py
Last active April 6, 2023 01:01
A script to check links in all the WordPress posts to find out broken ones. Saves the report in CSV file. Based on WordPress API and only needs domain as input.
import requests
import csv
import concurrent.futures
import sys, time
import bs4
domain = sys.argv[1]
csv_file = sys.argv[2]
headers = {
@ilovefreesw
ilovefreesw / bulk_webpage_to_pdf.ps1
Last active October 4, 2023 07:18
A powershelll script to bulk convert webpages to PDF using headless Chrome. Save PDF with numberic names or based on webpage title.
$sourceFile = " " # the source file containing the URLs you want to convert
$destFolder = " " # converted PDFs will be saved here. Folder has to exist. Don't forget to make sure that this path must end with "/"
$num = 1
foreach ($link in [System.IO.File]::ReadLines($sourceFile))
{
$outfile = $num.ToString() + '.pdf'
$outputPath = Join-Path -Path $destFolder -ChildPath $outfile
& 'C:\Program Files\Google\Chrome\Application\chrome.exe' --headless --print-to-pdf="$outputPath" "$link"
Start-Sleep -Seconds 3
@Suleman-Elahi
Suleman-Elahi / wptags.py
Last active March 23, 2021 07:03
Get All WordPress Tags in Excel (CSV) using WordPress WP API v2
import requests
import csv
import time
from tqdm import tqdm
tags = {}
pages = int(requests.get('https://www.example.com/wp-json/wp/v2/tags').headers['X-WP-TotalPages'])
for i in tqdm(range(pages), ncols=65):
js = requests.get('https://www.example.com/wp-json/wp/v2/tags?page='+str(i+1)).json()
@tajnymag
tajnymag / tinder.user.js
Last active March 10, 2024 18:59
Tinder Deblur Userscript (ARCHIVED and DEPRECATED, see https://github.com/tajnymag/tinder-deblur)
// ==UserScript==
// @name Tinder Deblur
// @namespace Violentmonkey Scripts
// @match https://tinder.com/*
// @grant none
// @version 1.4
// @author Tajnymag
// @downloadURL https://raw.githubusercontent.com/tajnymag/tinder-deblur/main/tinder.user.js
// @description Simple script using the official Tinder API to get clean photos of the users who liked you
// ==/UserScript==
@Suleman-Elahi
Suleman-Elahi / unsaver.py
Last active April 23, 2023 00:31
Sript to unsave all saved Instagram posts. Uses Instagram private API by ping and its extensions to do the heavy lifting.
from instagram_private_api import Client, ClientCompatPatch
from instagram_private_api_extensions import pagination
import json, time
user_name = 'UserName'
password = 'PassWord'
api = Client(user_name, password)
items=[]
@Tras2
Tras2 / cloudflare-ddns-update.sh
Last active April 21, 2024 04:49
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record