$$
is the process ID (PID) of the script itself.$!
gives the process id of the most recently executed background process.$?
Stores the exit value of the last command that was executed.$#
is the special parameter in which bash gives the number of positional parameter in decimal.$@
Stores all the arguments that were entered on the command line, individually quoted ("$1" "$2" ...).$*
Stores all the arguments that were entered on the command line ($1 $2 ...).$_
The underscore variable is set at shell startup and contains the absolute file name of the shell or script being executed as passed in the argument list.- https://javarevisited.blogspot.com/2011/06/special-bash-parameters-in-script-linux.html
- https://devhints.io/bash
- https://www.tecmint.com/useful-tips-for-writing-bash-scripts-in-linux/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Consensus Algoriithm must have - | |
- Agreement -> Where every correct process must agree on the same value. | |
- Validity -> The value agreed on must have been proposed by another process. | |
- Termination -> A value will eventually be decided by every correct process. | |
- CAP Theorem -> An algorithm cannot provide more than of the three following properties - | |
- Consistency | |
- Availability | |
- Partition Tolerance | |
- There are different types of failure that a consensus algorithm might have to deal with fail. | |
- Fail-stop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Crowdfunding contract implemented using the [[Plutus]] interface. | |
-- This is the fully parallel version that collects all contributions | |
-- in a single transaction. | |
-- | |
-- Note [Transactions in the crowdfunding campaign] explains the structure of | |
-- this contract on the blockchain. | |
import qualified Language.PlutusTx as PlutusTx | |
import Language.PlutusTx.Prelude |
➜ ~ sudo fdisk /dev/sda
Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sda: 24.42 GiB, 26214400000 bytes, 51200000 sectors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Send prefix | |
set-option -g prefix C-a | |
unbind-key C-a | |
bind-key C-a send-prefix | |
# Use Alt-arrow keys to switch panes | |
bind -n M-Left select-pane -L | |
bind -n M-Right select-pane -R | |
bind -n M-Up select-pane -U | |
bind -n M-Down select-pane -D |
- Beginning of a line
ctrl + a
- End of a line
ctrl + e
- Delete entire line(zsh) or delete(shell) words where the cursor places
ctrl + u
- Delete word before the cursor
ctrl + w
- Delete word after the cursor
alt + d
- Paste line/word
ctrl + y
- Swap 2 chars of a word
ctrl + t
and move at the end. - Swap 2 words
esc + t
- Capitalize a word
alt + u
. Decapitalize a word(shell)alt + l
, in zsh it binds withls
- Execute last command
!!
- In legacy GRUB the default is
/boot/grub/menu.list
- In GRUB2 the default is
/boot/grub/grub.cfg
- We mainly edit
/etc/default/grub
, which controls mainly the appearance of the GRUB menu. - We may also edit the scripts in
/etc/grub.d/
- These are the scripts that boot your operating systems, control external applications such as
memtest
&os_prober
theming./boot/grub/grub.cfg
is built from/etc/default/grub
&/etc/grub.d/*
update-grub
grub>
prompt, that is the full GRUB 2 command shell.- GRUB2 started normally and loaded the
normal.mod
module other modules which are located in/boot/grub/[arch]/
- If GRUB2 didn’t find
grub.cfg
file then,grub rescue>
is prompted that means it couldn’t findnormal.mod
, so it probably couldn’t find any of the boot files.
- Users are on the system are listed in an alphabetical order -
cut /etc/passwrd -d":" -f1 | sort
- User has shell access -
cat /etc/passwd | cut -d":" -f4,5,6,7 | grep "^0"
or count -cat /etc/passwd | cut -d":" -f4 | grep "^0" | wc -l
- Export the Users' list to a file -
cut /etc/passwd -d ":" -f1 > system_users.txt
- Count the number of Users -
cat ./system_users.txt | sort | wc –l
- Compare -
cat ./system_users.txt - cut /etc/passwd -d ":"
-f1 > system_users002.txt
&&
cat system_users002.txt | sort | wc -l
- Diff -
diff ./system_users.txt ./system_users002.txt
- how many words begin with the letter a from the main user dictionary -
egrep '^a.*$' /usr/share/dict/words | wc -l
- tee to both view and write files and directories in /etc -
ls -d /etc/a* | tee ./etc_report_a.txt
- Kernel Info -
lsb_release -a
oruname -a
orhostnamectl
orcat /proc/os-release
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWS Fargate allows you to run containers without worrying about provisioning or managing the underlying infrastructure, like Amazon EC2 instances. | |
It is a fully managed service, and is therefore inherently highly available and highly scalable. | |
When using AWS Fargate, you use container orchestration tools to define what containers you want to run, like Amazon Elastic Container Service or Amazon Elastic Kubernetes Service. | |
Once your containers are defined, you can launch them onto an AWS Fargate cluster. | |
There is no need to bring up the cluster on your own, AWS Fargate will handle the provisioning and management of the resources needed to run those containers. | |
AWS Fargate is the serverless compute launch type you can use with Amazon Elastic Container Service or Amazon Elastic Kubernetes Service. |