freebsd

sed replace literal TAB

别来无恙 提交于 2019-12-04 07:15:27
I want to replace TAB s in stdout with semicolons, by running sed from the ZSH shell. I understand one can normally (in other shells?) use: somecommand | sed 's/\t/;/g' However, this doesn't work for me in ZSH-shell under FreeBSD. The \t doesn't match the tabulators. Why is this? I've also tried multiple backslashes (up to 5). This does work: somecommand | sed 's/[TAB]/;/g' , where [TAB] is an actual TAB -character, inserted by entering Ctrl-V followed by the TAB button on my keyboard. Use of zsh has nothing to do with it. The \t is a GNU extension to the regular expressions used in sed. On a

Bash string explode [duplicate]

我是研究僧i 提交于 2019-12-04 05:25:06
问题 This question already has answers here : How do I split a string on a delimiter in Bash? (32 answers) Closed 11 months ago . My file looks like this: record=123 date=2012.01.20 10:22 In the bash file I do cat myfile.ini , and then I need to use something like explode, because I need ONLY to grep the 123 numeric record data, and nothing else. How it can be done in the bash ? 回答1: awk -F'=| ' '/record/ {print $2}' Substitute "date" for "record" in the command above to get the date (the time

How to install VMWare Tools for FreeBSD on ESXi...

主宰稳场 提交于 2019-12-04 04:50:03
Notes on installing VMWare Tools for FreeBSD on ESXi 4.1 Quick explanation: FreeBSD is not officially supported platform hence why the OS is listed as 'other' when creating a new Virtual Machine. However, the tools are contained withing the ESXi distribution, and here are the steps to install them. 1. Power on the virtual machine. 2. Select "Connect/disconnect the CD/DVD devices of the virtual machine" -> "Connect to ISO image on a datastore" (Select disconnect if was previously connect to a different ISO) -> Select "vmimages" -> "vmtools" -> "freebsd.iso" 3. Launch "Virtual Machine Console"

Warning: stream_socket_enable_crypto(): SSL operation failed with code 1

被刻印的时光 ゝ 提交于 2019-12-04 04:48:30
I have a problem with CSCart, it fails sending mail via google account. To check if there is a problem in server config or in CSCart's scripts I installed clean library PHPMailer and tried to send test message using example script. Result is the same: Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in [script path]/class.smtp.php on line 338 OpenSSL connection from console works good. FreeBSD 10.0, Apache24, php5.6. I could not find any information in google and

FreeBSD 12.1 开启 sshd 服务

孤街浪徒 提交于 2019-12-04 04:22:00
编辑 /etc/inetd.conf,去掉ssh前的#,保存退出. 编辑 /etc/rc.conf,最后加入 sshd_enable="yes" 即可 启动sshd服务 /etc/rc.d/sshd start #netstat -an 检查服务是否启动,22端口有无sshd服务监听。 编辑 /etc/ssh/sshd_config,修改如下内容 PermitRootLogin yes #允许root通过sshd登陆 PermitEmptyPasswords no #不允许空密码 PasswordAuthentication yes 重新启动sshd服务:/etc/rc.d/sshd restart。 来源: https://my.oschina.net/webcreazy/blog/3128017

Examples for reading text files in FreeBSD kernel module

穿精又带淫゛_ 提交于 2019-12-03 22:06:45
问题 Could anyone give some simple examples (function names are good) for reading text files line by line (binary is OK if text is really hard) in a FreeBSD kernel module, from a given directory? Really appreciate your kind help. 回答1: Here's a sample kernel module that'll cat your /etc/motd on load: // kernel module motd catter. // Doug Luce doug@forephypodia.con.com #include <sys/param.h> #include <sys/vnode.h> #include <sys/fcntl.h> #include <sys/module.h> #include <sys/kernel.h> #include <sys

FreeBSD虚拟机 VMware Tools 安装教程

淺唱寂寞╮ 提交于 2019-12-03 19:59:10
对于 FreeBSD 虚拟机,您可以使用 命令 行工具手动安装或升级 VMware Tools 前提条件 开启虚拟机。 确认客户机操作系统正在运行。 因为 VMware Tools 安装程序是使用 Perl 编写的,请确认已在客户机操作系统中安装 Perl。 过程 在主机上,从 Workstation Pro 菜单栏中选择虚拟机 > 安装 VMware Tools。 如果安装了早期版本的 VMware Tools,则菜单项是 更新 VMware Tools。 在虚拟机中,以 root 身份登录到客户机操作系统并打开终端窗口。 如果发行版本未自动装载 CD-ROM,请装载 VMware Tools 虚拟 CD-ROM 映像。 例如,键入 mount /cdrom。 转到工作目录,例如 /tmp。 cd /tmp 解压缩 VMware Tools .tar.gz 文件。 tar zxpf /cdrom/vmware-freebsd-tools.tar.gz 如果发行版本不使用自动装载,请卸载 VMware Tools 虚拟 CD-ROM 映像。 umount /cdrom 运行安装程序并配置 VMware Tools。 cd vmware-tools-distrib ./vmware-install.pl 通常,在安装程序文件结束运行后,将行 vmware-config-tools

Anonymous mmap zero-filled?

主宰稳场 提交于 2019-12-03 17:50:25
问题 This question was migrated from Unix & Linux Stack Exchange because it can be answered on Stack Overflow. Migrated 6 years ago . In Linux, the mmap(2) man page explains that an anonymous mapping . . . is not backed by any file; its contents are initialized to zero. The FreeBSD mmap(2) man page does not make a similar guarantee about zero-filling, though it does promise that bytes after the end of a file in a non-anonymous mapping are zero-filled. Which flavors of Unix promise to return zero

通过WinScp访问 FreeBSD的设定方法。

牧云@^-^@ 提交于 2019-12-03 15:29:19
In this case, i want to transfer data and maintenance my FreeBSD from other machine, Putty and WinSCP are choose to login from my XP. Login as a root #vi /etc/rc.conf make sure and insert this at the end sshd_enable=”YES” #vi /etc/ssh/sshd_config —> to configure sshd Find and change the line: “PasswordAuthentication no” to PasswordAuthentication yes, and root PermitRootLogin yes to login from winSCP / putty direct as a root. # /etc/rc.d/sshd restart and see sshd status as pid xxxx Finnaly, go to your putty / winSCP in other machine to login with user n password your FreeBSD 来源: oschina 链接:

How do I get a bash script working on FreeBSD, OpenBSD and Linux without modifying it?

爷,独闯天下 提交于 2019-12-03 13:16:11
Sorry, the headline might be a bit irritating, but I didn't know anything better. Anyway, I want a bash script to work on FreeBSD, OpenBSD and Linux without modifying it, but bash isn't located at the same place in Linux and BSD. So, if I write #!/bin/bash then it won't work on BSD, because the bash shell is located in /usr/local/bin/bash there. Is there any solution to get this script working on both? Or do I really need to ship two scripts with different paths...? Using env in the shebang ( #!/usr/bin/env bash ) should make the script OS agnostic. TGOGAM I like the answer about using #!/usr