Skip to content

Instantly share code, notes, and snippets.

View xt3r4m's full-sized avatar
💭
I may be slow to respond.

xt3r4m

💭
I may be slow to respond.
View GitHub Profile
@xt3r4m
xt3r4m / kubectl.md
Created October 21, 2022 14:00 — forked from so0k/kubectl.md
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@xt3r4m
xt3r4m / generate-nginx-cloudflare-allow.sh
Created July 6, 2022 17:30 — forked from mkg20001/generate-nginx-cloudflare-allow.sh
A script to generate a config to allow or additionally allow cloudflare addresses for a specific domain
#!/bin/bash
set -e
cf_ips() {
echo "# https://www.cloudflare.com/ips"
for type in v4 v6; do
echo "# IP$type"
curl -sL "https://www.cloudflare.com/ips-$type/" | sed "s|^|allow |g" | sed "s|\$|;|g"
#Checking for the IP's Performing DDOS attack.
netstat -ntu|awk '{print $5}'| cut -d: -f1 -s | sort| uniq -c| sort -nk1 -r
#**********Compression and Decompression**********#
#For compressing to tar.gz file
tar czvf create.tar.gz /directory/to/be/compressed/
#For Extracting tar.gz file in specific directory
tar -xzvf yourfile.tar.gz -C /extracting/directory
@xt3r4m
xt3r4m / MySQL_Sheet.sh
Created August 21, 2021 09:22 — forked from muhammad-owais-javed/MySQL_Sheet.sh
Useful MySQL queries and configurations
#MYSQL
#For login to mysql
mysql -h hostname -u dbusername -p dbname
#For taking dump of mysql
mysqldump -h hostname -u dbusername -p dbname > dbbackup.sql
#For taking dump without tablespaces
mysqldump -h hostname -u dbusername -p dbname --no-tablespaces > dbback.sql
#Magento Sheet:
#For search and replace in database file of magento
sed -i -e s'#DEFINER=`magento`@`%`#DEFINER=`cwdb`@`%`#'g file.sql
#Difference between Magento 1 and 2
env.php Magento 2
local.xml for Magento 1
"Magento 2.x"
#Wordpress Sheet
#For verifying Core wordpress files
wp core verify-checksums
#For restricting auto update of wordpress
define( 'WP_AUTO_UPDATE_CORE', false );
#For increasing memory limit
define('WP_MEMORY_LIMIT', '256M');
@xt3r4m
xt3r4m / OS-GreymonSheet.sh
Created August 21, 2021 09:22 — forked from muhammad-owais-javed/OS-GreymonSheet.sh
Scripts, Commands, Configurations, Package Deployments and Apache .htaccess rules particularly as per Cloudways stack
#OS-GreymonSheet
#For switching to Master user
for user in $(cat /etc/passwd | grep master | awk -F : '{print $1}'); do su $user; done
#For Finding application with corresponging domain name
grep -lr "domain.com" */conf/*
#For checking apache logs of every application in Cloudways