[{"content":"Some notes for Apache CGI programs on Ubuntu 22.04.4 LTS.\nApache config LoadModule cgid_module modules/mod_cgid.so ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ \u0026lt;Directory \u0026#34;/usr/lib/cgi-bin\u0026#34;\u0026gt; AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch AuthType Basic AuthBasicProvider file AuthUserFile \u0026#34;/path/passwd.file\u0026#34; Require valid-user \u0026lt;/Directory\u0026gt; CGI program #!/bin/bash # bash script for CGI echo \u0026#34;Content-type: text/html\u0026#34; echo \u0026#34;\u0026#34; echo \u0026#34;Output:\u0026#34; sudo -u $USER $EXEC 2\u0026gt;\u0026amp;1 exit 0 The CGI program uses sudo to modify other user files.\n# /etc/sudoers or /etc/sudoers.d/www-data www-data ALL = ($USER) NOPASSWD: $EXEC Reference https://httpd.apache.org/docs/2.4/howto/cgi.html https://www.sudo.ws/docs/man/sudoers.man/ ","permalink":"https://blog.gani.win/posts/cgi/","summary":"Some notes for Apache CGI programs.","title":"Apache with CGI"},{"content":"Introduction Use OpenSSH and Ncat to run AutoHotkey remotely in Windows 10.\nServer You need install OpenSSH server, AutoHotkey and Ncat from the Nmap Project.\nChocolatey Run PowerShell as an Administrator to install Chocolatey and other tools.\n# Install Chocolatey Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(\u0026#39;https://community.chocolatey.org/install.ps1\u0026#39;)) # Install the tools with Chocolatey choco install autohotkey choco install nmap OpenSSH Run PowerShell as an Administrator.\n# Install the OpenSSH Server Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 # Start the sshd service Start-Service sshd # OPTIONAL but recommended: Set-Service -Name sshd -StartupType \u0026#39;Automatic\u0026#39; # Get the public key generated on your client $clientPublicKey = \u0026#34;****************\u0026#34; # Copy the public key to the administrators_authorized_keys file Add-Content -Force -Path $env:ProgramData\\ssh\\administrators_authorized_keys -Value \u0026#34;$clientPublicKey\u0026#34; icacls.exe $env:ProgramData\\ssh\\administrators_authorized_keys /inheritance:r /grant Administrators:F /grant SYSTEM:F Ncat Run ncat to listen and execute ahk.exe after establishing a connection. ahk.exe is the executable file which is compiled from the AutoHotkey Script.\nncat --keep-open --listen --exec ahk.exe 127.0.0.1 12345 Client If the client has PowerShell, you can follow this article to upload the client public key file to the server.\nMy client is Home Assistant Add-on: Terminal \u0026amp; SSH. Use tmux and ssh to access the ncat server to run the executable file ahk.exe. The option --idle-timeout 10 is used for the lifetime of ahk.exe. When ncat stops, ahk.exe will also stop.\n#!/bin/bash tmux new -d -s remote tmux send -t remote \u0026#34;ssh user@server \u0026#39;ncat --idle-timeout 10 --send-only 127.0.0.1 12345\u0026#39;\u0026#34; Enter Reference:\nKey Bindings section of tmux manual key-string.c of tmux source code Control code chart of ASCII ","permalink":"https://blog.gani.win/posts/autohotkey/","summary":"Use OpenSSH and Ncat to run AutoHotkey in Windows 10.","title":"AutoHotkey with SSH"},{"content":"Install brew install hugo hugo new site spacedust --format yaml cd spacedust git init git submodule add --depth=1 https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod # clone your repository with its submodule git clone --recurse-submodules ${repository} # initialize and update submodules (if you cloned it without submodules) git submodule update --init Repository Git repository mupofps/hugo-spacedust in Gare.\nArchetypes archetypes/default.md with YAML front matter from Hugo.\n--- date: \u0026#39;{{ .Date }}\u0026#39; draft: true title: \u0026#39;{{ replace .File.ContentBaseName `-` ` ` | title }}\u0026#39; tags: [\u0026#39;{{ replace .File.ContentBaseName `-` ` ` }}\u0026#39;] --- Home hugo.yaml\nparams: homeInfoParams: Title: \u0026#34;Hello 👋 \u0026#34; Content: | ![Home Image](/home-image.jpg) Welcome to \u0026#34;Space Dust\u0026#34;! There is the blog of Mu Jiang. assets/css/extended/custom.css\nimg[alt=\u0026#39;Home Image\u0026#39;] { max-width: 100%; border-radius: var(--radius); margin: 0px 0px 0px 0px; } CLI pass environment variables env HUGO_TITLE=\u0026#34;Some Title\u0026#34; hugo show drafts hugo server --bind \u0026#34;$interface_ip\u0026#34; -b \u0026#34;$url\u0026#34; -D build the site hugo -b \u0026#34;$url\u0026#34; watch for changes hugo -b \u0026#34;$url\u0026#34; -w clear obsolete files hugo -b \u0026#34;$url\u0026#34; --cleanDestinationDir Access Key Check Wikipedia and PaperMod.\nc - ToC Open/Close g - Go To Top h - Home (according to current lang) t - Theme toggle / - Jumps to search page if in menu Modifier on Windows, FreeBSD, and Linux (Chrome): Alt or Alt + Shift Modifier on macOS (Safari or Chrome): control + option Mathematics Add these two files to layouts/partials/.\n├── layouts │ └── partials │ ├── extend_head.html │ └── math.html extend_head.html form PaperMod\n{{ if or .Params.math .Site.Params.math }} {{ partial \u0026#34;math.html\u0026#34; . }} {{ end }} math.html form Katex\n\u0026lt;link rel=\u0026#34;stylesheet\u0026#34; href=\u0026#34;https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css\u0026#34; integrity=\u0026#34;sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV\u0026#34; crossorigin=\u0026#34;anonymous\u0026#34;\u0026gt; \u0026lt;script defer src=\u0026#34;https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js\u0026#34; integrity=\u0026#34;sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8\u0026#34; crossorigin=\u0026#34;anonymous\u0026#34;\u0026gt;\u0026lt;/script\u0026gt; \u0026lt;script defer src=\u0026#34;https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js\u0026#34; integrity=\u0026#34;sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05\u0026#34; crossorigin=\u0026#34;anonymous\u0026#34; onload=\u0026#34;renderMathInElement(document.body);\u0026#34;\u0026gt;\u0026lt;/script\u0026gt; Examples:\nInline type \\( \\beta = \\alpha -\\gamma \\) Block type $$ \\varphi = 1+\\frac{1} {1+\\frac{1} {1+\\frac{1} {1+\\cdots} } } $$ Share Icons Add more share icons which is modified by Inkscape. Check share_icons.html for details.\nSocial Media More social media icons: weibo, qq, qzone, douban. The icons are from Simple Icons.\nCopy to Clipboard Click clipboard icon to copy the post url. The icons are from Feather.\nQR Code Click QR code icon to go to the qrcode page.\nThe icon is generated with text \u0026ldquo;QR\u0026rdquo; by qrcode-svg. The QR code generator static/qrcodejs/qrcode.min.js is from davidshimjs / qrcodejs. The qrcode page use the query string ?text=* to get contents. Check its layout qrcode.html for details. P.S. The icon of Space Dust is form MDI project and the home image of it is from Unsplash.\n","permalink":"https://blog.gani.win/posts/hugo/","summary":"Some notes for building the blog with Hugo.","title":"Build My Hugo Site"},{"content":"Introduction A shell script curl-github.sh to download the latest release of GitHub repositories. It needs curl and grep.\nusage: curl-github.sh [command] [repo] [keyword] commands: help, list, get. Script #!/bin/sh # download the latest release from github [ -n \u0026#34;$2\u0026#34; ] \u0026amp;\u0026amp; REPO_PATH=\u0026#34;$2\u0026#34; [ -n \u0026#34;$3\u0026#34; ] \u0026amp;\u0026amp; KEYWORD=\u0026#34;$3\u0026#34; [ -n \u0026#34;$4\u0026#34; ] \u0026amp;\u0026amp; FILE_NAME=\u0026#34;$4\u0026#34; [ -z \u0026#34;$REPO_PATH\u0026#34; ] \u0026amp;\u0026amp; REPO_PATH=\u0026#34;microsoft/vscode\u0026#34; [ -z \u0026#34;$KEYWORD\u0026#34; ] \u0026amp;\u0026amp; KEYWORD=\u0026#34;tarball\u0026#34; list() { echo $REPO_PATH curl -sL \u0026#34;https://api.github.com/repos/$REPO_PATH/releases/latest\u0026#34; | grep \u0026#39;browser_download_url\\|tarball_url\\|zipball_url\u0026#39; | grep -o \u0026#39;https:[^\u0026#34;]*\u0026#39; } get() { echo $REPO_PATH echo $KEYWORD URL=$(curl -sL \u0026#34;https://api.github.com/repos/$REPO_PATH/releases/latest\u0026#34; | grep \u0026#39;browser_download_url\\|tarball_url\\|zipball_url\u0026#39; | grep -o \u0026#39;https:[^\u0026#34;]*\u0026#39; | grep \u0026#34;$KEYWORD\u0026#34;) echo $URL curl -LO \u0026#34;$URL\u0026#34; } help() { echo \u0026#34;usage: curl-github.sh [command] [repo] [keyword], commands: help, list, get.\u0026#34; } CMD=$1 : ${CMD:=\u0026#39;help\u0026#39;} $CMD P.S. grep -o 'https:[^\u0026quot;]*' If the first character of the list is the caret ‘^’, then it matches any character not in the list, and it is unspecified whether it matches an encoding error. Check the manual for details.\ngrep 'browser_download_url\\|tarball_url\\|zipball_url' Two regular expressions may be joined by the infix operator ‘|’. The resulting regular expression matches any string matching either of the two expressions, which are called alternatives. For the default BREs, use ‘\\|’. Check the manual for details.\n","permalink":"https://blog.gani.win/posts/github/","summary":"\u003ch2 id=\"introduction\"\u003eIntroduction\u003c/h2\u003e\n\u003cp\u003eA shell script \u003ccode\u003ecurl-github.sh\u003c/code\u003e to download the latest release of \u003ca href=\"https://github.com\"\u003eGitHub\u003c/a\u003e repositories. It needs \u003ccode\u003ecurl\u003c/code\u003e and \u003ccode\u003egrep\u003c/code\u003e.\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003eusage: curl-github.sh [command] [repo] [keyword] \ncommands: help, list, get.\n\u003c/code\u003e\u003c/pre\u003e\u003ch2 id=\"script\"\u003eScript\u003c/h2\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003e#!/bin/sh\n# download the latest release from github\n\n[ -n \u0026#34;$2\u0026#34; ] \u0026amp;\u0026amp; REPO_PATH=\u0026#34;$2\u0026#34;\n[ -n \u0026#34;$3\u0026#34; ] \u0026amp;\u0026amp; KEYWORD=\u0026#34;$3\u0026#34;\n[ -n \u0026#34;$4\u0026#34; ] \u0026amp;\u0026amp; FILE_NAME=\u0026#34;$4\u0026#34;\n\n[ -z \u0026#34;$REPO_PATH\u0026#34; ] \u0026amp;\u0026amp; REPO_PATH=\u0026#34;microsoft/vscode\u0026#34;\n[ -z \u0026#34;$KEYWORD\u0026#34; ] \u0026amp;\u0026amp; KEYWORD=\u0026#34;tarball\u0026#34;\n\nlist()\n{\n    echo $REPO_PATH\n    curl -sL \u0026#34;https://api.github.com/repos/$REPO_PATH/releases/latest\u0026#34; | grep \u0026#39;browser_download_url\\|tarball_url\\|zipball_url\u0026#39; | grep -o \u0026#39;https:[^\u0026#34;]*\u0026#39;\n}\n\nget()\n{\n    echo $REPO_PATH\n    echo $KEYWORD\n    URL=$(curl -sL \u0026#34;https://api.github.com/repos/$REPO_PATH/releases/latest\u0026#34; | grep \u0026#39;browser_download_url\\|tarball_url\\|zipball_url\u0026#39; | grep -o \u0026#39;https:[^\u0026#34;]*\u0026#39; | grep \u0026#34;$KEYWORD\u0026#34;) \n    echo $URL\n    curl -LO \u0026#34;$URL\u0026#34;\n}\n\nhelp()\n{\n    echo \u0026#34;usage: curl-github.sh [command] [repo] [keyword], commands: help, list, get.\u0026#34;\n}\n\nCMD=$1\n: ${CMD:=\u0026#39;help\u0026#39;}\n$CMD\n\u003c/code\u003e\u003c/pre\u003e\u003ch3 id=\"ps\"\u003eP.S.\u003c/h3\u003e\n\u003ch4 id=\"grep--o-https\"\u003e\u003ccode\u003egrep -o 'https:[^\u0026quot;]*'\u003c/code\u003e\u003c/h4\u003e\n\u003cp\u003eIf the first character of the list is the caret ‘^’, then it matches any character not in the list, and it is unspecified whether it matches an encoding error. Check the \u003ca href=\"https://www.gnu.org/software/grep/manual/grep.html#Character-Classes-and-Bracket-Expressions\"\u003emanual\u003c/a\u003e for details.\u003c/p\u003e","title":"Download GitHub Latest Release"},{"content":"Introduction My notes of smaug whose OS is openSUSE Tumbleweed with KDE Plasma and pina whose OS is openSUSE Tumbleweed with Xfce .\nZypper Mirror Select the openSUSE mirror from tuna.\nsudo zypper mr -da sudo zypper ar -cfg \u0026#39;https://mirrors.tuna.tsinghua.edu.cn/opensuse/tumbleweed/repo/oss/\u0026#39; mirror-oss sudo zypper ar -cfg \u0026#39;https://mirrors.tuna.tsinghua.edu.cn/opensuse/tumbleweed/repo/non-oss/\u0026#39; mirror-non-oss sudo zypper ref Codecs sudo zypper ar -cfp 90 \u0026#39;https://mirrors.tuna.tsinghua.edu.cn/packman/suse/openSUSE_Tumbleweed/Essentials/\u0026#39; packman-essentials sudo zypper dup --from packman-essentials --allow-vendor-change Update sudo zypper dup --no-allow-vendor-change YaST Network Hostname/DNS → Static Hostname = \u0026lsquo;pina\u0026rsquo;\nBoot Loader Bootloader Options → Timeout in Seconds = \u0026lsquo;1\u0026rsquo;\nLanguage English (US) Simplified Chinese Japanese Virtualization Install KVM server and KVM tools with the network bridge br0 of wicked.\nBtrfs Mount a subvolume of /dev/sda5.\nsudo mount /dev/sda5 /mnt sudo btrfs subvolume list /mnt sudo mount /dev/sda5 /mnt/home -o subvolid=263 sudo umount /mnt/home /mnt Wake-on-LAN Reference\nsudo ethtool enp3s0 sudo systemctl enable wol@enp3s0.service # /etc/systemd/system/wol@.service [Unit] Description=Wake-on-LAN for %i Requires=network.target After=network.target [Service] ExecStart=/usr/sbin/ethtool -s %i wol g Type=oneshot [Install] WantedBy=multi-user.target KDE Plasma Session Default session is Plasma X11, but change it to Plasma Wayland.\nLocale Set environment variable $LANG to C.UTF-8.\n# System sudo localectl set-locale LANG=C.UTF-8 # KDE rm ~/.config/plasma-localerc Then get these two configuration files.\n# /etc/locale.conf LANG=C.UTF-8 # ~/.config/plasma-localerc [Formats] LANG=C.UTF-8 Fcitx 5 Wiki\nsudo zypper in fcitx5 fcitx5-chinese-addons fcitx5-mozc When session is Plasma X11, need this command to use fcitx5.\ncp /usr/etc/X11/xim.d/fcitx5 ~/.xim Check ~/.xim.template, /etc/X11/xinit/xinitrc.common, /usr/etc/X11/xim and /usr/etc/X11/xim.d/fcitx5.\nFingerprint sudo zypper in fprintd fprintd-pam fprintd‐enroll fprintd‐list $username sudo pam-config -a --fprintd For SDDM login, press enter in the empty password field, then the fingerprint reader starts working.\nKDE Connect sudo zypper in kdeconnect-kde Xfce pipewire-pulse Set audio output to HDMI.\npactl list cards pactl set-card-profile alsa_card.pci-0000_00_1b.0 output:hdmi-stereo+input:analog-stereo Locale Reference\n~/.config/xfce4/xinitrc\n#!/bin/sh test -s $HOME/.i18n \u0026amp;\u0026amp; . $HOME/.i18n . /etc/xdg/xfce4/xinitrc ~/.i18n\nunset GDM_LANG export LANG=C.UTF-8 Applications Clash sudo zypper in clash systemctl --user enable --now clash.service ddcutil sudo zypper in ddcutil sudo modprobe i2c_dev echo \u0026#39;i2c_dev\u0026#39; | sudo tee /etc/modules-load.d/i2c_dev.conf # get display infomation sudo ddcutil detect # get brightness ddcutil -b $bus getvcp 10 # set brightness ddcutil -b $bus setvcp 10 $brightness intel-gpu-tools sudo zypper in intel-gpu-tools sudo intel_gpu_top Firefox Manage Certificates: Menu → Settings → View Certificates\u0026hellip; → Servers → Add Exception\u0026hellip;\nChrome flatpak install flathub com.google.Chrome # enable proxy in Chrome # export http_proxy https_proxy all_proxy flatpak run flathub com.google.Chrome Manage Certificates on chrome://settings/certificates.\nVS Code flatpak install flathub com.visualstudio.code # alias for com.visualstudio.code in ~/.alias alias code=\u0026#39;flatpak run com.visualstudio.code\u0026#39; # User Settings (JSON) for Flatpak version # to make the integrated terminal automatically use the host system\u0026#39;s shell { \u0026#34;terminal.integrated.defaultProfile.linux\u0026#34;: \u0026#34;bash\u0026#34;, \u0026#34;terminal.integrated.profiles.linux\u0026#34;: { \u0026#34;bash\u0026#34;: { \u0026#34;path\u0026#34;: \u0026#34;host-spawn\u0026#34;, \u0026#34;args\u0026#34;: [ \u0026#34;bash\u0026#34; ] } } } Jellyfin Media Player flatpak install flathub com.github.iwalton3.jellyfin-media-player ","permalink":"https://blog.gani.win/posts/tumbleweed/","summary":"\u003ch2 id=\"introduction\"\u003eIntroduction\u003c/h2\u003e\n\u003cp\u003eMy notes of \u003ccode\u003esmaug\u003c/code\u003e whose OS is \u003ca href=\"https://en.opensuse.org/Portal:Tumbleweed\"\u003eopenSUSE Tumbleweed\u003c/a\u003e with \u003ca href=\"https://kde.org/plasma-desktop\"\u003eKDE Plasma\u003c/a\u003e and \u003ccode\u003epina\u003c/code\u003e whose OS is \u003ca href=\"https://en.opensuse.org/Portal:Tumbleweed\"\u003eopenSUSE Tumbleweed\u003c/a\u003e with \u003ca href=\"https://www.xfce.org/\"\u003eXfce\u003c/a\u003e .\u003c/p\u003e\n\u003ch2 id=\"zypper\"\u003eZypper\u003c/h2\u003e\n\u003ch3 id=\"mirror\"\u003eMirror\u003c/h3\u003e\n\u003cp\u003eSelect the openSUSE mirror from \u003ca href=\"https://mirrors.tuna.tsinghua.edu.cn/help/opensuse/\"\u003etuna\u003c/a\u003e.\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003esudo zypper mr -da\nsudo zypper ar -cfg \u0026#39;https://mirrors.tuna.tsinghua.edu.cn/opensuse/tumbleweed/repo/oss/\u0026#39; mirror-oss\nsudo zypper ar -cfg \u0026#39;https://mirrors.tuna.tsinghua.edu.cn/opensuse/tumbleweed/repo/non-oss/\u0026#39; mirror-non-oss\nsudo zypper ref\n\u003c/code\u003e\u003c/pre\u003e\u003ch3 id=\"codecs\"\u003eCodecs\u003c/h3\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003esudo zypper ar -cfp 90 \u0026#39;https://mirrors.tuna.tsinghua.edu.cn/packman/suse/openSUSE_Tumbleweed/Essentials/\u0026#39; packman-essentials\nsudo zypper dup --from packman-essentials --allow-vendor-change\n\u003c/code\u003e\u003c/pre\u003e\u003ch3 id=\"update\"\u003eUpdate\u003c/h3\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003esudo zypper dup --no-allow-vendor-change\n\u003c/code\u003e\u003c/pre\u003e\u003ch2 id=\"yast\"\u003eYaST\u003c/h2\u003e\n\u003ch3 id=\"network\"\u003eNetwork\u003c/h3\u003e\n\u003cp\u003eHostname/DNS → Static Hostname = \u0026lsquo;pina\u0026rsquo;\u003c/p\u003e\n\u003ch3 id=\"boot-loader\"\u003eBoot Loader\u003c/h3\u003e\n\u003cp\u003eBootloader Options → Timeout in Seconds = \u0026lsquo;1\u0026rsquo;\u003c/p\u003e","title":"Tumbleweed with KDE or Xfce"},{"content":"OS Debian GNU/Linux 12 (bookworm)\nCode Server Homepage\nInstall curl -fsSL https://code-server.dev/install.sh | sh sudo systemctl enable --now code-server@$USER Extention LaTeX Workshop\nTeX Live Homepage\nInstall mkdir ~/.cache/texlive cd ~/.cache/texlive wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz zcat \u0026lt; install-tl-unx.tar.gz | tar xf - mv install-tl-unx.tar.gz backup-install-tl-unx.tar.gz cd install-tl-* perl ./install-tl --no-interaction # perl ./install-tl --no-interaction --repository https://your.mirror/CTAN/systems/texlive/tlnet Add texlive to $PATH at ~/.bashrc\n# set PATH so it includes texlive bin if it exists if [ -d \u0026#34;/usr/local/texlive/2023/bin/x86_64-linux\u0026#34; ] ; then PATH=\u0026#34;/usr/local/texlive/2023/bin/x86_64-linux:$PATH\u0026#34; fi Manage Document\ntlmgr option tlmgr option repository https://your.mirror/CTAN/systems/texlive/tlnet tlmgr update -list -self -all sudo `which tlmgr` update \u0026lt;-self|-all|pkgs\u0026gt; Apache2 Modules sudo a2enmod rewrite proxy proxy_http Site Configuration Reference\n# /etc/apache2/sites-available/code.conf RewriteEngine On RewriteCond %{HTTP:Upgrade} =websocket [NC] RewriteRule /(.*) ws://ip:8080/$1 [P,L] RewriteCond %{HTTP:Upgrade} !=websocket [NC] RewriteRule /(.*) http://ip:8080/$1 [P,L] ProxyRequests off ProxyPass / http://ip:8080/ nocanon ProxyPassReverse / http//ip:8080/ ","permalink":"https://blog.gani.win/posts/code/","summary":"The manual to build a Code Server with LaTeX tools and Apache reverse proxy.","title":"Code Server with LaTeX and Apache"},{"content":"Get the client IP address from Kumo.\nCommamd line curl https://kumo.gani.win/ip curl -4 https://kumo.gani.win/ip curl -6 https://kumo.gani.win/ip curl -L gani.win/ip Web brower Check Kumo.\nCustom IP Get information about a custom IP.\nJust use -H option to set the HTTP X-Forwarded-For request header.\ncurl -H \u0026#34;X-Forwarded-For: 1.1.1.1\u0026#34; -L gani.win/ip P.S. This service includes GeoLite2 data created by MaxMind, and the databases are downloaded from P3TERX/GeoLite.mmdb.\n","permalink":"https://blog.gani.win/posts/ip/","summary":"\u003cp\u003eGet the client IP address from Kumo.\u003c/p\u003e\n\u003ch2 id=\"commamd-line\"\u003eCommamd line\u003c/h2\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003ecurl https://kumo.gani.win/ip\ncurl -4 https://kumo.gani.win/ip\ncurl -6 https://kumo.gani.win/ip\ncurl -L gani.win/ip\n\u003c/code\u003e\u003c/pre\u003e\u003ch2 id=\"web-brower\"\u003eWeb brower\u003c/h2\u003e\n\u003cp\u003eCheck \u003ca href=\"https://kumo.gani.win/#cip\"\u003eKumo\u003c/a\u003e.\u003c/p\u003e\n\u003ch2 id=\"custom-ip\"\u003eCustom IP\u003c/h2\u003e\n\u003cp\u003eGet information about a custom IP.\u003cbr\u003e\nJust use \u003ccode\u003e-H\u003c/code\u003e option to set the HTTP \u003ccode\u003eX-Forwarded-For\u003c/code\u003e request header.\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003ecurl -H \u0026#34;X-Forwarded-For: 1.1.1.1\u0026#34; -L gani.win/ip\n\u003c/code\u003e\u003c/pre\u003e\u003ch2 id=\"ps\"\u003eP.S.\u003c/h2\u003e\n\u003cp\u003eThis service includes GeoLite2 data created by \u003ca href=\"https://www.maxmind.com\"\u003eMaxMind\u003c/a\u003e, and the databases are downloaded from \u003ca href=\"https://github.com/P3TERX/GeoLite.mmdb\"\u003eP3TERX/GeoLite.mmdb\u003c/a\u003e.\u003c/p\u003e","title":"Client IP Address"},{"content":"Website config Brotli is on. Always Use HTTPS is on. HTTP Strict Transport Security is off. SSL/TLS encryption mode is Full (strict). Access Kumo by proxy SSL/TLS There are two ways to get certificates: Let\u0026rsquo;s Encrypt or CloudFlare Origin. I prefer CloudFlare Origin to Let\u0026rsquo;s Encrypt.\nLet\u0026rsquo;s Encrypt CA certificates Refer to this document, Certbot needs webroot plugin to get certificates when using proxy.\ncertbot certonly --webroot -w /var/www/example -d www.example.com -d example.com -w /var/www/other -d other.example.net -d another.other.example.net CloudFlare Origin CA certificates Refer to this document, get the certificate and the key from Cloudflare. I choose ECC type and 15-year validity.\nApache remote IP Refer to this document, Apache needs module mod_remoteip to get original visitor IPs.\n# /etc/apache2/conf-available/remoteip.conf RemoteIPHeader CF-Connecting-IP RemoteIPTrustedProxyList /etc/apache2/trusted-proxies-cfv4.lst RemoteIPTrustedProxyList /etc/apache2/trusted-proxies-cfv6.lst # /etc/apache2/apache2.conf LogFormat \u0026#34;%v:%p %a %l %u %t \\\u0026#34;%r\\\u0026#34; %\u0026gt;s %O \\\u0026#34;%{Referer}i\\\u0026#34; \\\u0026#34;%{User-Agent}i\\\u0026#34; \\\u0026#34;%{remoteip-proxy-ip-list}n\\\u0026#34;\u0026#34; proxy_combined # /etc/apache2/sites-available/site.conf RemoteIPHeader CF-Connecting-IP ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log proxy_combined The script is used to get Cloudflare IPs for RemoteIPTrustedProxyList.\n#!/bin/bash curl https://www.cloudflare.com/ips-v4 \u0026gt; /etc/apache2/trusted-proxies-cfv4.lst curl https://www.cloudflare.com/ips-v6 \u0026gt; /etc/apache2/trusted-proxies-cfv6.lst ","permalink":"https://blog.gani.win/posts/cloudflare/","summary":"Some notes for Apache server with Cloudflare.","title":"With Cloudflare"},{"content":"README It\u0026rsquo;s obsolete. Now I use Hugo instead of Hexo.\nIntroduction My Hexo is running in Docker. It watches files of the blog, and generates the static files for Apache HTTP server.\nBuild the image Get a Dockerfile.\ncd $WorkDir git clone https://github.com/spurin/docker-hexo.git Remove Hexo Admin, add Supervisor for process manager and use a script start.sh to run hexo.\nBuild the image.\ndocker build -t hexo $WorkDir Run the container Use Docker Compose to run hexo service.\nservices: hexo: container_name: hexo image: hexo user: \u0026#39;1001\u0026#39; volumes: - /hexo/spacedust:/app tty: true The user 1001 is added for hexo and own /hexo/spacedust.\nDocker Compose for build and run services: hexo: container_name: hexo build: $WorkDir user: \u0026#39;1001\u0026#39; volumes: - /hexo/spacedust:/app tty: true Update the blog The Hexo repository /hexo/spacedust is synchronized with a remote repository by user 1001. Push changes to the remote repository, then pull them to /hexo/spacedust.\nP.S. The icon of Kumo is form MDI project and the banner of Space Dust is from Unsplash.\n","permalink":"https://blog.gani.win/posts/hexo/","summary":"\u003ch2 id=\"readme\"\u003eREADME\u003c/h2\u003e\n\u003cp\u003eIt\u0026rsquo;s obsolete. Now I use \u003ca href=\"https://gohugo.io/\"\u003eHugo\u003c/a\u003e instead of \u003ca href=\"https://hexo.io/\"\u003eHexo\u003c/a\u003e.\u003c/p\u003e\n\u003chr\u003e\n\u003ch2 id=\"introduction\"\u003eIntroduction\u003c/h2\u003e\n\u003cp\u003eMy Hexo is running in \u003ca href=\"https://hub.docker.com/repository/docker/mupofps/hexo/\"\u003eDocker\u003c/a\u003e. It watches files of the blog, and generates the static files for Apache HTTP server.\u003c/p\u003e\n\u003ch2 id=\"build-the-image\"\u003eBuild the image\u003c/h2\u003e\n\u003cp\u003eGet a Dockerfile.\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003ecd $WorkDir\ngit clone https://github.com/spurin/docker-hexo.git\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003eRemove \u003ca href=\"https://github.com/jaredly/hexo-admin\"\u003eHexo Admin\u003c/a\u003e, add \u003ca href=\"https://docs.docker.com/config/containers/multi-service_container/#use-a-process-manager\"\u003eSupervisor\u003c/a\u003e for process manager and use a script \u003ccode\u003estart.sh\u003c/code\u003e to run \u003ccode\u003ehexo\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eBuild the image.\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003edocker build -t hexo $WorkDir\n\u003c/code\u003e\u003c/pre\u003e\u003ch2 id=\"run-the-container\"\u003eRun the container\u003c/h2\u003e\n\u003cp\u003eUse Docker Compose to run \u003ccode\u003ehexo\u003c/code\u003e service.\u003c/p\u003e","title":"Build My Hexo Blog"},{"content":"Software Licensing Management Tool slmgr.vbs /dlv slmgr.vbs /ipk product-key slmgr.vbs /skms kms.server slmgr.vbs /ato KMS Client Keys The slmgr.vbs /ipk product-key command is different for different Windows editions.\nGVLK for Pro edition:\nslmgr.vbs /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX\nGVLK for Education edition:\nslmgr.vbs /ipk NW6C2-QMPVW-D7KKK-3GKT6-VCFB2\nGVLK for Enterprise edition:\nslmgr.vbs /ipk NPPR9-FWDCX-D2C8J-H872K-2YT43\nFrom Home to KMS From Home edition in Retail channel to KMS:\nDisconnect network. Change your key to RTM generic key. Reboot. Set KMS. RTM generic key for Pro edition:\nslmgr.vbs /ipk VK7JG-NPHTM-C97JM-9MPGT-3V66T\nRTM generic key for Education edition:\nslmgr.vbs /ipk YNMGQ-8RYV3-4PGQ3-C8XTP-7CFBY\nRTM generic key for Enterprise edition:\nslmgr.vbs /ipk XGVPP-NMH47-7TTHJ-W3FW7-8HV2C\nOthers They are illegal.\nKMS Emulator KMS Emulator in C (currently runs on Linux including Android, FreeBSD, Solaris, Minix, Mac OS, iOS, Windows with or without Cygwin).\nMicrosoft Activation Scripts A Windows and Office activator using HWID / KMS38 / Online KMS activation methods, with a focus on open-source code and fewer antivirus detections. For Online KMS activation method, KMS_IP is 222.184.9.98.\n# PowerShell irm https://massgrave.dev/get | iex References Slmgr.vbs\nKMS keys\nGeneric Keys\nWindows 11\n","permalink":"https://blog.gani.win/posts/kms/","summary":"Some tools and keys for Windows activation.","title":"Windows 10 Activation"},{"content":"","permalink":"https://blog.gani.win/qrcode/","summary":"","title":"QR Code"}]