When you turn on cloudfront logs to s3 , then it create files like this:

Problem: If you create a table in Athena with single folder which has all the logs, it scans all the data and then gives you specific results. Which means if you want to scan…

To shrink a shard in elasticsearch we already have a “/old_index/_shrink/new_index” endpoint , which creates a new index with less shards. An example of endpoint request :

This script also helps to you set your own private ip and ec2 instance hostname and you can set your own custom environment variables on initial start of the machine.

import boto3, botocore

client = boto3.client(‘ec2’, region_name=’ap-south-1')

AMI = ‘ami-999999999999’
az_zone = ‘ap-south-1a’
InstanceType = “t3a.small”
SubnetId = ‘subnet-999999999999’
SecurityGroupId = ‘sg-999999999999’
IAMProfile =…

To run a php code directly via cli , there’s a simple command for it.

Lets take a example of traditional php script and how to run it :


<?php echo time();

To run it use via cli:

php my_script.php

Now, Lets run it without making the script:

php -r ‘echo time();’

They both would print the same output which is unix timestamp.

More examples of same kind:

php -r ‘echo “Hello World”;’

php -r ‘ print_r( explode( “ “ , ”Hello World” ) );’

php -r ‘var_dump(“Hello World”);’

php -r ‘echo strpos(“Hello World”, “W”);’

php -r ‘$a=10; $b=20; $c=$a+$b; echo $c;’

You can suggest more examples in the comment. Please do to help others.

Git Tags are ref’s that point to specific points in history. They are usually created to make releases or freeze the code at certain point. A tag is like a branch that doesn’t update. You can create and delete tags using git shell or at github.com.

Before starting, you should…

Rahul juneja


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store