Thursday, October 10, 2013

Git Tagging

Add Tag.

git tag -a v1.0 -m 'version 1.0'


Add Tag to a commit

git tag -a v1.0 -m 'version 1.0' c4283bb


Push Tag to remote origin (All TAG)

git push --tag


Push Tag to remote with specific tag.

git push origin tag v1.0


Here is how to delete a tag from a remote Git repository.

If you have a tag named '12345' then you would just do this:

    git tag -d 12345  git push origin :refs/tags/12345  

That will remove '12345' from the remote repository.


Friday, October 4, 2013

Custom validation on nested attributes



instead of hitting the database with a sum-query, you could calculate the stuff based of the activities collection like this

    self.activities.map(&:hours).sum






Sunday, September 22, 2013

mysql2 gem fail to install on windows

1. Download if you not using xampp or other binary only mysql in your system.

mysql-5.1.72-win32.zip

2. Extract.

3.  
gem install mysql2 -v '0.3.12' -- '--with-mysql-lib=D:\mysql-5.1.72-win32\lib\opt --with-mysql -include=D:\mysql-5.1.72-win32\include'

4. Enjoy.

* Im using xampp on window8. You can delete the downloaded mysql-5.1.72 from your system after installing the gem. 

Thanks.

Thursday, September 12, 2013

JMeter no user/password was provided for basic authentication

Jmeter HTTP Authentication not working:

Error message:  no user/password was provided for basic authentication

Need to uncomment 2 properties in two files stated below:

Documentation stated:

http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Authorization_Manager

In versions of JMeter after 2.2, the HttpClient sampler defaults to pre-emptive authentication if the setting has not been defined. To disable this, set the values as below, in which case authentication will only be performed in response to a challenge.

Edit filename: jmeter.properties  httpclient.parameters.file=httpclient.parameters    Edit filename httpclient.parameters  http.authentication.preemptive$Boolean=false

Problem solved!... 

Monday, September 9, 2013

GS1 Prefixes do not provide identification of country of origin for a given product.


Prefix List

GS1 Prefixes do not provide identification of country of origin for a given product. They simply provide number capacity to different countries for assignment from that location to companies who apply. Those companies in turn may manufacture products anywhere in the world.

The management of the GS1 System is carried out locally by GS1 Member Organisations established in over 100 countries. GS1 Member Organisations use their assigned prefix to allocate GS1 Company Prefixes to their member companies to enable them to create GS1 Identification Keys.


ASSIGNED GS1 PREFIXES

000 - 019 GS1 US
020 - 029 Restricted distribution (MO defined)
030 - 039 GS1 US
040 - 049 Restricted distribution (MO defined)
050 - 059 Coupons
060 - 139 GS1 US
200 - 299 Restricted distribution (MO defined)
300 - 379 GS1 France
380 GS1 Bulgaria
383 GS1 Slovenija
385 GS1 Croatia
387 GS1 BIH (Bosnia-Herzegovina)
389GS1 Montenegro
400 - 440 GS1 Germany
450 - 459 & 490 - 499 GS1 Japan
460 - 469 GS1 Russia
470 GS1 Kyrgyzstan
471 GS1 Taiwan
474 GS1 Estonia
475 GS1 Latvia
476 GS1 Azerbaijan
477 GS1 Lithuania
478 GS1 Uzbekistan
479 GS1 Sri Lanka
480 GS1 Philippines
481 GS1 Belarus
482 GS1 Ukraine
484 GS1 Moldova
485 GS1 Armenia
486 GS1 Georgia
487 GS1 Kazakstan
488GS1 Tajikistan
489 GS1 Hong Kong
500 - 509 GS1 UK
520 - 521 GS1 Association Greece
528 GS1 Lebanon
529 GS1 Cyprus
530GS1 Albania
531 GS1 MAC (FYR Macedonia)
535 GS1 Malta
539 GS1 Ireland
540 - 549 GS1 Belgium & Luxembourg
560 GS1 Portugal
569 GS1 Iceland
570 - 579 GS1 Denmark
590 GS1 Poland
594 GS1 Romania
599 GS1 Hungary
600 - 601 GS1 South Africa
603GS1 Ghana
604GS1 Senegal
608 GS1 Bahrain
609 GS1 Mauritius
611 GS1 Morocco
613 GS1 Algeria
615GS1 Nigeria
616 GS1 Kenya
618GS1 Ivory Coast
619 GS1 Tunisia
620 GS1 Tanzania
621 GS1 Syria
622 GS1 Egypt
623 GS1 Brunei
624 GS1 Libya
625 GS1 Jordan
626 GS1 Iran
627 GS1 Kuwait
628 GS1 Saudi Arabia
629 GS1 Emirates
640 - 649 GS1 Finland
690 - 699 GS1 China
700 - 709 GS1 Norway
729 GS1 Israel
730 - 739 GS1 Sweden
740 GS1 Guatemala
741 GS1 El Salvador
742 GS1 Honduras
743 GS1 Nicaragua
744 GS1 Costa Rica
745 GS1 Panama
746 GS1 Republica Dominicana
750 GS1 Mexico
754 - 755 GS1 Canada
759 GS1 Venezuela
760 - 769 GS1 Schweiz, Suisse, Svizzera
770 - 771 GS1 Colombia
773 GS1 Uruguay
775 GS1 Peru
777 GS1 Bolivia
778 - 779 GS1 Argentina
780 GS1 Chile
784 GS1 Paraguay
786 GS1 Ecuador
789 - 790 GS1 Brasil  
800 - 839 GS1 Italy  
840 - 849 GS1 Spain  
850 GS1 Cuba
858 GS1 Slovakia
859 GS1 Czech
860  GS1 Serbia
865 GS1 Mongolia
867 GS1 North Korea
868 - 869 GS1 Turkey
870 - 879 GS1 Netherlands
880 GS1 South Korea
884 GS1 Cambodia
885 GS1 Thailand
888 GS1 Singapore
890 GS1 India
893 GS1 Vietnam
896GS1 Pakistan
899 GS1 Indonesia
900 - 919 GS1 Austria
930 - 939 GS1 Australia
940 - 949 GS1 New Zealand
950GS1 Global Office
951GS1 Global Office (EPCglobal)
955 GS1 Malaysia
958 GS1 Macau
960-969 Global Office (GTIN-8s)
977 Serial publications (ISSN)
978 - 979 Bookland (ISBN)
980 Refund receipts
981 - 984 GS1 coupon identification for common currency areas
99 GS1 coupon identification
Notes:

