Hot answers tagged

19 votes

Linux / BSD "quickly" wipe a USB drive?

The Linux command to remove all disklabel and file systems signatures is: wipefs -a /dev/sd### Most modern flash disks and flash USB sticks are supporting TRIM / DISCARD / SCSI UNMAP. For USB you ...
Mircea Vutcovici's user avatar
16 votes

Should I create ZFS zpools with whole disks or partitions?

Use one slice/partition dedicated for ZFS per physical disc and leave some space unpartitioned. That way if you ever need to replace a drive and the replacement is 10 sectors smaller, you'll still be ...
Grogi's user avatar
  • 309
15 votes
Accepted

BSD nc (netcat) does not terminate on EOF

I, too, was puzzled by netcat's behavior, so I dug into the code. Here's the whole story: nc servers (nc -l) and clients only exit after the mutual connection was closed. That is, if each of the ...
ens's user avatar
  • 265
15 votes
Accepted

Linux / BSD "quickly" wipe a USB drive?

The fastest way is to remove all partitions on the drive. This will "remove" also filesystems. And zero first megabyte (boot record and so). dd if=/dev/zero of=/dev/da0 bs=1M count=1 and ...
Romeo Ninov's user avatar
  • 5,553
10 votes

Linux / BSD "quickly" wipe a USB drive?

There's different kinds of USB storage devices. If your device supports it, blkdiscard /dev/da0 on Linux, or trim /dev/da0 on FreeBSD will tell the drive to just drop all data. That's going to be ...
Marcus Müller's user avatar
8 votes
Accepted

Install Java 9, 10, 11, or 12 on FreeBSD 11.1

Java 11 & 12 OpenJDK 11 and 12 can now be found in the Ports tree. See: java/openjdk11 java/openjdk12 An effort is underway to see future versions of OpenJDK for FreeBSD regularly made ...
arrowd's user avatar
  • 319
7 votes

Linux / BSD "quickly" wipe a USB drive?

I do not care about "securely" wiping the data I just want it wiped so I can re-establish the partition structure and filesystem from scratch Just run mkfs on the partitions.
symcbean's user avatar
  • 21.9k
6 votes
Accepted

Resize zfs pool

camcontrol reprobe da0 will reprobe. after that I only needed: zpool online -e tank da0
larsemil's user avatar
  • 299
5 votes

BSD nc (netcat) does not terminate on EOF

nc establishes a bi-directional connection. I.e. it sends stdin from host B to host A as well as the desired one from A to B. Use -d on host B to ignore stdin. -N on host A is still needed to close ...
georg's user avatar
  • 323
5 votes

Should I create ZFS zpools with whole disks or partitions?

People here claim you need to use whole disks to get disk write cache advantages, but that's not true. What is true is that ZFS will try to enable the disk write cache for you if you give it the whole ...
Mecki's user avatar
  • 889
4 votes

Symbolic Links and Multiple Mount Points

Alright... Let's attempt an answer to this question. The setup and master/skeleton directories The "root" directory of the jail system is /home/j. It contains 3+ subdirectories: /home/j/ |- ...
Tommiie's user avatar
  • 5,647
3 votes

What is the alternative to ls --time-style=full-iso in BSD?

I know this is an old question, but if you're on OS X you can install coreutils to get the GNU version of ls, which includes the --time-style option: brew install coreutils Note that by default the ...
shawkinaw's user avatar
  • 150
3 votes
Accepted

How to force Apache to skip binding to failed interface?

If you want Apache to listen on all IP addresses assigned to the machine you can simply specify a bind directive without any IP address, for example: Listen 80 If you need to bind to only a subset ...
kasperd's user avatar
  • 30.6k
3 votes

netcat -e: the GAPING_SECURITY_HOLE

While I've no definitive answer, I believe the gaping security hole is only present if your nc has -e enabled and is setuid root. (As nc is often used to bind to ports, it might be packaged setuid ...
00dani's user avatar
  • 131
3 votes
Accepted

Where is Apache's 000-default.conf in FreeBSD?

