<?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>ryoku.org &#187; Coding</title>
	<atom:link href="http://www.ryoku.org/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ryoku.org</link>
	<description>Nerd stuff</description>
	<lastBuildDate>Sat, 04 Sep 2010 21:55:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Saving terminal scrollback to evernote</title>
		<link>http://www.ryoku.org/2009/11/saving-terminal-scrollback-to-evernote/</link>
		<comments>http://www.ryoku.org/2009/11/saving-terminal-scrollback-to-evernote/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 22:46:20 +0000</pubDate>
		<dc:creator>Arijan</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.ryoku.org/?p=139</guid>
		<description><![CDATA[I tend to keep a log of things I did when operating on production systems. It took quite a few steps to get this done, so I automated my workflow with a bash script. This script will put the current scrollback buffer into a temp file and import that file into evernote. I am aware [...]]]></description>
			<content:encoded><![CDATA[<p>I tend to keep a log of things I did when operating on production systems. It took quite a few steps to get this done, so I automated my workflow with a bash script.</p>
<p>This script will put the current scrollback buffer into a temp file and import that file into evernote. I am aware I can paste the buffer directly into the note but I prefer the way evernote reacts when you type the save command, it will prompt you for a title.</p>
<p>Enjoy.</p>
<pre class="brush: plain;">
#!/bin/sh
#
# Author: arijan.luiken at snow.nl
#
osascript &lt;&lt; @EOF
set fp to &quot;/tmp/terminal.txt&quot;

tell application &quot;Terminal&quot;
	activate
	set buffer to history of front window as text
end tell

try
	open for access fp with write permission
	set eof of fp to 0
	write (buffer) to fp starting at eof
	close access fp
on error
	try
		close access fp
	end try
end try

tell application &quot;Evernote&quot;
	activate
	create note from file fp tags &quot;#terminal&quot;
end tell
@EOF
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ryoku.org/2009/11/saving-terminal-scrollback-to-evernote/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Monitoring external web scenario&#8217;s behind a http proxy with zabbix.</title>
		<link>http://www.ryoku.org/2009/03/monitoring-external-web-scenarios-behind-a-http-proxy-with-zabbix/</link>
		<comments>http://www.ryoku.org/2009/03/monitoring-external-web-scenarios-behind-a-http-proxy-with-zabbix/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 14:13:01 +0000</pubDate>
		<dc:creator>Arijan</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.ryoku.org/?p=93</guid>
		<description><![CDATA[It&#8217;s ugly, very ugly. But it&#8217;s quick. If you want to use zabbix to be able to monitor web scenarios through a proxy you need to hack the source, since the latest version (1.6.2) has no other option to specify a proxy to connect through using configuration parameters. Take a look at httptest.c in src/zabbix_server/httppoller [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s ugly, very ugly. But it&#8217;s quick.</p>
<p>If you want to use zabbix to be able to monitor web scenarios through a proxy you need to hack the source, since the latest version (1.6.2) has no other option to specify a proxy to connect through using configuration parameters.</p>
<p>Take a look at httptest.c in src/zabbix_server/httppoller around line 262 you will find the process_httptest function. I added the proxy at line 297 and I hardcode (yuck) it into the code. Please don&#8217;t use this hack in production environments.</p>
<div class="code"><code><br />
    262 static void     process_httptest(DB_HTTPTEST *httptest)<br />
    263 {<br />
    264         DB_RESULT       result;<br />
    265         DB_ROW          row;<br />
    266         DB_HTTPSTEP     httpstep;<br />
    267         int             err;<br />
    268         char            *err_str = NULL, *esc_err_str = NULL;<br />
    269         int             now;<br />
    270         int             lastfailedstep;<br />
    271<br />
    272         S_ZBX_HTTPSTAT  stat;<br />
    273         double          speed_download = 0;<br />
    274         int             speed_download_num = 0;<br />
    275<br />
    276         CURL            *easyhandle = NULL;<br />
    277<br />
    278         INIT_CHECK_MEMORY();<br />
    279<br />
    280         zabbix_log(LOG_LEVEL_DEBUG, "In process_httptest(httptestid:" ZBX_FS_UI64 ",name:%s)",<br />
    281                 httptest->httptestid,<br />
    282                 httptest->name);<br />
    283<br />
    284         now = time(NULL);<br />
    285<br />
    286         DBexecute("update httptest set lastcheck=%d where httptestid=" ZBX_FS_UI64,<br />
    287                 now,<br />
    288                 httptest->httptestid);<br />
    289<br />
    290         easyhandle = curl_easy_init();<br />
    291         if(easyhandle == NULL)<br />
    292         {<br />
    293                 zabbix_log(LOG_LEVEL_ERR, "Cannot init CURL");<br />
    294<br />
    295                 return;<br />
    296         }<br />
    297         curl_easy_setopt(easyhandle,CURLOPT_PROXY, "http://proxy.company.nl:8080");<br />
    298         if(CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_COOKIEFILE, "")))<br />
    299         {<br />
    300                 zabbix_log(LOG_LEVEL_ERR, "Cannot set CURLOPT_COOKIEFILE [%s]",<br />
    301                         curl_easy_strerror(err));<br />
    302                 (void)curl_easy_cleanup(easyhandle);<br />
    303                 return;<br />
    304         }<br />
</code></div>
]]></content:encoded>
			<wfw:commentRss>http://www.ryoku.org/2009/03/monitoring-external-web-scenarios-behind-a-http-proxy-with-zabbix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
