JI1FGX/DU9 Mindanao, Philippines Amateur Radio Diary IOTA OC-130
English Japanese



Access until yesterday
Introduction. [Lily Diary]
Diary of Life in Mindanao

25/06/08  AutoCWType_Ver1.4.1
25/06/07  Introducing the Shack
25/06/06  A portrait illustrated by ChatGPT
25/05/26 Windows full-width half-width switching
25/05/17 OK2ZAW BCD to 16 converter
25/05/16 For 3.5MHz zepp antennas
Stepping motor this and that
25/05/15 3.5MHz stepping motor plan
25/05/14 3.5MHz tuning coil installed
25/05/11 3.5MHz antenna installation completed
25/05/03 JTDX automatic operation program Ver0.4.3
25/04/26 Drone Habsan ZINO
25/04/25 Time setting Ver0.3
25/04/24 AutoCWType_Ver1.3
25/04/23 FTDX3000 LCD repair preparation
25/04/22 Installation plan for 3.5 MHz Twep antenna
25/04/21 AutoCWType_Ver1.1
25/04/20 10,14MHz antenna installation completed
25/04/19 JTDX automatic operation program Ver0.4.1
25/04/19 Antenna pole installation at 14 MHz
25/04/18 ThinkPad X390 repair completed
25/04/17 Search is now available.
25/04/15 Preparation of 10 MHz dipole
25/04/12 Hexbeam Part8
25/04/06 ThinkPad X390 is broken.
25/04/05 Time Setting Program
25/03/31 JTDX Automatic Operation Program
25/03/30 Automatic log sending from CWType to Hamlog
25/03/21 Hexbeam Part7
25/03/20 FreeDV Part3 First QSO
25/03/18 FreeDV Part2 QSO in shack
25/03/16 Hexbeam Part6
25/03/15 FreeDV Part1 installation
25/03/09 Hexbeam Part5
25/03/07 Hexbeam Part4
25/03/05 28MHz antenna modification
25/03/01 FTDX3000 is broken!
25/02/28 Pile up at 50MHz FT8
25/02/28 DXV500ZS linear amplifier repair
25/02/27 Pipe and rebuild plan for tower
25/02/26 Direction of Japan from Ozamiz
25/02/26 28MHz does not fly.
25/02/23 DXV500ZS linear amplifier repair
25/02/22 Hexbeam Part3
25/02/21 Hexbeam Part2
25/02/18 28MHz antenna construction
25/02/17 18,24MHz antenna height construction
25/02/16 Z26NS Cosovo
25/02/14 21MHz FT8
25/02/12 Antenna repair at 7,21 MHz
25/02/08 CW operation at 21MHz
25/02/05 DXV500ZS linear amplifier failure
25/01/19 Input Director
25/01/14 Temporary License Renewal
Search is now available (2025/04/17) 
You can now search your diary, something you've wanted to do for a long time!
Enter a free word in the "Article Search" and a list of applicable articles will be displayed.
Click on the link in the search results to open the corresponding diary.
Talk to ChatGPT about the Python version of the rental server Xserver.
Python 2.7.5The instruction to upgrade the version because support has already ended at
However, the Python-3.12.3 installation does not finish with an error
Then it instructed me to upgrade gcc version 4.8.5 because it was out of date.

It ended up taking a long time to make from the evening to the morning.
# GCC Installation Instructions

echo $HOME
/home/lily2004
# Create working directory
mkdir -p $HOME/src
cd $HOME/src

# Download and install MPFR, GMP, MPC sources
wget https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz
tar xf gmp-6.2.1.tar.xz
cd gmp-6.2.1
. /configure --prefix=$HOME/local
make
make install
cd ...

wget https://www.mpfr.org/mpfr-4.2.1/mpfr-4.2.1.tar.xz
tar xf mpfr-4.2.1.tar.xz
cd mpfr-4.2.1
. /configure --prefix=$HOME/local --with-gmp=$HOME/local
make
make install
cd ...

wget https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz
tar xf mpc-1.2.1.tar.gz
cd mpc-1.2.1
. /configure --prefix=$HOME/local --with-gmp=$HOME/local --with-mpfr=$HOME/local
make
make install
cd ...

# Download GCC
wget https://ftp.gnu.org/gnu/gcc/gcc-11.4.0/gcc-11.4.0.tar.xz
tar xf gcc-11.4.0.tar.xz
cd gcc-11.4.0

# Set necessary environment variables (e.g., add paths)
export PATH=$HOME/local/bin:$PATH
export LD_LIBRARY_PATH=$HOME/local/lib:$LD_LIBRARY_PATH
export CFLAGS="-I$HOME/local/include"
export LDFLAGS="-L$HOME/local/lib"

# Prepare to build GCC
. /configure --prefix=$HOME/local --with-gmp=$HOME/local --with-mpfr=$HOME/local --with-mpc=$HOME/local --enable-languages=c,c++ --disable --multilib
make
make install
cd ...

# Prepare to install Python
wget https://www.python.org/ftp/python/3.12.3/Python-3.12.3.tgz
tar xf Python-3.12.3.tgz
cd Python-3.12.3

# Python Preferences
export LD_LIBRARY_PATH=$HOME/local/lib64:$LD_LIBRARY_PATH
export CFLAGS="-I$HOME/local/include"
export LDFLAGS="-L$HOME/local/lib"

# Build and install Python
. /configure --prefix=$HOME/local --enable-optimizations --with-ensurepip=install
make
make install
cd ...

# Check Python
/home/lily2004/local/bin/python3.12 --version

# Upgrade pip as needed
/home/lily2004/local/bin/python3.12 -m ensurepip --upgrade
CGI made after gcc makesearch_and_write.cgi

