Category Archives: Educational

9 ways to tell if you’re really a DevOps organization

9 ways to tell if you’re really a DevOps organization
Many people believe that their organizations use a DevOps approach, but the “best practices” they’ve adopted aren’t consistent with a DevOps methodology. You can call what you do at your organization “DevOps,” but if you don’t follow the basic software methodology principles, it’s not DevOps. Period.

Here’s a set of objective criteria you can use to determine whether what you’re doing is truly DevOps. You’re really doing DevOps if…

1. You have frequent, rapid release cycles.
2. Deployment to production is fully automated, and you can automatically roll back.
3. You do continuous integration with automated testing at every check-in.
4. You have far more resources devoted to automated testing than manual testing.
5. Your developers, testers, and operations engineers work together.
6. Your developers, testers, and operations engineers have common, business-oriented goals that cover the whole value chain.
7. You’re paying back your technical debt.
8. Management gives the team the authority to make the changes it needs to make—and the team makes those changes.
9. You have feedback mechanisms in place to ensure continuous assessment—and act on that feedback to ensure continuous improvement.

shell script to replace a string in a file

shell script to replace a string in a file

Some times during automating any task, we may require to replace a string in a file.
Example:- I want to change “Linux” string with “Waseem” in a file called string.txt

cat replacestring.sh
#!/bin/bash
# Shell Script to replace string in a file
/bin/sed -i “s/Linux/Waseem/g” /PATH/TO/FILE/string.txt
exit 0;

Before:-
—————–
cat string.txt
Linux

Run the script:-
——————-
sh replacestring.sh

After:-
——————
cat string.txt
Waseem

Another way we can replace string by passing parameter,so that the script will be used dynamically.
cat replacestring.sh
#!/bin/bash
# Shell Script to replace string in a file
/bin/sed -i “s/$1/$2/g” /PATH/TO/FILE/string.txt
exit 0;

Run the script:-
—————–
sh replacestring.sh Linux Waseem

Time Value of Money

The concept of Time Value of Money:
“A rupee is now worth full than a rupee to be received after a year” why ?

Do you prefer a 1000 rupees today or a 1000 rupees one year from now? why?

– Consumption forgone has value
– Investment lost has opportunity cost
– Inflation may increase and purchasing power decrease

Now,
Do you prefer a 1000 rupees today or 1100 rupees one year from now? Why?

You will ask yourself one question:
– Do I have any thing better to do with that 1000 rupees than lending it for 100 rupees
extra?

– What if I take 1000 rupees now and invest it, would I make more or less than
1100 rupees in one year?

Note:
Two elements are important in valuation of cash flows:
– What interest rate (opportunity rate, discount rate, required rate of
return) do you want to evaluate the cash flow based on?
– At what time do these the cash flows occur and at what time do you need
to evaluate them?

Example:
What return is needed to double money?
The present value formula can be rearranged to determine what rate of return is
needed to accumulate a given amount from an investment. For example, £100 is invested today and £200 return is
expected in five years; what rate of return (interest rate) does this represent?

The present value formula restated in terms of the interest rate is:

tme value of money

In addition to Time value of Money, let us also discuss, what is Opportunity cost?

Definition:
Opportunity cost is the cost of a foregone alternative. If you chose one alternative over another, then the cost of choosing that alternative is an opportunity cost. Opportunity cost is the benefits you lose by choosing one alternative over another one. The opportunity cost of choosing one investment over another one.

Example:
There is an opportunity cost over choosing an investment in bonds over an investment in stocks.

Product life cycle

Product life cycle is a business analysis that attempts to identify a set of common stages in the life of commercial products. In other words the ‘Product Life cycle‘ PLC is used to map the lifespan of the product such as the stages through which a product goes during its lifespan.

productlifecycle

Marketing Mix

Definition of Marketing Mix
According to Philip Kotler – Marketing Mix is the combination of four elements, called the 4P’s (product, Price, Promotion, and Place), that every company has the option of adding, subtracting, or modifying in order to create a desired marketing strategy”
According to Principles of Marketing, 14e, Kotler and Armstrong, 2012 – The Marketing Mix is the set of tactical marketing tools – Product, Price, Promotion, and Place – that the firm blends to produce the response it wants in the target market.”
marketingmixdiagram4c-vs-4p

Benchmarking

What is BenchMarking ?
Evaluate (something) by comparison with a standard.
(or)
Benchmarking is simply the comparison of one organization’s practices and performance against those of others.It seeks to identify standards, or “best practices,” to apply in measuring and improving performance.

Steps involved in Benchmarking

