<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://freebsdwiki.net/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://freebsdwiki.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gvtjongahung</id>
		<title>FreeBSDwiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://freebsdwiki.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gvtjongahung"/>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php/Special:Contributions/Gvtjongahung"/>
		<updated>2026-04-06T07:08:14Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.18.0</generator>

	<entry>
		<id>http://freebsdwiki.net/index.php/Jails</id>
		<title>Jails</title>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php/Jails"/>
				<updated>2007-08-22T22:39:02Z</updated>
		
		<summary type="html">&lt;p&gt;Gvtjongahung: /* Creating service jails */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A dedicated machine for a server is a costly thing. For a server which is not often used, it is desirable to still be able to use the same machine, but without the drawbacks of having all the servers on one installation. These are sometimes limited via chrooted servers. A better way is with the help of a jail.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating the jail ==&lt;br /&gt;
&lt;br /&gt;
Install cpdup ({PORTSDIR}/sysutils/cpdup)&lt;br /&gt;
 # pkg_add -r cpdup &lt;br /&gt;
Alternatively if that doesn't work try:&lt;br /&gt;
 # cd {PORTSDIR}/sysutils/cpdup &amp;amp;&amp;amp; make install clean&lt;br /&gt;
&lt;br /&gt;
Next create a template:&lt;br /&gt;
 # mkdir /usr/jail /usr/jail/mroot&lt;br /&gt;
 # cd /usr/src&lt;br /&gt;
 # make installworld DESTDIR=/usr/jail/mroot&lt;br /&gt;
 # cpdup /usr/src /usr/jail/mroot/usr/src&lt;br /&gt;
&lt;br /&gt;
 # mkdir /usr/jail/skel /usr/jail/skel/home /usr/jail/skel/distfiles&lt;br /&gt;
 # mv etc /usr/jail/skel&lt;br /&gt;
 # mv usr/local /usr/jail/skel/usr-local&lt;br /&gt;
 # mv tmp /usr/jail/skel&lt;br /&gt;
 # mv var /usr/jail/skel&lt;br /&gt;
 # mv root /usr/jail/skel&lt;br /&gt;
 # mergemaster -t /usr/jail/skel/var/tmp/temproot -D /usr/jail/skel -i&lt;br /&gt;
 # cd /usr/jail/skel&lt;br /&gt;
 # rm -R bin boot lib libexec mnt proc rescue sbin sys usr dev&lt;br /&gt;
 # cd /usr/jail/mroot&lt;br /&gt;
 # mkdir /usr/ports&lt;br /&gt;
 # mkdir s&lt;br /&gt;
 # ln -s s/etc etc&lt;br /&gt;
 # ln -s s/home home&lt;br /&gt;
 # ln -s s/root root&lt;br /&gt;
 # ln -s ../s/usr-local usr/local&lt;br /&gt;
 # ln -s ../s/usr-X11R6 usr/local&lt;br /&gt;
 # ln -s ../../s/distfiles usr/ports/distfiles&lt;br /&gt;
 # ln -s s/tmp tmp&lt;br /&gt;
 # ln -s s/var var&lt;br /&gt;
&lt;br /&gt;
Edit /etc/rc.conf:&lt;br /&gt;
 jail_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
 jail_set_hostname_allow=&amp;quot;NO&amp;quot;&lt;br /&gt;
 jail_list=&amp;quot;{server1} {server2}&amp;quot;&lt;br /&gt;
 jail_devfs_enable=&amp;quot;YES&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Search man 5 rc.conf for more jail settings&lt;br /&gt;
If you would like to have some standard configuration settings for (almost) all jails modify the files in /usr/jail/skel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Create a jail skeleton&lt;br /&gt;
&lt;br /&gt;
 # mkdir /usr/jails&lt;br /&gt;
&lt;br /&gt;
For every server:&lt;br /&gt;
* Edit /etc/fstab on your host system:&lt;br /&gt;
/usr/jail/mroot       /usr/jail/{server}     nullfs  ro  0   0&lt;br /&gt;
/usr/jails/{server}   /usr/jail/{server}/s   nullfs  rw  0   0&lt;br /&gt;
* Create the mount-points&lt;br /&gt;
# mkdir /usr/jail/{server}&lt;br /&gt;
# cpdup /usr/jail/skel /usr/jails/{server}&lt;br /&gt;
&lt;br /&gt;
* Edit /etc/rc.conf:&lt;br /&gt;
&lt;br /&gt;
 jail_{server}_hostname=&amp;quot;server.example.org&amp;quot;&lt;br /&gt;
 jail_{server}_ip=&amp;quot;192.168.x.x&amp;quot;&lt;br /&gt;
 jail_{server}_rootdir=&amp;quot;/usr/jail/{server}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Finally mount the jails and start them.&lt;br /&gt;
