Skip to content

Instantly share code, notes, and snippets.

View shionryuu's full-sized avatar
😪
I may be slow to respond.

shionryuu

😪
I may be slow to respond.
View GitHub Profile
@shionryuu
shionryuu / suyu.md
Last active March 31, 2024 08:12
Suyu v0.0.1 libappimage integrate fail
$ sha256sum Suyu-Linux_x86_64.AppImage
176313966d0e81c13f9b31304bb009e149282e51f27f7b539d2f454512d3e509  Suyu-Linux_x86_64.AppImage
$ ail-cli integrate ./Suyu-Linux_x86_64.AppImage
Processing /home/xxxx/Applications/Suyu-Linux_x86_64.AppImage
Moving AppImage to integration directory
ERROR: appimage_register_in_system : Entry doesn't exists: org.suyu_emu.suyu.desktop
Error: Failed to register AppImage in system via libappimage
$ chmod +x ./Suyu-Linux_x86_64_d949365ea94fd9fad8e9d572fcdc67da.AppImage
$ ./Suyu_d949365ea94fd9fad8e9d572fcdc67da.AppImage --appimage-extract | grep org.suyu_emu.suyu.desktop
@shionryuu
shionryuu / Merry Christmas & Happy New Year
Created March 26, 2023 02:50
ASCII Text Art - Merry Christmas & Happy New Year
* .  * .' * ★ *  '*   *
*  . '  +:..:+   '  '  *
.   *  ☆☆☆ *   .
  *  ' +:...+....:+  *
'    ' ☆☆☆☆☆   * '  
 * * ' +:...:+@+:...:+    '  *
* .  .☆☆☆☆☆☆☆ * ' * .
  .  +:..:+&+:...:+:...:+
 * . ☆☆☆☆☆☆☆☆☆ * '   *
' .  +:...:+♡+:...:+§+:..:+
@shionryuu
shionryuu / quicksort.rkt
Created January 25, 2023 08:14
Quick Sort in Racket
#lang racket
; author ka__ka__
(define (quick-sort array)
(cond
[(empty? array) empty] ; 快排的思想是分治+递归
[else (append
(quick-sort (filter (lambda (x) (< x (first array))) array)) ; 这里的 array 就是闭包
(filter (lambda (x) (= x (first array))) array)
(quick-sort (filter (lambda (x) (> x (first array))) array)))]))
@shionryuu
shionryuu / install_mongodb.sh
Created January 13, 2023 17:47
Installing mongodb over Ubuntu 22.04
#!/bin/bash
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mongodb.gpg > /dev/null
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt update
sudo apt install mongodb-org
@shionryuu
shionryuu / Makefile
Created September 3, 2022 10:37
ArchLinux install todesk-bin 4.1.0
all:
@makepkg -si
@shionryuu
shionryuu / line-segment-intersection.py
Created August 20, 2022 15:35
Check if two line segments intersect
#!/usr/bin/python
#
# Notes on intersection:
#
# https://bryceboe.com/2006/10/23/line-segment-intersection-algorithm/
#
# https://stackoverflow.com/questions/3838329/how-can-i-check-if-two-segments-intersect
#
# Permalink:
#
#!/usr/bin/env bash
function register_gcc_version {
local version=$1
local priority=$2
update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-${version} ${priority} \
--slave /usr/bin/c++ c++ /usr/bin/g++-${version} \
--slave /usr/bin/g++ g++ /usr/bin/g++-${version} \
@shionryuu
shionryuu / compile_log.md
Created March 5, 2022 03:45
OTP 25.0-rc1 Internal consistency check failed

compile mysql-otp failed, relate to issue

$ erl +Version
Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 13.0
$ rebar3 version
rebar 3.18.0 on Erlang/OTP 25 Erts 13.0
$ rebar3 compile
===> Verifying dependencies...
===&gt; Analyzing applications...
#!/bin/bash
function __curl() {
read proto server path <<<$(echo ${1//// })
DOC=/${path// //}
HOST=${server//:*}
PORT=${server//*:}
[[ x"${HOST}" == x"${PORT}" ]] && PORT=80
exec 3<>/dev/tcp/${HOST}/$PORT
@shionryuu
shionryuu / host
Created August 24, 2021 15:42
修改Hosts文件屏蔽MSN中国版
# 修改Hosts文件屏蔽MSN中国版
# 来源:蓝点网 https://landian.vip/archives/90312.html
# 屏蔽Microsoft Edge启动页广告
0.0.0.0 c.msn.com
0.0.0.0 ntp.msn.com
0.0.0.0 ntp.msn.cn
0.0.0.0 assets.msn.cn
0.0.0.0 api.msn.com
0.0.0.0 browser.events.data.msn.com
0.0.0.0 img-s-msn-com.akamaized.net