Skip to content

Instantly share code, notes, and snippets.

View simbafs's full-sized avatar

SimbaFs simbafs

View GitHub Profile
@simbafs
simbafs / README.md
Last active September 20, 2023 14:32
免費用 quizlet
@simbafs
simbafs / README.md
Created August 3, 2023 07:03
Crawler and Telegram bot to monitor NCKU course system

程式解說

如何開發:

整個程式分成兩個部份,首先是主要部份,網路爬蟲,會根據儲存的目標定期去選課系統抓指定課程剩餘人數,如果有變化就會通知使用者
第二部份是使用者界面,telegram 聊天機器人,透過指令的方式可以新增、刪除、列出要監聽的頁面跟指定欄位
這個聊天機器人支援多使用者,各自的資料不會互相影響,是分開儲存的

如何使用:

打開 Telegram,找到機器人 https://t.me/nckubot ,使用指令 /listen <url> [selector] 新增一筆紀錄,接著機器人就會每隔一段時間去抓看看有沒有變更

@simbafs
simbafs / ipfs.sh
Last active August 30, 2022 09:04
#!/bin/bash
# author: simbafs
# date: 2022-08-30
# MIT License
IPFS="${IPFS:-$(which ipfs)}"
KEY="${KEY:-q8s}"
# this line will be changed by the script
PKEY="${PKEY:-"k51qzi5uqu5dg9y6e55vjfb583rdoshtko6qizgk7nde9ybm9gyor5ujpfb9m2"}"
DIR="${DIR:-.}"
@simbafs
simbafs / .tmux.conf
Last active August 17, 2021 08:15
tmux configure file
# example: /usr/share/doc/tmux/examples/
# {{{ screen-keys.conf
# $Id: screen-keys.conf,v 1.7 2010/07/31 11:39:13 nicm Exp $
#
# By Nicholas Marriott. Public domain.
#
# This configuration file binds many of the common GNU screen key bindings to
# appropriate tmux key bindings. Note that for some key bindings there is no
# tmux analogue and also that this set omits binding some commands available in
# tmux but not in screen.
@simbafs
simbafs / scrcpy.sh
Last active June 14, 2021 07:11
scrcpy.sh
#!/bin/bash
# credit: simba-fs
#
# color
BLUE='\033[1;34m'
NC='\033[0m' # No Color
wireless=0
ip=192.168.43.1
name: Hexo
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
ifconfig | egrep 'inet ' | sed 's/ inet //' | sed 's/ netmask .*//'
declare -a cmd;
cmd+=('sudo apt update')
cmd+=('sudo apt install -y nmap net-tools mtr')
for i in ${!cmd[@]};do
echo "> ${cmd[$i]}"
${cmd[$i]}
done
#include <iostream>
#include <vector>
using namespace std;
int main(){
int _n;
cin >> _n;
for(int _i; _i < _n; _i++){
int data[1005][1005] = {{}};
#include <iostream>
#include <vector>
using namespace std;
int main(){
int _n;
cin >> _n;
for(int _i; _i < _n; _i++){
int data[1005][1005] = {{}};