Faceborg       on github      for feedback       get support  
 
20231122 11:34


Adding to Tiny Tools the following:

checkmd5, an md5 checksum utility
check256, a sha256 checksum utility
 
20231117 18:46


Just added 'regextr' to Tiny Tools.

You can find below, in MagicPot1 or on https://github.com/par7133
 
20231115 00:12


OpenBSD Fundraising campaign 2023

https://typeme.in/l/obf2023
 
20231115 00:12


Hello,

I got inspired by the Tiny Tools article, by Gerald J. Holzmann, with some useful shell tools for coding on Unix-like systems.

The article is severals years old (I. Software, jan/feb 2016) and the code should be adapted to OpenBSD. But I tried to convert them: the code follows, it was uploaded in MagicPot1 like "Tiny-Tools" and it is on GitHub as well.
 
20231114 23:37


Code for the search variable utility "var"

#!/bin/sh

case $# in
1) (pcregrep -n "^[$]?$1[^\w]" * ; pcregrep -n " ? ?[$]?$1[^\w]" * ; pcregrep -n "[^\w'][$]?$1[^\w]" * ) | sort -un
;;
2) (pcregrep -n "^[$]?$1[^\w]" $2 ; pcregrep -n " ? ?[$]?$1[^\w]" $2 ; pcregrep -n "[^\w'][$]?$1[^\w]" $2 ) | sort -un
;;
*) echo "usage: var [identifier] [file]?"
exit 1
;;
esac
exit 0
 
20231114 21:31


Code for the search function utility "fun"

#!/bin/sh

case $# in
1) sed -n /function.$1/,/}/p *; sed -n /proc.$1/,/}/p *; sed -n /sub.$1/,/}/p *;
;;
2) sed -n /function.$1/,/}/p $2; sed -n /proc.$1/,/}/p $2; sed -n /sub.$1/,/}/p $2;
;;
*) echo "usage: fun fctname [filename]?"
exit 1
;;
esac
exit 0
 
20231114 11:11



Code for the printing utility "nana"

#!/bin/sh

if [ "X$1" = "X" ]; then
echo "usage: nana [[startline] [endline]]? [file]*"
exit
fi

if [ -f $1 ]
then

pr -t -n -m $*

else
O=`expr $1 - 1`
N=$2
M=`expr $2 - $O`

echo \<$3\>
pr -t -n $3 | head -n$N | tail -n$M
fi

 
20231114 00:29



Two more utilities from packages to debug your system:

lspci displays detailed information about all PCI buses and devices.

pkg_add pciutils

You can run it in this way:
wiz# lspci

dmidecode reports information about your system's hardware as described in your system BIOS

pkg_add dmidecode

You can run it in this way:
wiz# dmidecode | less

NB: dmidecode requires root access and access to the kernel memory (kern.allowkmem=1)
 
20231111 16:04


Pdf viewer made it simple:

Evince has a lighter version here named Evince Light.

Please, check your repo for exact package name.

 
20231110 06:06


Quote:

Despite Hollywood's best efforts, the maintanance of a secure computing environment remains unglamourous and largely unappreciated. -- from Unix and Linux System Administration Handbook
 
20231110 05:31


Useful tip to defend your exposed services.

phpfpm, mysql, memcached and so fourth.. listen to me: better to protect your services port range.

net.inet.ip.portfirst=12125

 
20231109 07:11


Install and run the antivirus

# Install the antivrus
pkg_add clamav

# Create the log file
touch /var/log/freshclam.log
chown _clamav:_clamav /var/log/freshclam.log

# Configure clamav..
# consider to leave Bytecode on a default=yes
nano /etc/freshclam.conf

# Update the antivirus engine..
freshclam

# Run the antivirus eg on /usr/local/libexec/
clamscan /usr/local/libexec/
etc.
 
20231107 01:18


The Italian calendar.

You can find it below, in MagicPot1.

To use it just copy from the calendar repo, /usr/share/calendar, your desired calendars - including the italian one - to ~/.calendar/.

Then create an index file "calendar", in the same folder, listing your calendars eg:

/*
* My own calendar files
*/

#ifndef _calendar_
#define _calendar_

#include <calendar.it>
#include <calendar.computer>

#endif /* !_calendar_ */


Then simply launch "calendar" or inside eg ~/.profile:

/usr/bin/calendar -A 5
 
20231106 22:38


Customize you prompt string.

If Korn shell is your default shell you can customize your prompt string very easily. Place in ~/.profile or ~/.kshrc, according to your setup something like that:

export PS1='\h@$PWD\$ '

\h is your hostname excluding the domain part.
$PWD return your working directory
\$ print a '#' for user root otherwise '$'

Whenever you want to return to the default:

export PS1='\h\$ '

Please refer to "man ksh" for the full list of parameters or backslash-escaped special characters to use.
 
20231106 21:09


Softdep *recalled* since release 7.4.

As per OpenBSD 7.4 release notes:

- Make the softdep mount(8) option a no-op. Softdep was a significant impediment to improving the vfs layer.

Marc Espie clarifys about softdep that "it is buggy a and it is not expected to make things faster again until it will be truely rock-solid".



   
  
Hash Me!
 
  Disclaimer. A 5 Mode project and WYSIWYG system. Some rights reserved.

 Coding: Italy 
 Server: Finland 
 Metrics: Russia