Skip to content

Instantly share code, notes, and snippets.

Avatar
🐳
petting containers 😎

Crazy Optimist CrazyOptimist

🐳
petting containers 😎
View GitHub Profile
@CrazyOptimist
CrazyOptimist / vim-install-note.md
Created Apr 25, 2021
Install Vim From the Source on Fedora/CentOS
View vim-install-note.md

Installing Vim by building from the source needs bunch of dependancies.

Setup essential build environment

yum -y groupinstall "Development Tools"
yum -y install ncurses-devel git-core

Get the source

View docker-compose.yaml
version: "3.8"
services:
redis:
image: redis:6
container_name: redis
volumes:
- "./data/:/data/"
ports:
- "6379:6379"
restart: "no"
@CrazyOptimist
CrazyOptimist / docker-compose.yaml
Last active Mar 3, 2021
Redis Management Via Web GUI
View docker-compose.yaml
version: '3'
services:
redis-commander:
container_name: redis-commander
image: rediscommander/redis-commander:latest
restart: always
environment:
- REDIS_HOST=172.17.0.1
- REDIS_PORT=6379
- REDIS_DB=1 # any name you like to give your redis database
@CrazyOptimist
CrazyOptimist / nvm-install.sh
Last active Jan 22, 2021
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 / image-clean.sh
Last active Nov 26, 2020
Remove <none> tagged docker images
View image-clean.sh
if [ -z "$(docker images | awk '/^<none>/ {print $3}')" ]; then
echo "You don't have any <none> tagged images."
else
docker rmi $(docker images | awk '/^<none>/ {print $3}')
fi