<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>totalnetsolutions.net</title>
	<atom:link href="http://www.totalnetsolutions.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.totalnetsolutions.net</link>
	<description>totalnetsolutions.net - Complete Networking Solutions for business</description>
	<lastBuildDate>Wed, 16 May 2012 04:55:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Add Swap space to Solaris 10</title>
		<link>http://www.totalnetsolutions.net/2012/05/15/add-swap-space-to-solaris-10/</link>
		<comments>http://www.totalnetsolutions.net/2012/05/15/add-swap-space-to-solaris-10/#comments</comments>
		<pubDate>Wed, 16 May 2012 04:49:11 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[swap]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://www.totalnetsolutions.net/?p=102</guid>
		<description><![CDATA[I built a stock Solaris 10 VM in the lab a few weeks ago. After adding the fifth zone to it to host a NIS domain, it started suffering &#8220;out of memory&#8221; errors like the following: May 3 14:30:59 sol10-a tmpfs: [ID 518458 kern.warning] WARNING: /tmp: File system full, swap space limit exceeded May 3 [...]]]></description>
			<content:encoded><![CDATA[<p>I built a stock Solaris 10 VM in the lab a few weeks ago.  After adding the fifth zone to it to host a NIS domain, it started suffering &#8220;out of memory&#8221; errors like the following:<br />
<code>May  3 14:30:59 sol10-a tmpfs: [ID 518458 kern.warning] WARNING: /tmp: File system full, swap space limit exceeded<br />
May  3 14:31:53 sol10-a tmpfs: [ID 518458 kern.warning] WARNING: /zones/sol10-z5/root/etc/svc/volatile: File system full, swap space limit exceeded<br />
May  3 14:32:10 sol10-a tmpfs: [ID 518458 kern.warning] WARNING: /tmp: File system full, swap space limit exceeded<br />
May  3 14:32:34 sol10-a genunix: [ID 470503 kern.warning] WARNING: Sorry, no swap space to grow stack for pid 5650 (cron)<br />
</code></p>
<p>This is easy to fix if you know Solaris administration, but if not:<br />
<code>-bash-3.00# swap -l<br />
No swap devices configured</code></p>
<p>This is a problem.  The simple answer is to add more swap space, staring with a new disk to *host* the swap space.  I added a 2GB thin-provisioned disk to the ESX VM, rebooted it, then ran the following:<br />
<code>-bash-3.00# devfsadm<br />
-bash-3.00# format<br />
Searching for disks...done</p>
<p>AVAILABLE DISK SELECTIONS:<br />
       0. c1t0d0 <default cyl 4092 alt 2 hd 128 sec 32><br />
          /pci@0,0/pci15ad,1976@10/sd@0,0<br />
       1. c1t1d0 </default><default cyl 2085 alt 2 hd 255 sec 63>  zones<br />
          /pci@0,0/pci15ad,1976@10/sd@1,0<br />
       2. c1t2d0 </default><default cyl 1021 alt 2 hd 128 sec 32><br />
          /pci@0,0/pci15ad,1976@10/sd@2,0<br />
Specify disk (enter its number): 2<br />
selecting c1t2d0<br />
[disk formatted]</p>
<p>FORMAT MENU:<br />
        disk       - select a disk<br />
        type       - select (define) a disk type<br />
        partition  - select (define) a partition table<br />
        current    - describe the current disk<br />
        format     - format and analyze the disk<br />
        fdisk      - run the fdisk program<br />
        repair     - repair a defective sector<br />
        label      - write label to the disk<br />
        analyze    - surface analysis<br />
        defect     - defect list management<br />
        backup     - search for backup labels<br />
        verify     - read and display labels<br />
        save       - save new disk/partition definitions<br />
        inquiry    - show vendor, product and revision<br />
        volname    - set 8-character volume name<br />
        !<cmd>     - execute </cmd><cmd>, then return<br />
        quit<br />
format> fdisk<br />
No fdisk table exists. The default partition for the disk is:</p>
<p>  a 100% "SOLARIS System" partition</p>
<p>Type "y" to accept the default partition,  otherwise type "n" to edit the<br />
 partition table.<br />
y<br />
format> part</p>
<p>PARTITION MENU:<br />
        0      - change `0' partition<br />
        1      - change `1' partition<br />
        2      - change `2' partition<br />
        3      - change `3' partition<br />
        4      - change `4' partition<br />
        5      - change `5' partition<br />
        6      - change `6' partition<br />
        7      - change `7' partition<br />
        select - select a predefined table<br />
        modify - modify a predefined partition table<br />
        name   - name the current table<br />
        print  - display the current table<br />
        label  - write partition map and label to the disk<br />
        !</cmd><cmd> - execute </cmd><cmd>, then return<br />
        quit<br />
partition> print<br />
Current partition table (original):<br />
Total disk cylinders available: 1020 + 2 (reserved cylinders)</p>
<p>Part      Tag    Flag     Cylinders        Size            Blocks<br />
  0 unassigned    wm       0               0         (0/0/0)          0<br />
  1 unassigned    wm       0               0         (0/0/0)          0<br />
  2     backup    wu       0 - 1019        1.99GB    (1020/0/0) 4177920<br />
  3 unassigned    wm       0               0         (0/0/0)          0<br />
  4 unassigned    wm       0               0         (0/0/0)          0<br />
  5 unassigned    wm       0               0         (0/0/0)          0<br />
  6 unassigned    wm       0               0         (0/0/0)          0<br />
  7 unassigned    wm       0               0         (0/0/0)          0<br />
  8       boot    wu       0 -    0        2.00MB    (1/0/0)       4096<br />
  9 unassigned    wm       0               0         (0/0/0)          0</p>
<p>partition> 0<br />
Part      Tag    Flag     Cylinders        Size            Blocks<br />
  0 unassigned    wm       0               0         (0/0/0)          0</p>
<p>Enter partition id tag[unassigned]: swap<br />
Enter partition permission flags[wm]:<br />
Enter new starting cyl[1]:<br />
Enter partition size[0b, 0c, 1e, 0.00mb, 0.00gb]: 2g<br />
`2.00gb' is out of range<br />
Enter partition size[0b, 0c, 1e, 0.00mb, 0.00gb]: 1.99g<br />
partition> print<br />
Current partition table (unnamed):<br />
Total disk cylinders available: 1020 + 2 (reserved cylinders)</p>
<p>Part      Tag    Flag     Cylinders        Size            Blocks<br />
  0       swap    wm       1 - 1019        1.99GB    (1019/0/0) 4173824<br />
  1 unassigned    wm       0               0         (0/0/0)          0<br />
  2     backup    wu       0 - 1019        1.99GB    (1020/0/0) 4177920<br />
  3 unassigned    wm       0               0         (0/0/0)          0<br />
  4 unassigned    wm       0               0         (0/0/0)          0<br />
  5 unassigned    wm       0               0         (0/0/0)          0<br />
  6 unassigned    wm       0               0         (0/0/0)          0<br />
  7 unassigned    wm       0               0         (0/0/0)          0<br />
  8       boot    wu       0 -    0        2.00MB    (1/0/0)       4096<br />
  9 unassigned    wm       0               0         (0/0/0)          0<br />
                                                                                                                             [611/1860]<br />
partition> label<br />
Ready to label disk, continue? y</p>
<p>partition> quit</p>
<p>FORMAT MENU:<br />
        disk       - select a disk<br />
        type       - select (define) a disk type<br />
        partition  - select (define) a partition table<br />
        current    - describe the current disk<br />
        format     - format and analyze the disk<br />
        fdisk      - run the fdisk program<br />
        repair     - repair a defective sector<br />
        label      - write label to the disk<br />
        analyze    - surface analysis<br />
        defect     - defect list management<br />
        backup     - search for backup labels<br />
        verify     - read and display labels<br />
        save       - save new disk/partition definitions<br />
        inquiry    - show vendor, product and revision<br />
        volname    - set 8-character volume name<br />
        !</cmd><cmd>     - execute </cmd><cmd>, then return<br />
        quit<br />
format> label<br />
Ready to label disk, continue? y</p>
<p>format> quit<br />
-bash-3.00# swap -a /dev/dsk/c1t2d0s0<br />
-bash-3.00# swap -l<br />
swapfile             dev  swaplo blocks   free<br />
/dev/dsk/c1t2d0s0   32,192      8 4173816 4173816<br />
-bash-3.00# echo "/dev/dsk/c1t2d0s0       -       -       swap    -       no      -" >> /etc/vfstab<br />
</cmd></default></code></p>
<p>To recap:<br />
<code>devfsadm<br />
format<br />
2<br />
fdisk<br />
y<br />
part<br />
print<br />
0<br />
swap</p>
<p>1.99g<br />
label<br />
y<br />
quit<br />
label<br />
y<br />
quit<br />
swap -a /dev/dsk/c1t2d0s0<br />
swap -l<br />
echo "/dev/dsk/c1t2d0s0       -       -       swap    -       no      -" >> /etc/vfstab<br />
</code><br />
yes, one of those is a blank line to accept the default cylinder &#8220;1&#8243;.<br />
The info for this post was taken very directly from <a href="http://utahsysadmin.com/2008/04/10/how-to-add-a-swap-drive-to-solaris-10/">UtahSysAdmin.com</a>. Huge thank you to Kevin for his post, which I needed to modify slightly to get my VM running.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalnetsolutions.net/2012/05/15/add-swap-space-to-solaris-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LDIFDE.exe syntax error in the input file</title>
		<link>http://www.totalnetsolutions.net/2012/05/01/ldifde-exe-syntax-error-in-the-input-file/</link>
		<comments>http://www.totalnetsolutions.net/2012/05/01/ldifde-exe-syntax-error-in-the-input-file/#comments</comments>
		<pubDate>Tue, 01 May 2012 20:33:22 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Domain Controllers]]></category>
		<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://www.totalnetsolutions.net/?p=100</guid>
		<description><![CDATA[I spent more time than I&#8217;d care to admit trying to write an LDIF import file for a customer today. I started with a file provided by someone else, which is of course the root of my problem.  After adding the appropriate &#8221; &#8221; after each &#8220;:&#8221; character (which is absolutely required), when importing it, [...]]]></description>
			<content:encoded><![CDATA[<p>I spent more time than I&#8217;d care to admit trying to write an LDIF import file for a customer today. I started with a file provided by someone else, which is of course the root of my problem.  After adding the appropriate &#8221; &#8221; after each &#8220;:&#8221; character (which is absolutely required), when importing it, I was receiving the following error:</p>
<p><code>There is a syntax error in the input file<br />
Failed on line 21. The last token starts with '-'.<br />
An error has occurred in the program<br />
</code></p>
<p>So I opened the file in Notepad, and saw nothing wrong. I sent it back to the Linux box it came from, opened it in vi, verified it had dos line endings, and still saw nothing wrong with the format, according to the <a href="http://msdn.microsoft.com/en-us/library/ms677268%28v=VS.85%29.aspx" target="_blank">MSDN Document</a> on the subject of LDIF Schema modifications.</p>
<p>Only after scrolling through the file several times did I notice that line 20 wasn&#8217;t actually blank. it was a single horizontal tab character.</p>
<p>To recap:</p>
<ol>
<li>LDIF formatting is extremely specific, including breaking on whitespace appearance.</li>
<li>LDIF formatting is extremely specific, including breaking on whitespace missing.</li>
<li>LDIF formatting is extremely specific, including requiring the &#8220;-&#8221; to be a line literally on its own.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.totalnetsolutions.net/2012/05/01/ldifde-exe-syntax-error-in-the-input-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XS Version of Scalar::Util</title>
		<link>http://www.totalnetsolutions.net/2012/02/29/xs-version-of-scalarutil/</link>
		<comments>http://www.totalnetsolutions.net/2012/02/29/xs-version-of-scalarutil/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 17:56:14 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[POE]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[scalar]]></category>
		<category><![CDATA[scalar::util]]></category>

		<guid isPermaLink="false">http://www.totalnetsolutions.net/?p=95</guid>
		<description><![CDATA[We have a RHEL 5 box running some POE components that require the XS version of Scalar::Util.  However, the yum repos appear to have the non-XS version included, so every upgrade of perl breaks the Perl code that requires Scalar::Util. The fix is here: http://www.cybersprocket.com/2011/programming-languages/weaken-is-only-available-with-the-xs-version-of-scalarutil/ cpan > force install Scalar::Util But why is this? If [...]]]></description>
			<content:encoded><![CDATA[<p>We have a RHEL 5 box running some POE components that require the XS version of Scalar::Util.  However, the yum repos appear to have the non-XS version included, so every upgrade of perl breaks the Perl code that requires Scalar::Util.<br />
The fix is here:</p>
<p>http://www.cybersprocket.com/2011/programming-languages/weaken-is-only-available-with-the-xs-version-of-scalarutil/</p>
<p><code><br />
cpan<br />
> force install Scalar::Util<br />
</code></p>
<p>But why is this?  If you check out the &#8220;Diagnostics&#8221; section for Scalar::Util at <a href=http://search.cpan.org/~gbarr/Scalar-List-Utils-1.23/lib/Scalar/Util.pm target="_blank">CPAN</a>, you&#8217;ll see:<br />
<quote><br />
NAME is only available with the XS version of Scalar::Util</p>
<p>    Scalar::Util contains both perl and C implementations of many of its functions so that those without access to a C compiler may still use it. However some of the functions are only available when a C compiler was available to compile the XS version of the extension</quote></p>
<p>Meaning &#8211; the update from yum must install the perl-only impelementation for cross-compatibility.  What&#8217;s of most interest here is that &#8220;force install Scalar::Util&#8221; isn&#8217;t actually the full answer &#8211; you have to have gcc installed as well, so that there&#8217;s a C-compiler available during the CPAN forced reinstall.  In case your production systems don&#8217;t have gcc installed already.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalnetsolutions.net/2012/02/29/xs-version-of-scalarutil/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP mail(), Apache, and SELinux (FC7)</title>
		<link>http://www.totalnetsolutions.net/2012/02/23/php-mail-apache-and-selinux-fc7/</link>
		<comments>http://www.totalnetsolutions.net/2012/02/23/php-mail-apache-and-selinux-fc7/#comments</comments>
		<pubDate>Thu, 23 Feb 2012 21:47:36 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.totalnetsolutions.net/?p=93</guid>
		<description><![CDATA[(Originally drafted November 2nd, 2007, finally finished and posted much later) As I posted last night, we built a new Fedora Core 7 box last night for PHP testing. Whenever at all possible, I leave SELinux enabled on new systems in Enforcing mode. Oracle 10g hasn’t had any issues with it, Oracle 11i EBusiness Suite [...]]]></description>
			<content:encoded><![CDATA[<p>(Originally drafted <a href="http://web.archive.org/web/20091102075944/http://www.totalnetsolutions.net/2007/11/02/fedora-core-7-php-can%E2%80%99t-send-mail/">November 2nd, 2007</a>, finally finished and posted much later)<br />
As I posted last night, we built a new Fedora Core 7 box last night for PHP testing. Whenever at all possible, I leave SELinux enabled on new systems in Enforcing mode. Oracle 10g hasn’t had any issues with it, Oracle 11i EBusiness Suite hasn’t had any issues with it, and my NFS and FTP servers run without at hitch. The Oracle systems are RHEL4 (Red Hat Enterprise Linux 4), and the NFS and FTP servers are RHEL5.</p>
<p>However, this new PHP webserver caused a few glitches. I feel a little silly for not catching this as being an SELinux problem earlier, but since it’s caused 0 issues in 9 months of use in production, I didn’t even consider it initially.</p>
<p>What we initially saw was 0 errors from PHP – all the pages would run without error. PHP.ini has the following lines:</p>
<blockquote><p>sendmail_from = from@domain.com<br />
sendmail_path = /usr/sbin/sendmail -t -i</p></blockquote>
<p>and testing <code>cat mail.txt | /usr/sbin/sendmail -t -i</code> as a non-root user delivered mail properly as well. Combine that with /var/log/maillog being completely empty for every test page loaded, and it was sure that the mail wasn’t getting TO postfix (our preferred localhost MTA).</p>
<p>So, I looked at the /var/log/httpd/error_log for apache and found:</p>
<blockquote><p>sh: /usr/sbin/sendmail: Permission denied<br />
sh: /usr/sbin/sendmail: Permission denied<br />
sh: /usr/sbin/sendmail: Permission denied<br />
sh: /usr/sbin/sendmail: Permission denied<br />
sh: /usr/sbin/sendmail: Permission denied</p></blockquote>
<p>But I knew that non-root users could access sendmail as defined in php.ini, so I finally decided to tail /var/log/messages and saw:</p>
<blockquote><p>Nov 2 11:05:41 $(servername) setroubleshoot: SELinux is preventing the sh from using potentially mislabeled files sendmail.postfix (sendmail_exec_t). For complete SELinux messages. run sealert -l c9001c48-5d48-4b7c-9fd7-8400544daa8f</p></blockquote>
<p>So now to fix it…<br />
This is surprisingly simple, actually. The sad part is, we had this problem, fixed it, forgot about it, had it again, and I blogged it… and lost the post. so this has been sitting in my “drafts” folder for about 10 months now:<br />
<code>setsebool httpd_can_sendmail=true<br />
service httpd restart<br />
service postfix restart</code><br />
And retry sending mail. There’s a few posts about sendmail and having to change permissions on home directories or on “main.cf”, but I use postfix, and not sendmail, so I don’t know how effective or necessary those changes are.</p>
<p>&nbsp;</p>
<p>(Edit: repost on 2/23/2012 because of a DB problem losing the original)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalnetsolutions.net/2012/02/23/php-mail-apache-and-selinux-fc7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Network packet capture on different OSes</title>
		<link>http://www.totalnetsolutions.net/2012/02/23/network-packet-capture-on-different-oses/</link>
		<comments>http://www.totalnetsolutions.net/2012/02/23/network-packet-capture-on-different-oses/#comments</comments>
		<pubDate>Thu, 23 Feb 2012 21:45:39 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[capture]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[hp-ux]]></category>
		<category><![CDATA[hpux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[tcpdump]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.totalnetsolutions.net/?p=92</guid>
		<description><![CDATA[I ran into a problem 2 years ago where I couldn’t remember the native packet capture tool for Solaris and couldn’t install tcpdump, so i thought I’d put down as many as many native packet capture commands as I knew, by OS, in a single place.  I’ll update this as I find more, since there’s [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a problem 2 years ago where I couldn’t remember the native packet capture tool for Solaris and couldn’t install tcpdump, so i thought I’d put down as many as many native packet capture commands as I knew, by OS, in a single place.  I’ll update this as I find more, since there’s hundreds of Operating systems out there.</p>
<ul>
<li>AIX: <a href="http://web.archive.org/web/20091102075944/http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/com.ibm.aix.cmds/doc/aixcmds3/iptrace.htm" target="_blank">iptrace:</a> /usr/sbin/iptrace [ -a ] [ -b ][ -e ] [ -u ] [ -PProtocol_list ] [ -iInterface ] [ -pPort_list ] [ -sHost [ -b ] ] [ -dHost ] [ -L Log_size ] [ -B ] [ -T ] [ -S snap_length] LogFile</li>
<li>FreeBSD: <a href="http://web.archive.org/web/20091102075944/http://www.manpages.info/freebsd/tcpdump.1.html" target="_blank">tcpdump (I think):</a> tcpdump [ -adeflnNOpqRStuvxX ] [ -c count ] [ -C file_size ] [ -F file ] [ -i interface ] [ -m module ] [ -r file ] [ -s snaplen ] [ -T type ] [ -w file ] [ -E algo:secret ] [ expression ]</li>
<li>HP-UX: <a href="http://web.archive.org/web/20091102075944/http://docs.hp.com/en/B2355-60130/nettl.1M.html" target="_blank">nettl:</a> nettl requires a daemon start, and other setup: /usr/sbin/nettl -traceon kind… -entity subsystem… [-card dev_name...] [-file tracename] [-m bytes] [-size portsize] [-tracemax maxsize] [-n num_files] [-mem init_mem [max_mem]] [-bind cpu_id] [-timer timer_value]</li>
<li>Linux 2.4 and higher:
<ul>
<li><a href="http://web.archive.org/web/20091102075944/http://linux.die.net/man/8/tcpdump" target="_blank">tcpdump (some distros): </a>tcpdump [ -AdDefKlLnNOpqRStuUvxX ] [ -c count ] [ -C file_size ] [ -G rotate_seconds ] [ -F file ] [ -i interface ] [ -m module ] [ -M secret ] [ -r file ] [ -s snaplen ] [ -T type ] [ -w file ] [ -W filecount ] [ -E spi@ipaddr algo:secret,... ] [ -y datalinktype ] [ -z postrotate-command ] [ -Z user ] [ expression ]</li>
<li><a href="http://web.archive.org/web/20091102075944/http://wiki.wireshark.org/CaptureSetup" target="_blank">wireshark (some distros, used to be called “ethereal”): </a>GUI-config, no command-line, use tethereal (now tshark) for that</li>
<li><a title="tshark" href="http://web.archive.org/web/20091102075944/http://www.wireshark.org/docs/man-pages/tshark.html" target="_blank">tshark</a>: tshark [ -a &lt;capture autostop condition&gt; ] … [ -b &lt;capture ring buffer option&gt;] … [ -B &lt;capture buffer size (Win32 only)&gt; ]  [ -c &lt;capture packet count&gt; ] [ -C &lt;configuration profile&gt; ] [ -d &lt;layer type&gt;==&lt;selector&gt;,&lt;decode-as protocol&gt; ] [ -D ] [ -e &lt;field&gt; ] [ -E &lt;field print option&gt; ] [ -f &lt;capture filter&gt; ] [ -F &lt;file format&gt; ] [ -h ] [ -i &lt;capture interface&gt;|- ] [ -l ] [ -L ] [ -n ] [ -N &lt;name resolving flags&gt; ] [ -o &lt;preference setting&gt; ] … [ -p ] [ -q ] [ -r &lt;infile&gt; ] [ -R &lt;read (display) filter&gt; ] [ -s &lt;capture snaplen&gt; ] [ -S ] [ -t ad|a|r|d|e ] [ -T pdml|psml|ps|text|fields ] [ -v ] [ -V ] [ -w &lt;outfile&gt;|- ] [ -x ] [ -X &lt;eXtension option&gt;] [ -y &lt;capture link type&gt; ] [ -z &lt;statistics&gt; ] [ &lt;capture filter&gt; ]</li>
</ul>
</li>
<li>Mac OSX: <a href="http://web.archive.org/web/20091102075944/http://developer.apple.com/qa/qa2001/qa1176.html" target="_blank">tcpdump (among others): </a>tcpdump [ -adeflnNOpqRStuvxX ] [ -c count ] [ -C file_size ] [ -F file ] [ -i interface ] [ -m module ] [ -r file ] [ -s snaplen ] [ -T type ] [ -w file ] [ -E algo:secret ] [ expression ]</li>
<li>Solaris: <a href="http://web.archive.org/web/20091102075944/http://www.bga.org/%7Elessem/psyc5112/usail/man/solaris/snoop.1.html" target="_blank">snoop:</a> snoop [ -aPDSvVNC ] [ -d device ] [ -s snaplen ] [ -c maxcount ] [ -i filename ] [ -o filename ] [ -n filename ] [ -t [ r | a | d ] ] [ -p first [ , last ] ] [ -x offset [ , length ] ] [ expression ]</li>
<li>Windows 2000, XP, 2003, Vista, 2008 and beyond:
<ul>
<li><a href="http://web.archive.org/web/20091102075944/http://support.microsoft.com/kb/294818" target="_blank">netmon (not installed by default):</a> GUI config, <a href="http://web.archive.org/web/20091102075944/http://support.microsoft.com/kb/231920/EN-US/" target="_blank">filter creation info here</a></li>
<li><a href="http://web.archive.org/web/20091102075944/http://wiki.wireshark.org/CaptureSetup" target="_blank">wireshark (available by download):</a> GUI-config, no command-line</li>
</ul>
</li>
</ul>
<p>Any others anyone wants added (or corrected), just comment or email and I’ll update this.<br />
(Edit 7/29/08 – change tcpdump link)<br />
(Edit 10/13/08 – add tshark info, thanks Jefferson!, and wireshark on Windows)<br />
(Edit 2/23/2012 &#8211; repost since a DB problem lost this post.  Thanks wayback machine!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalnetsolutions.net/2012/02/23/network-packet-capture-on-different-oses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What date is XX days from today?</title>
		<link>http://www.totalnetsolutions.net/2012/01/25/what-date-is-xx-days-from-today/</link>
		<comments>http://www.totalnetsolutions.net/2012/01/25/what-date-is-xx-days-from-today/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 03:30:27 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.totalnetsolutions.net/?p=89</guid>
		<description><![CDATA[A quick CLI reference for perl people&#8230; perl -e ' my @t=localtime(time() + $ARGV[0]*24*60*60); $t[4]++; $t[5]+=1900; print "$t[4]/$t[3]/$t[5]\n";' XX I&#8217;ve needed this 2x today already, and hope it helps you! Edit: Someone made a comment, as people on the internet are prone to do, so here&#8217;s the long-form non-one-liner version: #!/usr/bin/perl my $addDays = shift; [...]]]></description>
			<content:encoded><![CDATA[<p>A quick CLI reference for perl people&#8230;<br />
<code><br />
perl -e ' my @t=localtime(time() + $ARGV[0]*24*60*60); $t[4]++; $t[5]+=1900; print "$t[4]/$t[3]/$t[5]\n";' XX<br />
</code><br />
I&#8217;ve needed this 2x today already, and hope it helps you!</p>
<p>Edit:<br />
Someone made a comment, as people on the internet are prone to do, so here&#8217;s the long-form non-one-liner version:</p>
<p><code><br />
#!/usr/bin/perl<br />
my $addDays = shift;<br />
my ($second, $minute, $hour, $day, $month, $year, $dayOfWeek, $dayOfYear, $daylightSavings) = localtime(time());<br />
my ($fsecond, $fminute, $fhour, $fday, $fmonth, $fyear, $fdayOfWeek, $fdayOfYear, $fdaylightSavings) = localtime(time() + $addDays*24*60*60);</p>
<p>#fix 0 = 1 values, and "0 = 1900" problem:<br />
$month++;<br />
$fmonth++;<br />
$year+=1900;<br />
$fyear+=1900;</p>
<p>print "today is:                    $month/$day/$year\n";<br />
print "$addDays days from today is: $fmonth/$fday/$fyear\n";<br />
</code></p>
<p>Run it as:<br />
<code><br />
rob@laptop:~$ fdate.pl 50<br />
today is:              1/25/2012<br />
50 days from today is: 3/15/2012<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalnetsolutions.net/2012/01/25/what-date-is-xx-days-from-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic MTU in Debian/Ubuntu</title>
		<link>http://www.totalnetsolutions.net/2011/10/05/dynamic-mtu-in-debianubuntu/</link>
		<comments>http://www.totalnetsolutions.net/2011/10/05/dynamic-mtu-in-debianubuntu/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 19:53:00 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.totalnetsolutions.net/?p=85</guid>
		<description><![CDATA[I know it&#8217;s probably an unusual situation, but in the lab we have Jumbo frames turned on for all the servers and test boxes. It makes a huge difference copying ISOs between hosts, and doing network backups. However, my Kubuntu laptop isn&#8217;t always in the lab network. This means that I almost never remember to [...]]]></description>
			<content:encoded><![CDATA[<p>I know it&#8217;s probably an unusual situation, but in the lab we have Jumbo frames turned on for all the servers and test boxes.  It makes a huge difference copying ISOs between hosts, and doing network backups.  However, my Kubuntu laptop isn&#8217;t always in the lab network.  This means that I almost never remember to change the MTU when I&#8217;m back in the office, OR I remember in the middle of a transfer, when it&#8217;s already too late to gain the benefits.</p>
<p>So I wrote a little script, and put it in /etc/network/if-up.d/ named &#8220;jumbo-frames.sh&#8221;.  The if-*.d/ structure is designed for exactly this purpose: run a script when an interface comes up.  The basic premise is: If I&#8217;m plugged into a wired network (eth0) in the lab (domain or IP address match certain parameters), then set the MTU to 9000 (jumbo frame support), otherwise assume the network has a normal MTU (1500).  This allows the system to reconfigure on the fly if I put it to sleep and go visit a customer.</p>
<p>Here&#8217;s the code:<br />
<code><br />
#!/bin/sh<br />
# Set support for jumbo frames when at home on wired network, else do not.<br />
# Determine home network based on IP address and DNS-determined name.<br />
# $IFACE should be set by the caller.</p>
<p>PATH=/sbin:/bin:/usr/sbin:/usr/bin</p>
<p>IFC=/sbin/ifconfig<br />
INT="eth0"<br />
MTU=9000<br />
DEFMTU=1500<br />
#name of the DNS domain to assume as "home"<br />
HOMED="totalnetsolutions.net"<br />
#IP Subnet to assume as "home" if DNS test fails<br />
HOMEN="10.0.0."</p>
<p>test -x $IFC || exit 0</p>
<p># Don't make changes to the wireless (wlan) or loopback (lo) interfaces<br />
if [ "$IFACE" != "$INT" ]; then<br />
    exit 0<br />
fi</p>
<p># if dhcpd is still working on writing our resolv.conf, just wait a while (it's a hack, but it works).<br />
test -f /etc/resolv.conf || sleep 15</p>
<p>DOM=`awk '/search/ { print $2 }' /etc/resolv.conf`<br />
NET=`ip addr show dev $IFACE | awk '/inet / { print $2 }' | awk -F. '{ print $1 "." $2 "." $3 "." }'`</p>
<p>if [ "$DOM" = "$HOMED" ]; then<br />
    $IFC $IFACE mtu $MTU<br />
elif [ "$NET" = "$HOMEN" ]; then<br />
    $IFC $IFACE mtu $MTU<br />
else<br />
    $IFC $IFACE mtu $DEFMTU<br />
fi<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalnetsolutions.net/2011/10/05/dynamic-mtu-in-debianubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo: Create a dummy / empty / blank krb5.keytab file</title>
		<link>http://www.totalnetsolutions.net/2011/07/07/howto-create-a-dummy-empty-blank-krb5-keytab-file/</link>
		<comments>http://www.totalnetsolutions.net/2011/07/07/howto-create-a-dummy-empty-blank-krb5-keytab-file/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 03:29:39 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[howto technology linux]]></category>

		<guid isPermaLink="false">http://www.totalnetsolutions.net/?p=80</guid>
		<description><![CDATA[We had an issue recently where we needed a dummy krb5.keytab file for an operation prior to creating the real keytab: echo -e "\0005\0002\c" >/etc/krb5.keytab]]></description>
			<content:encoded><![CDATA[<p>We had an issue recently where we needed a dummy krb5.keytab file for an operation prior to creating the real keytab:<br />
<code>echo -e "\0005\0002\c" >/etc/krb5.keytab</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalnetsolutions.net/2011/07/07/howto-create-a-dummy-empty-blank-krb5-keytab-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To: Test SMTP by hand</title>
		<link>http://www.totalnetsolutions.net/2011/06/21/howto-test-smtp-by-hand/</link>
		<comments>http://www.totalnetsolutions.net/2011/06/21/howto-test-smtp-by-hand/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 02:10:27 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://www.totalnetsolutions.net/?p=79</guid>
		<description><![CDATA[I recently had a co-worker trying to figure out a &#8220;lost email&#8221; problem we were possibly experiencing. He was blind to everything after hitting &#8220;send&#8221; because the intermediate servers weren&#8217;t sending delivery recipets, even though they were requested in the MIME header (Does any mail admin allow those to be sent out of the organization [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had a co-worker trying to figure out a &#8220;lost email&#8221; problem we were possibly experiencing.  He was blind to everything after hitting &#8220;send&#8221; because the intermediate servers weren&#8217;t sending delivery recipets, even though they were requested in the MIME header (Does any mail admin allow those to be sent out of the organization these days?)  So, to help him out, I wrote up the following &#8220;how to test SMTP by hand&#8221; HOWTO.</p>
<p>First step is to determine which servers are responsible for mail delivery inbound for the domain you&#8217;re sending to.  You do this by looking in DNS for the &#8220;MX&#8221; type records.  These are provided in the format &#8220;priority servername.domain.&#8221;  Priority is reverse-ordered.  The easiest way to remember priority order is that it&#8217;s the order in which servers are attempted.<br />
<code><br />
rob@rob-kubuntu3:~$ dig MX totalnetsolutions.net +short<br />
10 docsmooth.isa-geek.net.<br />
rob@rob-kubuntu3:~$ dig MX likewise.com +short<br />
10 server1.inboundmx.com.<br />
20 server2.inboundmx.com.<br />
</code><br />
This tells you the servers, in order, that *all* mail will be sent to for the domain listed.  So, anything to my likewise.com address will go to server1.inboundmx.com.  The higher priorities are only used if the lower priorities fail to answer.  If no server answers, the mail is held by the sender and retried, generally every 1 or 4 hours for up to 4 days, but this retry is configured on the *sending* server.  That means, your own email admin (or you, if you&#8217;re the mail admin).</p>
<p>Next thing to check is: does the server work, and is it your sender, or their receiver?  Check with telnet!<br />
Stuff I type is in red:<br />
<code><br />
rob@rob-kubuntu3:~$ <span style="color:red;">telnet docsmooth.isa-geek.net 25</span><br />
Trying 99.29.179.119...<br />
Connected to docsmooth.isa-geek.net.<br />
Escape character is '^]'.<br />
220 totalnetsolutions.net Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675 ready at  Tue, 31 May 2011 08:43:08 -0500<br />
<span style="color:red;">HELO</span><br />
250 totalnetsolutions.net Hello [12.130.116.175]<br />
<span style="color:red;">MAIL FROM: me@me.com</span><br />
250 2.1.0 me@me.com....Sender OK<br />
<span style="color:red;">RCPT TO:you@you.net</span><br />
250 2.1.5 you@you.net<br />
<span style="color:red;">DATA</span><br />
354 Start mail input; end with <crlf>.</crlf><crlf><br />
<span style="color:red;">from:me@me.com<br />
to:you@you.net<br />
subject:test manually<br />
test<br />
test<br />
.</span><br />
250 2.6.0 <tns03suzbbd2j9jsmmx00000039 @totalnetsolutions.net> Queued mail for delivery<br />
<span style="color:red;">quit</span><br />
221 2.0.0 totalnetsolutions.net Service closing transmission channel<br />
Connection closed by foreign host.<br />
</tns03suzbbd2j9jsmmx00000039></crlf></code><br />
The last &#8220;.&#8221; is SUPER important &#8211; it tells the mail server when you&#8217;re done sending that email.  You could use that channel to send other messages, rather than sending &#8220;QUIT&#8221; if you&#8217;d like.  You might notice that I entered the &#8220;From&#8221; and &#8220;To&#8221; lines twice.  The first entries are for the SMTP header (analogy would be the message envelope), and the second entries are for the MIME headings (analogy would be the return address header in a formal postal letter, if anyone sends those).  The MIME headings are what most mail programs display, and actually don&#8217;t technically need to match the SMTP header (but if MIME and SMTP don&#8217;t match many anti-spam programs will throw out the message).</p>
<p>The MIME header is pretty complex, but not order-dependant, although I prefer to enter it in order, so that I can be sure I don&#8217;t miss anything.<br />
If you want to add an attachment, just base64 encode it first with:<br />
<code>perl -e 'use MIME::Base64; qw(encode_base64); print encode_base64("@ARGV");' cat attachment-to-send.zip</code><br />
Then you can just paste it into the email.  In the MIME heading (right after the subject), just add (with the appropriate mime coding, probably application/octet-string:<br />
<code><br />
------=_NextPart_000_000D_01CC1C41.21F38080<br />
Content-Type: application/zip;<br />
	name="attachment-to-send.zip"<br />
Content-Transfer-Encoding: base64<br />
Content-Disposition: attachment;<br />
	filename="attachment-to-send.zip"<br />
&lt;paste your base64 encoded attachment/ &gt;<br />
Content-Type: multipart/mixed;<br />
	boundary="----=_NextPart_000_000D_01CC1C41.21F38080"<br />
------=_NextPart_000_000D_01CC1C41.21F38080<br />
Content-Type: text/plain;<br />
	charset="us-ascii"<br />
Content-Transfer-Encoding: 7bit</p>
<p>Type your message here, ending with a “.” Standalone on a line.<br />
.</p>
<p></code></p>
<p>Now that you know *how* to send an email message by hand, you can use the returned error codes to troubleshoot where the message may be disappearing.  Remember, that this just gives you transport troubleshooting between yourself and the initial destination mail server.  Many large (and even medium-sized) organizations will have a perimeter mail server which then forwards the message to one or more internal servers.  If the mail is being dropped at that point, you&#8217;ll have to contact the reciever with the proof that their server is accepting your messages.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalnetsolutions.net/2011/06/21/howto-test-smtp-by-hand/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ypcat passwd: No such map passwd.byname. Reason: No such map in server&#8217;s domain</title>
		<link>http://www.totalnetsolutions.net/2011/05/23/ypcat-passwd-no-such-map-passwd-byname-reason-no-such-map-in-servers-domain/</link>
		<comments>http://www.totalnetsolutions.net/2011/05/23/ypcat-passwd-no-such-map-passwd-byname-reason-no-such-map-in-servers-domain/#comments</comments>
		<pubDate>Mon, 23 May 2011 20:19:23 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.totalnetsolutions.net/?p=78</guid>
		<description><![CDATA[We ran into this bit of fun while setting up a NIS domain for testing in the lab today: rob@rob-kubuntu3:~$ ypcat -d nisdom -h rhel5-64-2 passwd.byname No such map passwd.byname. Reason: No such map in server's domain It turns out this was a problem with the /var/yp/securenets file, but I&#8217;m still not sure what is [...]]]></description>
			<content:encoded><![CDATA[<p>We ran into this bit of fun while setting up a NIS domain for testing in the lab today:<br />
<code>rob@rob-kubuntu3:~$ ypcat -d nisdom -h rhel5-64-2 passwd.byname<br />
No such map passwd.byname. Reason: No such map in server's domain<br />
</code><br />
It turns out this was a problem with the <strong>/var/yp/securenets</strong> file, but I&#8217;m still not sure <strong>what</strong> is wrong.  The man page for ypserv shows:</p>
<blockquote><p>       A sample securenets file might look like this:</p>
<p>              # allow connections from local host &#8212; necessary<br />
              host 127.0.0.1<br />
              # same as 255.255.255.255 127.0.0.1<br />
              #<br />
              # allow connections from any host<br />
              # on the 131.234.223.0 network<br />
              255.255.255.0   131.234.223.0
</p></blockquote>
<p>So we set up our securenets to look like this:</p>
<blockquote><p>
host 127.0.0.1<br />
255.255.255.0 10.10.10.0
</p></blockquote>
<p>And tried to connect to the server:<code><br />
rob@rob-kubuntu3:~$ ip addr show dev wlan0 |grep "inet "<br />
    inet 10.10.10.210/24 brd 10.10.10.255 scope global wlan0<br />
rob@rob-kubuntu3:~$ ypcat -d nisdom -h rhel5-64-2 passwd.byname<br />
No such map passwd.byname. Reason: No such map in server's domain<br />
rob@rob-kubuntu3:~$ ping -c1 rhel5-64-2<br />
PING rhel5-64-2 (10.10.10.213) 56(84) bytes of data.<br />
64 bytes from rhel5-64-2 (10.10.10.213): icmp_req=1 ttl=64 time=0.823 ms</p>
<p>--- rhel5-64-2 ping statistics ---<br />
1 packets transmitted, 1 received, 0% packet loss, time 0ms<br />
rtt min/avg/max/mdev = 0.823/0.823/0.823/0.000 ms</code></p>
<p>Removing the /var/yp/securenets file allowed us access, so it wasn&#8217;t firewall or rpc or portmap issues, to the best I can determine.  Adding &#8220;host 10.10.10.210&#8243; also worked and allowed the client access.  So what&#8217;s wrong with the format / man page?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalnetsolutions.net/2011/05/23/ypcat-passwd-no-such-map-passwd-byname-reason-no-such-map-in-servers-domain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.666 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-20 17:31:04 -->

