Posts

Showing posts from February, 2015

How to install GIT & Configure SSH in CentOs?

Step:#1 - Install GIT
sudo yum install git

Step:#2 - Configure SSH [After GIT Installation]

1. goto cd/home
2. cd .ssh
3. ssh -keygen -t rsa
4. cat id_rsa.pub
5. Copy the key generated and send it to System Admin

Show Desktop - Keyboard shortcut for Linux

To show the desktop / minimize all running applications press

"ctrl+alt+D"

Now it will show you the desktop.

Endeca - Components ready but server not started?

If you get error like
110 of 110 components loaded (116 of 145 components are ready)....
If it takes more time to load, follow the simple steps

Step #1: open
vi server/workspace/state/sling/_ifcr/jackrabbit/repository/nodetypes/custom_nodetypes.xml

Step #2: Paste the following code

<?xml version="1.0" encoding="UTF-8" standalone="no"?><nodeTypes xmlns:ecr="http://www.endeca.com/ecr/2012" xmlns:endeca="http://www.endeca.com/jcr/nt/2011" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:fn_old="http://www.w3.org/2004/10/xpath-functions" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ocm="http://jackrabbit.apache.org/ocm" xmlns:rep="internal" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:xs="http:/…

CentOs "gnome-screenshot" (No such file or directory)

Are you struck with taking Screenshot?
Are you getting the error
"gnome-screenshot" (No such file or directory) 
Follow the 2 steps to overcome:
Step #1 - Login to your root su -
Step #2 - Install Gnome Utilities yum install gnome-utils -y
Now you can take the screenshots with out any errors.

How to show all tables in the DB - Oracle XE?

SQL> SELECT table_name FROM user_tables;

It will list all the table names;

How to fix ORA-12547 TNS lost contact when try to connect to Oracle

Problem:
While login to oracle, the following error may happen:

sqlplus scott/tiger
ERROR:
ORA-12547: TNS:lost contact

Solution:
Step: #1
cd $ORACLE_HOME/bin
ls -ltr oracle
-rwxr-xr-x    1 oracle   oinstall       136803483 Mar 16 20:32 oracle

Step: #2
Change permissions as below:

chmod 6751 oracle
ls -ltr oracle
-rwsr-s--x    1 oracle   oinstall       136803483 Mar 16 20:32 oracle

Source:
http://www.dadbm.com/how-to-fix-ora-12547-tns-lost-contact-when-try-to-connect-to-oracle/

Why Terminal is closing while using ATG / Endeca?

Problem:
Linux terminal will close automatically.

Solution:
Check you .bashrc, there should be the following:

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# User specific aliases and functions


And the changes must be in your .bash_profile

Find the brightness of HEX color

function get_brightness($hex) {
// returns brightness value from 0 to 255

// strip off any leading #
$hex = str_replace('#', '', $hex);

$c_r = hexdec(substr($hex, 0, 2));
$c_g = hexdec(substr($hex, 2, 2));
$c_b = hexdec(substr($hex, 4, 2));

return (($c_r * 299) + ($c_g * 587) + ($c_b * 114)) / 1000;
}

It will return the brightness.
if ($this->get_brightness($msg_color) > 130){$text_color='black';}
                    else {$text_color='white';}

Install Google Chrome Using Richard Lloid script.

Richard Lloid developed one shell script which will help us to install google chrome in CentOS / RHEL / Fedora. Use the below command to install latest google chrome.

$ wget http://chrome.richardlloyd.org.uk/install_chrome.sh$ chmod +x install_chrome.sh$ sh install_chrome.sh$ google-chromeTo un-install Google chrome$ sh install_chrome.sh -u

Free SSL for websites

Image
CloudFlare.com
provides the Free SSL for the websites along with free CDN.
The main features of CloudFlare.com are CloudFlare's system gets faster and smarter as our community of users grows larger. We have designed the system to scale with our goal in mind: helping power and protect the entire Internet. CloudFlare can be used by anyone with a website and their own domain, regardless of your choice in platform. From start to finish, setup takes most website owners less than 5 minutes. Adding your website requires only a simple change to your domain's DNS settings. There is no hardware or software to install or maintain and you do not need to change any of your site's existing code. If you are ever unhappy you can turn CloudFlare off as easily as you turned it on. Our core service is free and we offer enhanced services for websites who need extra features like real time reporting or SSL. Join CloudFlare today and be part of the community that is creating a better web. Website: ht…

What is SKU?

SKU: Stock Keeping Unit
This is the unique code to be assigned to the products for inventory management purpose. This may be the bar code or in any number formatted.
In e-Commerce, it is mainly used to identify the product.

What is ATG Repository?

ATG Repository act as the Data layer between DB and ATG to fetch and store the data in DB.

Versioned Repository will create each version for each edit.
For Ex.: If a product created a new row will generated, as usual. But, if we edit the same product, Versioned repository will generate another new row for the edited data.

How to clean ubuntu temp files?

The clean command will remove every single cached item, while the auto-clean command only removes cached items that can no longer be downloaded.