You probably mean sites-enabled/000-default Virtual Host, like in many Linux distributions. There isn't one. In FreeBSD, as described in the handbook, VirtualHosts are configured directly in /usr/...
Esa Jokinen's user avatar
  • 48.3k
3 votes
Accepted

How do you expand /var in pfsense when you run it in memory?

It's right there in front of your nose. :) Generally speaking, though, you should limit the amount of data you're storing on your pfsense instance. For logs, ship them off to another loghost for ...
EEAA's user avatar
  • 110k
3 votes
Accepted

Using bash shell when logging into FreeBSD ssh

If you simplify your command line, the shell likely won't matter. This should likely work ssh </some/filelist -i /home/user/.ssh/some_key user@freebsd11 xargs -n 1 stat -f \"%N;%c;%m\" | sort ...
John Sellens's user avatar
2 votes

Layer 3 routing based on HTTP packet content

The problem I see here is that you have to accept the TCP connection before you get to see the http request. So even if the system could use application level data it would not have that data at the ...
Peter Green's user avatar
  • 4,256
2 votes
Accepted

Layer 3 routing based on HTTP packet content

For BSD i would look into relayd(8) - its native to OpenBSD, but i believe FreeBSD has a port too. It is quite powerful and can do more than a few things (ex., proxy, load balancer, application ...
pete's user avatar
  • 723
2 votes

Using bash shell when logging into FreeBSD ssh

Use ansible. You don't need to add any additional software on the target machines and, arguably, it simplifies what you need to do. ansible uses standard ssh to connect to the machines, sudo, pfexec ...
dawud's user avatar
  • 15.2k
2 votes
Accepted

During OpenBSD installation, what is "DNS domain name" for?

It wants to know the domain name of the system, so that it can pair that with the hostname to come up with the system's full-qualified domain name (FQDN). See here. I'm guessing this is an ...
theglossy1's user avatar
2 votes
Accepted

Is XNU based on FreeBSD or OpenBSD?

From https://github.com/apple-oss-distributions/xnu What is XNU? XNU kernel is part of the Darwin operating system for use in macOS and iOS operating systems. XNU is an acronym for X is Not Unix. XNU ...
toppk's user avatar
  • 196
2 votes
Accepted

How to disable opensshd's self-introductory banner

The minimal identification string for the ssh protocol is: SSH-2.0- however OpenSSH will always send at least OpenSSH_*.*. If you want a more stealth behaviour you have several options: You can ...
Piotr P. Karwasz's user avatar
2 votes

Copy/Snyc files with extended attributes between Linux and BSD

Tar is probably your best bet, as you aren't running ZFS on the Linux box. Otherwise you could probably just zfs send/recv. But you can skip the temporary tarball and simply send the data in one shot:...
Michael Hampton's user avatar
1 vote

Force ZFS to ignore checksum errors without removing the offending disk

I myself willingly am shooting myself in the foot by using a USB enclosure, and because FreeNAS (well, FreeBSD) is rightfully angry at said enclosure for not implementing the SCSI protocol correctly (...
Tsaukpaetra's user avatar
1 vote

pf shortcuts for block quick

They are not. To be short, only two rules in the middle are valid, others are just a noise. from requires a pair of addresses and a to keyword, and the last rule is just a total nonense.
drookie's user avatar
  • 8,709
1 vote
Accepted

Default http proxy under FreeBSD

There's already an example of how to do this properly in the same file: :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\ you need to use the setenv setting, which can be a comma-separated list. :setenv=...
madeddie's user avatar
  • 418
1 vote

Should I create ZFS zpools with whole disks or partitions?

in my head this question arises because of doubt if i late can designate, what is on that disk... so when you create pool on whole drive (yes, with -f option, if needed), zpool practically create gpt ...
Taras Filatov's user avatar
1 vote

Installing and setting up SVN on FreeBSD Server

The latest version is available as port and pre-built package. To install the package, sudo pkg install subversion And make sure to read and follow the text with details.
gsl's user avatar
  • 143
1 vote

FreeBSD Jail own network stack with vimage

I'll dig up this bone for anyone who is curious. What I have done in the past is build a jail for each service I want isolated, and then ensure PF is running on the host (un-jailed). Then I can ...
Greg Schmit's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible