Category: Uncategorized
-
Disable lid suspeld linux (no gnome)
edit /etc/systemd/logind.conf set HandleLidSwitch=ignore via http://revryl.com/2013/05/16/how-to-disable-auto-suspend-when-laptop-lid-is-closed-in-fedora-1817/
-
No space left on device on Rhel, Centos, Linux – though space is free
I got the error “No space left on device” when doing mkdir. Steps to fix: Is there still space (yes in my case); df -h /data/ Are there still inodes (yes in my case); df -i /data/ File system might be corrupted. Fsck fixed it for me (xfs equivalent xfs_repair /dev/mapper/rhel-data
-
Install RHEL7 using VNC
Start using CD, tab at the install menu, add “inst.vnc inst.vncpassword=kluinst” and it will do a vnc install.
-
YouCompleteMe for Vim required dependencies
For https://valloric.github.io/YouCompleteMe/ you will need (on Fedora) to: cd .vim/bundle git clone https://github.com/Valloric/YouCompleteMe cd YouCompleteMe git submodule update –init –recursive sudo yum install cmake gcc-c++ python-libs python-devel ./install.sh
-
RHEL7 ifconfig gone! halp!
It is gone, and that is a Good Thing. See my post from 2011: http://karloluiten.nl/deprecated-linux-networking-commands-and-their-replacements/
-
[Fix] Gmail smime.p7m and tnef open mail (with winmail.dat)
Outlook and gmail do not always work together. If a someone sends you a mail from outlook using Rich Text, and has s/mime enabled, the mail will show in gmail as an empty mail with just a smime.p7s or smime.p7m attachment. This can be fixed on a Linux box: Save the smime.p7m/p7s file Rename to…
-
[Fix] Open a winmail.dat file (TNEF)
$ yum install tnef $ tnef –save-body=body –unix-paths winmail.dat $ oowriter body.rtf
-
Check modulus of ssl key and certificate to see if they match
Use these commands to see if a private key matches a server’s certificate: # openssl rsa -noout -modulus -in server.key # openssl x509 -noout -modulus -in server.crt If the modulus us the same, you can use them.
-
Validating kickstart files (ks) for Fedora/Rhel
If you want to validate your kickstart files, install pykickstart. It comes with /usr/bin/ksvalidator which gives info on what is wrong with your kickstart files (syntax et cetera).
-
[Fix] Cifs block device is write protected, mounting read-only
If you only have samba libs, and not cifs-utils installed, you will get: mount: block device //10.0.64.60/linux is write-protected, mounting read-only mount: cannot mount block device //10.0.64.60/linux read-only So install cifs-utils ;). Also make sure you do not have special characters in your username and password. CIFS really does not like backslashes. Remove the last…
-
[FIX] tcpdump: non-network bits set in “1.2.3.4/24
Use the lowest IP of the range, ergo: # tcpdump net 1.2.3.0/24 # tcpdump net 10.0.0.0/8 not .1 at the and.
-
End vim macro in insert mode
Start recording macro (i normaly use qq) Do commands, end in insert mode Ctrl-o q Macro is now ended and saved in insert mode
-
Chrony status command (ntpq -p alternative)
$ chronyc sources 210 Number of sources = 4 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^+ arethusa.tweakers.net 2 10 377 22m -574us[ -574us] +/- 27ms ^* ntp0.mediamatic.nl 2 10 377 22m -946us[-1032us] +/- 32ms ^- dns02.wsrs.net 2 9 377 192 -54ms[ -54ms] +/- 91ms ^+ hosting01.spk.rickes.nl 2 10 377 22m -1834us[-1834us]…
-
Howto: vmware resize disk (lvm/ext4)
Very short version: echo 1 > /sys/class/scsi_disk/2\:0\:0\:0/device/rescan Resize disk in vmware fdisk /dev/sda2 p, d, 2, n, p, 2 , 258, t, 2, 8e, w reboot/rescan pvresize /dev/sda2 lvextend -l +100%FREE /dev/mapper/VG-lv_data df -h && echo “Be happy” Using parted: resize disk, reboot parted, p (should give larger disk, remember partition start for lvm part)…
-
[Fix] KS RHEL minimal (no base)
Not documented in the kickstart docs I use: https://fedoraproject.org/wiki/Anaconda/Kickstart , the way to do a minimal (core/nobase) install: %packages –nobase @core @server-policy %end
-
[Fix] NFS directories mounted as ‘nobody’ user
My nsf shares were mounted as ‘nobody. In /etc/idmap.conf the [Translation] Method= nsswitch, so that is not the problem. Solution is to do “nfsidmap -c” on the box where the share is mounted. And make sure the uid/gid’s are the same (use ldap or something).
-
Failed to find module vboxdrv/vboxnetflt/vboxnetadp
Problem: Dec 6 09:09:19 kahuna-karlo systemd-modules-load[8745]: Failed to find module ‘vboxdrv’ Dec 6 09:09:19 kahuna-karlo systemd-modules-load[8745]: Failed to find module ‘vboxnetflt’ Dec 6 09:09:19 kahuna-karlo systemd-modules-load[8745]: Failed to find module ‘vboxnetadp’ Solution: yum install kernel-devel gcc dkms akmod-VirtualBox syslog: Dec 6 09:10:31 kahuna-karlo systemd[1]: Starting Load Kernel Modules… Dec 6 09:10:31 kahuna-karlo kernel: [ 1877.376766]…
-
[FIX] Could not allocate requested partitions: requested size exceeds maximum allowed
I got “Could not allocate requested partitions: requested size exceeds maximum allowed” while installing RHEL on a SAN. Linux seems to be having a max partition size of 2.2TB (2TB). Fix: Stop partitioning, click ‘back’ Go to a text terminal (alt-f2) Find the device you want to put a 2GB+ system on: ls -al /dev/mapper/…
-
Linux java control panel binary location
I sometimes need the java control panel. It is not named like the other java programs (java javac javadoc javah javap javaws), that is why I sometimes can’t find it. The java control panel for Linux is called ‘jcontrol’ and can be found in (/usr)/bin/jcontrol. Now you can set java proxy settings in linux and…
-
FIX: RHEL Vbox/Virtualbox extension pack install fail
I got this on my laptop: Progress state: NS_ERROR_FAILURE VBoxManage: error: Failed to install “/home/klu/tmp/Oracle_VM_VirtualBox_Extension_Pack-4.2.18-88780.vbox-extpack” VBoxManage: error: The installer failed with exit code 127: Error creating textual authentication agent: Error opening current controlling terminal for the process (`/dev/tty’): No such device or address VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ExtPackManager, interface IExtPackManager VBoxManage: error:…
-
Fix Error mounting: $MFTMirr does not match $MFT (record 0).
While transferring 200k files to my USB HDD, it stopped and when remounting the disk, I got: Error mounting /dev/sdj1 at /run/media/karlo/WD: Command-line `mount -t “ntfs” -o “uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177” “/dev/sdj1” “/run/media/karlo/WD”‘ exited with non-zero exit status 13: $MFTMirr does not match $MFT (record 0). Failed to mount ‘/dev/sdj1’: Input/output error NTFS is either inconsistent, or there…
-
Fix “auxpropfunc error invalid parameter supplied” on RHEL6
Delete package cyrus-sasl-ldap after verifying you don’t need SASL/LDAP on your machine. See https://bugzilla.redhat.com/show_bug.cgi?id=167300 .
-
Linux sync process
$ watch -n 5 grep Dirty /proc/meminfo Gives you the amount of unsync’ed memory every 5 seconds.
-
Fix: Terminal entry not found in terminfo ‘screen-256color’ not known
I got: E558: Terminal entry not found in terminfo ‘screen-256color’ not known. Available builtin terminals are: … This means that the remote host you are working on does not know about the terminal ‘screen-256color’. Fix: local$ infocmp screen-256color > screen-256color.ti local$ scp screen-256color.ti remote: local$ ssh remote remote $ sudo yum install ncurses ncurses-bin #optional…
-
Fix “hostname: Name or service not known”
Simple fix, as root: # hostname -f hostname: Name or service not known # echo “127.0.0.1 `hostname`” >> /etc/hosts # hostname -f karlo-laptop
-
HOWTO: Solve / investigate high Linux system load
On support websites I am noticing there is a lot of confusion about system load. This post is my attempt to make a short guide to understanding (and fixing) high Linux system load. Disclaimer: I might be wrong ;). Get your current sysload: $ w 18:54:44 up 22 days, 22:47, 1 user, load average: 2.54,…
-
Auditd find syslog code
Don’t know what a syscall code means in your audit output? Follow these steps to find out: Find the source for your kernel: https://www.kernel.org/pub/linux/kernel/v2.6/ Extract the file Go to /[yourkernelversion]/arch/[your_architecture]/include/asm Open the header file unistd_[32/64].h Find the syscall code Defines: #define __NR_read 0 #define __NR_write 1 #define __NR_open 2 #define __NR_close 3 #define __NR_stat 4…
-
Monitor ntp without ntpq
I was working on a server which did not have ntpq installed, so I couldn’t do ntpq -p. Simple solution is to stop the ntp service and run ntpd -d This will output logging to stdout. Simple solution ;).