title: tmpfs and vm.swappiness

text: I have started tuning a bit Linux VM performance on my system (yes. I know that vm.swappiness=0 will kill kittens but I found 30-40 as much better for me as it improved my latency - probably at cost of throughput). I would like to ask how the tmpfs is counted (is it cache or program) for purpose of swapping and `vm.swappiness`. To give higher level I need a folder which:   * Usually is empty but usage might increase to up to 8x my main memory size   * Do not need to be preserved about reboots   * Is low priority as far as I/O is concerned (i.e. programs using it might wait) but it would be nice if it was fast Currently I'm using a normal FS. I heard (not tested) about problems with large tmpfs pushing the data on swap. Since I assume that tests were done with default `vm.swappiness=60` and tmpfs is simply occupying only cache the decreased `vm.swappiness` would make it easier swappable during memory pressure. Am I correct?


title: php-mysql not working

text: I'm running on RHEL6. I have installed `php` and `php-mysql`. `<?php phpinfo(); ?>` is working perfectly. But I can't connect to MySQL is there a way to confirm that `php-mysql` is not working on my server [EDIT] I'm trying to connect to a remote database from a webpage when I open up my webpage it displays `Can't connect to MySQL server on 'ipaddress' (110)` Remote database is working and I can successfully telnet to that ip from my ip and port 3306


title: How to copy in two folders simultaneously using GNU parallel by spawning multiple threads?

text: I am trying to copy files from `machineB` and `machineC` into `machineA` as I am running my below shell script on `machineA`. If the files is not there in `machineB` then it should be there in `machineC` for sure so I will try copying the files from `machineB` first, if it is not there in `machineB` then I will try copying the same files from `machineC`. I am copying the files in parallel using GNU Parallel library and it is working fine. Currently I am copying two files in parallel. Earlier, I was copying the `PRIMARY_PARTITION` files in `PRIMARY` folder using GNU parallel and once that is done, then onnly I was copying the `SECONDARY_PARTITION` files in `SECONDARY` folder using same GNU parallel so it is sequential as of now w.r.t `PRIMARY` and `SECONDARY` folder. Now I decided to copy files in `PRIMARY` and `SECONDARY` folder simultaneously. Meaning, I will copy two files in `PRIMARY` folder along with two files in `SECONDARY` folder simultaneously. Below is my shell script which I have -               #!/bin/bash          export PRIMARY=/test01/primary     export SECONDARY=/test02/secondary     readonly FILERS_LOCATION=(machineB machineC)     export FILERS_LOCATION_1=${FILERS_LOCATION[0]}     export FILERS_LOCATION_2=${FILERS_LOCATION[1]}     PRIMARY_PARTITION=(550 274 2 546 278) # this will have more file numbers     SECONDARY_PARTITION=(1643 1103 1372 1096 1369 1568) # this will have more file numbers          export dir3=/testing/snapshot/20140103          find "$PRIMARY" -mindepth 1 -delete     find "$SECONDARY" -mindepth 1 -delete          do_CopyInPrimary() {       el=$1       scp david@$FILERS_LOCATION_1:$dir3/new_weekly_2014_"$el"_200003_5.data $PRIMARY/. || scp david@$FILERS_LOCATION_2:$dir3/new_weekly_2014_"$el"_200003_5.data $PRIMARY/.     }     export -f do_CopyInPrimary          do_CopyInSecondary() {       el=$1       scp david@$FILERS_LOCATION_1:$dir3/new_weekly_2014_"$el"_200003_5.data $SECONDARY/. || scp david@$FILERS_LOCATION_2:$dir3/new_weekly_2014_"$el"_200003_5.data $SECONDARY/.     }     export -f do_CopyInSecondary               parallel -j 2 do_CopyInPrimary ::: "${PRIMARY_PARTITION[@]}" &     parallel -j 2 do_CopyInSecondary ::: "${SECONDARY_PARTITION[@]}" &     wait          echo "All files copied."      **Problem Statement:-** With the above script at some point I am getting this exception -               ssh_exchange_identification: Connection closed by remote host     ssh_exchange_identification: Connection closed by remote host     ssh_exchange_identification: Connection closed by remote host      Is there any better way of doing the same thing as the way I am doing currently? I guess, I can still use GNU Parallel to make it work?


title: Copying files with a specific pattern

text: I am trying to copy files from one location to another and given below are some sample ones:               aaa_bbb_ccc_ddd_cost_code_20140330.gz     aaa_bbb_ccc_ddd_revenue_zone_20140329.gz     aaa_bbb_ccc_ddd_benefit_extract_20140330.csv.gz     aaa_bbb_ccc_ddd_profit_zone_20150509.csv.gz     aaa_bbb_ccc_ddd_loss_zone_20140330.csv     aaa_bbb_ccc_ddd_username.csv.gz      from the above list, the files that should be copied should be in the following format:               aaa_bbb_ccc_ddd_cost[or]revenue[or]benefit[or]profit[or]loss_yyyymmdd.csv.gz      which means that the files               aaa_bbb_ccc_ddd_loss_zone_20140330.csv     aaa_bbb_ccc_ddd_username.csv.gz      shouldn't be copied. Also, I need to assign it to a variable and I am trying something like this but it doesn't seem to work:               FILENAME="egrep 'aaa_bbb_ccc_ddd_(cost|revenue|benefit|profit)_code_[0-9]{8}.csv.gz'"      The reason I am trying to assign this to a variable is because I need to use it later in the code for something like this:               SOURCE_DIR="/temp"     DESTN_DIR="/output"     FILENAME=`egrep 'aaa_bbb_ccc_ddd_(cost|revenue|benefit|profit)_code_[0-9]{8}.csv.gz'`     echo "FILENAME is:" $FILENAME     for SAMPLE_FILE in $(ls "$SOURCE_DIR/$FILENAME")     do     cp $SAMPLE_FILE $DESTN_DIR     done      Is there an alternate way in which this can be achieved?


title: An alternative to `xdotool type`

text: Is there an alternative to               xdotool type "a string"      It will be more useful if it is not an X11 app. Because X11 apps seem to be more vulnerable. Note: I will not use it in a terminal window. So `echo` is not an alternative to that. `echo` does not type. It just prints something in terminal.


title: "Too many arguments to function" error while installing php5-pdo_mysql from ports in FreeBSD

text: I'm having a trouble while installing php5-pdo_mysql in my FreeBSD environment. Everytime I trys to do /usr/ports/databases/php5-pdo_mysql make install the console gives me this error:               /usr/ports/databases/php5-pdo_mysql/work/php-5.3.5/ext/pdo_mysql/mysql_driver.c:     501: error: too many arguments to function 'pdo_mysql_globals.dbg->m->func_leave'          /usr/ports/databases/php5-pdo_mysql/work/php-5.3.5/ext/pdo_mysql/mysql_driver.c:     In function 'pdo_mysql_check_liveness':     /usr/ports/databases/php5-pdo_mysql/work/php-5.3.5/ext/pdo_mysql/mysql_driver.c:     519: error: too many arguments to function 'pdo_mysql_globals.dbg->m->func_leave'          /usr/ports/databases/php5-pdo_mysql/work/php-5.3.5/ext/pdo_mysql/mysql_driver.c:     534: error: too many arguments to function 'pdo_mysql_globals.dbg->m->func_leave'          /usr/ports/databases/php5-pdo_mysql/work/php-5.3.5/ext/pdo_mysql/mysql_driver.c:      In function 'pdo_mysql_handle_factory':          /usr/ports/databases/php5-pdo_mysql/work/php-5.3.5/ext/pdo_mysql/mysql_driver.c:     763: error: too many arguments to function 'pdo_mysql_globals.dbg->m->func_leave'          *** Error code 1     1 error     *** Error code 1          Stop in /usr/ports/databases/php5-pdo_mysql.     *** Error code 1          Stop in /usr/ports/databases/php5-pdo_mysql.      My php version is 5.3.3 and pear 1.9.1. I tried to upgrade port tree of php5 to 5.3.5 but it failed. Saying I have to update apache22 first, but then updating apache22 also failed. What should I do now?


title: Why is echo "bar" -n different from echo -n "bar"?

text: Compare               echo -n "bar"      with               echo "bar" -n      The former does what _I_ think it's supposed to do (prints "bar" without a newline), while the latter doesn't. Is this a bug or by design? Why is it different than many cli programs in that you can't move the options around? For example, `tail -f /var/log/messages` is exactly the same as `tail /var/log/messages -f`. I sometimes do the latter when I forget I wanted the former, because internally the options and arguments are rearranged, usually by getopt. **Update:** yes I originally nerf-ed my question. I removed the nerf you'll have to view history to make some of the answers make sense.


title: ImageMagick on multiple files

text: I have converted a single file from BMP to PNG with ImageMagick's `convert` using the command below               convert CD\ Front.bmp CD\ Front.png      I have many such files, thus I tried:               for f in */*.bmp ; do convert $f ${f%bmp}png; done      but this command hangs forever. What am I doing wrong?


title: Changing gnome terminal transparency with a command in Ubuntu?

text: How can I change the transparency of the Terminal windows in Ubuntu with a command? I already know about the profile method but want a command so that I can quickly swap between transparent and opaque. My terminal is GNOME Terminal 2.30.2


title: zsh completion doesn't correct ? (question mark) in paths

text: So, I've been pretty happy with my zsh completion and correction configuration for a while now, with this being a major exception. Configured as I have it, the shell routinely catches and corrects incorrect case when I perform tab completion. For instance, it will easily correct `ls ~/DOcuments/somedir` to `ls ~/Documents/somedir`. However, it is every bit as easy, and notably for precisely the same reasons and in precisely the same manner, to type (for example) `cd ~?Somedir<tab>`. Of course, the user might reasonably expect the question mark to be considered as a possible mistake, such that (in the absence of a better match) his entry will be corrected to `cd ~/Somedir`. But instead, I get this sort of error message:               No matches for: `user' or `named directory'      Or, if I've entered a couple characters after the question mark, I might get a list of suggestions which, I assume (based on their content and the above error message), are active user processes. Does anybody know an easy way for me to get the desired result?


