[    [    [    [    [    [    [    b l o g g i n   s p a c e    wiki   ]    ]    ]    ]    ]    ]    ]

Difference between revisions of "Termux"

From blogginpedia
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 257: Line 257:
<hr style="border-top: .5px solid #ff69b4; background: transparent;">
<hr style="border-top: .5px solid #ff69b4; background: transparent;">


<poem>
See [[Termux IRC Client]] as all the code was moved there and will be updated more than this article.
<small><small>
import socket
import ssl
import threading
import sys
import time
import queue


class IRCClient:
<h3>bombadillo</h3>
    def __init__(self):
<hr style="border-top: .5px solid #ff69b4; background: transparent;">
        self.server = "irc.rizon.net"
        self.port = 6697  # SSL port for Rizon
        self.channels = ["#/g/tv", "#/sp/"]  # Default channels to join
        self.nickname = "LullSac"
        self.realname = "Termux IRC Client"
        self.irc = None
        self.context = ssl.create_default_context()
        self.running = True
        self.message_queue = queue.Queue()
        self.lock = threading.Lock()  # For thread-safe channel list updates


    def connect(self):
Bombadillo is another [[Gopher]] browser for termux. It sucks. Don't use it.
        try:
            # Create socket and wrap with SSL
            raw_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            self.irc = self.context.wrap_socket(raw_socket, server_hostname=self.server)
            print(f"Connecting to {self.server}:{self.port}...")
            self.irc.connect((self.server, self.port))


            # Send user and nick information
<h3>AL east mlb standings</h3>
            self.send(f"USER {self.nickname} 0 * :{self.realname}")
<hr style="border-top: .5px solid #ff69b4; background: transparent;">
            self.send(f"NICK {self.nickname}")


            return True
<pre>
        except Exception as e:
# Fetch AL East standings (division ID 201)
            print(f"Connection error: {e}")
echo -e "${BLUE}${BOLD}MLB AL East Standings:${RESET}"
            return False
response=$(curl -s "http://statsapi.mlb.com/api/v1/standings?leagueId=103&season=2025")
teams=$(echo "$response" | jq '.records[] | select(.division.id==201)')


     def send(self, message):
if [[ -n "$teams" && "$teams" != "null" ]]; then
        try:
     echo -e "${CYAN}Team                    W  L  PCT  GB${RESET}"
            self.irc.send(f"{message}\r\n".encode('utf-8'))
  echo -e "${YELLOW}--------------------------------------------------------------------------------------------------------${RESET}"
         except Exception as e:
    echo "$teams" | jq -r '.teamRecords[] | "\(.team.name)|\(.wins)|\(.losses)|\(.winningPercentage)|\(.gamesBack)"' | while IFS='|' read -r team wins losses pct gb; do
             print(f"Error sending message: {e}")
        pct=$(echo "$pct" | sed 's/^\.//')
         if [[ "$gb" == "-" ]]; then
            printf "${GREEN}${BOLD}%-25s${RESET}${GREEN} %-3s %-3s .%-3s %-5s${RESET}\n" "$team" "$wins" "$losses" "$pct" "$gb"                                                                          else
             printf "${BOLD}%-25s${RESET} %-3s %-3s .%-3s %-5s\n" "$team" "$wins" "$losses" "$pct" "$gb"
        fi
    done
else
    echo -e "${RED}Standings unavailable${RESET}"
fi
echo
</pre>


    def handle_input(self):
==Welcome==
        while self.running:
            try:
                message = input().strip()
                if not self.running:
                    break
                if message:
                    self.message_queue.put(message)
            except KeyboardInterrupt:
                self.message_queue.put("QUIT :Goodbye")
                break


    def handle_server(self):
<pre>
        while self.running:
# Network Status
            try:
echo -e "${BLUE}${BOLD}Network Status:${RESET}"
                data = self.irc.recv(2048).decode('utf-8')
echo -e "${YELLOW}-------------------------------------------------------------------->
                if not data:
