trac svn python bindings messed up rebuild python

My trac and svn used to work it still does if i click on the links many times. How ever it complaines of he followign and i am not sure what to do i have followed http://trac.edgewall.org/wiki/TracSubversion and http://trac.edgewall.org/wiki/TracSubversion but nothings changed. I am using centos 5, svn 1.6, trac 0.10.4, python 2.4.3               2013-11-29 14:24:14,458 Trac[main] ERROR: Unsupported version control system "svn". Check that the Python bindings for "svn" are correctly installed.     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 406, in dispatch_request         dispatcher.dispatch(req)       File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 191, in dispatch         chosen_handler = self._pre_process_request(req, chosen_handler)       File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 263, in _pre_process_request         chosen_handler = f.pre_process_request(req, chosen_handler)       File "/usr/lib/python2.4/site-packages/trac/versioncontrol/api.py", line 73, in pre_process_request         self.get_repository(req.authname).sync()       File "/usr/lib/python2.4/site-packages/trac/versioncontrol/api.py", line 91, in get_repository         raise TracError('Unsupported version control system "%s". '     TracError: Unsupported version control system "svn". Check that the Python bindings for "svn" are correctly installed.     2013-11-29 14:24:15,090 Trac[loader] DEBUG: Loading file plugin ez_setup from /usr/share/trac/plugins/ez_setup.py     2013-11-29 14:24:15,154 Trac[loader] DEBUG: Loading egg plugin trac.ticket.web_ui from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,286 Trac[loader] DEBUG: Loading egg plugin trac.ticket.query from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,345 Trac[loader] DEBUG: Loading egg plugin trac.attachment from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,345 Trac[loader] DEBUG: Loading egg plugin trac.versioncontrol.svn_fs from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,564 Trac[loader] DEBUG: Loading egg plugin tracopt.mimeview.enscript from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,627 Trac[loader] DEBUG: Loading egg plugin trac.mimeview.patch from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,629 Trac[loader] DEBUG: Loading egg plugin trac.mimeview.txtl from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,643 Trac[loader] WARNING: Cannot load plugin trac.mimeview.txtl because it requires "textile>=2.0"     2013-11-29 14:24:15,643 Trac[loader] DEBUG: Loading egg plugin trac.admin.web_ui from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,644 Trac[loader] ERROR: Failed to load plugin trac.admin.web_ui from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named admin.web_ui     2013-11-29 14:24:15,682 Trac[loader] DEBUG: Loading egg plugin trac.web.session from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,683 Trac[loader] DEBUG: Loading egg plugin trac.ticket.admin from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,684 Trac[loader] ERROR: Failed to load plugin trac.ticket.admin from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named admin     2013-11-29 14:24:15,685 Trac[loader] DEBUG: Loading egg plugin trac.mimeview.rst from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,699 Trac[loader] WARNING: Cannot load plugin trac.mimeview.rst because it requires "docutils>=0.3"     2013-11-29 14:24:15,699 Trac[loader] DEBUG: Loading egg plugin trac.db.postgres from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,701 Trac[loader] DEBUG: Loading egg plugin trac.versioncontrol.web_ui from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,734 Trac[loader] DEBUG: Loading egg plugin trac.timeline from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,735 Trac[loader] ERROR: Failed to load plugin trac.timeline from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named timeline.web_ui     2013-11-29 14:24:15,736 Trac[loader] DEBUG: Loading egg plugin trac.mimeview.pygments from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,749 Trac[loader] WARNING: Cannot load plugin trac.mimeview.pygments because it requires "Pygments>=0.6"     2013-11-29 14:24:15,750 Trac[loader] DEBUG: Loading egg plugin trac.wiki.admin from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,750 Trac[loader] ERROR: Failed to load plugin trac.wiki.admin from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named admin     2013-11-29 14:24:15,751 Trac[loader] DEBUG: Loading egg plugin trac.about from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,752 Trac[loader] ERROR: Failed to load plugin trac.about from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named about     2013-11-29 14:24:15,752 Trac[loader] DEBUG: Loading egg plugin tracopt.ticket.commit_updater from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,758 Trac[loader] ERROR: Failed to load plugin tracopt.ticket.commit_updater from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])       File "build/bdist.linux-i686/egg/tracopt/ticket/commit_updater.py", line 48, in ?     ImportError: No module named compat     2013-11-29 14:24:15,759 Trac[loader] DEBUG: Loading egg plugin trac.wiki.interwiki from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,762 Trac[loader] DEBUG: Loading egg plugin trac.ticket.roadmap from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,765 Trac[loader] DEBUG: Loading egg plugin trac.versioncontrol.svn_prop from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,766 Trac[loader] ERROR: Failed to load plugin trac.versioncontrol.svn_prop from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named svn_prop     2013-11-29 14:24:15,766 Trac[loader] DEBUG: Loading egg plugin trac.mimeview.silvercity from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,779 Trac[loader] WARNING: Cannot load plugin trac.mimeview.silvercity because it requires "SilverCity>=0.9.4"     2013-11-29 14:24:15,779 Trac[loader] DEBUG: Loading egg plugin trac.wiki.macros from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,780 Trac[loader] DEBUG: Loading egg plugin trac.db.sqlite from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:15,790 Trac[loader] DEBUG: Loading egg plugin tracopt.ticket.deleter from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,045 Trac[loader] ERROR: Failed to load plugin tracopt.ticket.deleter from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])       File "build/bdist.linux-i686/egg/tracopt/ticket/deleter.py", line 22, in ?     ImportError: No module named translation     2013-11-29 14:24:16,046 Trac[loader] DEBUG: Loading egg plugin trac.wiki.web_ui from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,054 Trac[loader] DEBUG: Loading egg plugin tracopt.mimeview.php from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,055 Trac[loader] DEBUG: Loading egg plugin trac.web.auth from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,090 Trac[loader] DEBUG: Loading egg plugin trac.wiki.web_api from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,091 Trac[loader] ERROR: Failed to load plugin trac.wiki.web_api from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named web_api     2013-11-29 14:24:16,092 Trac[loader] DEBUG: Loading egg plugin trac.admin.console from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,092 Trac[loader] ERROR: Failed to load plugin trac.admin.console from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named admin.console     2013-11-29 14:24:16,093 Trac[loader] DEBUG: Loading egg plugin trac.db.mysql from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,094 Trac[loader] DEBUG: Loading egg plugin tracopt.perm.authz_policy from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,096 Trac[loader] ERROR: Failed to load plugin tracopt.perm.authz_policy from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])       File "build/bdist.linux-i686/egg/tracopt/perm/authz_policy.py", line 23, in ?     ImportError: cannot import name IPermissionPolicy     2013-11-29 14:24:16,097 Trac[loader] DEBUG: Loading egg plugin trac.versioncontrol.svn_authz from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,097 Trac[loader] DEBUG: Loading egg plugin trac.versioncontrol.admin from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,098 Trac[loader] ERROR: Failed to load plugin trac.versioncontrol.admin from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named admin     2013-11-29 14:24:16,098 Trac[loader] DEBUG: Loading egg plugin trac.search from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,099 Trac[loader] ERROR: Failed to load plugin trac.search from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named search.web_ui     2013-11-29 14:24:16,099 Trac[loader] DEBUG: Loading egg plugin tracopt.perm.config_perm_provider from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,100 Trac[loader] DEBUG: Loading egg plugin trac.prefs from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     2013-11-29 14:24:16,101 Trac[loader] ERROR: Failed to load plugin trac.prefs from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg     Traceback (most recent call last):       File "/usr/lib/python2.4/site-packages/trac/loader.py", line 101, in load_components         entry_point.load()       File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/pkg_resources.py", line 1954, in load         entry = __import__(self.module_name, globals(),globals(), ['__name__'])     ImportError: No module named prefs.web_ui     2013-11-29 14:24:16,101 Trac[loader] DEBUG: Loading egg plugin trac.ticket.report from /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg      I have tried downloading and re-installing trac 0.10.4 and I also noticed the following problem, I cannot create any trac projects either               [root@hero trac]# trac-admin nagios initenv     Traceback (most recent call last):       File "/usr/bin/trac-admin", line 21, in ?         from trac.scripts.admin import run     ImportError: No module named scripts.admin      29th november is when all this happened, only 3 packages where updated.               [root@hero trac]# rpm -qa --queryformat '%{installtime} (%{installtime:date}) %{name}\n' | sort -n | tail -20     1272376205 (Tue 27 Apr 2010 02:50:05 PM BST) perl-Digest-SHA     1272376206 (Tue 27 Apr 2010 02:50:06 PM BST) perl-Net-DNS     1272376367 (Tue 27 Apr 2010 02:52:47 PM BST) perl-Net-IMAP-Simple     1297437326 (Fri 11 Feb 2011 03:15:26 PM GMT) rsync     1303313671 (Wed 20 Apr 2011 04:34:31 PM BST) bacula-libs     1303313686 (Wed 20 Apr 2011 04:34:46 PM BST) bacula-client     1319625083 (Wed 26 Oct 2011 11:31:23 AM BST) nano     1320596688 (Sun 06 Nov 2011 04:24:48 PM GMT) libsmbclient     1320596692 (Sun 06 Nov 2011 04:24:52 PM GMT) samba-common     1320596694 (Sun 06 Nov 2011 04:24:54 PM GMT) perl-Convert-ASN1     1320596695 (Sun 06 Nov 2011 04:24:55 PM GMT) samba-client     1320596697 (Sun 06 Nov 2011 04:24:57 PM GMT) samba     1360917828 (Fri 15 Feb 2013 08:43:48 AM GMT) which     1380191389 (Thu 26 Sep 2013 11:29:49 AM BST) httperf     1380798707 (Thu 03 Oct 2013 12:11:47 PM BST) libssh2     1380798733 (Thu 03 Oct 2013 12:12:13 PM BST) libssh2-devel     1380799094 (Thu 03 Oct 2013 12:18:14 PM BST) php-pear     1385728355 (Fri 29 Nov 2013 12:32:35 PM GMT) neon     1385728360 (Fri 29 Nov 2013 12:32:40 PM GMT) subversion     1385728366 (Fri 29 Nov 2013 12:32:46 PM GMT) mod_dav_svn      In theory if i remove the dir `/usr/share/trac` and `/usr/lib/python2.4/site- packages/trac/` and re-install trac 0.10.4 should it not work? I have tried this and it does not. I have now done the following which has fixed issue of allowing me to create trac projects, however I cannot get into trac using browser.               [root@hero trac]# easy_install -m trac     Searching for trac     Best match: Trac 0.12     Processing Trac-0.12-py2.4.egg     Removing Trac 0.12 from easy-install.pth file     Installing trac-admin script to /usr/bin     Installing tracd script to /usr/bin          Using /usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg          Because this distribution was installed --multi-version, before you can     import modules from this package in an application, you will need to     'import pkg_resources' and then use a 'require()' call similar to one of     these examples, in order to select the desired version:              pkg_resources.require("Trac")  # latest installed version         pkg_resources.require("Trac==0.12")  # this exact version         pkg_resources.require("Trac>=0.12")  # this version or higher          Processing dependencies for trac     Finished processing dependencies for trac      The error I receive is               [Mon Dec 02 10:58:21 2013] [error] [client 172.16.0.85] PythonHandler trac.web.modpython_frontend: Traceback (most recent call last):, referer: http://hero/trac/     [Mon Dec 02 10:58:21 2013] [error] [client 172.16.0.85] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 287, in HandlerDispatch\n    log=debug), referer: http://hero/trac/     [Mon Dec 02 10:58:21 2013] [error] [client 172.16.0.85] PythonHandler trac.web.modpython_frontend:   File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 461, in import_module\n    f, p, d = imp.find_module(parts[i], path), referer: http://hero/trac/     [Mon Dec 02 10:58:21 2013] [error] [client 172.16.0.85] PythonHandler trac.web.modpython_frontend: ImportError: No module named trac, referer: http://hero/trac/