title: Modify the right click options when clicking a desktop icon

text: I'm wanting to restrict a standard user from being able to right click a desktop icon in Linux (Raspberry Pi running Debian wheezy). I don't want to disable the use of the right click totally (like xmodmap can)... We still need them to use the right click options in normal tasks etc.. Is there such a way to disable this menu option without disabling the right button completely?


title: Backing up a partition

text: I am pretty new to linux. I mostly started learning after I purchased a couple of Raspberry Pis. I like to make backups of my images as I have often made the mistake of corrupting my data :). Normally I use dd:               dd of=mybackup.img in=/dev/diskX bs=2m      Since my image is on an SD Card, the back up image takes the whole size of the SD card. For example, the size of the actually images is around 30mb, but the SD card is 32gb. The backup images is 32gb. I normally will zip/compress the file down to about 2gb. Still, I would like to back up the partition only e.g 30mb. if I type               df      I see the partition:                Filesystem    512-blocks       Used  Available Capacity   iused     ifree %iused  Mounted on     /dev/disk3s1      114576      38192      76384    34%       512         0  100%   /Volumes/boot       Can I use `dd` to backup the partition `/dev/disk3s1`?


title: Linux motion user - run it as ssh key as pi to remote server

text: This question is related to the two other questions I had earlier, about enabling Raspberry Pi to act as a motion sensor that will try to ssh into a more powerful server when it detects motion (the more power server will then do additional processing via a script). So here's what I did:   * On the Raspberry Pi, I installed Linux motion app   * I also used `ssh-keygen` on the Raspberry Pi and then using `ssh-copy-id` copies public keys to the more power server, so that the Raspberry Pi can `ssh` to the server without having to type in the password.   * On the `motion.conf` file, there's a line for `on_motion_detected` event for when the motion is detected by Raspberry Pi, on that line, I have something like:  > ssh user@more.powerful.server '/exec/some/script/here'   * But the script on the more powerful server is never executed because the motion daemon is running as user 'motion', rather than the user (pi) that did the ssh-keygen that the remote server accepts. I know this because:   * If I change the `on_motion_detected` command to:  > on_motion_detected echo hello_world | wall this command gets executed and I see it on all the terminals that are ssh'd into the Raspberry Pi   * Or, if instead of on the on_motion_detected line, I simply run `ssh user@more.power.server '/exec/some/script/here'` on the Raspberry Pi's command line (as user 'pi'), it also gets triggered by the server. So the question is, how do tell the Raspberry Pi's operating system to 'use' the key of the 'pi' user when the 'motion' user tries to ssh into the more powerful server, in that `on_motion_detected` event?


