Skip to content

Instantly share code, notes, and snippets.

@lmiguelmh
lmiguelmh / gist:de477d6e5bd70ce8ee52e0191965f4f9
Created October 13, 2026 20:03
Privacy Policy - drive-sync
This is a personal, single-user utility application. It requests
read-only access to the signed-in user's Google Driver to mirror
documents to the user's own computer. It collects no analytics,
stores no user data on any server, and shares information with no
third parties. Access tokens are stored only on the user's own
machine and can be revoked at any time from the user's Google
account security settings.
@lmiguelmh
lmiguelmh / klaviyo_api_client.py
Created March 3, 2022 14:06
klaviyo_api_client.py
# coding: utf-8
# This file is a copy from Klaviyo's api_client.py without the multiprocessing module
# that means you have to use async_req=False as the argument for each call to the API
#
# For more information see the next issue posted on klaviyo's repo:
# https://github.com/klaviyo/klaviyo-python-sdk/issues/3
"""
Klaviyo API
@lmiguelmh
lmiguelmh / enable_api_gateway_api_key_for_methods.sh
Created December 9, 2021 20:09
Enable API Key for all methods on API Gateway API
#!/bin/bash
api_gateway_method_enable_api_key() {
local api_id=$1
local method_id=$2
local method=$3
aws --profile "$profile" --region "$region" \
apigateway update-method \
--rest-api-id "$api_id" \
--resource-id "$method_id" \
@lmiguelmh
lmiguelmh / Docker logs for sam local invoke
Created May 21, 2019 22:57
Docker logs for sam local invoke
-- Reboot --
may 21 16:59:47 desktop systemd[1]: Starting Docker Application Container Engine...
may 21 16:59:48 desktop dockerd[1300]: time="2019-05-21T16:59:48.068753765-05:00" level=info msg="systemd-resolved is running, so using resolvconf: /run/systemd/resolve/resolv.conf"
may 21 16:59:48 desktop dockerd[1300]: time="2019-05-21T16:59:48.099138143-05:00" level=info msg="parsed scheme: \"unix\"" module=grpc
may 21 16:59:48 desktop dockerd[1300]: time="2019-05-21T16:59:48.099158867-05:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
may 21 16:59:48 desktop dockerd[1300]: time="2019-05-21T16:59:48.099337708-05:00" level=info msg="parsed scheme: \"unix\"" module=grpc
may 21 16:59:48 desktop dockerd[1300]: time="2019-05-21T16:59:48.099354685-05:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
may 21 16:59:48 desktop dockerd[1300]: time="2019-05-21T16:59:48.099513707-05:00" level=info msg="ccResolverWrapper: sending new addres
@lmiguelmh
lmiguelmh / sam local invoke log
Created May 21, 2019 22:53
sam local invoke log
$ sam local invoke --debug PyTorchFunction -n env.json -e event.json
2019-05-21 17:44:33 Using SAM Template at <HOME>/aws-lambda/template.yaml
2019-05-21 17:44:33 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-05-21 17:44:33 Changing event name from before-call.apigateway to before-call.api-gateway
2019-05-21 17:44:33 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-05-21 17:44:33 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-05-21 17:44:33 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-05-21 17:44:33 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-05-21 17:44:33 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scalin
@lmiguelmh
lmiguelmh / opensc-debug-Windows10.log
Created May 11, 2018 16:24
pkcs11-tool test fails with: C_SignFinal failed CKR_DATA_LEN_RANGE (0x21) in Windows 7
P:2772; T:5776 2018-05-11 11:20:03.233 ===================================
P:2772; T:5776 2018-05-11 11:20:03.234 opensc version: 0.18.0
P:2772; T:5776 2018-05-11 11:20:03.235 PC/SC options: connect_exclusive=0 disconnect_action=0 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1
P:2772; T:5776 2018-05-11 11:20:03.237 [opensc-pkcs11] reader-pcsc.c:1282:pcsc_detect_readers: called
P:2772; T:5776 2018-05-11 11:20:03.238 Probing PC/SC readers
P:2772; T:5776 2018-05-11 11:20:03.239 Establish PC/SC context
P:2772; T:5776 2018-05-11 11:20:03.242 Adding new PC/SC reader 'Gemplus USB Smart Card Reader 0'
P:2772; T:5776 2018-05-11 11:20:03.243 Gemplus USB Smart Card Reader 0 check
P:2772; T:5776 2018-05-11 11:20:03.244 current state: 0x00010422
P:2772; T:5776 2018-05-11 11:20:03.245 previous state: 0x00000000
@lmiguelmh
lmiguelmh / opensc-debug.log
Created May 11, 2018 16:13
pkcs11-tool test fails with: C_SignFinal failed CKR_DATA_LEN_RANGE (0x21) in Windows 7
P:4700; T:616 2018-05-11 10:31:40.812 ===================================
P:4700; T:616 2018-05-11 10:31:40.812 opensc version: 0.18.0
P:4700; T:616 2018-05-11 10:31:40.812 PC/SC options: connect_exclusive=0 disconnect_action=0 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1
P:4700; T:616 2018-05-11 10:31:40.812 [opensc-pkcs11] reader-pcsc.c:1282:pcsc_detect_readers: called
P:4700; T:616 2018-05-11 10:31:40.828 Probing PC/SC readers
P:4700; T:616 2018-05-11 10:31:40.828 Establish PC/SC context
P:4700; T:616 2018-05-11 10:31:40.828 Adding new PC/SC reader 'Gemplus USB SmartCard Reader 0'
P:4700; T:616 2018-05-11 10:31:40.828 Gemplus USB SmartCard Reader 0 check
P:4700; T:616 2018-05-11 10:31:40.828 current state: 0x00010122
P:4700; T:616 2018-05-11 10:31:40.828 previous state: 0x00000000
@lmiguelmh
lmiguelmh / gist:77a6b8c51dafa42bdeab8e1c98bc7c15
Created November 14, 2017 21:54
Contents of EF 3F0050157002
C:\Program Files\OpenSC Project\OpenSC\tools>opensc-explorer.exe -m 3F00
OpenSC Explorer version 0.17.0
Using reader with a card: Gemplus USB Smart Card Reader 0
OpenSC [3F00]> cd 5015
OpenSC [3F00/5015]> cat 7002
00000000: 30 73 30 4B 0C 1E 43 6C 61 76 65 20 50 72 69 76 0s0K..Clave Priv
00000010: 61 64 61 20 64 65 20 41 75 74 65 6E 74 69 63 61 ada de Autentica
00000020: 63 69 6F 6E 03 02 06 C0 04 01 01 30 22 30 0A 03 cion.......0"0..
00000030: 02 06 40 30 04 03 02 05 20 30 0A 03 02 04 10 30 ..@0.... 0.....0
00000040: 04 03 02 05 20 30 08 03 03 06 00 40 04 01 01 30 .... 0.....@...0
@lmiguelmh
lmiguelmh / gist:04203c713ed441a04ba316dfd20fa30d
Created November 14, 2017 15:57
Log for OpenSC with the verification of the mechanism disabled
C:\Program Files\OpenSC Project\OpenSC\tools>pkcs11-tool.exe --module "C:\Program Files\OpenSC Project\OpenSC\pkcs11\opensc-pkcs11.dll" -v -s -m SHA256-RSA-PKCS --id 02 --slot 1 --pin 112233 -i test.txt -o test.signed.txt
Using slot with ID 0x1
Using signature algorithm SHA256-RSA-PKCS
-END-
**opencs-debug.log**
2017-11-13 15:41:32.061 ===================================
2017-11-13 15:41:32.063 opensc version: 0.17.0
2017-11-13 15:41:32.064 PC/SC options: connect_exclusive=0 disconnect_action=1 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1
@lmiguelmh
lmiguelmh / gist:c7fe8b31e66fecab602125bec156684e
Last active November 15, 2017 16:20
RAW dump of the EF.TokenInfo (path 3f0050155032) from an Oberthur ID-One Cosmo v7 (AuthentIC 3.2.2) smart card
C:\Program Files\OpenSC Project\OpenSC\tools>opensc-explorer.exe -v -m 3F00
OpenSC Explorer version 0.17.0
Using reader with a card: Gemplus USB Smart Card Reader 0
OpenSC [3F00]> cd 5015
OpenSC [3F00/5015]> cat 5032
00000000: 30 82 02 E5 02 01 01 0C 15 4F 62 65 72 74 68 75 0........Oberthu
00000010: 72 20 54 65 63 68 6E 6F 6C 6F 67 69 65 73 80 06 r Technologies..
00000020: 4F 54 20 41 57 50 03 02 05 60 A2 82 02 A8 30 17 OT AWP...`....0.
00000030: 02 01 01 02 02 02 20 05 00 03 02 01 02 06 05 2B ...... ........+
00000040: 0E 03 02 1A 02 01 01 30 1A 02 01 02 02 01 00 05 .......0........