Faceborg was developed using javascript technology too. Please enable javascript to get the website running properly.



 
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".
 
20231106 00:09



Some more shorcuts for the shell:

CTRL + E takes you the end of the command line.
CTRL + U deletes what you are typing in.
 
20231105 00:55


Quote:

Users of Unix operating systems are an interesting breed. They like to poke under the surface of things, to find out how things work, and to figure out new and interesting ways of accomplishing common computing tasks. In short, they like to "hack." -- from BSD Hacks, Dru Lavigne
 
20231105 00:46



How to use a pf ruleset file by a different name.

wiz$ nano /etc/rc.local

and insert in it the following:

pfctl -ef /etc/heropf.conf
#restoring securelevel..
sysctl kern.securelevel=2 # or 1
 
20231103 18:57


I finally *melt* my OpenBSD system targeting sticks of 32gb.

0. I prepared a note with the new stick layout I would like to realize.
1. copymachine: I copied my 16gb stick into my target stick.
2. fdisk: I growed size of the OpenBSD partition to 59000000 sectors.
3. disklabel: I incrised the OpenBSD boundaries to 59000000 sectors.
4. disklabel: I erased all the existing partitions.
5. disklabel: I created the new stick layout as from the note above.
6. I *newfs* all the data partitions.
7. I repeated for every partition needing to be data populated:

cd /tmp
umount /mnt/oldkey
umount /mnt/newkey
mount -t ffs /dev/sd1a /mnt/oldkey
mount -t ffs /dev/sd2a /mnt/newkey
cd /mnt/oldkey
pax -rw -pe . /mnt/newkey/

8. installboot: I launched it in this way to prevent any boot problem:

installboot -v -r /mnt/neykey sd2 /usr/mdec/biosboot /usr/mdec/boot

9. I updated /etc/fstab accordingly to new layout of the new stick
a. I rebooted the pc in the new stick to test the resulting system.
b. I recovered all the immutable flags on the pertaining files.

I hope this is helpful to someone.
 
20231101 10:28


OpenBSD Fundraising campaign 2023

https://typeme.in/l/obf2023



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