freebsd

Getting GCC in C++11 mode to work on FreeBSD

不问归期 提交于 2019-12-05 06:13:38
How do I get a working GCC-based C++11 setup on FreeBSD 10? It seems that the standard library that comes with recent GCC versions on FreeBSD is broken. I've installed the port gcc49 and then try to compile this: #include <string> int main() { auto str = std::to_string(42); str = std::to_string(42ull); str = std::to_string(4.2); str.clear(); return 0; } This gives me an error: g++49 -v -std=c++11 foo.cc Using built-in specs. COLLECT_GCC=g++49 COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc49/gcc/x86_64-portbld-freebsd10.0/4.9.2/lto-wrapper Target: x86_64-portbld-freebsd10.0 Configured with: ./..

How to get list of open posix shared memory segments in FreeBSD

吃可爱长大的小学妹 提交于 2019-12-05 05:16:15
In linux i can get list of opened posix shared memory segments by getting /dev/shm directory listing. How do i programmatically get list of all opened posix shared memory segments in FreeBSD? Assuming segments opened with shm_open and i don't know even a part of a name that was used as a first argument of shm_open. You can't. See the comment in /sys/kern/uipc_shm.c: * TODO: * * (2) Need to export data to a userland tool via a sysctl. Should ipcs(1) * and ipcrm(1) be expanded or should new tools to manage both POSIX * kernel semaphores and POSIX shared memory be written? * * (3) Add support for

Elixir Phoenix production server has issue with Letsencrypt renewal

戏子无情 提交于 2019-12-04 18:07:47
问题 I have a site built with Elixir Phoenix frame work. The website runs fine in both dev and prod mode. When the phoenix server is running in dev mode, I have no issue renewingLet's Encrypt certificate, but when the exact same app is running in prod mode, I keep getting permission error when trying to renew. Please noted that I am talking about the exact same app, on the same FreeBSD server, executed by the same user - both command without sudo . The only difference is MIX_ENV=prod I also noted

Alternatives to make for linux/freebsd? [closed]

ぃ、小莉子 提交于 2019-12-04 17:48:01
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . What are some alternatives to make for linux/freebsd? 回答1: I like SCons. It is constructed in such a way that every build script (a SConstruct file) is also a syntactically valid Python program. So, you can build arbitrary Python logic into your build script if you need to. It's also much faster than make and

How to set Python version by default in FreeBSD?

我的梦境 提交于 2019-12-04 17:11:35
问题 I'm trying to install the application node, but by default in my environment is python 3 , and requires python 2.6 . How can I change the default python version in FreeBSD ? # cd /usr/local/bin # ls -l | grep python -r-xr-xr-x 2 root wheel 1246256 Jul 12 2011 python -r-xr-xr-x 2 root wheel 1401 Jul 12 2011 python-config -r-xr-xr-x 2 root wheel 6060 Jul 12 2011 python-shared -r-xr-xr-x 2 root wheel 1408 Jul 12 2011 python-shared-config -r-xr-xr-x 1 root wheel 3720 Jul 12 2011 python-shared2.6

Force a core to dump from an active, normally running program on FreeBSD

你。 提交于 2019-12-04 15:15:14
问题 I'm writing error handling code for a server on FreeBSD. For extremely serious errors I want to avoid data corruption by immediately terminating. That's easy, exit(3) . Before I exit, I output my relevant variables that led me there. However, ideally, this termination would be accompanied by a .core so that I could fully investigate what got me to this catastrophic (and likely hard to reproduce) state. How can I force this to happen? 回答1: kill -QUIT process_id will cause a core dump from a

Shell - one line query

隐身守侯 提交于 2019-12-04 10:04:58
问题 I need to execute a mysql query in one line using bash. It should be something like this: mysql database --user='root' --password='my-password' < query.file But instead of the < query.file it would like to use a raw query like this: mysql database --user='root' --password='my-password' < UPDATE `database` SET `field1` = '1' WHERE `id` = 1111; Is that possible? 回答1: Did you try mysql -u root -pmy_password -D DATABASENAME -e "UPDATE `database` SET `field1` = '1' WHERE `id` = 1111;" > output.txt

No module named MYSQLdb 问题解决

我的梦境 提交于 2019-12-04 09:33:27
问题描述: 报错:ImportError: No module named MySQLdb 对于不同的系统和程序有如下的解决方法: easy_install mysql-python (mix os) pip install mysql-python (mix os) apt-get install python-mysqldb (Linux Ubuntu) cd/usr/ports/databases/py-MySQLdb && make install clean (FreeBSD) yum install MySQL-python (linux Fedora, CentOS) pip install mysqlclient (Windows) 更多内容请参考下面的这两个链接: http://stackoverflow.com/questions/454854/no-module-named-mysqldb http://stackoverflow.com/questions/21440230/install-mysql-python-windows 来源: oschina 链接: https://my.oschina.net/u/2447363/blog/1540847

Forcing the order of output fields from cut command

▼魔方 西西 提交于 2019-12-04 08:26:38
问题 I want to do something like this: cat abcd.txt | cut -f 2,1 and I want the order to be 2 and then 1 in the output. On the machine I am testing (FreeBSD 6), this is not happening (its printing in 1,2 order). Can you tell me how to do this? I know I can always write a shell script to do this reversing, but I am looking for something using the 'cut' command options. I think I am using version 5.2.1 of coreutils containing cut. 回答1: This can't be done using cut . According to the man page:

Determine the process pid listening on a certain port

余生颓废 提交于 2019-12-04 07:29:31
问题 As the title says, I'm running multiple game servers, and every of them has the same name but different PID and the port number. I would like to match the PID of the server which is listening on certain port, and then I would like to kill this process. I need that in order to complete my bash script. Is that even possible? Because it didn't find yet any solutions on the web. 回答1: The -p flag of netstat gives you PID of the process: netstat -l -p Edit: The command that is needed to get PIDs of