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



Yesterday's access.
Introduction. [Lily Diary.
A diary of life in Mindanao.

   
25/07/13  IARU HF Contest
25/07/10 Software updates
25/07/08 DXV500ZS linear amplifier repair
25/07/07 CQ Machine Program
25/06/21 LoTW system upgrade
25/06/18 RG8 for 3.5MHz arrived
25/06/15  Time setting Ver0.5
25/06/14 Drone Habsan ZINO arrives
25/06/12 Philippine Independence Day
25/06/11 Algeria 7X2RF QSL card.
25/06/10 Translation API Program
25/06/09 DXCC150 award certificate arrived
25/06/08 AutoCWType_Ver1.4.1
25/06/07 Introducing the Shack
25/06/06 A portrait drawn 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 antenna.
Stepping motors
25/05/15 3.5MHz stepping motor design.
25/05/14 3.5MHz tuning coil installed.
25/05/11 3.5MHz antenna installation completed.
25/05/03 JTDX Autonomous Driving 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 Preparing for FTDX3000 LCD repair.
25/04/22 Installation plan for 3.5MHz Zepp antenna.
25/04/21 AutoCWType_Ver1.1.
25/04/20 10,14MHz antenna installation completed.
25/04/19 JTDX Autonomous Driving Program Ver0.4.1.
25/04/19 14MHz antenna pole installed.
25/04/18 ThinkPad X390 repair completed.
25/04/17 Search is now possible.
25/04/15 Preparing the 10MHz dipole.
25/04/12 Hexbeam Part8.
25/04/06 My ThinkPad X390 is broken.
25/04/05. Time setting program.
25/03/31 JTDX Autonomous Driving Program.
25/03/30 Automatic log sending from CWType to Hamlog.
25/03/21 Hexbeam Part 7.
25/03/20 FreeDV Part 3 First QSO.
25/03/18 FreeDV Part 2 QSO in the shack.
25/03/16 Hexbeam Part 6.
25/03/15 Install FreeDV Part1.
25/03/09 Hexbeam Part5.
25/03/07 Hexbeam Part 4.
25/03/05 28MHz antenna modification
25/03/01 FTDX3000 is broken!
25/02/28 Pileup at 50MHz FT8.
25/02/28 DXV500ZS linear amplifier repair.
25/02/27 Tower pipe rebuilding plan.
25/02/26 Direction to Japan from Ozamiz.
25/02/26 28MHz is not available.
25/02/23 DXV500ZS linear amplifier repair.
25/02/22 Hexbeam Part 3
25/02/21 Hexbeam Part 2
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 7,21MHz antenna repair.
25/02/08 Operating CW 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