title: Can I remove files in /var/log/jounal and /var/cache/abrt-di/usr?

text: I use Fedora and these directories contains a large amount of files, I wonder whether I can delete them? The system is running low on space.


title: httpd fails to start after install

text: 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


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

text: `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.


title: How do I make a usb thumbdrive persistent?

text: 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?


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

text: 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?


title: What to do when ubuntu-vm-builder completed?

text: 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'


title: Global cache config of debootstrap

text: 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.


title: Where do I change my shell?

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


title: grep string from contents of file command then delete file

text: 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


title: dhcp: Host name lookup failure

text: 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


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

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


title: How to conditionally do something if a command succeeded or failed

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


title: mysql restoration process takes longer time

text: 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?


title: Completely restart Bash

text: 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.


title: PCI configuration registers problem

text: 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?


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

text: 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 :)


title: Auto continuous scrolling of man output

text: 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.


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

text: 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?


title: What to do when a linux desktop freezes?

text: 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?


title: Rvm posix error on arm Beagle bone black

text: 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?


title: Is Linus Torvalds a hacker?

text: 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!


title: I/O brings a machine to its knees

text: 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_ )


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

text: 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


title: How does the order of arguments influence the speed of find

text: 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`?


title: Extended monitor - scroll right to access left screen

text: 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


