Skip to content

Instantly share code, notes, and snippets.

View hivivo's full-sized avatar
🏠
Working from Mars

Vivo hivivo

🏠
Working from Mars
View GitHub Profile
@hivivo
hivivo / useful.ps1
Last active February 25, 2023 23:53
Useful Windows Terminal commands
# batch renaming files
# e.g. ??.mp4 -> Prefix-??-Suffix.mp4
dir ??.mp4 | Rename-Item -NewName { "Prefix-$($_.BaseName)-Suffix.mp4" }
@hivivo
hivivo / n8n.yml
Created November 11, 2022 07:29
CapRover OneClick App - n8n (using remote DB)
captainVersion: 4
services:
$$cap_appname:
caproverExtra:
containerHttpPort: 5678
image: n8nio/n8n:$$cap_N8N_VERSION
environment:
DB_TYPE: mysqldb
DB_MYSQLDB_HOST: $$cap_MYSQL_HOST
DB_MYSQLDB_PORT: $$cap_MYSQL_PORT
@hivivo
hivivo / joplin.yml
Last active December 5, 2021 21:45
CapRover OneClick App - Joplin Server (using remote DB)
captainVersion: 4
services:
$$cap_appname:
image: joplin/server:$$cap_joplin_tag
restart: unless-stopped
environment:
APP_BASE_URL: http://$$cap_appname.$$cap_root_domain
DB_CLIENT: pg
POSTGRES_PASSWORD: $$cap_postgres_password
@hivivo
hivivo / monica.yml
Created November 29, 2021 00:48
CapRover OneClick App - Monica (using remote DB)
captainVersion: 4
services:
# Monica
$$cap_appname:
image: monica:$$cap_monica_version
restart: 'always'
environment:
APP_KEY: $$cap_gen_random_hex(32)
DB_HOST: $$cap_mariadb-host
DB_DATABASE: $$cap_mariadb-db
@hivivo
hivivo / wiki-js.yml
Last active April 18, 2021 23:20
CapRover OneClick App - Wiki.js (using remote DB)
captainVersion: 4
services:
$$cap_appname:
environment:
DB_TYPE: $$cap_DB_TYPE
DB_HOST: $$cap_DB_HOST
DB_PORT: $$cap_DB_PORT
DB_USER: $$cap_DB_USER
DB_PASS: $$cap_DB_PASS
DB_NAME: $$cap_DB_NAME
@hivivo
hivivo / install-caprover.sh
Last active June 26, 2024 20:33
Install CapRover on a brand new Ubuntu 22.04 standard server
#!/bin/bash
# Ubuntu 22.04
# Please also allow `80, 443, 3000` ports in the VM network rules if apply
# run as sudo
if [ "$EUID" -ne 0 ]
then echo "Please run as root or use sudo"
exit
fi
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDjY9ZTIulPB2A+xly3M+UJirPRykydqvnN/e8jrYrmMkALNmohGYsIn82KofVFImqAGi3592uHfUf1lfAbbHOvoB5/BdPE7SbtdyyWGekErHtxkrJ9qb3RdLA4vv4hkM9fSW8oNHOWG+SHmmICsCJ++vmtNbEP0Tg/ZZWFY0Ir9Z+zxrQX13iY11zRkLiQkheJ7NXRbAZXpK3EOAFpTqU78mZ5QadBRs2Ao/As/iwT/QC9opJ6l/gX+Zpqs/cS7LZ57aG6RA8jllzPaJpls7LV0X+o5SxlmP1vn69B5b7xoHlBh+dtEmNC4k5gaF9I5YMEZr8yCYTxEKOEkEW6RvOV vivokey
@hivivo
hivivo / start.md
Last active March 14, 2019 22:53
For new Macs. Personal use only.

To enable Terminal colors

Add the following lines into ~/.bash_profile file

export CLICOLOR=1
export TERM="xterm-color"
export PS1='\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;34m\]\w\[\e[0m\]\$ '

alias ll='ls -l'
@hivivo
hivivo / git.sh
Last active November 29, 2018 18:41
Git operations
# to change the latest commit date
git commit --amend --date "`date -R`"
# to change the latest commit date and author date
GIT_COMMITTER_DATE="`date-R`" git ci --amend --date "`date -R`"
# or
LC_ALL=C GIT_COMMITTER_DATE="$(date)" git commit --amend --no-edit --date "$(date)"
# create patch for specific commit
@hivivo
hivivo / bash.sh
Last active January 1, 2020 06:20
linux devices and sync
# to detach a busy device immediately
umount -l /PATH/OF/BUSY-DEVICE
umount -f /PATH/OF/BUSY-NFS(NETWORK-FILE-SYSTEM)
# locate/identify the busy the process
lsof | grep '/dev/sda1'
pkill target_process
umount /dev/sda1
# kill any processes accessing file