<?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>cyborgworkshop.org &#187; Best Tools</title>
	<atom:link href="http://cyborgworkshop.org/category/best-tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://cyborgworkshop.org</link>
	<description>Blurring the line</description>
	<lastBuildDate>Wed, 22 Feb 2012 14:31:06 +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>Authenticating a RHEL/Centos box against an Openfiler LDAP</title>
		<link>http://cyborgworkshop.org/2011/03/18/authenticating-a-rhelcentos-box-against-an-openfiler-ldap/</link>
		<comments>http://cyborgworkshop.org/2011/03/18/authenticating-a-rhelcentos-box-against-an-openfiler-ldap/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 01:31:56 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Best Tools]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://cyborgworkshop.org/?p=716</guid>
		<description><![CDATA[I seem to be running on a theme here. Setting your centos 5 boxes to authenticate users against your Openfiler LDAP server isn&#8217;t as straight forward as setting samba up to auth against it. You&#8217;ll obviously need to have Openfiler and LDAP already setup, but you&#8217;re also going to have to do some per user [...]]]></description>
			<content:encoded><![CDATA[<p>I seem to be running on a theme here.  Setting your centos 5 boxes to authenticate users against your Openfiler LDAP server isn&#8217;t as straight forward as setting samba up to auth against it.  You&#8217;ll obviously need to have Openfiler and LDAP already setup, but you&#8217;re also going to have to do some per user modifications in LDAP and some PAM configuration changes on the Centos box.  So, starting with the easiest part.  Download and copy this script to your openfiler machine. I did not write this script (I found it <a href="https://forums.openfiler.com/viewtopic.php?pid=8604">here</a>) I just modified it for my use.</p>
<blockquote><p>
#!/bin/bash<br />
# change shell and home for user in OpenFiler LDAP server</p>
<p>BINDDN=&#8221;cn=Manager,dc=themclarks,dc=com&#8221;<br />
BASEDN=&#8221;ou=People,dc=themclarks,dc=com&#8221;</p>
<p>USER=$1<br />
SHELL=$2</p>
<p>if [ -z "${SHELL}" -o -n "${3}" ]; then<br />
echo &#8220;Usage: $0  &#8221;<br />
exit 1<br />
fi</p>
<p>ldapsearch -s base -x -b &#8220;uid=${USER},${BASEDN}&#8221; &gt; /dev/null<br />
if [ $? -ne 0 ]; then<br />
echo &#8220;Error: User ${USER} not found in LDAP server&#8221;<br />
exit 1<br />
fi</p>
<p>grep -q -E -e &#8220;^${SHELL}$&#8221; /etc/shells<br />
if [ $? -ne 0 ]; then<br />
echo &#8220;Error: ${SHELL} not found in /etc/shells&#8221;<br />
exit 1<br />
fi</p>
<p>ldapmodify -x -D ${BINDDN} -W &lt;<br />
dn: uid=${USER},${BASEDN}<br />
changetype: modify<br />
replace: homeDirectory<br />
homeDirectory: /home/${USER}<br />
EOF<br />
ldapmodify -x -D ${BINDDN} -W &lt;<br />
dn: uid=${USER},${BASEDN}<br />
changetype: modify<br />
replace: loginShell<br />
loginShell: ${SHELL}<br />
EOF
</p></blockquote>
<p>Before you run this script, go into openfiler and make a backup of your LDAP config and database.  I doubt their will be a problem, but if you don&#8217;t do a backup I can almost guarantee something bad will happen.<br />
Be sure to chmod 775 that script.  When you run it you will need to supply the user you want to modify and the shell you want them to have. Home directories will be in /home, but you can modify that as you see fit. <br />
Once that script has run, you will have a user setup with a shell and a home directory in LDAP.  moving on to the Centos box<br />
run authconfig as root and select &#8220;Use LDAP&#8221; in User Information and &#8220;Use LDAP Authentication&#8221; in Authentication.  I also like to select &#8220;Local Authentication is sufficient&#8221; so I can add an oh-crap account.  When you select next, you will be prompted for some LDAP settings.  <br />
Leave Use TLS unchecked. <br />
LDAP Server will be ldap://OPEN_FILER_SERVER_NAME<br />
Base DN: will be &#8220;dc=your_domain,dc=com&#8221;<br />
Hit OK.  you can test to see if this works by doing an<br />
<code><br />
su - $USER<br />
</code><br />
for the user that you setup in LDAP. This should work, but it will give you an error about not having a home directory. To fix that, we need to make a change to the pam config.  If you did this using the gui authconfig, I believe you will have had an option to setup the automatic creation of home directories, so if you don&#8217;t get an error, you&#8217;re done.<br />
as root on the centos box, edit /etc/pam.d/system-auth and add the following line to the bottom of the file<br />
<code><br />
session    required     pam_mkhomedir.so skel=/etc/skel umask=0022<br />
</code><br />
save the file and do an su &#8211; to the user you setup in LDAP.  You should see a message about a home directory being created. Congratulations, you are authing to LDAP!</p>
]]></content:encoded>
			<wfw:commentRss>http://cyborgworkshop.org/2011/03/18/authenticating-a-rhelcentos-box-against-an-openfiler-ldap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Authenticating a samba server against the LDAP server in Openfiler</title>
		<link>http://cyborgworkshop.org/2011/03/05/authenticating-a-samba-server-against-the-ldap-server-in-openfiler/</link>
		<comments>http://cyborgworkshop.org/2011/03/05/authenticating-a-samba-server-against-the-ldap-server-in-openfiler/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 02:28:01 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Best Tools]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://cyborgworkshop.org/?p=710</guid>
		<description><![CDATA[I have an openfiler based NAS running as my main file server and an ubuntu VM running rsync that backs that server up. I wanted to be able to browse my backups via samba, and for giggles, authenticate that samba server against the openfiler LDAP that is already configured. This turned out to be really [...]]]></description>
			<content:encoded><![CDATA[<p>I have an openfiler based NAS running as my main file server and an ubuntu VM running rsync that backs that server up. I wanted to be able to browse my backups via samba, and for giggles, authenticate that samba server against the openfiler LDAP that is already configured. This turned out to be really easy.   First install samba.<br />
<code><br />
sudo apt-get install samba<br />
</code><br />
In the new /etc/samba/smb.conf,  you need to replace the passdb backend statement with<br />
<code><br />
passdb backend ldapsam:ldap://$DNS_NAME_OF_OPENFILE<br />
</code><br />
and add the following lines<br />
<code><br />
ldap ssl = no<br />
ldap admin dn = cn=Manager,dc=$YOURDOMAIN,dc=com<br />
ldap suffix = dc=$YOURDOMAIN,dc=com<br />
ldap user suffix = ou=People<br />
ldap group suffix = ou=Group<br />
</code><br />
Be sure to replace $YOURDOMAIN with the domain you configured when you first setup LDAP in openfiler.<br />
The last step is to store LDAP auth credentials in the secrets.tdb file so samba can query your LDAP. you do that by running<br />
<code><br />
smbpasswd -w $OPENFILER_LDAP_PASSWORD<br />
</code><br />
and replace $OPENFILER_LDAP_PASSWORD with the LDAP password you configured when you created the openfiler LDAP.  restart samba with<br />
<code><br />
service smbd restart<br />
</code><br />
And you should now be authenticating to you openfiler LDAP!</p>
]]></content:encoded>
			<wfw:commentRss>http://cyborgworkshop.org/2011/03/05/authenticating-a-samba-server-against-the-ldap-server-in-openfiler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Write an event to the eventlog in windows from a script</title>
		<link>http://cyborgworkshop.org/2010/10/15/write-an-event-to-the-eventlog-in-windows-from-a-script/</link>
		<comments>http://cyborgworkshop.org/2010/10/15/write-an-event-to-the-eventlog-in-windows-from-a-script/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 18:41:47 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Best Tools]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://cyborgworkshop.org/?p=648</guid>
		<description><![CDATA[I&#8217;m a regular user of the logger command on linux boxes and I&#8217;ve found the equivalent in windows. The command is called eventcreate.exe and seems to be present from windows XP forward. To create an informational event in the application log with a message subject of &#8220;Test message&#8221;, an arbitrary message id of 13 and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a regular user of the logger command on linux boxes and I&#8217;ve found the equivalent in windows.  The command is called eventcreate.exe and seems to be present from windows XP forward.  To create an informational event in the application log with a message subject of &#8220;Test message&#8221;, an arbitrary message id of 13 and a message text of &#8220;This is a test&#8221; you would just run the following</p>
<p><code><br />
eventcreate /t information /l application /so "Test message" /id 13 /d "This is a test"<br />
</code></p>
<p>More info on eventcreate.exe can be found at <a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/eventcreate.mspx?mfr=true">microsoft</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cyborgworkshop.org/2010/10/15/write-an-event-to-the-eventlog-in-windows-from-a-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>find files older than X days on a windows box</title>
		<link>http://cyborgworkshop.org/2010/10/13/find-files-older-than-x-days-on-a-windows-box/</link>
		<comments>http://cyborgworkshop.org/2010/10/13/find-files-older-than-x-days-on-a-windows-box/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 14:21:15 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Best Tools]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://cyborgworkshop.org/?p=645</guid>
		<description><![CDATA[To find files older than X days on a windows box, you either need the forfiles.exe command installed from the windows resource kit, or a 2003 and newer machine. The command looks like so forfiles -pC:\TEMP -s -m*.* -d-5 -c"cmd /C echo @PATH\@FILE" Just replace &#8220;-d-5&#8243; with &#8220;-d-X&#8221; where X is the number of days [...]]]></description>
			<content:encoded><![CDATA[<p>To find files older than X days on a windows box, you either need the forfiles.exe command installed from the windows resource kit, or a 2003 and newer machine. The command looks like so</p>
<p><code>forfiles -pC:\TEMP -s -m*.* -d-5 -c"cmd /C echo @PATH\@FILE"</code></p>
<p>Just replace &#8220;-d-5&#8243; with &#8220;-d-X&#8221; where X is the number of days since a file has been created.</p>
]]></content:encoded>
			<wfw:commentRss>http://cyborgworkshop.org/2010/10/13/find-files-older-than-x-days-on-a-windows-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get the PID of an application pool in iis 6.0</title>
		<link>http://cyborgworkshop.org/2010/08/25/get-the-pid-of-an-application-pool-in-iis-6-0/</link>
		<comments>http://cyborgworkshop.org/2010/08/25/get-the-pid-of-an-application-pool-in-iis-6-0/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 16:52:49 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Best Tools]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://cyborgworkshop.org/?p=641</guid>
		<description><![CDATA[All of the IIS process&#8217;s show up as the same process name, which makes it really challenging to figure out which of your websites has lost it&#8217;s mind.  In order to trace an IIS website or application pool back to a PID, you just need to open a command prompt and run the iisapp utility. [...]]]></description>
			<content:encoded><![CDATA[<p>All of the IIS process&#8217;s show up as the same process name, which makes it really challenging to figure out which of your websites has lost it&#8217;s mind.  In order to trace an IIS website or application pool back to a PID, you just need to open a command prompt and run the iisapp utility.<br />
<code><br />
iisapp<br />
</code><br />
Outputs<br />
W3WP.exe PID: 7424   AppPoolId: Site1<br />
W3WP.exe PID: 8096   AppPoolId: JoesSite<br />
W3WP.exe PID: 13080   AppPoolId: Wookielove.com</p>
<p>And now you can just use taskmanager to track resource usage to a site. </p>
]]></content:encoded>
			<wfw:commentRss>http://cyborgworkshop.org/2010/08/25/get-the-pid-of-an-application-pool-in-iis-6-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

