Skip to content

Instantly share code, notes, and snippets.

@lcc-321
lcc-321 / ap.rb
Last active April 18, 2017 14:15
#!/usr/bin/ruby
Thread.new { system "create_ap wlp12s0 enp9s0 lc_wlan lc123789 >/dev/null 2>&1" }
999.times.each {
break if `ifconfig | grep ap0`.length != 0
sleep 1
}
@lcc-321
lcc-321 / extend_300.js
Last active August 11, 2019 10:57
telegram 狼人杀群的自动续命脚本,续满5人就不续了,并且会自动删除多余的续命消息(避免影响正常聊天),以及清理过多的历史记录(节约内存)
var all_msgs = () => { return $(".im_history_message_wrap:visible"); };
var send = (cmd) => { $(".composer_rich_textarea").text(cmd); $(".im_submit").mousedown(); };
var ex_text = "/extend 299";
var ex_regexp = new RegExp(ex_text);
var own_regexp = /lccc/;
var del_regexp = new RegExp(ex_text + "|延長 299 秒|剩餘 \\d+ 秒|剩餘一分鐘");
(async function work() {
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/liuchong/.zshrc'
# End of lines added by compinstall
require "http/client"
sum = 0
100.times {
spawn {
10000.times {
HTTP::Client.get("http://127.0.0.1/") { |res| sum += 1 }
}
}
@lcc-321
lcc-321 / README.md
Last active November 10, 2021 15:29
COVID-19 cases table generator