Skip to content

Instantly share code, notes, and snippets.

View crazyoptimist's full-sized avatar
🐌
crawling

crazyoptimist crazyoptimist

🐌
crawling
View GitHub Profile
@crazyoptimist
crazyoptimist / jenkins-docker-compose
Created June 2, 2020 23:45
Jenkins docker-compose deployment real quick
git clone https://github.com/CrazyOptimist/jenkins.git your_dir_name
cd your_dir_name
cp .env.example .env
docker-compose up -d
@crazyoptimist
crazyoptimist / live-stream-server.js
Last active March 3, 2023 22:25
Live Stream Server Deployment
const NodeMediaServer = require('node-media-server');
const config = {
rtmp: {
port: 1935,
chunk_size: 10000,
gop_cache: true,
ping: 30,
ping_timeout: 60
},
@crazyoptimist
crazyoptimist / compose.yaml
Last active April 9, 2024 23:20
MongoDB Docker Deployment
name: mongodb
services:
mongodb:
container_name: mongo
image: mongo:7
volumes:
- mongodb_data:/data/db/
ports:
- 27017:27017
@crazyoptimist
crazyoptimist / compose.yaml
Last active April 10, 2024 00:42
MySQL 8 with Docker Compose
name: mysql
services:
mysql:
image: mysql:8
container_name: mysql
ports:
- "3306:3306"
command:
[
@crazyoptimist
crazyoptimist / image-clean.sh
Last active November 26, 2020 22:03
Remove <none> tagged docker images
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
@crazyoptimist
crazyoptimist / compose.yaml
Last active May 6, 2024 15:54
PostgreSQL deployment using docker-compose
name: postgres
services:
postgresql:
image: postgres:16
container_name: postgresql
environment:
- POSTGRES_USER=superuser
- POSTGRES_PASSWORD=youmayneverguess
@crazyoptimist
crazyoptimist / How-to-Win-Friends-and-Influence-People.md
Created July 26, 2020 08:33 — forked from justincampbell/How-to-Win-Friends-and-Influence-People.md
Principles of How to Win Friends and Influence People

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 / arch-with-kde.md
Last active April 10, 2024 00:58
Arch Linux w/ KDE Installation Note by crazy0ptimist

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
@crazyoptimist
crazyoptimist / install-docker.sh
Last active April 30, 2024 20:33
Install the latest version of docker engine on Ubuntu machines
#!/bin/bash
# Uninstall all conflicting packages:
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg --purge -y; done
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl -y
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
@crazyoptimist
crazyoptimist / app.js
Created October 25, 2020 19:20
Concept of Promise in Javascript
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}`)
}