Skip to content

Instantly share code, notes, and snippets.

@mangalbhaskar
mangalbhaskar / skplt.serversetup.md
Last active August 24, 2023 16:45
skplt.serversetup: Ubuntu Server GPU or non GPU server setup guide using lscripts-docker bash shell script framework

skplt.serversetup

Ubuntu Server GPU or non GPU server setup guide using lscripts-docker bash shell script framework

  1. If there is an error of for /cdrom on sudo apt update, then comment the CDROM line in the file: /etc/apt/sources.list
    cat /etc/apt/sources.list
    sudo vi /etc/apt/sources.list
  2. Install ubuntu-desktop

How To Change The Default Docker Engine Ip

  1. Inspect system IP and docker network. Use sudo if you are getting permission denied error, ex: sudo docker network list
    ip a
    docker network list
    # docker network inspect etc_default | grep Subnet
    docker network inspect bridge
  2. Create file /etc/docker/daemon.json if it does not already exits
@mangalbhaskar
mangalbhaskar / asciidoc-static.adoc
Created May 10, 2021 13:06 — forked from briandominick/asciidoc-static.adoc
Static Site Generators with AsciiDoc Support

There are 24 static site generators that support AsciiDoc sourcing.

@mangalbhaskar
mangalbhaskar / sudo_restrict_user_cmd.sh
Last active September 16, 2020 21:58
create a new system level user without login, create the new group, adds current logged-in user and new system nologin user to the common group; and give restrictive sudo access to a particular script
#!/bin/bash
## Copyright (c) 2020 mangalbhaskar. All Rights Reserved.
##__author__ = 'mangalbhaskar'
###----------------------------------------------------------
## create a new system level user without login, create the new group,
## adds current logged-in user and new system nologin user to the common group;
## and give restrictive sudo access to a particular script and systemd service
###----------------------------------------------------------
@mangalbhaskar
mangalbhaskar / test-1-case-1-yes_or_no_loop.sh
Last active September 16, 2020 21:40
bash yes or no loop for user prompt
#!/bin/bash
## Copyright (c) 2020 mangalbhaskar. All Rights Reserved.
##__author__ = 'mangalbhaskar'
###----------------------------------------------------------
function test-1-case-1-yes_or_no_loop() {
local LSCRIPTS=$( cd "$( dirname "${BASH_SOURCE[0]}")" && pwd )
source ${LSCRIPTS}/yes_or_no_loop.sh
@mangalbhaskar
mangalbhaskar / argparse.sh
Created August 9, 2020 20:26
key value parser for shell script for bash shell
#!/bin/bash
## Copyright (c) 2020 mangalbhaskar. All Rights Reserved.
##__author__ = 'mangalbhaskar'
##----------------------------------------------------------
## key value parser for shell script for bash shell
## Reference and Credits:
## http://tldp.org/LDP/abs/html/parameter-substitution.html
## https://stackoverflow.com/questions/14370133/is-there-a-way-to-create-key-value-pairs-in-bash-script#14371026
storage:
dbPath: "/data/db"
journal:
enabled: true
systemLog:
destination: file
path: "/var/log/mongodb.log"
logAppend: true
timeStampFormat: iso8601-utc
processManagement: