Skip to content

Instantly share code, notes, and snippets.

View ravikyada's full-sized avatar
🎯
Focusing

Ravi Kyada ravikyada

🎯
Focusing
View GitHub Profile
@ravikyada
ravikyada / sshpass.md
Created September 12, 2024 13:15
SSH Login Without Prompting for Password Using `sshpass`

SSH Without Prompting for Password

Configure SSH to avoid prompting for a password each time.

Problem Statement

Currently, after setting up SSH with a PEM file, you can access a server without a password like so:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"route53:ChangeResourceRecordSets",
"route53:ListResourceRecordSets"
],
"Resource": [
@ravikyada
ravikyada / Readme.md
Created July 30, 2024 09:50
Bash Script to Create S3 Bucket with Public Website Hosting

S3 Bucket Setup Script

This script automates the process of setting up an S3 bucket in AWS. It performs the following tasks:

  1. Checks if the specified S3 bucket already exists.
  2. Creates the bucket if it does not exist.
  3. Removes Block Public Access settings from the bucket.
  4. Attaches a specified bucket policy to allow public read access.
  5. Configures CORS settings for the bucket.
  6. Enables static website hosting on the bucket.

Common Most Useful Terminal Commands

User Information

Show the current logged-in user.

whoami

Show the User details.

@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