Author: karlo
-
Linux df says disk is full, du does not add up
There might be files which you deleted but but are still on disk. This happens if a process still has the file open. You can check for open files by doing: sudo lsof +L1 firefox 15940 klu txt REG 0,39 130896 0 4064267 /usr/lib64/firefox/firefox (deleted) firefox 15940 klu 12r REG 0,39 9698845 0 4064383 /usr/lib64/firefox/omni.ja…
-
LVM lv logical volumes not in mapper (or in /dev)
vgdisplay (are they there?) vgscan –mknodes -v vgchange -a y
-
Reboot failing in RHEL/centos: Failed to talk to init daemon.
Use reboot -f [root@lintest ~]# reboot Failed to start reboot.target: Activation of org.freedesktop.systemd1 timed out Failed to open /dev/initctl: No such device or address Failed to talk to init daemon. [root@lintest ~]# [root@lintest ~]# [root@lintest ~]# [root@lintest ~]# [root@lintest ~]# reboot -f packet_write_wait: Connection to 10.0.100.31 port 22: Broken pipe
-
Bash compound commands (()){{}}{}[[]]
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 or more newlines, and may be followed by a newline in place of a semicolon. (list) list is executed in a subshell environment (see COMMAND…
-
lvm VGrename and lvrename in linux
vgrename VG_ESM6c VG Volume group “VG_ESM6c” successfully renamed to “VG” lvrename /dev/VG/root lv_root Renamed “root” to “lv_root” in volume group “VG” then edit /etc/fstab then edit /boot/grub/grub*cfg then make a new kernel: mkinitrd –force /boot/initramfs-$(uname -r).img $(uname -r)
-
RHEL crash after flush journal to persistent
mount with a rescue image, chroot /mnt/sysimage, mount -a see what fails fix your /etc/fstab
-
Check SSL ciphers remotely using nmap
[klu@scanner ~]$ nmap -p 636 –script ssl-enum-ciphers servername Starting Nmap 6.40 ( http://nmap.org ) at 2016-10-11 08:33 CEST Stats: 0:00:00 elapsed; 0 hosts completed (0 up), 1 undergoing Ping Scan Ping Scan Timing: About 100.00% done; ETC: 08:33 (0:00:00 remaining) Nmap scan report for servername (10.0.01) Host is up (0.00033s latency). rDNS record for 10.0.64.5:…
-
Offending DSA key /var/lib/sss/pubconf/known_hosts
Offending DSA key /var/lib/sss/pubconf/known_hosts if you use rhel idm/ipa, remove ssh keys from that server
-
RHEL/Fedora auto apply updates (dnf/yum)
[root@zotac3 ~]# 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 updates 90 k Transaction Summary =============================================================================================================================================================================================================================================================================================================================== Install 1 Package Total download size: 90 k Installed size: 35 k Downloading Packages: dnf-automatic-1.1.10-1.fc24.noarch.rpm 18 kB/s |…
-
RHEL7 systemctl systemd list shutdown jobs (pending)
Sometimes you want to list the jobs you scheduled (reboots) for a Red Hat Enterprise Linux 7 server. This is how you can list the shutdowns: root@tasus:~# shutdown -r 19:02 “This system will reboot at 19:02 for updates” Shutdown scheduled for Tue 2016-09-20 19:02:00 CEST, use ‘shutdown -c’ to cancel. root@tasus:~# systemctl status systemd-shutdownd.service ●…
-
Restart UDEV (/sbin/udevd-d) on RHEL7
Use /sbin/start_udev . This will restart. Useful in a situation where you updated some libs and need to restart udev, since udev has no init/systemctl restart script.
-
Run programs without execute rights on file
/bin/bash script.sh /lib64/ld-linux-x86-64.so.2 binary.bin /usr/bin/php file.php
-
java.net.MalformedURLException: unknown protocol: socket
Open jcontrol, general, network settings, choose ‘Direct connection’. jcontrol is /usr/bin/jcontrol jcontrol is /bin/jcontrol
-
Fix broken yum database (DB_RUNRECOVERY)
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 using db5 – (-30973) error: cannot open Packages database in /var/lib/rpm CRITICAL:yum.main: Error: rpmdb open failed [root@crowdfundmailer ~]# rm -f /var/lib/rpm/__db* [root@crowdfundmailer ~]# rpm –rebuilddb…
-
Tmux arrow key navigation
Via a colleague! # Use Alt-arrow keys without prefix key 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 # Shift arrow to switch windows bind -n S-Left previous-window bind -n S-Right next-window # No delay for escape key press set…
-
Bash keyboard shortcuts
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 (End) Ctrl + p Previous command (Up arrow) Ctrl + n Next command (Down arrow) Alt + b Back (left) one word Alt + f…
-
SELinux openvpn on Fedora (Network Manager) not working
Found here, place your certs in ~/.certs and run restorecon -v ~/.certs . Local certs should have label “unconfined_u:object_r:home_cert_t:s0″
-
HP iLO 4 on Linux (Opera & Firefox) no Java console
Go to https://ip.ip.ip.ip/html/java_irc.html?lang=en to load java
-
tcpdump all but own (connected) ip
sudo tcpdump -i any not host $( echo $SSH_CLIENT |cut -d’ ‘ -f1 )
-
List all arcsight connector memory usages
RHEL7 cd /etc/init.d/; for initname in arc_*; do echo $initname = $(( ( $( ps –no-headers -q $( cat /opt/arcsight/connectors/*/current/run/$initname.pid ) -o rss ) + $( ps –no-headers -q $( cat /opt/arcsight/connectors/*/current/run/$initname.java.pid ) -o rss ) ) / 1024 )) MB used, $( grep maxmem $( echo /opt/arcsight/connectors/$initname/current/user/agent/agent.wrapper.conf | sed ‘s/arc_//g’ ) | egrep -o…
-
Fix (13)Permission denied access to * denied * because search permissions are missing on a component of the path
[core:error] [pid 25430] (13)Permission denied: [client 10.33.4.13:57108] AH00035: access to /el6/el-6-epel/ denied (filesystem path ‘/var/www/html/el6/el-6-epel’) because search permissions are missing on a component of the path check selinux
-
Reset HP/HPE iLO 4 password with CLI on Linux
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 .
-
Simulate cron environment
Add this to your cron: 30 08 * * * env > ~/cronenv After it runs, do this: env – `cat ~/cronenv` /bin/sh via https://stackoverflow.com/questions/2135478/how-to-simulate-the-environment-cron-executes-a-script-with
-
Self extracting zipped encrypted linux package
#!/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 -d /tmp/$$.XXXXX` trap “rm -rf $TMP” EXIT # Create payload tar -czf $TMP/payload –exclude=*~ ./* cd .. #?? DST=./packages/`date +%Y%m%d`/sysprep.run mkdir `dirname $DST` ( tail…