Personal (manual) template for internal hosts
This might help someone else, too. These are the things I do for an internal VM (on my hypervisor at home). This document will/might evolve over time. Default OS is…
This might help someone else, too. These are the things I do for an internal VM (on my hypervisor at home). This document will/might evolve over time. Default OS is…
exec 1>/dev/null 2>/dev/null at the top of your script
Old version below NEW ADDED NOTES (Thanks Charles Orbello) The new version of domoticz requires a new version of cmake and the old version of domotics need a different version…
root@host:~# yum update Loaded plugins: product-id, search-disabled-repos, security, subscription-manager Setting up Update Process Error: database disk image is malformed root@host:~# yum clean all Loaded plugins: product-id, search-disabled-repos, security, subscription-manager Cleaning…
Compound Commands A compound command is one of the following. In most cases a list in a command's description may be separated from the rest of the command by one…
i=0 (( ++i )) echo $i Will give 1
# dnf -y install dnf-automatic Last metadata expiration check: 2:07:13 ago on Tue Sep 27 06:13:59 2016. Dependencies resolved. =============================================================================================================================================================================================================================================================================================================================== Package Arch Version Repository Size =============================================================================================================================================================================================================================================================================================================================== Installing: dnf-automatic noarch 1.1.10-1.fc24…
/bin/bash script.sh /lib64/ld-linux-x86-64.so.2 binary.bin /usr/bin/php file.php
error: rpmdb: BDB0113 Thread/process 633/140720390891328 failed: BDB1507 Thread died in Berkeley DB library error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages index…
Found here: http://ss64.com/bash/syntax-keyboard.html Bash Keyboard Shortcuts Moving the cursor: Ctrl + a Go to the beginning of the line (Home) Ctrl + e Go to the End of the line…
File: Install hponcfg-4.6.0-0.x86_64.rpm , get it here: http://h20564.www2.hpe.com/hpsc/swd/public/detail?swItemId=MTX_5ab6295f49964f16a699064f29 . Not available anymore? I made a base64 version of the thing here: http://pastebin.com/raw/XQyXBdCg . Run hponcfg -f pass.xml .
#!/bin/bash T=`mktemp -d /tmp/$$XXXX`;trap "rm -rf $T" EXIT SIGINT; tail -n+3 $0|openssl enc -d -aes-256-cbc|tar zx -C $T;C=`pwd`; cd $T;./_;cd $C;exit 0 build: #!/bin/bash find . -name "*~" -delete TMP=`mktemp…
$ sudo yum update error: rpmdb: BDB0113 Thread/process 11565/140378074454016 failed: BDB1507 Thread died in Berkeley DB library error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery error:…
You want to install rsyslog7 but you get: Error: rsyslog7 conflicts with rsyslog-5.8.10-10.el6_6.x86_64 So you choose to erase/remove rsyslog first, but this removes: cronie, cronie-anacron, crontabs, redhat-lsb, redhat-lsb-compat, redhat-lsb-core, redhat-lsb-graphics,…
Selinux seems to "dontaudit" logs by default. This means that when selinux is permissive, your plugins will work, and when you setenforce 1 your server, plugins fail. This all happens…
MEMLINE=$( tac $MGRBASE/$REL_LOGLOC/server.status.log | egrep -m1 '\*\*.*Memory Status:' ) USED=$( echo "$MEMLINE" | egrep -o '+ MB Used' | sed 's/\..*//;s/,//' ) MAX=$( echo "$MEMLINE" | egrep -o '+ MB…
if ]; then #Check age if ]; then echo "Backup takes too long" else echo "Doing backup" fi fi
I got this on RHEL 6: requested NFS version or transport protocol is not supported Restarting the NFS daemon fixed this. Guess some libraries were updated. Haven't taken the time…
Setting hostname via /etc/sysconfig/network does not seem to work anymore. Instead use hostnamectl set-hostname hostname.domain.
Compact: #.---------------- min (0-59) #| .------------- hr (0-23) #| | .---------- dom (1-31) #| | | .------- mon (1-12) #| | | | .---- dow (0-7|mon-sun0) #| | | |…
repomanage -k2 --old /data/repo/data/el-6-epel | xargs rm -f
I got: Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release The GPG keys listed for the "RHEL6 Server" repository are already installed but they are not correct for this package. Check that the correct…
MySQL for puppet dashboard gets BIG. You can make this smaller by deleting old records. Source for this article is here. To get the size in GB of the dashboard:…
A RHEL update today fucked up a RHEL system, giving: "vfs unable to mount root fs unknown-block". Fix: Boot from RHEL CD Choose rescue mode Start (with network) Type: chroot…
Get the full path of a file via: $ readlink -f ./file Tip: make an alias: alias fullpath='readlink -f'
This might be helpful for someone. A quick script I made for changing output modes on my Dell laptop. There are different configurations. laptop: laptop screen only vga: vga output…
Encrypt: openssl enc -aes-256-cbc -a -salt -in plain.txt -out encrypted.enc Decrypt: openssl enc -d -aes-256-cbc -a -in encrypted.enc -out plain.txt Functions: #!/bin/bash function encrypt() { openssl enc -aes-256-cbc -a -salt…
You can check the endtime/end time/notafter/expiration date of a site by doing this: openssl s_client -connect google.com:443 2>/dev/null
Adjust to your needs ;) #!/bin/bash # Create puppet module layout if ];then echo "$0 modulename" exit 1 fi if ]; then echo "Dir already exists" exit 1 fi #…
From here.: yum check dependencies \ | grep 'has missing requires' \ | sed 's/.\+has missing requires of //' \ | sed 's/ .\+//' \ | while read dep; do…