Skip to content

Instantly share code, notes, and snippets.

@rampageX
rampageX / HDD_StandBy_Check.bat
Last active August 29, 2024 14:56
This program will run "smartctl.exe -n standby X:" on all HDD drives in an unattended manner.
:: BatchGotAdmin <https://sites.google.com/site/eneerge/scripts/batchgotadmin>
:-------------------------------------
@echo off
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
@rampageX
rampageX / Replace_Notepad_Win11.cmd
Created February 12, 2022 13:43
replace notepad with notepad2/notepad3/notepad++ on Windows11
@ECHO OFF & CLS & ECHO.
NET FILE 1>NUL 2>NUL & IF ERRORLEVEL 1 (ECHO You must right-click and select & ECHO "RUN AS ADMINISTRATOR" to run this batch. Exiting... & ECHO. & Timeout /t 10 & EXIT /B)
REM ... proceed here with admin rights ...
REM http://stackoverflow.com/questions/7044985/how-can-i-auto-elevate-my-batch-file-so-that-it-requests-from-uac-administrator
SETLOCAL
::
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /t REG_SZ /d "\"%~dp0Notepad3.exe\" /z" /f
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\0" /v "FilterFullPath" /t REG_SZ /d "\"%~dp0Notepad3.exe\" /f
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\1" /v "FilterFullPath" /t REG_SZ /d "\"%~dp0Notepad3.exe\" /f
@rampageX
rampageX / openssl_speed_aes-128-cbc
Created February 5, 2022 01:13
some hardware openssl speed test
openssl speed -multi 4 aes-128-cbc
#Netgear R6700V3 Broadcom BCM4708C0 (1 GHz, 2 cores)
OpenSSL 1.1.1l 24 Aug 2021
built on: Tue Sep 21 03:53:56 2021 UTC
options:bn(64,32) rc4(char) des(long) aes(partial) idea(int) blowfish(ptr)
compiler: distcc arm-linux-gcc -fPIC -pthread -Wa,--noexecstack -Wall -O3 -march=armv7-a -mtune=cortex-a9 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DZLIB -DNDEBUG -I/mmc/include -DOPENSSL_PREFER_CHACHA_OVER_GCM
aes-128 cbc 60405.84k 71259.72k 72525.55k 73877.76k 74127.67k 74700.12k
#Netgear R7800 Qualcomm IPQ8065 (1.7 GHz, 2 cores)
@rampageX
rampageX / ExportNetEaseMusicSongList.js
Created January 29, 2022 13:08 — forked from tianshuo/ExportNetEaseMusicSongList.js
导出网易云音乐歌单到 AppleMusic / Spotify 等平台
/**
* 使用方法:
* 1. 用 Chrome 打开歌单的 web 页面(可以通过分享拿到链接,链接类似这样:http://music.163.com/playlist?id=xxx&userid=yyy)
* 2. 然后右键“检查”(如果有左上角有 device 选项,需要选择 Laptop 开头的,可以在 Edit/编辑 里添加)
* 3. 在 console 里输入下面脚本,即可输出 “歌曲名 - 歌手名” 格式的内容:
Springsteen - Eric Church
Chattahoochee - Alan Jackson
Baby Now That I Found You - Alison Krauss
Check Yes or No - George Strait
@rampageX
rampageX / mosdns_public.yaml
Created December 25, 2021 03:03
mosdns public config for v2.x
log:
level: error # 日志级别。可选 `debug` `info` `warn` `error`。默认 `info`。
file: "/var/log/mosdns.log" # 记录日志到文件。
#level: debug
#file: ""
plugin:
## 启动 sequence 服务器 DoT
# - tag: dot_server
# type: server
@rampageX
rampageX / nginx_aarch64_static
Last active October 29, 2021 02:04
Build Static Nginx aarch64 Binary
#!/bin/sh
#Build Static Nginx aarch64 Binary
PCRE_TAG=8.45
OPENSSL_TAG=3.0.0
ZLIB_TAG=1.2.11
LIBATOMIC_OPS_TAG=7.6.12
NGINX_TAG=1.21.3
STANDARD="c++17"
@rampageX
rampageX / nginx-tuning.md
Created September 29, 2021 21:59 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@rampageX
rampageX / Cross_Build_Static_Ubound
Created August 11, 2021 13:59
Cross Build Static aarch64 Ubound Binary on Alpine x86_x64
#!/bin/sh
set -e
OPENSSL_TAG=OpenSSL_1_1_1k
LIBEXPAT_TAG=R_2_4_1
LIBEVENT_TAG=release-2.1.12-stable
LIBSODIUM_TAG=1.0.18-RELEASE
STANDARD="c++17"
RESULT="`pwd`/result"
@rampageX
rampageX / Cross_Build_Static_Tor
Last active March 23, 2022 06:24
Cross Build Static aarch64 Tor Binary on Alpine x86_x64
#!/bin/sh
#Cross Build Static aarch64 Tor Binary on Alpine x86_x64
install_dir="`pwd`/aarch64"
include_dir="${install_dir}/include"
lib_dir="${install_dir}/lib"
custom_flags_set() {
CPPFLAGS="--static -static -I${include_dir}"
@rampageX
rampageX / mosdns.yaml
Last active December 25, 2021 03:01
mosdns local config for v2.x
log:
# level: error # 日志级别。可选 `debug` `info` `warn` `error`。默认 `info`。
# file: "/var/log/mosdns.log" # 记录日志到文件。
level: debug
file: ""
plugin:
## 启动 sequence 服务器
- tag: sequence_server
type: server