httpd fails to start after install

While I try to install server through `yum install httpd` in Fedora 19, enabling and starting it shows errors. I checked httpd status and it's also failed. Can some body explain what the problem is?               [root@localhost ~]# systemctl enable httpd.service     ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'           [root@localhost ~]# systemctl start httpd.service     Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.           [root@localhost ~]# systemctl status httpd.service     May 18 06:30:50 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...     May 18 06:30:50 localhost.localdomain httpd[2226]: httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /..._encode     May 18 06:30:50 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE     May 18 06:30:50 localhost.localdomain httpd[2228]: httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /..._encode     May 18 06:30:50 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1     May 18 06:30:50 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.     May 18 06:30:50 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.          [root@localhost ~]# httpd configtest     Usage: httpd [-D name] [-d directory] [-f file]                  [-C "directive"] [-c "directive"]                  [-k start|restart|graceful|graceful-stop|stop]                  [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]     Options:       -D name            : define a name for use in <IfDefine name> directives       -d directory       : specify an alternate initial ServerRoot       -f file            : specify an alternate ServerConfigFile       -C "directive"     : process directive before reading config files       -c "directive"     : process directive after reading config files       -e level           : show startup errors of level (see LogLevel)       -E file            : log startup errors to file       -v                 : show version number       -V                 : show compile settings       -h                 : list available command line options (this page)       -l                 : list compiled in modules       -L                 : list available configuration directives       -t -D DUMP_VHOSTS  : show parsed vhost settings       -t -D DUMP_RUN_CFG : show parsed run settings       -S                 : a synonym for -t -D DUMP_VHOSTS -D DUMP_RUN_CFG       -t -D DUMP_MODULES : show all loaded modules        -M                 : a synonym for -t -D DUMP_MODULES       -t                 : run syntax check for config files       -T                 : start without DocumentRoot(s) check       -X                 : debug mode (only one worker, do not detach)      My Apache config file:               #     # This is the main Apache HTTP server configuration file.  It contains the     # configuration directives that give the server its instructions.     # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.     # In particular, see      # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>     # for a discussion of each configuration directive.     #     # Do NOT simply read the instructions in here without understanding     # what they do.  They're here only as hints or reminders.  If you are unsure     # consult the online docs. You have been warned.       #     # Configuration and logfile names: If the filenames you specify for many     # of the server's control files begin with "/" (or "drive:/" for Win32), the     # server will use that explicit path.  If the filenames do *not* begin     # with "/", the value of ServerRoot is prepended -- so 'log/access_log'     # with ServerRoot set to '/www' will be interpreted by the     # server as '/www/log/access_log', where as '/log/access_log' will be     # interpreted as '/log/access_log'.          #     # ServerRoot: The top of the directory tree under which the server's     # configuration, error, and log files are kept.     #     # Do not add a slash at the end of the directory path.  If you point     # ServerRoot at a non-local disk, be sure to specify a local disk on the     # Mutex directive, if file-based mutexes are used.  If you wish to share the     # same ServerRoot for multiple httpd daemons, you will need to change at     # least PidFile.     #     ServerRoot "/etc/httpd"          #     # Listen: Allows you to bind Apache to specific IP addresses and/or     # ports, instead of the default. See also the <VirtualHost>     # directive.     #     # Change this to Listen on specific IP addresses as shown below to      # prevent Apache from glomming onto all bound IP addresses.     #     #Listen 12.34.56.78:80     Listen 80          #     # Dynamic Shared Object (DSO) Support     #     # To be able to use the functionality of a module which was built as a DSO you     # have to place corresponding `LoadModule' lines at this location so the     # directives contained in it are actually available _before_ they are used.     # Statically compiled modules (those listed by `httpd -l') do not need     # to be loaded here.     #     # Example:     # LoadModule foo_module modules/mod_foo.so     #     Include conf.modules.d/*.conf          #     # If you wish httpd to run as a different user or group, you must run     # httpd as root initially and it will switch.       #     # User/Group: The name (or #number) of the user/group to run httpd as.     # It is usually good practice to create a dedicated user and group for     # running httpd, as with most system services.     #     User apache     Group apache          # 'Main' server configuration     #     # The directives in this section set up the values used by the 'main'     # server, which responds to any requests that aren't handled by a     # <VirtualHost> definition.  These values also provide defaults for     # any <VirtualHost> containers you may define later in the file.     #     # All of these directives may appear inside <VirtualHost> containers,     # in which case these default settings will be overridden for the     # virtual host being defined.     #          #     # ServerAdmin: Your address, where problems with the server should be     # e-mailed.  This address appears on some server-generated pages, such     # as error documents.  e.g. admin@your-domain.com     #     ServerAdmin root@localhost          #     # ServerName gives the name and port that the server uses to identify itself.     # This can often be determined automatically, but we recommend you specify     # it explicitly to prevent problems during startup.     #     # If your host doesn't have a registered DNS name, enter its IP address here.     #     #ServerName www.example.com:80          #     # Deny access to the entirety of your server's filesystem. You must     # explicitly permit access to web content directories in other      # <Directory> blocks below.     #     <Directory />         AllowOverride none         Require all denied     </Directory>          #     # Note that from this point forward you must specifically allow     # particular features to be enabled - so if something's not working as     # you might expect, make sure that you have specifically enabled it     # below.     #          #     # DocumentRoot: The directory out of which you will serve your     # documents. By default, all requests are taken from this directory, but     # symbolic links and aliases may be used to point to other locations.     #     DocumentRoot "/var/www/html"          #     # Relax access to content within /var/www.     #     <Directory "/var/www">         AllowOverride None         # Allow open access:         Require all granted     </Directory>          # Further relax access to the default document root:     <Directory "/var/www/html">         #         # Possible values for the Options directive are "None", "All",         # or any combination of:         #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews         #         # Note that "MultiViews" must be named *explicitly* --- "Options All"         # doesn't give it to you.         #         # The Options directive is both complicated and important.  Please see         # htt p://ht tpd.a pache.org/docs/2.4/mod/core.html#options         # for more information.         #         Options Indexes FollowSymLinks              #         # AllowOverride controls what directives may be placed in .htaccess files.         # It can be "All", "None", or any combination of the keywords:         #   Options FileInfo AuthConfig Limit         #         AllowOverride None              #         # Controls who can get stuff from this server.         #         Require all granted     </Directory>          #     # DirectoryIndex: sets the file that Apache will serve if a directory     # is requested.     #     <IfModule dir_module>         DirectoryIndex index.html     </IfModule>          #     # The following lines prevent .htaccess and .htpasswd files from being      # viewed by Web clients.      #     <Files ".ht*">         Require all denied     </Files>          #     # ErrorLog: The location of the error log file.     # If you do not specify an ErrorLog directive within a <VirtualHost>     # container, error messages relating to that virtual host will be     # logged here.  If you *do* define an error logfile for a <VirtualHost>     # container, that host's errors will be logged there and not here.     #     ErrorLog "logs/error_log"          #     # LogLevel: Control the number of messages logged to the error_log.     # Possible values include: debug, info, notice, warn, error, crit,     # alert, emerg.     #     LogLevel warn          <IfModule log_config_module>         #         # The following directives define some format nicknames for use with         # a CustomLog directive (see below).         #         LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined         LogFormat "%h %l %u %t \"%r\" %>s %b" common              <IfModule logio_module>           # You need to enable mod_logio.c to use %I and %O           LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio         </IfModule>              #         # The location and format of the access logfile (Common Logfile Format).         # If you do not define any access logfiles within a <VirtualHost>         # container, they will be logged here.  Contrariwise, if you *do*         # define per-<VirtualHost> access logfiles, transactions will be         # logged therein and *not* in this file.         #         #CustomLog "logs/access_log" common              #         # If you prefer a logfile with access, agent, and referer information         # (Combined Logfile Format) you can use the following directive.         #         CustomLog "logs/access_log" combined     </IfModule>          <IfModule alias_module>         #         # Redirect: Allows you to tell clients about documents that used to          # exist in your server's namespace, but do not anymore. The client          # will make a new request for the document at its new location.         # Example:         # Redirect permanent /foo ht t p://www.example.com/bar              #         # Alias: Maps web paths into filesystem paths and is used to         # access content that does not live under the DocumentRoot.         # Example:         # Alias /webpath /full/filesystem/path         #         # If you include a trailing / on /webpath then the server will         # require it to be present in the URL.  You will also likely         # need to provide a <Directory> section to allow access to         # the filesystem path.              #         # ScriptAlias: This controls which directories contain server scripts.          # ScriptAliases are essentially the same as Aliases, except that         # documents in the target directory are treated as applications and         # run by the server when requested rather than as documents sent to the         # client.  The same rules about trailing "/" apply to ScriptAlias         # directives as to Alias.         #         ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"          </IfModule>          #     # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased     # CGI directory exists, if you have that configured.     #     <Directory "/var/www/cgi-bin">         AllowOverride None         Options None         Require all granted     </Directory>          <IfModule mime_module>         #         # TypesConfig points to the file containing the list of mappings from         # filename extension to MIME-type.         #         TypesConfig /etc/mime.types              #         # AddType allows you to add to or override the MIME configuration         # file specified in TypesConfig for specific file types.         #         #AddType application/x-gzip .tgz         #         # AddEncoding allows you to have certain browsers uncompress         # information on the fly. Note: Not all browsers support this.         #         #AddEncoding x-compress .Z         #AddEncoding x-gzip .gz .tgz         #         # If the AddEncoding directives above are commented-out, then you         # probably should define those extensions to indicate media types:         #         AddType application/x-compress .Z         AddType application/x-gzip .gz .tgz              #         # AddHandler allows you to map certain file extensions to "handlers":         # actions unrelated to filetype. These can be either built into the server         # or added with the Action directive (see below)         #         # To use CGI scripts outside of ScriptAliased directories:         # (You will also need to add "ExecCGI" to the "Options" directive.)         #         #AddHandler cgi-script .cgi              # For type maps (negotiated resources):         #AddHandler type-map var              #         # Filters allow you to process content before it is sent to the client.         #         # To parse .shtml files for server-side includes (SSI):         # (You will also need to add "Includes" to the "Options" directive.)         #         AddType text/html .shtml         AddOutputFilter INCLUDES .shtml     </IfModule>          #     # Specify a default charset for all content served; this enables     # interpretation of all content as UTF-8 by default.  To use the      # default browser choice (ISO-8859-1), or to allow the META tags     # in HTML content to override this choice, comment out this     # directive:     #     AddDefaultCharset UTF-8          <IfModule mime_magic_module>         #         # The mod_mime_magic module allows the server to use various hints from the         # contents of the file itself to determine its type.  The MIMEMagicFile         # directive tells the module where the hint definitions are located.         #         MIMEMagicFile conf/magic     </IfModule>          #     # Customizable error responses come in three flavors:     # 1) plain text 2) local redirects 3) external redirects     #     # Some examples:     #ErrorDocument 500 "The server made a boo boo."     #ErrorDocument 404 /missing.html     #ErrorDocument 404 "/cgi-bin/missing_handler.pl"     #ErrorDocument 402 h t t p:/ / ww w.example.com/subscription_info.html     #          #     # EnableMMAP and EnableSendfile: On systems that support it,      # memory-mapping or the sendfile syscall may be used to deliver     # files.  This usually improves server performance, but must     # be turned off when serving from networked-mounted      # filesystems or if support for these functions is otherwise     # broken on your system.     # Defaults if commented: EnableMMAP On, EnableSendfile Off     #     #EnableMMAP off     EnableSendfile on          # Supplemental configuration     #     # Load config files in the "/etc/httpd/conf.d" directory, if any.     IncludeOptional conf.d/*.conf