960 has been assigned to GS1 UK for GTIN-8 allocations.

Prefixes not listed above are reserved by GS1 Global Office for allocations in non-member countries and for future use.

Monday, September 2, 2013

Don't know how to build task 'thinking_sphinx:config' after update from TS 2.0.12 -> 3.0.5

New rake task defined in new version 3.+

rake ts:clear                    # Clear out Sphinx files
rake ts:configure                # Generate the Sphinx configuration file
rake ts:generate                 # Generate fresh index files for real-time indices
rake ts:index                    # Generate the Sphinx configuration file and process all indices
rake ts:rebuild                  # Stop Sphinx, index and then restart Sphinx
rake ts:regenerate               # Stop Sphinx, clear files, reconfigure, start Sphinx, generate files
rake ts:restart                  # Restart the Sphinx daemon
rake ts:start                    # Start the Sphinx daemon
rake ts:stop                     # Stop the Sphinx daemon

Saturday, March 30, 2013

GSM MCC MNC FOR MALAYSIA TELCO

Malaysia - MY

MCC MNCBrand OperatorStatus Bands (MHz)References and notes
50201ATUR 450Telekom Malaysia Bhd OperationalCDMA2000 450 (depreciated)011-(6digits)
50210 DiGi Telecommunications [85]
50211TM Homeline Telekom Malaysia Bhd [86] [85]
50212Maxis Maxis Mobile Services SDN BerhadOperationalGSM 900 / GSM 1800 / UMTS 2100 [87]
50213Celcom Celcom Axiata BerhadOperational GSM 900 / GSM 1800 / UMTS 2100Formerly TMTouch
[88]
50214 Telekom Malaysia Berhad for PSTN SMS [85]
50216DiGi DiGi Telecommunications OperationalGSM 1800 / UMTS 2100
50217HotlinkMaxis Prepaid OperationalGSM 900 / GSM 1800 / UMTS 2100 Formerly TimeCel Adam017
50218 U MobileU Mobile Sdn Bhd OperationalUMTS 2100Domestic Roaming with Celcom
50218TM Homeline Telekom Malaysia BhdOperational CDMA 850[89] On MCMC website, 502-18 is allocated to U Mobile [85]
50219Celcom Celcom Axiata BerhadOperational GSM 900 / GSM 1800 / UMTS 2100[90]
50220 Electcoms Wireless Sdn BhdOperationalCDMA PTT and CDMA Technology. Uses TM CDMA [85]
502150Tune Talk Tune Talk Sdn BhdOperationalMVNO uses Celcom [85]
502151 Baraka Telecom Sdn Bhd (MVNE)OperationalMVNO SalamFone[91] (MVNO)-MAXIS,[85]Previously using DiGi.
502152Yes YTL Communications Sdn BhdOperational WiMAX 2.3 GHz / LTE 4G[85]

Thursday, March 28, 2013

Ruby: Get Value from Collection

    TITLETYPE = [['Prof.', '4'],    ['Dr.', '3'],    ['Mrs.', '2'],    ['Ms.', '1'],    ['Mr.', '0']]
    
    TYTLETYPEHASH = Hash[TYTLETYPE]  
    TYTLEHASH.key('1') # => 'Ms.' 

Proxmox installation display out of range

Reference:  https://forum.proxmox.com/threads/proxmox-ve-screen-out-of-range.131297/