Skip to content

Instantly share code, notes, and snippets.

View CarlosRA97's full-sized avatar

Carlos Rivero Aro CarlosRA97

View GitHub Profile
#!/usr/local/bin/python3
from datetime import datetime
from mrz.checker.td1 import TD1CodeChecker
from mrz.checker.td2 import TD2CodeChecker
from mrz.checker.td3 import TD3CodeChecker
import pyautogui
import pygetwindow
import time
from getpass import getpass
@CarlosRA97
CarlosRA97 / README.md
Created February 23, 2023 16:05 — forked from matusnovak/README.md
GPG + Git SSH Authentication and Signing on Windows 10

GPG + Git SSH Authentication and Signing on Windows 10

Introduction

This simple Gist will explain how to settup your GPG key to work for SSH authentication (with Git) and Git commit signing on Windows 10. This may seem straightforward on Linux, but there are certain tweaks needed on Windows.

No Cygwin, no MinGW, no Git Bash or any other Linux emulated environment. This works in pure Windows 10.

Software needed

const isXPathLoaded = async path => {
while ( getElementByXpath(path) === null) {
await new Promise( resolve => requestAnimationFrame(resolve) )
}
return getElementByXpath(path);
};
function getElementByXpath(path) {
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}
@CarlosRA97
CarlosRA97 / useAsyncHook.ts
Last active May 4, 2022 12:11
Async hook for Axios in ReactJS
import { AxiosResponse } from 'axios';
import { useEffect } from 'react';
export const useAsync = (
asyncFn: () => Promise<AxiosResponse<any, any>>,
successFunction: Function,
returnFunction: Function,
dependencies: any[] = []
) => {
useEffect(() => {
@CarlosRA97
CarlosRA97 / enable_wake_on_lan.sh
Created January 6, 2022 16:34
This is bash script setup the wake on lan functionality on fedora systems using the nmcli command. it was extracted from a forum (https://forums.fedoraforum.org/showthread.php?322977-Making-WoL-persistent)
#!/bin/bash
#
clear
echo
echo
echo "Details of connections:"
echo "=================================================================================="
nmcli con show
CONNECTIONS=()
while IFS= read -r line; do
@CarlosRA97
CarlosRA97 / make-keys.sh
Created May 5, 2020 17:35 — forked from suru-dissanaike/make-keys.sh
Create self-signed certificates for Eclipse Mosquitto MQTT broker
#!/bin/bash
IP="192.168.1.22"
SUBJECT_CA="/C=SE/ST=Stockholm/L=Stockholm/O=himinds/OU=CA/CN=$IP"
SUBJECT_SERVER="/C=SE/ST=Stockholm/L=Stockholm/O=himinds/OU=Server/CN=$IP"
SUBJECT_CLIENT="/C=SE/ST=Stockholm/L=Stockholm/O=himinds/OU=Client/CN=$IP"
function generate_CA () {
echo "$SUBJECT_CA"
openssl req -x509 -nodes -sha256 -newkey rsa:2048 -subj "$SUBJECT_CA" -days 365 -keyout ca.key -out ca.crt

Keybase proof

I hereby claim:

  • I am carlosra97 on github.
  • I am carlosra97 (https://keybase.io/carlosra97) on keybase.
  • I have a public key ASDsRDLch2fup3pGxV981Uc31OoSJsLDCYIE2Bvex3rNtQo

To claim this, I am signing this object:

@CarlosRA97
CarlosRA97 / git.sh
Last active July 7, 2019 18:37
Git client for Docker RPI similar to Alpine Git
#!/bin/bash
docker run -ti --rm -v $1:/git -v $HOME/.ssh:/root/.ssh carlosra97/raspberrypi3-alpine-git ${@:2}
@CarlosRA97
CarlosRA97 / 01.dominator.cpp
Created February 7, 2018 13:37 — forked from juanfal/01.dominator.cpp
dominator of an array
// 01.dominator.cpp
// juanfc 2018-02-06
#include <iostream>
#include <array>
using namespace std;
const int N = 9;
typedef array<int,N> TVec;
int dominator(TVec a);
@CarlosRA97
CarlosRA97 / 01.peaks.cpp
Created February 7, 2018 13:37 — forked from juanfal/01.peaks.cpp
Print peaks of a matrix
// 01.peaks.cpp
// juanfc 2018-02-06
#include <iostream>
#include <array>
using namespace std;
const int N = 3;
typedef array<int,N> TRow;
typedef array<TRow,N> TSqMat;