# search_and_write.cgi
#! /usr/bin/env perl
use strict;.
use warnings;.
use utf8;
use CGI;.
use JSON;.
use Encode;.

binmode(STDOUT, ":encoding(UTF-8)");

my $q = CGI->new;
my $keyword = $q->param('keyword') // '';
$keyword = decode('UTF-8', $keyword) if defined $keyword;
$keyword =~ s/^\s+|\s+$///g;

print $q->header(-type => 'text/html', -charset => 'UTF-8');
print "<html><head><meta charset='UTF-8'><title>Search Results</title></head><body bgc
olor=#ffffe0>";
print "<style>table { border-collapse: collapse; } td { padding: 4px 10px; verti
cal-align: top; }</style>";.

print "<p>Keyword = [$keyword]</p>";

if (! $keyword) {
print "<p>No keywords entered. </p>";
print "</body></html>";
exit;
}

my $json_file = '/home/lily2004/ji1fgx.com/public_html/index.json';

if (-e $json_file) {
open my $fh, '<', $json_file or die "File read error: $!" ;
my $json_data = do { local $/; <$fh> };
close $fh;.

my $data = decode_json($json_data);

my @results = grep {
($_->{title} && $_->{title} =~ /\Q$keyword\E/i) ||
($_->{content} && $_->{content} =~ /\Q$keyword\E/i)
} @$data; }

if (@results) {
print "<p>Search Results:</p><table border=0 cellpadding=0 cellspacing=0>";.
foreach my $result (@results) {
my $raw_title = $result->{title};
my $file = $result->{file};
my $path = '/' . $file;.

# If title contains HTML tags, extract plain text only
my $title = $raw_title;
$title =~ s/<[^>]*>//g;

my ($date, $description) = ("", $title);

if ($title =~ /[((]([^()()]*)[)]/) {
my $paren_content = $1;
if ($paren_content =~ /^\d{4}\/\d{2}\/\d{2}$/) {
$date = $paren_content;
$description =~ s/[((]$date[)]//;
}
}

if ($date ne '') {
print "<tr><td><a href="$path\" target="B\">$date</a></td><td
$description</td></tr>";
} else {
print "<tr><td colspan=\"2\"><a href=\"$path\" target=\"B\">$tit
le</a></td></tr>";.
}
}
print "</table>";.
} else {
print "<p>No results found. </p>";
}
} else {
print "<p>The index.json file cannot be found. </p>";
}

print "</body></html>";
<script> embedded in the table of contents section

<script>
window.addEventListener("DOMContentLoaded", function () {
const searchBox = document.getElementById("searchBox");

searchBox.addEventListener("keydown", function(event) {
if (event.key === "Enter") {
event.preventDefault(); // prevent form submission and page reload

const keyword = searchBox.value;.
console.log("The Enter key was pressed. Keyword:", keyword);

const encodedKeyword = encodeURIComponent(keyword);
const url = `/script/search_and_write.cgi?keyword=${encodedKeyword}&_=${Date.now()}`;

// Load into frame name "B
parent.frames["B"].location.href = url;
}
});
});
</script>

<tr>
<td colspan="2">
<form method="get" accept-charset="UTF-8">
<label for="searchBox"><strong>Article Search:</strong></label
<input type="text" id="searchBox" name="keyword" placeholder="Enter a keyword" size="35">
<! -- <input type="submit" value="search">-->
</form>
<div id="results" style="margin-top: 10px;"></div>
</td>
</tr>

Python program to create Json Index (index.json)make_index.2.py

We run it once a day with cron.
0 2 * * * /home/lily2004/local/bin/python3 /home/lily2004/ji1fgx.com/public_html/script/make_index.2.py /home/lily2004/ji1fgx.com/public_html /home/lily2004/ji1fgx.com/public_html/index.json

#make_index.2.py
# -*- coding: utf-8 -*-
import os
import json
import sys
import chardet
from bs4 import BeautifulSoup

# Function to determine file encoding
def detect_encoding(file_path):.
with open(file_path, 'rb') as f:.
raw_data = f.read()
result = chardet.detect(raw_data)
return result['encoding'] or 'utf-8' # return utf-8 if no result

# Function to extract unique title and body from HTML
def extract_custom_title_and_text(file_path):.
encoding = detect_encoding(file_path) # detect encoding
with open(file_path, 'r', encoding=encoding, errors='ignore') as f:.
html = f.read()

soup = BeautifulSoup(html, 'html.parser')

# Unique title extraction
th_title = soup.find('th', class_='hpb-cnt-tb-th1')
title = ''
if th_title:.
title = th_title.get_text(strip=True)

# Extract text also (for search)
body = soup.get_text(separator=' ', strip=True)

return title, body

def main(folder, output_file):.
index_data = [].

for filename in os.listdir(folder): for filename in os.listdir(folder)
# if filename.endswith('.html', '.php'):.
if filename.endswith(('.html', '.php')):.
full_path = os.path.join(folder, filename)
try:.
title, content = extract_custom_title_and_text(full_path)

# Embed file names as links
link = f'<a href="{filename}" target="B">{filename}</a>'

# Add data to index_data
index_data.append({
'title': title or link, and
'file': filename,.
'link': link,.
'content': content[:300].
})
except Exception as e:.
print(f "Error processing {filename}: {e}")

with open(output_file, 'w', encoding='utf-8') as f:.
json.dump(index_data, f, ensure_ascii=False, indent=2)

print(f "Index file created: {output_file}")

if __name__ == '__main__':.
if len(sys.argv) < 3: if len(sys.argv) < 3: if len(sys.argv) < 3
print("Usage: make_index.py <input_folder> <output_file>")
else:.
input_folder = sys.argv[1].
output_file = sys.argv[2].
main(input_folder, output_file)
April 15, 2024   April 18, 2025