Friday, March 20, 2015

Rails Mysql2::Error (Can't connect to local MySQL server through socket

Something going to error, my site got trouble.
checking in the apache error log found the Mysql2::Error (Can't connect to local MySQL server through socket
googling and found

mysqladmin variables | grep socket
and touch the socket file
touch /var/lib/mysql/mysql.sock

Friday, November 21, 2014

Enable / disable horizontal scroll on Textmate

Just simple way, to enable or disable horizontal scroller on the Textmate, just type:
CMD + OPTION + W

Thursday, November 20, 2014

MySQL delete all rows of tables back to zero id

To delete all rows in the table following these codes:
TRUNCATE first_table;
TRUNCATE second_table;
TRUNCATE third_table;
TRUNCATE fourth_table;

Wednesday, November 19, 2014

Android: appcompat_v7 errors when update API 21

I have installed the SDK, when updating SDK to API 21 is get errors, i can't run the "Android Device Manager" because the project still errors. Following erros message at below:







Here's the original messages:
[2014-11-19 07:07:16 - appcompat_v7] WARNING: unable to write jarlist cache file /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/bin/jarlist.cache
[2014-11-19 07:07:16 - appcompat_v7] WARNING: unable to write jarlist cache file /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/bin/jarlist.cache
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:75: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:79: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.CloseMode'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:83: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.Overflow'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:25: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabView'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:29: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabView'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:33: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabText'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:37: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:41: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:65: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Title'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:69: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Subtitle'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:45: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Menu'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:49: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:53: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:57: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title.Inverse'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:61: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle.Inverse'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:178: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar.Horizontal'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:182: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:113: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:115: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:110: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.DropDownItem.Spinner'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:107: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView.DropDown'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:121: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:126: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListPopupWindow'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:138: error: Error: No resource found that matches the given name: attr 'android:overlapAnchor'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:143: error: Error: No resource found that matches the given name: attr 'android:overlapAnchor'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:129: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.PopupMenu'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:132: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.PopupMenu'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:146: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:150: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:154: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:158: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:164: error: Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Title'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:168: error: Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Subtitle'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:172: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:174: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:93: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Toolbar.Button.Navigation'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:97: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base.xml:101: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:62: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:22: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display4'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:24: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display3'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:26: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:28: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:30: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Headline'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:32: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Title'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:34: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Subhead'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:36: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:38: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:40: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:42: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Menu'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:60: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:46: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:48: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:50: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large.Inverse'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:52: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:54: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium.Inverse'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:56: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/styles_base_text.xml:58: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small.Inverse'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:26: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:31: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:36: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Dialog'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:41: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light.Dialog'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v11/themes_base.xml:338: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v14/themes_base.xml:29: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v11/themes_base.xml:345: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v14/themes_base.xml:37: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v11/themes_base.xml:352: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v14/themes_base.xml:45: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v11/themes_base.xml:359: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v14/themes_base.xml:53: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:202: error: Error retrieving parent for item: No resource found that matches the given name 'android:ThemeOverlay.Material'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:212: error: Error retrieving parent for item: No resource found that matches the given name 'android:ThemeOverlay.Material.Light'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:205: error: Error retrieving parent for item: No resource found that matches the given name 'android:ThemeOverlay.Material.Dark'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:219: error: Error retrieving parent for item: No resource found that matches the given name 'android:ThemeOverlay.Material.ActionBar'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:223: error: Error retrieving parent for item: No resource found that matches the given name 'android:ThemeOverlay.Material.Dark.ActionBar'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:81: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:83: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:84: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:82: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:79: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:80: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:118: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:120: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:121: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:119: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:116: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:117: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:155: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:157: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:158: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:156: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:153: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:154: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:192: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:194: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:195: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:193: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:190: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
[2014-11-19 07:07:19 - MyApp] /Users/arul/Documents/My Labs/Android Dev/appcompat_v7/res/values-v21/themes_base.xml:191: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
To resolve this issue:
  1. Click right on the appcompat_v7 library and select Properties
  2. Click on the Android option
  3. Set Project Build Target > Target Name and click at Android 5.0 > OK
  4. Now, go back to the Package Explorer
  5. Click right on the your_project and select Properties
  6. Click on the Android option
  7. Set Project Build Target > Target Name and click at Android 5.0 > OK
  8. Clean the project, Project > Clean > Clean All Projects > OK
 That's all :)

Friday, November 14, 2014

MySQL import file from MySQL console

Here's the step:
Login to your MySQL database:
mysql -u root -p
Select the database name:
mysql>use db_name;
Import the database:
mysql>source /home/dump.sql;

ERROR 1153 (08S01) at line 75: Got a packet bigger than 'max_allowed_packet' bytes

These error message raise when i run the script like the below:
mysql -u root -p my_database < dump.sql
Then raised:
ERROR 1153 (08S01) at line 75: Got a packet bigger than 'max_allowed_packet' bytes
Googling and found:
vi /etc/my.cnf
add these line under [mysqld]
[mysqld]
# added to avoid err "Got a packet bigger than 'max_allowed_packet' bytes"
#
net_buffer_length=1000000 
max_allowed_packet=1000000000
#
Restart the mysql db:
service mysqld restart
Finally, i import the database with successfully:
mysql -u root -p my_database < dump.sql

Saturday, November 1, 2014

How to restore MySQL Database (MySQL won't start because InnoDB Corruption and Recovery)

Here's the information when i show the error log of MySQL:
130306 22:02:18 mysqld_safe Number of processes running now: 0
130306 22:02:18 mysqld_safe mysqld restarted
130306 22:02:18 [Note] Plugin 'FEDERATED' is disabled.
130306 22:02:18 InnoDB: The InnoDB memory heap is disabled
130306 22:02:18 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130306 22:02:18 InnoDB: Compressed tables use zlib 1.2.3
130306 22:02:18 InnoDB: Using Linux native AIO
130306 22:02:18 InnoDB: Initializing buffer pool, size = 128.0M
130306 22:02:18 InnoDB: Completed initialization of buffer pool
130306 22:02:18 InnoDB: highest supported file format is Barracuda.
Googling and fix the problem:
sudo service mysqld stop
Backup your Database:
mkdir -p /opt/database/backup/
cp -r /var/lib/mysql/* /opt/database/backup/
Adding script for recovery:
vi /etc/my.cnf
then add this line
innodb_force_recovery = 4
Restart your mysql:
service mysqld restart
Dump all tables:
mysqldump -u root -p db_name > dump.sql
Drop all databases which need recovery:
mysql>DROP TABLE table_name;
Stop MySQL:
service mysqld stop
rm -rf /var/lib/mysql/ib*
Comment out recovery script:
vi /etc/my.cnf
#innodb_force_recovery
Restart your mysql:
service mysqld restart
Restore your tables of database:
mysql -u root -p db_name < dump.sql

Saturday, October 25, 2014

Migrate From Apache to Nginx (Engin X) on Ubuntu VPS

I have low end of VPS, there are has minim of spesification hardware, googling and found recommended using Nginx for web server to reduce using of memory.

1. Stop service for Apache

sudo service apache2 stop

2. Installing Nginx PHP5-FPM

sudo apt-get install nginx php5-fpm

3. Configure PHP5-FPM

need to configuring PHP5 handler by Nginx
sudo nano /etc/php5/fpm/php.ini
find (CTRL + W) cgi.fix_pathinfo word and set like the below value:
cgi.fix_pathinfo=0
will modify another PHP configuration
sudo nano /etc/php5/fpm/pool.d/www.conf
find the "listen = ", We will modify this to use a socket for communication with the web server
listen = /var/run/php5-fpm.sock
Restart the PHP-FPM
sudo service php5-fpm restart

5. Set the Vhost of Nginx

sudo nano /etc/nginx/sites-available/myvhost.conf
add this lines to configure your site, for more example script you can find at /etc/nginx/sites-available/default
server {
    listen 80;

    root /var/www;
    index index.php index.html index.htm;
}
unlink the default configuration
sudo unlink /etc/nginx/sites-enabled/default 
Start the Nginx web server
sudo nano service nginx start

6. Remove Apache

to find all dependcies of Apache you filter like this:
dpkg --get-selections | grep apache
will display:
apache2      install
apache2-doc     install
apache2-mpm-prefork    install
apache2-threaded-dev    install
apache2-utils     install
apache2.2-bin     install
apache2.2-common    install
libapache2-mod-auth-mysql   install
libapache2-mod-passenger   install
remove
sudo apt-get remove apache2 apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common libapache2-mod-auth-mysql libapache2-mod-php5
for the clear remove dependencies run this command
sudo apt-get autoremove

Saturday, October 18, 2014

Friday, October 17, 2014

`autodetect': Could not find a JavaScript runtime on Ubuntu

When i starting the rails server, got the message " `autodetect': Could not find a JavaScript runtime "
googling and fix the issue with install a package:
sudo apt-get install nodejs

Thursday, October 16, 2014

Setup VPS for Ruby On Rails on Ubuntu 12.04 LTS

In this case, i'm using RVM for installing ROR

1. Update the Ubuntu

sudo apt-get update
sudo apt-get upgrade
after done, you need to restart the server for clean.
sudo shutdown -r now

2. Install MySQL

sudo apt-get install mysql-server mysql-client libapache2-mod-auth-mysql php5-mysql
Need, install the PHP for using phpmyadmin
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

3. Install dependencies

sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion libpq-dev

4. Install Curl

sudo apt-get install curl

5. Install RVM

\curl -L https://get.rvm.io | bash -s stable --ruby
source ~/.rvm/scripts/rvm
After installed RVM, close your terminal and login back to use the "rvm" command: RVM has some dependencies to need install, run this command.
rvm requirements
and if any install some recommended dependencies

6. Install Ruby

rvm list known
Will display like this:
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p547]
[ruby-]2.0.0-p481
[ruby-]2.0.0[-p576]
[ruby-]2.1.2
[ruby-]2.1[.3]
[ruby-]2.1-head
ruby-head
rvm install 2.1.2
rvm use 2.1.2 --default
check the version installed Ruby and Gem
ruby -v
gem -v

7. Install Rails

gem install rails

8. Install MySQL gem

Firstly, need install mysql dev
sudo apt-get install libmysqlclient-dev
gem install mysql2

9. Install ImageMagic

sudo apt-get install imagemagick

10. Install Javascript Runtime

sudo apt-get install nodejs

11. Install Phusion Passenger

gem install passenger
View script apache installation run this script:
passenger-install-apache2-module

Saturday, May 10, 2014

Crontab skip holiday date

Here's the step for skip holiday when using crontab:

1. Create the list of holidays on text file

touch /Users/arul/holidays_2014.txt
nano /Users/arul/holidays_2014.txt
2014-01-01
2014-01-14
2014-01-30
2014-03-31
2014-04-18

2. Create shell script on file

touch /Users/arul/runner.sh
nano /Users/arul/runner.sh
TODAY=$(date "+%Y-%m-%d")
if grep -q "$TODAY" /Users/arul/holiday.txt;
then
  /usr/bin/php /Users/arul/test.php
else
  echo "Not found the date"
  exit 0
fi

3. Set the Crontab task

crontab -e
Example the crontab will run every two hours start from Monday through Friday
0 */2 * * mon-fri sh /Users/arul/runner.sh

Tuesday, March 11, 2014

SVN cannot set LC_CTYPE locale on Centos

I got the error when checking "svn status"
svn: warning: cannot set LC_CTYPE locale
svn: warning: environment variable LC_CTYPE is UTF-8
svn: warning: please check that your locale name is correct
locale -a
export LC_ALL=C

Installing Subversion on Server Centos

Install the package
sudo yum install subversion mod_dav_svn
Create the directory svn
mkdir /var/www/svn
svnadmin create myrepo
chown -R apache.apache myrepo
Edit subversion configuration file
vi /etc/httpd/conf.d/subversion.conf
Add these line
LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

< Location /svn >
   DAV svn
   SVNPath /var/www/svn
   AuthType Basic
   AuthName "Subversion repositories"
   AuthUserFile /etc/svn-auth-users
   Require valid-user
< /Location >
Adding new user
sudo htpasswd -cm /etc/svn-auth-users username
New password:
Re-type new password:
Adding password for user new_user
Restart your server
sudo service httpd restart
Finally, access your svn url:
http://ip-address/svn/myrepo

ROR `autodetect': Could not find a JavaScript runtime on Centos 6

To fix this problem, please install some packages:
sudo yum install nodejs npm

Monday, March 10, 2014

Installing mysql gem on Centos 5

Firstly, install mysql dev:
sudo yum install mysql-devel
gem install mysql2

How to remove old installed rails

To removing old installed rails, just type:
sudo gem clean

How to cleanup the Ruby on Centos

To remove the current installed ruby, just type
sudo yum remove ruby
ruby -v

Saturday, March 8, 2014

Rails fileutils.rb:245:in `mkdir': Permission denied - /opt/

To fix this issue, please run this code below:
change directory to your app.
sudo bundle install

rails Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Please check your MySQL first, may be MySQL engine not starting
So, start your MySQL and restart your rails application