Archive for 2013

Varnish (Web application accelerator)

by in 0

I just read nice article about varnish from Smashing magazine and this post is the reminder for me to try it out.

I think varnish can be use with nginx also.
Here is what I found after a quick googling.
How To Install Wordpress, Nginx, PHP, and Varnish on Ubuntu 12.04

Random User Generator from randomuser.me

by 0

randomuser.me got really cool & realistic random user generator to use for testing applications.
RandomUser is an API that provides you with a randomly generated user. These users can be used as placeholders in web mockups, and will save you time from creating your own placeholder information.

Debug javascript in smarter way console.table()

by in 0

Works in Chrome and Firefox
Via mariusschulz.com

LOGGING ARRAY DATA WITH CONSOLE.LOG()

Imagine you have created this list of programming languages and their file extensions:
var languages = [
    { name: "JavaScript", fileExtension: ".js" },
    { name: "TypeScript", fileExtension: ".ts" },
    { name: "CoffeeScript", fileExtension: ".coffee" }
];

console.log(languages);
The console.log() call will give you the following representation of your data:
Console Output for console.log
That tree view is helpful for debugging purposes, but I find it a little cumbersome to have to open every collapsed object manually. I'm saying we can do a little better withconsole.table().

LOGGING ARRAY DATA WITH CONSOLE.TABLE()

Instead of calling console.log(), we'll use console.table() now:
console.table(languages);
Make sure the console is opened before refreshing the page, otherwise you won't see any output. If you did everything correct, you'll be rewarded with this nice, little table view:
Console Output for console.table()
Pretty neat, isn't it?
Of course, tables work best for tabular data. If all the objects have a totally different structure, you'll end up with most of the cells containing undefined values. Still, the property values are neatly arranged and give you a good overview.

LOGGING OBJECT DATA WITH CONSOLE.TABLE()

Another nice thing about console.table() is that it also works with objects:
var languages = {
    csharp: { name: "C#", paradigm: "object-oriented" },
    fsharp: { name: "F#", paradigm: "functional" }
};

console.table(languages);
Console Output for console.table() called with an object
'nuff said.

FILTERING THE DISPLAYED OBJECT PROPERTIES

If you want to restrict the columns to certain properties, you can pass an array of their keys as a second parameter to the console.table() call:
// Multiple property keys
console.table(languages, ["name", "paradigm"]);
For a single property, a simple string is sufficient:
// A single property key
console.table(languages, "name");Via mariusschulz.com

Installing VMware Tools for Arch based distros

by in , , 0

  1. Login as root
     su 
  2. Update your system
     pacman -Syu 
  3. Install VMware tools
     pacman -S open-vm-tools open-vm-tools-modules 
  4. Enable VMware tools
    systemctl start vmtoolsd
    systemctl enable vmtoolsd
    cat /proc/version > /etc/arch-release 
  5. Install Mouse and Display Integration
    pacman -S xf86-input-vmmouse xf86-video-vmware svga-dri 
  6. Open following file to configure it
     vim /etc/X11/xorg.conf.d/20-gpudriver.conf 
    Insert following line
    Section "Device"
            Identifier "Card0"
            Driver     "vmware"
    EndSection
    
  7. Get Enabled Copy & Paste between Host and Guest
     
    pacman -S gtkmm 
  8. Exit from root and then enable the VMware-Tools Integration
    exit 
    vmware-user-suid-wrapper
    

Ref:

Set hardware clock to UTC on Windows

by in , 0

မေ့သွားတဲ့အခါ ကွကို ပြန်ဖတ်ဖို့ ရေးထားတာပါ။ တကယ်လို့ vmware မှာပဲဖြစ်ဖြစ် dual boot မှာ ဖြစ်ဖြစ် linux တို့ mac osx တို့ တင်တဲ့အခါ တခါမဟုတ်တခါတော့ vm တွေထဲမှာ အချိန်လွဲနေတတ်ပါတယ်။ linux os တော်တော်များများက bios ကအချိန်ကို UTC အနေနဲ့ ယူပြီး time zone နဲ့ ပြန်ပြောင်းပါတယ်။ ဝင်းဒိုးတခုပဲ ကပေါက်တိကပေါက်ချာနဲ့ RTS ကို local time ထားတာဆိုတော့ ရှိသမျှ vm တွေ မှာ လိုက်မချိန်းပဲ၊ ဝင်းဒိုးမှာပဲ ချိန်းလိုက်တာ ခေါင်းကိုက်သက်သာပါတယ်။ window registry ထဲမှာ

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
"RealTimeIsUniversal"=dword:00000001 


အဲဒါ သွားထည့်လိုက်ရုံပါပဲ။
မူရင်း ပို့စ်က ဒီကပါ

How to use Putty with Console 2

by in , 0