if curl -s --connect-timeout 3 google.com &> /dev/null; then
                    print("Disconnected from server.")
    ssid=$(termux-wifi-connectioninfo 2>/dev/null | jq -r '.ssid // "Unknown"' || echo>
                    self.running = False
    echo -e "${CYAN}Connected - Wi-Fi: ${ssid}${RESET}"
                    break
else
    echo -e "${RED}No internet connection${RESET}"
fi
echo


                for line in data.strip().split('\r\n'):
                    if not line:
                        continue
                    print(line)


                    # Handle PING
# Fetch historical event for today
                    if line.startswith("PING"):
month=$(date +%m | sed 's/^0//')  # Remove leading zero
                        self.send(f"PONG {line.split()[1]}")
day=$(date +%d | sed 's/^0//')    # Remove leading zero
echo -e "${BLUE}${BOLD}Happened on This Day:${RESET}"
echo -e "${YELLOW}-------------------------------------------------------------------->
history=$(curl -s "https://byabbe.se/on-this-day/$month/$day/events.json" | jq -r '.ev>
if [[ -n "$history" && ! "$history" =~ "null" ]]; then
    echo -e "${CYAN}${history}${RESET}"
else
    echo -e "${RED}No historical events available${RESET}"
fi
echo


                    # Join channels after MOTD
# Show Quick Links
                    if "376" in line or "422" in line:
echo -e "${BLUE}${BOLD}Quick Links:${RESET}"
                        with self.lock:
echo -e "${YELLOW}-------------------------------------------------------------------->
                            for channel in self.channels:
echo -e
                                self.send(f"JOIN {channel}")
echo -e "${RED}${BOLD} • https://bloggin.space/home/index.php/Main_Page${RESET}"
                                print(f"Joined {channel}")
echo -e
echo -e "${CYAN}${BOLD} • https://bloggin.space/wiki/index.php/Main_Page${RESET}"
echo -e
echo -e "${GREEN}${BOLD} • https://x.com/home${RESET}"
echo -e
echo -e "${RED}${BOLD} • https://search.brave.com${RESET}"
echo -e
echo -e "${CYAN}${BOLD} • https://mail.hostinger.com/?_task=mail&_mbox=INBOX${RESET}"
echo


                    # Parse messages for display
</pre>
                    if "PRIVMSG" in line:
                        sender = line[1:line.index('!')]
                        target = line.split()[2]
                        msg = line[line.index(':', 1) + 1:]
                        print(f"<{sender}@{target}> {msg}")


                    # Handle channel join confirmation
==Welcome 2 (for the small tablet)==
                    if "JOIN" in line and self.nickname in line:
                        channel = line.split(':', 2)[-1]
                        with self.lock:
                            if channel not in self.channels:
                                self.channels.append(channel)
                                print(f"Added {channel} to active channels.")


            except Exception as e:
<pre>
                print(f"Server error: {e}")
                self.running = False
                break


    def process_commands(self):
#!/data/data/com.termux/files/usr/bin/bashin
        while self.running:
            try:
                message = self.message_queue.get(timeout=1)
                if message.lower() == "quit":
                    self.send("QUIT :Goodbye")
                    self.running = False
                elif message.startswith('/'):
                    self.handle_command(message)
                else:
                    # Default to sending to the first channel if no target specified
                    with self.lock:
                        if self.channels:
                            self.send(f"PRIVMSG {self.channels[0]} :{message}")
                        else:
                            print("No channels joined. Use /join <channel>.")
            except queue.Empty:
                continue
            except Exception as e:
                print(f"Command error: {e}")


    def handle_command(self, command):
# Welcome Screen for Termux: Weather in Fort Wayne, IN and AL East MLB Standings
        parts = command.split(maxsplit=2)
        cmd = parts[0].lower()
        if cmd == "/nick" and len(parts) > 1:
            self.nickname = parts[1]
            self.send(f"NICK {self.nickname}")
        elif cmd == "/join" and len(parts) > 1:
            channel = parts[1]
            self.send(f"JOIN {channel}")
            with self.lock:
                if channel not in self.channels:
                    self.channels.append(channel)
                    print(f"Requested to join {channel}")
        elif cmd == "/msg" and len(parts) > 2:
            target = parts[1]
            msg = parts[2]
            self.send(f"PRIVMSG {target} :{msg}")
        elif cmd == "/list":
            with self.lock:
                print(f"Active channels: {', '.join(self.channels)}")
        elif cmd == "/part" and len(parts) > 1:
            channel = parts[1]
            self.send(f"PART {channel}")
            with self.lock:
                if channel in self.channels:
                    self.channels.remove(channel)
                    print(f"Left {channel}")
        else:
            print("Unknown command or invalid syntax. Try: /nick, /join, /msg, /list, /part")


    def run(self):
# Define ANSI color codes
        if not self.connect():
BLUE="\033[0;34m"
            return
CYAN="\033[0;36m"
YELLOW="\033[1;33m"
GREEN="\033[0;32m"
RED="\033[0;31m"
BOLD="\033[1m"
RESET="\033[0m"


        # Start threads
echo -e "${BLUE}${BOLD}=== Sup Fuckos? ===${RESET}"
        server_thread = threading.Thread(target=self.handle_server)
        input_thread = threading.Thread(target=self.handle_input)
        command_thread = threading.Thread(target=self.process_commands)


        server_thread.start()
# Fetch weather for Fort Wayne, Indiana using wttr.in
        input_thread.start()
echo -e "\n${CYAN}${BOLD}Current Weather in Fort Wayne, IN:${RESET}"
        command_thread.start()
WEATHER=$(curl -s 'wttr.in/fort-wayne_indiana?0' 2>/dev/null)
if [ -z "$WEATHER" ]; then
  echo -e "${RED}Unable to fetch weather data. Check your internet connection.${RESET}"
else
  echo -e "${GREEN}${WEATHER}${RESET}"
fi


        # Wait for threads to finish
# Fetch AL East standings (division ID 201)
        try:
echo -e "\n${CYAN}${BOLD}MLB AL East Standings:${RESET}"
            server_thread.join()
response=$(curl -s "http://statsapi.mlb.com/api/v1/standings?leagueId=103&season=2025" 2>/dev/null)
            input_thread.join()
teams=$(echo "$response" | jq '.records[] | select(.division.id==201)')
            command_thread.join()
if [[ -n "$teams" && "$teams" != "null" ]]; then
        except KeyboardInterrupt:
  echo -e "${CYAN}Team                    W  L  PCT  GB${RESET}"
            self.running = False
  echo -e "${YELLOW}--------------------------------------------------------------------------------------------------------${RESET}"
  echo "$teams" | jq -r '.teamRecords[] | "\(.team.name)|\(.wins)|\(.losses)|\(.winningPercentage)|\(.gamesBack)"' | while IFS='|' read -r team wins losses pct gb; do
    # Remove leading dot from PCT and format to three digits
    pct=$(echo "$pct" | sed 's/^\.//')
    # Highlight leader (GB = "-")
    if [[ "$gb" == "-" ]]; then
      printf "${GREEN}${BOLD}%-25s %-3s %-3s .%-3s %-5s${RESET}\n" "$team" "$wins" "$losses" "$pct" "$gb"
    else
      printf "%-25s %-3s %-3s .%-3s %-5s\n" "$team" "$wins" "$losses" "$pct" "$gb"
    fi
  done
else
  echo -e "${RED}Standings unavailable. Check your internet connection or API status.${RESET}"
fi


        # Clean up
echo -e "\n${BLUE}${BOLD}============================${RESET}"
        self.irc.close()
        print("Connection closed.")


def main():
</pre>
    client = IRCClient()
    client.run()


if __name__ == "__main__":
==SSH/Terminal Commands==
    main()
</small></small>
</poem>


'''Channel List:'''
{| class="wikitable"
|+ Commands
|-
! SSH Command !! Explanation !! Notes
|-
| ls || Show directory contents (list the names of files).
|
* '''-l''' —  displays the details of the files, such as size, modified date and time, the owner, and the permissions.
* '''-a''' —  shows hidden files and directories.
|-
| cd || Change Directory.
|If you want to enter the home directory of your server, you can type: cd /home
|-
| mkdir || Create a new folder (directory).
|'''Example:''' mkdir myfolder  will create a folder called "myfolder."
|-
| touch ||Create new file.
|The file extension could be anything you want. You can even create a file with no extension at all.
|-
| rm || Remove a file.
|To delete a folder, you need to use the '''-r''' option to remove all the files and subfolders inside it:
'''Example:''' rm -r home/myfolder
|-
| cat || Show contents of a file.
|It also allows you to create a new file by merging multiple files.
'''Example:''' cat info.txt info2.txt > mergedinfo.text
|-
| pwd || Show current directory (full path to where you are).
|'''pwd''' command can come in really handy when you are accessing your site hosting account through SSH. Oftentimes, shared servers don’t tell you the directory you are in.
|-
| cp || Copy file or folder
|cp [options] [source] [destination]
If you want to make a copy in a different folder, run the following command: cp /home/hostinger/myfile.txt /home/etc/


*The self.channels list tracks all joined channels (initialized with #/g/tv and #/sp/ as defaults).
* '''-f''' — if you don’t have writing permission to the destination file, it’ll be deleted and the command will create a new file
*Channels are added dynamically via /join or confirmed via server JOIN messages.
* '''-u''' — copy the source file if it is newer than the destination file.
* '''-n''' — will not overwrite an existing file.
* '''-a''' — archive the files.
|-
| mv || Move a file or folder
|mv [source] [destination]
'''Example:'''  mv /home/myfile.txt /home/files/myfolder
|-
| grep || Search for phrase in a file
|grep 'line' info.txt
Keep in mind that this command is case sensitive. If you want to ignore letter cases, use '''-i''' option.
|-
| find || Search files and directories
|find [starting directory] [options] [search term]


'''Joining Multiple Channels:'''
* '''/''' (slash) — search the whole system
* '''.''' (dot) — search the working directory
* '''~''' (tilde) — search the home directory


*After receiving the MOTD (376 or 422), the client joins all channels in self.channels.
'''[options]''' is an additional argument that you can use to refine your search. Some of the most popular options are:
*The /join <channel> command adds a new channel to the list and sends a JOIN command.
* '''-name''' — look for files based on their names
 
* '''-user''' — search for files that belong to a given user
'''Message Routing:'''
* '''-size''' — look for files based on their sizes
*The /msg <target> <message> command sends messages to a specific channel or user.
|-
*If you type a message without a command, it defaults to the first channel in self.channels.
| vi/nano || Text editors.
Received messages display the target channel (e.g., <sender@#channel> message).
|nano [file name]
 
|-
'''New Commands:'''
| history || Show last 50 used commands.
 
|This one is used to display the last used commands. You need to enter a number to limit the displayed results. '''Example:''' history 20
*/list: Shows all active channels.
|-
 
| clear || Clear the terminal screen.
*/part <channel>: Leaves a specified channel and removes it from the list.
|The function of '''clear''' command is simple — it clears all text from the terminal screen.
 
|-
<h3>bombadillo</h3>
| tar || Create & Unpack compressed archives.
<hr style="border-top: .5px solid #ff69b4; background: transparent;">
|To archive a folder in '''.tar.gz''' format, use the following command:  tar -cvzf ArchiveName.tar.gz /path/to/directory
 
To unpack a '''.tar.gz''' file, enter this command: tar -xvzf FileName.tar.gz
Bombadillo is another [[Gopher]] browser for termux. It sucks. Don't use it.


* '''x''' tells tar to extract files
* '''c''' tells tar to create an archive
* '''v''' stands for '''verbose'''. The option tells tar to display all file names that are processed by the command.
* '''z''' instructs tar to uncompress the archive
* '''f''' tells tar that you are supplying the name of the archive
|-
| wget || Download files from the internet.
|wget <nowiki>http://fileurl/filename.ext</nowiki>
|-
| du || Get file size.
|You can use '''du''' (Disk Usage) command to view the size of files and folders in a specified directory: du [directory path]
|}


{{Science}}  
{{Science}}  
{{TermuxIRC}}
[[Category:Old]][[Category:Internet]]
[[Category:Old]][[Category:Internet]]

Latest revision as of 01:32, 29 June 2025

Anonymous 00:52, 5 August 2025 (EDT) Us.gif
Andy.jpg
Termux is a terminal emulator compatible with Xterm specification and Linux environment application for the Android OS. In other words this is an interface that lets you to run command line Linux programs. Additionally the app configures a lightweight environment that consists of standard utilities such as Bash, Coreutils, Nano, APT package manager and few other software packages.
Termux running irssi lets you chat with all your internet pals.

Some stuff I have found using termux terminal on my tablet. All of this stuff can be found on github and other websites and are probably a better source for the materials found here. I just copied and pasted stuff for my own personal use.

I am NOT a terminal (or linux) user. I dabble from time to time.

calcurse


Calcurse is a calendar and scheduling application for the command line. see more here.

To get it, you can install it in termux by typing:

pkg install calcurse

wordgrinder


WordGrinder is a Unicode-aware character cell word processor that runs in a terminal (or a Windows console). It is designed to get the hell out of your way and let you get some work done. You can see more here.

Install:

pkg install wordgrinder

wttr.in


Great way to get the local weather...if you happen to live in a town that has really recognizable name like Chicago or Berlin. Otherwise, you have to kinda play with it until it gets something close to what you want. Also, the ?u sets the temps to American units of F(reedom).

curl -s wttr.in/warsaw,IN?u

fastfetch


Screenshot 20250327 190230 Termux.jpg

Fastfetch displays what's going on.

Ways to install it here.

fastfetch --list-modules

Note that a lot of these do not work on Android.

1) Battery  : Print battery capacity, status, etc
2) Bios  : Print information of 1st-stage bootloader (name, version, release date, etc)
3) Bluetooth  : List (connected) bluetooth devices
4) BluetoothRadio: List bluetooth radios width supported version and vendor
5) Board  : Print motherboard name and other info
6) Bootmgr  : Print information of 2nd-stage bootloader (name, firmware, etc)
7) Break  : Print a empty line
8) Brightness  : Print current brightness level of your monitors
9) Btrfs  : Print Linux BTRFS volumes
10) Camera  : Print available cameras
11) Chassis  : Print chassis type (desktop, laptop, etc)
12) Command  : Run custom shell scripts
13) Colors  : Print some colored blocks
14) CPU  : Print CPU name, frequency, etc
15) CPUCache  : Print CPU cache sizes
16) CPUUsage  : Print CPU usage. Costs some time to collect data
17) Cursor  : Print cursor style name
18) Custom  : Print a custom string, with or without key
19) DateTime  : Print current date and time
20) DE  : Print desktop environment name
21) Display  : Print resolutions, refresh rates, etc
22) Disk  : Print partitions, space usage, file system, etc
23) DiskIO  : Print physical disk I/O throughput
24) DNS  : Print configured DNS servers
25) Editor  : Print information of the default editor ($VISUAL or $EDITOR)
26) Font  : Print system font names
27) Gamepad  : List (connected) gamepads
28) GPU  : Print GPU names, graphic memory size, type, etc
29) Host  : Print product name of your computer
30) Icons  : Print icon style name
31) InitSystem  : Print init system (pid 1) name and version
32) Kernel  : Print system kernel version
33) Keyboard  : List (connected) keyboards
34) LM  : Print login manager (desktop manager) name and version
35) Loadavg  : Print system load averages
36) Locale  : Print system locale name
37) LocalIp  : List local IP addresses (v4 or v6), MAC addresses, etc
38) Media  : Print playing song name
39) Memory  : Print system memory usage info
40) Monitor  : Alias of Display module
41) Mouse  : List connected mouses
42) NetIO  : Print network I/O throughput
43) OpenCL  : Print highest OpenCL version supported by the GPU
44) OpenGL  : Print highest OpenGL version supported by the GPU
45) OS  : Print operating system name and version
46) Packages  : List installed package managers and count of installed packages
47) PhysicalDisk  : Print physical disk information
48) PhysicalMemory: Print system physical memory devices
49) Player  : Print music player name
50) PowerAdapter  : Print power adapter name and charging watts
51) Processes  : Print number of running processes
52) PublicIp  : Print your public IP address, etc
53) Separator  : Print a separator line
54) Shell  : Print current shell name and version
55) Sound  : Print sound devices, volume, etc
56) Swap  : Print swap (paging file) space usage
57) Terminal  : Print current terminal name and version
58) TerminalFont  : Print font name and size used by current terminal
59) TerminalSize  : Print current terminal size
60) TerminalTheme : Print current terminal theme (foreground and background colors)
61) Title  : Print title, which contains your user name, hostname
62) Theme  : Print current theme of desktop environment
63) TPM  : Print info of Trusted Platform Module (TPM) Security Device
64) Uptime  : Print how long system has been running
65) Users  : Print users currently logged in
66) Version  : Print Fastfetch version
67) Vulkan  : Print highest Vulkan version supported by the GPU
68) Wallpaper  : Print image file path of current wallpaper
69) Weather  : Print weather information
70) WM  : Print window manager name and version
71) Wifi  : Print connected Wi-Fi info (SSID, connection and security protocol)
72) WMTheme  : Print current theme of window manager
73) Zpool  : Print ZFS storage pools

