Saturngod

What's on my mind

Found a reason why my server slow

Last month , I relaize my server is too slow. I checked the memory , it only use 50%. However cpu load average is load average: 0.97, 1.15, 1.05 . It’s a reason , server is too slow.

At this time , I don’t know how to fix. So, I asked digital ocean and digital ocean recommend to change DB server or upgrade a new server. So , I upgrade it. But still slow. I couldn’t find a reason.

So, I search about what is load average. I found Understanding Linux CPU Load - when should you be worried?. It’s really helpful for me.

load average

After that I check /var/log/nginx/access.log . I found wp-admin/admin-ajax.php request a lot from my myanmar blog. I checked admin-ajax.php and it’s load the whole library of wordpress. So, it’s a one of the reason to make my slow. The question is why admin-ajax.php call a lot ? I open my myanmar blog and check the view source. I found it. I am using KUDOS wordpress plugin and it request admin-ajax.php to every 30 seconds. So, it’s a problem. I found another request from quote collection plugin. I can disable ajax request in KUDOS plguin. However, I can’t disable ajax request in quotes-collection setting. So, I disabled this plugin.

After that , I checked my load average.

$ uptime
  03:51:34 up 6 days, 31 min,  1 user,  load average: 0.02, 0.14, 0.20

Now, the load average is very different. It’s not a problem of CPU. It’s a problem of ajax request too much. So, it will like DDOS attack itself.

Now, the server is working fine again.

iOS 7 Colors

When working for iOS 7 , I follow the color pattern that recommend on iOS Human Interface Guidelines. However, pickup color is not easy in Xcode. I am using RGB color . When I want to add color code on Xcode , I need to open image from the Guidelines and chose the color with pixelmator.

It’s not easy to use. So, I decided to write color selector for easy my life. I am using UIColor Macro for Xcode. I just want to chose color, copy rgb and paste in to xcode. That all. Don’t want to open images and other apps.

http://saturngod.github.io/iOS7Colors/ is easy to use . Just click , copy the color code. You can chose hex or RGB. Click on the clolor, you can see color with full screen. And then click on the full screen color again , it will go back to the main screen again.

color

Why fighting ?

At the morning of September 11 , 2013 , there is a lot of news about iPhone 5s and iPhone 5c. I also watched at night. I am using iPhone 4s and I need to change in this year. So, I decided to change iPhone 5s but I don’t know what color should I chose. At facebook , some people wrote there is no innovation in iPhone 5s. They will change to Android. Some android user wrote there is no new in iPhone 5s. iPhone 5c is ugly. They are talking what they think. They don’t know exactly what is 64 bits. But they wrote it’s nothing and just for marketing. Some people wrote no 4GB , 64 bits is nothing. Some people wrote it’s expensive. Apple fan boy are defend and fighting with android fan.

I want to ask , it’s for what ? I don’t understand. Why people are fighting to apple or android , for what ? They are not developers. They are user. They are talking from user point of view. Apple didn’t pay me and Android too. Why are they fighting ? All are the user and we are using what we want. Nobody pay us. We pay to Apple or Samsung or HTC or other phone company. So, we can chose what we want. Why fighting ?

For developer , platform is a problem. We complain sometime , that one can do in Android and can’t do in iOS. That one is easy in iOS and it’s not easy to done in Android. So, they complain. I can accept this one. But some fan are not complain , they want to fight and they want to show they are using best phone.

Some people can’t buy iPhone and they wrote it’s expensive. Some people using S4 and complain to iPhone 5s screen size. Nobody force to use the iPhone 5s or any other Android. You can chose what you like. You can try before you buy. Some people like stable and easy to use , so they are using iOS. Some people what to hack or change anything as they want , so using Android. Simple. There is no complicate. If you want to use Pages on mobile or tablet, use iPhone or iPad. Don’t buy Android. If you are using Android and can’t use Pages, don’t complain to the Apple or Android. It’s your choice. We don’t know exactly how fast new CPU in iPhone 5s and is it really 40x faster than before. We didn’t know now. We can’t prove anything yet. So, why complain about 64 bits.

If you are using Android , is there a reason to complain the iphone ? You don’t like iPhone and you already use Android. Why complain ?

Same like apple fan. You already like Apple product and why fight with Android. It’s wasting our time. It’s useless. Nobody pay us for fighting between us. Nobody pay free phone for against with other fans.

