Skip to content

Instantly share code, notes, and snippets.

# Getopts - parsing arguments
while getopts "hs:c:" opt; do
case $opt in
c)
echo "Argument $opt at position $OPTIND equals $OPTARG"
;;
s)
echo "Argument $opt at position $OPTIND equals $OPTARG"
;;
h)
Level Disks Hot spare Available space Fault tolerance Read Write
RAID 0 from 2 - disk size * dIsk count - high high
RAID 1 2 + disk size 1 disk medium medium
RAID 1E 2 - disk size 1 disk high medium
RAID 5 from 3 + disk size*(disk count-1) 1 disk high low
RAID 5EE from 4 - disk size*(disk count-2) 1 disk high low
RAID 6 from 4 + disk size*(disk count-2) 2 disk medium low
RAID 10 (1+0) from 4, even + disk size*(disk count/2) 1 disk in every RAID 1 medium medium
RAID 50 (5+0) from 6, even + disk size*(disk count-2) 1 disk in every RAID 5 high low
Type Tools
RDBMS MySQL, Oracle Database, IBM DB2, PostgreSQL, Firebird
NoSQL MongoDB, CouchDB, CouchBase, Cassandra, HBase, Redis, Riak, Neo4J
Load Balancing Nginx, HAProxy
Web Servers Nginx, Apache HTTP Server, Lighttpd, Apache Tomcat
Cluster Infrastructure Keepalived, Heartbeat, Corosync, Pacemaker, IPVS
Version control GitHub, BitBucket, GitLab
CI/CD Jenkins, Bamboo, GitLab CI, TeamCity
Build Tools Gradle, CMake

Special bash variables

Character Definition
$* Expands to the positional parameters, starting from one. When the expansion occurs within double quotes, it expands to a single word with the value of each parameter separated by the first character of the IFS special variable.
$@ Expands to the positional parameters, starting from one. When the expansion occurs within double quotes, each parameter expands to a separate word.
$# Expands to the number of positional parameters in decimal.
$? Expands to the exit status of the most recently executed foreground pipeline.
$- A hyphen expands to the current option flags as specified upon invocation, by the set built-in command, or those set by the shell itself (such as the -i).
$$ Expands to the process ID of the shell.
@sorquan
sorquan / some_ansible.yml
Last active March 9, 2021 19:09
Some ansible playbooks
---
- name: Install Web
hosts: hostgroup
become: true
vars:
- repo:
Debian:
- apt
RedHat:
- epel-release
@sorquan
sorquan / aix_general.md
Last active March 1, 2021 10:53
Some general commands for AIX

Show top 10 largest directories

du -sg | sort -r | tail -n10

@sorquan
sorquan / veritas_cluster_server.md
Last active March 22, 2021 14:17
Veritas Cluster Server Cheatsheet

Veritas Cluster Server Cheatsheet

LLT & GAB

VCS uses two components, LLT and GAB, to share data over the private networks among systems. These components provide the performance and reliability required by VCS.

Name Description
LLT LLT (Low Latency Transport) provides fast, kernel-to-kernel comms and monitors network connections. The system admin configures the LLT by creating a configuration file (llttab) that describes the systems in the cluster and private network links among them. The LLT runs in layer 2 of the network stack.
GAB GAB (Group membership and Atomic Broadcast) provides the global message order required to maintain a synchronised state among the systems, and monitors disk comms such as that required by the VCS heartbeat utility. The system admin configures GAB driver by creating a configuration file ( gabtab).
@sorquan
sorquan / linux_general.md
Last active September 16, 2021 21:34
Some general commands for GNU/Linux

Format output with delimiter

ls /var/ | xargs | sed 's/ /,/g'

Add text to end of file if it not exists in the file

sed -e '/option=/{s/.*/option=value/;:a;n;:ba;q}' -e 'aoption=value' /dir/filename

Count inodes

@sorquan
sorquan / veritas_netbackup.md
Last active May 9, 2024 17:00
Veritas NetBackup Cheatsheet

Veritas NetBackup Cheatsheet

Master Server Daemons/Processes

Description Name
Request daemon bprd
Scheduler bpsched (started with bprd)
Netbackup database manager bpdbm (started with bpsched)
Job Monitor bpjobd (started with bpdbm)
@sorquan
sorquan / veritas_volume_manager.md
Last active March 22, 2021 13:41
Veritas Volume Manager Cheatsheet

Veritas Volume Manager

VM daemons

Name Description
vxconfigd

It can be in three states:
Enable = Normal mode
Disable = Most operations cannot be be used
Booted = Normal startup while using boot disk group
Maintains system configuration in the kernel & disk (private region).If the daemon is stopped it does not disable any configuration state loaded into the kernel, it only affects the ability to make configuration changes until vxconfigd is restarted.
vxrelocd Monitors for failure events and relocates failed subdisks
vxconfigbackupd Used to backup configuration chnages, the files created can be used with vxmake to restored lost groups.