Questions tagged [freebsd]

FreeBSD is an advanced Unix-like operating system for modern server, desktop, and embedded computer platforms. It is open source and licensed under the 2-clause BSD license.

This tag should be used for question pertaining specifically to the FreeBSD operating system. In keeping with the intent of Stack Overflow, this is limited to programming, not such things as use, installation, configuration, or maintenance.

Such questions generally belong on Super User if related to personal/workstation use, or on Server Fault if related to use as a server.

See Also

1914 questions
401
votes
25 answers

How can I get the behavior of GNU's readlink -f on a Mac?

On Linux, the readlink utility accepts an option -f that follows additional links. This doesn't seem to work on Mac and possibly BSD based systems. What would the equivalent be? Here's some debug information: $ which readlink; readlink…
troelskn
  • 107,146
  • 23
  • 127
  • 148
197
votes
11 answers

How to install packages offline?

What's the best way to download a python package and it's dependencies from pypi for offline installation on another machine? Is there any easy way to do this with pip or easy_install? I'm trying to install the requests library on a FreeBSD box that…
Chris Drantz
  • 1,973
  • 3
  • 11
  • 4
108
votes
6 answers

Check if string is neither empty nor space in shell script

I am trying to run the following shell script which is supposed to check if a string is neither space nor empty. However, I am getting the same output for all the 3 mentioned strings. I have tried using the "[[" syntax as well but to no avail. Here…
Shubhanshu Mishra
  • 4,850
  • 4
  • 18
  • 23
101
votes
8 answers

Determine the process pid listening on a certain port

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…
Cyclone
  • 13,241
  • 22
  • 76
  • 112
88
votes
9 answers

InetAddress.getLocalHost() throws UnknownHostException

I am testing our server-application (written Java) on different operating systems and thought that OpenSolaris (2008.11) would be the least troublesome due to the nice Java integration. Turns out I was wrong, as I end up with a…
jhwist
  • 13,623
  • 3
  • 37
  • 47
56
votes
10 answers

A way to determine a process's "real" memory usage, i.e. private dirty RSS?

Tools like 'ps' and 'top' report various kinds of memory usages, such as the VM size and the Resident Set Size. However, none of those are the "real" memory usage: Program code is shared between multiple instances of the same program. Shared…
Hongli
  • 17,912
  • 14
  • 73
  • 103
53
votes
3 answers

Why exit code 141 with grep -q?

Can someone explain why I get exit code 141 from the below? #!/usr/bin/bash set -o pipefail zfs list | grep tank echo a ${PIPESTATUS[@]} zfs list | grep -q tank echo b ${PIPESTATUS[@]} cat /etc/passwd | grep -q root echo c ${PIPESTATUS[@]} I…
Sandra Schlichting
  • 22,478
  • 28
  • 91
  • 145
51
votes
4 answers

Insert newline (\n) using sed

I am trying to scrub some lists into a properly formatted CSV file for database import. My starting file, looks something like this with what is supposed to be each "line" spanning multiple lines like below Mr. John Doe Exclusively Stuff, 186…
Allan
  • 824
  • 1
  • 8
  • 18
43
votes
9 answers

PostgreSQL failing peer authentication with Ansible

I am running PostgreSQL 9.3 on FreeBSD. FreeBSD uses pgsql as the default system user for PostgreSQL. My /usr/local/pgsql/data/pg_hba.conf looks like this: # TYPE DATABASE USER ADDRESS METHOD local all …
37
votes
1 answer

When would os.environ['foo'] not match os.getenv('foo')?

I have a small Python application, launched via subprocess.Popen, that takes some parameters in the form of environment variables. I do this by passing the environment structure into the Popen call. The program then reads the variables via…
Benjamin Pollack
  • 25,420
  • 16
  • 76
  • 102
37
votes
2 answers

Forcing the order of output fields from cut command

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…
Shreeni
  • 3,092
  • 7
  • 24
  • 39
35
votes
6 answers

What is equivalent of Linux's 'free' command on FreeBSD v8.1

What is equivalent of Linux's 'free' command on FreeBSD v8.1? I am calling 'free' from my application and reporting the results in my application's log file. What would be the replacement when porting to FreeBSD v8.1? Here is a sample run of 'free'…
WilliamKF
  • 36,283
  • 61
  • 170
  • 271
33
votes
2 answers

error : BOOST DISABLE THREADS

i have some problem with my boost library. i m using freebsd and installed my boost using ports. Boost version is : 1.45 and i use g++47 as compiler. Also i have never defined BOOST DISABLE THREADS at there :…
iyasar
  • 1,139
  • 2
  • 11
  • 25
33
votes
2 answers

How did WhatsApp achieve 2 million connections per server?

On Ubuntu, the maximum number of sockets which can be opened seems to be governed from following: $ cat /proc/sys/net/ipv4/tcp_max_orphans 262144 As per one of the presentations by Rick Reed (from WhatsApp), these guys took it up to 2 million…
Piyush Kansal
  • 1,111
  • 4
  • 17
  • 25
31
votes
3 answers

How to increase limits on sockets on osx for load testing?

I'm creating a load tester that uses libev to create lots of open tcp connections to an app i'm working on. Currently it bombs out at 256 connections, due to the nofiles limit: ulimit -n 256 I can increase this to 1024 by doing the below: ulimit -n…
Chris
  • 37,118
  • 43
  • 178
  • 226
1
2 3
99 100