title: Command to run an application within a specific directory

text: 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).


title: Blacked out html folder in root directory

text: 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?


title: Installing mono on open suse

text: 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 ?


title: Cropping a JPG image

text: 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.


title: Install third party software on Linux from source

text: 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?


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

text: 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.


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

text: 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?


title: Issue on created folder permissions: temporary flag

text: 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)


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

text: 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".


title: What killed Beagle?

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


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

text: 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?


title: Fake serial number of USB device

text: 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.


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

text: 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?


title: Take copy of RAM

text: 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.


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

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


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

text: 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!


title: Not working udev rule with systemd-udevd on Fedora 19

text: 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 ?


title: vim stops sending text to * (X11) register?

text: 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.


title: Important scripts useful for a Linux system administrator

text: 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?


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

text: 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.


title: firefox bookmark updation

text: 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.


title: extract the characters before () using grep

text: 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...


title: Extract particular words from Rsyslog %msg% facility

text: 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?


title: Custom Linux Distro that runs just one program, nothing else

text: 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.


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

text: 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.


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

text: 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?


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

text: 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


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

text: 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 ?


title: Change Owner of Folder in SCO

text: 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


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

text: 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.


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

text: 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.


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

text: 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.


title: git push in gnome-term crashes my window manager

text: 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!


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

text: 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


title: top: how to cancel current command?

text: 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`?


title: Error while installing edx on debian squeeze

text: 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.


title: Set the button mapping of touchpad using xorg files

text: 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


title: How do I view the entire raw message in alpine?

text: 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.


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

text: 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?


title: How to apply org-todo to multiple items

text: 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.


title: Can't resize a partition using resize2fs

text: 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?


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

text: 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?


title: Mode to set Directory in Only READ-WRITE mode

text: 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...


title: Installing Domjudge in Fedora 19

text: 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.


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

text: 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?


title: emacs fonts from ssh not as good as locally installed

text: 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...


title: Is there a method for simulating high latency?

text: 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.


title: difference between useradd -b and useradd -d

text: 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.


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

text: 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


title: Delete backup files according to rules

text: 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?


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

text: 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).


title: wlan connection stops working when ppp 3g connection is running

text: 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?**


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

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


title: /etc/shadow and /etc/passwd format compatibility

text: 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


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

text: 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._


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

text: 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?


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

text: 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


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

text: 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?