<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Computer on Space Dust</title>
    <link>https://blog.gani.win/tags/computer/</link>
    <description>Recent content in Computer on Space Dust</description>
    <image>
      <title>Space Dust</title>
      <url>https://blog.gani.win/favicon.png</url>
      <link>https://blog.gani.win/favicon.png</link>
    </image>
    <generator>Hugo -- 0.147.2</generator>
    <language>en-US</language>
    <lastBuildDate>Thu, 09 May 2024 09:25:46 +0000</lastBuildDate>
    <atom:link href="https://blog.gani.win/tags/computer/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Apache with CGI</title>
      <link>https://blog.gani.win/posts/cgi/</link>
      <pubDate>Thu, 09 May 2024 09:25:46 +0000</pubDate>
      <guid>https://blog.gani.win/posts/cgi/</guid>
      <description>Some notes for Apache CGI programs.</description>
    </item>
    <item>
      <title>AutoHotkey with SSH</title>
      <link>https://blog.gani.win/posts/autohotkey/</link>
      <pubDate>Sat, 06 Apr 2024 23:53:41 +0000</pubDate>
      <guid>https://blog.gani.win/posts/autohotkey/</guid>
      <description>Use OpenSSH and Ncat to run AutoHotkey in Windows 10.</description>
    </item>
    <item>
      <title>Build My Hugo Site</title>
      <link>https://blog.gani.win/posts/hugo/</link>
      <pubDate>Thu, 01 Feb 2024 00:20:08 +0800</pubDate>
      <guid>https://blog.gani.win/posts/hugo/</guid>
      <description>Some notes for building the blog with Hugo.</description>
    </item>
    <item>
      <title>Download GitHub Latest Release</title>
      <link>https://blog.gani.win/posts/github/</link>
      <pubDate>Sat, 06 Jan 2024 14:03:10 +0000</pubDate>
      <guid>https://blog.gani.win/posts/github/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;A shell script &lt;code&gt;curl-github.sh&lt;/code&gt; to download the latest release of &lt;a href=&#34;https://github.com&#34;&gt;GitHub&lt;/a&gt; repositories. It needs &lt;code&gt;curl&lt;/code&gt; and &lt;code&gt;grep&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;usage: curl-github.sh [command] [repo] [keyword] 
commands: help, list, get.
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;script&#34;&gt;Script&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#!/bin/sh
# download the latest release from github