My current fastfetch:

fastfetch --logo none -s OS:Host:Memory:CPU:Battery:Disk:DateTime:Uptime

If you want to mess around with fastfetch logos (and there are a ton of them), check out:

fastfetch --list-logos

irssi


I don't normally use a CLI based irc client, but when I do, it is either irssi or weechat. Below you will find some irssi cheats.

irssi new user guide.

pkg install irssi

Irssi cheat sheet.jpg

When I use irssi, I don't like all the crap they put in the way. I just want text on a screen. Here are some things that will remove stuff that gets in the way:

/STATUSBAR MODIFY -disable info This gets rid of the info bar at the bottom that tells you stuff like how many users are in the channel.

/STATUSBAR MODIFY -disable window status bar This will remove the bar at the top that has the title in it.

fastfetch in irssi


I tried making a script that would output a fastfetch into a channel on irc:


use strict;
use vars qw($VERSION %IRSSI);
$VERSION = '1.5';
%IRSSI = (
    contact => 'N/A',
    name => 'Flexible Fastfetch Sysinfo',
    description => 'Displays system info on separate colored lines with fallbacks',
    license => 'Public Domain',
);
sub fetch_sysinfo {
    my ($server, $witem) = @_;
    return unless $witem; # Ensure we're in a channel/window
    # Run fastfetch and capture output
    my $sysinfo = `fastfetch --logo none -s OS:Memory:CPU:Battery:Disk:DateTime 2>/dev/null`;
    chomp($sysinfo);
    my %data;
    if ($sysinfo) {
        # Split by " - " and populate data hash
        my @sections = split / - /, $sysinfo;
        $data{'OS'} = $sections[0] if @sections > 0;
        $data{'Memory'} = $sections[1] if @sections > 1;
        $data{'CPU'} = $sections[2] if @sections > 2;
        $data{'Battery'} = $sections[3] if @sections > 3;
        $data{'Disk'} = $sections[4] if @sections > 4;
        $data{'Date & Time'} = $sections[5] if @sections > 5;
    }
    # Fallbacks for missing or incomplete data
    $data{'OS'} ||= `uname -o -r -m` || 'Unknown OS';
    $data{'Memory'} ||= `free -h | grep Mem | awk '{print \$3 "/" \$2}'` || 'Unknown Memory';
    $data{'CPU'} ||= `cat /proc/cpuinfo | grep "model name" | head -n 1 | cut -d: -f2-` || 'Unknown CPU';
    $data{'Battery'} ||= `termux-battery-status 2>/dev/null | grep percentage | cut -d: -f2 | tr -d '",'` || 'Unknown Battery';
    $data{'Disk (/)'}= `df -h / | tail -n 1 | awk '{print \$3 "/" \$2 " (" \$5 ")"}'` || 'Unknown Disk (/)';
    $data{'Disk (/storage/emulated)'} = `df -h /storage/emulated | tail -n 1 | awk '{print \$3 "/" \$2 " (" \$5 ")"}'` || 'Unknown Disk (/storage/emulated)';
    $data{'Date & Time'} ||= `date +"%Y-%m-%d %H:%M:%S"` || 'Unknown Date & Time';
    # Define colors and labels
    my @colors = (4, 7, 3, 12, 6, 9, 11); # Red, Orange, Green, Blue, Purple, Cyan, Light Cyan
    my @labels = ('OS:', 'Memory:', 'CPU:', 'Battery:', 'Disk (/):', 'Disk (/storage/emulated):', 'Date & Time:');
    # Send each line with colored values
    my $i = 0;
    for my $key ('OS', 'Memory', 'CPU', 'Battery', 'Disk (/)', 'Disk (/storage/emulated)', 'Date & Time') {
        chomp($data{$key}); # Remove newlines from fallback commands
        my $colored_value = "\x03" . $colors[$i % @colors] . $data{$key} . "\x0f";
        $witem->command("MSG " . $witem->{name} . " $labels[$i] " . $colored_value);
        $i++;
    }
}

  1. Register the /sysinfo command

