Skip to content

Instantly share code, notes, and snippets.

@Pastor
Pastor / git-config-http-version.md
Created April 26, 2024 13:54 — forked from daopk/git-config-http-version.md
Fix error : RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
git config --global http.version HTTP/1.1
git config --global http.postBuffer 157286400
@Pastor
Pastor / cgo1.go
Created February 21, 2024 14:15 — forked from tejainece/cgo1.go
Examples of calling C code from Golang
package main
//#include<stdio.h>
//void inC() {
// printf("I am in C code now!\n");
//}
import "C"
import "fmt"
func main() {
@Pastor
Pastor / jwt_fast_api.py
Created April 14, 2023 08:25 — forked from jgontrum/jwt_fast_api.py
JWT & FastAPI
import os
from typing import Dict, List, Optional
import requests
from jose import jwt, jwk
from jose.utils import base64url_decode
JWK = Dict[str, str]
JWKS = Dict[str, List[JWK]]
@Pastor
Pastor / spin.md
Created May 7, 2022 20:23 — forked from hadisfr/spin.md
How to Use SPIN Model Checker

How to Use SPIN

Run Verifier

It's possible to use spin -a src.pml to create pan.[cbhmt] files. Then, it's possible to compile the generated verifier using gcc -o pan pan.c. The compiler verifier could be run by ./pan. spin -run src.pml automates the whole process.

Rerun After Failure

@Pastor
Pastor / msys2-SDL2-Setup.md
Created September 17, 2021 20:37 — forked from thales17/msys2-SDL2-Setup.md
msys2 sdl2 setup

Download and install msys2 64bit

Update msys2

  • Update msys2 64bit after install by running pacman -Syu if pacman needs to be updated you might have to close and reopen the terminal and run pacman -Syu again

Install build tools

  • pacman -S git mingw-w64-x86_64-toolchain mingw64/mingw-w64-x86_64-SDL2 mingw64/mingw-w64-x86_64-SDL2_mixer mingw64/mingw-w64-x86_64-SDL2_image mingw64/mingw-w64-x86_64-SDL2_ttf mingw64/mingw-w64-x86_64-SDL2_net mingw64/mingw-w64-x86_64-cmake make

Compile Hello World

@Pastor
Pastor / KeycloakAdminClientExample.java
Created April 21, 2021 21:15 — forked from thomasdarimont/KeycloakAdminClientExample.java
Using Keycloak Admin Client to create user with roles (Realm and Client level)
package demo.plain;
import org.keycloak.OAuth2Constants;
import org.keycloak.admin.client.CreatedResponseUtil;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.admin.client.resource.RealmResource;
import org.keycloak.admin.client.resource.UserResource;
import org.keycloak.admin.client.resource.UsersResource;
import org.keycloak.representations.idm.ClientRepresentation;
@Pastor
Pastor / ROS_Kinetic_macOS_High_Sierra.txt
Created April 8, 2021 20:39 — forked from stela/ROS_Kinetic_macOS_High_Sierra.txt
A step by step installation of ROS Kinetic on macOS 10.13.4 High Sierra
# A step by step installation of ROS Kinetic on macOS 10.13.4 High Sierra
# Similar in spirit to https://gist.github.com/lubiluk/361a018b267ca4e3ce10cdc68b17363d but for Kinetic and High Sierra.
#
# Assumptions:
# You already installed:
# homebrew
# XCode 9.3 (or in case you want to build CUDA, use CUDA 9.1 with XCode 9.2)
# Remove any anaconda, conda or similar from your path
# You're not afraid of the command line and can deal with potentially incomplete instructions like this file
#
@Pastor
Pastor / rn2483-linux
Created November 26, 2020 15:34 — forked from leon-anavi/rn2483-linux
Controlling RN2483 using minicom from GNU/Linux distribution
1. run:
sudo minicom -s
2. Go to "Serial port setup" and set:
Serial Device: /dev/ttyUSB0
Bps/Par/Bits : 57600 8N1
Hardware Flow Control : No
Software Flow Control : No
3. Select Exit to exit configurations and to enter minicom
4. Press Ctrl+A Z
5. Press E to enable local Echo
@Pastor
Pastor / uart-tx.v
Created March 8, 2020 17:38 — forked from xigh/uart-tx.v
tinyfpga fpga uart tx hello world verilog
module top(
input CLK,
output USBPU,
output PIN_24,
);
assign USBPU = 0; // disable USB
wire clk115200hz;
dclk0 d0(.clk16mhz(CLK), .clk115200hz(clk115200hz));