<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description></description><title>cat /dev/mind | grep useful</title><generator>Tumblr (3.0; @remzisenel)</generator><link>http://remzisenel.tumblr.com/</link><item><title>How I come to hate Facebook Canvas.</title><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;I&amp;#8217;m a ninja in a company where we are building a e-commerce virtual world, and we decided to start inside Facebook Canvas.&lt;/p&gt;
&lt;p&gt;I think the FB canvas is a pain to work with and here is why:&lt;/p&gt;
&lt;p&gt;1- Cookies are broken. Seriously, If you want to build something inside Facebook canvas, you can&amp;#8217;t trust the cookies. Every browser thinks you are a popup spawning, click hijacking, demon spawn, nasty advertising company since you are inside an iframe in a different domain and they try really hard to block you from functioning properly.&lt;/p&gt;
&lt;p&gt;You either have to work around by redirecting the user multiple times to your domain until you get your cookie writing permissions or you should just abandon them completely.&lt;/p&gt;
&lt;p&gt;2- Since the cookies are broken, server side sessions are broken. You can never count on your server-side session since you can never be sure about your cookies.&lt;/p&gt;
&lt;p&gt;3- Page size a bitch. Seriously, if your page is too small, canvas height will be higher than yours so your users will see a white block under your page when they scroll. If your page is bigger there are 2 scrollbars on page, which is confusing for your users. And don&amp;#8217;t even get me started on autoGrow feature.&lt;/p&gt;
&lt;p&gt;4- So say you have users with variable width monitors, some of them has 1680 some of them have 1380. Don&amp;#8217;t try to be responsive. Since your page height also varies as your page responds to user screen width you begin to depend on facebook to resize your content iframe and oh, god that works weird.&lt;/p&gt;
&lt;p&gt;So, your best option is to have a fixed height, fixed width single page app, which only works with flash games.&lt;/p&gt;
&lt;p&gt;Eh, I don&amp;#8217;t mean these things are impossible to solve or work around, nor they BREAK the environment. And I know Facebook cares. Also, b&lt;span&gt;eing inside facebook is probably still worth the work, but it kinda reminds me of IE6, with all the time used to get your app to work &amp;#8220;acceptably well&amp;#8221; inside the FB canvas.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;All in all, Facebook Canvas is not developer friendly enough IMHO but yeah, I guess we and people like us will be working to get our applications to work properly inside it for a bit more.&lt;/p&gt;</description><link>http://remzisenel.tumblr.com/post/45264877938</link><guid>http://remzisenel.tumblr.com/post/45264877938</guid><pubDate>Wed, 13 Mar 2013 15:06:18 +0200</pubDate></item><item><title>Weekend Challenge: OyunJS - Turn-based game server on Node.JS</title><description>&lt;p&gt;I&amp;#8217;m pretty sure most of the people reading this blog post are familiar with both node.js and the hype around it.&lt;/p&gt;
&lt;p&gt;I was looking for a weekend challenge and I was challenged by &lt;a href="https://twitter.com/#!/enginerenturk" title="@enginerenturk" target="_blank"&gt;@enginerenturk&lt;/a&gt; to build a turn-based game server on node.js.&lt;/p&gt;
&lt;p&gt;So it began.&lt;/p&gt;
&lt;p&gt;DISCLAIMER: OyunJS is my first serious attempt at creating something with NodeJS and JavaScript. &lt;/p&gt;
&lt;p&gt;I came home at around 8-9pm Friday night and immediately started working on the weekend challenge. I started with creating a project on &lt;a href="http://c9.io/" title="Cloud9 IDE" target="_blank"&gt;Cloud9&lt;/a&gt; and started with hacking together a basic HTTP server, which was ridiculously easy, being the though j2ee developer I am.&lt;/p&gt;
&lt;p&gt;(Time references from now on refer to actual work-hour spent working.)&lt;/p&gt;
&lt;p&gt;At around 1 hour mark, HTTP server was up and handling JSON objects in requests.&lt;/p&gt;
&lt;p&gt;At around 10 hour mark, a basic tictactoe server was up and running, handling user joins, matching users, creating rooms. &lt;/p&gt;
&lt;p&gt;At around 14 hour mark, I was playing tictactoe with a friend! (I built a basic html client with jQuery, communicating with nodejs over HTTP &amp;amp; JSON.)&lt;/p&gt;
&lt;p&gt;At this point, I must admit, I was pretty impressed with performance and the rapid ability of nodejs to work as an application backend and decided to move on forward  to see what will come out of this weekend challenge.&lt;/p&gt;
&lt;p&gt;Some refactoring took place, made tictactoe logic an extension, fixed some bugs, cleaned up the server code, created a github account (Yeah, I know, I should have done that before.) , got a free tier micro instance from &lt;a href="http://aws.amazon.com/" title="AWS" target="_blank"&gt;AWS&lt;/a&gt;, added some Facebook JS API magic, created an app on FB.&lt;/p&gt;
&lt;p&gt;And so, here we are around ~20 hours mark. &lt;/p&gt;
&lt;p&gt;I know OyunJS still has a very long way to go into production, many lines to code, many bugs to fix, but I&amp;#8217;m hoping it will get somewhere nice eventually. Please don&amp;#8217;t hesitate to contact me about any feedback, any advice, any bug or the fact, how much I suck at JS/nodejs.&lt;/p&gt;
&lt;p&gt;Please, please do give some feedback!&lt;/p&gt;
&lt;p&gt;Feel free to fork it/use it!&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/remzisenel/oyunjs"&gt;&lt;a href="https://github.com/remzisenel/oyunjs"&gt;https://github.com/remzisenel/oyunjs&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Remzi - &lt;a href="https://twitter.com/#/ankthepot" title="@ankthepot" target="_blank"&gt;@ankthepot&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;For the curious reader:&lt;/p&gt;
&lt;p&gt;- Application on Facebook: &lt;a href="http://apps.facebook.com/ticky_tacky_toe/"&gt;&lt;a href="http://apps.facebook.com/ticky_tacky_toe/"&gt;http://apps.facebook.com/ticky_tacky_toe/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;- &amp;#8220;Oyun&amp;#8221; means &amp;#8220;Game&amp;#8221; in Turkish.&lt;/p&gt;</description><link>http://remzisenel.tumblr.com/post/20362451381</link><guid>http://remzisenel.tumblr.com/post/20362451381</guid><pubDate>Mon, 02 Apr 2012 23:00:10 +0300</pubDate></item><item><title>Monitoring with Bijk</title><description>&lt;p&gt;&lt;a href="http://bijk.com" title="Bijk.com" target="_blank"&gt;Bijk.com&lt;/a&gt; offers a nice and useful service at first look. I quickly signed up for an account, added my colleagues and started adding servers right away.&lt;/p&gt;
&lt;p&gt;Adding servers is pretty easy with bijk, their website provides the commands step by step for the most of the distros out there. In our particular case we are using ubuntu at our servers.&lt;/p&gt;
&lt;p&gt;The first problem I had with bijk was that push method, which doesn&amp;#8217;t require you to open up your ssh port to bijk outbound ips and should be your first choice as a sysadmin, didn&amp;#8217;t work for us, so we ended up opening up our ssh port to Bijk outbound ips and started waiting for data.&lt;/p&gt;
&lt;p&gt;Bijk offers nice and detailed graphs about your servers, the interface is nice and self-explanatory, and offers a pretty useful plugin base including mysql, postgresql, apache, nginx and memcached plugins. So you end up monitoring the required services pretty quick.&lt;/p&gt;
&lt;p&gt;However, our experience with Bijk didn&amp;#8217;t go on that seamless, on one of our Database servers, bijk-node (the agent you install on your servers to provide bijk with data) wasn&amp;#8217;t reporting any data for mysql. After a week of mailing (which was only 3 or 4 consecutive mails long) with bijk staff, a purge&amp;amp;re-install of the bijk-node package fixed the problem.&lt;/p&gt;
&lt;p&gt;So, we were getting data from our servers, the graphs were shiny and useful, alerts sounded nice, so we decided to upgrade to a paid plan.&lt;/p&gt;
&lt;p&gt;At first our data receive interval wasn&amp;#8217;t updated, which resulted in a 15 min poll frequency, which is a bit too low, whereas it should have been 5 mins. It took us a support ticket and a days wait to get our data poll interval to 5 mins.&lt;/p&gt;
&lt;p&gt;After all the hassle, Bijk provides a pretty useful and rigid monitoring tool. Other than the problems setting up (and one more thing I will explain in a second), we didn&amp;#8217;t have any problems for the last month. &lt;/p&gt;
&lt;p&gt;The problem is, bijk has a minimum of 5 minute data poll frequency, and when you set up your alarms, say, for a CPU load of 3, bijk doesn&amp;#8217;t send the alarm message if the load of 3 occurs between the data polls. Let me clear things up.&lt;/p&gt;
&lt;p&gt;Server X has an average load of 0.1 - 2.5.&lt;/p&gt;
&lt;p&gt;We set up our alarm for a CPU load of 3.&lt;/p&gt;
&lt;p&gt;Bijk polls data at 19:00, which shows a CPU load of 2.0.&lt;/p&gt;
&lt;p&gt;CPU load spikes to 4.2 at 19:03 which ends 30 seconds later at 19:03:30 and goes back to normal range.&lt;/p&gt;
&lt;p&gt;Bijk polls data at 19:05, which shows a CPU load of 2.2 again and since 2.2 is still in the normal range, you don&amp;#8217;t receive an alarm.&lt;/p&gt;
&lt;p&gt;This doesn&amp;#8217;t sound too bad since the CPU load faded back to normal value range and indeed everything is fine by 19:05. But if you want to, say, monitor users logged in, a ssh session occurring between 19:01 and 19:04 can go a long way unnoticed if you don&amp;#8217;t check the graphs.&lt;/p&gt;
&lt;p&gt;So, after all, monitoring is a dirty job. The required work to have a well enough monitoring software up and running is worth the time, but not affordable in dire situations like a close deadline or a product release. Bijk is affordable both price-wise and ease-to-use-wise. Bijk has been a valuable solution to our server stack and hope it gets even better over time.&lt;/p&gt;
&lt;p&gt;Bijk is worth a try.&lt;/p&gt;

&lt;p&gt;More reading on monitoring and why it sucks:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://gigaom.com/2012/02/12/why-monitoring-sucks-for-now/"&gt;&lt;a href="http://gigaom.com/2012/02/12/why-monitoring-sucks-for-now/"&gt;http://gigaom.com/2012/02/12/why-monitoring-sucks-for-now/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://remzisenel.tumblr.com/post/18734285906</link><guid>http://remzisenel.tumblr.com/post/18734285906</guid><pubDate>Sun, 04 Mar 2012 19:31:50 +0200</pubDate><category>monitoring</category><category>bijk</category></item></channel></rss>