Irssi::command_bind 'sysinfo' => sub {
    my ($data, $server, $witem) = @_;
    fetch_sysinfo($server, $witem);
};
print "Flexible Fastfetch Sysinfo script loaded. Use /sysinfo to display detailed system info!";

It kinda works. Some stuff runs together a bit.

curl wttr.in in irssi


Same thing as above, I tried getting a script to work that would display the current weather in my location in irssi.


use strict;
use vars qw($VERSION %IRSSI);
$VERSION = '1.1';
%IRSSI = (
    contact => 'N/A',
    name => 'Current Weather Fetcher',
    description => 'Fetches current weather for Warsaw, IN and sends it to the channel',
    license => 'Public Domain',
);
sub fetch_weather {
    my ($server, $witem) = @_;
    return unless $witem; # Ensure we're in a channel/window
    # Fetch only current weather using ?0 parameter
    my $weather = `curl -s wttr.in/warsaw,IN?u?0`;
    chomp($weather);
    if ($weather) {
        # Send the single-line current weather to the channel
        $witem->command("MSG " . $witem->{name} . " Current weather in Warsaw, IN: " . $weather);
    } else {
        $witem->command("MSG " . $witem->{name} . " Error: Could not fetch weather data.");
    }
}

  1. Register the /weather command

Irssi::command_bind 'weather' => sub {
    my ($data, $server, $witem) = @_;
    fetch_weather($server, $witem);
};
print "Current Weather Fetcher script loaded. Use /weather to display current Warsaw, IN weather!";

