Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Bash script



  Create temp file in Bash using mktemp and trap

When working on Linux Bash, sometimes there is need to create temporary file. A common way of creating temp file on Linux is creating some file in /tmp directory. However there is security risk when creating temp file in /tmp directory. This post will show how to securely create temp file in Linux Bash. When creating file in /tmp directory, there are some security risks. This directory can be accessed by any user on the system, any user can write data into this directory as well. The files creat...

   LINUX,MKTEMP,TRAP,TEMP FILE     2019-12-30 23:28:23

  Differences between bashrc and profile in Linux

After login to a Linux system, the command console will show up with a prompt label such as # or ~, a shell command can be typed after this prompt and the system can execute the command thereafter. All these operations are handled by shell. Shell is a command language interpreter that executes commands read from the standard input device (keyboard) or from a file. There are different types of shells such as bash, ksh, csh etc. The most commonly used of them is bash and it's also the de...

   LINUX,PROFILE,BASH,BASHRC,.BASHRC,.PROFILE     2016-11-05 22:17:51

  Start to work with rollup.js to pack JS files

rollup.js is a module bundler for JavaScript. It compiles small piece of JavaScript modules spreading in different files into a single larger standardized ES code file. This post will show some entry level usage for this library. Introduction Normally a bundler tool would compile a few small JavaScript files into a single JavaScript so that web browser can read, parse and render it properly. A bundler tool may be needed because of a few reasons: Some early stage browsers don't understand module...

   ROLLUP.JS,COMMONJS,ES MODULE,BUNDLE,WEBPACK     2022-06-12 00:00:14

  Shell script common interview questions

Shell script is frequently used when monitoring system status on Linux. It's not an easy task to write shell script but it's a very important skill for developers and system administrators to ease work and automate common tasks. This post will share some common interview questions about shell script. 1. Get random characters(8 characters) Method 1 # echo $RANDOM |md5sum |cut -c 1-8 471b94f2 Method 2 # openssl rand -base64 4 vg3BEg== Method 3 # cat /proc/sys/kernel/random/uuid |cut -c 1-8 ed...

   LINUX,INTERVIEW,SHELL SCRIPT     2018-09-28 10:46:00

  A guide on installing and setting up GitLab server on Ubuntu

GitHub, GitLab and BitBucket are the three most famous code hosting platform in the world. They have different features which allow teams or individuals to share code with others remotely. In case you want to build your own code hosting server so that you can host and share the code by yourself, you can install and set up your own server. In this post, we will walk you through a guide on installing and setting up GitLab server on Linux environment. gitlab is a web based code hosting tool which i...

   UBUNTU,TUTORIAL,GITLAB     2020-04-25 07:05:33

  A simple tutorial on Linux nohup command

In our daily work, there might be need to run some important program for hours or even days without being abruptly terminated. In such case, we may want to run the program with command nohup. nohup is the abbreviation of no hangup, i.e, don't hang up or terminate the process. This command will tell the process to ignore the system HUP signal. The HUP signal will be emitted when the terminal is exited or disconnected. Normally process will abort its execution when receiving this signal.  Bas...

   NOHUP,LINUX     2020-08-08 01:14:50

  Bash Shell Scripting - 10 Seconds Guide

This Bash shell scripting guide is not a detailed study but a quick reference to the BASH syntax. So lets begin... Common environment variables PATH - Sets the search path for any executable command. Similar to the PATH variable in MSDOS. HOME - Home directory of the user. MAIL - Contains the path to the location where mail addressed to the user is stored. IFS - Contains a string of characters which are used as word seperators in the command line. The string normally consists of the spac...

   Bash,Shell,Linux,Tutorial,10 seconds,Shortcut key     2012-02-28 08:05:41

  Useful Bash Scripts

Many people hack together shell scripts quickly to do simple tasks, but these soon take on a life of their own. Unfortunately shell scripts are full of subtle effects which result in scripts failing in unusual ways. It's possible to write scripts which minimise these problems. In this article, I explain several techniques for writing robust bash scripts. Use set -u ...

   Linux,Shell,Bash,Command,Robust     2012-01-15 10:28:00

  Writing robust shellling scripts

Many people hack together shell scripts quickly to do simple tasks, but these soon take on a life of their own. Unfortunately shell scripts are full of subtle effects which result in scripts failing in unusual ways. It's possible to write scripts which minimise these problems. In this article, I explain several techniques for writing robust bash scripts. Use set -u ...

   Robust,Shell script,Set,Commands     2012-03-19 13:25:26

  Fix issue docker-credential-desktop not installed or not available in PATH on Mac

Sometimes you may encounter below issue while running docker-compose on MacOS. Traceback (most recent call last): File "docker-compose", line 6, in <module> File "compose/cli/main.py", line 71, in main File "compose/cli/main.py", line 127, in perform_command File "compose/cli/main.py", line 1085, in up File "compose/cli/main.py", line 1081, in up File "compose/project.py", line 527, in up File "compose/service.py", line 354, in ensure_image_exists File "compose/service.py",...

   MACOS,DOCKER,DOCKER-COMPOSE     2020-06-23 03:25:16