This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: StatefulSet | |
metadata: | |
name: cassandra | |
spec: | |
serviceName: cassandra | |
replicas: 3 | |
selector: | |
matchLabels: | |
app: cassandra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import hashlib | |
class LoadBalancer: | |
def __init__(self, servers): | |
self.servers = servers | |
self.index = 0 | |
self.connections = {server: 0 for server in servers} | |
self.weights = {server: 1 for server in servers} # Default weight is 1 | |
self.server_response_times = {server: random.uniform(0.1, 1.0) for server in servers} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.23.0-bookworm AS build | |
ARG upx_version=4.2.4 | |
RUN apt-get update && apt-get install -y --no-install-recommends xz-utils && \ | |
curl -Ls https://github.com/upx/upx/releases/download/v${upx_version}/upx-${upx_version}-amd64_linux.tar.xz -o - | tar xvJf - -C /tmp && \ | |
cp /tmp/upx-${upx_version}-amd64_linux/upx /usr/local/bin/ && \ | |
chmod +x /usr/local/bin/upx && \ | |
apt-get remove -y xz-utils && \ | |
rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update outdated software packages: | |
apt update | |
Setting up Go on Ubuntu: | |
apt install golang-go -y | |
Test the Setup: | |
go version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pip install gitpython paramiko | |
import paramiko | |
from git import Repo | |
# Configuration | |
git_repo_url = 'https://github.com/yourusername/your-repo.git' | |
local_repo_dir = '/path/to/local/repo' | |
remote_server_ip = 'your.server.ip' | |
ssh_user = 'your_ssh_username' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Open Terminal. | |
List the current configured remote repository for your fork. | |
$ git remote -v | |
> origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch) | |
> origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push) | |
Specify a new remote upstream repository that will be synced with the fork. | |
$ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git | |
Verify the new upstream repository you've specified for your fork. | |
$ git remote -v | |
> origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ aws configure --profile project_name_1 | |
$ aws configure --profile project_name_2 | |
or can edit the : ~/.aws/credentials file directly | |
and when doing any service call, mention profile name at the end like this: | |
aws s3 ls --profile project_name_1 | |
If you are going to work on a particular project for long and will not make any switches, it's better to set the profile as default: | |
e.g. export AWS_DEFAULT_PROFILE=project_name_2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Try | |
CXXFLAGS="-mmacosx-version-min=10.9" LDFLAGS="-mmacosx-version-min=10.9" npm i | |
https://stackoverflow.com/questions/52545166/node-6-node-gyp-rebuild-for-hiredis-fails-on-macos | |
It works for me, Mac OS 10.14.1 (18B75), node version 6.11.3 (legacy project) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWS and DevOps related courses available for 🆓 FREE 🆓 on udemy. | |
--> https://docs.google.com/document/d/1BEdrhZrTd-iY61HJ_JS5Y3ExTWtytUnHFR9EYf1ODdU/edit?usp=sharing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum update -y | |
pip3 install awscli --upgrade --user | |
sudo ln -s /bin/touch /usr/bin/touch | |
yes | sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)" | |
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv) | |
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) | |
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile | |
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile | |
brew upgrade | |
brew update |
NewerOlder