This one also half-ass works. I can't strip out the clouds/sun/rain that wttr.in displays.

lynx


Lynx is a text-based web browser designed for use in terminal environments, emphasizing accessibility, speed, and minimal resource usage. It renders web pages as plain text, stripping away images, JavaScript, and complex formatting, making it ideal for users who prioritize content over visual design or work in low-bandwidth or text-only systems.

I use it to access Gopher pages. To access them, you must type "lynx (address) into the termux command line.

Example:

lynx gopher://mozz.us:7003/

termux IRC client


See Termux IRC Client as all the code was moved there and will be updated more than this article.

bombadillo


Bombadillo is another Gopher browser for termux. It sucks. Don't use it.

AL east mlb standings


# Fetch AL East standings (division ID 201)
echo -e "${BLUE}${BOLD}MLB AL East Standings:${RESET}"
response=$(curl -s "http://statsapi.mlb.com/api/v1/standings?leagueId=103&season=2025")
teams=$(echo "$response" | jq '.records[] | select(.division.id==201)')

if [[ -n "$teams" && "$teams" != "null" ]]; then
    echo -e "${CYAN}Team                     W   L   PCT   GB${RESET}"
   echo -e "${YELLOW}--------------------------------------------------------------------------------------------------------${RESET}"
    echo "$teams" | jq -r '.teamRecords[] | "\(.team.name)|\(.wins)|\(.losses)|\(.winningPercentage)|\(.gamesBack)"' | while IFS='|' read -r team wins losses pct gb; do
        pct=$(echo "$pct" | sed 's/^\.//')
        if [[ "$gb" == "-" ]]; then
            printf "${GREEN}${BOLD}%-25s${RESET}${GREEN} %-3s %-3s .%-3s %-5s${RESET}\n" "$team" "$wins" "$losses" "$pct" "$gb"                                                                           else
            printf "${BOLD}%-25s${RESET} %-3s %-3s .%-3s %-5s\n" "$team" "$wins" "$losses" "$pct" "$gb"
        fi
    done