1310050305004

Benchmarking2 Word Cloud "Benchmarking"

Installing Apache and PHP from source

I’ve just been through the process of installing the latest versions (as of this writing) of Apache 2.4.2 and PHP 5.4.5 from source on a new Debian 6 virtual machine for the first time.

I had some small issues along the way and thought I’d do a short post on the process I went through to get it working and resolve various errors which may help someone out. First we will install Apache, followed by PHP.

Prerequisites

Before starting you will need make, gcc and g++ installed.

apt-get install make gcc g++
I also had the latest version of MySQL installed (5.5.25a), as I wanted to use this later on. The latest version was downloaded from the Dotdeb repository

Installing Apache 2.4.2 from source

Apache was then downloaded from http://httpd.apache.org/download using wget on one of the mirrors in my country and then extracted.

wget http://apache.mirror.uber.com.au//httpd/httpd-2.4.2.tar.gz
tar xf httpd-2.4.2.tar.gz
cd httpd-2.4.2/
./configure –enable-so

Configuring Apache Portable Runtime library …
checking for APR… no
configure: error: APR not found. Please read the documentation.
–enable-so is needed later on for PHP.

At this point I downloaded APR 1.4.6 from apr.apache.org/download using wget and then extracted it.

cd ..
wget http://apache.mirror.uber.com.au//apr/apr-1.4.6.tar.gz
tar xf apr-1.4.6.tar.gz
cd apr-1.4.6/
./configure
make
make install
Apache will also need APR-util installed, which can be downloaded from the apr.apache.org/download page too. When you run configure you will have to specify where the apr config is, you should see this location in the output from make install after finishing apr above.

cd ..
wget http://apache.mirror.uber.com.au//apr/apr-util-1.4.1.tar.gz
tar xf apr-util-1.4.1.tar.gz
cd apr-util-1.4.1/
./configure –with-apr=/usr/local/apr/bin/apr-1-config
make
make install
Now that’s complete we can try Apache again.

cd ../httpd-2.4.2/
./configure –enable-so

checking for pcre-config… false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
pcre-8.30.tar.gz was then downloaded from http://pcre.org and for something different, I uploaded it to the server with SFTP to the root directory.

cd ..
tar xf pcre-8.30.tar.gz
cd pcre-8.30/
./configure
make
make install
Now to try Apache again…

cd ../httpd-2.4.2/
./configure –enable-so
make
make install
That’s it, Apache should now be ready to go, let’s move into the default installation and start it up.

cd /usr/local/apache2/bin/
./apachectl start
/usr/local/apache2/bin/httpd: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
ldconfig
./apachectl start
./apachectl -v
Server version: Apache/2.4.2 (Unix)
Server built: Jul 26 2012 20:51:23
That error relating to the shared libraries was resolved by running ldconfig, see the man page on that for more information.

Browsing to the IP address in my web browser now brings up the Apache default page. As ServerSignature is enabled by default, using Firebug for FireFox I can see “Apache/2.4.2 (Unix)” as the Server header in the response headers, confirming the new install of Apache has served my page.

Installing PHP 5.4.5 from source

PHP was downloaded from http://au.php.net/get/php-5.4.5.tar.gz/from/a/mirror and then uploaded to the root directory on the server using SFTP.

I’m configuring PHP with apxs, this wasn’t working for me unless Apache was configured with –enable-so. I was after MySQL support, feel free to leave –with-mysql off.

cd /root
tar xf php-5.4.5.tar.gz
cd php-5.4.5/
./configure –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql=mysqlnd

configure: error: xml2-config not found. Please check your libxml2 installation.
apt-get install libxml2-dev
./configure –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql=mysqlnd
make
make install
php -v
PHP 5.4.5 (cli) (built: Jul 26 2012 21:18:58)
Configuration

Once you have both Apache and PHP installed and running there is a bit of configuration to do so that Apache knows how to use PHP. I created a phpinfo file here /usr/local/apache2/htdocs/phpinfo.php and it will not display in a browser prior to configuration.

First off, let’s copy the library file over to Apache.

cp /root/php-5.4.5/libs/libphp5.so /usr/local/apache2/modules/
Next you will want to edit the Apache configuration file in /usr/local/apache2/conf/httpd.conf and add the following lines into it.

AddType text/html .php
AddHandler php5-script .php
This line should already be in there, referring to the .so file that was previously copied.

LoadModule php5_module modules/libphp5.so
You probably want to edit DirectoryIndex index.html and include index.php after this.

Once complete, restart Apache.

cd /usr/local/apache2/bin/
./apachectl restart