{"id":2331,"date":"2015-10-17T16:51:59","date_gmt":"2015-10-17T14:51:59","guid":{"rendered":"https:\/\/adrhc.go.ro\/wordpress\/?p=2331"},"modified":"2018-05-05T16:14:36","modified_gmt":"2018-05-05T14:14:36","slug":"linux-errors-problems-tips-tricks","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/linux-errors-problems-tips-tricks\/","title":{"rendered":"Linux errors\/problems, tips &#038; tricks"},"content":{"rendered":"<pre class=\"brush:bash shell;toolbar: false\">\r\n# error\r\n# adr@adr-desktop:~$ su-to-root -X -c zenmap\r\n(gksu:24352): Gtk-WARNING **: cannot open display: \r\nadr@adr-desktop:~$ echo $DISPLAY\r\n... showing nothing ...\r\nadr@adr-desktop:~$ export DISPLAY=:0.0 -> add this in .bashrc\r\nadr@adr-desktop:~$ su-to-root -X -c zenmap\r\n... now is working ...\r\n\r\n# vmware security problem; closing ports 443 and 902 opened by VMware Authentication Daemon\r\n# https:\/\/communities.vmware.com\/thread\/425526?start=0&tstart=0\r\n# http:\/\/blog.martinshouse.com\/2012\/11\/vmware-90-on-linux-closing-ports-443.html\r\nsudo service vmware-workstation-server status\r\nsudo nmap -T4 -A -v localhost\r\n1. In \/etc\/init.d\/vmware\r\nComment out the line:\r\n         vmware_exec 'VMware Authentication Daemon' vmware_start_authdlauncher\r\nAdd the following line:\r\n         echo 'Skipping: VMware Authentication Daemon'\r\n2. In \/etc\/init.d\/vmware-workstation-server\r\nAfter the line:\r\n          ### END INIT INFO\r\nAdd two new lines:\r\n          echo Aborting launch of vmware-workstation-server\r\n          exit 0\r\n2. or (not tested) better use this to disable vmware-workstation-server autostart\r\nsudo service vmware-workstation-server stop\r\nsudo update-rc.d vmware-workstation-server disable\r\nsudo service vmware-workstation-server status\r\nsudo update-rc.d vmware-workstation-server defaults\r\n2. VMware Workstation -> Edit -> Preferences -> Shared VMs\r\nuncheck \"Enable virtaul machine sharing and remote access\" \r\n\r\n# error at apache2 startup\r\n\tAH01574: module dav_module is already loaded, skipping\r\n# solution; edit \/etc\/apache2\/mods-available\/dav.load\r\n\t&lt;IfModule !mod_dav.c>\r\n\t\tLoadModule dav_module \/usr\/lib\/apache2\/modules\/mod_dav.so\r\n\t&lt;\/IfModule>\r\n\r\n# error\r\nFetched 759 kB in 8s (91.2 kB\/s)\r\nW: Failed to fetch http:\/\/ro.archive.ubuntu.com\/ubuntu\/dists\/vivid-updates\/universe\/binary-amd64\/Packages  Hash Sum mismatch\r\nW: Failed to fetch http:\/\/ro.archive.ubuntu.com\/ubuntu\/dists\/vivid-updates\/universe\/binary-i386\/Packages  Hash Sum mismatch\r\nE: Some index files failed to download. They have been ignored, or old ones used instead.\r\nError executing command, exiting\r\n# solution\r\nCheck that everything is on in Synaptic Package Manager -> Settings -> Repositories.\r\nsudo rm \/var\/lib\/apt\/lists\/* -vf\r\nsudo apt-get update\r\n\r\n# error\r\nDash (from Unity) does not showing Applications.\r\nMessage presented is \"Sorry, there is nothing that matches your search\".\r\n# solution\r\n# http:\/\/askubuntu.com\/questions\/501880\/applications-dont-appear-in-the-dash-14-04\r\nsudo apt-get install desktop-file-utils\r\n# list the files containing errors:\r\ndesktop-file-validate ~\/.local\/share\/applications\/*.desktop | grep -i \"desktop: error\" | awk '{sub(\/:$\/,\"\",$1); print $1}' | uniq\r\ndesktop-file-validate ~\/.gnome\/apps\/*.desktop | grep -i \"desktop: error\" | awk '{sub(\/:$\/,\"\",$1); print $1}' | uniq\r\ndesktop-file-validate \/usr\/share\/applications\/*.desktop | grep -i \"desktop: error\" | awk '{sub(\/:$\/,\"\",$1); print $1}' | uniq\r\n# in order to see the errors run:\r\ndesktop-file-validate ~\/.local\/share\/applications\/*.desktop\r\ndesktop-file-validate ~\/.gnome\/apps\/*.desktop\r\ndesktop-file-validate \/usr\/share\/applications\/*.desktop\r\n# move the error-desktop-files to a temporary location:\r\nmkdir -p ~\/temp\/error-desktop-files1 ~\/temp\/error-desktop-files2 ~\/temp\/error-desktop-files3\r\ndesktop-file-validate ~\/.local\/share\/applications\/*.desktop | grep -i \"desktop: error\" | awk '{sub(\/:$\/,\"\",$1); print $1}' | uniq | xargs sudo mv -t ~\/temp\/error-desktop-files1\/ {}\r\ndesktop-file-validate ~\/.gnome\/apps\/*.desktop | grep -i \"desktop: error\" | awk '{sub(\/:$\/,\"\",$1); print $1}' | uniq | xargs sudo mv -t ~\/temp\/error-desktop-files2\/ {}\r\ndesktop-file-validate \/usr\/share\/applications\/*.desktop | grep -i \"desktop: error\" | awk '{sub(\/:$\/,\"\",$1); print $1}' | uniq | xargs sudo mv -t ~\/temp\/error-desktop-files3\/ {}\r\n# At this point your problem is solved but some application still are missing (the ones for whom you moved the *.desktop files).\r\n# What's strange is that after moving back the *.desktop files to where they originally were the problem still remains solved.\r\n# I suppose you have to first access the dash in order to show the applications before\r\n# moving them back to where they originally were, otherwise would be more than strange.\r\n\r\n# Enable *.sh executing on double-click for Xfce (thunar 1.6.6 minimal):\r\n# see then created: Settings -> Settings Editor -> thunar -> misc-exec-shell-scripts-by-default\r\nxfconf-query --channel thunar --property \/misc-exec-shell-scripts-by-default --create --type bool --set true\r\n\r\n# video card info\r\n# see also http:\/\/ubuntuforums.org\/showthread.php?t=2294502\r\n# using chromium navigate to chrome:\/\/gpu\/\r\nlspci | grep VGA\r\nsudo lshw -C video\r\n# That's because your hardware is newer than Trusty's copy of the PCI ID database of names. \r\n# Run this (once, with internet connection on) to update to the most current database of \r\n# PCI\/USB device names, and then run lspci again:\r\nsudo update-pciids\r\nsudo update-usbids\r\n# other video test\r\nexport LIBGL_DEBUG=verbose\r\nglxgears -info\r\n# display info about a GLX extension and OpenGL renderer\r\nglxinfo\r\n# display information from VA API driver\r\nvainfo\r\n\r\n# Disable The User List Or Guest Session In Ubuntu 15.10\r\n# see also http:\/\/sourcedigit.com\/17187-disable-user-list-guest-session-ubuntu\/\r\n# when using lightdm login manager:\r\ngksu gedit \/etc\/lightdm\/lightdm.conf\r\n[SeatDefaults]\t\t-> existing line\r\nallow-guest=false\t-> append this line\r\nsudo systemctl restart lightdm\r\n\r\n# show current login manager\r\ncat \/etc\/X11\/default-display-manager\r\n\r\n# list available login managers\r\nupdate-alternatives --list x-window-manager\r\n\r\n# Enable password-less login\r\n# Use \"Users and Groups\" utility.\r\n\r\n# XFCE Whisker Menu (http:\/\/gottcode.org\/xfce4-whiskermenu-plugin\/)\r\n# search whisker in Synaptic for maybe other related useful packages\r\nsudo apt-get install xfce4-whiskermenu-plugin xfce4-goodies\r\n# then add the Whisker Menu in Panel 1 and remove the Application menu\r\n\r\n# XFCE + annoying security popups\r\n# https:\/\/www.freedesktop.org\/software\/polkit\/docs\/latest\/polkit.8.html\r\nIn \/usr\/share\/polkit-1\/actions\/org.freedesktop.accounts.policy configure:\r\n&lt;defaults>\r\n  &lt;allow_any>auth_self&lt;\/allow_any>\r\n  &lt;allow_inactive>auth_self&lt;\/allow_inactive>\r\n  &lt;allow_active>auth_self_keep&lt;\/allow_active>\r\n&lt;\/defaults>\r\n# or at XFCE Settings -> Session and Startup (Application Autostart TAB):\r\n# uncheck PolicyKit Authentication Agent but with this side effect e.g.:\r\n# when starting Synaptic you won't longer be prompted for password so you'll have to start it with gksudo synaptic\r\n\r\n# public key authentication not working (Permission denied (publickey))\r\n# possible solution:\r\nsudo chown -Rv $USER: ~\/.ssh\r\nsudo chmod -v 700 ~\/.ssh\r\nsudo chmod -v 600 ~\/.ssh\/*\r\n# also remove any other user from the group named as the $USER (the base group)\r\n\r\n# ERROR1\r\n\tVMWare says something like \"vmware kernel module updater ...\" and requires pressing Install button then nothing happens.\r\n# ERROR2\r\n\tAfter some Ubuntu updates the vmware network adapters are gone.\r\n# SOLUTION\r\n\tsudo vmware-modconfig --console --install-all\r\n\r\n# problem: masked service\r\n# This will prevent the service from being started, automatically or manually, for as long as it is masked.\r\nsudo service transmission-daemon status\r\n\u25cf transmission-daemon.service\r\n   Loaded: masked (\/dev\/null)\r\n   Active: inactive (dead)\r\nsudo service transmission-daemon start\r\nFailed to start transmission-daemon.service: Unit transmission-daemon.service is masked.\r\nsudo systemctl unmask transmission-daemon.service\r\nRemoved symlink \/etc\/systemd\/system\/transmission-daemon.service.\r\nsudo service transmission-daemon status\r\n\u25cf transmission-daemon.service - LSB: Start or stop the transmission-daemon.\r\n   Loaded: loaded (\/etc\/init.d\/transmission-daemon)\r\n   Active: inactive (dead)\r\n     Docs: man:systemd-sysv-generator(8)\r\n\r\n# show open ports:\r\nsudo nmap localhost\r\n# use zenmap gui:\r\nsudo zenmap\r\n\r\n# how to install vmware tools on linux:\r\nsudo apt-get install open-vm-tools\r\n\r\n# get hdd partition uuid\r\nsudo blkid \/dev\/sda2\r\n# result e.g: \/dev\/sda2: LABEL=\"Windows7_OS\" UUID=\"4250D1BE50D1B8BD\" TYPE=\"ntfs\" PARTUUID=\"33ca1039-02\"\r\n\r\nUnity Tweak Tool - usefull tweaks:\r\nselect Launcher -> \"Show Desktop\" icon\r\nselect Search -> Search online sources\r\nselect Panel -> Date & time\r\n\r\nCompiz Config Settings Manager (compizconfig-settings-manager) - settings:\r\nGeneral Options -> Display Settings (for default monitor selection)\r\nUbuntu Unity Plugin -> Launcher -> Minimize Single Window Applications (check in order to maximize\/minimize window when clicking on it's launcher icon)\r\n\r\nAfter updating an Ubuntu server I occasionally see the message you \r\nmay need to re-run your boot loader[grub] after updating the kernel:\r\nsudo update-grub\r\n\r\n# Remote desktop + XFCE + terminal auto complete commands\r\n# http:\/\/ubuntuforums.org\/showthread.php?t=1771058&page=2\r\nedit ~\/.config\/xfce4\/xfconf\/xfce-perchannel-xml\/xfce4-keyboard-shortcuts.xml\r\nfind the line\r\n&lt;property name=\"custom\" type=\"empty\">\r\n\t&lt;property name=\"&amp;lt;Super&amp;gt;Tab\" type=\"string\" value=\"switch_window_key\"\/>\r\nand change it to\r\n&lt;property name=\"custom\" type=\"empty\">\r\n\t&lt;property name=\"&amp;lt;Super&amp;gt;Tab\" type=\"empty\"\/>\r\nreboot or whatever and then tab will work properly!\r\n\r\n# download from https with public\/private key and user\/password\r\n# see also https:\/\/adrhc.go.ro\/wordpress\/how-to-create-a-certificate\/\r\nwget --no-hsts --no-check-certificate --user=uuu --password=ppp --certificate=xxx_pub.pem --private-key=xxx_key.pem https:\/\/svn-ubuntu\/zzz\/yyy.xml\r\nPS: make sure \"certificate common name\" match host name (e.g. svn-ubuntu); put it in \/etc\/hosts in order to match\r\n\r\n# clear HSTS data for chrome\r\nchrome:\/\/net-internals\/#hsts\r\n\r\n# PROBLEM:\r\n# umount: \/mnt\/adrhc-davp: target is busy\r\n# SOLUTION:\r\n# list open files in \/mnt\/adrhc-davp:\r\nsudo lsof | grep \/mnt\/adrhc-davp\r\n# or identify processes using \/mnt\/adrhc-davp:\r\nfuser -u \/mnt\/adrhc-davp\r\n\r\n# convert m4a or m4b to mp3\r\n# use soundconverter:\r\nsudo apt-get install soundconverter\r\n\r\n# nomodeset\r\n# http:\/\/askubuntu.com\/questions\/207175\/what-does-nomodeset-do\r\nThe newest kernels have moved the video mode setting into the kernel. So all the programming of the hardware specific clock rates and registers on the video card happen in the kernel rather than in the X driver when the X server starts.. This makes it possible to have high resolution nice looking splash (boot) screens and flicker free transitions from boot splash to login screen. Unfortunately, on some cards this doesnt work properly and you end up with a black screen. Adding the nomodeset parameter instructs the kernel to not load video drivers and use BIOS modes instead until X is loaded.\r\n\r\n# ssh with pre-configured port and user name\r\n# http:\/\/linux.die.net\/man\/5\/ssh_config\r\n# create\/edit ~\/.ssh\/config:\r\nHost gigi\r\n    HostName www.gigi.com\r\n    Port 22\r\n    User gigikent\r\n    ServerAliveInterval 30\r\n# now you can login with: ssh gigi\r\nHost gigi18375\r\n    HostName www.gigi.com\r\n    Port 18375\r\n    User gigikent\r\n    ServerAliveInterval 30\r\n# now you can login with: ssh gigi18375\r\n\r\n# RAM info\r\nsudo dmidecode -t memory\r\n\r\n# generate nive html reports on computer access for a custom period of time\r\n# see also \/etc\/cron.daily\/epylog\r\n# see also \/etc\/epylog\/modules.d\/*.conf\r\n# see \/etc\/epylog\/epylog.conf for configuration:\r\n# [file]\r\n# method = file\r\n# path = \/var\/www\/html\/epylog\r\nsudo epylog --last day\r\n\r\n# access samba share; put this in your File Manager tab:\r\nsmb:\/\/ip\r\n\r\n# teamviewer setup:\r\n# https:\/\/www.linuxbabe.com\/desktop-linux\/install-teamviewer-ubuntu-16-04-xenial-xerus\r\n\r\n# Errors in \/var\/log\/syslog:\r\n# Too many open files\r\n# TCP: request_sock_TCP: Possible SYN flooding on port 8080. Dropping request.  Check SNMP counters.\r\n# http:\/\/serverfault.com\/questions\/294209\/possible-syn-flooding-in-log-despite-low-number-of-syn-recv-connections\r\nnetstat -tuna | wc -l\r\nwatch --interval=1 'netstat -tuna | grep \"SYN_RECV\" | wc -l'\r\n# \/etc\/sysctl.conf:\r\n# http:\/\/www.dba-oracle.com\/oracle10g_tuning\/t_ios_kernel_parameters.htm\r\nnet.ipv4.tcp_max_syn_backlog = 2048\r\nless \/etc\/sysctl.conf\r\nsysctl -a\r\n# \/etc\/security\/limits.conf:\r\n# -: changes both soft and hard limit\r\nusername soft nofile 2048\r\nusername hard nofile 65536\r\nusername - memlock 524288\r\n@groupname soft nofile 2048\r\n@groupname hard nofile 65536\r\n# shows all limits for current user:\r\n# http:\/\/ss64.com\/bash\/ulimit.html\r\nulimit -a\r\n# xrdp ignores \/etc\/security\/limits.conf\r\n# http:\/\/florent.clairambault.fr\/xrdp-and-the-ulimits-nofile-issue\r\n# Edit \/etc\/pam.d\/common-session* and add the following line:\r\nsession    required   pam_limits.so\r\n# e.g. change memlock limit then login with current user:\r\n# won't work with only \"ulimit -l 1024\"\r\nsudo sh -c \"ulimit -l 1024 && exec su $LOGNAME\"\r\n# e.g. print limits set for the process with pid 1831:\r\ncat \/proc\/1831\/limits\r\n# http:\/\/www.cyberciti.biz\/tips\/linux-procfs-file-descriptors.html\r\n# http:\/\/www.cyberciti.biz\/faq\/linux-increase-the-maximum-number-of-open-files\/\r\n# To count the number of open file handles of any sort, type the following command:\r\nlsof | wc -l\r\n# see also nginx setup:\r\nworker_rlimit_nofile, worker_connections, proxy_read_timeout\r\n# see also limits for sslh and sshttp:\r\nps -e -o pid,comm,cmd | grep [s]shttp\r\nps -e -o pid,comm,cmd | grep [s]slh\r\n\r\n# wget console output\r\nwget --no-check-certificate https:\/\/www.google.ro\/ -qO-\r\n\r\n# nginx ssl configuration:\r\n# https:\/\/mozilla.github.io\/server-side-tls\/ssl-config-generator\/\r\n# https:\/\/github.com\/mozilla\/server-side-tls\r\n# ttps:\/\/wiki.mozilla.org\/Security\/Server_Side_TLS#Recommended_configurations\r\n# http:\/\/security.stackexchange.com\/questions\/54639\/recommended-ssl-ciphers-for-security-compatibility-perfect-forward-secrecy\r\n# https:\/\/www.ssllabs.com\/ssltest\/analyze.html?d=adrhc.go.ro\r\n\r\n# ERROR: sudo apt-get install ttf-mscorefonts-installer\r\n# ttf-mscorefonts-installer: processing...\r\n# ttf-mscorefonts-installer: downloading http:\/\/downloads.sourceforge.net\/corefonts\/andale32.exe\r\n# Get:1 http:\/\/downloads.sourceforge.net\/corefonts\/andale32.exe [198 kB]\r\n# Fetched 198 kB in 1s (184 kB\/s)                                                              \r\n# W: Can't drop privileges for downloading as file '\/var\/lib\/update-notifier\/package-data-downloads\/partial\/andale32.exe' couldn't # be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)\r\n# ttf-mscorefonts-installer: downloading http:\/\/downloads.sourceforge.net\/corefonts\/arial32.exe\r\n# SOLUTION:\r\n# see https:\/\/ubuntuforums.org\/showthread.php?t=2323229\r\napt-cache policy ttf-mscorefonts-installer\r\nll \/var\/lib\/update-notifier\/package-data-downloads\/partial\r\nsudo rm \/var\/lib\/update-notifier\/package-data-downloads\/partial\/*\r\nsudo apt-get --purge --reinstall install ttf-mscorefonts-installer\r\n\r\n# Adding CAcert root certificate to Debian\/Ubuntu\r\n# https:\/\/www.brightbox.com\/blog\/2014\/03\/04\/add-cacert-ubuntu-debian\/\r\n# see: curl-config --ca\r\nsudo mkdir \/usr\/local\/share\/ca-certificates\/svn-ubuntu-2017\r\nsudo cp -v svn-ubuntu.cer-chain.b64-ascii.crt \/usr\/local\/share\/ca-certificates\/svn-ubuntu-2017\/\r\nsudo update-ca-certificates\r\n# or this way:\r\nsudo bash -c \"echo -n | openssl s_client -showcerts -connect host-name-here:443 2>\/dev\/null | sed -ne '\/-BEGIN CERTIFICATE-\/,\/-END CERTIFICATE-\/p' >> \/etc\/ssl\/certs\/ca-certificates.crt\"\r\n<\/pre>\n<pre>\r\n<strong>Frozen linux restart<\/strong>\r\n<a href=\"https:\/\/forum.likg.org.ua\/linux-specific\/magic-sysrq-key-t395.html\" target=\"_blank\">https:\/\/forum.likg.org.ua\/linux-specific\/magic-sysrq-key-t395.html<\/a>\r\n<a href=\"http:\/\/www.exploringbinary.com\/binary-converter\/\" target=\"_blank\">http:\/\/www.exploringbinary.com\/binary-converter\/<\/a>\r\ncat \/proc\/sys\/kernel\/sysrq\r\nCtrl + Alt + SysRq + key\r\n<em>Under graphical environments (such as Gnome or KDE) 'Alt'+'PrintScrn\/SysRq'+key combination generally only leads to a screenshot being dumped. To avoid this Print Screen feature the magic SysRq combination should include the Ctrl, becoming 'Ctrl'+'Alt'+'SysRq'+key. For the same purposes the AltGr key, if present, can be used in place of the Alt key.<\/em>\r\n\r\n<strong>#54: Protect log files<\/strong>\r\nsee <a href=\"http:\/\/www.tuxradar.com\/content\/linux-tips-every-geek-should-know\" target=\"_blank\">http:\/\/www.tuxradar.com\/content\/linux-tips-every-geek-should-know<\/a>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p># error # adr@adr-desktop:~$ su-to-root -X -c zenmap (gksu:24352): Gtk-WARNING **: cannot open display: adr@adr-desktop:~$ echo $DISPLAY &#8230; showing nothing &#8230; adr@adr-desktop:~$ export DISPLAY=:0.0 -> add this in .bashrc adr@adr-desktop:~$ su-to-root -X -c zenmap &#8230; now is working &#8230; # [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/linux-errors-problems-tips-tricks\/#more-2331\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">Linux errors\/problems, tips &#038; tricks<\/span><\/a><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,8,11],"tags":[],"class_list":["post-2331","post","type-post","status-publish","format-standard","hentry","category-configuration","category-howto","category-linux"],"_links":{"self":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/2331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/comments?post=2331"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/2331\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=2331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=2331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=2331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}