Skip to content

Instantly share code, notes, and snippets.

View moonsn's full-sized avatar
🎯
Focusing

Moonsn moonsn

🎯
Focusing
View GitHub Profile
@moonsn
moonsn / mikrotik_container_adguardhome.txt
Created May 13, 2025 04:39 — forked from kangarie/mikrotik_container_adguardhome.txt
mikrotik container adguard home script installation
/system/device-mode/update container=yes
/interface veth add address=172.17.0.1/24 gateway=172.17.0.254 name=agh
/interface bridge add name=dockers
/interface bridge port add bridge=dockers interface=agh
/ip address add address=172.17.0.254/24 interface=dockers network=172.17.0.0
/ip firewall nat add action=masquerade chain=srcnat
/container config set registry-url=https://registry-1.docker.io tmpdir=/disk1/tmp
@moonsn
moonsn / s.json
Last active October 17, 2024 05:13
{
"servers": [
{
"name": "s1",
"address": "https://anisette-v3-server-e1ug.onrender.com"
},
{
"name": "s2",
"address": "http://103.237.28.56:6969"
}
@moonsn
moonsn / conf
Created September 5, 2018 12:11
tmux.conf
# from http://endot.org/2011/12/06/my-tmux-configuration/
# keybindings to make resizing easier
bind -r C-h resize-pane -L
bind -r C-j resize-pane -D
bind -r C-k resize-pane -U
bind -r C-l resize-pane -R
# VI keybindings
setw -g mode-keys vi
@moonsn
moonsn / a.cpp
Created March 3, 2017 07:17
这段代码有 bug。。思路是这样。O(n)
#include <iostream>
#include <cstdio>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
const int maxn = 10000 + 5;
int a[maxn];
map<int, int> idx_array;
@moonsn
moonsn / iustudio_spider.php
Created December 21, 2016 12:31
发现个 iu 妹纸的图站,果断全站拔下来。。。
<?php
// author: moonsn
// desc: 发现个 iu 妹纸的图站,果断全站拔下来。。。
echo "iustudio images saver\n";
for($i = 1; $i < 35; $i++) {
$list_url = "http://iustudio.tistory.com/category/?page=$i";
echo "get_list: $list_url\n";
@moonsn
moonsn / bqsort.cpp
Created April 16, 2016 13:30
bad qsort
#include <iostream>
using namespace std;
int partition(int *a, int l, int r){
int i = l,j = r;
int p = a[r];
while(1) {
while(a[i] < p) i++;
struct User;
struct relationship {
User *user1, *user2;
unsigned int type; // 微信 1;QQ 2;帮派 4;游戏好友 8
};
using relationship_user = pair<User*, unsigned int>;
int calculate_relationship_value(const relationship_user& r) {