Yes, somebody want big screen and using iPhone. They want size like HTC one x+ or galaxy s4 for iPhone. From developer point of view, we need to change a lot. If apple change the ratio , all the apps need to re write again. When iPhone 5 release , we are big trouble and tested and change the UI to support iPhone 5. It’s just only height changes. If apple change the screen size with same ratio , it shouldn’t be problem. But must be same ratio to fix with current app design. I don’t know why apple only change height . If apple change the screen size with same ratio, it will be awesome for us. But, it can’t fit perfectly with one hand.

For my point of view , mobile world didn’t change so much. So many people are boring for iPhone and Android. Only changes is hardware and UI design. No big changes like first version of iPhone announcement. It feel like arrive the highest limit of the smart phone. But if you compare iPhone 4 and iPhone 5s , it look different. Most of the people are expecting too much for most of the Apple Events.

Still waiting iWatch and I really hope it better than samsung galaxy gear.

Android that not so bad like what I thought

I was using HTC Dream and iPod Touch 1 at the same time. At this time , Android phone is not so useful when compare with my iPod Touch . Less app and most of the apps are not useful so much. All the androids app UI/UX are so bad.

After that long time no use android. My aunt is using Nexus 7 and she love it. She use it a lot. I can’t understand why she love android. So, I asked her and she only use for candy crash and facebook. It’s enough for her. She is using iPhone 5. Nexus 7 screen is bigger than iPhone 5 and can play well candy crash. It’s enough.

My elder sister using iPhone 4s a lot and complain a lot. That can’t do. That can’t open. Flash can’t play. So many complain to me. Why she complain ? May be I recommend her to use iPhone 4s. So, I told her why not changing to Nexus 4. Android may do what you want. After changing nexus 4 , she just happy at first time. After that complain again. Later she bought iPad mini and surface pro and happy with iPad mini without jailbreak. I still don’t understand. She use iPad mini for skype , reading , etc.

So, why we are using this tablet or gadget ? Why we are wasting money ? My wife was using Galaxy Tab 2 7.0. She don’t like it because it can’t play Hay Day. She was playing Hay Day with her iPad 1 but Android can’t play it . So, it’s useless for her. After that she bought iPad mini and I am using galaxy tab 2 for reading book with Kobo.

Yes, I am using Android at night for reading book. Before that I thought about to buy Kobo Aura. But I don’t want to buy that much because I already have Nook Simple Touch. I use it for reading at bus stop and on bus. It’s enough. I don’t need other facebook, twitter, etc. Just read books. We have a extra galaxy tab 2. So, I just install Kobo and try to read it. OK, it’s enough and I decided not to buy other ebook reader.

After using galaxy tab 2 7.0 a week. I feel Android is not so bad like what I was using HTC Dream. Very different from now. Most of the apps are ready on android. (Hay Day still not available). But most of the porting app are not polish enough. Still use memory a lot and can’t play well on my galaxy tab 2 7.0 . Reading ebook with Kobo is OK for me. Evernote already on Android.

So most of the apps that I am using on iPad , iPhone are ready on android. UI are not so much different with iOS app. But Android are not smooth like iOS. If they are using animation and I feel it have glitch. May be galaxy tab 2 7.0 memory is not enough for that animation.

After using Android a week and I understand one thing. OS or platform is not matter. It’s just a platform. We are using for what we need. If apps are existing on that platform , people will use it. If there is no Kobo on android , I may not use. Simple. We are not using OS. We are using apps. There is no Hay Day on android. So, my wife didn’t use Android Tablet.

So, why are we using tablet , smart phones ? Why we need it ? Why did we buy it ? Are they really useful ?

We are using for what we need. My aunt only need to play candy crash. My sister need for learning and communication. My wife need for playing Hay Day and checking facebook and her email. I only need for reading books and checking email. For normal user , We want to use what we want and platform is not matter that much.

Does google reader still running at the backend ?

I moved my blog rss to the feedpress. It’s very simple and easy to use. It also have good statics dashboard. I can check daily subscriber from the dashboard. It can also show RSS reader. So, I checked it and it’s showing like that.

image

It’s showing google reader and I got a daily request from google reader. Why google didn’t turn off reader backend service and only shutdown user side ? or feedpress is wrong ?

It look like most of the google reader people are not using anymore RSS reader and most are enjoying the following posts from twitter and facebook.

UIColor Macro For ObjC

Declare in your app .pch

    #define rgb(R,G,B) [UIColor colorWithRed:R/255.0f green:G/255.0f blue:B/255.0f alpha:1.0]

    #define rgba(R,G,B,A) [UIColor colorWithRed:R/255.0f green:G/255.0f blue:B/255.0f alpha:A]