&lt;br /&gt;
 # mount -a&lt;br /&gt;
 # /etc/rc.d/jail start&lt;br /&gt;
&lt;br /&gt;
They should be running now and you should be able to see them by typing:&lt;br /&gt;
 jls&lt;br /&gt;
If you wish to access the system type:&lt;br /&gt;
 jexec tcsh {JID}&lt;br /&gt;
&lt;br /&gt;
One often creates a build jail in which one creates the packages for the separate jails creating less &amp;quot;pollution&amp;quot; in your jails.&lt;br /&gt;
One can now install the packages for the jail.&lt;br /&gt;
&lt;br /&gt;
[[Category: Configuring FreeBSD]]&lt;/div&gt;</summary>
		<author><name>Gvtjongahung</name></author>	</entry>

	<entry>
		<id>http://freebsdwiki.net/index.php/Grep</id>
		<title>Grep</title>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php/Grep"/>
				<updated>2007-08-22T21:38:59Z</updated>
		
		<summary type="html">&lt;p&gt;Gvtjongahung: cat | grep -&amp;gt; grep&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The basics ==&lt;br /&gt;
&lt;br /&gt;
[[grep]] returns results that match a string. You can use it to find a line in a file in a directory, by having grep run through the directory and show you what matches your query. Grep accepts input from the commandline, but is more often fed input in conjunction with other commands, such as [[find]], [[ls]] or [[cat]]:&lt;br /&gt;
&lt;br /&gt;
 samizdata#''' ls -la /etc | grep .conf'''&lt;br /&gt;
 -rw-r--r--   1 root  wheel      1163 Jun  5  2003 apmd.conf&lt;br /&gt;
 -rw-r--r--   1 root  wheel       271 Jun  5  2003 auth.conf&lt;br /&gt;
 -rw-r--r--   1 root  wheel      2965 Jun  5  2003 devd.conf&lt;br /&gt;
 -rw-r--r--   1 root  wheel      2073 Jun  5  2003 devfs.conf&lt;br /&gt;
 -rw-r--r--   1 root  wheel       267 Jun  5  2003 dhclient.conf&lt;br /&gt;
 -rw-r--r--   1 root  wheel      5159 Jun  5  2003 inetd.conf&lt;br /&gt;
 -rw-r--r--   1 root  wheel      6521 Jun  5  2003 login.conf&lt;br /&gt;
 -rw-r--r--   1 root  wheel     65536 Jun  5  2003 login.conf.db&lt;br /&gt;
 -rw-r--r--   1 root  wheel       503 Jun  5  2003 mac.conf&lt;br /&gt;
 -rw-r--r--   1 root  wheel       201 Jun  5  2003 make.conf&lt;br /&gt;
 -rw-r--r--   1 root  wheel       963 Jun  5  2003 manpath.config&lt;br /&gt;
 -rw-r--r--   1 root  wheel       963 Jun  5  2003 manpath.config.bak&lt;br /&gt;
 -rw-r--r--   1 root  wheel       783 Jun  5  2003 netconfig&lt;br /&gt;
 -rw-r--r--   1 root  wheel      1871 Jun  5  2003 newsyslog.conf&lt;br /&gt;
 -rw-------   1 root  wheel      1701 Jun  5  2003 nsmb.conf&lt;br /&gt;
 -rw-r--r--   1 root  wheel       630 Aug 23 21:46 rc.conf&lt;br /&gt;
 -rw-r--r--   1 root  wheel        45 Jun  5  2003 resolv.conf&lt;br /&gt;
 -rw-r--r--   1 root  wheel       367 Jun  5  2003 sysctl.conf&lt;br /&gt;
 -rw-r--r--   1 root  wheel      1329 Jun  5  2003 syslog.conf&lt;br /&gt;
 -rw-r--r--   1 root  wheel      2023 Jun  5  2003 usbd.conf&lt;br /&gt;
&lt;br /&gt;
Let's say you want to know which of your users has [[csh]] as their shell:&lt;br /&gt;
&lt;br /&gt;
 samizdata# '''grep csh /etc/passwd'''&lt;br /&gt;
 root:*:0:0:Avatar:/root:/bin/csh&lt;br /&gt;
 samizdata#&lt;br /&gt;
&lt;br /&gt;
Looks like only [[root]] does.&lt;br /&gt;
&lt;br /&gt;
==Producing results like [[find]] does==&lt;br /&gt;
&lt;br /&gt;
Let's say that you just want to see a list of all the files containing the word PATTERN, in this directory or in any directory below it:&lt;br /&gt;
&lt;br /&gt;
 server# '''grep -lr PATTERN *'''&lt;br /&gt;
&lt;br /&gt;
Perhaps you wanted to ''delete'' all files in this directory and all its subdirectories which contains the word PATTERN?&lt;br /&gt;
&lt;br /&gt;
 server# '''grep -lr PATTERN * | [[xargs]] rm'''&lt;br /&gt;