[ -n &amp;#34;$2&amp;#34; ] &amp;amp;&amp;amp; REPO_PATH=&amp;#34;$2&amp;#34;
[ -n &amp;#34;$3&amp;#34; ] &amp;amp;&amp;amp; KEYWORD=&amp;#34;$3&amp;#34;
[ -n &amp;#34;$4&amp;#34; ] &amp;amp;&amp;amp; FILE_NAME=&amp;#34;$4&amp;#34;

[ -z &amp;#34;$REPO_PATH&amp;#34; ] &amp;amp;&amp;amp; REPO_PATH=&amp;#34;microsoft/vscode&amp;#34;
[ -z &amp;#34;$KEYWORD&amp;#34; ] &amp;amp;&amp;amp; KEYWORD=&amp;#34;tarball&amp;#34;

list()
{
    echo $REPO_PATH
    curl -sL &amp;#34;https://api.github.com/repos/$REPO_PATH/releases/latest&amp;#34; | grep &amp;#39;browser_download_url\|tarball_url\|zipball_url&amp;#39; | grep -o &amp;#39;https:[^&amp;#34;]*&amp;#39;
}

get()
{
    echo $REPO_PATH
    echo $KEYWORD
    URL=$(curl -sL &amp;#34;https://api.github.com/repos/$REPO_PATH/releases/latest&amp;#34; | grep &amp;#39;browser_download_url\|tarball_url\|zipball_url&amp;#39; | grep -o &amp;#39;https:[^&amp;#34;]*&amp;#39; | grep &amp;#34;$KEYWORD&amp;#34;) 
    echo $URL
    curl -LO &amp;#34;$URL&amp;#34;
}

help()
{
    echo &amp;#34;usage: curl-github.sh [command] [repo] [keyword], commands: help, list, get.&amp;#34;
}

CMD=$1
: ${CMD:=&amp;#39;help&amp;#39;}
$CMD
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;ps&#34;&gt;P.S.&lt;/h3&gt;
&lt;h4 id=&#34;grep--o-https&#34;&gt;&lt;code&gt;grep -o &#39;https:[^&amp;quot;]*&#39;&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;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 &lt;a href=&#34;https://www.gnu.org/software/grep/manual/grep.html#Character-Classes-and-Bracket-Expressions&#34;&gt;manual&lt;/a&gt; for details.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tumbleweed with KDE or Xfce</title>
      <link>https://blog.gani.win/posts/tumbleweed/</link>
      <pubDate>Mon, 25 Sep 2023 15:41:30 +0000</pubDate>
      <guid>https://blog.gani.win/posts/tumbleweed/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;My notes of &lt;code&gt;smaug&lt;/code&gt; whose OS is &lt;a href=&#34;https://en.opensuse.org/Portal:Tumbleweed&#34;&gt;openSUSE Tumbleweed&lt;/a&gt; with &lt;a href=&#34;https://kde.org/plasma-desktop&#34;&gt;KDE Plasma&lt;/a&gt; and &lt;code&gt;pina&lt;/code&gt; whose OS is &lt;a href=&#34;https://en.opensuse.org/Portal:Tumbleweed&#34;&gt;openSUSE Tumbleweed&lt;/a&gt; with &lt;a href=&#34;https://www.xfce.org/&#34;&gt;Xfce&lt;/a&gt; .&lt;/p&gt;
&lt;h2 id=&#34;zypper&#34;&gt;Zypper&lt;/h2&gt;
&lt;h3 id=&#34;mirror&#34;&gt;Mirror&lt;/h3&gt;
&lt;p&gt;Select the openSUSE mirror from &lt;a href=&#34;https://mirrors.tuna.tsinghua.edu.cn/help/opensuse/&#34;&gt;tuna&lt;/a&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo zypper mr -da
sudo zypper ar -cfg &amp;#39;https://mirrors.tuna.tsinghua.edu.cn/opensuse/tumbleweed/repo/oss/&amp;#39; mirror-oss
sudo zypper ar -cfg &amp;#39;https://mirrors.tuna.tsinghua.edu.cn/opensuse/tumbleweed/repo/non-oss/&amp;#39; mirror-non-oss
sudo zypper ref
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;codecs&#34;&gt;Codecs&lt;/h3&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo zypper ar -cfp 90 &amp;#39;https://mirrors.tuna.tsinghua.edu.cn/packman/suse/openSUSE_Tumbleweed/Essentials/&amp;#39; packman-essentials
sudo zypper dup --from packman-essentials --allow-vendor-change
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;update&#34;&gt;Update&lt;/h3&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;sudo zypper dup --no-allow-vendor-change
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;yast&#34;&gt;YaST&lt;/h2&gt;
&lt;h3 id=&#34;network&#34;&gt;Network&lt;/h3&gt;
&lt;p&gt;Hostname/DNS → Static Hostname = &amp;lsquo;pina&amp;rsquo;&lt;/p&gt;
&lt;h3 id=&#34;boot-loader&#34;&gt;Boot Loader&lt;/h3&gt;
&lt;p&gt;Bootloader Options → Timeout in Seconds = &amp;lsquo;1&amp;rsquo;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Code Server with LaTeX and Apache</title>
      <link>https://blog.gani.win/posts/code/</link>
      <pubDate>Mon, 18 Sep 2023 15:16:27 +0000</pubDate>
      <guid>https://blog.gani.win/posts/code/</guid>
      <description>The manual to build a Code Server with LaTeX tools and Apache reverse proxy.</description>
    </item>
    <item>
      <title>Client IP Address</title>
      <link>https://blog.gani.win/posts/ip/</link>
      <pubDate>Tue, 05 Sep 2023 10:58:46 +0000</pubDate>
      <guid>https://blog.gani.win/posts/ip/</guid>
      <description>&lt;p&gt;Get the client IP address from Kumo.&lt;/p&gt;
&lt;h2 id=&#34;commamd-line&#34;&gt;Commamd line&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;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
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;web-brower&#34;&gt;Web brower&lt;/h2&gt;
&lt;p&gt;Check &lt;a href=&#34;https://kumo.gani.win/#cip&#34;&gt;Kumo&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;custom-ip&#34;&gt;Custom IP&lt;/h2&gt;
&lt;p&gt;Get information about a custom IP.&lt;br&gt;
Just use &lt;code&gt;-H&lt;/code&gt; option to set the HTTP &lt;code&gt;X-Forwarded-For&lt;/code&gt; request header.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;curl -H &amp;#34;X-Forwarded-For: 1.1.1.1&amp;#34; -L gani.win/ip
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;ps&#34;&gt;P.S.&lt;/h2&gt;
&lt;p&gt;This service includes GeoLite2 data created by &lt;a href=&#34;https://www.maxmind.com&#34;&gt;MaxMind&lt;/a&gt;, and the databases are downloaded from &lt;a href=&#34;https://github.com/P3TERX/GeoLite.mmdb&#34;&gt;P3TERX/GeoLite.mmdb&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>With Cloudflare</title>
      <link>https://blog.gani.win/posts/cloudflare/</link>
      <pubDate>Mon, 04 Sep 2023 16:12:45 +0000</pubDate>
      <guid>https://blog.gani.win/posts/cloudflare/</guid>
      <description>Some notes for Apache server with Cloudflare.</description>
    </item>
    <item>
      <title>Build My Hexo Blog</title>
      <link>https://blog.gani.win/posts/hexo/</link>
      <pubDate>Thu, 31 Aug 2023 16:57:12 +0000</pubDate>
      <guid>https://blog.gani.win/posts/hexo/</guid>
      <description>&lt;h2 id=&#34;readme&#34;&gt;README&lt;/h2&gt;
&lt;p&gt;It&amp;rsquo;s obsolete. Now I use &lt;a href=&#34;https://gohugo.io/&#34;&gt;Hugo&lt;/a&gt; instead of &lt;a href=&#34;https://hexo.io/&#34;&gt;Hexo&lt;/a&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;My Hexo is running in &lt;a href=&#34;https://hub.docker.com/repository/docker/mupofps/hexo/&#34;&gt;Docker&lt;/a&gt;. It watches files of the blog, and generates the static files for Apache HTTP server.&lt;/p&gt;
&lt;h2 id=&#34;build-the-image&#34;&gt;Build the image&lt;/h2&gt;
&lt;p&gt;Get a Dockerfile.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;cd $WorkDir
git clone https://github.com/spurin/docker-hexo.git
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Remove &lt;a href=&#34;https://github.com/jaredly/hexo-admin&#34;&gt;Hexo Admin&lt;/a&gt;, add &lt;a href=&#34;https://docs.docker.com/config/containers/multi-service_container/#use-a-process-manager&#34;&gt;Supervisor&lt;/a&gt; for process manager and use a script &lt;code&gt;start.sh&lt;/code&gt; to run &lt;code&gt;hexo&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Build the image.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;docker build -t hexo $WorkDir
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;run-the-container&#34;&gt;Run the container&lt;/h2&gt;
&lt;p&gt;Use Docker Compose to run &lt;code&gt;hexo&lt;/code&gt; service.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Windows 10 Activation</title>
      <link>https://blog.gani.win/posts/kms/</link>
      <pubDate>Wed, 30 Aug 2023 11:02:11 +0000</pubDate>
      <guid>https://blog.gani.win/posts/kms/</guid>
      <description>Some tools and keys for Windows activation.</description>
    </item>
  </channel>
</rss>