After that you can use like

mylabel.textColor = rgb(231, 76, 60);
myview.backgroundColor = rgba(231, 76, 60,0.2); 
// Alpaha value max is 1 and min is 0 , you must use float point

Change Blog URL

Now, Myanmar blog has been move to http://blog.saturngod.net . http://en.saturngod.net has been switch to www.saturngod.net .

Ebooks are like apps

Before I bought the Nook Simple Touch , I bought ebooks from kobo because it’s cheap and always have discount coupon. Sometime , I got 30% or 50% discount. Example: I only need to pay $13.12 for Art of start Ebook. In B&N , it cost $18.99. So, I always bought it from Kobo and read with my iPad.

I bought Nook Simple Touch. I just test and play around but I didn’t use for reading a book. Last month , I want to read a book again. So, I check on B&N. They are the great service like Read on The Web , iPad , iPhone App and they also have Mac app. Wow, that great. I have one problem. Can I transfer my Kobo ebooks to B&N ? The answer is yes but not all feature.

I want to change service like a phone or internet. Just call them and tell them I want to transfer from this to this. Simple and not so much work. I can transfer it. However, ebooks can’t do like that. I can read ebook from kobo. Download ePub , transfer with Adobe Digital Edition because of Adobe DRM. I feel it take a lot of staff. In iPad is OK , just download Kobo app and download ebook easily. In Nook Simple Touch , I can’t do like that.

I can only download from B&N. I can share text only B&N book. Bookmark sync only work in B&N book. All side loaded books are not working with B&N service. I feel , something wrong. I feel it shouldn’t be like that. It look like they are forcing user to buy book from B&N. I don’t want to buy from B&N because it’s a bit expensive then Kobo (not all book but most of the book that I want to buy).

You may ask , why don’t buy ebook reader from Kobo ? Yes, I want but I can’t . I bought Nook Simple Touch at february 2012. At this time , we can’t buy Kobo Ebook Reader.

Ebooks are selling like the apps. They are marketing like app. They are selling service for reading ebook. Like read on web , read on any platform. They are selling device for reading. It look like free app with in app purchases system. I can play free but if you want other feature , you need to pay. Nook Simple Touch reader are like that. You can read ePub from other book store but if you want the sync feature , must buy from B&N. Not possible to transfer current kobo book to B&N account. Yes, it’s not possible. Like Apple iCloud service can’t work on Android.

I understand cloud service cost is expensive. Transfer or merge account from other service it hard. Ebooks is not the Object like book. Book is a Object. You can transfer to other people easily. You can also donate or sell after you read. Ebook is a app. In app , after you finish the game or not using anymore , you can’t sell back. One time you pay , it always for you. Can’t resell or donate or transfer to other people because it’s a app. So, ebook is the same.

For me ebooks are not book object. It’s an app.

EasyDoc

Learn from the SGDoc , I created the EasyDoc again. SGDoc require the node.js and npm. It can’t be edit easily after generated. I want to allow other people to edit easily. So, I create EasyDoc again. EasyDoc is similar code with SGDoc. Just download EasyDoc from Github . Edit in index.html . That all. You can write markdown code in index.html and it will be generate when run on browser. All the feature and design are same like SGDoc. But I think, EasyDoc is more cool and easier than the SGDoc.

SGDoc

Today , I tried to write a API documentation for my work. We are using MS Words but I feel MS Words is not ready for code documentation or API Request Documentation. It’s good for management team but not good for developer. Very hard to see and we can’t know what functions are include in our document.

So, I searched on google and I found daux.io and FlatDoc. Both are really great. Daux is using PHP to generate markdown to HTML document.FlatDoc is using javascript and ajax to generate the makrdown to HTML document. I don’t want to use Daux because it need PHP server side and very hard to share via email or dropbox. We need to hosted on server. FlatDoc look cool. Beautiful and easy to use. However, it use ajax to read file. So, it can’t run at file:// . If we click on .html , it can be open but didn’t show anything. If we hosted on somewhere or localhost and call http://localhost/flatdoc/ , it will be working perfect. But it have one bug. If I gave a same header name , menu link can’t work well.

I thought, it’s not enough. What I want it just html that can share via email or dropbox. This html can copy to apple pages with syntax coloring. So, I decided to write my own and SGDoc was born. But it require npm to install and template design can customize easily. I hope, everybody can use easily. If you found a bugs or issue , you can post on github issue. For demo and documentation , you can check at http://saturngod.github.io/SGDoc/