else
    echo -e "${RED}Standings unavailable${RESET}"
fi
echo

Welcome

# Network Status
echo -e "${BLUE}${BOLD}Network Status:${RESET}"
echo -e "${YELLOW}-------------------------------------------------------------------->
if curl -s --connect-timeout 3 google.com &> /dev/null; then
    ssid=$(termux-wifi-connectioninfo 2>/dev/null | jq -r '.ssid // "Unknown"' || echo>
    echo -e "${CYAN}Connected - Wi-Fi: ${ssid}${RESET}"
else
    echo -e "${RED}No internet connection${RESET}"
fi
echo


# Fetch historical event for today
month=$(date +%m | sed 's/^0//')  # Remove leading zero
day=$(date +%d | sed 's/^0//')    # Remove leading zero
echo -e "${BLUE}${BOLD}Happened on This Day:${RESET}"
echo -e "${YELLOW}-------------------------------------------------------------------->
history=$(curl -s "https://byabbe.se/on-this-day/$month/$day/events.json" | jq -r '.ev>
if [[ -n "$history" && ! "$history" =~ "null" ]]; then
    echo -e "${CYAN}${history}${RESET}"
else
    echo -e "${RED}No historical events available${RESET}"
fi
echo

# Show Quick Links
echo -e "${BLUE}${BOLD}Quick Links:${RESET}"
echo -e "${YELLOW}-------------------------------------------------------------------->
echo -e
echo -e "${RED}${BOLD} • https://bloggin.space/home/index.php/Main_Page${RESET}"
echo -e
echo -e "${CYAN}${BOLD} • https://bloggin.space/wiki/index.php/Main_Page${RESET}"
echo -e
echo -e "${GREEN}${BOLD} • https://x.com/home${RESET}"
echo -e
echo -e "${RED}${BOLD} • https://search.brave.com${RESET}"
echo -e
echo -e "${CYAN}${BOLD} • https://mail.hostinger.com/?_task=mail&_mbox=INBOX${RESET}"
echo

Welcome 2 (for the small tablet)


#!/data/data/com.termux/files/usr/bin/bashin

# Welcome Screen for Termux: Weather in Fort Wayne, IN and AL East MLB Standings

# Define ANSI color codes
BLUE="\033[0;34m"
CYAN="\033[0;36m"
YELLOW="\033[1;33m"
GREEN="\033[0;32m"
RED="\033[0;31m"
BOLD="\033[1m"
RESET="\033[0m"

echo -e "${BLUE}${BOLD}=== Sup Fuckos? ===${RESET}"

# Fetch weather for Fort Wayne, Indiana using wttr.in
echo -e "\n${CYAN}${BOLD}Current Weather in Fort Wayne, IN:${RESET}"
WEATHER=$(curl -s 'wttr.in/fort-wayne_indiana?0' 2>/dev/null)
if [ -z "$WEATHER" ]; then
  echo -e "${RED}Unable to fetch weather data. Check your internet connection.${RESET}"
else
  echo -e "${GREEN}${WEATHER}${RESET}"
fi

# Fetch AL East standings (division ID 201)
echo -e "\n${CYAN}${BOLD}MLB AL East Standings:${RESET}"
response=$(curl -s "http://statsapi.mlb.com/api/v1/standings?leagueId=103&season=2025" 2>/dev/null)
teams=$(echo "$response" | jq '.records[] | select(.division.id==201)')
if [[ -n "$teams" && "$teams" != "null" ]]; then
  echo -e "${CYAN}Team                     W   L   PCT   GB${RESET}"
  echo -e "${YELLOW}--------------------------------------------------------------------------------------------------------${RESET}"
  echo "$teams" | jq -r '.teamRecords[] | "\(.team.name)|\(.wins)|\(.losses)|\(.winningPercentage)|\(.gamesBack)"' | while IFS='|' read -r team wins losses pct gb; do
    # Remove leading dot from PCT and format to three digits
    pct=$(echo "$pct" | sed 's/^\.//')
    # Highlight leader (GB = "-")
    if [[ "$gb" == "-" ]]; then
      printf "${GREEN}${BOLD}%-25s %-3s %-3s .%-3s %-5s${RESET}\n" "$team" "$wins" "$losses" "$pct" "$gb"
    else
      printf "%-25s %-3s %-3s .%-3s %-5s\n" "$team" "$wins" "$losses" "$pct" "$gb"
    fi
  done
else
  echo -e "${RED}Standings unavailable. Check your internet connection or API status.${RESET}"
fi

echo -e "\n${BLUE}${BOLD}============================${RESET}"

SSH/Terminal Commands

Commands
SSH Command Explanation Notes
ls Show directory contents (list the names of files).
  • -l —  displays the details of the files, such as size, modified date and time, the owner, and the permissions.
  • -a —  shows hidden files and directories.
cd Change Directory. If you want to enter the home directory of your server, you can type: cd /home
mkdir Create a new folder (directory). Example: mkdir myfolder will create a folder called "myfolder."
touch Create new file. The file extension could be anything you want. You can even create a file with no extension at all.
rm Remove a file. To delete a folder, you need to use the -r option to remove all the files and subfolders inside it:

Example: rm -r home/myfolder

cat Show contents of a file. It also allows you to create a new file by merging multiple files.

Example: cat info.txt info2.txt > mergedinfo.text

pwd Show current directory (full path to where you are). pwd command can come in really handy when you are accessing your site hosting account through SSH. Oftentimes, shared servers don’t tell you the directory you are in.
cp Copy file or folder cp [options] [source] [destination]

If you want to make a copy in a different folder, run the following command: cp /home/hostinger/myfile.txt /home/etc/

  • -f — if you don’t have writing permission to the destination file, it’ll be deleted and the command will create a new file
  • -u — copy the source file if it is newer than the destination file.
  • -n — will not overwrite an existing file.
  • -a — archive the files.
mv Move a file or folder mv [source] [destination]

Example: mv /home/myfile.txt /home/files/myfolder

grep Search for phrase in a file grep 'line' info.txt

Keep in mind that this command is case sensitive. If you want to ignore letter cases, use -i option.

find Search files and directories find [starting directory] [options] [search term]
  • / (slash) — search the whole system
  • . (dot) — search the working directory
  • ~ (tilde) — search the home directory

[options] is an additional argument that you can use to refine your search. Some of the most popular options are:

  • -name — look for files based on their names
  • -user — search for files that belong to a given user
  • -size — look for files based on their sizes
vi/nano Text editors. nano [file name]
history Show last 50 used commands. This one is used to display the last used commands. You need to enter a number to limit the displayed results. Example: history 20
clear Clear the terminal screen. The function of clear command is simple — it clears all text from the terminal screen.
tar Create & Unpack compressed archives. To archive a folder in .tar.gz format, use the following command: tar -cvzf ArchiveName.tar.gz /path/to/directory

To unpack a .tar.gz file, enter this command: tar -xvzf FileName.tar.gz

  • x tells tar to extract files
  • c tells tar to create an archive
  • v stands for verbose. The option tells tar to display all file names that are processed by the command.
  • z instructs tar to uncompress the archive
  • f tells tar that you are supplying the name of the archive
wget Download files from the internet. wget http://fileurl/filename.ext
du Get file size. You can use du (Disk Usage) command to view the size of files and folders in a specified directory: du [directory path]
Fauccitrans.png
Termux is part of a series that involves THE SCIENCE

¤ Termux IRC Client SP ¤ Termux IRC Client GTV ¤ Termux IRC Client ¤ Termux ¤ original link ¤