Skip to content

Instantly share code, notes, and snippets.

{
"name": "vahid-test",
"version": "1.0.0",
"bin": "./zzz.js"
}
@rhashemian
rhashemian / MysqlFullBackup.bat
Last active November 21, 2021 16:32
Windows batch script to backup all MySQL databases, with compression and versioning.
rem for a windows server running multiple mysql databases, for example hosting multiple wordpress sites.
rem simple batch file makes a full backup of all mysql databases, then compresses and versions it
rem keeping the last 5 versions. ex. run daily from task scheduler.
rem be sure that another process such a robocopy picks up and stores the backup files remotely, in case of server failure.
rem install 7-zip for compression.
rem update my.ini with mysqldump credentials:
@rhashemian
rhashemian / CFattackmode.py
Last active March 27, 2022 17:22
Python script to turn on or off "under attack" mode in Cloudflare for one, some, or all sites in your account.
#!/usr/bin/env python3
'''
By Robert Hashemian
Turn on or off "under attack" mode in Cloudflare for one, some, or all sites in your account.
Get api token from: https://dash.cloudflare.com/profile/api-tokens
permission needed: #zone_settings:edit
Replace xxxxxxxxxxxxxxxx... below with the token.
import hashlib as hasher
import datetime as date
# Define what a Snakecoin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash