Difference between revisions of "FreeBSD"

From Secure Computing Wiki
Jump to: navigation, search
m (Reverted edits by Esubiguxoc (talk) to last revision by Ecrist)
 
Line 1: Line 1:
----
 
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://yzobiwysac.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=
 
----
 
=[http://yzobiwysac.co.cc CLICK HERE]=
 
----
 
</div>
 
 
== Commands ==
 
== Commands ==
 
This is a table of useful commands gleaned out of mailing lists and personal experience.
 
This is a table of useful commands gleaned out of mailing lists and personal experience.
Line 15: Line 7:
 
|-
 
|-
 
| Find the date of the newest file in a directory.
 
| Find the date of the newest file in a directory.
| &lt;nowiki>find /some/dir -type f -printf "%T@^%h/%f\n" | awk -F^ '{ if ($1 > the_max) { the_max = $1; file_name = $2; } } END { print file_name }'&lt;/nowiki>
+
| <nowiki>find /some/dir -type f -printf "%T@^%h/%f\n" | awk -F^ '{ if ($1 > the_max) { the_max = $1; file_name = $2; } } END { print file_name }'</nowiki>
 
|-
 
|-
| || &lt;nowiki>ls -ltr /some/dir | tail -1 | awk '{print $6" "$7" "$8}'&lt;/nowiki>
+
| || <nowiki>ls -ltr /some/dir | tail -1 | awk '{print $6" "$7" "$8}'</nowiki>
 
|-
 
|-
| md5 all files in &lt;foo> directory and find matches
+
| md5 all files in <foo> directory and find matches
| &lt;nowiki>md5 -r ./&lt;foo> | sort | uniq -c&lt;/nowiki>
+
| <nowiki>md5 -r ./<foo> | sort | uniq -c</nowiki>
 
|-
 
|-
| Remove IP from interface.&lt;br />&lt;i>This works for the primary IP on an interface, too.&lt;/i>
+
| Remove IP from interface.<br /><i>This works for the primary IP on an interface, too.</i>
| ifconfig &lt;interface> &lt;IP> -alias
+
| ifconfig <interface> <IP> -alias
 
|}
 
|}
  
Line 32: Line 24:
  
 
To enable passive mode for fetch when using pkg_add, sent the environment variable ''FTP_PASSIVE_MODE'' to something.  If you use csh/tcsh, the following command will work:
 
To enable passive mode for fetch when using pkg_add, sent the environment variable ''FTP_PASSIVE_MODE'' to something.  If you use csh/tcsh, the following command will work:
&lt;pre># setenv FTP_PASSIVE_MODE 1&lt;/pre>
+
<pre># setenv FTP_PASSIVE_MODE 1</pre>
  
 
== Networking ==
 
== Networking ==
Line 42: Line 34:
 
* [[OpenVPN Server]]
 
* [[OpenVPN Server]]
 
* [[Traffic Shaping with pf/ALTQ]]
 
* [[Traffic Shaping with pf/ALTQ]]
* [[Bandwidth Monitoring with IPFW &amp; Cacti]]
+
* [[Bandwidth Monitoring with IPFW & Cacti]]
 
* [[NFS]]
 
* [[NFS]]
 
* [[pf]]
 
* [[pf]]
Line 58: Line 50:
 
=== System V ===
 
=== System V ===
 
In jails on 8.0-RELEASE+, the host system ''security.jail.sysvipc_allowed'' sysctl is ignored.  You can override this and enabled it with the following command, after a jail has started:
 
In jails on 8.0-RELEASE+, the host system ''security.jail.sysvipc_allowed'' sysctl is ignored.  You can override this and enabled it with the following command, after a jail has started:
&lt;pre>jail -m jid=&lt;JID> allow.sysvipc=1&lt;/pre>
+
<pre>jail -m jid=<JID> allow.sysvipc=1</pre>
  
 
== Errors ==
 
== Errors ==

Latest revision as of 17:33, 26 November 2010

Commands

This is a table of useful commands gleaned out of mailing lists and personal experience.

Command Description Command
Find the date of the newest file in a directory. find /some/dir -type f -printf "%T@^%h/%f\n" | awk -F^ '{ if ($1 > the_max) { the_max = $1; file_name = $2; } } END { print file_name }'
ls -ltr /some/dir | tail -1 | awk '{print $6" "$7" "$8}'
md5 all files in <foo> directory and find matches md5 -r ./<foo> | sort | uniq -c
Remove IP from interface.
This works for the primary IP on an interface, too.
ifconfig <interface> <IP> -alias

Management

To enable passive mode for fetch when using pkg_add, sent the environment variable FTP_PASSIVE_MODE to something. If you use csh/tcsh, the following command will work:

# setenv FTP_PASSIVE_MODE 1

Networking

Virtualization

Ports/Applications

  • You can look up what options were passed to configure at /var/db/ports/{prtname}/options.

Jails

Postgres

Read Me!

System V

In jails on 8.0-RELEASE+, the host system security.jail.sysvipc_allowed sysctl is ignored. You can override this and enabled it with the following command, after a jail has started:

jail -m jid=<JID> allow.sysvipc=1

Errors

Error Fix
Lookup of /dev for devfs, error: 2 The /dev directory was deleted/can't be found on the root filesystem. Recreate, reboot.

Building