Year: 2014
-
Samsung-Linux HDMI fix overscan (missing 5% borders)
This is very annoying, and undocumented. Basically, you do not have to change anything on the linux side. It is just the TV that needs to know you are connecting a laptop/pc. To do this on samsung: Connect your laptop/pc to the HDMI port labeled DVI. For me, that is HDMI 4 Go to the…
-
[Fix] Disable RHEL7 tmux auto pane renaming in tmux
In .tmux.conf: set -g automatic-rename off set -g allow-rename off
-
Split files to loop devices
FILE=file_name; CHUNK=$((64*1024*1024)); SIZE=$(stat -c “%s” $FILE); for ((i=0; i < $SIZE; i+=$CHUNK)); do losetup --find --show --offset=$i --sizelimit=$CHUNK $FILE; done via http://www.commandlinefu.com/commands/view/13735/split-a-large-file-without-wasting-disk-space
-
Kobo on Linux, skip installation
Activate: Find the hidden .kobo dir after attaching the kobo to your pc/laptop Install sqlite3 sqlite3 KoboReader.sqlite INSERT INTO “user” VALUES(‘aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa’,’aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa’,’xxxx@xxxx.xx’,’xxxx@xxxx.xx’,’2aaaa aaaaaaaaaaaaa==’,NULL,NULL); sqlite> .exit Add dictionaries: http://www.mobileread.com/forums/showthread.php?t=196931
-
Nagios, nrpe and selinux policies (audit)
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 without warnings. If you see this happening: Disable dontaudit: semodule -DB See avc entries filling up audit.log, pipe through audit2allow. Enable again: semodule -B
-
Bash percentage calculate snippet
MEMLINE=$( tac $MGRBASE/$REL_LOGLOC/server.status.log | egrep -m1 ‘\*\*.*Memory Status:’ ) USED=$( echo “$MEMLINE” | egrep -o ‘[0-9\.,]+ MB Used’ | sed ‘s/\..*//;s/,//’ ) MAX=$( echo “$MEMLINE” | egrep -o ‘[0-9\.,]+ MB Max’ | sed ‘s/\..*//;s/,//’ ) PERC=$( printf “%.0f” $(echo “scale=2;($USED/$MAX)*100″ | bc) ) if [[ $PERC -gt $MEM_CRIT_PERC ]]; then ERRORS=”$ERRORS memory ${PERC}%” elif [[…
-
Bash file age check snippet
if [[ -f $BACKUP_LOCKFILE ]]; then #Check age if [[ $(( $( date +%s ) – $(stat -c %Y $BACKUP_LOCKFILE ) )) -gt $BACKUP_MAXLENGTH_SECS ]]; then echo “Backup takes too long” else echo “Doing backup” fi fi
-
Changing default browser in Fedora
Open gnome-control-center, go to system, details, default applications
-
Systemctl for nfs: Failed to issue method call: No such file or directory
systemctl enable nfs Failed to issue method call: No such file or directory Solution: use nfs-server .
-
Generate crypted salted password (for kickstart / shadow file)
python -c ‘import crypt; print(crypt.crypt(“Karlo”, “$6$SaltHere”))’ If your output ends with a dot, copy that as well.
-
Fix Timeout in locking authority file */.Xauthority
When logging in (via SSH) to one of my systems, it said: timeout in locking authority file */.Xauthority When this happens: Make sure the users’ home dir is readable + writeable by the user Make sure the SELinux context is set correctly; this is usually a problem when the users’ home dir is mounted on…
-
Sestatus selinux config not read on RHEL/CentOS
If you want to change the selinux config, be aware that there are two files: /etc/selinux/config /etc/sysconfig/selinux The second one should be a symlink to the first one but I found out that this is not always the case.
-
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.
-
Fix requested NFS version or transport protocol is not supported
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 to investigate further, maybe if the problem shows up more often… ;)
-
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
-
Set hostname RHEL7
Setting hostname via /etc/sysconfig/network does not seem to work anymore. Instead use hostnamectl set-hostname hostname.domain.
-
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…