Skip to content

Instantly share code, notes, and snippets.

View ravikyada's full-sized avatar
🎯
Focusing

Ravi Kyada ravikyada

🎯
Focusing
View GitHub Profile

Common Most Useful Terminal Commands

User Information

Show the current logged-in user.

whoami

Date and Time

@ravikyada
ravikyada / openvpn-debian.md
Created July 18, 2024 05:24
OpenVPN Configs in Ubuntu Debian

OpenVPN3 Commands

Importing Configuration

Import a configuration file and create a persistent profile.

openvpn3 config-import --config client.ovpn --name <profile_name> --persistent

Listing Configurations

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "*",
"Resource": [
"arn:aws:s3:::bucketname",
@ravikyada
ravikyada / swapper.sh
Created May 9, 2024 08:16
Create Swap File Inside Debian Server
#! /usr/bin/bash
read -p "Give size of swap you wants to create:" usr_input
echo "Your swap memory will be create of size : $usr_input"
sudo fallocate -l $usr_input /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
@ravikyada
ravikyada / s3-cors-policy.json
Created April 12, 2024 12:25
CORS Policy for S3 Bucket
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"PUT",
"POST",
"GET"
],
@ravikyada
ravikyada / domain-name-nginx.conf
Created January 8, 2024 06:53
NGINX Conf to Reverse Proxy
server {
server_name domain.com;
location / {
proxy_pass http://localhost:1111;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
@ravikyada
ravikyada / multi-git.md
Last active December 22, 2023 06:16
Add Multiple Github Repo in Single Directory

check git remove by this command

git remote -v

Add second github remote

git remote add github https://github.com/organization/repo.git

check remote again

@ravikyada
ravikyada / NodePool.yaml
Created December 21, 2023 04:54
Here is the new Karpenter NoodPoool YAML fIle.
apiVersion: karpenter.sh/v1beta1
kind: NodePool
metadata:
name: default
spec:
template:
metadata:
labels:
lifecycle: on-demand
spec:
@ravikyada
ravikyada / alias_automations.md
Last active January 9, 2024 05:06
Useful alias and tiny Automations for DevOps

Aliases to Automate and Fast the Daily CLI Life

alias kgp='kubectl get pods'
alias kgd='kubectl get depoyments'
alias kaf='kubectl apply -f'

alias gst='git status'
alias gad='git add'
alias gl='git pull'
@ravikyada
ravikyada / k8s-shortcut-commands.md
Last active July 18, 2024 08:07
Sharing Important and Useful Kubernetes CLI Commands to save your time.

Scale All the deployments of the single namespace to Specific Number. Useful when wants to Scale diffrent environments.

kubectl scale deploy -n dev --replicas=3 --all

Edit HPA For the Whole Namespace with Single liner:

for deployment in $(kubectl get deployments -o jsonpath='{.items[*].metadata.name}' -n <namespace>); do
    kubectl autoscale deployment $deployment --min=<min-replicas> --max=<max-replicas> --cpu-percent=<cpu-percent>
done