Skip to content

Instantly share code, notes, and snippets.

View jimmy947788's full-sized avatar
🙄
faping

吉掰米 jimmy947788 jimmy947788

🙄
faping
View GitHub Profile
@jimmy947788
jimmy947788 / gnuk-on-stlinkv2.sh
Created August 14, 2023 18:15 — forked from sowbug/gnuk-on-stlinkv2.sh
Gnuk on ST-Link v2
# https://github.com/cabo/stlink
# https://blog.danman.eu/2-usb-crypto-token-for-use-with-gpg-and-ssh/
sudo ./upgrade_by_passwd.py -f ../regnual/regnual.bin ../src/build/gnuk-vidpid.bin
sudo st-flash erase && st-flash --reset write ~/src/gnuk/src/build/gnuk-vidpid.bin 0x08000000
-- or --
~/src/stlink/build/Debug/st-flash reset && \
~/src/stlink/build/Debug/st-flash erase && \
@jimmy947788
jimmy947788 / openssl_commands.md
Created July 2, 2023 17:19 — forked from Hakky54/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
version: "3.7"
volumes:
kong_data: {}
networks:
kong-net:
services:
#!/bin/bash
CANAME=$1
#CANAME=Daedalus
if [[ -z "$CANAME" ]]; then
echo "Usage: $0 <CA name>"
exit 1
fi
# optional, create a directory
@jimmy947788
jimmy947788 / client.py
Created December 3, 2022 14:52 — forked from dbehnke/client.py
Python AsyncIO Client and Server Example using StreamReader and StreamWriter
"""
client.py - AsyncIO Server using StreamReader and StreamWriter
This will create 200 client connections to a server running server.py
It will handshake and run similar to this:
Server: HELLO
Client: WORLD
@jimmy947788
jimmy947788 / .env
Last active December 2, 2022 18:39
docker-comose template
COMPOSE_PROJECT_NAME=myproject
# Redis
REDIS_HOSTNAME=redisdb.local
REDIS_PORT=6379
REDIS_PASSWORD=
# Rabbitmq
RABBITMQ_HOSTNAME=rabbitmq.local
RABBITMQ_USERNAME=root
@jimmy947788
jimmy947788 / LoggerConfig.py
Last active January 4, 2023 05:28
python 常用程式碼
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import logging
import logging.config
import os
import config
LOGGING_CONFIG = {
"version": 1,
@jimmy947788
jimmy947788 / sockets.h
Created November 26, 2022 08:17 — forked from willeccles/sockets.h
Cross-platform socket header for both POSIX sockets and Winsock
/*
* File: sockets.h
* Author: Will Eccles
* Date: 2020-03-12
*
* 1. Description
*
* This header attempts to make it easy to use sockets across platforms,
* for both Windows and POSIX systems. While Winsock is often somewhat
* compatible with Berkeley sockets, it is not strictly compatible,
@jimmy947788
jimmy947788 / gist:11b23d863100ac600f0d9d0b1d1f0b8a
Last active October 2, 2022 09:36
python version change by update-alternatives
We couldn’t find that file to show.

Redis 支援JSON

預先準備

  1. 安裝redis

    sudo apt update -y
    sudo apt-get install libclang-dev -y
    # reload daemon first
    sudo systemctl daemon-reload