tag:blogger.com,1999:blog-89742009871110639812024-03-06T02:43:41.263-03:00Just a simple knowledge baseKnowledge base on subjects I use in my day-by-day life.
Unix, Linux, Mac OS X, VMware, Web, Java, Codfusion, Flex, etc.Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.comBlogger38125tag:blogger.com,1999:blog-8974200987111063981.post-38928285292093059702015-09-24T02:08:00.001-03:002015-09-24T02:09:36.548-03:00Cordova / Ionic - Multiple Dex Issue with "Facebook Connect" and "LocalNotification" plugins.Had a problem with Cordova / Ionic today:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com7tag:blogger.com,1999:blog-8974200987111063981.post-15413991563211061282014-09-26T21:09:00.000-03:002017-02-07T10:53:30.165-02:00backbone.js + underscore.js + ??? = good localizationStarting a localization process for one of projects. Currently looking for localization of backbone and underscore parts. i18n plugin from require.js seems to do almost all that I need, but... there is a strange feeling that everything is too simple... Looking around on the web found some frameworks, projects but they don't offer anything that I can not get with a plain and simple require.js i18nAnonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0tag:blogger.com,1999:blog-8974200987111063981.post-1646939467770022832014-09-25T15:04:00.000-03:002014-09-25T17:16:10.020-03:00npm + grunt + bower + grunt-bower-taskMaybe this will help someone... In any case - I'm keeping this KB mostly for myself :)
Since I prefer following structure for my node.js (and backbone / underscore) projects:
project/
public/
js/
lib/ - here will go all libs/frameworks
app/ - here will go all JS application files
...
css/
fonts/
&Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0tag:blogger.com,1999:blog-8974200987111063981.post-32725201177256709952013-11-27T12:20:00.005-02:002013-11-27T12:20:56.318-02:00MySQL privileges update for creating procedures, functions, etc.After creating a new user you need to update his privileges to grant creation of procedures, functions and so on. Here is a SQL for this.
UPDATE user SET
Select_priv="Y", Insert_priv="Y", Update_priv="Y", Delete_priv="Y", Create_priv="Y", Drop_priv="Y", Reload_priv="Y", Process_priv="Y", File_priv="Y", References_priv="Y", Index_priv="Y", Alter_priv="Y", Super_priv="Y", Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0tag:blogger.com,1999:blog-8974200987111063981.post-85664148341539937262013-03-25T21:16:00.001-03:002014-09-26T21:10:00.547-03:00jQuery executes error function even on success (200) statusJust lost a couple of hours with this problems.
jQuery was executing an error function regardless the jqXHR status. A little bit about setup:
node.js + Express + Backbone + backbone.paginator + Underscore
After upgrading to Express 3.0 an application that was working without any problems stoped to work. Problem - jQuery was always executing an error function for all ajax requests. Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0tag:blogger.com,1999:blog-8974200987111063981.post-53279911115034293922012-12-01T17:45:00.000-02:002012-12-01T17:45:04.497-02:00MySQL PASSWORD() function in JavaScript
If you need to implement a MySQL PASSWORD() function in JavaScript - use http://code.google.com/p/crypto-js/#SHA-1 with 2 encodings.
Here is an example:
var password = "TestPassword";
var result = ("*"+CryptoJS.SHA1(CryptoJS.SHA1(password))).toUpperCase();
console.log("result : " + result);
Result will be *0F437A73F4E4014091B7360F60CF81271FB73180. If you check it with MySQL password() it willAnonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com13tag:blogger.com,1999:blog-8974200987111063981.post-39784333085540160492012-06-11T11:36:00.000-03:002012-06-11T11:36:05.275-03:00Show hidden files on MacTo show hidden files and folders in Finder - open terminal window and paste the following line:
defaults write com.apple.Finder AppleShowAllFiles YES
Then relaunch Finder application (Option + right button click on dock icon, then select relaunch).
To disable showing of hidden files - do the same procedure with other string:
defaults write com.apple.Finder AppleShowAllFiles NO
Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0tag:blogger.com,1999:blog-8974200987111063981.post-9350725648931226062011-12-19T22:07:00.003-02:002011-12-19T22:18:10.953-02:00Find directory with biggest number of files / directoriesToday we had a problem related with a number of files in a directory. We needed to find directories with a biggest number of files / directories in it. Here is a small shell script that will list directories and a number of files/directories in each directory.
find . -type d|awk {'print "echo -n "$1".\"\t\"; ls "$1"|wc -l"'} > /tmp/do; . /tmp/do|sort -k 2 -n -r |more
Explaining it a little Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0tag:blogger.com,1999:blog-8974200987111063981.post-20059256232786921332010-02-22T14:23:00.000-03:002010-02-22T14:23:19.578-03:00iPhone takes too long to syncAfter changing a notebook I got a following problem. My iPhone was taking an eternity to sync with iTunes. I made a restore - no solution. I made a restore as new iPhone - same problem. After googling a little bit I found that this can be related with "Sync Photos" option. At the moment that I disabled "sync photos" - my iPhone was synced in a couple of minutes.
Problem: iPhone is taking too Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0tag:blogger.com,1999:blog-8974200987111063981.post-9563427294745788732009-11-08T02:38:00.006-02:002009-11-08T02:52:59.174-02:00VMware crashes after updating (upgrading) of host OS (to CentOS 5.4)If you have in your hostd.log something like this:Nov 07 21:19:12.648: Worker#23| Caught signal 6 -- tid 31543this can be related with update(upgrade) of host OS.After upgrading of a host OS (CentOS 5.3->CentOS 5.4) I got an issue - a guest OS started to crash. Searching around for a possible cause I found bug post in CentOS bug tracker. Seems that issue is related to glibc update (last version Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0tag:blogger.com,1999:blog-8974200987111063981.post-19272285206711245712009-08-04T13:48:00.001-03:002009-08-04T13:50:23.080-03:00Twitter tipRT @ryancarson: Top tip: You can put a "+" on the end of any http://bit.ly link and see, real time, the pace at which that link is getting shared and clickedAnonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com1tag:blogger.com,1999:blog-8974200987111063981.post-89933049902457211652009-07-07T10:32:00.004-03:002009-07-07T10:39:03.453-03:00VMware troublesWell, I'm not a hardware guru, but from my experience I figured out the following:Dell Servers + QLogic HBA + IBM Storage = troublesDell Servers + Emulex HBA + IBM Storage = working okDell Servers + QLogic HBA + EMC Storage = working okOther one issue is:Any server + Any HBA + Any storage - Fiber Channel Switch = troubles (unclean filesystem on Linux guests with EXT3 filesystem)Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0tag:blogger.com,1999:blog-8974200987111063981.post-9023853417462141342009-05-25T20:26:00.004-03:002011-12-15T13:23:48.654-02:00"Network Connection Closed Unexpectedly" error while using svn+sshIf you got a "Network Connection Closed Unexpectedly" error while using svn+ssh (here is a nice HOWTO) then you should comment (or remove) "mesg y" in /etc/bashrc or in $HOME/.bashrc
Worked for me as a charm :)Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com5tag:blogger.com,1999:blog-8974200987111063981.post-22561910334297879772009-02-16T12:24:00.003-03:002009-02-16T12:37:53.506-03:00iPhone speaker too lowWell, I got a simple accident - "Mozart Chocolate Liqueur" were split over my iPhone 3G. I quickly clean it out, but... Next day I noticed that my iPhone speaker was too low. I was not able to hear it ringing. After looking around for solution I found a post telling that this can be caused by dust. Seems that this is my case (ok, not dust, but a creamy liqueur...). So, I put some music on my Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com1tag:blogger.com,1999:blog-8974200987111063981.post-55886875969644624962008-12-03T14:33:00.002-02:002008-12-03T14:35:33.326-02:00How to sync Google Contacts and Calendar with iPhoneI've been looking for some simple solution to sync Google Contacts & Calendar with my iPhone on the air (without syncing with my notebook). Finally I found a solution that seems to be working like a charm.https://www.nuevasync.com/Setup process is quite simple and straigh forward. Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0tag:blogger.com,1999:blog-8974200987111063981.post-64319197377902006712008-08-22T17:47:00.003-03:002008-08-22T17:57:11.365-03:00cfmenu and cfgrid overlapIf you are using <cfmenu> and <cfgrid> and you have an overlapping of the menu items by cfgrid header (a part of menu is hidden behind cfgrid header) you must add to your CSS a following style:#myMenuId .yuimenu { z-index: 300003;}This problem is caused by some "yui" CSS style with z-index set to 1, while grid related styles have z-index bigger than 200000.Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com2tag:blogger.com,1999:blog-8974200987111063981.post-73907185596384165132008-07-25T12:31:00.005-03:002008-07-29T08:49:05.642-03:00ESX host not connecting to Virtual CenterWe got following problem some days ago:One of our ESX (version 3.5) hosts, after crash, was not connecting to Virtual Center (version 2.5).Solution:Restart management service on ESX hostservice mgmt-vmware stopservice mgmt-vmware startRestart Virtual Center service on Virtual Center server (stop/start on service VMware Virtual Center in Services)One more stuff - if you have a lot of memory on Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0tag:blogger.com,1999:blog-8974200987111063981.post-81836141866213183242008-06-25T16:19:00.005-03:002008-07-29T08:49:48.895-03:00Creating a copy of the disk (vmdk) in VMwareWhen you need to have the a copy of the disk from one VM on the other:Power off source VM, copy your .vmdk files to destination VM (probably you would like to change disk name and flat name - just rename your files and edit smaller .vmdk file to set correct name for flat file).Set new UUID for your copy of your original .vmdk file/usr/sbin/vmkfstools -J setuuid path_to_destination_VM/Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0tag:blogger.com,1999:blog-8974200987111063981.post-47430213437287162102008-06-16T16:07:00.004-03:002008-07-29T08:50:21.119-03:00Oracle analog of MySQL GROUP_CONCAT functionI was looking for Oracle analog of MySQL GROUP_CONCAT function. There is a solution on Ask Tom site. So here it is:create or replace type string_agg_type as object ( total varchar2(4000), static function ODCIAggregateInitialize(sctx IN OUT string_agg_type ) return number, member function ODCIAggregateIterate(self IN OUT string_agg_type, value IN varchar2 ) return number, member function Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0tag:blogger.com,1999:blog-8974200987111063981.post-14848964016796909692008-05-13T10:40:00.002-03:002008-05-13T10:44:11.077-03:00List number of file handles (open files) for each processHere is a simple script that will show you a number of file handles (open files) used by each process on your Linux system:ps -e|grep -v TTY|awk {'print "echo -n \"Process: "$4"\tPID: "$1"\tNumber of FH: \"; lsof -p "$1"|wc -l"'} > out; . ./outAnonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com2tag:blogger.com,1999:blog-8974200987111063981.post-46639546245388367972008-04-28T11:02:00.003-03:002008-04-28T11:06:47.595-03:00& in Oracle insert or update statementsIf you have & or % in your Oracle insert or update statements - you probably would like to do the following:SQL> set define offSQL> [your insert or update query containing & and %]SQL> set define onAnonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0tag:blogger.com,1999:blog-8974200987111063981.post-36382480198486882022008-04-23T19:27:00.004-03:002008-12-01T17:54:02.989-02:00Export from Oracle table to CSV fileSometimes you need to export result of the query to CSV file. Here is a nice example of how to do this kind of operations.SQL> SET LINESIZE 500 FEEDBACK OFF TRIMSPOOL ON TERMOUT OFF HEAD OFF PAGESIZE 0 TERM OFFSQL> spool outfile.csvSQL> select '"'|| column_1 || '",' || column_2 || ',' || column_3 from mytable where [your where statement]......SQL> spool offSQL> exitIn this case column_1 data willAnonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com2tag:blogger.com,1999:blog-8974200987111063981.post-66552283417056556972008-04-08T10:12:00.002-03:002008-04-08T10:16:04.454-03:00Cent OS 5.1 + Oracle 10gApart of modifying /etc/redhat-release to "redhat-4", there are a couple of packages that you will need to install in order to make Oracle 10g work with Cent OS 5.1:yum install \compat-db-4.2.52-5.1 \glibc-devel-2.5-18.el5_1.1 \libX11-devel-1.0.3-8.0.1.el5 \libXau-devel-1.0.1-3.1 \libXdmcp-devel-1.0.1-2.1 \libXmu-1.0.2-5 \libXtst-devel-1.0.1-3.1 \mesa-libGL-devel-6.5.1-7.5.el5 \Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com1tag:blogger.com,1999:blog-8974200987111063981.post-52624495480079410682008-02-20T18:51:00.002-03:002008-02-20T18:54:29.399-03:00Mac OS & Database developmentSince switching to Mac I was looking for good DB modeling/editing tool that will support Oracle and MySQL databases. Finally I got one... SQL4X Manager J from dbSuite Seems to be a really nice tool.Anonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0tag:blogger.com,1999:blog-8974200987111063981.post-62860951010935719332008-02-13T19:03:00.001-02:002008-02-13T19:05:03.534-02:00Leopard terminal and Midnight CommanderIf you use mc while connected to some linux server and you need to select some files - use Ctrl+TAnonymoushttp://www.blogger.com/profile/16891273299430734291noreply@blogger.com0