$ sudo apt-get clean

$ sudo apt-get autoremove
it will remove the unnecessary packages.

The stupid station Logo

Image

The Great achievements of Piyush Pandey

Image
The Great achievements of Piyush Pandey
Bharatiya Janata Party campaign for Indian general election, 2014: with Prasoon Joshi and Abeer ChatterjeeFevicol Ad Campaigns: These include the Cannes award winning hen and egg advertisement created by him to break the monotony of elephants being used as a medium, and others like a politician glued to his chair, a ridiculously overcrowded bus, the joint family that refuses to fall apart, the girl with a moustache or the cycle glued to jeep.Fevikwik Ad Campaigns: Fevikwik ad campaigns including the fishermen ad.CadburyDairy Milk Ad Campaigns: 'Kuch khaas hai' and many more.Vodafone Ad Campaigns: These include campaigns with the iconic characters of ZooZoo and many others.Asian Paints ad campaigns: ‘Har ghar kuch kehta hai’Campaigns for Indian Tourism : These include focused campaigns for Incredible India, Madhya Pradesh Tourism, Gujarat Tourism, and Kerala Tourism.Bell Bajao Ad Campaign : Cannes winning campaign asking people to ha…

Fit the Canvas object to the canvas width or height

function fitToScale()
        {
            activeObject = canvas.getActiveObject();
            if (activeObject.width >= activeObject.height) {
                expectedScaleX = (canvas.width - 20) / activeObject.width;
                proportion = expectedScaleX / activeObject.scaleX;
                activeObject.scaleX = expectedScaleX;
                activeObject.scaleY = activeObject.scaleY * proportion;
                horizontal_center_object();
            }
            else {
                expectedScaleY = (canvas.height - 20) / activeObject.height;
                proportion = expectedScaleY / activeObject.scaleY;

                activeObject.scaleY = expectedScaleY;
                activeObject.scaleX = activeObject.scaleX * proportion;
                vertical_center_object();
            }
            canvas.renderAll();
        }

Centering the Canvas object - JS

// MOVE THE SELECTED OBJECT TO THE CENTER 
function center_object() OF CANVAS
        {
            var obj = canvas.getActiveObject();
            obj.center().setCoords();
            canvas.renderAll();
        }

Stop canvas object outside the Canvas

canvas.on('object:scaling', function (event) {  // THIS EVENT WILL STOP RESIZE OVER THE CANVAS SIZE
                var el = event.target;

                widthPercentage = ((el.width * el.scaleX) / canvas.width) * 100;
                document.getElementById('textSizeSlider').value = widthPercentage;
                canvas.renderAll();              

                if (el && (el.height * el.scaleY) > 10 && (el.left + (el.width * el.scaleX)) < canvas.width && (el.top + (el.height * el.scaleY)) < canvas.height) {
                    previous_scaleY = el.scaleY;
                    previous_scaleX = el.scaleX;
                    previous_left = el.left;
                    previous_top = el.top;
                }

                if (el && (el.height * el.scaleX) < 10) {
                    el.left = previous_left;
                    el.top = previous_top;
                    el.scaleX = previous_scaleX;
                    el.scaleY = prev…

Goto the Div Position - JavaScript

HTML
--------
<div id="design_start">
Your content here
</div>
<button onclick="goto_top_position();">Move to design area</button>

JS
------
function goto_top_position()
        {
            $('html, body').animate({
                scrollTop: $("#design_start").offset().top
            }, 1000);
        }

This code will take the scroll to the div position with animation

How to hide overflow text in a Div

<a href="data:post.url" href="https://www.blogger.com/null" style="height: 75px; overflow: hidden; text-overflow: ellipsis;">
   Your text here
</a>

Indian Beverage Brand succeeding the Market - Bovonto

Image
One of the Indian based beverage product, Bovonto, fighting with the Global brands in various aspects, especially, Price, Quality and availability.


Store in DB using AJAX - Magento

JS
--------------
var designInitialArray = {};
designInitialArray['template_id'] = document.getElementById('customer_template_id').value;
designInitialArray['design_code'] = design_code;
designInitialArray['product_id'] = product_id;
designInitialArray['customer_id'] = customer_id;
var designInitial_jsonString = JSON.stringify(designInitialArray);

$.ajax({
    type: "POST",
    url: "productdesigner/tool/customer_design_initialize/",
    data: {data: designInitial_jsonString},
    success: function (oup) {
        alert(oup);
    }
});


CONTROLLER ACTION
-------------------
Mage::getModel('productdesigner/customerdesign')->customer_design_initialize($_POST['data']);


MODEL
-------------

$items = array();
$oldarray = json_decode($data);
foreach ($oldarray as $key => $item) {
    $items[$key] = $item;
}


$hot_spot = Mage::getModel('productdesigner/itemhotspot');
$hot_spot->setData($items);

Citrisys T-Shirt design

Image

ATG Basic structure

Image
To know more about DAF (Dynamo Application Framework) goto this link: http://www.muthupandian.in/2015/03/dynamo-application-server-atg-module.html