This post is meant for me to remember when I change my laptop again. 
I love GNULinux but as I am currently working in 100% window only environment, I can’t let go of window yet. I love to do stuffs in Terminal. My choice of terminal in window is Console 2. I don’t want to use CygWin for no reason. I set up a folder for batch scripts and put in window’s path, so that from Console 2, I can do many common tasks. Such as poweroff, vim,curl, nmap, clear, ls, nc, etc.. . When It comes to ssh, I like Putty. Here is how to use putty in Console 2 via @jimueller

The following is as it written in his blog


Instructions
  1. Download ANSICON (Github Repo) and extract the contents from the x86 or x64 folders to your Console2 installation folder.

    I now have the following files in my C:\Program Files\Console2\ directory:
    • ANSI32.dll
    • ANSI64.dll
    • ansicon.exe
    • ANSI-LLW.exe
       
  2. Open Console2 and create a new tab with the command line:
    C:\Program Files\Console2\ansicon.exe "C:\Program Files (x86)\PuTTY\plink.exe" -load aPuttyProfileName


But I don't want to make new tab just for each ssh profile, I make ssh.bat inside my batch folder and put this one in ssh.bat instead.
@C:\Program Files\Console2\ansicon.exe "C:\Program Files (x86)\PuTTY\plink.exe" -load %*

So whenever i type
 ssh myserver 
it will load my server instantly inside Console 2. Awesome!.

Start Google App Engine - PHP with your own batch command (Windows)

by in 0


Google Apps engine now can run PHP
Here is hello world tutorial from Google, 
What I know is I have to run dev_appserver.py inside sdk folder and  type path to php-cgi.exe and path to the application folder.
It’s quite long for me to type whenever I want to test the app locally.
So I made a batch file inside my [appengine projects] folder and named it appstart.bat
You can save the sdk folder and php-cgi in anywhere you like, just put absolute path inside your batch file.

This is my sample batch file

E:\sandbox\appengine\sdk\dev_appserver.py --php_executable_path=C:\ProgramFilesPortable\php-5.4.20\php-cgi.exe %*
My folder structure is like
+[appengine projects]
    +helloworld
    +testproject1
    +testproject2
    -appstart.bat
So when I want to run helloworld app I just go to command prompt and type, 

e:\appengine projects>appstart helloworld

I am not sure whether or not it's best practice but as for lazy person like me, its works ok. :D
If you have any other tips please let me know also, I am just start learning GAE with PHP. 

Update
Actually I don't need to type it so many times while developing. While running the project also can edit the file. The server will auto reload if necessary as it mentioned at the helloworld example.
You can leave the web server running while you develop your application. The web server knows to watch for changes in your source files and reload them if necessary.

Oracle 10g and Perl

by in 0

When I run my perl script before installing oracle, it is fine with no error. But when I installed oracle 10g I got this error

Use of :unique is deprecated at c:\oracle\product\10.2.0\db_1\perl\5.8.3\lib\MSWin32-x86-multi-threa d/Config.pm.. ..

I don't even use oracle in my Perl script. So I am totally confused.
It took me a while to google it and I found this solution.

Just go to environment variable and remove PERL5LIB variable or set it to your perl installaton folder. That fixed it like a charm. 
Oracle comes with its own perl and that one is making me crazy. :D

Dell VOSTRO 3460, Battery (Plugged in, not charging) Fix

by in 2

I intentionally used my laptop given from office until 10% battery last night to discharge battery. This morning when I switched on my laptop it show
 " Battery cannot be identified press F1 for skipped and F2 for setup"
 I skipped with F1 but when charging the battery, It showed Plugged in, not charging
It took me a while to google it for the fix. If it's happened to you also, It is dell being stupid, your battery is still ok.
 It is easy to fix, 

  1. power off your laptop 
  2. take the battery out 
  3. Press power button for 10 second 
  4. put the battery back. 
  5. switch it on. 
That's all.

Unicode Table

by in 0



http://unicode-table.com/en/#myanmar
မြန်မာ ယူနီကုတ် အပါအဝင် ကမ္ဘာသုံး ယူနီကုတ် ကုတ်ပွိုင့်များနဲ့ စာလုံးများကို လွယ်လွယ်ကူကူနဲ့ ကြည့်လို့ရပါတယ်။ 

Standalone Charting Library With HTML5 Canvas

by in , 0


Chart.js is an impressive JavaScript charting library that is built on top of HTML5 canvas.
It currently supports 6 chart types (line, bar, radar, pie, column and polar area) and all this comes in a standalone, <5kb package.
Chart.js
Colors, fonts, borders and their sizes can all be customized. Also, optionally, charts can be loaded with an animation.

The making of the world's thinnest watch

by in 0


In January, Jerry O’Leary and I launched a Kickstarter campaign (currently <3 days to go) for the world’s thinnest watch, the CST-01. This is a watch we have worked on outside of project work while here at IDEO. On IDEO Labs, our aim is to share our process and give our readers an “under-the-hood” look at some of the things happening here at IDEO and, occasionally, beyond our walls. With that in mind, we wanted to recount the evolution of the design of the CST-01 from early CAD sketches to fully working “design validation units” made from real production parts. 
Read more..