freebsd

FreeBSD下Mount总结

旧巷老猫 提交于 2019-12-03 01:45:50
NTFS-3G 读写驱动用法简介 先安装ntfs-3g 从ports或pkg_add -r都可以! 如果上述安装过程中没有出现错误,我们就可以用"读-写"方式挂载(mount) NTFS分区了: $ mount -t ntfs-3g /dev/ad0s1 /mnt/windows 或 $ ntfs-3g /dev/ad0s1 /mnt/windows 这里假设/dev/ad0s1是我们想要挂载的NTFS分区,/mnt/windows目录是我们事先建立好的挂载点。 如果需要文件名中文支持,必须设置'locale'选项,例如: $ mount -t ntfs-3g -o locale=zh_CN.UTF-8 /dev/ad0s1 /mnt/windows 如果需要在系统启动的时候自动挂载NTFS分区,可以修改"/etc/fstab"文件,在文件末尾加入 /dev/ad0s1 /mnt/windows ntfs-3g defaults 0 0 更多的选项和例子可以参考手册: $ man ntfs-3g 以下为系统默认自带 mount 工具 1.mount FAT/FAT32分区:(C盘为例) mount -t msdos /dev/ad0s1 /mnt 或 mount_msdos /dev/ad0s1 /mnt for 4.x mount_msdosfs /dev/ad0s1 /mnt

Generic Makefile not working on FreeBSD

匿名 (未验证) 提交于 2019-12-03 00:53:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Please note that this is not a duplicate of the other questions named generic makefile. I have followed all of the instructions on other questions about generic makefiles, and this is the code I have come up with from that: CFLAGS = -c CC = cc SOURCES = $(wildcard *.cc) OBJECTS = $(patsubst %.cc,%.o,%(SOURCES)) EXEC = run all: build clean build: $(OBJECTS) $(CC) $(OBJECTS) -o $(EXEC) %.o: %.cc $(CC) $(CFLAGS) $< clean: rm *.o However, when I execute make with a file called test.cc in my directory, it gives me the followig error: cc -o run cc

Does GPL code linking with proprietary library depend which is created first? [closed]

喜你入骨 提交于 2019-12-03 00:25:15
Microsoft creates their windows and MFC DLL library, etc. An open source develop write a new MFC application and release the source code as GPL. The app has to link with the MS DLL/libraries to run in Windows, but I don't think anyone can argue that we now have the right to force the Microsoft's GPL their DLL. Does this mean the GPL license is really depends on which one is "created" first? If proprietary library is created first (such as Windows DLLs) that is published without linking and any GPL code and later a GPL program is linked with it, then the GPL program can't convert the

How did WhatsApp achieve 2 million connections per server?

﹥>﹥吖頭↗ 提交于 2019-12-03 00:23:48
问题 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 concurrent connections on a "single server" using FreeBSD and ErLang. My understanding is that we will always need some support from the kernel. And yes, looks like the tweaked the FreeBSD to have this capability: hw.machine: amd64 hw.model: Intel(R)

How to color a prompt on FreeBSD/cshrc?

心不动则不痛 提交于 2019-12-03 00:19:07
I'm being put in charge of managing a bunch of servers, I want to set up my prompts on each of them so that I don't get confused as to where I am logged in to. I've edited my .cshrc files and put this in them: set prompt=`whoami`@`hostname -s`:$cwd'$ ' But I'd like to color that prompt so it stands out a bit more. Maybe green with white text or something. How can I do that? I'm not very familiar with the shell syntax. I'm SSH-ing in from the standard terminal that comes with Ubuntu, if that's relevant. mpen This page has a pretty good explanation, although the syntax is a bit different in csh

FreeBSD设置开机同步时间

匿名 (未验证) 提交于 2019-12-03 00:16:01
没有设置开机同步时间的话,重启之后时间不对。 如果装机时没正确设置时区,先设置时区: # tzsetup 用date命令手工设置时间一方面不方便,另一方面也依赖于本地管理员的时钟的正确性,那么网络上不同的管理员管理的计算机时间必然有偏差,不同计算机的时间偏差就会对一些要求时间同步的服务产生影响。解决这种问题的方法很简单,连接到一个能提供精确时间的服务器上进行时间同步。 当计算机连接到了Internet之后,那么就能同Internet上存在的很多时间服务器通信,以获得精确的时间。TCP/IP协议中,用于同步时间的协议为ntp协议,在Internet上提供ntp服务的站点有clepsydra.dec.com 、 ben.cs.wisc.edu、truechimer.waikato.ac.nz 等,虽然ntp协议本身考虑了网络延迟,然而网络延迟毕竟会对时间的精确性造成影响,因此应该选用一个离本地计算机最近的时间服务器。   使用/stand/sysinstall也能设定时间同步,可以根据地域来选择合适的时间服务器,然而由于网络连接并不一定和地域相一致,因此不能完全根据地域的远近来选择时间服务器。   使用ntp协议更新自己计算机上的时间的一个简单的应用程序为ntpdate,同样这也需要使用root权限执行: # ntpdate clepsydra.dec.com 设置/etc/ntp

Forcing the order of output fields from cut command

拜拜、爱过 提交于 2019-12-02 21:56:27
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. Lars Haugseth This can't be done using cut . According to the man page: Selected input is written in the same order that it is read, and is written exactly once. Patching

Using a numbered file descriptor from Java

余生长醉 提交于 2019-12-02 20:42:21
I need to access numbered file descriptors from Java -- other than 0, 1 or 2. How can this be done? I looked at the FileDescriptor class but did'nt find any way to initialize it with a given file descriptor number. As a concrete example lets suppose Java gets called as a child process from another programing language. File descriptors 3 and 4 are provided by the other language for input and output. What I need in Java are InputStream and OutputStream objects connected to these file-descriptors, just like System.in, System.out and System.error are connected to file-desctiptors 0, 1 and 2. I'm

Find files in multiple directories taken from list in a file?

家住魔仙堡 提交于 2019-12-02 19:37:53
问题 FreeBSD 9.2 RELEASE p2 I have a file fromdirs.txt . In this file is a new line separated directory list like so: /etc /home /home/goods/ I need to first find in all directory's files which have names like "good" or contain string "(NODES_'TASK')" and then copy all these files into the directory /tmp . 2.sh file chmod +x and is 755 fromDirs.txt file chmod +x and is 755 This code give me error IFS=$'\n' read -d '' -r -a dirs < fromDirs.txt find "${dirs[@]}" -type f \( -name '*good*' -o -exec

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

佐手、 提交于 2019-12-02 17:56:45
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 os.getenv . Or rather, it used to read them that way. On Windows, it worked fine. But on our FreeBSD servers, os.getenv returns None for all the parameters we passed in. The odd part is that os.environ has the values just fine—and, indeed, simply switching all os.getenv('foo') calls to os.environ['foo'] made everything work just fine on both platforms. Why