<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Coding on BAFM</title><link>https://christian.blog.pakiheim.de/tags/coding/</link><description>Recent content in Coding on BAFM</description><generator>Hugo -- 0.160.1</generator><language>en</language><lastBuildDate>Sat, 16 Aug 2014 10:15:10 +0000</lastBuildDate><atom:link href="https://christian.blog.pakiheim.de/tags/coding/index.xml" rel="self" type="application/rss+xml"/><item><title>VBscript undamp; Active Directory and printers</title><link>https://christian.blog.pakiheim.de/posts/2014-08-16_vbscript-amp-active-directory-and-printers/</link><pubDate>Sat, 16 Aug 2014 10:15:10 +0000</pubDate><guid isPermaLink="false">http://blog.barfoo.org/2007/10/13/vbscript-active-directory/</guid><description>&lt;p&gt;Well, since our current solution for mapping printers is an ugly batch file, which needs to be put into &lt;em&gt;Startup&lt;/em&gt;, I today poked at doing it in VBscript (I know, but it&amp;rsquo;s less ugly than the batch script, trust me).&lt;/p&gt;
&lt;p&gt;As some of you know, printers are only applicable to users (as in you can&amp;rsquo;t put a startup script onto an OU, which is going to map the printers). So as we store users and the computes in different OU&amp;rsquo;s in our Active Directory (we do have about 15.000 students), I can&amp;rsquo;t apply the printer.vbs to the users OU directly either, unless I implement some intelligence into the script itself.&lt;/p&gt;</description></item><item><title>VBscript undamp; Active Directory and printers (continued)</title><link>https://christian.blog.pakiheim.de/posts/2008-12-05_vbscript-amp-active-directory-and-printers-continued/</link><pubDate>Fri, 05 Dec 2008 21:54:09 +0000</pubDate><guid isPermaLink="false">http://blog.barfoo.org/index.php/2007/10/25/vbscript-active-directory-and-printers-continued/</guid><description>&lt;p&gt;As I &lt;a href="https://christian.blog.pakiheim.de/posts/2008-12-05_vbscript-amp-active-directory-and-printers-continued" title="VBscript &amp;amp; Active Directory and printers ?"&gt;posted earlier&lt;/a&gt;, I tried working around some limitations in Microsoft&amp;rsquo;s Active Directory by teaching the script some intelligence.&lt;/p&gt;
&lt;p&gt;But, since we recently started using Thin Clients, all the stuff I did with the fancy vbs was just a waste-of-time. Turns out, Windows XP Embedded doesn&amp;rsquo;t work quite the same as a &amp;quot; &lt;em&gt;normal&lt;/em&gt;&amp;quot; Windows XP (that&amp;rsquo;s where I tested the script on), and it simply dies when running the WMI Query. Bollocks.&lt;/p&gt;</description></item><item><title>Nagios undamp; plugins</title><link>https://christian.blog.pakiheim.de/posts/2007-10-06_nagios-amp-plugins/</link><pubDate>Sat, 06 Oct 2007 15:12:43 +0000</pubDate><guid isPermaLink="false">http://blog.barfoo.org/2007/10/06/nagios-plugins/</guid><description>&lt;p&gt;Since we started utilizing &lt;a href="http://www.nagios.org/"&gt;Nagios&lt;/a&gt;&amp;rsquo;s power two months ago, I finally came up with a C-based ram-plugin for nagios. The biggest problem I had with the python and perl based plugins, that some distributions (yes, SLES and Debian) don&amp;rsquo;t install either Python or Perl.&lt;/p&gt;
&lt;p&gt;Since I wanted a manageable setup (as in unified code base across all distributions), I wanted it to work without installing too much. So I took the &lt;a href="http://nagiosplug.svn.sourceforge.net/viewvc/nagiosplug/nagiosplug/trunk/plugins/check_swap.c?view=markup"&gt;swap plugin&lt;/a&gt; and basically removed what wasn&amp;rsquo;t necessary and &lt;a href="https://christian.blog.pakiheim.de/uploads/2007/10/check_ram.patch"&gt;voila&lt;/a&gt;!&lt;/p&gt;</description></item><item><title>TYPO3 and MySQL replication</title><link>https://christian.blog.pakiheim.de/posts/2007-09-08_typo3-and-mysql-replication/</link><pubDate>Sat, 08 Sep 2007 20:33:13 +0000</pubDate><guid isPermaLink="false">http://blog.barfoo.org/2007/09/08/typo3-and-mysql-replication/</guid><description>&lt;p&gt;Apparently the TYPO3 version we are using, doesn&amp;rsquo;t play too nice with the MySQL MasterMaster replication.&lt;/p&gt;
&lt;p&gt;Sometimes, something like this is going to happen:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt" id="hl-0-1"&gt;&lt;a class="lnlinks" href="#hl-0-1"&gt;1&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-2"&gt;&lt;a class="lnlinks" href="#hl-0-2"&gt;2&lt;/a&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;070826 0:44:32 [ERROR] Slave: Error &amp;#39;Duplicate entry &amp;#39;75-222419149&amp;#39; for key 1&amp;#39; on query. Default database: &amp;#39;t3nb&amp;#39;. Query: &amp;#39;INSERT INTO cache_pagesection
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;070826 0:44:32 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with &amp;#34;SLAVE START&amp;#34;. We stopped at log &amp;#39;dbc-mysql1.000192&amp;#39; position 611861372
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Well, as you can see from the last line in the log, the Slave-SQL thread found a duplicate entry and thought it is smart to just turn off the thread instead of disregarding the just made entry. So from now on, both databases drift since there ain&amp;rsquo;t no replication anymore until someone kick starts the replication again (someone being me).&lt;/p&gt;</description></item><item><title>Handling files/directories with spaces in `for'-loops</title><link>https://christian.blog.pakiheim.de/posts/2007-07-08_handling-files-directories-with-spaces-in-for-loops/</link><pubDate>Sun, 08 Jul 2007 18:58:54 +0000</pubDate><guid isPermaLink="false">http://blog.barfoo.org/2007/07/07/handling-filesdirectories-with-spaces-in-for-loops/</guid><description>&lt;p&gt;So I have one or the other file, that needs to be extracted to a directory. And why not name it as the archive itself .. Only problem with it is the handling of variables with bash &amp;hellip;&lt;/p&gt;
&lt;p&gt;Try it yourself, stuff some directories with a space in inside a variables, and use something like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt" id="hl-0-1"&gt;&lt;a class="lnlinks" href="#hl-0-1"&gt;1&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-2"&gt;&lt;a class="lnlinks" href="#hl-0-2"&gt;2&lt;/a&gt;
&lt;/span&gt;&lt;span class="lnt" id="hl-0-3"&gt;&lt;a class="lnlinks" href="#hl-0-3"&gt;3&lt;/a&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;epimetheus tmp [0] $ mkdir files
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;epimetheus tmp [0] $ touch files/&amp;#34;I hate directories.archive&amp;#34; files/&amp;#34;Me luuv you looong time.archive&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;epimetheus tmp [0] $ for i in $( /bin/ls --color=none files/ ); do mkdir &amp;#34;${i/.archive/}&amp;#34;; done
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;And now take a look at the output of that ..&lt;/p&gt;</description></item></channel></rss>