Linux & Terraform & AIX Server Administrator Cheat Sheet

Most of these commands will also work on Linux , networking or terraform as specified below

CommandWhat is does?
route add -net 10.98.208.40 netmask 255.255.255.255 gw 172.31.191.254Add a static root – substitute for your IP information
route del -net 10.98.208.40 netmask 255.255.255.255 gw 172.31.191.254Remove static route
ifconfig eth1 192.168.1.2 netmask 255.255.240.0 gw 192.168.1.1Configure Ethernet
/etc/sysconfig/network-scriptsLocation for Networking boot configuration
ifup eth1 boot
enable NIC at boot
ifdown eth1 bootdisabled NIC at boot
ip -s linkenable overview of traffic
dhclient eth01
dhclient ens33
get new IP from DHCP
/etc/sysconfig/networkbasic Network config
cat /etc/resolv.confDNS server details
cat /etc/hostsLocal host file
cat /etc/servicesPorts used for Firewall
iptable -FFlush IPtables
iptables -I INPUT -p tcp –dport 48000 -j ACCEPTOpen port 48000 on firewall
CommandWhat it does
find / -xdev | xargs ls -ld | sort -rnk 5 | moreSearch AIX Filesystem for files
egrep –p “ Search string “ –f filename.loguseful for grep very large dsmsched.logs
q vol devclass=lto_tapeQueries Tape Library and Lists Scratch tapes
q reqlists requests to reply to
lscfg –vl fcs3Get details of a fibre card fcs3
nohup /opt/Tivoli/tsm/client/ba/bin/rc.tsmclient >/dev/null 2>&1Starts TSM Process
dd if=/dev/cdrom of=line500v7.1WindowsServer.iso bs=1024Command how to copy ISO on AIX
ls |sort |awk ‘{name=toupper($1);if(name==pre1) printf(“** %s  %s\n”,$1,pre2); pre1=name;pre2=$1}’AIX command used to find the duplicate files
find /var -xdev | xargs ls -ld | sort -rnk 5 | moreFinding large files in AIX (EG /VAR)
startsrc -s qdaemonrestart error daemon

Terraform Cheatsheet

CommandWhat it does?
terraform -install-autocompleteEnables tab completion
-helpShows the help files
applyapply the changes
consolecreates and interactive console
destroydestroys the Terraform-managed infrastructure
fmtused to rewrite Terraform configuration files
force-unlockused to remove lock on the state for the current configuration
getused to download and update modules
graphused to generate a a graph
importused to import existing resources
Type or VariableWhat it does
“var” prefixUser String Variable
Interpolate
“var.MAP[“KEY”]User Map Variable
Value of Key
“${var.LIST}”Value of the list as a list
List elements by Index
“self.ATTRIBUTE”Own Resource
“TYPE.NAME.ATTRIBUTE”Other Resource
“data.TYPE.NAME.ATTRIBUTE”Data Source
MODULE.NAME.OUTPUT”Module outputs
“Count.FIELD”Count
“path.TYPE”Path
“terraform.FIELD”Terraform Meta

You May Also Like

About the Author: VirtuallyThatGuy

Leave a Reply

Your email address will not be published. Required fields are marked *