Skip to content

Instantly share code, notes, and snippets.

Avatar
🐳
Petting containers with ❤️ 😆

Crazy Optimist CrazyOptimist

🐳
Petting containers with ❤️ 😆
View GitHub Profile
@CrazyOptimist
CrazyOptimist / nvm-install.sh
Created Nov 11, 2020
Install the latest version of nvm, node, npm
View nvm-install.sh
# Check the latest version of NVM
curl https://github.com/nvm-sh/nvm/releases/latest | cut -d \/ -f 8 | cut -d \" -f 1
# Run the install script
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | bash
# Paste in this scripts into your .bashrc or .bash_profile
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
# Install node and npm
nvm ls-remote
@CrazyOptimist
CrazyOptimist / app.js
Created Oct 25, 2020
Concept of Promise in Javascript
View app.js
const fs = require('fs');
(() => {
return new Promise(async (resolve, reject) => {
try {
let file = fs.readFileSync(`${__dirname}/app.js`)
resolve(file)
} catch (err) {
reject(`Oops! \n ${err}`)
}
@CrazyOptimist
CrazyOptimist / bionic-focal-web-setup.sh
Last active Oct 5, 2020
Initial Deployment Script for Bionic and Focal Distros
View bionic-focal-web-setup.sh
#!/bin/bash
# upgrades operating system
sudo apt-get update && sudo apt-get upgrade -y
# install docker latest
sudo apt remove docker docker-engine docker.io containerd runc # purging the legacy version if exists
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
@CrazyOptimist
CrazyOptimist / arch-with-kde.md
Last active Aug 31, 2020
Arch Linux /w KDE Installation Cheatsheet by CrazyOptimist
View arch-with-kde.md

Alright, here you go ...

#check if network is connected
ip link
ping google.com
#sync time
timedatectl set-ntp true
#check partition info
fdisk -l
View How-to-Win-Friends-and-Influence-People.md

How to Win Friends and Influence People

Fundamental Techniques in Handling People

  1. Don't criticize, condemn, or complain.
  2. Give honest and sincere appreciation.
  3. Arouse in the other person an eager want.
  4. Never show others that you are not interested in what they have to say.
@CrazyOptimist
CrazyOptimist / docker-compose.yml
Last active Sep 7, 2020
PostgreSQL deployment using docker-compose
View docker-compose.yml
version: "3"
services:
postgresql:
image: postgres:12-alpine
container_name: postgresql_db
restart: always
environment:
- POSTGRES_USER=superuser
@CrazyOptimist
CrazyOptimist / .bashrc
Last active Nov 10, 2020
Custom Shortcuts For Linux Terminal by CrazyOptimist
View .bashrc
alias ssh-to-someserver="ssh -i $HOME/path/to/secret.pem user@someserver-ip"
alias dps="docker ps"
alias dls="docker container ls $1"
alias dils="docker images $1"
alias drmi="docker rmi $1"
alias dcb="docker-compose build"
alias dcu="docker-compose up $1"
alias dcd="docker-compose down"
@CrazyOptimist
CrazyOptimist / image-clean.sh
Created Jun 29, 2020
Remove <none> tagged docker images
View image-clean.sh
if [ -z "$(docker images | awk '/^<none>/ {print $3}')" ]; then
exit
else
docker rmi $(docker images | awk '/^<none>/ {print $3}')
fi
@CrazyOptimist
CrazyOptimist / docker-compose.yml
Last active Nov 21, 2020
MySQL 8 Instant Deployment Using Docker Compose
View docker-compose.yml
version: "3"
services:
mysql:
image: mysql:8
container_name: mysql_eight
ports:
- "3306:3306"
command:
[
"--default_authentication_plugin=mysql_native_password",
@CrazyOptimist
CrazyOptimist / docker-compose.yml
Created Jun 10, 2020
MongoDB Docker Deployment - Cool
View docker-compose.yml
version: "3.1"
services:
mongodb:
container_name: mongo
image: mongo
volumes:
- ./db_data/:/data/db/
ports:
- 27017:27017
restart: always
You can’t perform that action at this time.