echo date in bash
$(date '+%d/%m/%Y %H:%M:%S')
Here is what the above code is Doing:
1. It’s creating a variable called “now” and assigning it the value of the current date and time.
2. It’s printing the value of the “now” variable.
$(date '+%d/%m/%Y %H:%M:%S')
Here is what the above code is Doing:
1. It’s creating a variable called “now” and assigning it the value of the current date and time.
2. It’s printing the value of the “now” variable.
sudo gitlab-ctl reconfigure sudo gitlab-rake gitlab:check sudo gitlab-ctl status Here is what the above code is Doing: 1. Install the necessary dependencies 2. Install and configure the necessary PostgreSQL packages 3. Add the GitLab package server and install the package 4. Configure and start GitLab 5. Check the status of GitLab
brew install bindfs And then bind one folder to another: bindfs /Volumes/Data/ContentA ~/ContentA Here is what the above code is Doing: 1. It’s creating a new folder called ContentA in your home directory. 2. It’s mounting the folder /Volumes/Data/ContentA to ~/ContentA. 3. It’s making ~/ContentA read-only. 4. It’s making ~/ContentA owned by you. 5. It’s…
$uriSlack = “https://hooks.slack.com/services/{guids}” $body = ConvertTo-Json @{ pretext = “Hello world” text = “This is the text below with a blue thingy next to it” color = “#142954” } try { Invoke-RestMethod -uri $uriSlack -Method Post -body $body -ContentType ‘application/json’ | Out-Null } catch { Write-Error (Get-Date) “: Update to Slack went wrong…” } Here…
echo -e “hello\nworld” Here is what the above code is Doing: 1. The first line is a shebang. It tells the computer that this file is a bash script. 2. The second line is a comment. It’s ignored by the computer. 3. The third line is a command. It prints the string “hello” to the…
version: “3.8” services: mongodb: image : mongo container_name: mongodb environment: – PUID=1000 – PGID=1000 volumes: – /home/barry/mongodb/database:/data/db ports: – 27017:27017 restart: unless-stopped Here is what the above code is Doing: 1. We are using the version 3.8 of the docker-compose file. 2. We are creating a service called mongodb. 3. We are using the mongo…
$ pip list –outdated Here is what the above code is Doing: 1. pip list –outdated: This command lists all the packages that are outdated. 2. awk ‘{print $1}’: This command prints the first column of the output. 3. xargs -n1 pip install -U: This command takes the output of the previous command and installs…