Skip to content

Instantly share code, notes, and snippets.

View ShubhamRasal's full-sized avatar
💻
Cooking software

Shubham Rasal ShubhamRasal

💻
Cooking software
View GitHub Profile
{
"Version": "2008-10-17",
"Id": "PolicyForPublicWebsiteContent",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
aws s3api put-bucket-policy --bucket dev-creatorsbyheart.com --policy file://s3_bucket_policy.json
@ShubhamRasal
ShubhamRasal / s3 cp
Created December 6, 2020 10:55
s3 cp
aws s3 cp aws_image.jpg s3://dev-creatorsbyheart.com
{
"CallerReference": "shubham-rasal",
"Aliases": {
"Quantity":0
},
"Origins": {
"Quantity": 1,
"Items": [
{
"Id": "cloudfront-dev-creatorsbyheart.com",
@ShubhamRasal
ShubhamRasal / cloudfront create-distribution
Created December 6, 2020 11:00
cloudfront create-distribution
aws cloudfront create-distribution --distribution-config file://cf_config.json
@ShubhamRasal
ShubhamRasal / ssm send-command
Created December 6, 2020 11:12
ssm send-command
aws ssm send-command \
--document-name "AWS-RunShellScript" \
--parameters commands=["sudo yum install httpd git -y,
sudo systemctl start httpd,
sudo systemctl enable httpd,
sudo mkfs.ext4 /dev/xvdf/ /var/www/html ,
sudo rm -rf /var/www/html/*,
sudo git clone https://github.com/creatorsbyheart/creatorsbyheart.github.io.git /var/www/html/ ,
sudo systemctl restart httpd "]
--targets "Key=instanceids,Values=<instance-id>"
@ShubhamRasal
ShubhamRasal / hadoop-install.yml
Created December 17, 2020 06:26
ansible playbook to install hadoop
#Install hadoop on namenode and datanodes
- hosts:
- hadoop_namenode
- hadoop_datanode
vars:
- user_directory: "{{ ansible_facts['user_dir']}}"
tasks:
#copy java software
- name: "Transfer JDK 8"
@ShubhamRasal
ShubhamRasal / namenode-core-site.xml
Created December 17, 2020 06:42
namenode core-site.xml for ansible
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://{{ groups['hadoop_namenode'][0] }}:{{hadoop_port}}</value>
</property>
</configuration>
@ShubhamRasal
ShubhamRasal / namenode-hdfs-site.xml
Created December 17, 2020 06:44
namenode-hdfs-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>dfs.name.dir</name>
<value>{{user_dir}}{{namenode_directory }}</value>
</property>
</configuration>
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://{{ groups['hadoop_namenode'][0] }}:{{hadoop_port}}</value>
</property>
</configuration>