Skip to content

Instantly share code, notes, and snippets.

View v0lkan's full-sized avatar
🎸
totally rocking it 🚀.

Volkan Özçelik v0lkan

🎸
totally rocking it 🚀.
View GitHub Profile
@v0lkan
v0lkan / kubedump.sh
Created October 24, 2022 01:38
Dump everything in your Kubernetes cluster into folders a YAML files
#!/usr/bin/env bash
# Dumps everything in your Kubernetes cluster into folders a YAML files.
# Use it at your own risk.
set -e
CONTEXT=“$1”
if [[ -z ${CONTEXT} ]]; then
@v0lkan
v0lkan / nginx-ssl.md
Created October 1, 2022 01:48
Add Self-Signed Certificate to Enable SSL on NGINX
@v0lkan
v0lkan / replace.md
Created September 25, 2022 17:41
Use `replace` in `go.mod` for local development.

If you don’t want to push your dependencies and tag them all the time and just want to use whatever the local version of code you have to speed up local development and also not break anyone’s code by merging unstable stuff to main, then you can use replace in your go.mod.

The replace line goes above your require statements, as follows:

module github.com/zerotohero-dev/sample-go-app
@v0lkan
v0lkan / LS_COLORS.md
Last active October 17, 2022 13:40
How do I change that ugly dark blue color in my linux terminal?

Those colors are defined in LS_COLORS.

In the terminal

echo $LS_COLORS

Save it to a text file, and edit to your heart’s desire.

@v0lkan
v0lkan / install-go.sh
Created September 11, 2022 22:49
Install Go on Linux
# ref: https://go.dev/learn/
curl https://go.dev/dl/go1.19.1.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.1.linux-amd64.tar.gz
@v0lkan
v0lkan / install-docker.sh
Created September 11, 2022 07:43
The Fastest Way to Install docker on Ubuntu
#!/usr/bin/env bash
curl -fsSL https://get.docker.com -o get-docker.sh
# ^ Read and verify the above script before executing the command below:
sudo sh get-docker.sh
# ref: https://docs.docker.com/engine/install/ubuntu/
@v0lkan
v0lkan / install-node.sh
Created September 6, 2022 00:55
Install Node and NPM on Amazon EC2 Linux
# Replace 16 with the version you want to install:
curl -sL https://rpm.nodesource.com/setup_16.x | sudo bash -
# You might need these too:
sudo yum install gcc-c++ make
# Then install node:
sudo yum install nodejs
# Verify node:
@v0lkan
v0lkan / arch-os.sh
Created September 5, 2022 21:25
Get the Architecture and OS of your Linux Distro
export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)
export OS=$(uname | awk '{print tolower($0)}')
@v0lkan
v0lkan / fix-perm.sh
Created September 5, 2022 06:21
Resolving EACCESS permissions errors when installing packages globally
# ref: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
# Update ~/.profile with this:
export PATH=~/.npm-global/bin:$PATH
# Then source it to use the new $PATH:
source ~/.profile
@v0lkan
v0lkan / install-mongodb.md
Last active September 11, 2022 23:48
Install MongoDB Community Edition on Amazon EC2 Linux

First, getthe name of the distribution:

grep ^NAME  /etc/*release

It will say something like “Amazon Linux” or “Amazon Linux AMI”.

sudo vim /etc/yum.repos.d/mongodb-org-4.2.repo