Automatically set file attributes in a given directory

Let's say I want to set one or more attributes (in the `chattr` sense) on every file created in a given directory. Is there a way to achieve this automatically, like `umask` does for file permissions ? In other words, is there a way to omit the `chattr` step in :               $ copy file /path/to/backup/     $ chattr +i /path/to/backup/file      for every file created in `/path/to/backup/` ? Note : My system is Debian and my filesystem is ext3.


cp --backup=numbered for folders

To backup existing files with number suffixes, I can do the following:               cp --backup=numbered afile /path/to/dest      But this does not apply when I try to do the same with a folder:               cp -R --backup=numbered afolder /path/to/dest      How can I achieve this? * * * Maybe I should demonstrate a bit what I want to achieve. First we have two dirs:               ls -ld source container     drwxrwxr-x 6 kaiyin kaiyin 4096 Nov 29 22:11 container     drwxrwxr-x 2 kaiyin kaiyin 4096 Nov 29 22:09 source      Then we do this: myPerfectCp -R --backup=numbered source container/ myPerfectCp -R --backup=numbered source container/ myPerfectCp -R --backup=numbered source container/ myPerfectCp -R --backup=numbered source container/ Ideally I want this result:               tree container/     container/     ├── source     ├── source.~1~     ├── source.~2~     └── source.~3~


Can Not Install JStock on Ubuntu (zorin 7)

Trying to install Jstock on a Linux Ubuntu Box. As a new user trying to install this product. I have received this error after following instruction - on to a Ubuntu (Zorin7) system. ### Instructions How to install JStock in Linux?               user@ubuntu804desktop:~$ cd ~     user@ubuntu804desktop:~$ wget http://downloads.sourceforge.net/jstock/jstock-1.0.7i-bin.zip     user@ubuntu804desktop:~$ unzip jstock-1.0.7i-bin.zip     user@ubuntu804desktop:~$ cd jstock/     user@ubuntu804desktop:~/jstock$ chmod 755 jstock.sh     user@ubuntu804desktop:~/jstock$ ./jstock.sh      This is the error after imputing - `cd jstock` it returned the following:-               :~/jstock$ /jstock$ chmod 755 jstock.sh     bash: /jstock$: No such file or directory     :~/jstock$ ls     config  database  docs  extra  jstock.jar  jstock.sh  lib      Can you please advise?


How to merge two files based on the matching of two columns?

I have file1 likes:               0   AFFX-SNP-000541     NA     0   AFFX-SNP-002255     NA     1   rs12103     0.6401     1   rs12103_1247494     0.696     1   rs12142199  0.7672      And a file2:               0   AFFX-SNP-000541     1     0   AFFX-SNP-002255     1     1   rs12103     0.5596     1   rs12103_1247494     0.5581     1   rs12142199  0.4931      And would like a file3 such that:               0   AFFX-SNP-000541     NA   1     0   AFFX-SNP-002255     NA   1     1   rs12103     0.6401   0.5596     1   rs12103_1247494     0.696   0.5581     1   rs12142199  0.7672   0.4931      Which means to put the 4th column of file2 to file1 by the name of the 2nd column.


Delete files recursively that DON'T match regexp

I'm attempting to clean out a bunch of temporary files from a folder tree, but don't want to delete files that match some criteria, specifically executable files, .tpl files, and not the subfolder 'data'. I see the question here Delete files in a directory that match a regexp, using a Mac terminal is almost what I'm looking for, but they have a regex they are trying to match, and I have a regex that I don't want matches. I can do this to find all of the files I don't to delete:               find . -executable -o -regex '.*\.tpl'      Is there a way to invert the matches, like -v does with regex?


Copying many CDs to disk

I have many old (data) CDs. I want to copy them all to the disk, but the problem is that some of these CDs are no longer readable and it is extremely tiresome to copy the CDs one by one. Is there some tool to expedite this process?


See the STDOUT redirect of a running process

If I start an app with this command:               /path/to/my/command >> /var/log/command.log      And the command doesn't return, is there a way, from another prompt, to see what the STDOUT redirect is set to? I'm looking for something like either               cat /proc/PID/redirects      or               ps -??? | grep PID      but any method will do.


How/why does this globbing expression work?