&lt;br /&gt;
Or move any file in this directory and all its subdirectories which contains a word ending in &amp;quot;temp&amp;quot; to the /tmp directory?&lt;br /&gt;
&lt;br /&gt;
 server# '''grep -Elr &amp;quot;.*temp&amp;quot; * | [[xargs]] -J % mv % /tmp'''&lt;br /&gt;
&lt;br /&gt;
==Other common uses of grep==&lt;br /&gt;
&lt;br /&gt;
'''grep -l pattern *''' to get only the filename of files that match in the current directory.&lt;br /&gt;
&lt;br /&gt;
'''grep -i pattern *''' to get lines that match inside files in the current directory. The &amp;quot;-i&amp;quot; is for case-insensitive so you'll match &amp;quot;Pattern&amp;quot; and &amp;quot;PATTERN&amp;quot; too.&lt;br /&gt;
&lt;br /&gt;
'''grep -l goodpattern * | grep -v badpattern ''' This use a [[Pipe]] to get grep output as the input of another grep; it gets you lines having goodpattern but not badpattern in the current directory (the &amp;quot;-v&amp;quot; means &amp;quot;non-matching instead of matching&amp;quot;). You can switch the two grep around if you like, but the directory to be searched must go to the leftmost grep after the pattern.&lt;br /&gt;
&lt;br /&gt;
'''grep -E &amp;quot;cat|dog|giraffe&amp;quot; pets.txt''' This will search the file pets.txt for any line including the patterns &amp;quot;cat&amp;quot;, &amp;quot;dog&amp;quot;, OR &amp;quot;giraffe&amp;quot;.  Very handy.  Note the '''-E''' argument - that specifies an extended regular expression; the &amp;quot;or&amp;quot; pipe construct doesn't work with basic regular expressions ('''grep''''s default regexp type).&lt;br /&gt;
&lt;br /&gt;
'''grep -f No-No-list *''' to get patterns from to match from the file 'No-No-list' instead of the command line. There can be hundreds of patterns listed in it (one per line). This is useful when looking for large sets of common typos, autodetection of swear words and known spam on wikis, and finding code snippets that have to be modified for compatibility purposes.&lt;br /&gt;
&lt;br /&gt;
See also: [[strings]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FreeBSD Terminology]] [[Category:System Commands]]&lt;/div&gt;</summary>
		<author><name>Gvtjongahung</name></author>	</entry>

	<entry>
		<id>http://freebsdwiki.net/index.php/Firefox</id>
		<title>Firefox</title>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php/Firefox"/>
				<updated>2007-08-22T09:27:05Z</updated>
		
		<summary type="html">&lt;p&gt;Gvtjongahung: /* Updated to use diablo JDK/JRE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Firefox is a great browser and this documentation relates to version 2.01&lt;br /&gt;
&lt;br /&gt;
==Installing video plugin==&lt;br /&gt;
Install the mplayer-plugin for mozilla&lt;br /&gt;
&lt;br /&gt;
 # cd /usr/ports/www/mplayer-plugin&lt;br /&gt;
 # make install&lt;br /&gt;
&lt;br /&gt;
mplayer plugin will support:&lt;br /&gt;
&lt;br /&gt;
Window Media  wmv, avi, asf, wav and asx&lt;br /&gt;
  QuickTime  mov and smil&lt;br /&gt;
  MPEG Video and Audio  mpeg and mp3&lt;br /&gt;
  Ogg Vorbis  ogg&lt;br /&gt;
  AutoDesk FLI  fli and flc&lt;br /&gt;
  Vivo  vivo&lt;br /&gt;
  Real Player  ram and rm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Installing Java VM plugin==&lt;br /&gt;
Install the Java Runtime Environment via ports ({PORTSDIR}/java/diablo-jre15) or the Java Development Kit ({PORTSDIR}/java/diablo-jre15)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then to add the plugin go to the directory:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /usr/X11R6/lib/browser_plugins&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
and if you installed the JRE type the following:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ln -s /usr/local/diablo-jre1.5.0/jre/plugin/i386/ns7/libjavaplugin_oji.so&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or if you installed the JDK type the following:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ln -s /usr/local/diablo-jdk1.5.0/jre/plugin/i386/ns7/libjavaplugin_oji.so&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now you should have java VM working.  To test go to this site and wait a while for the Java VM to load:&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.java.com/en/download/help/testvm.xml&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Installing flash on native firefox==&lt;br /&gt;
http://www.freebsdwiki.net/index.php/Flash#Native_Firefox&lt;br /&gt;
&lt;br /&gt;
[[Category:Ports_and_Packages]]&lt;/div&gt;</summary>
		<author><name>Gvtjongahung</name></author>	</entry>

	</feed>