This entry is intended to replace the default FreeBSD MTA agent with one that is easier to manage. Because of its simplicity we are going to use SSMTP as it takes very few configuration lines.
To list all installed packages in FreeBSD, you can use pkg info command.
To list all installed packages in FreeBSD that are outdated, you can use pkg version -vL=
To clean package cache in FreeBSD, you can use pkg clean command. This will remove all old and unused packages from cache.
To remove orphaned packages in FreeBSD, you can use pkg autoremove command. This will remove all packages that are no longer required by any other package.
Unix system administration commonly consists of repeating common and similar operations on different sets of targets. The notion of using, and stringing together, building block primitives such as cat, sort, strings, wc, sed and awk is a core tenet of Unix philosophy. //
By incorporating the data into the script itself, one can create powerful system administration tools, in the form of simple shell scripts, that consist merely of a single file.
The basic organization of such a script is a set of one or more data items which are commented out, as they are not actual commands, but commented in such a way that they can be distinguished from normal comments:
01: #!/bin/sh
02: #
03: # Here is the data set, and perhaps we will add some other comments here
04: #
05: ##DATA var1 var2 var3
06: ##DATA var1 var2 var3
07: ##DATA var1 var2 var3
As you can see, normal comments are commented out with one # character, but data items are commented with ##. Not only does this allow us the ability to parse through the script and easily identify which lines are data lines (as opposed to normal comments), but it also allows us to quickly disable a data line that we temporarily do not wish to use. Simply remove one of the # characters from the data line that is not to be used - it will not be parsed because it has no leading ##, but it still starts with #, and thus does not affect the script as it is still commented out.
The body of the script consists of a variable defining the path of the script itself (obviously the script needs to know the path to itself if it is to parse itself), and then a while loop that reads in every line of the script, but filters out (using grep) only those lines that are data lines, which begin with ##DATA :
08: myself=/usr/local/bin/script.sh
09:
10: while read line
11: do
12:
13: if echo $line | grep "^##DATA"
14: then
15:
16: var1=`echo $line | awk '{print $2}'`
17: var2=`echo $line | awk '{print $3}'`
18: var3=`echo $line | awk '{print $4}'`
19:
20: diff $var1 $var2 >> $var3
21:
22: fi
23:
24: done < $myself
What is happening here is that the script, in line 08, defines the path to itself, and uses a "while read line" construct, the end of which in line 24 takes as input the name of the script itself. ...
The Depenguinator, version 2.0
In December 2003, I wrote a script for remotely upgrading a linux system to FreeBSD. I gave it a catchy name ("depenguinator", inspired by the "Antichickenator" in Baldur's Gate), announced it on a FreeBSD mailing list and on slashdot, and before long it was famous. Unfortunately, it didn't take long for changes in the layout of FreeBSD releases to make the depenguination script stop working; so for the past three years I have been receiving emails asking me to update it to work with newer FreeBSD releases.
A few weeks ago, Richard Bejtlich came forward with an offer to pay me to make the necessary improvements (money doesn't solve everything, but offering money certainly helps break the "I'll do it when I have some free time" / "I never have any free time" deadlock). In the end I asked him to arrange for a donation to the FreeBSD Foundation instead of paying me, but his offer was enough of a prompt for me to spend ten hours revising and testing the depenguinator.
Many computer systems around the world have been possessed by penguins; some have even been possessed by dead rats. In light of this, it is desireable to exorcize these evil spirits, and replace them with a nice, friendly daemon.
(More to the point, there are a number of dedicated server hosting companies which only offer Linux (or, in some cases, Linux and Windows); being able to remotely replace Linux with FreeBSD makes the (typically very low cost) offerings from these companies available to those who want to run FreeBSD.
I've put together some code for building a FreeBSD disk image which will boot into memory, configure the network, set a root password, and enable SSH. This can be used to "depenguinate" a Linux box, without requiring any access beyond a network connection.
The remainder of this page relates to the original (December 2003) version of my depenguinator. For a more recent version (which works with FreeBSD 7.0) see my blog post about my depenguinator version 2.0.
Welcome to the Mirror Services infrastruction site by BOINC Team Belgium. On here, you will find software mirrors of various Linux® and UNIX®-like operating systems distributions. The mirrors sync once an hour (or once per 2 hours for ISO mirros) using rsync with a Tier 0 or Tier 1 mirror
You can check the installation date of a FreeBSD server by looking at the /var/log/bsdinstall_log file, which typically contains a line indicating when the installation began.
Alternatively, you can use the command stat -f '%SB %N' / to see when the root filesystem was created, but this may not reflect the actual installation date if the system was modified later.
In tcsh, you can do:
(ls $argv > filelist) >& /dev/null
Note that >& redirects both stdout and stderr, but since stdout has already been redirected elsewhere only the stderr will make it through to /dev/null
Check Listening Ports with netstat
netstat is a command-line tool that can provide information about network connections.
To list all TCP or UDP ports that are being listened on, including the services using the ports and the socket status use the following command:
sudo netstat -tunlp
The options used in this command have the following meaning:
-t - Show TCP ports.
-u - Show UDP ports.
-n - Show numerical addresses instead of resolving hosts.
-l - Show only listening ports.
-p - Show the PID and name of the listener’s process. This information is shown only if you run the command as root or sudo user.
To check the CPU temperature on FreeBSD, you can use the command sysctl -a | grep temperature after loading the appropriate driver for your CPU type with kldload coretemp for Intel or kldload amdtemp for AMD processors. Make sure to add the driver to /boot/loader.conf for automatic loading at boot time.
You can list devices on FreeBSD using commands like geom disk list, camcontrol devlist, orgpart show to display information about the disks and their partitions.
geom part list shows the partitions in FreeBSD. Similarly geom md list will get you the "memory disk" devices
You can list devices on FreeBSD using commands like geom disk list, camcontrol devlist, or gpart show to display information about the disks and their partitions.
- The Linux screen command is a versatile tool that allows you to run terminal applications in the background and switch back to them when needed.
- It supports split-screen displays and can be used over SSH connections, even after disconnecting and reconnecting.
- With screen, you can create new windows, run multiple processes, detach and reattach sessions, and share sessions between multiple users in real-time.
With the Linux screen command, you can push running terminal applications to the background and pull them forward when you want to see them. It also supports split-screen displays and works over SSH connections, even after you disconnect and reconnect!
Here is another reverse lookups done using dig command:
$ dig -x ip-address-here
$ dig -x 75.126.153.206
FreeBSD uses try the drill command:
drill -Qx 54.184.50.208Any number of unwanted or troublesome behaviours may ensue.
mark_j said:
… possibly is a bug. Even if the file system is junk, the driver should time out and allow the process to be killed. …
Depending on the context of an error, it's not unusual for an operating system halt to fail in response to shutdown -p now.
shutdown(8)
Ideally: things should be more graceful.
Realistically: it's sometimes necessary to force off the power.
us.mirror.ionos.com
powered by IONOS Inc.
Hardware:
2x Intel Xeon Silver 4214R (2.4 GHz, 24 Cores, 48 Threads)
192 GByte RAM
246 TByte storage
20 GBit/sec network connectivity
Located in Karlsruhe / Germany
Software:
This server runs Debian GNU/Linux with:
Nginx
Samba rsync
I want to use a live USB iso of FreeBSD to mount my actual system ans change a config file.
My problem is, I can't mount it because I get an error thay says that the filesystem is "read only" (reffing to the ISO filesystem).
Is there another way to do it? Can I make the filesystem read-write?
T-Daemon Sep 7, 2024
Create a mount point under /tmp/, mount the file system there. /tmp is a tmpfs and rw.
Something broke. The VPS would not boot:
ZFS: out of temporary buffer space
So this sounds like a missing step in the automated upgrade flow. Normally, using new features in zpool is deferred until you choose to upgrade the pool after the reboot, so you get to see the warnings. At a guess (because I'm on FreeBSD 11.4 still), the OpenZFS migration forces the issue to do the zpool upgrade early and they missed the gpart requirement. //
boot from the current rescue disk
bring ifaces up
scp a current/13 zfsbootcode file
install that
//
gpart bootcode -p /root/Downloads/gptzfsboot -i<gpart index of freebsd-boot> <block device>
with that just use the correct path from gptzfsboot
or just dd if=/root/Downloads/gptzfsboot of=/dev/vtbd0p1 if you are brave
zfs: out of temporary buffer space
posted in: computer | 0
system: FreeBSD v13.0-p7
reason: the bootloader is broken (e.g. after update)
solution: reinstall the bootloader(s) to your boot disk(s)
- Boot from recent FreeBSD image
- find out the devicenames and boot partition number from your boot-disks
gpart show
(the partition named “freebsd-boot” is the boot partition on every disk) - reinstall the pMBR and GPT ZFS bootloader (for every booting disk)
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i <boot-partition-number> <devicename>
(e.g.gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0)
(e.g.gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1) - reboot
used sources:
Welcome to the ZFS Handbook, your definitive guide to mastering the ZFS file system on FreeBSD and Linux. Discover how ZFS can revolutionize your data storage with unmatched reliability, scalability, and advanced features.