freebsd

Determine if Makefile is executed with gmake

廉价感情. 提交于 2019-12-06 04:30:53
问题 Say on FreeBSD an application needs to be compiled with GNU make (gmake), not the standard system make. Is there any directive I could put to the Makefile to stop executing it and print an error if the Makefile is not compiled with gmake? 回答1: Call your makefile GNUmakefile. GNU Make will find it, but not other makes. The first name checked, GNUmakefile, is not recommended for most makefiles. You should use this name if you have a makefile that is specific to GNU make, and will not be

sed replace literal TAB

≯℡__Kan透↙ 提交于 2019-12-06 02:53:53
问题 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. 回答1:

freebsd配置sshd_conf文件

两盒软妹~` 提交于 2019-12-05 22:18:59
[toc] ##以下为sshd配置信息 root@freebsd:/etc/ssh # cd /etc/ssh/ root@freebsd:/etc/ssh # egrep -v '^$|^#' sshd_config PermitRootLogin yes #允许root远程登录 MaxAuthTries 6000 #认证次数 PubkeyAuthentication no #禁用公钥 PermitEmptyPasswords no #禁用空密码 UsePAM no #禁止使用PAM UseDNS no #禁止使用DNS Subsystem sftp /usr/libexec/sftp-server #远程ftp AllowTcpForwarding yes #允许tcp连接 PasswordAuthentication yes #开启密码验证 AllowUsers root #允许root登录 ##重启sshd服务 root@freebsd:/etc/ssh # /etc/rc.d/sshd restart Performing sanity check on sshd configuration. Stopping sshd. Waiting for PIDS: 5717. Performing sanity check on sshd configuration.

Difference in kqueue handling of fifos between Mac OS and FreeBSD?

青春壹個敷衍的年華 提交于 2019-12-05 19:51:43
I'm working on an application that uses fifos for IPC and uses an event-notification API (such as epoll or kqueue) to monitor the fifos for data to be read. The application expects that if the writer for a fifo terminates that the reader will receive an event via the event notification API, allowing the reader to notice that the writer terminated. I'm currently porting this application to macos and I'm running into some odd behavior with kqueue. I've been able to create a reproducer of this behavior: #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <string

PHP Unzip very large file

浪尽此生 提交于 2019-12-05 18:11:05
I have a zip file on the server. It's 1.1gb made up of thousands of small files. I do not have shell or root access to the server and can only use ftp and create php files.. so far I have tried exec and shell exec but none worked. The server is running free bsd. How can I unzip the file into the directory it is in? For a pure PHP solution, try PclZip - this would not require you to install any PHP extensions or require shell access - you just need to write access to wherever you want to extract the files. $filename = '/media/file.gz'; $unzipped_content = ''; $zd = gzopen($filename, "r"); while

kill - does it kill the process right away?

自作多情 提交于 2019-12-05 13:57:34
what does kill exactly do? I have a parent process which is creating 100 (as an example) child processes one after another. At the end of any child's job, I kill the child with kill(pid_of_child, SIGKILL) and I cannot see that in ps output. But if something goes wrong with the parent process and I exit from the parent process with exit(1) (at this point only 1 child is there - I can check tht in ps ), at that point I see a lot of <defunct> processes whose ppid is pid of parent process. How is that possible? did kill not kill the child processes entirely? kill doesn't kill anything . It sends

How do I find out the default server character set in mysql?

怎甘沉沦 提交于 2019-12-05 11:26:35
Using MySQL on FreeBSD 8.2. How do I find out the default server character set? Is there some command I can run or file I can check? UPDATE Actually I want to know how to find both the default server character set and the current server character set. As documented under Server Character Set and Collation : Initially, the server character set and collation depend on the options that you use when you start mysqld . You can use --character-set-server for the character set. Along with it, you can add --collation-server for the collation. If you don't specify a character set, that is the same as

sed extra characters at end of l command

帅比萌擦擦* 提交于 2019-12-05 10:54:02
I am trying replace value in a config file with sed in cshell. However it gives me the error: sed: 1: "/usr/local/etc/raddb/mo ...": extra characters at the end of l command I am trying the following command: sed -i "s/private_key_password = .*/private_key_password = test/" /usr/local/etc/raddb/mods-available/eap I have looked at examples of sed to do this but they all look similar with what I am doing, what is going wrong here? FreeBSD sed requires an argument after -i to rename the original file to. For example sed -i .orig 's/../../' file will rename he original file to file.orig , and save

Can ruby scripts be precompiled into a binary?

与世无争的帅哥 提交于 2019-12-05 07:46:21
I'm working on a Ruby script that will need to be deployed onto systems without a ruby interpreter. It will need to run on FreeBSD systems which uses the ELF format. I know there is a ruby2exe project to compile ruby scripts to run on Windows, but is it easy or even possible to do that on other operating systems? Have you checked whether Rubinius or JRuby would allow you to precompile your code? Aside from bytecode that requires a VM to run, Ruby cannot be compiled. It is an interpreted langauge and as such requires an interpreter. ruby2exe packages a ruby interpreter and runtime library with

MySQL Galera node not starting (aborting with Error 'WSREP: […]: 60: failed to reach primary view: 60 (Operation timed out)')

本小妞迷上赌 提交于 2019-12-05 07:28:33
I am trying to setup three Galera nodes on FreeBSD 10 with MySQL 5.6.26 and VirtualBox. When I set up everything and run MySQL, it exits after some time and cannot start properly. Here is my log: 2015-10-22 15:23:24 9402 [Note] WSREP: Read nil XID from storage engines, skipping position init 2015-10-22 15:23:24 9402 [Note] WSREP: wsrep_load(): loading provider library '/usr/local/lib/libgalera_smm.so' 2015-10-22 15:23:24 9402 [Note] WSREP: wsrep_load(): Galera 3.5(rXXXX) by Codership Oy <info@codership.com> loaded successfully. 2015-10-22 15:23:24 9402 [Note] WSREP: CRC-32C: using "slicing-by