Is there a command that outputs a line-numbered file starting the numbering at a specific line?

`cat -n file` outputs `file` with line numbering, but how can I specify at which line to start the numbering? Is there a command that can do that? I've thought of perhaps splitting the process into a few commands. If I want to start line numbering at line `N` of the text file `file.txt`, then:   1. Print the first `N-1` lines, à la `head -$((N-1)) file.txt`   2. Print the remaining `N` lines, numbered: `tail -n N file.txt | cat -n` But the second step is not possible if the input is from `stdin`; the first step will have consumed all of it. I'd have to create some temporary file to read from and then remove it, AFAIK.


How do I make a usb thumbdrive persistent?

I have Linux Mint Petra (Mate 64 Bit) installed on a HP Pavilion dv7-3008tx laptop. I want to make a 32GB thumbdrive, with an ISO disk image on it, persistent without fully installing the system on the computer itself. In other words I want to have a bootable system on one partition and data on another one, while the latter is always mounted when the system from the USB is booted. Is this possible somehow?


How to test the touch screen on embedded devices like iPhone / iPad / Kindle?

I want to test the touch panels on embedded devices like iPhone, iPad and Kindle against following criteria:   1. Do a gesture, like tap, swipe, pinch ( zoom in/out) 10000 times and validate that every time the gesture was indeed detected and was detected as a tap, swipe, pinch ( zoom in/out).   2. Do a tap on the touch panel (screen) 10000 times and make sure that the coordinate of the touched location as reported by the software stack is indeed where you did the tap. Also I would like to get more ideas on what other touch testing can I do?


What to do when ubuntu-vm-builder completed?

I already have the VM (Xen based) installed, but the Xen config used specified "Linux kernel" as "None". The exact command line was: `ubuntu-vm-builder xen precise -v --debug --addpkg openssh-server` Two images and a xen VM config was generated in /etc/xen/ubuntu-xen , I'll provide more info later , i'm at the other computer now. How should I start the VM? **UPDATE** I got a xen.conf :               # Configuration file for the Xen instance ubuntu, created     # by VMBuilder     kernel = 'None'     ramdisk = 'None'     memory = 128          root = '/dev/xvda1 ro'     disk = [     'tap:aio:/root/ubuntu-xen/tmpZV_BzU,xvda1,w',     'tap:aio:/root/ubuntu-xen/tmpeUm7XN,xvda2,w'     ]          name = 'ubuntu'          dhcp    = 'dhcp'     vif = ['']          on_poweroff = 'destroy'     on_reboot   = 'restart'     on_crash    = 'restart'          extra = 'xencons=tty console=tty1 console=hvc0'


Global cache config of debootstrap

How should one configure the cache of `debootstrap` globally? I haven't found its configuration file, I have to specify the local mirror all the time.


Where do I change my shell?

If I wanted to use `zsh`, for instance, rather than `bash`, where would I make this change for the current user?


grep string from contents of file command then delete file

I have a peculiar problem I need help with. I have a large batch of .docx files where a certain number of them are junk. I know how to identify these files from the file command, as they contain the phrase "Number of Words: 161" from the output of file cmd. I need to delete these files. I have the following so far,               file * | grep "Number of Words: 161"      which gives an output similar to               19028409: CDF V2 Document, Little Endian, Os: Windows, Version 5.1, Code page: 1252, Author: author, Template: Normal, Last Saved By:  , Revision Number: 2, Name of Creating Application: Microsoft Office Word, Last Printed: Mon Dec 13 13:21:00 2010, Create Time/Date: Wed Dec 12 22:39:00 2012, Last Saved Time/Date: Wed Dec 12 22:38:00 2012, Number of Pages: 1, Number of Words: 161, Number of Characters: 923, Security: 0      where the filename is 19028409 How can I delete all instances of these files? I should also add that I am running this from the MAC OS X terminal, but I suppose the solution will be similar to a Unix/Linux based problem


dhcp: Host name lookup failure

I changed configuration of `/etc/sysconfig/network-scripts/ifcfg-eth1` and used `ifdown` and `ifup` to reset it. Then used `ifconfig eth1 dhcp start` it does not work and say:`dhcp: Host name lookup failure`. Are you know what caused it to behave so? distro:Fedora 12


Under Mint 12 and the latest version of the Enlightenment window manager the battery monitor gadget doesn't report correctly

Can anyone give me a clue where to look to fix it, and, can anyone point me to a good replacement?


How to conditionally do something if a command succeeded or failed

How can I do something like this in bash?               if "`command` returns any error";     then         echo "Returned an error"     else         echo "Proceed..."     fi


mysql restoration process takes longer time

I have a Ubuntu 8.04 machine which has around 300 GB size `mysql` databases. I have dumped all the databases using the `mysqldump` command as below.               mysqldump -u root -p --all-databases > file.sql      Now, in the RHEL6 machine, I am trying to restore the `mysql` databases using:               mysql -u root -p < file.sql      However, the above command seems to take so much time and seems to execute forever. After 3 days when I check the restored database size, it shows just 30 GB as restored. Is there an efficient way to restore the database?


Completely restart Bash

Is there a way to completely restart Bash and reload `.bashrc` and `.profile` and the like? I'd like to make sure my changes worked out properly after editing these files.


PCI configuration registers problem

I'm trying to get my new Realtek RTL-8169 NIC (over CardBus) to work, but I'm having this weird problem. My lspci -x output looks like this:               [root@comp]# lspci -x -d *:8169     07:00.0 Non-VGA unclassified device: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev ec)     00: ec 10 69 81 00 00 00 00 ec 10 69 81 00 00 00 00     10: ec 10 69 81 00 00 00 00 ec 10 69 81 00 00 00 00     20: ec 10 69 81 00 00 00 00 ec 10 69 81 00 00 00 00     30: ec 10 69 81 00 00 00 00 ec 10 69 81 00 00 00 00      . Does this mean the card is messed up? PCI configuration registers are looking crazy, they only contain vendor and device id repeatedly. The contents should definitely be different, and when I try to write to them with `setpci`, the values just stay the same. Does anyone know what might be wrong?


Get values in an XML File - Requirement : It must be done in bash/Unix

Sorry If this question has already been asked but I did not find my answer yet. Here is an extract of my XML file :               <Value ProtectInMemory="True"> ytznnyg</Value><Value>arulmdbqtza01 </Value><Value>arulmrms </Value><Value>sys/system</Value>     <Value ProtectInMemory="True">kylfpo8</Value><Value>arulmdbqtza02 </Value><Value>arulmrib </Value><Value>sys/system </Value>     <Value ProtectInMemory="True" /><Value>arulmdbsoaa01 </Value><Value>arulmsoa</Value><Value />     <Value ProtectInMemory="True" /><Value>arulmdbsoaa01 </Value><Value>srulmsoa</Value><Value />      What I want for the moment :               ytznnyg;arulmdbqtza01;arulmrms;sys/system     kylfpo8;arulmdbqtza02;arulmrib;sys/system     ;arulmdbsoaa01;arulmsoa;     ;arulmdbsoaa01;srulmsoa;      What would be great is have the values I separated by semicolons in 4 different variables What would be amazing is having an output like this:               connect sys/ytznnyg@arulmdbqtza01:1521/arulmrms as sysdba @coucou.sql     disconnect     connect system/ytznnyg@arulmdbqtza01:1521/arulmrms @coucou.sql     disconnect     connect sys/kylfpo8@arulmdbqtza02:1521/arulmrib as sysdba @coucou.sql     disconnect     connect system/kylfpo8@arulmdbqtza01:1521/arulmrib @coucou.sql     disconnect     connect /@arulmdbsoaa01:1521/arulmsoa as sysdba @coucou.sql     disconnect     connect /@arulmdbsoaa01:1521/arulmsoa @coucou.sql     disconnect     connect /@arulmdbsoaa01:1521/srulmsoa as sysdba @coucou.sql     disconnect     connect /@arulmdbsoaa01:1521/srulmsoa @coucou.sql     disconnect      Thanks a lot for your help. I think I will succeed in doing the other two solutions if you help me for the first one :)


Auto continuous scrolling of man output

When I execute `man foo` the terminal shows only the first page and then pauses. Then I have to manually press the keys to scroll here and there.   After executing `man foo` how do I get an output which is continuously scrolling till the end of it. It'll be bonus if I could control the speed of scrolling.


How to grep the last number on a line in a bash script

I have output from the smartctl -a command; one of the lines looks like this:               9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 301      I've placed this into a variable (if that's the correct term) in my bash script like this:               $SMARTCTL_OUTPUT=`smartctl -a /dev/sda`      I want to parse this so that only the number at the end of the line is returned to a variable, so in the above example `301` gets put into the variable `$POWER_ON_HOURS`. I've tried using grep:               $SMARTCTL_OUTPUT=`smartctl -a /dev/sda | grep "Power_On_Hours"`      But this returns the other text (`9 Power_On_Hours 0x0032 100 100 000 Old_age Always -`) that I'm not interested in. Can I return just the number at the end of the line?


What to do when a linux desktop freezes?

I'm a Windows guy, dual booted recently, and now I'm using Linux Mint 12 When a Windows desktop freezes I `refresh`, or if I am using a program I use `alt` + `F4` to exit the program or I can use `ctrl` + `alt` + `delete` and this command will allow me to fix the Windows desktop by seeing what program is not responding and so on. Mint freezes fewer times than my xp, but when it does, I don't know what to do, I just shut down the pc and restart it. So is there a command to fix Linux when it freezes?


Rvm posix error on arm Beagle bone black

I'm trying to run rvm on Angstrom linux on BBB. When I try to launch rvm, I obtain:               RVM can not be run with `set -o posix`, please turn it off and try again.      Someone know about this?


Is Linus Torvalds a hacker?

