Skip to content

Instantly share code, notes, and snippets.

View akinazuki's full-sized avatar
🐟
Fish-touching

秋 奈月 akinazuki

🐟
Fish-touching
View GitHub Profile
### Keybase proof
I hereby claim:
* I am akinazuki on github.
* I am akinazuki (https://keybase.io/akinazuki) on keybase.
* I have a public key ASCkki5WGdZcQ7IhbUPL8u-0nJrvfFectE9b28Uu0eoFWAo
To claim this, I am signing this object:
@akinazuki
akinazuki / openvpn-1password.sh
Last active October 13, 2022 14:36
Authenicating OpenVPN via 1Password
#!/bin/bash
credentials_temp_fifo_file=/tmp/.$$-credentials.pipe
openvpn_temp_fifo_file=/tmp/.$$-openvpn.pipe
mkfifo $credentials_temp_fifo_file
default_op_path='op://empty/item' # 1Password item path
openvpn_exists=$(which openvpn)
op_cli_exists=$(which op)
if [ -z "$openvpn_exists" ]; then
echo "OpenVPN CLI not found. Please install OpenVPN."
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'qyh'
__date__ = '2018/10/16 9:22'
import binascii
from importlib.resources import path
from ntpath import join
import struct
import base64

Require Library pexpect

Run pip install pexpect to install it
import java.util.Base64;
class Main {
public static String key = "Encrypt";
public static void main(String[] args) {
if (args[0].equals("decrypt")) {
System.out.println(decrypt(args[1]));;
}else{
System.out.println(encrypt(args[1]));
tls = require('tls');
// callback for when secure connection established
function connected(stream) {
if (stream) {
// socket connected
stream.write("GET / HTTP/1.0\n\rHost: encrypted.google.com:443\n\r\n\r");
} else {
console.log("Connection failed");
}
@akinazuki
akinazuki / 1.3_LCD_HAT_install.md
Created March 23, 2019 14:49 — forked from JdaieLin/1.3_LCD_HAT_install.md
Install waveshare 1.3 LCD HAT on Raspbian

在树莓派上点亮微雪1.3寸LCD HAT所需的安装步骤,重新梳理了一下安装顺序。

使用最新Raspbian镜像,联网进行安装。

安装 WiringPi

cd ~
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build
@akinazuki
akinazuki / SIM900_Chatscript
Created March 23, 2019 11:08 — forked from me-no-dev/SIM900_Chatscript
PPP connection settings for Linux and SIM900
#save as /etc/chatscripts/sim900
ABORT "BUSY"
ABORT "VOICE"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "NO DIAL TONE"
ABORT "NO ANSWER"
ABORT "DELAYED"
REPORT "CONNECT"
TIMEOUT 6

接口公共路由

https://api.satori.moe/v2/{action}/{method}.json

Hitokoto / 一言

<?php
class JSON {
public static function Decode($string, $return_array = false, $depth = 512, $options = 0) {
$res = json_decode($string, $return_array, $depth, $options);
if (json_last_error() !== JSON_ERROR_NONE) {
throw new Exception(json_last_error(), json_last_error_msg());
}
return $res;
}
public static function Encode($array, $options = 0, $depth = 512) {