In one of my bash scripts I needed to obtain the last part of a colon delimited string. For example I needed to grab the numeric `289283` value from the following value:               OK: DriveC-ReadBytesPerSec: 289283      After some trial and error I arrived at the following:               READRESULT="OK: DriveC-ReadBytesPerSec: 289283"     echo ${READRESULT#*:*:*}      Which outputs `289283`. The problem is that whilst it gets the job done, I don't fully understand why `${READRESULT#*:*:*}` produces the correct result. Can anyone explain how this globbing expression works?


foomatic-configure producing weird perl warnings

I am using CentOS 6.4 and trying to use the 'foomatic-configure' for print information and am receiving some weird errors: Perl: v5.10.1 foomatic: foomatic-4.0.4-1.el6_1.1.i686 Command line:               foomatic-configure -r -P -q      Produces these warnings:               Use of uninitialized value $manufacturer in string eq at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 354.     Use of uninitialized value $model in string eq at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 355.     Use of uninitialized value in split at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 2147.     Use of uninitialized value $d in hash element at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1143.     Use of uninitialized value in regexp compilation at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1146.     Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1146.     Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1189.     Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1191.     Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1193.     Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1195.     Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1197.     Use of uninitialized value in pattern match (m//) at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1199.     Use of uninitialized value in hash element at /usr/share/perl5/vendor_perl/Foomatic/DB.pm line 1249.      Yukk, what is up with that??? I do receive the perl hash for `$QUEUES[0]` with the correct data, but could do without the error messages.... **UPDATE:** Looks as though I can suppress these messages using the following: `foomatic-configure -P -q -r 2>/dev/null` Shouldn't have to do that though....


MySQL is running out of cache

I installed MySQL Workbench on Linux Mint 17. When I enter the `i` character from keyboard MySQL runs out cache in MySQL query display. Then MySQL shuts down. I would appreciate it if you could help.


init.d script won't send graphical data

I have a client sever java program. The client's work is to capture the screen and send data to server. An additional function it does is opens the website given from server and send some text to server. I wanted the client to run at startup, so I wrote a script and used it in `/etc/init.d` and used `update- rc.d scriptname defaults` and then rebooted. On reboot, the text I am supposed to receive works perfectly. But I am not able to browse or receive captured screen from client. The script I used in init.d is as follows:               #!/bin/sh          ### START INIT INFO     # Provides: suscript     # Required-Start:    $remote_fs $syslog $local_fs $network     # Required-Stop:     $remote_fs $syslog $local_fs $network     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: Start daemon at boot time     # Description:       Enable service provided by daemon.     ### END INIT INFO          java -jar /etc/capture/capture.jar      I run the client jar as root. How do I bring the graphical data to the server?


how to round trip a bash associative array to a text file?

I want to memorize an associative array between different script runs. What I have so far is that given a text file containing one key/value pair:               (     [james]=bond     )      Is a script to load that into an associative array, add to it, then echo it out in a way which can be redirected into a second file:               #!/bin/bash     file=`cat $1`     key=$2     value=$3     declare -A row="$file"     row[$key]=$value     echo "("     for server in "${!row[@]}"         do echo "[$server]=${row[$server]}"; done     echo ")"      then I can run it as:               ./arrays.sh file1 honey rider > file2 ; mv file2 file1      Giving               (     [james]=bond     [honey]=rider     )      Yet it seems very clunky. Is there a cleaner way to do this?


Feh - strange behavior when loading backgrounds in Arch Linux

I am experiencing a strange problem with Feh in Arch Linux. When I start my openbox session, feh loads the background for a split second and then it goes away. If I manually load the background then feh will operate perfectly for the remainder of my session but on startup it always fails. I am running Arch Linux (current) and Openbox 3. Relevant files: ~/.config/openbox/autostart.sh               # Set a background color     BG=""     if which hsetroot >/dev/null 2>&1; then         BG=hsetroot     else         if which esetroot >/dev/null 2>&1; then         BG=esetroot         else         if which xsetroot >/dev/null 2>&1; then             BG=xsetroot         fi         fi     fi     test -z $BG || $BG -solid "#303030"          # D-bus     if which dbus-launch >/dev/null 2>&1 && test -z "$DBUS_SESSION_BUS_ADDRESS"; then            eval `dbus-launch --sh-syntax --exit-with-session`     fi          if test -x /usr/libexec/gnome-settings-daemon >/dev/null; then       /usr/libexec/gnome-settings-daemon &     elif which gnome-settings-daemon >/dev/null 2>&1; then       gnome-settings-daemon &     elif which xfce-mcs-manager >/dev/null 2>&1; then       xfce-mcs-manager n &     fi          if which start_kdeinit >/dev/null 2>&1; then       LD_BIND_NOW=true start_kdeinit --new-startup +kcminit_startup &     fi          # Run XDG autostart things.  By default don't run anything desktop-specific     # See xdg-autostart --help more info     DESKTOP_ENV="OPENBOX"     if which /usr/lib/openbox/xdg-autostart >/dev/null 2>&1; then       /usr/lib/openbox/xdg-autostart $DESKTOP_ENV     fi          ## My startup programs:     cairo-compmgr &     pypanel &     sh ~/.fehbg &      ~/.fehbg               feh  --bg-fill '/home/cknadler/Wallpaper/wall.jpg'      At this point I am either looking for a solution to make feh load correctly every-time I start my session or possibly an alternative the feh for loading backgrounds in openbox. Either would be greatly appreciated, thanks.


What would be a good choice for an elastic file system (for adding storage at a later date)?

I'm currently running a Debian 6.0 server with EXT3, but I'd like to move over to Arch. It's being used as a file server right now with a 1TB drive in it (of which 650GB in it is used). What I'd like to do at a later point (when I'm not completely broke) is buy another drive and add it to the same system (for backing up my main rig). What would be the easiest way of accomplishing this? I've looked into RAID, but it'd be useless because I'd have to reinitialize the array every time I added a new drive. **Note: I'm not fussed about redundancy, it's only going to be hosting mirrored backups which I can easily remake in the case of data loss.** Basically: System with clean 1TB drive in, what should I do now to prepare for a new striped drive at a later date _without having to reinitialize any arrays?_


Passing pipeline value as parameter to xargs for use by eval echo

I have a text file that I'm using as a template, it looks like this:               Hostname     : $HOSTNAME     Host Address : $HOSTADDRESS      My bash script sets two variables, `HOSTNAME` and `HOSTADDRESS`, reads the template file then does an `eval` to expand `$HOSTNAME` and `$HOSTADDRESS`:               HOSTNAME="SH_SQL_0089"     HOSTADDRESS="172.16.3.44"     TEMPLATE=`cat template.txt`     MESSAGE=`eval echo $TEMPLATE`      The resultant value of `MESSAGE` is:               Hostname     : SH_SQL_0089     Host Address : 172.16.3.44      Is it possible to reduce the last two lines to something like:               MESSAGE=$(cat template.txt | eval echo ????)      I tried using `xargs`:               MESSAGE=$( cat template.txt | xargs -i bash -c "eval echo {}" )      But it only substitutes `$HOSTNAME` and strips the carriage returns. The reason I want to do this is that I need to add a third processing step and pipe the `eval`'d output to that. I feel I'm so close.


Simple CLI rss reader, that can print only subject and uri, based on new since time interval

So what I'm looking for is easy enough to code, but I'm wondering if it already exists, so I don't going releasing duplicate code. I need a feed reader, that prints the subject, and uri on one line, to stdout. It should be able to be configured (not necessarily by config file) to only show new feeds in say the last 5 minutes. The reason I want this is because I'm coding my ping.fm replacement. I basically want to be able to do something like `feedreader | pingit` where `pingit` will do, `foreach` line of input, make a separate post. In this way I'll also be able to `echo -n "my social post" | pingit` I'll probably also make `pingit "post"` work.


How to scale xvfb?

I'm looking to develop a web-application that translates request parameters into a PNG/GIF chart. I'm looking to reuse an open source charting library, but I have concerns about the scalability. A long time ago, we were using a single Xvfb buffer to render our image into, but that basically meant servicing only one incoming request at a time. According to the man page it seems we can create numerous buffers? If so, is it simply ensuring there is enough physical RAM to prevent excessive paging?


Writing basic systemd service files

I am developing a Nodejs application that the user interacts with via HTTP on localhost. There are practically no parameters and the daemon has virtually no dependencies and it just needs to be up by log-in time. I would like to follow the idioms on each platform for start-up scripts, and that means Upstart on Ubuntu and systemd on Fedora.   * **Are there any good tutorials for writing systemd system files?**   * **Are there any 'best practices' to be aware of?** I have found these resources:   * Fedora wiki page about systemd   * Blog about writing systemd system files   * Systemd on Wikipedia I am mostly looking for an API of sorts as a reference, as well as a basic format to follow.


Shell script to check for the presence of one or more files with a specific extension?

I want to write a script to find a file with specific extension.this much i have done:               #!/bin/bash     file="/home/Savio/Dsktop/check/*.csv"     file1="/home/Savio/check/*.txt"     if [[ -f "$file" && -f "$file1" ]];     then         echo " found."     else         echo "not found."     fi      Where the `check` folder contains sub-folders. Please correct me if anything wrong is there


Mint changes default route when eth0 comes back and breaks existing tcp connections

I have two interfaces on my laptop (eth0, wlan0). lets say I am moving away from desk and connecting to an internal network A using openvpn software which uses wlan0 as gateway. I then ssh to a few vms inside this network A. when I return back to my desk, the system detects eth0 is available and automatically changes default route. I then lose vpn connection and all the ssh sessions with the vms in network A. on wlan0               Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         10.147.76.1     0.0.0.0         UG    0      0        0 wlan0      when reestablished connection with eth0               Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         10.148.93.1     0.0.0.0         UG    0      0        0 eth0      how to solve this issue?


Pulseaudio failed to create secure directory in nfs share

My pulseaudio cannot run, because it attempts to create `~/.config/pulse` under a different user. (probably `pulse`?).               user@localhost ~$ pulseaudio      E: [pulseaudio] core-util.c: Failed to create secure directory (/home/user/.config/pulse): Permission denied      Since the home directory is mounted from nfs and the server will never allow user `pulse` to access that directory (even for reading) it must either use a different path outside the home directory or run with a different user. I have checked `/etc/pulse/client.conf`, but there doesn't seem to be any configuration option on that. Any ideas on how this problem can be solved?


Archlinux installation problem

I've used 2 usb's, both livelinuxusb and unetbootin, and tried multiple reinstalls and formats. Whenever I try and install Archlinux x86_64 it unpacks the kernel and the says "0.000 fast tsc calibration failed" after that the computer runs but the screen turns off. What am I doing wrong?


SSH server is not disconnecting session when I shutdown the machine

I have a Arch Linux virtual machine, if I shutdown the machine while a ssh connection is alive. The SSH session would stuck (and the machine shuts down correctly) So the server is not disconnecting the session before the SSH service gets stopped. But on Ubuntu there's no such behavior, what problem could it be?


tar.bz2 7zip selective extract prformance

We use tar.bz2 as our archive of server logs. We also write tools that selectively parse these archived logs. Many times I must regex-search one file’s lines in the archive to determine if other logs contained in the same archive are relevant to the parsing needs. (I have a regex match for the file name/path) From a performance stand point I think I facing some limits. But it could be that I have a gap in my knowledge. I mostly script in python and have some basic bash skills. The archives are large and stored on a mount. I would like to avoid as much reading and local/temp storage as I can and especially when archives don’t qualify for a full parsing. Option 1 (waste bandwidth and cpu resources save local storage)   1. Read the whole bz2 file to local disk.   2. Uncompress the tar as I scan the file list.    3. Uncompress again to search the first log file.   4. Then if this archive qualifies uncompress again to extract the log that I must parse.   5. Move on to the next archive Or (waste local storage and waste less bandwidth)   1. Read the whole bz2 file to local disk.   2. Extract most of the files that meet a potential interesting criteria (would need to take most everything)   3. Now every file is just on my local file system. Scan the first log   4. Then if it qualifies move on to the log that I must parse.   5. Delete all the local storage and move on to next archive. When I research compression tools like 7zip zip rar bz2… Most links give me information about compression speed and compression size. I would like to use something like 7zip because the compression size is important long term. This is not the base of my question! But I also ‘think’ that zip has the ability to expose the full file list and extract one file without decompressing the whole archive. (Because the file list is in headers…) But zip is not very native on Linux.   Is there a way to optimize the process using the existing tar.bz2? What are some tools / methods I should consider? (Switch out tar, use 7zip?)


Why does CentOS even with its latest release ship older versions of apps such as Python 2.6? What is the reason and logic behind it?


How to make wpa_supplicant automatically log into file

I am trying to troubleshoot a wireless connection on FreeBSD. I am manually editing the `/etc/wpa_supplicant.conf` file So far the `wpa_cli` status only tells me that it's Unauthorized. I'd like to get a more verbose message and log the messages into a file for each wireless adapter.   1. How do I make wpa_supplicant automatically log into a file?   2. How do I make wpa_supplicant automatically change his debug level after a reconfigure?


Determine dynamically allocated port for OpenSSH RemoteForward

## Question (TL;DR) When assigning ports dynamically for remote forwarding (a.k.a. `-R` option), how can a script on the remote machine (for instance sourced from `.bashrc`) determine which ports were chosen by OpenSSH? * * * ## Background I use OpenSSH (on both ends) to connect to our central server, that I share with multiple other users. For my remote session (for now) I would like to forward X, cups and pulseaudio. The most trivial is forwarding X, using the `-X` option. The allocated X address is stored in the environmental variable `DISPLAY` and from that I can determine the corresponding TCP port, in most cases anyways. But I hardly ever need to, because Xlib honors `DISPLAY`. I need a similar mechanism for cups and pulseaudio. The basics for both services exist, in the form of the environmental variables `CUPS_SERVER` and `PULSE_SERVER`, respectively. Here are usage examples:               ssh -X -R12345:localhost:631 -R54321:localhost:4713 datserver          export CUPS_SERVER=localhost:12345     lowriter #and I can print using my local printer     lpr -P default -o Duplex=DuplexNoTumble minutes.pdf #printing through the tunnel     lpr -H localhost:631 -P default -o Duplex=DuplexNoTumble minutes.pdf #printing remotely          mpg123 mp3s/van_halen/jump.mp3 #annoy co-workers     PULSE_SERVER=localhost:54321 mpg123 mp3s/van_halen/jump.mp3 #listen to music through the tunnel      The problem is setting `CUPS_SERVER` and `PULSE_SERVER` correctly. **We use port forwardings a lot and therefore I need dynamic port allocations. Static port allocations are not an option.** OpenSSH has a mechanism for dynamic port allocation on the remote server, by specifying `0` as bind-port for remote forwarding (the `-R` option). By using the following command, OpenSSH will dynamically allocate ports for cups and pulse forwarding.               ssh -X -R0:localhost:631 -R0:localhost:4713 datserver      When I use that command, `ssh` will print the following to `STDERR`:               Allocated port 55710 for remote forward to 127.0.0.1:4713     Allocated port 41273 for remote forward to 127.0.0.1:631      There is the information I want! Ultimately I want to generate:               export CUPS_SERVER=localhost:41273     export PULSE_SERVER=localhost:55710      However the "Allocated port ..." messages are created on my local machine and sent to `STDERR`, which I can't access on the remote machine. Oddly enough OpenSSH does not seem to have means to retrieve Information about port forwardings. How do I fetch that information to put it into a shell script to adequately set `CUPS_SERVER` and `PULSE_SERVER` on the remote host? * * * ## Dead Ends The only easy thing I could find was increasing verbosity of the `sshd` until that information can be read from the logs. This is not viable as that information discloses a lot more information than is sensible to make accessible by non-root users. I was thinking about patching OpenSSH to support an additional escape sequence which prints a nice representation of the internal struct `permitted_opens`, but even if that is what I want, I still can't script accessing the client escape sequences from the server side. * * * ## There must be a better way The following approach seems very unstable and is limited to one such SSH session per user. However, I need at least two concurrent such sessions and other users even more. But I tried ... When the stars are aligned properly, having sacrificed a chicken or two, I can abuse the fact that `sshd` is not started as my user, but drops privileges after successful login, to do this:   * get a list of port numbers for all listening sockets that belong to my user `netstat -tlpen | grep ${UID} | sed -e 's/^.*:\\([0-9]\\+\\) .*$/\1/'`   * get a list of port numbers for all listening sockets that belong to processes my user started `lsof -u ${UID} 2>/dev/null | grep LISTEN | sed -e 's/.*:\\([0-9]\\+\\) (LISTEN).*$/\1/'`   * All ports that are in the first set, but not in the second set have a high likelyhood to be my forwarding ports, and indeed subtracting the sets yields `41273`, `55710` and `6010`; cups, pulse and X, respectively.   * `6010` is identified as the X port using `DISPLAY`.   * `41273` is the cups port, because `lpstat -h localhost:41273 -a` returns `0`.   * `55710` is the pulse port, because `pactl -s localhost:55710 stat` returns `0`. (It even prints the hostname of my client!) (To do the set substraction I `sort -u` and store the output from the above command lines and use `comm` to do the substraction.) Pulseaudio lets me identify the client and, for all intents and purposes, this may serve as an anchor to separate SSH sessions that need separating. However, I haven't found a way to tie `41273`, `55710` and `6010` to the same `sshd` process. `netstat` won't disclose that information to non-root users. I only get a `-` in the `PID/Program name` column where I would like to read `2339/54` (in this particular instance). So close ...


What is the correct partition type for a geli-crypted partition on FreeBSD?

I am currently in the process of setting up an encrypted homeserver with zfs and geli.   However I am not sure what the correct partition type for geli-crypted filesystems are. Do I just take 'freebsd-zfs' like I would do for a noncrypted zfs partition?   Do I go with the more generic 'freebsd'? All I want to know in the end is what value to pass as the '-t' parameter when calling 'gpart add'.


How to use $? and test to check function?

#!/bin/sh          function checkExit(){         if test "$?" != "0"; then           echo Command $1 exited with abnormal status           exit 1;         else echo $?         fi     }          function echoThenRun () { # echo and then run the command       echo $1       $1       ret=$?       echo $ret       return $ret     }     file=test_file     echo > $file     echoThenRun "test -f $file"     checkExit $file     echo "all right!"      The output of executing the script:               $  ~/Downloads/test.sh      test -f test_file     0     1 # why 1 here??     all right!


Kill process spawned by ssh when ssh dies

This is a question that has been addressed several times, not only here, but also in other sites of the stack exchange network (e.g. http://stackoverflow.com/questions/331642/how-to-make-ssh-to-kill-remote- process-when-i-interrupt-ssh-itself?rq=1). However, I cannot make any of the solutions work for me. So, here's the deal. I'm running a command through ssh. I want that whenever I exit ssh, the command dies as well. This command is a deamon called ktserver, that's running indefinitely until you press Ctrl-C. I run it as follows: `ssh -t compute-0-1 ktserver` and, indeed, when I press Ctrl-C, the process ends gracefully and the ssh session ends. However, if instead of pressing Ctrl-C, I kill the ssh process using the `kill` command (for example, sending SIGINT or SIGHUP), the `ktserver` process stays alive. How can I make the `ktserver` always die independent on how `ssh` is killed? **EDIT** : If, instead of `ktserver` I run something completely different, such as `gedit`, everything works like a charm (i.e. gedit dies when the connection dies). Therefore there might be something wrong with the process itself. For example, I thought that it might be ignoring SIGHUP or SIGINT. However, when I run `kill -1 ktserver` or `kill -2 ktserver`, the process dies as expected. **EDIT2** : As Mark Plotnick points out, the issue is related to the fact that there is no communication circulating on the ssh channel. I've confirmed by running `ssh -t <host> read` and killing the ssh process afterwards. `read`was still alive and kicking.


tslib: mouse cursor moves in the opposite direction to selection box

I'm using tslib/xf86-input-tslib on an ARM box with Debian 7. **ts_calibrate** and **ts_test** are working properly. The problems occur in Xfce. When I touch the screen and move the finger, I see, that mouse cursor is following my finger, but a selection box occurs with some offset to the Y-axis and then moves towards mouse cursor. My xorg.conf:               Section "InputDevice"         Identifier "tslib"         Driver "tslib"         Option "Device"    "/dev/input/event1"         Option "ScreenNumber"  "0"         Option "Width" "0"         Option "Height"    "0"         Option "Rotate"    "NONE"         Option "EmulateRightButton"    "1"     EndSection          Section "ServerLayout"          Identifier      "Default Layout"          InputDevice     "tslib" "CorePointer"     EndSection            tslib version is 1.1 and xf86-input-tslib from Ubuntu: https://code.launchpad.net/~ubuntu-branches/ubuntu/saucy/xf86-input- tslib/saucy An USB mouse is working as expected. cat /proc/bus/input/devices               I: Bus=0018 Vendor=0000 Product=fe2e Version=0100     N: Name="TPS6507x Touchscreen"     P: Phys=1-0048/input0     S: Sysfs=/devices/platform/omap/omap_i2c.1/i2c-1/1-0048/input/input1     U: Uniq=     H: Handlers=mouse0 event1     B: EV=b     B: KEY=400 0 0 0 0 0 0 0 0 0 0     B: ABS=1000003      How can I fix this behavior?


How do I delete all lines with ".png" in a file?

I've a list of urls of which some point to images:               http://s.thebrighttag.com/iframe?c=A5lqOqP     http://s.wordpress.com/imgpress?resize=136,136&url=http%3A%2F%2Fdata.whicdn.com%2Fimages%2F2833524%2F4thofJuly-collage_large.jpg%3F1278084193      How do I remove those lines from the file?


Bash- Help modify code for a custom output statement

The script will read the contents of a user-input file and count the number of employees with a specific job. Ex file line:               Sophia Lewis, 542467, Accountant       The script I have so far is:               if [ -s $1 ]     then          cat $1 | tr -s ' ' | cut -d' ' -f4- | sort | uniq -c          else             echo "ERROR: file '$1' does not exist."          fi      Output:               4 Sales      2 Accountant      1 CEO       But I want the output to appear as:               There are 4 ‘Sales’ employees.      There are 2 ‘Accountant’ employees.      There is 1 ‘CEO’ employee.      There are a total of 7 employees in the company      Should I take out the cat and put in echo statements so I can customize each line? And is there a way for it to know if it should be "is/are" x employees?


Can not execute some shell command from php

I want to execute phpcs commands from phpcode using shell_exec function. During execution it gives error `/usr/bin/php: relocation error: /usr/bin/php: symbol X509_free, version OPENSSL_1.0.0 not defined in file libcrypto.so.1.0.0 with link time reference`. How can I solve this issue??


Test automation tools for desktop application

Is there any GUI / functionality test automation tools for testing QT3 based GUI applications? I went through LDTP, dogtail, Squish, and Sikuli but all dependent on specific QT versions. Also, Sikuli is not reliable. Any others?


What's the right way to shutdown Arch Linux through dbus interface?

I'm running `openbox` with Arch Linux, and looks like the old console kit interface has been long gone,               %> dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop     Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ConsoleKit was not provided by any .service files      So what's the interface to use now?


On CentOS, when I try to use `yum`, I keep getting:                   Loaded plugins: fastestmirror, priorities     Could not create lock at /var/run/yum.pid: [Errno 28] No space left on device: '/var/run/yum.pid'      Another app is currently holding the yum lock; waiting for it to exit...       The other application is: yum         Memory :  19 M RSS (301 MB VSZ)         Started: Tue Aug 27 14:27:41 2013 - 00:00 ago         State  : Running, pid: 21381     Another app is currently holding the yum lock; waiting for it to exit...       The other application is: yum         Memory :  19 M RSS (301 MB VSZ)         Started: Tue Aug 27 14:27:41 2013 - 00:02 ago         State  : Running, pid: 21381     Another app is currently holding the yum lock; waiting for it to exit...       The other application is: yum         Memory :  19 M RSS (301 MB VSZ)         Started: Tue Aug 27 14:27:41 2013 - 00:04 ago         State  : Running, pid: 21381     Another app is currently holding the yum lock; waiting for it to exit...       The other application is: yum         Memory :  19 M RSS (301 MB VSZ)         Started: Tue Aug 27 14:27:41 2013 - 00:06 ago         State  : Running, pid: 21381      My disk space is definitely more than enough. The `/var/run/yum.pid` file is also missing. How can I fix `yum`?


Why do Linux and OSX require no driver to connect to an Android device?

I asked the dual question at superuser and didn't really get an answer - thought I might have better luck here. I've started down the path of tinkering with my Android phones. What's curious to me is that during the bootloader unlocking process if you're on Windows you are required to download and install drivers while on OS X or Linux drivers are not required. This is true for my Evo 4G, Evo 3D, and most recently the Galaxy Nexus. Why do *nix based systems not require drivers?


Can you have multiple lost and found directories?

I was unaware of the `mklost+found` command until I read this question. The `mklost+found` command will make a new lost+found directory in the pwd.   1. Why would you ever need to run this command? The lost+found directory already exists in / on every distro I've checked.    2. What would happen if you have multiple lost and found directories? Would recovered data fragments go to the lost+found dir in / , or would it go to the most recently created lost+found dir?  I'm not sure how I could deliberately create a data fragment to test this.


debian lenny ftp not working?

I've installed ftp in my debian lenny virtual server with apt-get install ftp and it uses the archive ftp_0.17-18_amd64.deb. But when I type ftp command into my shell there isn't any response? When I want to connect to a ftp site it's not working? I get not any response? ftp --help gives me this:               Aufruf: ftp [ignorierete Kommandozeilenargumente]     oder:  ftp OPTION      Exit with a status code indicating failure.            --help     diese Hilfe anzeigen und beenden       --version  Versionsinformation anzeigen und beenden          BEMERKUNG: Ihre Shell hat möglicherweise eine eigene Version von false,      welche normalerweise die hier beschriebene Version ersetzt. Bitte greifen Sie     auf die Dokumentation der Shell zurück, um die dort unterstützten Optionen     in Erfahrung zu bringen.          Melden Sie Übersetzungsfehler an      <translation-team-de@lists.sourceforge.net>, Programmfehler dagegen (auf      Englisch, mit LC_ALL=C) an <bug-coreutils@gnu.org>.


Does alsa depend on the kernel version?

Lately I had nothing but trouble with my sound setup. The full chain looks like this:               alsa (pulse plugin)-> pulseaudio (jack plugin) -> jackd -> firewire soundcard      This works fine, except for flash in firefox and Chrome. I have reason to believe that the tail end of the chain is okay, because every other source of audio, using pulse or jackd directly works fine. On the front end I made some experiments, like connecting alsa directly to jackd, but this also causes trouble with flashplayer: playback stops after like 20 seconds and firefox freezes. This made me believe that there is something wrong with the alsa stuff. Now I do have a custom kernel (3.8.2) but the rest of the system uses regular debian "stable" stuff. Can it be that the kernel is "too new" for the alsa libs?


Arch Linux: I get 500 error when trying to open PHP file

I get the `HTTP Error 500 (Internal Server Error)` error with Chrome when trying to open a simple PHP file. I have installed Apache and PHP correctly as instructed in this article. Including the PHP specific part of it. I get this error when I try going to the URL `http://localhost/~eduan/php_info.php`, I made sure and this file has correct syntax and everything, here's it's contents:               <?php     php_info();     ?>      It contains nothing else and nothing less. I also have a test install of Statamic under `http://localhost/~eduan/statamic`, and that works and doesn't. It loads correctly, but all the styles and stuff of it is missing, meaning (from what I understand) that it couldn't load the theme which is done with PHP if I'm not mistaken. That's all, any help is greatly appreciated!


OpenVPN: Push a route to client with a different gateway

I would like my OpenVPN server to push a route down to the client with a different default gateway. Specifically, my OpenVPN server has an internal IP address of `10.0.0.1`, and I would like it to push a route of `10.10.10.1/24` using gateway `10.0.0.2`. Is it possible to do this by specifying a push route in the server config file?


Trying to record a screencast using ffmpeg but my mouse pointer is invisible

I'm trying to record a screencast using ffmpeg but my mouse pointer is invisible. What am I doing wrong? This is the command:               ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1024x768 -i :0.0 -acodec pcm_s16le \         -vcodec libx264 -preset ultrafast -crf 0 -threads 0 output.mkv


How do I get current keyboard layout?

I'm wondering is there any command line tool, that returns current keyboard layout. I have `XkbLayout` set to `us, ru`. **Update:** `setxkbmap` returns layout settings, not selected layout. E.g.:               $ setxkbmap -print | grep xkb_symbols     xkb_symbols   { include "pc+us+ru:2+inet(evdev)+capslock(grouplock)+terminate(ctrl_alt_bksp)"   };      It will return same result no matter what current layout is.


Detect if mouse button is pressed, then invoke a script or command

Is there any way to get mouse button state from bash? Xdotool can only get mouse location. I'd like to set something up where I can define a rule where when a mouse button is pressed, a script can get executed.


Shell script doesn't paint last line of stdout to screen without user input

I have a shell script that's happily doing all my backup process and writing progress to stderr and stdout, with one exception — the last line doesn't get written to my terminal (if I call the script manually) until I hit `Enter`. Now this isn't a big deal, but it's really irritating me that it's not doing it, so I'd like to understand why it's behaving that way. What gets written to the output (after I hit `Enter`) reads:               [blackero@XXXXXXXXXXXXXXXX ~]$ fullbackup.sh     Tue Feb 28 17:57:41 GMT 2012     Tue Feb 28 17:57:41 GMT 2012     Starting SITE_NAME backup     maintenance_mode was set to 1.                                                    [success]     /home/blackero/bin/fullbackup.sh: line 36: hash: lzma: not found     maintenance_mode was set to 0.                                                    [success]          Backup for SITE_NAME created               [blackero@XXXXXXXXXXXXXXXX ~]$      The relevant parts of the script read as follows (with `↪` indicating I've wordwrapped the code for legibility):               #!/bin/bash     date     date 2>&1          # [A bunch of content has been deleted from here]          # Compress with lzma if available, otherwise use gzip     if hash lzma; then       lzma -c ${backup_dest}/${dbname} >${backup_dest}/${dbname}.lzma       ↪  && rm ${backup_dest}/${dbname}     else       gzip -c ${backup_dest}/${dbname} >${backup_dest}/${dbname}.gz       ↪  && rm ${backup_dest}/${dbname}     fi          # Disable maintenance mode.     drush -r ${drupal_root} vset --always-set maintenance_mode 0          # Remove old backups >30 days     find ${backup_dest} -mtime +30 -exec rm {} \; >> /dev/null 2>&1          echo "Backup for ${sitename} created"     echo     echo 2>&1      So, you can see the `if hash lzma; then` line that's causing the `hash: lzma: not found` line to stderr (it'd be nice if I could suppress this message, so it doesn't write that warning, but I can live with it). You can see that `drush` is writing the `maintenance_mode was set to 0.` line to stdout. But the line `Backup for SITE_NAME created` only appears once I hit `Enter`. Is that because the previous command is redirecting stdout to `/dev/null`? Do I need to undo that redirect somehow? (I thought stream redirection only affected the single command atomically.) (Caveats: Fwiw, when this script is run from cron, with stdout and stderr redirected to append to logfiles, everything gets written to the logfiles quite happily, with no terminal input required. The script is originally from Drupal's Administration Guide: `fullsitebackup_drush`; I've edited it a fair amount, but the `lzma` or `gzip` code is from there.)


Accidental `nano SomeFile | uniq` renders the shell unresponsive

In my attempt to get unique entries (read lines) out of a simple text file, I accidentally executed `nano SomeTextFile | uniq`. This "instruction" renders the shell (bash) completely (?) unresponsive/non- usable -- tested within from Yakuake and Konsole. I had to retrieve the _process id_ (PID) (by executing `ps aux | grep nano`) and manually `sudo kill -9` the PID in question. Anyhow, couldn't (or shouldn't?) the above return some error message? Why doesn't `Ctrl`+`C` kill this pipeline? Is there an easier or cleaner way to stop it than `kill -9`?


I am using `&`: why isn't the process running in the background?

I know that I can append `&` to a command to run the process in the background. I'm SSH'ing into an Ubuntu 12.04 box and running a python program with `$python program.py &` -- but when I go to close the terminal window I get a message saying that closing the terminal will kill the running process. Why is this? I am using the ampersand to run the process in the background. How can I get it to run regardless of if I am SSH'ed in?


nscd uses 100% cpu

I'm working on a linux box and the output of `top` reveals that the command `nscd` (user `nscd`) is using 100% of CPU. I'm uploading a flat file to MySQL from this box, and it is taking a long time (albeit it is a very large file)... I am curious whether `nscd` could be slowing it down by hogging all the CPU. That said, I'm puzzled as to why anything could be working with a process taking 100% of CPU... because, after all, I am running bash scripts, perl scripts, and bash commands fine notwithstanding. Is this a known problem with `nscd`? Is it actually hogging 100% of `CPU` as top reports?


How to detect and remove a Linux trojan?

I recently (re)stumbled upon this:   * Linux Trojan Goes Unnoticed For Almost A Year (Unreal IRCd) Yes, I know that adding some random PPA/software from an untrusted source is asking for trouble (or worse). I never do that, but many do (many Linux blogs and tabloids promote adding PPAs for fancy apps, without warning that it may break your system or worse still, compromise your security.) **How can a trojan horse or a rogue application/script be detected and removed?**


How does partprobe work?

I was looking for a way to refresh the scsi bus (or any other bus, for that matter) that would allow my kernel ( 2.6.18-194-el5 on CentOS 5.5) to know about the partitions on a drive, and I couldn't find a way. partprobe did it instantly. How? Since it's important, here's what I was doing: I wanted to get some practice in partition-specific things like resizing, backing up the MBR and restoring it, and so on. I had created a 20GB partition on /dev/sdb, backed up the MBR: > dd if=/dev/sdb of=sdb.mbr bs=512 count=1 then I went into fdisk, deleted the partition, wrote it, and exited. > ls /dev/sdb* showed that there was no partition, and > fdisk -l /dev/sdb' matched, so I figured I was good. I then reversed the dd: > dd if=sdb.mbr of=/dev/sdb bs=512 count=1 Of course, I didn't do anything at that point, so > ls /dev/sdb* didn't list any partitions, but > fdisk -l showed the partition, presumably because it reads the first 512 bytes on the disk and doesn't rely on the kernel. I knew that I'd have to refresh the bus, so I went into into /sys/class/scsi_host/host1, and did > echo "- - -" > scan and doing > ls /dev/sdb didn't show anything new, so then I went to /sys/bus/scsi/devices and for each of the listed devices, I did > echo 1 > rescan and that didn't work. I then did more research on the problem, and came across 'partprobe', which comes with parted. I ran it, and it worked instantly. If I don't get a likely answer here, I'm probably going to just go get the source and look it up, but I figure there are wizards here beyond me, so I thought I'd appeal to you all.


Cannot change global keyboard shortcuts in Linux Mint XFCE

I am using Linux Mint 14 XFCE. I am trying to remove the default XFCE window manager shortcuts for workspace switching (Ctrl-F1, Ctrl-F2, etc.), as described in this question. The answers there don't have any effect for me. If I go into Settings->Window Manger->Keyboard, nothing I do has any effect. If I click on a setting and hit "Clear", the setting stays there unchanged. If I double-click on a setting and choose a new shortcut key, the original settings stays there unchanged. If I go into Settings Editor (as described in the other answer to that question) and attempt to reset the settings there, nothing has any effect still. What is going on? How can I get XFCE to let me change the keyboard shortcut settings?


How to set up control for case fans in Debian Wheezy?

We'll for some days now I've been trying to get the fancontrol for my Debian Wheezy up and running. Actually (after some problems with pwmconfig not accepting my chipset, which is a AMD 770 one) now at least CPU and GFC-card fans are being controlled by fancontrol. But, this being already a very nice success, I was wondering how to control (specifically, lower) the speed (and the volume therefore) of my case fans? I've to admit I have absolutely no clue where to begin? (I only know that it should be possible somehow, because Ubuntu 12.04 did it.. but I am currently all in favor of Debian, so it would be quite nice to have this ability there as well.) So, I would really appreciate any kind of help with this issue. Here's some basic information about my system:               CPU: AMD Athlon64 5050e     GFX: MSI NX7800GT (nV 7800GT Chipset)     MB: Biostar TA770 A2+ (Chipset AMD 770)      Please let me know, if you need any further information.


How to integrate a multiline awk script in a shell script

I am a beginner in shell scripting and my question is a continuation of How to parse a file to extract 3 digits numbers kept in a "group number" I am trying to integrate in a single shell script a series of commands that   1. parse a european standard to extract a test sequence   2. convert the text encodings to utf8   3. process the result with the the awk routine that was provided to me on the post above.   4. save the content in a destination file I have tentatively written the script below. I am able to achieve only `step 1` and `step 4`, but neither `step 2` nor `step 3`. I wonder if intermediate (temporary) file(s) should be created. I have tried to store the output of intermediate steps into variables, but without success. Any help also would be helpul regarding possible mistakes and the best way to do this.               #!/bin/bash     # creating the Latex code for a test procedure          awkcommand= "/usr/bin/awk      '         $1 == "Group" {printf("\\section{%s %d}\n", $1, $2); next}         {           title = sep = ""           for (i=1; i<=NF; i++)              if ($i ~ /^[0-9][0-9][0-9]$/) {               printf("\\subsection{%s} \n\\TestDetails{%d}\n", title, $i)               break             }             else {               title = title sep $i               sep = FS             }         }     '      "          sourcefolder="/Users/yves/Desktop/Test-folder-parsing/"     sourcefile="NFEN3545-001.pdf"     destfile="Latex-code.tex"     destfolder=$sourcefolder     destinationfilepath=${destfolder}${destfile}     extractioncmd="/usr/local/bin/pdftotext -layout -f 54 -l 54"     modifier=" -"     #textencodingcmd="/usr/bin/iconv -f L1 -t UTF-8" # Needed but not used          ${extractioncmd}  ${sourcefolder}${sourcefile} ${modifier}  >  $destinationfilepath     exit 0


How does 'screen' impact environment variables?

I noticed a difference in 'env' before and after a 'screen' call, is there any additional clarity on what gets called (for setting environment variables)? I couldn't see any clear explanation from a quick search on 'man screen' Some googled queries on the topic: http://alan.lamielle.net/2009/03/09/environment-variables-and-gnu-screen http://superuser.com/questions/105954/updating-screen-session-environment- variables-to-reflect-new-graphical-login I guess a more specific sub-question would be, what is not instantiated in a screen session vs. that of a normal log-in?


Merging multiple lines selectively?

I have a large file in which a header line is followed by a string of characters at multiple times. eg: `file1`               VHBFBJBDSBVVFJBSV     SVJBVHJBVJ     SVKJBVJBNVKVJV      `file2`               dfhgdgffdghgg     SVKJBVJBNVKVJV      I want to keep the header file same, but merge all characters from line 2 onwards into a single line. can anyone suggest something?


In OSX ssh-keygen creates a key but then the session won't connect

I made a key, but it logs me back out as i try to setup passphraseless logins to localhost:               $ rsa-keygen -t rsa     $ cat id_rsa.pub > authorized_keys     $ ssh localhost          The authenticity of host 'localhost (::1)' can't be established.     RSA key fingerprint is bb:a6:5e:46:c9:b5:e9:46:bd:43:c1:6e:cd:3b:e5:ea.     Are you sure you want to continue connecting (yes/no)? yes     Warning: Permanently added 'localhost' (RSA) to the list of known hosts.     Connection closed by ::1      The same thing happens when I try to login with using the hostname as well. What am I missing?


Why does xargs cause apt-get to abort?

I'm trying to remove a list of packages from a file. I'm using the following command:               cat packages | xargs sudo apt-get remove      `packages` is my file containing a list of packages I want to remove. Everything appears to work, but `apt-get` aborts instead of letting me choose yes or no. I know I can get around this with the `-y` option, but I would like to know why this is happening and how can I keep the interactive choice.


Microsoft LifeCam VX-800 stopped working on Linux Mint

My Microsoft Lifecam VX-800 stopped working without any plausible reason. `lsusb` identifies the camera with the name "Z-Star Microelectronics Corp. Venus USB2.0 Camera". Another unusual thing is that the camera's green light is always turned on (this didn't happen when it was still working). I didn't install any new software, update anything, or change any OS configurations. What could have broken things?


Centos CMake Does Not Install Using gcc 4.7.2

A similar problem has been reported here with no solution:https://www.centos.org/modules/newbb/print.php?form=1&topic_id=42696&forum=56&order=ASC&start=0 I've added and upgraded gcc to centos               cd /etc/yum.repos.d     wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo      yum --enablerepo=testing-1.1-devtools-6 install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++     scl enable devtoolset-1.1 bash      The result is this for my gcc               [root@hhvm-build-centos cmake-2.8.11.1]# gcc -v     Using built-in specs.     COLLECT_GCC=gcc     COLLECT_LTO_WRAPPER=/opt/centos/devtoolset-1.1/root/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/lto-wrapper     Target: x86_64-redhat-linux     Configured with: ../configure --prefix=/opt/centos/devtoolset-1.1/root/usr --mandir=/opt/centos/devtoolset-1.1/root/usr/share/man --infodir=/opt/centos/devtoolset-1.1/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,fortran,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-ppl --with-cloog --with-mpc=/home/centos/rpm/BUILD/gcc-4.7.2-20121015/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux     Thread model: posix     gcc version 4.7.2 20121015 (Red Hat 4.7.2-5) (GCC)       And I tried to then install cmake through http://www.cmake.org/cmake/resources/software.html#latest But I keep running into this error:               Linking CXX executable ../bin/ccmake     /opt/centos/devtoolset-1.1/root/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/ld: CMakeFiles/ccmake.dir/CursesDialog/cmCursesMainForm.cxx.o: undefined reference to symbol 'keypad'     /opt/centos/devtoolset-1.1/root/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/ld: note: 'keypad' is defined in DSO /lib64/libtinfo.so.5 so try adding it to the linker command line     /lib64/libtinfo.so.5: could not read symbols: Invalid operation     collect2: error: ld returned 1 exit status     gmake[2]: *** [bin/ccmake] Error 1     gmake[1]: *** [Source/CMakeFiles/ccmake.dir/all] Error 2     gmake: *** [all] Error 2      The problem seems to come from the new gcc installed because it works with the default install. Is there a solution to this problem?


compiling ldc2 on a centOS 5 system with no root access

I git-cloned the latest version of ldc2, but I don't know how to compile it on my centOS 5 machine:               git clone --recursive git://github.com/ldc-developers/ldc     cd ldc     git submodule update --init      `cmake` doesn't seem to do much. Neither does `cmake Unix Makefiles` Any ideas? There is no INSTALL file and the README file doesn't mention any installation instructions.


Cannot delete broken symbolic link

I have a symbolic link formerly pointing to a Dropbox directory. I don't know what I did wrong, but apparently now it points to itself.               hyper@mypi:/home/hyper/test$ ls -l     total 1024     lrwxrwxrwx 1 hyper hyper 7 Feb 15  2013 Dropbox -> Dropbox      When I try to remove the link I get:               hyper@mypi:/home/hyper/test$ rm Dropbox     rm: cannot remove ‘Dropbox’: Not a directory      What else can I try to get rid of this link? Part of the Output of strace rm Dropbox:               close(3)                                = 0     ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0     newfstatat(AT_FDCWD, "Dropbox", {st_mode=S_IFLNK|0777, st_size=7, ...}, AT_SYMLINK_NOFOLLOW) = 0     geteuid()                               = 1000     newfstatat(AT_FDCWD, "Dropbox", {st_mode=S_IFLNK|0777, st_size=7, ...}, AT_SYMLINK_NOFOLLOW) = 0     unlinkat(AT_FDCWD, "Dropbox", 0)        = -1 ENOTDIR (Not a directory)     open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=2570, ...}) = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7ce00fc000     read(3, "# Locale name alias data base.\n#"..., 4096) = 2570     read(3, "", 4096)                       = 0     close(3)                                = 0     munmap(0x7f7ce00fc000, 4096)            = 0     open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale-langpack/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale-langpack/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=619, ...}) = 0     mmap(NULL, 619, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7ce00fc000     close(3)                                = 0     open("/usr/lib/charset.alias", O_RDONLY|O_NOFOLLOW) = -1 ENOENT (No such file or directory)     write(2, "rm: ", 4rm: )                     = 4     write(2, "cannot remove \342\200\230Dropbox\342\200\231", 27cannot remove ‘Dropbox’) = 27     open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     open("/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)     write(2, ": Not a directory", 17: Not a directory)       = 17     write(2, "\n", 1     )                       = 1     lseek(0, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)     close(0)                                = 0     close(1)                                = 0     close(2)                                = 0     exit_group(1)                           = ?     +++ exited with 1 +++


Using tcpdump to extract NFS RPC contents

Fairly simple question... I'm running tcpdump and trying to analyze the contents of the TCP packets between server/client. I see the "GETATTR" RPC being received, which is great! However, I want to know the file for which the RPC is being made. I'm assuming this is in the packet content. When I print the tcpdump as ASCII.               From server:     tcpdump -vvv -s 200 port 2049      14:45:38.408949 IP (tos 0x0, ttl 64, id 58408, offset 0, flags [DF], proto TCP (6), length 296)     myserver.nfs > myclient.2469839164: reply ok 240 getattr NON 3 ids 0/3 sz 0      Here and other sites show that it is possible to map to filenames. Maybe it's platform dependent? I just want to make sure there isn't an obvious option to tcpdump that I am missing. I'm running RH5 - Kernel 2.6.32-279.el6.x86_64


A question about wlan0 / eth0 and wireshark

I'm using wireshark to listen to packets on my own personal home network. I have my Desktop with Debian and Windows 7 running and my laptop is running the same setup; Debian and Windows 7. I installed wireshark on both. When on my laptop, I can listen to packets on wlan0. When I browse the web, the packets are captured and all is good. When on my desktop, I can listen to packets on eth0. When I browse the web and etc, the packets are captured and all is good. However, when on my laptop (wlan0) and want to listen to packets coming in/out on eth0 - which my desktop computer is on, I obviously get no results. ### To the Question: If I want to use my laptop and monitor the packets coming in and out from my desktop or just simply on both wlan0 and eth0, how could I do this? This is what it all looks like. As you can see, there is no IP address at eth0. (This is from my laptop, where wlan0 has an IP address). ![enter image description here](http://i.stack.imgur.com/KYeA3.png) and here is another perspective ![enter image description here](http://i.stack.imgur.com/AJ51b.png) I know it's a small image but if you look closely, under eth0 there is no ip address.. but just below that, wlan0, has a bunch of information there and an ip address.


Does -q definitely turn off wget output logging?

I currently have a shell script running on a linux server which is using wget in oder to download a remote web page. This in turn is executed by a cron job which is scheduled to run at certain times. Can someone please confirm that adding in the `-q` option will not only stop all output being returned to the console, but will also stop all attempts by wget to write to the logs or to try and create a log file?


Does this threat still exist: Linux keylogger without root privileges

http://superuser.com/questions/301646/linux-keylogger-without-root-or-sudo-is- it-real Or it's long gone as most of the new distros implement SELinux by default


Emacs subshell (M-x shell) not autocompleting shell aliases

I have aliases defined on my `.zshrc` file that I commonly use when I am on a `gnome-terminal`. However, when I am on `M-x shell` on Emacs, the autocompletion does not find them (even though they still work). Is this a limitation of the Emacs subshell? Are there any known workarounds to this problem?


How to compile and install iperf on a MIPS based router?

I have a DIR-825 router based on Atheros AR7161 (MIPS) running DD-WRT v24-sp2 std. How can I compile and install iperf on it? Can I compile it directly on the target device, or do I have to cross compile it and then transfer the binary to the target device? Is this possible, and where do I begin? What kind of tools do I need? What's involved in doing something like this? _Side note: I have limited knowledge of Linux, so please provide as thorough answer as possible, and not just some external links. If you do post a link, make sure it links to some article or a blog post that thoroughly explains the process._


How do I use ctags functionality in vim with cscope installed?

When I install `cscope` by adding the line `Bundle 'chazy/cscope_maps` to my `.vimrc` file, my tags menu (`g+[`) is replaced with a cscope list, which seems to contain a list of files where the tag is _called_ , not where it is _declared_. I would like to be able to use cscope using `CTRL\\+s` to get a list of locations where the tag is referenced, and then use `g+[` to get locations where the object is declared. Can I do this? I'm not fussed whether I'm using `cscope` or `ctags` to get the token declarations.


What does it mean to redirect /dev/console through a non-existent file?

I have been trying to follow the "NAND firmware update" tutorial and I am perplexed by these last lines: > now, in second stage, all processes are gone, only /dev/console in old root > is still open and connected to our stdin/stdout/stderr. This blocks un- > mounting our old root. To close it, start third stage script to redirect > console to new rootfs /dev/console (use exec to replace current process): > > exec /bin/sh /bin/update-firmware3 /dev/console 2>&1 but /bin/update-firmware3 isn't mentioned previously. What is the `exec /bin/sh /bin/update-firmware3 </dev/console >/dev/console 2>&1` code trying to accomplish? and what is '/bin/update-firmware3'?


How to recover a corrupted "tar.gz" file

I suddenly needed to recover an old `tar.gz` file, but as soon as I execute so:               tar -zxvf filename.tar.gz      I get this:               gzip: stdin: invalid compressed data--format violated       tar: Child returned status 1       tar: Error is not recoverable: exiting now


How to fix Russian letters in a Wine application when adjusting LANG does not help?

An application with a Russian UI shows question marks instead the most of its text (some elements are rendered ok though). The system locale is English (en_US, en_IE), I've tried Ubuntu ant XUbuntu 12.04 with Wine 1.5. I've tried launching the application with               LANG=ru_RU.utf8 wine myapp.exe      but it doesn't help. I have also checked that `ttf-mscorefonts-installer` is installed. If I use Windows, setting Russian codepage for non-unicode apps in the Control Panel solves the problem. Any ideas?


Awk : Range of PIDs

I am learning `awk` from this tutorial. It's quite basic. I have a list of processes in a file which I got by doing `ps aux > processes` Now according to the tutorial, doing `awk '$2 ~ 14022, $2 ~ 14040'` should give a range of processes with PID ranging from 14022 to 14040. I tried the same with PID range 1746 - 1760. But it outputs the processes which have PID above 1760. Output               $ awk '$2 ~ 1746, $2 ~ 1760 {print $1, $2, $11}' processes      root 1746 sudo     root 1750 wvdial     root 1751 /usr/sbin/pppd     dharmit 1772 /opt/google/chrome/chrome     dharmit 1788 /opt/google/chrome/chrome     dharmit 1790 /opt/google/chrome/chrome     root 1791 /sbin/udevd     dharmit 1827 /opt/google/chrome/chrome     dharmit 1830 /opt/google/chrome/chrome     dharmit 1846 /opt/google/chrome/chrome     dharmit 1850 gnome-terminal     dharmit 1856 gnome-pty-helper     dharmit 1857 bash     root 1902 [kworker/0:4]     dharmit 1940 /opt/google/chrome/chrome     root 1952 [kworker/1:0]     root 2104 /usr/sbin/anacron     root 2181 /usr/libexec/packagekitd     dharmit 2183 ps      Why does it happen so? What am I missing here?


Any reason for encrypted /?

I am a big fan of linux and like trying out new distros now and then. I usually have my home folders and roots in a lvm atop an encrypted partition, but this tends to become cumbersome with every initramfs creation process being more alien than the last one. I value privacy, but most of my valuable information or personal is stored in the home folders. Moreover, I partitioned using GPT, so multiple partitions are not that hard to setup even outside a lvm. So the question is: Is root crypting and lvm-ing of "/" worth it, especially with all the early userspace hassle I have to deal with?


help needed to decipher this Acer Aspire 4830TG ACPI code for Nvidia Optimus

I am trying to make sense of the following NVOP Method from the ACPI tables for an Acer Aspire 4830TG with an Nvidia Optimus hybrid graphics system. The NVOP method on top defines a bunch of instructions that can be used later on in the _DSM method. Which method should I call with the acpi_call module or the byo-switcheroo module to switch on/off the card on demand? See the code below:               Method (NVOP, 4, Serialized)     {         Name (_T_0, Zero)         Store ("------- NV OPTIMUS DSM --------", Debug)         If (LNotEqual (Arg1, 0x0100))         {             Return (0x80000001)         }              While (One)         {             Store (ToInteger (Arg2), _T_0)             If (LEqual (_T_0, Zero))             {                 Store (Buffer (0x04)                     {                         0x61, 0x00, 0x01, 0x0C                     }, Local0)                 Return (Local0)             }             Else             {                 If (LEqual (_T_0, 0x05))                 {                     Name (TMP5, Buffer (0x04)                     {                         0x00, 0x00, 0x00, 0x00                     })                     CreateField (TMP5, Zero, 0x04, DAVF)                     CreateField (TMP5, 0x04, One, LIDF)                     CreateField (TMP5, 0x08, 0x06, TOGN)                     CreateField (Arg3, 0x1F, One, NCSM)                     CreateField (Arg3, 0x19, 0x05, NCSN)                     CreateField (Arg3, 0x18, One, DIMK)                     CreateField (Arg3, 0x0C, 0x0C, ACTD)                     CreateField (Arg3, Zero, 0x0C, ATTD)                     If (ToInteger (NCSM))                     {                         Store (ToInteger (NCSN), TOGN)                     }                     Else                     {                         If (ToInteger (DIMK))                         {                             GETD (ToInteger (ATTD), ToInteger (ACTD))                             Store (\_SB.PCI0.PEG0.PEGP.NTOI, TOGN)                             Store (One, DAVF)                         }                     }                          Return (TMP5)                 }                 Else                 {                     If (LEqual (_T_0, 0x06))                     {                         Name (TMP6, Package (0x0F)                         {                             Ones,                              0x2C,                              Ones,                              0x2C,                              Ones,                              0x2C,                              Ones,                              Ones,                              0x2C,                              Ones,                              Ones,                              0x2C,                              Ones,                              Ones,                              0x2C                         })                         Store (\_SB.PCI0.GFX0.IDI2, Index (TMP6, Zero))                         Store (\_SB.PCI0.GFX0.IDI1, Index (TMP6, 0x02))                         Store (\_SB.PCI0.GFX0.IDI4, Index (TMP6, 0x04))                         Store (\_SB.PCI0.GFX0.IDI2, Index (TMP6, 0x06))                         Store (\_SB.PCI0.GFX0.IDI1, Index (TMP6, 0x07))                         Store (\_SB.PCI0.GFX0.IDI2, Index (TMP6, 0x09))                         Store (\_SB.PCI0.GFX0.IDI4, Index (TMP6, 0x0A))                         Store (\_SB.PCI0.GFX0.IDI1, Index (TMP6, 0x0C))                         Store (\_SB.PCI0.GFX0.IDI4, Index (TMP6, 0x0D))                         Return (TMP6)                     }                     Else                     {                         If (LEqual (_T_0, 0x10))                         {                             Return (\_SB.PCI0.PEG0.PEGP.GOBT (Arg3))                         }                         Else                         {                             If (LEqual (_T_0, 0x1A))                             {                                 CreateField (Arg3, 0x18, 0x02, OPCE)                                 CreateField (Arg3, Zero, One, FLCH)                                 If (ToInteger (FLCH))                                 {                                     Store (ToInteger (OPCE), OMPR)                                 }                                      Name (RBUF, Buffer (0x04)                                 {                                     0x00, 0x00, 0x00, 0x00                                 })                                 CreateField (RBUF, Zero, One, OPEN)                                 CreateField (RBUF, 0x03, 0x02, CGCS)                                 CreateField (RBUF, 0x06, One, SHPC)                                 CreateField (RBUF, 0x18, 0x03, DGPC)                                 CreateField (RBUF, 0x1B, 0x02, HDAC)                                 Store (One, OPEN)                                 Store (One, SHPC)                                 Store (0x02, HDAC)                                 Store (One, DGPC)                                 If (\_SB.PCI0.PEG0.PEGP.GSTA ())                                 {                                     Store (0x03, CGCS)                                 }                                 Else                                 {                                     Store (Zero, CGCS)                                 }                                      Return (RBUF)                             }                             Else                             {                                 If (LEqual (_T_0, 0x1B))                                 {                                     Store (Arg3, Local0)                                     CreateField (Local0, Zero, One, OPFL)                                     CreateField (Local0, One, One, OPVL)                                     If (ToInteger (OPVL))                                     {                                         Store (Zero, OPTF)                                         If (ToInteger (OPFL))                                         {                                             Store (One, OPTF)                                         }                                     }                                          Store (OPTF, Local0)                                     Return (Local0)                                 }                                 Else                                 {                                     Return (0x80000002)                                 }                             }                         }                     }                 }             }                  Break         }     }          Method (GOBT, 1, NotSerialized)     {         Name (OPVK, Buffer (0xE2)         {             /* 0000 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0008 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0010 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0018 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0020 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0028 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0030 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0038 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0040 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0048 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0050 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0058 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0060 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0068 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0070 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0078 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0080 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0088 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0090 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 0098 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00A0 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00A8 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00B0 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00B8 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00C0 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00C8 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00D0 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00D8 */    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* 00E0 */    0x00, 0x00         })         CreateWordField (Arg0, 0x02, USRG)         If (LEqual (USRG, 0x564B))         {             Return (OPVK)         }              Return (Zero)     }          Method (_INI, 0, NotSerialized)     {         Store (Zero, \_SB.PCI0.PEG0.PEGP._ADR)     }          Method (GSTA, 0, Serialized)     {         If (LEqual (\_SB.PCI0.PEG0.PEGP.PI17, One))         {             Return (One)         }         Else         {             Return (Zero)         }     }          Method (_ON, 0, Serialized)     {         \_SB.PCI0.PEG0.PEGP.PWRE ()         Store (Zero, LNKD)         While (LLess (LNKS, 0x07))         {             Sleep (One)         }              Store (Zero, CMDR)         Store (VGAB, VGAR)         Store (0x06, CMDR)     }          Method (_OFF, 0, Serialized)     {         Store (VGAR, VGAB)         Store (One, LNKD)         While (LNotEqual (LNKS, Zero))         {             Sleep (One)         }              \_SB.PCI0.PEG0.PEGP.PWRD ()     }          Method (_PS0, 0, NotSerialized)     {         If (DGOS)         {             GLSC ()             \_SB.PCI0.PEG0.PEGP._ON ()             GLSR ()             Store (Zero, DGOS)             Store (Zero, MLTF)             Store (Zero, \_SB.PCI0.LPCB.EC0.DSPM)         }     }          Method (_PS3, 0, NotSerialized)     {         If (LEqual (\_SB.PCI0.PEG0.PEGP.OMPR, 0x03))         {             GLSC ()             \_SB.PCI0.PEG0.PEGP._OFF ()             GLSR ()             Store (One, DGOS)             Store (0x02, \_SB.PCI0.PEG0.PEGP.OMPR)             Store (One, \_SB.PCI0.LPCB.EC0.DSPM)         }     }          Method (_STA, 0, Serialized)     {         Return (0x0F)     }          Method (_ROM, 2, NotSerialized)     {         Store (Arg0, Local0)         Store (Arg1, Local1)         If (LGreater (Local1, 0x1000))         {             Store (0x1000, Local1)         }              If (LGreater (Local0, 0x00010000))         {             Return (Buffer (Local1)             {                 0x00             })         }              If (LGreater (Local0, RVBS))         {             Return (Buffer (Local1)             {                 0x00             })         }              Multiply (Local1, 0x08, Local3)         Name (ROM1, Buffer (0x8000)         {             0x00         })         Name (ROM2, Buffer (Local1)         {             0x00         })         If (LLess (Local0, 0x8000))         {             Store (RBF1, ROM1)         }         Else         {             Subtract (Local0, 0x8000, Local0)             Store (RBF2, ROM1)         }              Multiply (Local0, 0x08, Local2)         CreateField (ROM1, Local2, Local3, TMPB)         Store (TMPB, ROM2)         Return (ROM2)     }          Method (MXMX, 1, Serialized)     {         If (LEqual (Arg0, One))         {             P8XH (One, 0x99, P8XH (Zero, One, Return (One), Return (Zero)))         }     }          Name (MXM3, Buffer (0x45)     {         /* 0000 */    0x4D, 0x58, 0x4D, 0x5F, 0x03, 0x00, 0x3D, 0x00,          /* 0008 */    0x30, 0x10, 0xB8, 0xFF, 0xF9, 0x3E, 0x00, 0x00,          /* 0010 */    0x00, 0x01, 0x8A, 0xFF, 0xF9, 0x3E, 0x00, 0x00,          /* 0018 */    0x60, 0x79, 0xD0, 0xFE, 0xF9, 0x3E, 0x00, 0x00,          /* 0020 */    0x20, 0x2B, 0xE2, 0xFE, 0xF9, 0x3E, 0x00, 0x00,          /* 0028 */    0x60, 0x6C, 0xEA, 0xFE, 0xF9, 0x3E, 0x00, 0x00,          /* 0030 */    0x01, 0x90, 0x01, 0x00, 0x03, 0x00, 0x90, 0x01,          /* 0038 */    0x13, 0x00, 0x90, 0x01, 0xE5, 0x0D, 0x01, 0x01,          /* 0040 */    0x01, 0x00, 0x00, 0x00, 0x96     })     Method (_DSM, 4, Serialized)     {         Name (_T_0, Zero)         If (LEqual (Arg0, Buffer (0x10)                 {                     /* 0000 */    0xF8, 0xD8, 0x86, 0xA4, 0xDA, 0x0B, 0x1B, 0x47,                      /* 0008 */    0xA7, 0x2B, 0x60, 0x42, 0xA6, 0xB5, 0xBE, 0xE0                 }))         {             Return (\_SB.PCI0.PEG0.PEGP.NVOP (Arg0, Arg1, Arg2, Arg3))         }              If (LEqual (Arg0, Buffer (0x10)                 {                     /* 0000 */    0x00, 0xA4, 0x04, 0x40, 0x7D, 0x91, 0xF2, 0x4C,                      /* 0008 */    0xB8, 0x9C, 0x79, 0xB6, 0x2F, 0xD5, 0x56, 0x65                 }))         {             While (One)             {                 Store (ToInteger (Arg2), _T_0)                 If (LEqual (_T_0, Zero))                 {                     Return (Buffer (0x04)                     {                         0x01, 0x00, 0x01, 0x01                     })                 }                 Else                 {                     If (LEqual (_T_0, 0x18))                     {                         Return (Buffer (0x04)                         {                             0x00, 0x03, 0x00, 0x00                         })                     }                     Else                     {                         If (LEqual (_T_0, 0x10))                         {                             If (LEqual (Arg1, 0x0300))                             {                                 Return (MXM3)                             }                         }                     }                 }                      Break             }                  Return (0x80000002)         }              Return (0x80000001)     }      The original ACPI tables are available here:   http://bugs.launchpad.net/lpbugreporter/+bug/752542/+attachment/2235754/+files/Aspire%204830TG.tar.gz http://github.com/mkottman/acpi_call   http://github.com/awilliam/asus-switcheroo