Skip to content

Instantly share code, notes, and snippets.

View ssrlive's full-sized avatar

ssrlive

  • telegram: realssrlive
  • ssrlivebox(at)gmail(dot)com
View GitHub Profile
@ssrlive
ssrlive / ibmcloud.sh
Last active October 14, 2020 01:54
IBM cloud install script
#!/bin/bash
ssr_dir=""
config_file=""
curr_path=""
password=""
ssrot_path=""
svr_listen_port=""
cli_conn_port=""
IBM_APP_NAME=""
@ssrlive
ssrlive / jq-test.html
Created September 22, 2020 06:52
jQuery usage
<!DOCTYPE html>
<head>
<title>jquery tutorial</title>
<script src="https://cdn.staticfile.org/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdn.staticfile.org/jqueryui/1.12.1/themes/base/jquery-ui.css"/>
<script src="https://cdn.staticfile.org/jqueryui/1.12.1/jquery-ui.min.js"></script>
</head>
<body>
<h1>just a test for jquery</h1>
@ssrlive
ssrlive / euserv.md
Last active January 14, 2022 13:08
EUServ tips

EUserv 的坑

首先编辑 /etc/resolv.conf,删除现有的 nameserver,添加以下 nameserver。这是为了能访问 IPv4 地址。

nameserver 2a09:11c0:f1:bbf0::70
nameserver 2001:67c:2b0::4
nameserver 2001:67c:2b0::6
@ssrlive
ssrlive / test_getaddrinfo.c
Created October 5, 2020 08:50
test getaddrinfo
#include <stdlib.h>
#include <netdb.h>
#include <netinet/in.h>
#include <stdio.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <assert.h>
#ifndef NI_MAXHOST
#define NI_MAXHOST 1025
@ssrlive
ssrlive / net_change.c
Created November 4, 2020 10:55
monitor windows network status
#include <winsock2.h>
#include <iphlpapi.h>
#include <stdio.h>
#include <windows.h>
#pragma comment(lib, "iphlpapi.lib")
#pragma comment(lib, "ws2_32.lib")
void main()
{
@ssrlive
ssrlive / checkablegroupbox.c
Last active November 30, 2020 03:07
A GroupBox control with a CheckBox: CheckableGroupBox class for Windows
#include <Windows.h>
#include <WindowsX.h>
#include <commctrl.h>
#include <assert.h>
#include "checkablegroupbox.h"
#pragma comment(lib, "Comctl32.lib")
#define ID_CHECKBOX 0xFFFE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <uv.h>
uv_loop_t *loop;
typedef struct {
uv_write_t req;
uv_buf_t buf;
@echo off
@setlocal EnableDelayedExpansion
cd /d "%~dp0"
::--- need config ---
:: to check interface index run> netsh int ipv4 show interfaces "Wi-Fi"
:: or change Wi-Fi to your interface name
set gwIP=XXX.XXX.XXX.XXX
set gwIndex=X
set proxyIp=XXX.XXX.XXX.XXX
@ssrlive
ssrlive / git_submodule_remove.md
Created August 25, 2021 02:42
How to remove a submodule of git

How to remove a submodule you need to:

  • Run git rm --cached path_to_submodule (no trailing slash).
  • Delete the now untracked submodule files by run rm -rf path_to_submodule
  • Run rm -rf .git/modules/path_to_submodule
  • Delete the relevant section from the .gitmodules file.
  • Delete the relevant section from .git/config.
  • Stage the .gitmodules changes git add .gitmodules
  • Commit git commit -m "Removed submodule <name>"
@ssrlive
ssrlive / tp.sh
Last active July 3, 2023 04:27
Transparent proxy in Linux
#!/bin/bash
# SOCKS5 服务器的 IP 地址
REMOTE_SERVER_IP=
# 本地 SOCKS5 服务器的端口
LOCAL_LISTEN_PORT=0
# 自动获取家用网关(路由器)的 IP 地址,你也可以手动指定,如 192.168.28.2
REAL_GATEWAY=$(ip route | grep "default .* dhcp" | awk '{print $3}')