Skip to content

Instantly share code, notes, and snippets.

@junaid18183
junaid18183 / userdata.sh
Created October 12, 2022 08:25 — forked from dkeightley/userdata.sh
RKE2 AWS cloud controller manager
#!/bin/sh
PUBLIC_IP=$(curl ifconfig.io)
# export INSTALL_RKE2_VERSION="v1.20.5+rke2r1"
curl -sfL https://get.rke2.io | sh -
provider_id="$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)/$(curl -s http://169.254.169.254/latest/meta-data/instance-id)"
provider "aws" {
region = "us-east-2"
}
terraform {
required_version = "1.0.7"
required_providers {
aws = {
source = "hashicorp/aws"
@junaid18183
junaid18183 / debloat.sh
Last active April 7, 2023 08:10
Debloat Xiomi
adb devices -l
List of devices attached
ZD2228KRXB device usb:339738624X product:hawao_g model:moto_g42 device:hawao transport_id:1
adb -d shell
pm list packages | grep google
com.google.android.youtube
pm uninstall -k --user 0 com.google.android.apps.tachyon # Google Duo
@junaid18183
junaid18183 / keybase.md
Created April 1, 2020 05:38
keybase.md

Keybase proof

I hereby claim:

  • I am junaid18183 on github.
  • I am junaid18183 (https://keybase.io/junaid18183) on keybase.
  • I have a public key whose fingerprint is 125A B028 4F43 4538 0570 9A8A B7C1 868E 3994 DA9E

To claim this, I am signing this object:

@junaid18183
junaid18183 / sssd_on_redhat.sh
Last active November 28, 2018 13:29
sssd_on_redhat
#https://mapr.com/support/s/article/How-to-configure-LDAP-client-by-using-SSSD-for-authentication-on-CentOS?language=en_US
#https://gist.github.com/mazgi/3dbfe99fb2b3e8d1e50b
#http://www.ateam-oracle.com/part-3-of-4-sssd-linux-authentication-implementation-step-by-step-guideline/
yum install openldap openldap-clients sssd sssd-client
cp /etc/openldap/ldap.conf /etc/openldap/ldap.conf.orig
> /etc/openldap/ldap.conf
cat << EOF > /etc/openldap/ldap.conf
BASE dc=example,dc=com
@junaid18183
junaid18183 / ssm-cft.json
Last active April 3, 2018 07:35
CFT template to create the Sample Lambda which takes config value from SSM Parameter
{
"AWSTemplateFormatVersion": "2010-09-09",
"Metadata": {
"AWS::CloudFormation::Interface": {
"ParameterGroups": [
{
"Label": {
"default": "HelloWorld Parameters"
},
"Parameters": [
@junaid18183
junaid18183 / check_vpn_status.py
Created March 9, 2018 13:06 — forked from mjbommar/check_vpn_status.py
This script monitors and logs to CSV the status of all tunnels for all VPNs for a single EC2 region.
'''
@author Bommarito Consulting, LLC; http://bommaritollc.com/
@date 20131029
This script monitors and logs to CSV the status of all tunnels for all VPNs for a single EC2 region.
'''
# Imports
import boto
import boto.ec2
import boto.vpc
@junaid18183
junaid18183 / taint_module.sh
Created February 15, 2018 05:47 — forked from justinclayton/taint_module.sh
Terraform: taint all resources from one module
#!/bin/bash
module=$1
for resource in `terraform show -module-depth=1 | grep module.${module} | tr -d ':' | sed -e 's/module.${module}.//'`; do
terraform taint -module ${module} ${resource}
done
@junaid18183
junaid18183 / vault_ssh_otp_demo.sh
Last active May 10, 2020 11:11
vault_ssh_otp_demo
#!/bin/bash
download_vault(){
wget https://releases.hashicorp.com/vault/0.9.1/vault_0.9.1_linux_amd64.zip?_ga=2.165144251.566422628.1516357846-2059600638.1516357846 -O vault_0.9.1_linux_amd64.zip
apt-get install -y zip
unzip vault_0.9.1_linux_amd64.zip
mv vault /usr/local/bin/
rm vault_0.9.1_linux_amd64.zip
}
########################
download_ssh_helper(){
@junaid18183
junaid18183 / gist:17c5b94e38a3072722440051074c9b5d
Created January 8, 2018 09:21 — forked from cktricky/gist:8f4e9912f757d1ccdcd00ad8e8630620
Lambda Function to Alert (Slack) of Unauthorized IAM Attempt
var AWS = require('aws-sdk');
var url = require('url');
var https = require('https');
var hookUrl, kmsEncyptedHookUrl, slackChannel;
kmsEncyptedHookUrl = 'abcd1234'; // Enter the base-64 encoded, encrypted key (CiphertextBlob)
slackChannel = 'example_channel'; // Enter the Slack channel to send a message to
var postMessage = function(message, callback) {