S3 notes – how to make all s3 images public

aws configure --profile myproject
// to test if it works or not

aws s3 ls --profile myproject

aws s3 cp \
      --exclude "*" \
      --include "*.jpeg" \
      --content-type="image/jpeg"  \
      --metadata-directive="REPLACE" \
      --recursive \
	  --acl public-read \
       s3://myproject/ \
       s3://myproject/ \
	   --dryrun --profile myproject
aws s3 cp \
      --exclude "*" \
      --include "*.jpg" \
      --content-type="image/jpeg"  \
      --metadata-directive="REPLACE" \
      --recursive \
	  --acl public-read \
       s3://myproject/ \
       s3://myproject/ \
	   --dryrun --profile myproject
aws s3 cp \
      --exclude "*" \
      --include "*.jpeg" \
      --content-type="image/jpeg"  \
      --metadata-directive="REPLACE" \
      --recursive \
	  --acl public-read \
       s3://myproject/ \
       s3://myproject/ \
	   --dryrun --profile myproject
// not needed 
aws s3 sync . s3://my-bucket/path --acl public-read

Dont forget to remove dryrun flag once you are sure.

prevent sticky header jumping in css or js

jQuery(document).ready(function(){var header=jQuery("header .fusion-header");var headerHeight=0; var shouldWrite=1;
if(shouldWrite && headerHeight!==undefined){
jQuery("#headerjumpfixer").html(".fusion-header-wrapper.fusion-is-sticky{padding-top:"+headerHeight + "px}");
<style id="headerjumpfixer">.fusion-header-wrapper.fusion-is-sticky{padding-top:88px}</style>

This unique date 02 02 2020 will come after 1010 years – WRONG MATH

In dd/mm/yyyy format, 2nd February 2020 (02 02 2020) is a palindrome

In really common beliefs, whatsapp forwards were filled with this number being so rare and unique. However it would be stupid to say that such a rare date will occur only after 1010 years.

Here is how:

In whole millennium (1000 years), first few years of first few centuries have many of such dates. Even if you consider MM/DD/YYYY format, you can find a lot of such numbers in first few centuries.

Here are all of such dates in this century (2000 – 2099) in DD/MM/YYYY format


10 tips for better freelancing

How to improve yourself as a freelancer? Here are 10 points to take care of:

  1. Communication Skills – convincing power
  2. Make yourself a brand, your ethics will define your future in freelancing. This will help you in scaling also
  3. Consistency, Focus and Dedication
  4. Productivity is Gold, know your value, do math and target for a monthly number
  5. Read!! know clients requirements in depth, if it is small task, fix already without getting the project. This approach will consume time without paying, but would probably make you better
  6. keep challenging yourself, keep improving
  7. Stay away from template bids, no body wants to know which app you did 4 years ago if the project not about an app
  8. Keep your portfolio updated
  9. Take care of clock, predict and quote project timelines intelligently
  10. Exceed expectations of your Client, under-promise and over-deliver

SQL Notes

CREATE TABLE `clients` (
  `name` varchar(11) NOT NULL,
  `associate` varchar(100) NOT NULL,
  `revenue` int(12) NOT NULL,
  `profit` int(12) NOT NULL,
   PRIMARY KEY (`id`),
   FOREIGN key (`associate`) references `emp`(`emp_code`)

alter table `emp` add COLUMN `phone` int(12) not null after `name`
alter table `emp` add COLUMN `phone` int(12) null after `name`
alter table `emp` modify `phone` int(12) null
alter table `emp` drop column `phone`

  ADD UNIQUE KEY `emp_code` (`emp_code`);

-- AUTO_INCREMENT for dumped tables

-- AUTO_INCREMENT for table `emp`

SSL certification setup: Cloudflare.

This article will guide you to set your SSL certification using Cloudflare. Cloudflare is an internet security company which provides content delivery network service.

You can get free SSL certification as well as paid one from Cloudflare.

A breif discussion on SSL certification and https redirection.

So, Let’s start the process.



Signup and Login to cloudflare. There you will get an option to add your site url. Do it and proceed.


Cloudflare will check your DNS records. You just click next and proceed.


Now choose your plan according to your needs. For this tutorial i preffered free plan. Paid plans will add some extra features and security to your site.


Now it will show you some details of your site to confirm. Just Click continue. And move on.


Cloudflare will give you two nameservers to replace with your default nameserver. Just login to your hosting provider and change it there. And then click continue.

If everything went good so far, cloudflare will activate security on your website. Click Re-check button to refresh cloudflare and it will show the status.

We are almost done. The last thing to do is – get your API key and paste it to wordpress plugin of cloudflare, and save API credentials.

That is it. Your site is now secured with a SSL certification from cloudflare. This certification is valid for 1 year.


Magento File Directory

The etc folder contains the di.xml configuration file
The di.xml file contains class mapping and interface preferences
Contains the design folder for themes.

The directory contains the magento file or a Command Line Interface script

Magento 2 testing and development tools are placed in this folder.

The internal and web subfolders are located here
The internal directory contains server-side libraries and several font files;
The web subfolder contains client-side libraries, jquery, modernizr, requirejs, prototype, scriptaculous

It should be set as your web root on the server
It contains all the publicly accessible files
index.php controller is also contained in the folder
pub also contains the error pages that will be displayed if your site is showing a 404 or 503 or another report page
Image uploads and imports will appear somewhere within pub/media.

caches and generated classes are all located in the folder
the var folder includes cache, composer_home, generation, log, di, view_preprocessed, page_cache files

the folder includes various packages that have been defined under composer.json
Marketplace modules and the core modules are all under vendor.
If you download something from the new Magento Marketplace.

Commands not to be used on terminal as a root user

First one on list is the infamous 8 characters in that particular order

rm -rf /

Sometimes we just want to remove the current directory for which the command is rm -rf ./ but you keyboard skips the dot and you end up in a deadzone.

Second one would be:

ifdown eth0

wow!!, you just disconnected your server from internet.

Basics about advertisements and Google Adsense

On 15th Year Anniversary of GOogle Adsense and their partnerships with Publishers, google published a youtube video briefly explaining all the basic keywords related to Adsense.

15 words to sum up 15 years?
That's easy! Okay, let's go.
Content is at the heart of the web.
And publishers?
You power that web. Without you that place would be quite empty.
Ads? Ads bring the revenue that helps to fund it all while helping you reach your…
Goals! Goals like growing your business, doing something you love and sharing it with the world creating…
Memories? So many good memories!
You've told us that Adsense has funded your weddings,
helped you buy your homes or hire new teams. We feel part of your…
Community. A community that grows with you recommending us. Thank you!
Beginnings. It's been 15 years since we ran our first ads, they were text only back then.
Today? Today Adsense is truly global!
Urdu, Japanese or French – We speak 45 languages. And counting.
Changeā€¦is constant, especially on the web.
We've been evolving with you and your audience needs for the past 15 years,
to help you provide the best possible…
…Experiences. As the look and feel of websites have improved over the years
we built native ads to complement them,
while always giving you the…
Control. To decide what type of ads will show on your site.
Platforms? All of them. Mobile, Video and whatever will come next – we have you covered.
Time. Saved. With smart automated ad placements,
keeping things simple for you so that you can focus on creating great content.
Simplicity. Always. Our team's goal: making it easier to grow your business.
Okay and last but not least.
Happy Birthday! Absolutely. 15 years is a milestone we should all celebrate.
But the web doesn't wait so time to get back to work.
Can I finish my cake first?

Watch the video here