Maybe wrong place for the question, but I couldn't find the answer. The wiki says he's software engineer and hacker. (http://en.wikipedia.org/wiki/Linus_Torvalds) Is it true? I must tell I haven't heard any of the meaning in the answers. I must quote a book (it's Hungarian, I am not from England, so please correct my spelling): > It's a frequently asked question that who is a cracker and who is a hacker. > In my opinion hacker is someone who is looking for a challenge, he doesn't > want any trouble, so he doesn't do any. He has great knowledge, well > prepared, he knows what does he do, and why. (...) So the meaning of the word hacker isn't so clear. Thanks for the answers!


I/O brings a machine to its knees

Why, on every Linux I've used, when a program is really I/O bound, it bogs the machine down? It just happened when I (accidentally) tried to make `gcc` compile a (valid!) 50Mb C file. GCC was so I/O intensive it brought the machine to its knees. Another moment is when `apt-get` or similar are downloading packages, sometimes I can't even access the internet in the meantime, all the requests get timed out. On Windows, the operations may not be _that_ fast, but at least the processes get to share the I/O time between them. Is this because of design decision? If yes, is there anyway I can change this behavior? ( _please do not take this as a critique of Linux_ )


How to write a Shell Script using the condition from a database

Consider this is the condition I need to check               select count(*) from nm.table1 where column1 =true;       Now it should come out of the db (PostgreSQL) and use `IF THEN ELSE LOOP` in the Unix Something like               if [ $count > 1]     then       echo " Successful"     else       exit     fi


How does the order of arguments influence the speed of find

How does the order of arguments in a `find` call affect the speed of the results? Compare for example (A)               find -name dir -type d      and (B)               find -type d -name dir      Or any other of combinations of arguments (e.g. using `-or` or `-and`). I would expect `find` to be smart in some way. I tried to collect some statistics by executing both A and B with `time` and 5 repetitions. However with                11.86, 7.23, 5.25, 5.87, 7.16      for A and for B:               9.73, 6.56, 8.69, 7.14, 6.35      this is not really conclusive, with mean values around `7.5s` for both, and quite a high variance. So, to repeat my question, does the order of arguments matter using `find`?


Extended monitor - scroll right to access left screen

I am running Crunchbang (debian based) and I'm trying to extend my desktop, I've ran the following command:               xrandr --output DVI-I-2 --auto --output DVI-I-1 --primary --auto      This has extended the desktop but my second monitor is to the left of my main monitor but I have to move the mouse to the right to access the left monitor, how can I fix this? Output of `xrandr -q`               Screen 0: minimum 320 x 200, current 3360 x 1050, maximum 8192 x 8192     DVI-I-1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 473mm x 296mm        1680x1050      59.9*+        1280x1024      75.0     60.0          1152x864       75.0          1024x768       75.1     60.0          800x600        75.0     60.3          640x480        75.0     60.0          720x400        70.1       DVI-I-2 connected 1680x1050+1680+0 (normal left inverted right x axis y axis) 473mm x 296mm        1680x1050      60.0*+        1280x1024      75.0     60.0          1152x864       75.0          1024x768       75.1     60.0          800x600        75.0     60.3          640x480        75.0     60.0          720x400        70.1


I'm using Ubuntu 13.04 on Asus VX6 (1.8GHz Atom - 2 cores, optimus nVidia ION) with Kernel 3.9.0. When I start my system I get this error:               [   15.728106] [drm:intel_enable_lvds] *ERROR* timed out waiting for panel to power on      I get it even with older kernels. What does it mean and how can I make it stop? I tried to google something, but all I found were threads where the actual problem was something else. .................. lspci -vv: https://files.myopera.com/BS-Harou/files/ub-lspcivv.txt


Command to run an application within a specific directory

I want to be able to type a line of command to do the following two commands that I know:               cd ~/rpitwit_commands/     rpitwit      This is because I want to automatically run it upon boot in crontab, and it has to run from within that directory. How do you guys suggest I do so? Do note that the actual application file is not in that directory (i'm not sure how this works in debian linux).


Blacked out html folder in root directory

Just looking through my system's directories and wondering about some of the contents. There is a blacked out (inaccessible) directory called `html`. I'm thinkging this is a bad link? I'm guessing and not really sure if I can delete it. Also there's another directory, `conf.d`, which I've only ever seen in the `/etc/httpd` directory in the past. Can I safely delete these files/directories? What are their purposes?


Installing mono on open suse

I'm trying to install mono on my open suse linux. I downloaded the latest rpm packages from the mono page and tried to install the mono-core package with the --test attribute               rpm -ivh --test /home/martin/Downloads/mono-core-3.2.3-0.x86_64.rpm      but got an error saying:               error: Failed dependencies:             mono(System.ComponentModel.Composition) = 4.0.0.0 is needed by mono-core-3.2.3-0.x86_64             mono(System.ComponentModel.DataAnnotations) = 4.0.0.0 is needed by mono-core-3.2.3-0.x86_64             mono(System.Data) = 4.0.0.0 is needed by mono-core-3.2.3-0.x86_64             mono(System.Runtime.Serialization) = 4.0.0.0 is needed by mono-core-3.2.3-0.x86_64             mono(System.ServiceModel) = 4.0.0.0 is needed by mono-core-3.2.3-0.x86_64      I understand that these dependencies should be installed first, but there isn't any just 'mono' package. Am I missing something here ?


Cropping a JPG image

This is a question about image file cropping. I recently posted a public notice to an Indian newspaper called the Free Press Journal. This is available online as The Free Press Epaper. Now, one can download a notice that was posted in the paper as a JPG file. However, this JPG can, and in my case, does, include multiple notices. These notices are mostly long thin rectangles running vertically, filling up the image. I'm wondering if anyone can suggest a simple approach to "slice" the segment containing the desired notice out of the image file. I could also convert to another format if it would make this slicing process easier. A method to make the image larger if necessary would also be a plus.


Install third party software on Linux from source

What are good practices for making Linux installations? Suppose I wanted to install some so-very-useful library of my own design and documentation/reference for it on a Linux system. Which part should go where in that case?


Running "gnome-session" or "gnome-panel" over SSH via X yields black bar

I can VNC fine to my machine. But VNC is slow, and to try something else, I wanted to use `gnome-session` or `gnome-panel` over SSH via X. But it simply gives me a black bar across the whole screen. No app shortcuts, however, I can right click and click preferences. But there's no functionality. Using Debian 7 x64 on an Intel Atom system. Connecting from OS X 10.9, XQuartz.


A tool for automatically applying RandR configuration when external display is plugged in

is there a tool which enables one to:   * remember current RandR configuration (position, orientation, resolution etc) on per-monitor basis,   * automatically apply last known good configuration as soon as the display is plugged in, with no need to muck around with applets or xrandr(1)? The configurations would have to be applied on a per-user, per-display basis. If there is no such tool in the wild, I'd like to throw together one myself, but as far as I can see, there's no way to tell that a monitor has been plugged in. Do I have to poll with xrandr -q once in a while to figure out that an output was connected or disconnected, or is there a more efficient way to do it? Can udev be tuned to do just that?


Issue on created folder permissions: temporary flag

I have a strange issue with directory permissions. From within a C++ app, I create a folder with: `mkdir( "foldername", 777 );` But I got into an issue when attempting to create a file in that folder, `fopen()` returned `NULL`, and `errno` told me `Permission denied`. So I checked, and indeed, I had the following permissions on the folder that got created: `dr----x--t` (The root folder has `drwxrwxr-x`) I checked, and this unusual `t` means "temporary", but I have no clue on what that means. `chmod 777 foldername` from the shell does the job and sets attributes to `drwxrwxrwx`, but I can't do it manually each time. **Question** : any clue on what is going on ? Why doesn't my app correctly sets the folders attributes ? What is the meaning of this 'temporary' attribute ? (system is Ubuntu 12.04)


Need a script that generates files from words within a single text files

I have the following scenario and my lack of linux knowledge doesn't help a lot. I have a text file that contains YML values, in the following matters:               coolregion:       min: {z: -99613.0, y: 45.0, x: -99805.0}       flags: {vehicle-place: allow}       max: {z: 100387.0, y: 127.0, x: 100195.0}       priority: 0       type: cuboid       owners:         groups: [jacob, eithan, michael]       members:         groups: [jack, noah]     niceregion:           min: {z: 544.0, y: 6.0, x: 184.0}       flags: {}       max: {z: 556.0, y: 13.0, x: 197.0}       priority: 0       type: cuboid       owners:         groups: [noah]       members:         groups: [logan, lucas, jack]      I want to generate files for each name with the regions that he belongs to. For example `noah.txt` will contain `coolregion, niceregion` while `jacob.txt` will contain `coolregion` only. I know regex pretty well so I'd be also pleased if you only point me to the right direction (i.e. a script that only needs the regex to complete). If it matters, my linux version is "Debian GNU/Linux 5.0".


What killed Beagle?

Beagle was all the rage some years ago, and then it just died... silently. Anyone knows why?


Do I need to cross-compile my program when my target is 64 bit arch. and host is 32 bit arch from x86 family?

I have scenario in which   my host is : x86 32 bit processor   my target is : x86 64 bit processor I have a couple of questions :   * I want to know if i can simply compile a program in my host using the available gcc and run it on the target?   * Do i need to cross compile it for x86 64 bit processor? If yes, how can i specify it while compiling?   * Do i need to use separate tool-chain for cross-compiling the program?


Fake serial number of USB device

I have a mobile phone connected to my PC via USB. When viewing the device info using               sudo udevadm info --attribute-walk      the product and vendor id's show up fine, but there is no _ATTR{serial}_. An application I'm using (Android adb) needs the device to report a serial number to work properly. Is there any way I can fake the serial number of the device, for example by using a udev rule? **Clarification:** The question is not on how to _get_ the serial number of the USB device, but on how to _set_ the serial number. I had an Android phone that does not report a serial number over USB, and the adb tool did not like this too much. So far there does not seem to be any simple solution for this. However, there days it is very easy to just buy a proper Android phone for development.


Does the order of options in the /etc/network/interface option matter

I'm trying to determine if the order of the options matter I'm using a script (represents an external remote interface) that is updating the /etc/network/interfaces file. The script can set the IP Address, Default Gateway, and Netmask. My question is does the order of the options matter i.e.               #standard options     auto eth0     iface eth0 inet static     address 192.168.0.71     netmask 255.255.255.0     gateway 192.168.0.1          #possible script output     auto eth0     iface eth0 inet static     netmask 255.255.255.0     gateway 192.168.0.1     address 192.168.0.71      Is this still an acceptable configuration?


Take copy of RAM

How trivial is it to take a copy of the current state of a Live Linux Distro's RAM storage? I have had situations where it might be useful to debug what caused a problem with the OS, and if I had happened to take a 'snapshot' earlier, thought this would be useful data.


Is there a place where we can have an exhaustive list of debian's package?

Do you know if there is a place where we can have an exhaustive list of debian's package ?


I can't use ANY Linux distribution because of my graphic card

I have a problem. On my computer I have an ATI 6800 Series and every time I try to install ANY Linux distribution I get a black screen or a white screen or sometimes i only see half of the wallpaper. Of course this has to do with my video card. How can I solve this problem? I want to try Linux but I can't!


Not working udev rule with systemd-udevd on Fedora 19

I would like to play with IOIO on my Fedora 19, so I installed the udev rule as the documentation tells, in `/etc/udev/rules.d/50-ioio.rules`:               ACTION=="add", SUBSYSTEM=="tty", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="0008", SYMLINK+="IOIO%n", MODE="666"      This should create some `/dev/IOIO**` devices after restarting the service. But it does not work for me. Since Fedora 18, udev has been replaced by systemd-udevd, could it be related ? Is this rule correctly written for Fedora 19 ?


vim stops sending text to * (X11) register?

I recently started using VcXsrv with the hope of being able to grab text from `vim` (console mode) to the Windows clipboard via X11 forwarding (and the `*` register). It works...to an extent. As soon as I paste to Notepad, I lose the ability to yank to the Windows clipboard.   * I'm experiencing this issue whether I yank text to the `*` register directly, or use the `autoselect` clipboard option. (`:help options` (clipboard), `:help guioptions_a`)   * It doesn't appear to be tied to a specific Xserver: I've tried VcXsrv, XMing, and MobaXterm (including PuTTY w/ Moba's X Server).   * It doesn't appear to be tied to the terminal I'm using. I've tried PuTTY and MobaXterm.   * `xclip` can be used any number of times outside of `vim` with no issues.   * Echoing a command to `xclip` seems to temporarily fix the problem. I can successfully copy yank to `"*` from `vim` again, but as soon as I paste to the Windows notepad, the problem is back.   * `~/.vim/autoload` and `~/.vim/plugin` are empty.   * I use `tmux` regularly, but experience this problem outside of a session as well.   * Happens with `gvim` as well. My `.vimrc`:               $ cat ~/.vimrc     " Default vimrc file, installed by vim spell     set mouse=a     set nocompatible     set backspace=indent,eol,start     " set autoindent     " set smartindent     set cindent     set tabstop=4     set shiftwidth=4     set expandtab     set ruler     set showcmd     colorscheme elflord     syntax enable     if &term =~ "^screen"       set ttymouse=xterm     endif     filetype plugin on      Output of `set clipboard`:               clipboard=autoselect,exclude:cons\|linux      Output of `vim --version`:               $ vim --version | head -20     VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Jul 12 2010 02:29:33)     Included patches: 1-445     Modified by pkg-vim-maintainers@lists.alioth.debian.org     Compiled by jamessan@debian.org     Huge version with GTK2 GUI.  Features included (+) or not (-):     +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent     +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments     +cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic     +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path     +float +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand     +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap     +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm     -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte     +multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra +perl +postscript     +printer +profile +python +quickfix +reltime +rightleft +ruby +scrollbind     +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax     +tag_binary +tag_old_static -tag_any_white +tcl +terminfo +termresponse     +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual     +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup     +X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save      * * * Update: `:echo @*` will show the contents of the `*` register properly even after the bug manifests, so it appears that it's not arriving in the Windows clipboard via my X servers for some reason.


Important scripts useful for a Linux system administrator

I am a Linux system administrator and constantly find myself doing the same chores again and again. I need some scripts to make life easier. What are the most important scripts needed by a Linux system administrator?


Unable to boot Linux / Windows as there are no boot entries in the BIOS

I have `Asus N56D` laptop with `Windows 8` pre-installed in `EFI` mode. I installed Linux Mint 15 dual boot and got it working with the Boot-Repair utility. Everything was going fine until I decided to install Karora Linux. I was unable to boot Karora Linux in UEFI mode hence I enabled Legacy BIOS mode and installed Karora successfully. But when I reboot the system neither Karora nor Windows 8 is booting. I went to BIOS to check the boot order I did not see any boot option entries like "Windows Boot Manager", rEFInd, etc. At least to get Windows 8 working I followed approach of rebuilding `bcd` like below with no luck.               bcdedit /export c:\bcdbackup     The operation completed successfully.     attrib c:\boot\bcd -h -r -s     ren c:\boot\bcd bcd.old     bootrec /rebuildbcd     Scanning all disks for Windows installations.          Please wait, since this may take a while...          Successfully scanned Windows installations.     Total identified Windows installations: 0      It did not find any Windows 8 installation :( although I have it on my `C:\` I checked in GParted (launched from Karora live USB) that my EFI partition is still intact and has `boot` flag. Also it has folders like `rEFInd` `Microsoft` etc. Please guide me to solve this issue. I am not able to use my laptop as I've messed up badly.


firefox bookmark updation

I bookmark a lot of pages everyday and I export them as well into a html file. The thing is whenever is bookmark a page **can it automatically get updated or synced with the html file**. I use Ubuntu 13.10 and Firefox 30.


extract the characters before () using grep

I need to extract the characters before the character '('. My file structure is: > rose(good)ook > > daisy()no > > lilly(bad)fine > > sunflower()nice I need output file as in the form of:               rose          daisy          lilly          sunflower      can anybody tell the command for this..... awk, grep or sed are preferable...


Extract particular words from Rsyslog %msg% facility

After lot of search on Google and reading all manuals available on man page and internet, I finally ask here. In my scenario, I have one `rsyslog` server working with `mysql` and a custom template written which take logs, filter them and write them to `mysql` database My tmeplate is :               $template db_k,"insert into       sensitive_logs(ID,TIME,message)      values('%HOSTNAME%','%timegenerated:::date-mysql%','%msg%' )", sql      Output:               Security | 20140401182028  |  Failed password for root from 192.168.1.113 port 34290 ssh2       I'd like to extract some words from the %msg% Example:               Failed,root,IP       from this message part How can I do this?


Custom Linux Distro that runs just one program, nothing else

I am wondering how I could go about creating my own "custom" Linux distro that will run just one program, pretty much exactly the same way as XBMCbuntu. I'm not asking for a step by step guide, just maybe a link to something that can help me on my way.


How can I use a Mint Live DVD with separate persistent storage of customizations on a USB drive?

I am looking for a tool or "recipe" to set up persistent storage on a USB drive for a LiveDVD installation of Mint. My situation is that I have a laptop that will not recognize a LiveUSB and boot directly from it, but will boot from its DVD drive. I'd like to regularly use Mint on that machine, but the usage would be greatly enhanced with persistent storage. I've hunted around this and other stack exchange sites and google and have found tools and recipes to set up a LiveUSB with its own persistent storage, or ways to modify the LiveDVD (modifying the boot process so that it points to persistent storage on another device, but have not found a method to just point the LiveDVD installation to another device for storage of customizations after booting. I'm looking to have the LiveDVD entirely generic (so it can be replaced as new ISOs come out for updates), and keep the persistent storage separate. I assume I would have to give a command line command after boot to make the running OS aware of the persistent storage.


apt-get shows important packages as “no longer required”

I recently installed Kali Linux in my system. It came with a preinstalled Iceweasel. However, instead of Iceweasel I wanted to install firefox so I followed this guide and installed firefox successfully. Now whenever I invoke `apt-get` it shows many pre-installed packages as _"automatically installed and no longer required"_ :               abhishek@ab-linux:~$ sudo apt-get install     [sudo] password for abhishek:      Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages were automatically installed and are no longer required:       empathy empathy-common fonts-cantarell gcalctool gnome-backgrounds       gnome-dictionary gnome-font-viewer gnome-icon-theme-extras gucharmap       libavahi-gobject0 libcaribou-gtk-module libcaribou-gtk3-module       libchamplain-0.12-0 libchamplain-gtk-0.12-0 libgdict-1.0-6 libgdict-common       libgeocode-glib0 libtelepathy-farstream2 nautilus-sendto-empathy       sound-theme-freedesktop telepathy-gabble telepathy-logger telepathy-salut       vino     Use 'apt-get autoremove' to remove them.     0 upgraded, 0 newly installed, 0 to remove and 35 not upgraded.     abhishek@ab-linux:~$       **Linux Version**               abhishek@ab-linux:~$ uname -a     Linux ab-linux 3.7-trunk-amd64 #1 SMP Debian 3.7.2-0+kali8 x86_64 GNU/Linux      How to mark these package as important and required?


How to format the output of free/sar/such commands?

I need to get some specific columns from the output of `free` command. The way I'm following doesn't seem good, could anyone please suggest me a better way?               bash-3.2$ free -gotsi                  total       used       free     shared    buffers     cached     Mem:            56         29         27          0          0         29     Swap:           11          0         11     Total:          67         29         38     bash-3.2$          bash-3.2$ free -gotsi | cut -c-40,64-                  total       used       free    cached     Mem:            56         29         27        29     Swap:           11          0         11     Total:          67         29         38


How to use partial IP address in /etc/sysconfig/iptables for the "-s" flag?

in this example it is a full ip ip is: 1.1.1.1               -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -s 1.1.1.1 -j ACCEPT      but suppose i want to allow any ip that simply starts with: 1.1. because for example my internet ip always starts with 1.1. but rest changes time to time. i want to be able to do something like this:               -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -s 1.1.* -j ACCEPT      i do not think this will work because i think in world of computers they use ranges and etc rather than the wild card symbols. Range stuff looks very complex to me. is there something like this with a wild card style concept ?


Change Owner of Folder in SCO

How can I change the Owner/group of a folder in SCO? I did:               ls -l      and got the following:               ...     drwxr-xr-x 9 root root 512 Jul 2 10:09 opt     ...      I have tried:               chown /opt      But that hasn't worked. The user I am wanting to use is: test I have asked another question (different thread) about how to change the folder permissions, but realized I still won't be able to create folders in the /opt folder with root being the owner and group - if test is not part of the root group. Gaining root privileges in SCO


Can I use a chroot on my dev machine to build an application to run on embedded linux installation?

I am trying to develop an application to run on an embedded linux installation. It comes with an older version of libc than I have on my development maching. If I were to create a chroot environment on my development machine, copy the libraries from my embedded device in such a way that the chroot environment mirrors the device and then build the application, would it be safe to run on the device? My dev machine and the device are both x86 32 bit so I don't think I need to cross compile. Also should the application I write require linking to additional libraries (that are not present on the device) am I safe to build these libs on the dev machine in the chroot and then just copy them to the device for application deployment? From all the reading I have done on this subject it appears that the only way I can ensure that everything links together properly would be to actually build the application on the device but this is not an option as it is a minimal install and doesn't come with gcc installation.


How to get CR2 (Canon raw) support for XLoadImage?

I've been looking for a light-weight image viewer to replace gThumb now that I'm not running Gnome anymore, and found XLoadImage. How can I add support for Canon's raw CR2 format?               anna@anna:~ $ xloadimage IMG_0001.CR2      TIFFReadDirectory: Warning, Photometric tag is missing, assuming data is YCbCr.     TIFFReadDirectory: Warning, SamplesPerPixel tag is missing, applying correct SamplesPerPixel value of 3.     OJPEGSubsamplingCorrect: Warning, Subsampling tag is not set, yet subsampling inside JPEG data [2,1] does not match default values [2,2]; assuming subsampling inside JPEG data is correct.     IMG_0001.CR2 is a 5184x3456 24-bit single-plane YCBCR TIFF image     IMG_0001.CR2: YCBCR  is an unsupported TIFF photometric style, sorry.     IMG_0001.CR2: unknown or unsupported image type     anna@anna:~ $       The only thing I've found so far is a plugin for GIMP, but GIMP is definitely not light-weight.


Is there a Lubuntu, Centos equvialent...Centos that runs lxde out of the box?

Are there any CentOS distros that run LXDE out of the box? I want to use CentOS for a server I'm throwing together instead of Ubuntu, but I want to be able to run LXDE as the system I'm using has kind of low system specs.


git push in gnome-term crashes my window manager

In terminal in awesome wm when i `git push` awesome wm freezes. so i move over to tty2 and log in. `top` shows awesome at %100 cpu. `ps aux | grep [g]it` output               git-remote-https origin https://github.com/user/user.git.io     /usr/lib/ssh/x11-ssh-askpass Username for "https://github.com"      if i git push in linux termnina (no x)               Error: can't open display     error: unable to read askpass response from '/usr/lib/ssh/x11-ssh-askpass'     username for "https://github.com":       i input username then it give me the errors again and prompts for password then it pushes everything fine. is there a way to not use the graphical dialog x11-askpath? https://wiki.archlinux.org/index.php/SSH_Keys#x11-ssh-askpass "The x11-ssh- askpass package provides a graphical dialog for entering your passhrase when running an X session." damn, i dont want to use this!


Shell vi mode prints (arg: repetition): How to remove it?

Whenever you are in vi command mode on the shell and hit a number, like 8, "(arg: 8)" shows at the start of the line. Anyone know how to make it not do that? The moving the line I'm typing is distracting. Instead of:               (arg: 8) somecmd --itslong --reallylong      This:               somecmd --itslong --reallylong


top: how to cancel current command?

While browsing processes on a shared server in `top` I accidentally hit the `r` key which prompted me with `renice`. I had no clue what this was going to do with my input and found no way to go back. I tried `^C`, `^D`, `<ESC>` among other things and ended up just typing some garbage like `asdf;` which got me out. Is there a sane way to cancel a command that you type interactively in `top`?


Error while installing edx on debian squeeze

I am installing edx platform on debian squeeze with anisible at the middle of the process of installation I get this error :               TASK: [supervisor | create a symlink for supervisor cfg] **********************      ok: [localhost] => (item=/edx/app/supervisor/supervisord.conf)     ok: [localhost] => (item=/edx/app/supervisor/conf.d)          TASK: [supervisor | start supervisor] *****************************************      failed: [localhost] => {"failed": true, "item": ""}     msg: cannot find 'service' binary or init script for service,  possible typo in service name?, aborting          FATAL: all hosts have already failed -- aborting          PLAY RECAP ********************************************************************             to retry, use: --limit @/root/edx_sandbox.retry          localhost                  : ok=42   changed=2    unreachable=0    failed=1      I don't know what is the problem? can anybody help me?thanks.


Set the button mapping of touchpad using xorg files

I would like to change the mapping of my touchpad (of an eee-pc with Linux Mint 16 MATE edition) so that a two fingers tap is a middle click and three is right click. For that I add the `ButtonMapping` option to `/usr/share/X11/xorg.conf.d/50-synaptics.conf`:               Section "InputClass"             Identifier "touchpad catchall"             Driver "synaptics"             MatchIsTouchpad "on"     # This option is recommend on all Linux systems using evdev, but cannot be     # enabled by default. See the following link for details:     # http://who-t.blogspot.com/2010/11/how-to-ignore-configuration-errors.html           MatchDevicePath "/dev/input/event*"             Option "ButtonMapping" "1 3 2 4 5"     EndSection      But it has no effect. This `xinput` command does work, but is lost on reset (and it doesn't work in `~/.xinitrc` or other init scripts I've tried):               xinput set-button-map "ETPS/2 Elantech Touchpad" 1 3 2 4 5      **Update:** xclip is not actually what I want as it changes also the physical keys. However it did work in the MATE startup applications. The following doesn't, but does what I want when manually executed:               #!/bin/sh     synclient TapButton2=2     synclient TapButton3=3


How do I view the entire raw message in alpine?

I am fiddling around with S/MIME emails (sent from http://transport- testing.nist.gov/ttt/). I want to view the entire email, but when I export the message I get this:               From wwerner@transport-testing.nist.gov Wed Apr 16 11:02:03 2014     Date: Wed, 16 Apr 2014 12:02:04 -0400 (EDT)     From: wwerner@transport-testing.nist.gov     To: wwerner@not-a-chance.com     Subject: Direct Validation Request                        [ Part 1, Application/PKCS7-MIME (Name: "smime.p7m") 27 KB. ]         [ Unable to print this part. ]      Instead, I expect to see something more like this:               Received: from hit-testing.nist.gov (unknown [])             by mydomain.com (Postfix) with SMTP id 552EDB606BC             for <wwerner@direct.mydomain.com>; Wed, 16 Apr 2014 13:54:21 -0500 (CDT)     Subject: Direct Validation Request     Date: Wed, 16 Apr 2014 14:54:23 -0400 (EDT)     From: wwerner@transport-testing.nist.gov     To: wwerner@direct.mydomain.com     Message-ID: <2027534107.69.1397674463912.JavaMail.root@transport-testing.nist.gov>     Subject: Message test     MIME-Version: 1.0     Content-Type: application/pkcs7-mime; name=smime.p7m;              smime-type=enveloped-data     Content-Transfer-Encoding: base64     Content-Disposition: attachment; filename=smime.p7m          MIAGCSqGSIb3DQEHA6CAMIACAQAxggGtMIIBqQIBADCBkDCBgjELMAkGA1UEBhMCVVMxCzAJBgNV     BAgMAkFSMQswCQYDVQQHDAJMUjETMBEGA1UECgwKTFdTSSwgSW5jLjEMMAoGA1UECwwDRGV2MRUw     EwYDVQQDDAx0dHQubHdzaS5jb20xHzAdBgkqhkiG9w0BCQEWEHd3ZXJuZXJAbHdzaS5jb20CCQDa     Ol9sXP8A8TANBgkqhkiG9w0BAQEFAASCAQBrfDgrbsR24cMsMUHLwqmZldHRfZh+rqHAg3wYp/BT     91OasZfU2Yke/MBTNu3VpmNM4L2OB10PzYH8heywPP6cVylLhEwnpdEGv6i1sL4Wz0pFeivXfHn/     D7w4iAQyBRUJnFd/uEYIJRJ5xP1Jnlcmcifyz8ZJ2YCZolehbETQGmLbNJdLuHTkB7ZnlmCMnNW+     vhRFDOrg/l9C+ATsoEGGWKRLmN0EZT8XSyiEOHpRqgGaScS0sjXGzCPkZGd+S1X8KSzUP7cvB1Ml     Vz7lXpIg+KnuglMWaPIp++acHGEwbb3hTIKxn23HqdbT95MeXdjjOJnqxkkelC6ObPY6evSnMIAG     CSqGSIb3DQEHATAdBglghkgBZQMEAQIEECvsba7B8B6vlbDaHsp000+ggASCA+iNDnc2EOJPNAXk     x0fDMAuVuzB5ZiklhJ+bQXn21eYGaXJedhk+UWZF3ov5sWKwbl2A7yVCoKF1yuVlpAqGAFh1MZOH     XcFF+EwbzR1dF5rUJQ3xc+evyT64clDap7IM1LBGJ2z2qBaQNazoVTdKIPYuyNmmeAteeXh3XaAU      I just tried saving the attachment and apparently it's saving it in a binary format. If I look at this in Gmail's "original" view it shows up b64 encoded (of course this is probably obvious as I'm looking at it in the browser). Do I have to convert the attachment myself? Or is there a way I can export it b64 encoded.


How to get `expr match` to extract colon-delimited key-value pair?

Given: `myvar="present-value: 1"`, I'd expect `expr match "$myvar" '\\([0-9]\\)'` to output `1`. However, instead it outputs blank and exits with a non-zero status code indicating no match. How can I get it to match?


How to apply org-todo to multiple items

Consider an emacs org-mode file like this:               ** item 1     ** item 2     ** item 3     ** item 4      Now I can apply `org-todo` to every item separately (bound to `C-c C-t`). But how can I apply it to every item in region at once? Just selecting the region and doing it doesnt't work, it just adds the TODO keyword to the item below the region.


Can't resize a partition using resize2fs

I recently resized the hard drive of a VM from 150 GB to 500 GB in VMWare ESXi. After doing this, I used Gparted to effectively resize the partition of this image. Now all I have to do is to resize the file system, since it still shows the old value (as you can see from the output of `df -h`):               Filesystem                     Size  Used Avail Use% Mounted on     /dev/mapper/owncloud--vg-root  157G   37G  112G  25% /     udev                           488M  4.0K  488M   1% /dev     tmpfs                          100M  240K  100M   1% /run     none                           5.0M     0  5.0M   0% /run/lock     none                           497M     0  497M   0% /run/shm     /dev/sda1                      236M   32M  192M  14% /boot      However, running `sudo resize2fs /dev/mapper/owncloud--vg-root` returns this:               resize2fs 1.42 (29-Nov-2011)     The filesystem is already 41608192 blocks long.  Nothing to do!      Since Gparted says that my partition is `/dev/sda5`, I also tried running `sudo resize2fs /dev/sda5`, but in this case I got this:               resize2fs 1.42 (29-Nov-2011)     resize2fs: Device or resource busy while trying to open /dev/sda5     Couldn't find valid filesystem superblock.      Finally, this is the output of `pvs`:               PV         VG          Fmt  Attr PSize   PFree     /dev/sda5  owncloud-vg lvm2 a-   499.76g 340.04g      `fdisk -l /dev/sda` shows the correct amount of space. How can I resize the partition so that I can finally make the OS see 500 GB of hard drive?


What does “sh a.sh <&0 >&0” mean?

It's a question about bash shell command. "sh a.sh <&0 >&0" What dose it mean? Especially, I'm not very clear about what does &0 mean?


Mode to set Directory in Only READ-WRITE mode

Can anyone tell me how to set a directory only in read/write mode as below?               -rw-rw-r--      I tried with 640,644 but I am able to achieve...


Installing Domjudge in Fedora 19

I tried to install Domjudge in Fedora 19 (based on its documentation) and it installed successfully but when I try to start it in browser (localhost/domjudge) I get the following error: Forbidden You don't have permission to access /domjudge/ on this server. I thought maybe the problem is caused by SELinux but I disabled that and the problem still exists.


How do I prevent time drift in a Debian guest on a CentOS KVM host?

I know I can install `ntp` in the guest, but my confused understanding of what I've Googled so far suggests this shouldn't be necessary. The Host is CentOS 6.3 and guest is Debian Wheezy, which seems to be using the kvm clock as a time source:               # cat /sys/devices/system/clocksource/clocksource0/current_clocksource     kvm-clock      Is there something special I need to do to make the guest use the host clock?


emacs fonts from ssh not as good as locally installed

How can I have the same emacs fonts and antialiasing configuration that I have in my local Ubuntu 12.04 also working when I open an emacs session via ssh to a CentOS 5 system? EDIT: I didn't get an answer for this and it's still bothering me. I have emacs 24 installed, so I thought it should have been easy to have good quality fonts with antialiasing enabled...


Is there a method for simulating high latency?

This is a very good answer about how to limit bandwidth. Now Bandwidth is not my primary concern - latency is. What happens if I put a few hundred kilometres between my application-servers and its database-servers? I am looking for a possibility to simulate the expected lag for every IP- packet.


difference between useradd -b and useradd -d

Can somebody please explain to me the exact differences between `useradd -b` and `useradd -d` in [Debian] Linux? Both seem to work quite similar to me, but then I spot differences that confuse me.


less does not show expected output after sourcing a script in .cshrc

In our university we have a script to setup the working environment under linux. Since I am lazy I decided to add this process to the shell initialization by adding `source /setup/script` to `.cshrc`. However since I have done so, I can't use less anymore. When I run `less somefile`, the output of said script is displayed by less **instead** of the contents of `somefile`. I managed to work around the issue by using `source /setup/script > /dev/null` So the questions:   1. Is it wrong/is there a better way, then adding `source initscript` to `.cshrc`   2. How can I continue using `less` (without the output redirect, the script echos some ussage information I find helpfull)?   3. Why is this happening?  **edit** : OK since I feel uncomfortable adding the scripts, here is a minimal example that breaks less for me: `.cshrc`:               source ~/test      `~/test`:               echo "test"      If I now do `less test` I get `test` instead of `echo "test"`, by the way the output is the same for other files, I checked. The output is within the less environment (pressing `q` returns me to the console) _update_ : There is an additional annoying thing: `less imaginaryPathToNonexistingFile`- works, same output. less has some sort of memory: every time I change the file I open the display of `test` is one line down on the screen, until it is right over the `filename(END)`at the bottom of the console _update_ : I found that there is an environment variable called `LESSOPEN` set to `|/usr/bin/lesspipe.sh %s` (thx vonbrand)               #!/bin/sh -     #     # To use this filter with less, define LESSOPEN:     # export LESSOPEN="|/usr/bin/lesspipe.sh %s"          lesspipe() {       case "$1" in       *.[1-9n]|*.man|*.[1-9n].bz2|*.man.bz2|*.[1-9].gz|*.[1-9]x.gz|*.[1-9].man.gz)         case "$1" in             *.gz)   DECOMPRESSOR="gunzip -c" ;;             *.bz2)  DECOMPRESSOR="bunzip2 -c" ;;             *)  DECOMPRESSOR="cat" ;;         esac         if $DECOMPRESSOR -- "$1" | file - | grep -q troff; then             if echo "$1" | grep -q ^/; then #absolute path                 man -- "$1" | cat -s             else                 man -- "./$1" | cat -s             fi         else             $DECOMPRESSOR -- "$1"         fi ;;       *.tar) tar tvvf "$1" ;;       *.tgz|*.tar.gz|*.tar.[zZ]) tar tzvvf "$1" ;;       *.tar.bz2|*.tbz2) bzip2 -dc -- "$1" | tar tvvf - ;;       *.[zZ]|*.gz) gzip -dc -- "$1" ;;       *.bz2) bzip2 -dc -- "$1" ;;       *.zip) zipinfo -- "$1" ;;       *.rpm) rpm -qpivl --changelog -- "$1" ;;       *.cpi|*.cpio) cpio -itv < "$1" ;;       *.gif|*.jpeg|*.jpg|*.pcd|*.png|*.tga|*.tiff|*.tif)        if [ -x "`which identify`" ]; then          identify "$1"        else          echo "No identify available"          echo "Install ImageMagick to browse images"        fi ;;       *)         case "$1" in             *.gz)   DECOMPRESSOR="gunzip -c" ;;             *.bz2)  DECOMPRESSOR="bunzip2 -c" ;;         esac         if [ ! -z $DECOMPRESSOR ] ; then             $DECOMPRESSOR -- "$1" ;         fi       esac     }          if [ -d "$1" ] ; then         /bin/ls -alF -- "$1"     else         lesspipe "$1" 2> /dev/null     fi


Delete backup files according to rules

I manage my backup files with homemade scripts:   * keep the 7 latest backups (full + incremental)   * keep the 5 latest full end-of-week full backups   * keep the 6 latest full end-of-month full backups   * those numbers are automatically higher if disk space allow it So my scripts works. But I'm sure something already exists to manage this kind of need. Didn't found anything using Google.   Does anyone knows a (free as speech) software for that?


Is there ever a reason to use scp instead of rsync?

Is there a reason to use `scp` instead of `rsync`? I can see no reason for using `scp` ever again, `rsync` does everything that `scp` does, with more safety (can preserve symlinks etc).


wlan connection stops working when ppp 3g connection is running

I have ZTE MF669 modem and RTL8188eu wifi card. My wifi address is fixed (192.168.1.14). Modem gets address from 10.0.0.0/8 subnet. My wlan connection stops working when I connect to 3G network. I tried with ping 192.168.1.14. SSH (with putty) disconnects when modem is obtaining network parameters. Modem connection works normally. I can't troubleshoot this from console (this is headless system - no monitor, no keyboard). **What is the problem?**


How to get permission number by string : -rw-r--r--

I need to set the same chmod, how to get number for **-rw-r--r--** ?


/etc/shadow and /etc/passwd format compatibility

Are formats of files /etc/shadow and /etc/passwd same on all unix and unix- like systems same or are there significant differences? I mean syntax of files, not file location or name


Window with activity in GNOME, notifies but doesn't show itself after Alt+Tab?

When a process that has an open window is activated, it remains un-focused and hidden underneath other windows but gives a small notification below that there was action. This is particularly evident in these situations:   * **PCManFM File Manager** - when it is already open to a folder and is given a new one to open into a new tab   * **File-Roller** or **Archive Manager** - when it has a file open already and gets a new one and opens in a window. I use **Gnome 3.x** primarily. I've scoured to the end and back of `dconf` 30 times and the closest I could find was `focus_mode = click` and `auto_raise = true` but neither had any effect. I've been at this so long I'm bound to be overlooking something. Feel free to set me straight if you see something blatant I'm missing. **Here's the system setup:**   * Ubuntu 14.04 x64 (and Fedora 20)   * Gnome 3.x (all versions affected)   * AMD Catalyst 13 drivers for Radeon R9   * `gdm` ### EDIT #1 `nautilus` is affected by this as well I just confirmed. I really need these windows to show up when stuff happens. Especially because _I'm the one making the stuff happen_ , not some random process. Gladly will post any settings or config files as desired. ### EDIT #2 I have narrowed the action responsible down to `Alt`+`Tab` (even when re- assigned to a new key mapping **AND** when another mapping with a similar action is re-assigned to it). At first I thought it could be the **Alternate Tab** extension but disabling that did _nothing_. To replicate: Open a files window, `Alt`+`Tab` to another window and then open another instance of the file manager. It doesn't have to be in a tab; _it will occur with a new window as well._


Why do 'nohup' and 'disown' not work on SoX (invoked as 'play')

I can run this command:               $ play mylist.m3u      And music plays. I can then press Ctrl-Z to suspend the job, and issue `bg` to have it run in the background. However, if I then run `disown` and `exit`, the music stops playing, even though the `play` command still shows up in `ps`. I would expect the music to keep playing. **Also interesting** I run the command               $ play mylist.m3u &      Music does _not_ play. The job shows as the `stopped` status. I can also run the command               $ nohup play mylist.m3u &      And no music plays - the job immediately stops. However,               $ nohup play mylist.m3u      Does have music play, but I can't disown it, as before. * * * It seems like all these are related. Most programs behave well when `disown`ed or run through `nohup`, but not SoX. Does anyone know why?


How to prevent prompt that ask to restart services when installing libpq-dev

I want to install `libpq-dev` on my Vagrant machine. I install it with               $ apt-get install -y libpq-dev      During installation a prompt appears which asks if it's allowed to restart some services automatically. This prompt breaks my Vagrant provision. How can disable this prompt? ![prompt](http://i.imgur.com/U4Czr11.png) ****EDIT **** Thanks to Patrick's answer and this question I fixed it. Now my Vagrantfile contains:                sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libpq-dev


What is "raw mode in hex" from stat output?

When using GNU `stat` to probe the filesystem, there are a number of format sequences available for the `\--format`/`\--printf` arguments; this one in particular               %f    Raw mode in hex      doesn't make much sense. Comparing with %a, access mode, something might have (you can see this with `stat --format '%f %a'`) a raw mode of 41ed but an access mode of 755, or a raw mode of 81a4 and an access mode of 644. So what does "raw mode" mean?


Why doesn't this udev rule trigger upon removal of the device?

I have two mice, one which has an issue where the middle mouse button and button6 get triggered simultaneously. So I configured my `~/.Xmodmap` to disable this button. At the same time, however, I wanted to be able to still use this button with my other mouse. So I wrote a `udev` rule that called `xmodmap` to change the button layout depending on which mouse is connected. * * * ## Setup This is my current setup: **/etc/udev/rules.d/logitech-g7.rules** :               # deactivate MB 6 when mouse 1 is connected     ACTION=="add", ENV{DEVTYPE}=="usb_device", ENV{ID_VENDOR_ID}=="046d", ENV{ID_MODEL_ID}=="c51a", RUN+="/home/user/.scripts/Troubleshooting/Bugfixes/mouseswitcher_wrapper 1", OWNER="user"     # restore defaults when mouse 1 is disconnected     ACTION=="remove", ENV{DEVTYPE}=="usb_device", ENV{ID_VENDOR_ID}=="046d", ENV{ID_MODEL_ID}=="c51a", RUN+="/home/user/.scripts/Troubleshooting/Bugfixes/mouseswitcher_wrapper 0", OWNER="user"      **/home/user/.scripts/Troubleshooting/Bugfixes/mouseswitcher_wrapper** :               #!/bin/bash     /home/user/.scripts/Troubleshooting/Bugfixes/mouseswitcher "$1"&      **/home/user/.scripts/Troubleshooting/Bugfixes/mouseswitcher**               #!/bin/bash     sleep 1     DISPLAY=":0.0"     HOME=/home/user/     XAUTHORITY=$HOME/.Xauthority     export DISPLAY XAUTHORITY HOME          if [[ "$1" == 1 ]] #differentiate between ADD (1) event and REMOVE (0) event       then           /usr/bin/xmodmap /home/user/.XmodmapG7 > /dev/null 2>&1       else           /usr/bin/xmodmap /home/user/.Xmodmap > /dev/null 2>&1     fi      If this seams a bit overcomplicated it's only because I stumbled on a number of problems whith udev, xmodmap and the DISPLAY variable. My scripts are based on this Q&A. * * * ## Current state The ADD action works fine, the REMOVE action doesn't. Executing either of the RUN commands manually in a terminal works fine. * * * ## What I've tried so far I found this forum post outlining why udev has problems with removal actions and accordingly replaced the ATTRS with ENV variables. But all of this was to no avail, the REMOVE trigger still doesn't work. There's gotta be something I'm doing wrong. I would really appreciate it if someone around here more versed in udev and Linux in general could take a look at my case. * * * ## Additional information Output of `udevadm monitor --environment --udev` when plugging the receiver in:               ######ADD#######          monitor will print the received events for:     UDEV - the event which udev sends out after rule processing          UDEV  [21728.392805] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3 (usb)     ACTION=add     BUSNUM=002     DEVNAME=/dev/bus/usb/002/037     DEVNUM=037     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3     DEVTYPE=usb_device     ID_BUS=usb     ID_MODEL=USB_Receiver     ID_MODEL_ENC=USB\x20Receiver     ID_MODEL_ID=c51a     ID_REVISION=4100     ID_SERIAL=Logitech_USB_Receiver     ID_USB_INTERFACES=:030102:030000:     ID_VENDOR=Logitech     ID_VENDOR_ENC=Logitech     ID_VENDOR_ID=046d     MAJOR=189     MINOR=164     PRODUCT=46d/c51a/4100     SEQNUM=3139     SUBSYSTEM=usb     TYPE=0/0/0     UDEV_LOG=3     UPOWER_VENDOR=Logitech, Inc.     USEC_INITIALIZED=21727880859          UDEV  [21728.393864] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0 (usb)     ACTION=add     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0     DEVTYPE=usb_interface     INTERFACE=3/1/2     MODALIAS=usb:v046DpC51Ad4100dc00dsc00dp00ic03isc01ip02in00     PRODUCT=46d/c51a/4100     SEQNUM=3140     SUBSYSTEM=usb     TYPE=0/0/0     UDEV_LOG=3     USEC_INITIALIZED=21728393779          UDEV  [21728.395536] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1 (usb)     ACTION=add     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1     DEVTYPE=usb_interface     INTERFACE=3/0/0     MODALIAS=usb:v046DpC51Ad4100dc00dsc00dp00ic03isc00ip00in01     PRODUCT=46d/c51a/4100     SEQNUM=3146     SUBSYSTEM=usb     TYPE=0/0/0     UDEV_LOG=3     USEC_INITIALIZED=21728395426          UDEV  [21728.395737] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/0003:046D:C51A.004B (hid)     ACTION=add     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/0003:046D:C51A.004B     HID_ID=0003:0000046D:0000C51A     HID_NAME=Logitech USB Receiver     HID_PHYS=usb-0000:00:1d.0-1.3/input0     MODALIAS=hid:b0003g0001v0000046Dp0000C51A     SEQNUM=3141     SUBSYSTEM=hid     UDEV_LOG=3     USEC_INITIALIZED=21728395467          UDEV  [21728.398102] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/0003:046D:C51A.004C (hid)     ACTION=add     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/0003:046D:C51A.004C     HID_ID=0003:0000046D:0000C51A     HID_NAME=Logitech USB Receiver     HID_PHYS=usb-0000:00:1d.0-1.3/input1     MODALIAS=hid:b0003g0001v0000046Dp0000C51A     SEQNUM=3147     SUBSYSTEM=hid     UDEV_LOG=3     USEC_INITIALIZED=21728397927          UDEV  [21728.398650] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/0003:046D:C51A.004B/hidraw/hidraw2 (hidraw)     ACTION=add     DEVNAME=/dev/hidraw2     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/0003:046D:C51A.004B/hidraw/hidraw2     MAJOR=251     MINOR=2     SEQNUM=3145     SUBSYSTEM=hidraw     UDEV_LOG=3     USEC_INITIALIZED=21728398188          UDEV  [21728.399406] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/0003:046D:C51A.004C/hidraw/hidraw3 (hidraw)     ACTION=add     DEVNAME=/dev/hidraw3     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/0003:046D:C51A.004C/hidraw/hidraw3     MAJOR=251     MINOR=3     SEQNUM=3151     SUBSYSTEM=hidraw     UDEV_LOG=3     USEC_INITIALIZED=21728399273          UDEV  [21728.400119] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/usbmisc/hiddev1 (usbmisc)     ACTION=add     DEVNAME=/dev/usb/hiddev1     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/usbmisc/hiddev1     MAJOR=180     MINOR=1     SEQNUM=3150     SUBSYSTEM=usbmisc     UDEV_LOG=3     USEC_INITIALIZED=21727874845          UDEV  [21728.401438] add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/input/input73 (input)     ACTION=add     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/input/input73     EV=17     ID_BUS=usb     ID_INPUT=1     ID_INPUT_MOUSE=1     ID_MODEL=USB_Receiver     ID_MODEL_ENC=USB\x20Receiver     ID_MODEL_ID=c51a     ID_PATH=pci-0000:00:1d.0-usb-0:1.3:1.0     ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_3_1_0     ID_REVISION=4100     ID_SERIAL=Logitech_USB_Receiver     ID_TYPE=hid     ID_USB_DRIVER=usbhid     ID_USB_INTERFACES=:030102:030000:     ID_USB_INTERFACE_NUM=00     ID_VENDOR=Logitech     ID_VENDOR_ENC=Logitech     ID_VENDOR_ID=046d     KEY=ffff0000 0 0 0 0     MODALIAS=input:b0003v046DpC51Ae0111-e0,1,2,4,k110,111,112,113,114,115,116,117,118,119,11A,11B,11C,11D,11E,11F,r0,1,6,8,am4,lsfw     MSC=10     NAME="Logitech USB Receiver"     PHYS="usb-0000:00:1      Output of `udevadm monitor --environment --udev` when removing the receiver:               #######REMOVE#######               monitor will print the received events for:     UDEV - the event which udev sends out after rule processing          UDEV  [21800.789239] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/input/input75/mouse1 (input)     ACTION=remove     DEVLINKS=/dev/input/by-id/usb-Logitech_USB_Receiver-mouse /dev/input/by-path/pci-0000:00:1d.0-usb-0:1.3:1.0-mouse     DEVNAME=/dev/input/mouse1     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/input/input75/mouse1     ID_BUS=usb     ID_INPUT=1     ID_INPUT_MOUSE=1     ID_MODEL=USB_Receiver     ID_MODEL_ENC=USB\x20Receiver     ID_MODEL_ID=c51a     ID_PATH=pci-0000:00:1d.0-usb-0:1.3:1.0     ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_3_1_0     ID_REVISION=4100     ID_SERIAL=Logitech_USB_Receiver     ID_TYPE=hid     ID_USB_DRIVER=usbhid     ID_USB_INTERFACES=:030102:030000:     ID_USB_INTERFACE_NUM=00     ID_VENDOR=Logitech     ID_VENDOR_ENC=Logitech     ID_VENDOR_ID=046d     MAJOR=13     MINOR=33     SEQNUM=3178     SUBSYSTEM=input     UDEV_LOG=3     USEC_INITIALIZED=21797014959          UDEV  [21800.792866] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/input/input75/event6 (input)     ACTION=remove     DEVLINKS=/dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse /dev/input/by-path/pci-0000:00:1d.0-usb-0:1.3:1.0-event-mouse     DEVNAME=/dev/input/event6     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/input/input75/event6     ID_BUS=usb     ID_INPUT=1     ID_INPUT_MOUSE=1     ID_MODEL=USB_Receiver     ID_MODEL_ENC=USB\x20Receiver     ID_MODEL_ID=c51a     ID_PATH=pci-0000:00:1d.0-usb-0:1.3:1.0     ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_3_1_0     ID_REVISION=4100     ID_SERIAL=Logitech_USB_Receiver     ID_TYPE=hid     ID_USB_DRIVER=usbhid     ID_USB_INTERFACES=:030102:030000:     ID_USB_INTERFACE_NUM=00     ID_VENDOR=Logitech     ID_VENDOR_ENC=Logitech     ID_VENDOR_ID=046d     MAJOR=13     MINOR=70     SEQNUM=3179     SUBSYSTEM=input     UDEV_LOG=3     USEC_INITIALIZED=21797013896          UDEV  [21800.797061] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/input/input75 (input)     ACTION=remove     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/input/input75     EV=17     ID_BUS=usb     ID_INPUT=1     ID_INPUT_MOUSE=1     ID_MODEL=USB_Receiver     ID_MODEL_ENC=USB\x20Receiver     ID_MODEL_ID=c51a     ID_PATH=pci-0000:00:1d.0-usb-0:1.3:1.0     ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_3_1_0     ID_REVISION=4100     ID_SERIAL=Logitech_USB_Receiver     ID_TYPE=hid     ID_USB_DRIVER=usbhid     ID_USB_INTERFACES=:030102:030000:     ID_USB_INTERFACE_NUM=00     ID_VENDOR=Logitech     ID_VENDOR_ENC=Logitech     ID_VENDOR_ID=046d     KEY=ffff0000 0 0 0 0 0 0 0 0     MODALIAS=input:b0003v046DpC51Ae0111-e0,1,2,4,k110,111,112,113,114,115,116,117,118,119,11A,11B,11C,11D,11E,11F,r0,1,6,8,am4,lsfw     MSC=10     NAME="Logitech USB Receiver"     PHYS="usb-0000:00:1d.0-1.3/input0"     PRODUCT=3/46d/c51a/111     PROP=0     REL=143     SEQNUM=3180     SUBSYSTEM=input     UDEV_LOG=3     UNIQ=""     USEC_INITIALIZED=21796479085          UDEV  [21800.797132] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/0003:046D:C51A.004D/hidraw/hidraw2 (hidraw)     ACTION=remove     DEVNAME=/dev/hidraw2     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/0003:046D:C51A.004D/hidraw/hidraw2     MAJOR=251     MINOR=2     SEQNUM=3181     SUBSYSTEM=hidraw     UDEV_LOG=3     USEC_INITIALIZED=21800796369          UDEV  [21800.797172] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/0003:046D:C51A.004D (hid)     ACTION=remove     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/0003:046D:C51A.004D     HID_ID=0003:0000046D:0000C51A     HID_NAME=Logitech USB Receiver     HID_PHYS=usb-0000:00:1d.0-1.3/input0     MODALIAS=hid:b0003g0001v0000046Dp0000C51A     SEQNUM=3182     SUBSYSTEM=hid     UDEV_LOG=3     USEC_INITIALIZED=21800796501          UDEV  [21800.798537] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0 (usb)     ACTION=remove     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0     DEVTYPE=usb_interface     INTERFACE=3/1/2     MODALIAS=usb:v046DpC51Ad4100dc00dsc00dp00ic03isc01ip02in00     PRODUCT=46d/c51a/4100     SEQNUM=3183     SUBSYSTEM=usb     TYPE=0/0/0     UDEV_LOG=3     USEC_INITIALIZED=21800796538          UDEV  [21800.814181] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/input/input76/event7 (input)     ACTION=remove     DEVLINKS=/dev/input/by-id/usb-Logitech_USB_Receiver-event-if01 /dev/input/by-path/pci-0000:00:1d.0-usb-0:1.3:1.1-event     DEVNAME=/dev/input/event7     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/input/input76/event7     ID_BUS=usb     ID_INPUT=1     ID_INPUT_KEY=1     ID_MODEL=USB_Receiver     ID_MODEL_ENC=USB\x20Receiver     ID_MODEL_ID=c51a     ID_PATH=pci-0000:00:1d.0-usb-0:1.3:1.1     ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_3_1_1     ID_REVISION=4100     ID_SERIAL=Logitech_USB_Receiver     ID_TYPE=hid     ID_USB_DRIVER=usbhid     ID_USB_INTERFACES=:030102:030000:     ID_USB_INTERFACE_NUM=01     ID_VENDOR=Logitech     ID_VENDOR_ENC=Logitech     ID_VENDOR_ID=046d     MAJOR=13     MINOR=71     SEQNUM=3184     SUBSYSTEM=input     UDEV_LOG=3     USEC_INITIALIZED=21797013933     XKBLAYOUT=de     XKBMODEL=pc105          UDEV  [21800.816765] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/input/input76 (input)     ABS=1 0     ACTION=remove     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/input/input76     EV=1f     ID_BUS=usb     ID_INPUT=1     ID_INPUT_KEY=1     ID_MODEL=USB_Receiver     ID_MODEL_ENC=USB\x20Receiver     ID_MODEL_ID=c51a     ID_PATH=pci-0000:00:1d.0-usb-0:1.3:1.1     ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_3_1_1     ID_REVISION=4100     ID_SERIAL=Logitech_USB_Receiver     ID_TYPE=hid     ID_USB_DRIVER=usbhid     ID_USB_INTERFACES=:030102:030000:     ID_USB_INTERFACE_NUM=01     ID_VENDOR=Logitech     ID_VENDOR_ENC=Logitech     ID_VENDOR_ID=046d     KEY=4837fff 72ff32d bf544446 0 0 1 20f90 8b17c000 677bfa d9415fed 9ed680 4400 0 10000002     MODALIAS=input:b0003v046DpC51Ae0111-e0,1,2,3,4,k71,72,73,74,77,80,82,83,85,86,87,88,89,8A,8B,8C,8E,90,96,98,9B,9C,9E,9F,A1,A3,A4,A5,A6,A7,A8,A9,AB,AC,AD,AE,B0,B1,B2,B5,B6,CE,CF,D0,D1,D2,D4,D8,D9,DB,DF,E4,E7,E8,E9,EA,EB,F1,100,161,162,166,16A,16E,172,174,176,178,179,17A,17B,17C,17D,17F,180,182,183,185,188,189,18C,18D,18E,18F,190,191,192,193,195,198,199,19A,1A0,1A1,1A2,1A3,1A4,1A5,1A6,1A7,1A8,1A9,1AA,1AB,1AC,1AD,1AE,1B0,1B1,1B7,1BA,r6,a20,m4,lsfw     MSC=10     NAME="Logitech USB Receiver"     PHYS="usb-0000:00:1d.0-1.3/input1"     PRODUCT=3/46d/c51a/111     PROP=0     REL=40     SEQNUM=3185     SUBSYSTEM=input     UDEV_LOG=3     UNIQ=""     USEC_INITIALIZED=21796482192          UDEV  [21800.817249] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/usbmisc/hiddev1 (usbmisc)     ACTION=remove     DEVNAME=/dev/usb/hiddev1     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/usbmisc/hiddev1     MAJOR=180     MINOR=1     SEQNUM=3186     SUBSYSTEM=usbmisc     UDEV_LOG=3     USEC_INITIALIZED=21800816392          UDEV  [21800.818490] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/0003:046D:C51A.004E/hidraw/hidraw3 (hidraw)     ACTION=remove     DEVNAME=/dev/hidraw3     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/0003:046D:C51A.004E/hidraw/hidraw3     MAJOR=251     MINOR=3     SEQNUM=3187     SUBSYSTEM=hidraw     UDEV_LOG=3     USEC_INITIALIZED=21800816472          UDEV  [21800.818536] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/0003:046D:C51A.004E (hid)     ACTION=remove     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1/0003:046D:C51A.004E     HID_ID=0003:0000046D:0000C51A     HID_NAME=Logitech USB Receiver     HID_PHYS=usb-0000:00:1d.0-1.3/input1     MODALIAS=hid:b0003g0001v0000046Dp0000C51A     SEQNUM=3188     SUBSYSTEM=hid     UDEV_LOG=3     USEC_INITIALIZED=21800816908          UDEV  [21800.818580] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1 (usb)     ACTION=remove     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.1     DEVTYPE=usb_interface     INTERFACE=3/0/0     MODALIAS=usb:v046DpC51Ad4100dc00dsc00dp00ic03isc00ip00in01     PRODUCT=46d/c51a/4100     SEQNUM=3189     SUBSYSTEM=usb     TYPE=0/0/0     UDEV_LOG=3     USEC_INITIALIZED=21800816945          UDEV  [21800.818645] remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3 (usb)     ACTION=remove     BUSNUM=002     DEVNAME=/dev/bus/usb/002/038     DEVNUM=038     DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3     DEVTYPE=usb_device     ID_BUS=usb     ID_MODEL=USB_Receiver     ID_MODEL_ENC=USB\x20Receiver     ID_MODEL_ID=c51a     ID_REVISION=4100     ID_SERIAL=Logitech_USB_Receiver     ID_USB_INTERFACES=:030102:030000:     ID_VENDOR=Logitech     ID_VENDOR_ENC=Logitech     ID_VENDOR_ID=046d     MAJOR=189     MINOR=165     PRODUCT=46d/c51a/4100     SEQNUM=3190     SUBSYSTEM=usb     TYPE=0/0/0     UDEV_LOG=3     UPOWER_VENDOR=Logitech, Inc.     USEC_INITIALIZED=21796488421


remove /dev/mapper/fedora-root and /dev/mapper/fedora-swap

I want to replace Fedora 18 with Ubuntu but I have these devices listed when partitioning. I only have a hard disk labelled sda, where does these virtual device come from? How I do remove them?


Port monitoring on GNU/Linux based NAT router

I am using a Ubuntu machine as a NAT router. How can I find out the following:   * the ports on which the LAN machines are listening or communicating (both tcp and udp);   * which local machines have established connections with which WAN ip's on those ports;   * and the size of data that has been transfered on those ports.


Best way to get into Kernel programming?

Not so much asking what books (although if you know of any guides/tutorials that'd be helpful) but what is the best way to start doing kernel programming and is there a particular distro that would be best to learn on? Im mostly interested in the Device Drivers portion, but I wanna learn how the Kernel is set up as well (Modules and such) I have around 4-5 years Experience with C/C++ but it's mostly knowledge from College (so it's not like 4-5 years work experience lol if you know what I mean)


Wifi problem in fedora 20?

I have recently installed fedora 20 on my laptop. I am new to fedora/linux. I think its not having any wifi driver. My network controller is: Broadcom BCM43142. I dont have any other way to connect my laptop to the internet and that why solution on the other sites are not working. Where can i get the driver and can i download it on some other pc and install it on laptop later on? Please help.


Automatically dim the backlight of a secondary monitor on MAC

I have a 2010 iMac 27" as well as a 27" Apple Cinema Display. The iMac will auto-dim on inactivity, I'd say around 5 minutes. When the iMac dim's the Cinema Display is still bright. There is no "Automatically reduce the brightness of the display" option in Energy Saver or Displays within System Preferences. Anyone any suggestions? CLI commands would be preferred.


Is it Safe to write to linux Partition from Windows?

I do tasks some of which require Windows while some require Ubuntu and thus I sometime need to access linux from windows, though the reverse is easily possible. So, I searched in google and got an article: (http://www.howtogeek.com/112888/3-ways-to-access-your-linux-partitions-from- windows/) about accessing linux Partitions from Windows. In the Article it says that it might be messy to write using the software. So, what can really go wrong if I do write or is it safe to write to a linux partition in such a way?


Measurement of free ram through /proc/meminfo with ramdisk (initrd)

I am booting a disk image via PXE, it is a full system on an `initrd` ramdisk. I would like to measure the actual free memory of the system (not including buffers and file system caching). I was told this is done by adding the MemFree, Buffers and Cached values from `/proc/meminfo`. For a regular system this gives accurate results. However with my ramdisk setup it does not give accurate results. I assume that the memory that is used by the ramdisk is added to the "Cached" value:               [root@node1 ~]# cat /proc/meminfo     MemTotal:        8173700 kB     MemFree:         7443696 kB     Buffers:               0 kB     Cached:           650236 kB     SwapCached:            0 kB     MemCommitted:          0 kB     VirtualSwap:           0 kB     Active:            27156 kB     Inactive:         632204 kB     Active(anon):       4636 kB     Inactive(anon):     4616 kB     Active(file):      22520 kB     Inactive(file):   627588 kB     Unevictable:           0 kB     Mlocked:               0 kB     SwapTotal:             0 kB     SwapFree:              0 kB     Dirty:                 0 kB     Writeback:             0 kB     AnonPages:          9156 kB     Mapped:             8712 kB     Shmem:               128 kB     Slab:              38548 kB     SReclaimable:      29420 kB     SUnreclaim:         9128 kB     KernelStack:         536 kB     PageTables:         1268 kB     NFS_Unstable:          0 kB     Bounce:                0 kB     WritebackTmp:          0 kB     CommitLimit:     4086848 kB     Committed_AS:      51216 kB     VmallocTotal:   34359738367 kB     VmallocUsed:      288032 kB     VmallocChunk:   34359448036 kB     HardwareCorrupted:     0 kB     AnonHugePages:         0 kB     HugePages_Total:       0     HugePages_Free:        0     HugePages_Rsvd:        0     HugePages_Surp:        0     Hugepagesize:       2048 kB     DirectMap4k:       10240 kB      DirectMap2M:     8378368 kB      Now this unfortunately gives me incorrect values for two metrics I would like to calculate: %MemUsed and AmountMemFreeActual. With a Ramdisk the "Cached" value is at least in part unreclaimable, and therefore cannot be used to calculate the actual Free memory. To calculate both correctly, I would need to know the memory usage of the ramdisk, and i do not think I can simply take the "Cached" value, since this might also include other Cached Filesystem data. Preferably I would like to take the ramdisk memory use out of the picture for both metrics, since it is unreclaimable memory AFAIK. Any ideas where to look? Edit: "free" (@answer1) does provide the same wrong values. The "free" value from the "free" output is misleading anyways. "Free" memory is usually "Free"+"Buffers"+"Cached". My problem is that the ramdisk as non reclaimable memory (unlike usually cached filesystem data) cannot be reclaimed.


How to send mail from a remote SMTP host?

I have Postfix suite installed locally on Ubuntu 10.10. I can send/receive mail to my local address, e.g. `user@local.com`. I'm given credentials to a remote mail server mailbox, e.g. `other@remote.com`. What command line incantation on my local box would connect me to SMTP server at `remote.com` providing username and password and send mail through it? I've read `sendmail` and `smtp` manpages but that didn't give me any clue.


Adding Sleep command to shell script?

How can I add a 10sec sleep to my loop after each page is processed?               #!/bin/sh          for page in {1..50}     do         wget -q -U Mozilla "http://admin.domain.com/products_search/?p=$page" -O - \         | tr '"' '\n' | grep "^Product photo for " | cut -d ' ' -f 3 > bproduct.txt     done


Sed to reverse two words

echo "AXIS2C_HOME=/usr/local/Axis2C" | sed 's/\(^AXIS2C_HOME=\) \(.*\)/ \2 \1/'      The output I am expecting is `/usr/local/Axis2C AXIS2C_HOME=`. I can't figure out what I am doing wrong. :(


Disabling an Xorg server's extension at runtime (for new clients)?

I have an old Xorg server whose "Render" extension seems to be buggy (if enabled, most of the fonts are invisible, unless hovering over them -- after upgrading the packages with X clients and libraries). So, the problem is solved for new instances of the Xorg server by adding to `/etc/X11/xorg.conf`:               Section "Extensions"         Option      "RENDER" "Disable"     EndSection      But what if I want to continue an X session, but make new clients not use the extension? (Of course, logically, old clients can't be made not to use it; but what about new ones?) Some options are:   1. Can I turn one of the server's extension off on the fly, while the server is running?   2. Can I tell the clients not to use it (e.g., those written with a specific toolkit)?   3. IS there an "X proxy" which could be used for my goal: the proxy could simply not advertise that it has a "Render" extension, or translate the requests that involve it, and forward everything to the "physical" X server, and my new clients would then connect to the proxy's DISPLAY.


What is the equivalent of "ubuntu-desktop" package in Debian?

In Ubuntu, we can upgrade from text-mode installation to GUI desktop environment by installing `ubuntu-desktop` package. How to do the same with Debian?


Kernel Panic on 3.14.0-gentoo on an IBM 9228LGA / SMP Stack Trace

So I've spent the past weekend trying to get this IBM Xeon server up and running. I also took this opportunity to try and get a bootable GPT/Grub2/BIOS setup going. I am able to get the kernel booted, but I immediately get kernel panics. The kernel on the Gentoo LiveCD works fine. I've tried Gentoo and Vanilla sources and constantly see stack traces like the following. I've done a lot of searching and haven't been able to find anything useful. ![Kernel Panic on Boot](http://i.stack.imgur.com/YcFlk.jpg) I've tried disabling CPU Frequency scaling (based on some mailing lists that had a similar stack trace), but it gave me the same stack track on boot.


Difference between 2>&-, 2>/dev/null, |&, &>/dev/null and >/dev/null 2>&1

Just looking for the difference between   * `2>&-`   * `2>/dev/null`   * `|&`   * `&>/dev/null`   * `>/dev/null 2>&1` and their portability with `non-Bourne shells` like `tcsh`, `mksh`, etc.