Skip to content

Instantly share code, notes, and snippets.

View tperalta82's full-sized avatar

Tiago Peralta tperalta82

View GitHub Profile
@tperalta82
tperalta82 / README.md
Created May 17, 2017 15:47 — forked from Remiii/README.md
How to delete Vault (AWS Glacier)

How to delete Vault (AWS Glacier)

This Gist give some tips in order to remove AWS Glacier Vault with AWS CLI (ie. https://aws.amazon.com/en/cli/).

Step 1 / Retrive inventory

$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --vault-name YOUR_VAULT_NAME --account-id YOUR_ACCOUNT_ID --region YOUR_REGION
@tperalta82
tperalta82 / damnedd3.php
Last active May 3, 2018 23:43
Reboot D3 on fail board
#!/usr/bin/php
<?php
$hosts = array("antminer1","antminer2");
$minercreds = array( "user" => "root", "pass" => "becauseIAmHigh");
$failhashboard = "oxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxx";
/* I'm too stoned to try and detect how many hashboards are there*/
$possiblehashboards = 4;
foreach($hosts as $host)
{
#!/bin/bash
set -e
# REQUIRED ACTION: Configure your backup server vars - see OVH Server Manager's "Backups" tab.
# BACKUP_HOST_PREFIX: use the prefix domain for the listed "Name" value on the "Backups" tab.
# Example: With a 'Name' value `ftpback-bhs1-3.ip-111-222-333.net` you would need to set `BACKUP_HOST_PREFIX=ftpback-bhs1-3`
# Add something likethese to your ~/.bashrc - /etc/profile
#export OVH_SERVER_ID="ns5xxxxx.ip-x-x-x.net"
#export BACKUP_HOST_PREFIX="ftpback-bhs1-x"
@ECHO OFF
COLOR 1F
SET V=1.7
TITLE Windows 10 Registry tweaks for mining (x64) by: jsanzsp
ECHO #########################################################
ECHO # #
ECHO # WINDOWS 10 BUILD 10240 X64 #
ECHO # #
ECHO # #
ECHO # AUTOR: jsanzsp Ethereum Community Forum #
@tperalta82
tperalta82 / github_delete_repos.sh
Created June 19, 2020 09:35
Remove Github Repos Batch
#!bin/bash
sudo apt update
sudo apt full-upgrade
sudo apt install curl jq
curl "https://api.github.com/users/YOURUSERNAME/repos?per_page=100&page=1" | jq -r '.[] | .name' | sed 's\^\YOURUSERNAME/\g' > delete_repos.txt
##code delete_repos.txt
read -p "Edit delete_repos.txt and delete the repos you want to keep from the list, then create a github token with delete_repos permissions"
while read repo; do curl -X DELETE -H "Authorization: token YOUR_TOKEN" "https://api.github.com/repos/$repo"; done < delete_repos.txt
@tperalta82
tperalta82 / gist:e508a2baaffc6148b953ecc77f2a398e
Created January 15, 2021 00:15 — forked from iraSenthil/gist:930328
Different ways to create and run thread
//Method with no parameter - ThreadStart Delegate
Thread t = new Thread (new ThreadStart (TestMethod));
t.Start();
void TestMethod() {}
//Method with a parameter - ParameterizedThreadStart Delegate
Thread t = new Thread (new ThreadStart (TestMethod));
t.Start(5);
t.Start("test");
void TestMethod(Object o) {}
@tperalta82
tperalta82 / install_tools.sh
Created October 6, 2021 15:24 — forked from allenyllee/install_tools.sh
mount vhdx in linux
#!/bin/bash
# install qemu utils
sudo apt install qemu-utils
# install nbd client
sudo apt install nbd-client
@tperalta82
tperalta82 / mysqldbcompare.py
Created November 23, 2023 01:37
Mysql Table data Compare
import mysql.connector
def get_table_data(host, port, user, password, database, table):
connection = mysql.connector.connect(
host=host,
port=port,
user=user,
password=password,
database=database
)
@tperalta82
tperalta82 / tx.sql
Created July 3, 2024 18:37
Check for locked transactions
SELECT OBJECT_TYPE,
OBJECT_SCHEMA,
OBJECT_NAME,
LOCK_TYPE,
LOCK_STATUS,
THREAD_ID,
PROCESSLIST_ID,
PROCESSLIST_INFO
FROM performance_schema.metadata_locks
INNER JOIN performance_schema.threads ON THREAD_ID = OWNER_THREAD_ID
@tperalta82
tperalta82 / wireguard-update.py
Last active August 18, 2024 02:37
Wireguard DDNS Updater
import re
import subprocess
import socket
import traceback
DEBUG = False
WG = "wg0"
DDNS = "ddnshost.tld"
try:
subprocess.run(["wg-quick", "save", f'{WG}'])
config = open(f'/etc/wireguard/{WG}.conf', "r").read()