Skip to content

Instantly share code, notes, and snippets.

View Hardeep18's full-sized avatar
๐Ÿš€
Focusing

Hardeep Hardeep18

๐Ÿš€
Focusing
View GitHub Profile
@Hardeep18
Hardeep18 / LICENSE.txt
Created August 15, 2022 16:57 — forked from pat/LICENSE.txt
Running Setup SQL scripts on an RDS instance within a VPC, via Terraform
The MIT License (MIT)
Copyright (c) 2018 Pat Allan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@Hardeep18
Hardeep18 / build-gcc-9.2.0-on-centos7.md
Created May 19, 2021 09:58 — forked from nchaigne/build-gcc-9.2.0-on-centos7.md
Building GCC 9.2.0 on CentOS 7

Building GCC 9.2.0 on CentOS 7

Introduction

CentOS 7 distribution (as well as RHEL 7) ships with a somewhat outdated version of the GCC compiler (4.8.5 on CentOS 7.5), which may not be suitable to your compilation requirements. For example, C11 - which supersedes C99 - is fully supported only starting from GCC 4.9).

Additionally, recent versions of GCC (GCC6, GCC7, GCC8, GCC9) come with improvements which help detect issues at build time and offer suggestions on how to fix them. Sometimes, these are even actually helpful!

This note describes how to build the latest GCC (9.2.0 as of October 2019) from sources on CentOS 7. This should be applicable as is on RHEL 7. For other Linux distributions, adapt as needed.

@Hardeep18
Hardeep18 / Dockerfile-jenkins
Created May 31, 2020 17:20 — forked from ohanetz/Dockerfile-jenkins
Utilize Jenkins in an auto-scaling Kubernetes deployment on Amazon EKS
FROM jenkins/jenkins:2.204.5
RUN /usr/local/bin/install-plugins.sh ssh-slaves
RUN /usr/local/bin/install-plugins.sh kubernetes
USER root
RUN apt-get update && apt-get install -y maven
USER jenkins
@Hardeep18
Hardeep18 / update-centos-7.sh
Created May 7, 2020 12:03 — forked from jbeda/update-centos-7.sh
Install prev kubeadm versions
kubeadm init --use-kubernetes-version=v1.5.6
@Hardeep18
Hardeep18 / gist:e006729b661ed5418b4a88cc0f7ace50
Created March 28, 2020 19:56 — forked from zohar/gist:a047e265e336b329f811
MongoDB: Find by regular expression and run regex replace on results
/*
MongoDB: Find by regular expression and run regex replace on results
*/
db.test.find({"url": { $regex: 'http:\/\/' }}).forEach(function(doc) {
doc.url = doc.url.replace(/http:\/\/www\.url\.com/g, 'http://another.url.com');
db.test.save(doc);
});
@Hardeep18
Hardeep18 / EC2-SG-PublicIP-Fixer
Created March 16, 2020 08:11 — forked from naveen-vijay/EC2-SG-PublicIP-Fixer
Python Boto Code to update your EC2 instance's Security Group to be in sync with your changing Public IP
# Python Boto Script to Update the EC2 security group to make the instance
# to be open to your public IP although ISP change
# Can be automated in CRON everyday
import boto
import urllib2
def get_public_ip():
ext_ip = urllib2.urlopen("http://curlmyip.com").read()
return ext_ip.strip()
@Hardeep18
Hardeep18 / Retrieve all EC2 instance userData
Last active March 13, 2020 03:27 — forked from dagrz/Retrieve all EC2 instance userData
Retrieve all EC2 instance userData
#!/usr/bin/env python
from __future__ import print_function
import boto3
import base64
client = boto3.client(service_name='ec2', region_name='us-east-1')
for region in client.describe_regions()['Regions']:
ec2 = boto3.resource(service_name='ec2', region_name=region['RegionName'])
for instance in ec2.instances.all():
response = instance.describe_attribute(Attribute='userData')
cls
$parent = "f:cachetemp"
$unrarred = "f:cacheunpacked"
$files = @()
$unrarpath = "C:Program FilesWinRARunrar.exe"
# Check unrar.exe default path.
if ((Test-Path -Path $unrarpath) -ne $true){
write-host "Unrar.exe not present in default unrar folder. Please verify"
break
@Hardeep18
Hardeep18 / add-dns-record.sh
Created March 5, 2020 12:41 — forked from justinclayton/add-dns-record.sh
CLI to add DNS Records in Route53
#!/bin/bash -eo pipefail
## Allows for creation of "Basic" DNS records in a Route53 hosted zone
function main() {
record_name=$1
record_value=$2
[[ -z $record_name ]] && echo "record_name is: $record_name" && exit 1
[[ -z $record_value ]] && echo "record_value is: $record_value" && exit 1
@Hardeep18
Hardeep18 / jenkins_worker_windows.ps1
Created February 23, 2020 09:23 — forked from ismail0352/jenkins_worker_windows.ps1
user-data for Jenkins slave - Windows
<powershell>
function Wait-For-Jenkins {
Write-Host "Waiting jenkins to launch on 8080..."
Do {
Write-Host "Waiting for Jenkins"
Nc -zv ${server_ip} 8080