Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- man nm-settings
- man nmcli-examples
- nmcli con show "connexion_name" | grep ipv4.dad-timeout
- nmcli con add type ethernet ifname ens32 ipv4.address 10.1.1.4/24 +ipv4.addresses 10.1.1.5/24 ipv4.gateway 10.1.1.1 ipv4.dns "1.1.1.1,2.2.2.2" ipv4.method {manual,dhcp} connection.autoconnect yes
- nmcli con add type ethernet ifname ens32 ip4 10.1.1.4/24 gw4 10.1.1.1
- nmcli connection add type ethernet ifname <interface-name> con-name <interface-name> ipv4.method manual ipv4.address <IP>/<prefix> ipv4.gateway <GW-address>
- export SYSTEMD_EDITOR=/usr/bin/vi; sytemctl edit --full NetworkManager-wait-online.service
- ###########
- systemd.debug-shell enforcing=0 rd.break [in tty9, don't need password]
- systemd.unit=emergency.target,
- restorecon /etc/shadow
- setenforce 1
- systemd.unit=rescue.target [ use of rd.break to interrupt the boot process before control is passed from initramfs to systemd]
- systemctl status $$
- ###########
- eval $(which tcpdump)
- ##########
- systemctl edit --full rhel-autorelabel.service << changes .autorelabel file to other name causes reboot loop
- ###########
- yum install setools-console policycoreutils-python
- seinfo -t
- seinfo -r
- semanage user -l
- semanage fcontext -l
- fixfiles -F restore (this is what is done when touching /.autorelabel and rebooting)
- grubby --info /boot/vmlinuz-3.10.0-229.4.2.el7.x86_64
- grubby --info=ALL
- #############
- echo "Hardening files..."
- find / -type f -perm /00700 -a -uid 0 -exec chmod u-wrx {} \; 2>/dev/null
- find / -type f -perm /00070 -a -gid 0 -exec chmod g-wrx {} \; 2>/dev/null
- echo "Hardening directories..."
- find / -type d -perm /00200 -a -uid 0 -exec chmod u-w {} \; 2>/dev/null
- find / -type d -perm /00020 -a -gid 0 -exec chmod g-w {} \; 2>/dev/null
- echo "Correcting a couple things..."
- find /sbin -type f -perm /00000 -a -uid 0 -exec chmod u+x {} \; 2>/dev/null
- find /usr/sbin -type f -perm /00000 -a -uid 0 -exec chmod u+x {} \; 2>/dev/null
- ###########
- getcap `which ping`
- find /usr/bin /usr/lib -perm /4000 -user root [find SUID]
- find /usr/bin /usr/lib -perm /2000 -user root [find SGID]
- setcap cap_net_bind_service=ep `which ncat` to be able to bind ports < 1024
- ###########
- echo -e '.com\nAcom' | grep -F .co
- echo -e 'a\n a\n a' | grep -E '^\s{1,11}a'
- expandtab tabstop=1 shiftwidth=1
- set et list tabstop=4
- set et ts=2 sw=2 nu ic
- imap jj <Esc>
- :se all
- :se
- ####################
- pssh -i -H "172.20.0.33 172.20.0.35" "tmsh save sys ucs \$HOSTNAME.20190819.ucs"
- f5s="172.20.0.33 172.20.0.34 172.20.0.35"
- for i in $f5s ; do ssh $i "echo \$HOSTNAME ; uptime" ; done
- #############
- echo 'export TESTPROFILE=1' >> /etc/profile
- echo 'export TESTBASHRC=1' >> /etc/bashrc
- env | grep TEST
- ssh 127.0.0.1 "env | grep TEST"
- ###
- X="Hi There"
- bash
- echo $X
- export X="Hi There"
- bash
- echo $X
- #############
- Local Var vs Global Var
- FOO=BAR
- env | grep FOO
- set | grep FOO
- FOO=BAR
- unset FOO
- export FOO=BAR
- env | grep FOO
- set | grep FOO
- printenv | grep FOO
- printenv: Lists out all global ENVs set.
- set: Lists out all the ENVs (global as well local)
- ###############
- time
- \time
- ###############
- for ((i=1;i<10;i++));do echo $i;done
- ###############
- echo 'dtdi ' >> bigip\ 4.conf
- ls bigip*conf | xargs grep dtdi ; ls bigip*conf | xargs -t -0 grep dtdi
- find ./ -iname bigip\*.conf -print0 | xargs -t -0 grep dtdi
- find /tmp -name core -type f -print0 | xargs -t -0 /bin/rm -f
- (find ./ -iname bigip\*.conf -print0 | xargs -n1 -0 -t grep dtdi)
- VS
- (find ./ -iname bigip\*.conf -print0 | xargs -0 -t grep dtdi)
- ###############
- for i in *; do egrep '^[a-zA-Z]+$' <<<"$i"; done
- sudo subscription-manager remove --all
- sudo subscription-manager unregister
- sudo subscription-manager clean
- sudo subscription-manager register
- sudo subscription-manager refresh
- sudo subscription-manager attach --auto
- Execute sudo subscription-manager repos --list-enabled to see all actually enabled subscriptions.
- Execute sudo subscription-manager repos --list to see all subscriptions that are available for you.
- Execute sudo subscription-manager repos --enable <repo> if you want to add additional repos.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement