Skip to content

Instantly share code, notes, and snippets.

View renbaoshuo's full-sized avatar

Baoshuo renbaoshuo

View GitHub Profile
#include <iostream>
#include <cpuid.h>
#include <stdint.h>
#if defined(_WIN32)
#include <Windows.h>
#elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))
@renbaoshuo
renbaoshuo / clock.html
Last active December 3, 2022 13:55 — forked from sam0737/clock.html
OBS Studio: A HTML page for showing current date and time in the video
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>A simple clock</title>
</head>
<body translate="no">
<div id="output"></div>
@renbaoshuo
renbaoshuo / ssh.sh
Last active January 24, 2023 07:22
#!/bin/bash
mkdir -p ~/.ssh
curl -s https://github.com/renbaoshuo.keys >> ~/.ssh/authorized_keys
sed -i 's|[#]*PasswordAuthentication yes|PasswordAuthentication no|g' /etc/ssh/sshd_config
sed -i 's|UsePAM yes|UsePAM no|g' /etc/ssh/sshd_config
echo "PubkeyAcceptedKeyTypes=+ssh-rsa" >> /etc/ssh/sshd_config
systemctl restart ssh.service
#!/bin/bash
sed -i 's|[#]*PasswordAuthentication yes|PasswordAuthentication no|g' /etc/ssh/sshd_config
sed -i 's|UsePAM yes|UsePAM no|g' /etc/ssh/sshd_config
systemctl restart sshd.service

Keybase proof

I hereby claim:

  • I am renbaoshuo on github.
  • I am baoshuo (https://keybase.io/baoshuo) on keybase.
  • I have a public key ASD-3RpAbjDnulwlyAzozpYVe65CZwJEiPzVA0xMcvcaawo

To claim this, I am signing this object:

@renbaoshuo
renbaoshuo / archive.yml
Created November 12, 2021 11:42
Archive Site with Wayback Machine
name: Archive Site with Wayback Machine
on:
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
@renbaoshuo
renbaoshuo / codespaces.zsh-theme
Created September 8, 2021 12:14
GitHub Codespaces zsh Theme
# Codespaces zsh prompt theme
__zsh_prompt() {
local prompt_username
if [ ! -z "${GITHUB_USER}" ]; then
prompt_username="@${GITHUB_USER}"
else
prompt_username="%n"
fi
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
@renbaoshuo
renbaoshuo / getfrp.sh
Created February 10, 2021 15:08
getfrp.sh - 20210210
#!/bin/bash
if [[ "$(uname -s)" =~ "Darwin" ]]
then
red=''
green=''
yellow=''
magenta=''
cyan=''
none=''
@renbaoshuo
renbaoshuo / smms-image.py
Created December 30, 2020 13:23
Download all uploaded SMMS images.
import requests
import os
import json
import pathlib
import sys
proxy = "http://127.0.0.1:7890"
print("\nusing proxy: " + proxy + "\n\n====================\n")
proxies = {"http": proxy, "https": proxy}
@renbaoshuo
renbaoshuo / Cloudflare workers reverse proxy.js
Created December 2, 2020 17:16
Cloudflare Workers 反代网站
// Website you intended to retrieve for users.
const upstream = 'domain.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = 'domain.com'
// Countries and regions where you wish to suspend your service.