Hot answers tagged

122

This will work in any Posix-compatible shell: ls good bad >/dev/null 2>&1 You have to redirect stdout first before duplicating it into stderr; if you duplicate it first, stderr will just point to what stdout originally pointed at. Bash, zsh and some other shells also provide the shortcut ls good bad &>/dev/null which is convenient on ...


19

You are using the Forsyth PD Korn shell, the usual login shell on OpenBSD. The PD Korn shell does not have a source command. The source built-in command is only available in some shells. The command that you want is the . command. Further reading What is the difference between '.' and 'source' in shells?


15

On 6.0 and below, add a mirror to the file /etc/pkg.conf: installpath = http://ftp.eu.openbsd.org/pub/OpenBSD/5.9/packages/amd64/ On 6.1 and later, use the file /etc/installurl: https://ftp.eu.openbsd.org/pub/OpenBSD/


15

That restriction is precisely documented. From: http://man.openbsd.org/awk.1#STANDARDS STANDARDS The awk utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification, except awk does not support {n,m} pattern matching.


14

OpenBSD and your VM are working right; you are mis-using the Google time source. This is in the OpenBSD Frequently Asked Questions and manual pages. You are synchronizing to a time source that publishes UTC time, sort of. But by default rdate assumes that your time source publishes TAI-10 time. TAI, a strict uniformly increasing count of all SI seconds ...


14

What is Pledge? pledge is a system call. Calling pledge in a program is to promise that the program will only use certain resources. Another way of saying is to limit the operation of a program to its needs, e.g., "I pledge not to use any other ports except port 63" "I pledge not to use any other system-call except lseek() and fork()" How does it ...


13

The best way to do this is to define a table and create a rule to block the hosts, in pf.conf: table <badhosts> persist block on fxp0 from <badhosts> to any And then dynamically add/delete IP addresses from it: $ pfctl -t badhosts -T add 1.2.3.4 $ pfctl -t badhosts -T delete 1.2.3.4 Other 'table' commands include flush (remove all), replace ...


12

The z option tells tar to decompress an archive using gunzip (or its internal equivalent), and is appropriate only for gzip-compressed archives, typically with a .tar.gz extension. To decompress archives using other compression formats, you can try tar xvf file to see if your tar is clever enough to figure things out on its own. If it isn't, you can ...


11

Just my 2 cents... It is more than true that spinning down the disks decreases their service life. Years of experience have shown that starting and stopping the disk motor causes far more fatigue than 24/7 spin. All my disks with big start/stop count have reallocated sectors and all my disks that spin 10 years 24/7 are (believe it or not) good as new. After ...


10

There is no correlation between the number of processes and the “clarity” of an operating system. You are comparing apples and gooseberries. On a Linux system, ps ax will show a lot of processes that consume no memory and have a name in square brackets, like this: root 2 0.0 0.0 0 0 ? S Nov02 0:01 [kthreadd] root 3 0....


10

You're question is pretty general, so I'll just take a little stab at the NetBSD part: The webpage of NetBSD's vax port lists supported machines (such as yours), many can use NetBSD 6.0.1, some are only supported in -current. It also points to VAXarchive, a website collection some information that might help you further. It also points to the vax port of ...


10

As hinted at in lo(4), you may create /etc/hostname.lo1: inet 127.0.0.2 255.0.0.0 This will create the lo1 interface when the boot process runs /etc/netstart. With that file in place, you may also set up the interface without rebooting through $ doas sh /etc/netstart lo1 The interface is reported as lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> ...


10

The source keyword which is available in bash is not part of the Posix standard. Instead you can use . myVenv/bin/activate You could use the same syntax with . in bash which you are using on your Linux system.


9

There is now vmm, which is OpenBSD's builtin virtualization solution. It is fully supported and probably the fastest solution on OpenBSD.


9

Don't build from source. I've been following current for several years. You can do binary upgrades to new snapshots. And you can do a direct binary upgrade from release/stable to current. Reboot. At the prompt type: boot bsd.rd Go through the motions of upgrading. When it asks for a hostname, I use this one, it's quite fast mirrors.sonic.net When it ...


8

That is the default you get if you leave it out. It comes from Charlie (the) Root (user) and I've seen it show up as a name over the years in articles and papers. Don't know where it orignated but at least before 1995. The & in the Gecos field is automatically replaced by root. It is mentioned e.g in Matt Bishops paper (page 6). And it has its own ...


8

I just wanted to add that you will get the same error message if your system time is off. I got the same error, tried using a mirror as Kusalananda suggested but still had SSL errors. I checked the system time, and it was about two weeks behind. Running ntpd -s fixed the issue and pkg_add worked again.


8

tl;dr; with newer versions of OpenSSH, you should use the -n option instead of -Z to set the principals (eg. hostname or user). Looking at the source code for ssh-keygen, the -Z option is accepted but seems to have something to do with a "format cipher" Yes, and the reason why you don't get an error is because that openssh_format_cipher variable is not ...


7

The number of running processes is not necessarily a good indicator for "clarity". Take, for example, FreeBSD's devd which uses a socket to communicate where udev uses D-Bus (and hence needs another dbus-daemon process). Process count: 1:2. But D-Bus brings in a lot more features and possibilities, many other system daemons use it (handled by the same ...


7

Perhaps Ctrl-a c and system_powerdown ? Supposed to work, although it didn't seem to work in my case; perhaps OpenBSD and QEMU ACPI don't interact well enough.


7

I haven't had the honour of playing with a VAX, but OpenBSD 5.2 has mg, a mini emacs clone. So if you can't compile emacs, mg should do. :)


7

Htop 2.0 adds OpenBSD support. I just compiled it on OpenBSD 5.9 and it works very well: http://hisham.hm/htop/


7

All users' crontabs are stored in a single directory, and users can't access that directory directly, they need to use the privileged command crontab. Instead of storing the actual crontab file in version control, write a commit hook that runs crontab to push the latest version. crontab "$HOSTNAME.crontab" The simplest hook would be a post-commit hook. ...


7

Your issue was that the httpd daemon was given an invalid command line argument (the string YES) when started using rcctl and therefore would not start properly. The only "special" value for the XXX_flags variables in /etc/rc.conf.local is the two letter string NO, which disables the corresponding service. This is the default value for most of ...


6

I have found that the following cronjob works for me. */5 * * * * /bin/touch /dev/sdb &>/dev/null Obviously update it with the device name of your disk. You can also vary the time based on how long your drive is idle before it powers down.


6

libvirt knows how to handle this. If you don't mind installing libvirtd and virsh, then you can use: virsh list to show the name(s) of the guest(s). And, to shutdown gracefully the guest with name guest_001, use the command: virsh shutdown guest_001


6

My answer is to the "any suggestions" part of your question. While you hunt down a terminal, note that if you have another computer with a serial port, you can use a null modem cable and a terminal emulator program to connect to the console. On windows you can use putty, tip on solaris, or minicom on linux. (if you have USB but no serial port, you can use ...


6

First things first: your hostname.urtwn0 file looks good and if you had a mistake in there you'd get completely different error messages. The message urtwn0: failed loadfirmware of file urtwn-rt18192cfwT (error 2) indicates that the firmware isn't installed in the proper location: As explained in loadfirmware(9), this function returns errno style error ...


6

You're using the wrong partition letter. Try with this: dd if=yourisofile.iso of=/dev/rsd1c Replace 1 by the correct number of your device (search this info in the dmesg). Read the Wikipedia article about BSD disklabels to learn why with the c works and with i doesn't.


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