This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upsert(db_cur, table, pk_fields, schema=None, **kwargs): | |
"""Updates the specified relation with the key-value pairs in kwargs if a | |
row matching the primary key value(s) already exists. Otherwise, a new row | |
is inserted. Returns True if a new row was inserted. | |
schema the schema to use, if any (not sanitized) | |
table the table to use (not sanitized) | |
pk_fields tuple of field names which are part of the primary key | |
kwargs all key-value pairs which should be set in the row | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import csv | |
import concurrent.futures | |
import sys, time | |
import bs4 | |
domain = sys.argv[1] | |
csv_file = sys.argv[2] | |
headers = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 |