title: Running `build-locale-archive` causes my ssh session to terminate

text: I had previously asked the question, How do I reduce the size of locale- archive?, and got a great answer to my question, but when I execute `build- locale-archive` I get disconnected from my RHEL6 host. How can I prevent this? Update: I decided to run ...               # strace -f -o /tmp/output build-locale-archive      ... and here's the only interesting output ...               17779 truncate("/usr/lib/locale/locale-archive.tmpl", 0) = 0     17779 execve("/usr/sbin/tzdata-update", ["/usr/sbin/tzdata-update"], [/* 0 vars */]) = 0     17779 open("/etc/sysconfig/clock", O_RDONLY) = 3     17779 read(3, "ZONE=\"Africa/Abidjan\"\nUTC=true\n", 32767) = 31     17779 read(3, "", 32736)                = 0     17779 close(3)                          = 0     17779 open("/usr/share/zoneinfo/Africa/Abidjan", O_RDONLY) = 3     17779 read(3, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0\2\0\0\0\0"..., 32768) = 156     17779 read(3, "", 32612)                = 0     17779 close(3)                          = 0     17779 open("/etc/localtime", O_RDONLY)  = 3     17779 read(3, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0\2\0\0\0\0"..., 32768) = 156     17779 read(3, "", 32612)                = 0     17779 close(3)                          = 0     17779 open("/var/spool/postfix/etc/localtime", O_RDONLY) = -1 ENOENT (No such file or directory)     17779 _exit(0)                          = ?      ... not sure what to make of that. Also it looks like `snmpd` and `crond` died when I ran `build-locale-archive`. Update II: Thanks for the answer Gilles, but it looks like I may not be following your suggestion correctly as I still loss my connection when I execute:               [root@dev-007 ~]# sysctl vm.overcommit_memory=2     vm.overcommit_memory = 2     [root@dev-007 ~]# (ulimit -v 100000; build-locale-archive)     build-locale-archive: cannot read archive header     [root@dev-007 ~]# cd /usr/lib/locale/     [root@dev-007 locale]# mv locale-archive locale-archive.tmpl     [root@dev-007 locale]# (ulimit -v 100000; build-locale-archive)     Connection to dev-007 closed.      Did I follow your instructions correctly? If not please let me know what I did wrong. Update III Sorry I has taken me so long to get back to you all. Here's my swap info:               [root@dev-007 ~]# swapon -s     Filename                                Type            Size    Used    Priority     /dev/sda3                               partition       10178552        0       -1     [root@dev-007 ~]# df /dev/sda3      Filesystem           1K-blocks      Used Available Use% Mounted on     -                       952296       184    952112   1% /dev


title: Is there a way to find a file in an inverse recursive search?

text: So say I'm in a directory that is deep within a file structure, such as               /home/cory/projects/foo/bar/bash/baz      I know that in either the current folder `baz` or one of the folders _above_ me (such as `home`, `cory`, `projects`, `foo`, `bar`, or `bash`) there is a file named `happy`. How can I find that file without searching a lot of extra folders?


title: MySql not accessible by root user

text: I have a local MySql server. It is started as I can access it with my local user like               $ mysql     Welcome to the MySQL monitor.  Commands end with ; or \g.     Your MySQL connection id is 66     Server version: 5.5.34-0ubuntu0.13.04.1 (Ubuntu)          Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.          Oracle is a registered trademark of Oracle Corporation and/or its     affiliates. Other names may be trademarks of their respective     owners.          Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.          mysql> exit      just fine but when i try with root, I keep getting this:               $ mysql -u root     ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)      What does this mean and how can I fix this? _**edit_** Also this doesn't work (after running `sudo mysql_install_db `):               $ /usr/bin/mysqladmin -u root password 'MyPass'     /usr/bin/mysqladmin: connect to server at 'localhost' failed     error: 'Access denied for user 'root'@'localhost' (using password: NO)'


title: Optimized way to list and delete files

text: I need to list and delete .php, .xml files. For this I am using `find` command. **To list :** `find . -type f -name \\*.php -print0` **To delete :** `find . -type f -name \\*.php -print0 | xargs -0 rm -r` As I run `find` two times. Is it possible to store result of first command and then reuse in second ? Thanks.


title: vim - Store a backup before each write

text: I want to create a backup of the file I'm editing before each write. For example, if I am editing some `file.txt`, when I go to write the file with `:w`, I want vim to first save a backup of `file.txt` within a directory (i.e. `~/.vim_backups/`) as `file_2013-01-01_01-01-01.txt`, where this represents `YYYY-MM-DD_HH-MM-SS.txt`. I am aware of alternatives such as version control, but I'm curious if this is possible in vim.


title: Running vmdk in ramdisk

text: I created a FreeBSD VM running on VMWare ESX, with a SCSI Harddisk. I added another SCSI disk (new vmdk file) to it and it booted perfectly fine. I then created a ramdisk on the VMWare ESX Host, and copied the new .vmdk file inside the ramdisk. I also made relevant path changes to the .vmx file. When I boot the VM, it gives me the error: " file not found" I checked the vmware.log file and it says:: `vmx| Unable to find file /vmfs/volumes/4d2ebaf1-571db8f7-3493-00145e55c628/abc/shehbaz-FreeBSD- Guest-1_1.vmdk` There is nothing wrong with the path (I have mounted the ramdisk /dev/ram1 on /vmfs/volumes/.../abc/) and I have double checked the .vmx file and the location of the file. Where am I going wrong? Is it not possible to run a vmdk file inside a ramdisk? Or should I make change to the parameter: `scsi0:1.deviceType = "scsi-hardDisk"` Does this connection need to be different from scsi-hardDisk for ramdisks?


title: How 'passwd' gains ROOT user permissions?

text: How does Linux knows that it has to give euid 0 (uid of root) to only certain process like passwd, setuid, etc. If a process can gain root user's permissions, will it not lead to security breach in Linux platform? For example, if I write a program that can gain root user permissions like passwd, I may corrupt important system files like /etc/passwd, /etc/groups. How still Linux manages to be secure?


title: Conky buffer too small?

text: e.g.: my sample conkyrc (the last line is the only important part!):               background yes     use_xft yes     xftfont Terminus:size=8     xftalpha 0.8     update_interval 5.0     total_run_times 0     double_buffer yes     own_window yes     own_window_type override     own_window_transparent yes     own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager     minimum_size 0 0     draw_shades yes     draw_outline no     draw_borders no     stippled_borders 8     border_margin 0     border_width 0     default_color ffffff     default_shade_color black     default_outline_color ffffff     alignment top_left     # gap_x - 1280x800 = 1105; 1024x768 = 820     gap_x 1200     gap_y 0     no_buffers yes     uppercase no     cpu_avg_samples 2     net_avg_samples 2     override_utf8_locale yes     use_spacer yes     TEXT          ${execpi 15 sleep $[ ($RANDOM % 3 ) ]; sh conkyscripts.sh}      AND               cat conkyscripts.sh      #!/bin/bash          for i in {1..40}; do echo "Welcome $i times"; done      So this should give output as the same as when doing "sh conkyscript.sh"               Welcome 1 times     Welcome 2 times     Welcome 3 times     Welcome 4 times     Welcome 5 times     Welcome 6 times     Welcome 7 times     Welcome 8 times     Welcome 9 times     Welcome 10 times     Welcome 11 times     Welcome 12 times     Welcome 13 times     Welcome 14 times     Welcome 15 times     Welcome 16 times     Welcome 17 times     Welcome 18 times     Welcome 19 times     Welcome 20 times     Welcome 21 times     Welcome 22 times     Welcome 23 times     Welcome 24 times     Welcome 25 times     Welcome 26 times     Welcome 27 times     Welcome 28 times     Welcome 29 times     Welcome 30 times     Welcome 31 times     Welcome 32 times     Welcome 33 times     Welcome 34 times     Welcome 35 times     Welcome 36 times     Welcome 37 times     Welcome 38 times     Welcome 39 times     Welcome 40 times      But nooooOO, because the conky gives this output to the Desktop: ![enter image description here](http://i.stack.imgur.com/24x6b.png) Why? Why does it stop at 16? Is some buffer to small? Or conky can't write scripts output longer the 16 Lines or what? :O


title: Does setting the system time back impair logrotate operation?

text: I'm working on an embedded linux system where the root filesystem is mounted from an SDcard. Although many systems like this just mount `/var/log` on a ramdisk, I'd like to save the logs to the SDcard for recording important events, so I left logrotate operational as usual so the SDcard is not filled up completely. Unfortunately, this system doesn't have a battery backing up the RTC, so if the system is powered down and up again the system time goes back to Jan 1st 1970. In this situation, I ran logrotate once and then checked the logrotate configuration with `logrotate -d /etc/logrotate.conf`:               # logrotate -d /etc/logrotate.conf      reading config file /etc/logrotate.conf     including /etc/logrotate.d     reading config file syslog     reading config info for /var/log/cron /var/log/debug /var/log/maillog /var/log/messages /var/log/secure /var/log/spooler /var/log/syslog      reading config info for /var/log/wtmp      reading config info for /var/log/btmp      error: bad year 1970 for file /var/log/syslog in state file /var/lib/logrotate.status          Handling 3 logs          rotating pattern: /var/log/cron /var/log/debug /var/log/maillog /var/log/messages /var/log/secure /var/log/spooler /var/log/syslog  weekly (4 rotations)     empty log files are rotated, old logs are removed     considering log /var/log/cron       log does not need rotating     considering log /var/log/debug       log does not need rotating     considering log /var/log/maillog       log does not need rotating     considering log /var/log/messages       log does not need rotating     considering log /var/log/secure       log does not need rotating     considering log /var/log/spooler       log does not need rotating     considering log /var/log/syslog       log does not need rotating     not running postrotate script, since no logs were rotated          rotating pattern: /var/log/wtmp  monthly (1 rotations)     empty log files are rotated, only log files >= 1048576 bytes are rotated, old logs are removed     considering log /var/log/wtmp       log does not need rotating          rotating pattern: /var/log/btmp  monthly (1 rotations)     empty log files are rotated, old logs are removed     considering log /var/log/btmp       log does not need rotating     error: could not read state file, will not attempt to write into it      Note that it complains that syslog has a bad year 1970 in logrotate status file `/var/log/logrotate.status`, which shows like this:               logrotate state -- version 2     "/var/log/syslog" 1970-1-1     "/var/log/debug" 1970-1-1     "/var/log/wtmp" 1970-1-1     "/var/log/spooler" 1970-1-1     "/var/log/btmp" 1970-1-1     "/var/log/maillog" 1970-1-1     "/var/log/httpd/*_log" 1970-1-1     "/var/log/wpa_supplicant.log" 1970-1-1     "/var/log/secure" 1970-1-1     "/var/log/mcelog" 1970-1-1     "/var/log/messages" 1970-1-1     "/var/log/cron" 1970-1-1     "/var/log/vsftpd.log" 1970-1-1      And in the end it says it will not attempt to write into the state file, so now I'm worried if that means the logs won't be rotated correctly. Does anyone know what happens to logrotate when something like this occurs? The chance of power failing where the system will be installed is low, so I prefer to leave time set correctly, but I'd really like to confirm that, in the event it fails, logrotate won't be screwed up.


title: The right way for dynamic ssh port-forwarding

text: Want my Firefox could use localhost:9099 proxy forwarded from vps server, why it doesn't it work this way? I always get `bind: Address already in use`               $ ssh -vfND 127.0.0.2:9099 vpn      OpenSSH_5.9p1, OpenSSL 1.0.0j-fips 10 May 2012     debug1: Connection established.     debug1: Host  is known and matches the RSA host key.     debug1: Next authentication method: publickey     debug1: Authentication succeeded (publickey).     debug1: Local connections to 127.0.0.2:9099 forwarded to remote address socks:0     debug1: Local forwarding listening on 127.0.0.2 port 9099.     bind: Address already in use     channel_setup_fwd_listener: cannot listen to port: 9099     debug1: Local connections to 127.1:8080 forwarded to remote address socks:0     debug1: Local forwarding listening on 127.0.0.1 port 8080.     debug1: channel 0: new [port listener]     debug1: Requesting no-more-sessions@openssh.com     debug1: forking to background      I add the next step in my solution of problem. The duplicate binding is solved it was a question of firewall on local machine now i can get connected to my vps server. But proxy in browser still doesn't work when i open a http in browser i get               The connection was reset The connection to the server was reset while the page was loading. If your computer or network is protected by a firewall or proxy, make sure  that Firefox is permitted to access the Web.      and on remote machine (VPS) i get the next               debug1: Connection to port 9099 forwarding to socks port 0 requested.     debug2: fd 6 setting TCP_NODELAY     debug2: fd 6 setting O_NONBLOCK     debug1: channel 2: new [dynamic-tcpip]     debug2: channel 2: pre_dynamic: have 0     debug2: channel 2: pre_dynamic: have 837     debug2: channel 2: zombie     debug2: channel 2: garbage collecting     debug1: channel 2: free: dynamic-tcpip, nchannels 3      **on remote machine**               # iptables -L -n -v                 state NEW tcp dpt:9099         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0              122 19030 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited          Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                  0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited      # netstat -lntp               Active Internet connections (only servers)     Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name         tcp        0      0 0.0.0.0:17500           0.0.0.0:*               LISTEN      1283/dropbox             tcp        0      0 0.0.0.0:55964           0.0.0.0:*               LISTEN      848/rpc.statd            tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      837/rpcbind              tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      5750/ssh                 tcp        0      0 127.0.0.1:9099          0.0.0.0:*               LISTEN      5750/ssh                 tcp        0      0 0.0.0.0:46165           0.0.0.0:*               LISTEN      1568/skype               tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      853/cupsd                tcp6       0      0 :::445                  :::*                    LISTEN


title: Show current "setterm" values/settings

text: I know that `setterm` can be used to adjust parameters such as screen blanking time on a virtual console. How can I show the current `setterm` settings/values for all parameters?


title: Debian 7: Gnome3 sometimes stops when loading

text: Sometimes (rather rarely) when I boot up my laptop, my Gnome3 desktop stops loading. I can move the mouse, but there's nothing else on the screen (except my wallpaper). And it seems that no matter how long I wait, the gnome menubar (the thingie with the Activities and shutdown buttons at the top of the screen) just refuses to load. Also my processor-usage starts to converge to 100% on all four cores, when this happens. This problem can be easily solved by restarting gdm3, but it's still annoying and I have no clue why this might happen. My system uses the standard gnome metapackage from the wheezy repo. (It might or might not be relevant.) I have no clue what causes this so any ideas are welcome.


title: Creating linux distro for use during exam

text: I'm thinking about creating a liveCD having some linux on it. The distro (let's call it Exam OS) is meant to be used by students during an exam and should be, at least, unpleasent to bypass. Let's assume that students can come with their own notebooks and they receive a bootable Exam OS on CD. The distro should be characterised by:   * limited network access (preferably only to wolframalpha.com and / or Overlord Server [verifying users]) - no communication with other students and the external web   * limited packages (but on the other hand some added like Maxima) The second point is, what I believe, the easy one. The first seems to get harder if I want to be sure that no matter how long they analyse CD (they can save it on their HDD, right?) they won't b able to bypass the limitations. What is more, the system should be easy to verify ( well students may make.. similar system which looks just like my). I was thinking about logging and registering to the Overlord so that you can look how many PC are logged and what names (real names i mean) are they registered to. Server could also provide the user wih some KEY which student would have to put on his paper (yeah, in fact it's all paper work and PC should be only helping). My questions are:   * on which distro should I base Exam OS   * what should I do to counter any attempts bypassing by students? Thanks for any thoughts on the matter.


title: Setting up digital piano and computer with MIDI interface

text: I have a MIDI cable that has IN and OUT interfaces. ![](http://i.stack.imgur.com/A7PqSm.jpg) I want to connect my piano (Yamaha P95) with the laptop (running Ubuntu), so I can record midi songs. I connected the cable between piano and laptop like in the following scheme:                Yamaha P95          +-- OUT :: IN-----------\          +-- IN  :: OUT-----------\------USB :: USB--+Laptop      No software can detect piano events. What are the ways to debug the problem? Have I done something wrong? Relevant output:               ionicabizau@laptop:~$ lsusb     Bus 002 Device 002: ID 8087:8000 Intel Corp.      Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 001 Device 002: ID 8087:8008 Intel Corp.      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub     Bus 003 Device 004: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller     Bus 003 Device 003: ID 04f2:b3fd Chicony Electronics Co., Ltd      Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     ionicabizau@laptop:~$ modprobe snd-usb-audio     modprobe: ERROR: could not insert 'snd_usb_audio': Operation not permitted     ionicabizau@laptop:~$ sudo modprobe snd-usb-audio     [sudo] password for ionicabizau:      ionicabizau@laptop:~$ lsusb     Bus 002 Device 002: ID 8087:8000 Intel Corp.      Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 001 Device 002: ID 8087:8008 Intel Corp.      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub     Bus 003 Device 004: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller     Bus 003 Device 003: ID 04f2:b3fd Chicony Electronics Co., Ltd      Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     ionicabizau@laptop:~$ arecordmidi -l      Port    Client name                      Port name      14:0    Midi Through                     Midi Through Port-0


title: How / where to get sources for kernel-2.6.36-gentoo-r4 in Gentoo Linux distribution?

text: How can I get (i.e. what command to use) sources for kernel-2.6.36-r4 (`uname -a` says that it is version 2.6.36-gentoo-r4), or where from I can download it? I want to compile the userside 'perf' tools, and I'd rather they match kernel version.


title: Ext4 exhibits unexpected write latency variance vs. ext2

text: I have a latency sensitive application running on an embedded system, and I'm seeing some discrepancy between writing to a ext4 partition and an ext2 partition on the same physical device. Specifically, I see intermittent delays when performing many small updates on a memory map, but only on ext4. I've tried what seem to be some of the usual tricks for improving performance (especially variations in latency) by mounting ext4 with different options and have settled on these mount options:               mount -t ext4 -o remount,rw,noatime,nodiratime,user_xattr,barrier=1,data=ordered,nodelalloc /dev/mmcblk0p6 /media/mmc/data `barrier=0` didn't seem to provide any improvement. For the ext2 partition, the following flags are used:               /dev/mmcblk0p3 on /media/mmc/data2 type ext2 (rw,relatime,errors=continue) Here's the test program I'm using:               #include <stdio.h>     #include <cstring>     #include <cstdio>     #include <string.h>     #include <stdint.h>     #include <sys/mman.h>     #include <sys/stat.h>     #include <sys/types.h>     #include <unistd.h>     #include <fcntl.h>     #include <stdint.h>     #include <cstdlib>     #include <time.h>     #include <stdio.h>     #include <signal.h>     #include <pthread.h>     #include <unistd.h>     #include <errno.h>     #include <stdlib.h>          uint32_t getMonotonicMillis()     {         struct timespec time;         clock_gettime(CLOCK_MONOTONIC, &time);         uint32_t millis = (time.tv_nsec/1000000)+(time.tv_sec*1000);         return millis;     }          void tune(const char* name, const char* value)     {         FILE* tuneFd = fopen(name, "wb+");         fwrite(value, strlen(value), 1, tuneFd);         fclose(tuneFd);     }          void tuneForFasterWriteback()     {         tune("/proc/sys/vm/dirty_writeback_centisecs", "25");         tune("/proc/sys/vm/dirty_expire_centisecs", "200");         tune("/proc/sys/vm/dirty_background_ratio", "5");         tune("/proc/sys/vm/dirty_ratio", "40");         tune("/proc/sys/vm/swappiness", "0");     }               class MMapper     {     public:         const char* _backingPath;         int _blockSize;         int _blockCount;         bool _isSparse;              int _size;         uint8_t *_data;         int _backingFile;         uint8_t *_buffer;              MMapper(const char *backingPath, int blockSize, int blockCount, bool isSparse) :             _backingPath(backingPath),             _blockSize(blockSize),             _blockCount(blockCount),             _isSparse(isSparse),             _size(blockSize*blockCount)         {             printf("Creating MMapper for %s with block size %i, block count %i and it is%s sparse\n",                     _backingPath,                     _blockSize,                     _blockCount,                     _isSparse ? "" : " not");             _backingFile = open(_backingPath, O_CREAT | O_RDWR | O_TRUNC, 0600);                  if(_isSparse)             {                 ftruncate(_backingFile, _size);             }             else             {                 posix_fallocate(_backingFile, 0, _size);                 fsync(_backingFile);             }             _data = (uint8_t*)mmap(NULL, _size, PROT_READ | PROT_WRITE, MAP_SHARED, _backingFile, 0);             _buffer = new uint8_t[blockSize];             printf("MMapper %s created!\n", _backingPath);         }              ~MMapper()         {             printf("Destroying MMapper %s\n", _backingPath);             if(_data)             {                 msync(_data, _size, MS_SYNC);                 munmap(_data, _size);                 close(_backingFile);                 _data = NULL;                 delete [] _buffer;                 _buffer = NULL;             }             printf("Destroyed!\n");         }              void writeBlock(int whichBlock)         {             memcpy(&_data[whichBlock*_blockSize], _buffer, _blockSize);         }     };                    int main(int argc, char** argv)     {         tuneForFasterWriteback();              int timeBetweenBlocks = 40*1000;         //2^12 x 2^16  = 2^28  = 2^10*2^10*2^8 = 256MB         int blockSize = 4*1024;         int blockCount = 64*1024;         int bigBlockCount = 2*64*1024;         int iterations = 25*40*60; //25 counts simulates 1 layer for one second, 5 minutes here                   uint32_t startMillis = getMonotonicMillis();              int measureIterationCount = 50;              MMapper mapper("sparse", blockSize, bigBlockCount, true);         for(int i=0; i<iterations; i++)         {             int block = rand()%blockCount;             mapper.writeBlock(block);             usleep(timeBetweenBlocks);             if(i%measureIterationCount==measureIterationCount-1)             {                 uint32_t elapsedTime = getMonotonicMillis()-startMillis;                 printf("%i took %u\n", i, elapsedTime);                 startMillis = getMonotonicMillis();             }         }              return 0;     }      Fairly simplistic test case. I don't expect terribly accurate timing, I'm more interested in general trends. Before running the tests, I ensured that the system is in a fairly steady state with very little disk write activity occuring by doing something like:               watch grep -e Writeback: -e Dirty: /proc/meminfo      There is very little to no disk activity. This is also verified by seeing 0 or 1 in the wait column from the output of `vmstat 1`. I also perform a sync immediately before running the test. Note the aggressive writeback parameters being provided to the vm subsystem as well. When I run the test on the ext2 partition, the first one hundred batches of fifty writes yield a nice solid 2012 ms with a standard deviation of 8 ms. When I run the same test on the ext4 partition, I see an average of 2151 ms, but an abysmal standard deviation of 409 ms. My primary concern is variation in latency, so this is frustrating. The actual times for the ext4 partition test looks like this:               {2372, 3291, 2025, 2020, 2019, 2019, 2019, 2019, 2019, 2020, 2019, 2019, 2019, 2019, 2020, 2021, 2037, 2019, 2021, 2021, 2020, 2152, 2020, 2021, 2019, 2019, 2020, 2153, 2020, 2020, 2021, 2020, 2020, 2020, 2043, 2021, 2019, 2019, 2019, 2053, 2019, 2020, 2023, 2020, 2020, 2021, 2019, 2022, 2019, 2020, 2020, 2020, 2019, 2020, 2019, 2019, 2021, 2023, 2019, 2023, 2025, 3574, 2019, 3013, 2019, 2021, 2019, 3755, 2021, 2020, 2020, 2019, 2020, 2020, 2019, 2799, 2020, 2019, 2019, 2020, 2020, 2143, 2088, 2026, 2017, 2310, 2020, 2485, 4214, 2023, 2020, 2023, 3405, 2020, 2019, 2020, 2020, 2019, 2020, 3591} Unfortunately, I don't know if ext2 is an option for the end solution, so I'm trying to understand the difference in behavior between the file systems. I would most likely have control over at least the flags being used to mount the ext4 system and tweak those.   * noatime/nodiratime don't seem to make much of a dent   * barrier=0/1 doesn't seem to matter   * nodelalloc helps a bit, but doesn't do nearly enough to smooth out the latency variation.   * The ext4 partition is only about 10% full. Thanks for any thoughts on this issue!


title: RANCID like configuration differ for linux applications

text: I'm looking for a RANCID-like (http://www.shrubbery.net/rancid/) config management tool - the catch is that I want to manage config files for Linux applications like mysql, apache, memcache, varnish, php, and so forth not network configs. What I'd like the tool to do is: 1) On a periodic basis query a predetermined list of servers (via SFTP/SSH/SCP?) 2) Check if a predetermined list of files have changed (maybe via checksum?) 3) If they've changed, do a diff on the new and old files, email the changes email address.   * This is for change control processes so that a team of people are aware AS changes happen and we have an audit trail. It needs to be real time or quasi real time (within 30 minutes of a change would be acceptable) 4) Commit the new file to a source control repository (SVN/GIT maybe?) I'm pretty sure RANCID can do most (all?) of this for network devices like Cisco routers, firewalls etc but the problem is it doesn't work for non- network devices (as far as I know). And I lack the perl knowledge and time to code a RANCID module to do the above. So what I am looking for is a RANCID like turnkey solution (free would be great but I'm not opposed to paying a reasonable price for it) that can do the above. Can anyone recommend anything? Disclaimer: I'm already aware of centralized configuration tools like Chef and Puppet. While great solutions, at this stage I'm not looking to do automated/centralized config deployments but rather continue to manually manage config files and simply have versioned backups and change notification.


title: Switching from Nvidia proprietary driver to Nouveau driver for Nvidia card on Debian wheezy

text: I am running Debian wheezy. I have the following Nvidia graphics card installed: GeForce 7300 SE/7200 GS. I am currently using the proprietary Nvidia graphics drivers. I have the following packages installed containing `nvidia` in their names.               ii  glx-alternative-nvidia                 0.2.2                    amd64                    allows the selection of NVIDIA as GLX provider     ii  libgl1-nvidia-alternatives             304.88-1+deb7u1          amd64                    transition libGL.so* diversions to glx-alternative-nvidia     ii  libgl1-nvidia-glx:amd64                304.88-1+deb7u1          amd64                    NVIDIA binary OpenGL libraries     ii  libglx-nvidia-alternatives             304.88-1+deb7u1          amd64                    transition libgl.so diversions to glx-alternative-nvidia     ii  libxvmcnvidia1:amd64                   304.88-1+deb7u1          amd64                    NVIDIA binary XvMC library     ii  nvidia-alternative                     304.88-1+deb7u1          amd64                    allows the selection of NVIDIA as GLX provider     ii  nvidia-glx                             304.88-1+deb7u1          amd64                    NVIDIA metapackage     ii  nvidia-installer-cleanup               20120630+3               amd64                    Cleanup after driver installation with the nvidia-installer     ii  nvidia-kernel-3.2.0-4-amd64            304.88-1+deb7u1+3.2.46-1 amd64                    NVIDIA binary kernel module for Linux 3.2.0-4-amd64     ii  nvidia-kernel-common                   20120630+3               amd64                    NVIDIA binary kernel module support files     ii  nvidia-kernel-dkms                     304.88-1+deb7u1          amd64                    NVIDIA binary kernel module DKMS source     ii  nvidia-kernel-source                   304.88-1+deb7u1          amd64                    NVIDIA binary kernel module source     ii  nvidia-settings                        304.88-1                 amd64                    Tool for configuring the NVIDIA graphics driver     ii  nvidia-support                         20120630+3               amd64                    NVIDIA binary graphics driver support files     ii  nvidia-vdpau-driver:amd64              304.88-1+deb7u1          amd64                    NVIDIA vdpau driver     ii  xserver-xorg-video-nvidia              304.88-1+deb7u1          amd64                    NVIDIA binary Xorg driver      I also have the following `xorg.conf` file.               Section "Device"     Identifier     "nVidia Corporation G70 [GeForce 7300 GS]"     Driver         "nvidia"     EndSection          Section "Screen"     Identifier     "My Screens"     Option         "TwinView" "1"     Option         "MetaModes" "1280x1024, 1920x1200"     EndSection      I want to try using the nouveau driver instead, but without removing the nvidia proprietary drivers. What steps do I need to take to switch to the nouveau driver? UPDATE: My attempt to switch to Nouveau failed - the X log appears here.


title: Open emacs in a terminal when editing crontab

text: I have setup `emacs` as my default editor in `/etc/profile`. When I want to use `emacs` in a terminal. I open it with the `-nw` option. How can I have the same behavior when doing a `crontab -e` preventing it to open in a window?


title: Upgrading CentOS 6.3 to 6.5

text: [Note: I manually moved this here from StackOverflow] I'm trying to update CentOS 6.3 to 6.5. If it matters, I'm doing this inside VBox 4.3.8, on a Mac running OSX 10.9.2. Following directions found on if-not-true-then-false.com: What version am I running?               $ cat /etc/redhat-release     CentOS 6.3 release (Final)          $ uname -r     2.6.32-279.el6.x86_64      Okay, let's try updating:               $ yum clean all     $ yum update glibc* yum* rpm* python*     $ yum update      That all seemed to go well. _(I'd paste the output but due to the inability to export cut-and-paste buffer, it's impractical -- in fact, what I'm ultimately trying to do is install VBOXADDITIONS to enable just that, which requires a 6.5 kernel.)_               $ reboot     :     $ cat /etc/redhat-release     CentOS release 6.3 (Final)      Hmm. Well, I don't loik that.               $ yum info kernel      Indicates that two kernels are "installed" - .279, and .436. The former is highlighted in such a way to suggest that it is the one currently running. _(I tried this whole thing yesterday, which is probably why there is a staged .436 version.)_ Any ideas what I'm doing wrong? Or what I may be confused about? The whole purpose of this exercise is to be able to install the **VBox Guest Additions 4.3.8** , which require CentOS 6.5 (6.3 being obsolete).


title: grub-install --no-floppy /dev/sda fails (Funtoo)

text: I am trying out Funtoo on a new machine. I've been through the installation process, as described in Funtoo Linux Installation . Specifically, the installation is done from within an existing Linux distro via chroot, though in a new empty SSD. All went fine up to the point of installing the bootloader which fails:               grub-install --no-floppy /dev/sda     source_dir doesn't exist. Please specify --target or --directory      The partitions created are:               Number  Start (sector)    End (sector)  Size       Code  Name        1            2048         1026047   500.0 MiB   8300  Linux filesystem        2         1026048         1091583   32.0 MiB    EF02  BIOS boot partition        3         1091584       269527039   128.0 GiB   8200  Linux swap        4       269527040       395356159   60.0 GiB    8300  Linux filesystem        5       395356160       479242239   40.0 GiB    8300  Linux filesystem        6       479242240       500118158   10.0 GiB    8300  Linux filesystem      and the `/etc/fstab` looks like               /dev/sda1               /boot           ext2            noatime 1 2     /dev/sda3               none            swap            sw              0 0     /dev/sda4               /               ext4            noatime         0 1     /dev/sda5               /osgeo          ext4            auto,rw,exec,user 0 2     /dev/sda6               /home           ext4            defaults,noatime 0 2     #/dev/cdrom             /mnt/cdrom      auto            noauto,ro       0 0      The /dev/sda1 partition is mounted as reported by `mount`               ...     /dev/sda1 on /boot type ext2 (rw,relatime)     ...      If it matters, the existing Linux distro has a similar GPT scheme, of course, in another disk than the target for Funtoo. Some info about it:               cat /proc/mounts | grep boot     /dev/sdb1 /boot ext4 rw,relatime,data=ordered 0 0     /dev/sdb2 /boot/efi vfat rw,relatime,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0     /dev/sda1 /boot ext2 rw,noatime 0 0      What else is there to be done? Do I have to mount `/dev/sda2` as well? Thanks for any hints!


title: Can't Install netflix-desktop in Debian....Aptitude Has Unmet/Broken Dependencies

text: I'm trying to install the netflix-desktop package in Debian 'jessie'. I was able to get this to work on my laptop running Debian 'wheezy' a few months ago, but on my desktop I keep running into these errors when I run:               aptitude install netflix-desktop      I already added the i386 architecture and tried running `apt-get install -f` and `aptitude install -f` to try and fix any broken packages. It's worth noting that it's not just the 'netflix-desktop' package that does this: other packages (which are also 'netflix-desktop' dependencies) like 'ia32-libs' give similar messages about broken dependencies. So I'm a little stumped. If anybody has any ideas I'd greatly appreciate it.


title: How to convert binary installer into rpm?

text: There are times when all you have is binary installer. I hate them because once installed it is quite difficult to uninstall such software, and since my distro (openSUSE 11.4) is rpm-based it is hard to get consistent info about what is installed in the system. Is there any way to convert binary installer into rpm? **For my own purposes only!** (it means the machine -- e.g. CPU -- is exactly the same). The only idea I have -- it is a crazy one -- is to create virtual system (with VBox for example) list all files in the system, execute installer, list all files again. Check what was added, copy those files, and in rpm spec add those files with simple "cp" command. It is tiresome, but it is worse than that because installer can alter some files, so they would be listed in both cases. So I am looking for something smarter. For now I would like to make rpm for IntelliJ IDEA. Any ideas?


title: Stuck/hung upon connect usb device

text: I have a device the is coming up 'busy' as soon as I plug it in. I even sniffed the usb connection and all looks normal. How do I find out what is capturing the device? How do I free it up?               root@coined:~# VBoxManage list usbhost     Host USB Devices:          UUID:               a287040d-bdf3-488a-8c45-9ab0a04c8263     VendorId:           0x04d8 (04D8)     ProductId:          0x000a (000A)     Revision:           1.0 (0100)     Port:               3     USB version/speed:  2/1     Manufacturer:       TECHNOBIT HEX ASIC Miner.     Product:            HEX16C-Avalon2 ASIC Miner     Address:            sysfs:/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.4//device:/dev/vboxusb/003/010     Current State:      Busy          UUID:               511d4477-4b2d-4117-b30b-251f4c0c65d8     VendorId:           0x04d9 (04D9)     ProductId:          0x1605 (1605)     Revision:           1.1 (0101)     Port:               2     USB version/speed:  1/1     Manufacturer:     Product:            USB Keyboard     Address:            sysfs:/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.3//device:/dev/vboxusb/003/003     Current State:      Captured      * * *               root@coined:~# udevadm info /dev/vboxusb/003/010     P: /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.4     N: bus/usb/003/010     E: BUSNUM=003     E: DEVNAME=/dev/bus/usb/003/010     E: DEVNUM=010     E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.4     E: DEVTYPE=usb_device     E: DRIVER=usb     E: ID_BUS=usb     E: ID_MODEL=HEX16C-Avalon2_ASIC_Miner     E: ID_MODEL_ENC=HEX16C-Avalon2\x20ASIC\x20Miner     E: ID_MODEL_FROM_DATABASE=CDC RS-232 Emulation Demo     E: ID_MODEL_ID=000a     E: ID_REVISION=0100     E: ID_SERIAL=TECHNOBIT_HEX_ASIC_Miner._HEX16C-Avalon2_ASIC_Miner     E: ID_USB_INTERFACES=:020201:0a0000:     E: ID_VENDOR=TECHNOBIT_HEX_ASIC_Miner.     E: ID_VENDOR_ENC=TECHNOBIT\x20HEX\x20ASIC\x20Miner.     E: ID_VENDOR_FROM_DATABASE=Microchip Technology, Inc.     E: ID_VENDOR_ID=04d8     E: MAJOR=189     E: MINOR=265     E: PRODUCT=4d8/a/100     E: SUBSYSTEM=usb     E: TYPE=2/0/0     E: USEC_INITIALIZED=118225936790


title: Issue with yum - error in importing one of the python modules

text: I am trying to install rpm package on CentOS 6 using `yum install` command, but getting folowing error               There was a problem importing one of the Python modules     required to run yum. The error leading to this problem was:             libldap-2.4.so.2: cannot open shared object file: No such file or directory          Please install a package which provides this module, or     verify that the module is installed correctly.          It's possible that the above module doesn't match the     current version of Python, which is:     2.6.5 (r265:79063, Nov 12 2010, 00:52:45)      [GCC 4.4.4 20100525 (Red Hat 4.4.4-5)]      Please suggest how to solve this. and ask if more info required.


title: How do postfix and mailx interact with mbox locking?

text: If postfix is setup as the MTA using its virtual transport to deliver mail to a local mbox file (and handling delivery of outgoing messages), and mailx is the MUA, being used on that same computer for reading and composing messages, can only one of these operations happen at once due to mbox file locking? If a user is using mailx to read their messages and perhaps reply to or compose a few messages, does this prevent postfix from delivering new messages to the user's mbox file? Does this create a situation where the user might not receive some messages due to the incoming messages being bounced? What is the process for mbox file locking here? When and where is it happening? I am trying to get a better idea of how this works.


title: How can I find and install pacman-color or cope?

text: I'm using Arch-Linux and I'm trying to install something that colors the text in the terminal (xterm), but not necessarily just for xterm. It would be nice to find something for text without initializing the X server. I've found (after a little search on google) that `pacman-color` already exists in the AUR, but I haven't managed to extract & install it. Is there someone that can help me with this problem? I'd like to know the steps for installing `pacman-color`? If you have other suggestions on how I can change the text color, I would be very happy if you could share the answer!


title: Resolution problems with external monitor in ElementaryOS

text: The specifications are:               sudo lshw -C video     [sudo] password for cipricus:        *-display                           description: VGA compatible controller            product: RV380/M24 [Mobility Radeon X600]            vendor: Hynix Semiconductor (Hyundai Electronics)            physical id: 0            bus info: pci@0000:01:00.0            version: 00            width: 32 bits            clock: 33MHz            capabilities: pm pciexpress msi vga_controller bus_master cap_list rom            configuration: driver=radeon latency=0            resources: irq:43 memory:c0000000-c7ffffff ioport:2000(size=256) memory:c8      The problem seems to be that **at certain resolutions the two monitors cannot work together** (distorted image on both) . Also, my experience is greatly affected by the **default configuration/reaction** that the system adopts when connected to the external monitor or when it is started with the external monitor already connected (I also have a question on how to modify that default behavior). If started with the monitor already connected, both displays are started (and work ok) with the same resolution: 1280x720 (16:9) that is, mirror display, which is below the maximum of both. The maximum of the internal monitor is 1680x1050 (16:10). That of the external is 1360x768 (16:9); this value is not available for the internal monitor. If the external monitor is connected when the computer is already started, the image is severely distorted on both monitors, which are thus not usable. ![enter image description here](http://i.stack.imgur.com/tQXKm.png) I can use shortkeys to turn off one of them and access the 'Displays' setting and try different combinations. The available resolutions of the two monitors are: ![enter image description here](http://i.stack.imgur.com/nMa7Y.png) ![enter image description here](http://i.stack.imgur.com/DVIMt.png) What I see is that they cannot work together at all possible combinations of resolutions. (The higher resolution of the external monitor works only in combination with the three lowest resolutions of the internal monitor. The second higher resolution of the external works with all **but** the first three higher of the internal. The lowest resolution of the external monitor works with all internal resolutions.) I think that **when the external monitor is connected after startup, the monitors take their maximum resolutions or other combination that is not accepted, which does not work and give that distorted image**. There are other combinations in which they do not work, but in many, as mentioned, they do work (and create extended monitor). If set to mirror monitor, they will automatically take the same resolution 1280x720 (16:9) and work ok. What the cause of this may be? I use the default radeon driver. Never had this problem in other ubuntu linuxes.


title: How to interleave the lines of two or more files?

text: I have tried to get the 2 files output in a single file. I have tried below command:               cat file1 file2      but here `file2` data is appending to `file1`. What I need is `file1` 1st line followed by `file2` first line, and `file1` second line followed by `file2` second line etc. Can anybody tell me how to do this in a simple way?


title: Input/output error using jmtpfs not saving file when copying to device

text: I'm trying to mount an Android device on Debian using:               jmtpfs /media/mobile      But when I try to copy a file from my system to the device I get an input/output error saying that the file can't be closed. Am I missing some parameter or something to enable the transfer?


title: How to get memory used(RAM used) using linux command?

text: I am trying to retrieve memory used(RAM) in percentage using linux command. My cpanel shows Memory Used which I need to display on a particular webpage. From forums, I found out that correct memory can be found from the following:               free -m      Result:               -/+ buffers/cache:        492       1555      -/+ buffers/cache: contains the correct memory usage. I dont know how to parse this info or if there is any different command to get the memory used in percentage.


title: How do I set a file's mtime in epoch format?

text: I know how to _get_ a file's mtime in epoch format:               stat --format=%Y <file>      But I have not been able to figure out how to _set_ a file's mtime in epoch format. The touch(1) man page appears to only accept a "timestamp" value (more-or-less fixed format which uses months, days, hours, minues, etc) or a "mostly free format human readable date string". Is there another utility I should be looking into? Thanks.


title: How to block incoming and allow outgoing mails for a no-reply user on Sendmail?

text: I am trying to block inbound emails for no-reply user and allow it to send emails at the same time. I tried editing the configuration in `/etc/mail/virtusertable` with:               no-reply@example.com     error:5.7.0:550 Invalid Address      But when I tried sending a test email with `root`, the email got bounced back to my postmaster with the "Invalid Address" error. So, I guess the setting affects both sending and receiving of mails. As I need to receive emails for some other users, is there anyway I can block incoming mails and yet allow outgoing ones without closing inbound port 25 on my firewall?


title: ActiveMQ doesn't start on Ubuntu 14.04

text: One of the packages which seems to be plagued with problems is `activemq`. After installing it, it's necessary to enable one of the queues with a simple symlink:               sudo ln -s /etc/activemq/instances-available/main \         /etc/activemq/instances-enabled/main      Next, start the service:               sudo service activemq start      Is it running?               ps aux | grep '[a]ctive'      Nope. Maybe it's not showing up properly?               ps aux | grep '[j]ava'      Nope. Start it up in foreground mode:               sudo activemq console      Great, classpath errors right out of the box (pastebin):               Caused by: java.io.FileNotFoundException: class path resource [activemq.xml] cannot be opened because it does not exist         at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:158)         at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)         ... 25 more      How do I fix what's wrong with ActiveMQ so I can get it to start?


title: how to count total number of words in a file?

text: I am looking for a command to count number of all words in a file. For instance if a file is like this,               today is a      good day      then it should print `5`, since there are `5` words there.


title: Program for taking snap-shots of movie?

text: Are there any programs that would let me specify parts of a video-file (avi, mpeg, mp4, ...) and take "snap-shots" every so-and-so second/minute, and store it as a series of image-files (eg. jpeg)? For example select part of a movie between 0h45m and 1h00m, and take a "snap-shot" every 30 second. It may be part of or a plug-in for a video-player (eg. VLC)... the point is that I need something that takes snap-shots automatically, not maually. Further more, are there any good programs for turning such a series of image- files into an animated-GIF or-PNG file? (It would of course be a bonus if the snap-shot program could optionally save the snaps as animated GIF/PNG.)


title: XEN stop all virtual machine when shutdown

text: I am using XEN on CentOS 6.5 64 I want a way to stop all virtual machine when XEN server shutdown I build service call in stop `xm shutdown -a` but not working               #!/bin/bash     # chkconfig: 2345 95 20     # description:      # processname:           stop()     {         /usr/sbin/xm shutdown -a        while [[ true ]]; do          if [[ `virsh list|wc -l` == 4 ]]; then            break          fi          sleep 1        done     }          case "$1" in       stop)         stop         ;;       *)         echo $"Usage: $prog {stop}"     esac      ![enter image description here](http://i.stack.imgur.com/MB3Pk.png)


title: nginx should not handle unicorn's request

text: I have a server on which I have configured Nginx and Unicorn, where Unicorn servers static pages. In my case I'm writing a rewrite rule in Nginx that, if a request comes to `mydomain.com` it should redirect to another domain, which is possible with following rule.               location / {     rewrite ^/$ yahoo.com;     }      Well, the above code is working fine for me, but when I write `mydomain.com/docs/web` in the address bar, Nginx throws 404 page. Basically, in my case Unicorn handles this request (when above Nginx code **does not** exist), and I want it so that Unicorn should handle this request when the above code exists in Nginx.


title: How to get Apache to use upgraded PHP

text: I need to upgrade to a higher version of php. My current version is 5.1.6. So I am trying to upgrade php to version 5.3.26. php installed just fine in /usr/local. But at least according to wordpress, apache is still seeing the older version of php. The .bashrc and .bash_profile have been modified for root to point to /usr/local/bin first (where the newer version of php is installed). What else do I need to do?


title: How can I tell If a file is NTFS encrypted?

text: When I copied some files from work onto my external hard drive it copied them as encrypted files. **NOTE:** The drive is not encrypted - just individual files. Now when I try to copy files from the external drive to my PC, Nautilus crashes. In fact Nautilus crashes even when I browse a directory that contains an encrypted file. I can browse the file system using the terminal, although I get "Permission Denied" errors if I try to copy the encrypted files. On Windows the encrypted files are listed in green in Windows explorer. Is there anyway that I can list which files on the external drive are encrypted? ### UPDATE #1 I understand that you cannot decrypt these encrypted files under Linux per this Q&AL Use Linux to read contents of Windows encrypted folder. However, I can list them in the terminal so I'm looking for a way to list which ones are encrypted and which ones are not.


title: Where can I see the processes running at startup?

text: I'm using backtrack5 R2 and sometimes when I log in the information showed says that `There is 1 zombie process`, where can I see what process is running?


title: Remove an IPTable Rule

text: I'm having troubles removing this `ipables` rule in Ubuntu:               $ iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3128      I've tried using the `-D` attribute but with no success. How can I remove this? I've tried flushing the tables but that didn't seem to work. Any suggestions?


title: csplit not obeying backslash r \r as carriage return

text: I have a file with `\r\n` line endings (CRLF carriage return line feed). This command works:               $ csplit --silent --prefix=email-emailbad.txt- \         --digits=3 emailbad.txt '/^\.^M/'+1 '{*}'      This requires that I press `CTLR`+`V` and then `CTRL`+`M` to insert an actual carriage return character. I want this to work, so that I'm using only printable characters (for SVN, etc.)               $ csplit --silent --prefix=email-emailbad.txt- \         --digits=3  emailbad.txt '/^\.\r/'+1 '{*}'      I've tried with single and double quotes, and without quotes. Any suggestions welcome.


title: How to modify the default setting adopted by xrandr when connecting an external monitor?

text: I am confronted with a problem of conflict of resolutions (this is a separate question), which makes the display image distorted on both monitors. But this bothers me the most when connecting the external monitor while the computer is open. At that point it seems that xrandr adopts one of the combinations that do not work. As a workaround to the other larger problem, **I want to be able to modify the default display settings that xrandr has upon connecting the external monitor while the computer is running.** (So that I may put a setting that avoids the problem: either by a combination of resolutions that works, or by starting just one of the monitors). If I connect the external monitor before starting the system, xrandr selects mirror display at a certain rather low resolution that works. * * * Update:               xrandr     Screen 0: minimum 320 x 200, current 1360 x 768, maximum 4096 x 4096     VGA-0 connected 1360x768+0+0 (normal left inverted right x axis y axis) 580mm x 320mm        1360x768       60.0*+        1280x720       60.0          1024x768       60.0          800x600        60.3          640x480        60.0       DVI-0 disconnected (normal left inverted right x axis y axis)     LVDS connected (normal left inverted right x axis y axis)        1680x1050      60.1 +        1400x1050      60.0          1280x1024      59.9          1440x900       59.9          1280x960       59.9          1280x854       59.9          1280x800       59.8          1280x720       59.9          1152x768       59.8          1024x768       59.9          800x600        59.9          848x480        59.7          720x480        59.7          640x480        59.4       S-video disconnected (normal left inverted right x axis y axis)      When I connect the external desktop I want to use it at its best resolution (which, considering my other problem, excludes the use of the internal monitor). I can set from GUI the resolution for dual monitor. But upon connecting the cable for the external monitor, I want the internal to go off and the external to have 1360x768 - just like they were when I ran the `xrandr` command above.


title: Raspberry Pi webcam server streaming via an IP?

text: I developed one webcam server using my Raspberry Pi and Logitech webcam and Motion library. I'm able to view the stream by using Raspberry Pi's IP. If I use an IP camera instead of a normal webcam, how can I access the stream. Any ideas?


title: Hold and release CUPS print jobs from command line

text: Is is possible to hold and release CUPS print jobs from command line? How to do it? I tried cupsenable:               sudo cupsenable --release myprinter      but it didn't work.


title: LinuxMint15: Suspend to RAM not working

text: I just installed LinuxMint15 on an Acer Aspire V3-771G-73638G500Maii. Hibernation works. But suspend to RAM does not. When clicking suspend: After a few seconds the screen goes grey and then off. The network is turned off. The computer's fan stops spinning. The power LED is slowly blinking orange. The battery led still on. All in all this is what I would expect. When clicking the power button the fan turns on. The power LED goes blue. Harddisk LED blinks a few times. Up to here it looks like what I would expect. But then: Screen remains off. Network remains down. A running "cat" started before suspending does not continue running (i.e. the harddisk LED does not start blinking hectically). Clicking the power button again does nothing. Power off is needed. Ctrl-Alt- SysRq-REISUB does not boot the system. This leads me to believe that this is not just an issue re-activating the graphics card, but that the system is not running. The system has full disk encryption, so this problem could be that the system is selecting the wrong graphics card (showing nothing on the screen) and awaiting passphrase, but entering the passphrase in the blind does nothing (i.e. the running "cat" does not continue). What is going on? How can I fix it, so that suspend to ram (and restore) actually works? * * * System info: Linux mint15 3.8.0-25-generic #37-Ubuntu SMP Thu Jun 6 20:47:07 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux Two graphics cards (lshw):                           description: VGA compatible controller                 product: GK107M [GeForce GT 740M]                 vendor: NVIDIA Corporation                   description: VGA compatible controller              product: 3rd Gen Core processor Graphics Controller              vendor: Intel Corporation      I am pretty sure it only uses the Intel card (nothing in syslog or Xorg.0.log says anything about nv, nvidia, nouveau). I added this to /etc/default/grub to make restoring graphics from hibernation work:               GRUB_GFXPAYLOAD_LINUX=text     GRUB_CMDLINE_LINUX_DEFAULT="nomodeset"      The system has full disk encryption. pm-suspend.log:               Initial commandline parameters:      Sat Oct 12 11:10:07 CEST 2013: Running hooks for suspend.     Running hook /usr/lib/pm-utils/sleep.d/000kernel-change suspend suspend:          /usr/lib/pm-utils/sleep.d/000kernel-change suspend suspend: success.     Running hook /usr/lib/pm-utils/sleep.d/00logging suspend suspend:     Linux aspire 3.8.0-25-generic #37-Ubuntu SMP Thu Jun 6 20:47:07 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux     Module                  Size  Used by     autofs4                36475  1      rfcomm                 42641  16      bnep                   18036  2      parport_pc             28152  0      ppdev                  17073  0      binfmt_misc            17500  1      nfsd                  248016  2      auth_rpcgss            40632  1 nfsd     nfs_acl                12837  1 nfsd     nfs                   164047  0      lockd                  76670  2 nfs,nfsd     sunrpc                235585  6 nfs,nfsd,auth_rpcgss,lockd,nfs_acl     fscache                57430  1 nfs     ext2                   72837  1      uvcvideo               80847  0      videobuf2_vmalloc      13056  1 uvcvideo     videobuf2_memops       13202  1 videobuf2_vmalloc     videobuf2_core         40513  1 uvcvideo     videodev              129260  2 uvcvideo,videobuf2_core     coretemp               13355  0      kvm_intel             132891  0      kvm                   443165  1 kvm_intel     joydev                 17377  0      arc4                   12615  2      snd_hda_codec_hdmi     36913  1      snd_hda_codec_realtek    78399  1      ath9k                 149924  0      ath9k_common           14055  1 ath9k     snd_hda_intel          39619  3      ath9k_hw              413680  2 ath9k_common,ath9k     snd_hda_codec         136453  3 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel     snd_hwdep              13602  1 snd_hda_codec     ath                    23827  3 ath9k_common,ath9k,ath9k_hw     snd_pcm                97451  3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel     snd_page_alloc         18710  2 snd_pcm,snd_hda_intel     mac80211              606457  1 ath9k     snd_seq_midi           13324  0      snd_seq_midi_event     14899  1 snd_seq_midi     snd_rawmidi            30180  1 snd_seq_midi     snd_seq                61554  2 snd_seq_midi_event,snd_seq_midi     snd_seq_device         14497  3 snd_seq,snd_rawmidi,snd_seq_midi     cfg80211              510937  3 ath,ath9k,mac80211     snd_timer              29425  2 snd_pcm,snd_seq     ath3k                  12918  0      acer_wmi               32467  0      sparse_keymap          13890  1 acer_wmi     mac_hid                13205  0      snd                    68876  16 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec,snd_hda_intel,snd_seq_device     btusb                  22474  0      psmouse                95870  0      mei                    41158  0      bluetooth             228619  23 bnep,ath3k,btusb,rfcomm     lp                     17759  0      parport                46345  3 lp,ppdev,parport_pc     rtsx_pci_ms            13011  0      lpc_ich                17061  0      memstick               16554  1 rtsx_pci_ms     soundcore              12680  1 snd     serio_raw              13215  0      microcode              22881  0      dm_multipath           22843  0      scsi_dh                14843  1 dm_multipath     btrfs                 785967  0      zlib_deflate           26885  1 btrfs     libcrc32c              12615  1 btrfs     dm_crypt               22820  1      raid10                 48088  0      raid456                65844  0      async_memcpy           12529  1 raid456     async_raid6_recov      12795  1 raid456     async_pq               12912  1 raid456     async_xor              12777  2 async_pq,raid456     async_tx               13291  5 async_pq,raid456,async_xor,async_memcpy,async_raid6_recov     raid6_pq               97812  2 async_pq,async_raid6_recov     raid1                  35240  0      raid0                  17159  0      multipath              13145  0      linear                 12894  0      dm_raid45              76725  0      xor                    17116  2 async_xor,dm_raid45     dm_mirror              21946  0      dm_region_hash         20820  1 dm_mirror     dm_log                 18529  3 dm_region_hash,dm_mirror,dm_raid45     rtsx_pci_sdmmc         17475  0      ghash_clmulni_intel    13259  0      aesni_intel            55399  2      aes_x86_64             17255  1 aesni_intel     xts                    12885  1 aesni_intel     lrw                    13257  1 aesni_intel     gf128mul               14951  2 lrw,xts     ablk_helper            13597  1 aesni_intel     cryptd                 20373  4 ghash_clmulni_intel,aesni_intel,ablk_helper     i915                  600396  0      video                  19390  2 i915,acer_wmi     i2c_algo_bit           13413  1 i915     ahci                   25731  2      drm_kms_helper         49394  1 i915     libahci                31364  1 ahci     rtsx_pci               33355  2 rtsx_pci_ms,rtsx_pci_sdmmc     atl1c                  41071  0      wmi                    19070  1 acer_wmi     drm                   286028  2 i915,drm_kms_helper                  total       used       free     shared    buffers     cached     Mem:       7993996     902544    7091452          0      54568     441044     -/+ buffers/cache:     406932    7587064     Swap:      8200188          0    8200188          /usr/lib/pm-utils/sleep.d/00logging suspend suspend: success.     Running hook /usr/lib/pm-utils/sleep.d/00powersave suspend suspend:          /usr/lib/pm-utils/sleep.d/00powersave suspend suspend: success.     Running hook /etc/pm/sleep.d/10_grub-common suspend suspend:          /etc/pm/sleep.d/10_grub-common suspend suspend: success.     Running hook /etc/pm/sleep.d/10_unattended-upgrades-hibernate suspend suspend:          /etc/pm/sleep.d/10_unattended-upgrades-hibernate suspend suspend: success.     Running hook /usr/lib/pm-utils/sleep.d/60_wpa_supplicant suspend suspend:     Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory          /usr/lib/pm-utils/sleep.d/60_wpa_supplicant suspend suspend: success.     Running hook /usr/lib/pm-utils/sleep.d/75modules suspend suspend:          /usr/lib/pm-utils/sleep.d/75modules suspend suspend: not applicable.     Running hook /usr/lib/pm-utils/sleep.d/90clock suspend suspend:          /usr/lib/pm-utils/sleep.d/90clock suspend suspend: not applicable.     Running hook /usr/lib/pm-utils/sleep.d/94cpufreq suspend suspend:          /usr/lib/pm-utils/sleep.d/94cpufreq suspend suspend: success.     Running hook /usr/lib/pm-utils/sleep.d/95anacron suspend suspend:     stop: Unknown instance:           /usr/lib/pm-utils/sleep.d/95anacron suspend suspend: success.     Running hook /usr/lib/pm-utils/sleep.d/95hdparm-apm suspend suspend:          /usr/lib/pm-utils/sleep.d/95hdparm-apm suspend suspend: not applicable.     Running hook /usr/lib/pm-utils/sleep.d/95led suspend suspend:          /usr/lib/pm-utils/sleep.d/95led suspend suspend: not applicable.     Running hook /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler suspend suspend:     Using last known working set of quirks.          /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler suspend suspend: success.     Running hook /usr/lib/pm-utils/sleep.d/99video suspend suspend:     /usr/lib/pm-utils/sleep.d/99video: 22: /usr/lib/pm-utils/sleep.d/99video: shopt: not found     kernel.acpi_video_flags = 0     Allocated buffer at 0x11000 (base is 0x0)     ES: 0x1100 EBX: 0x0000          /usr/lib/pm-utils/sleep.d/99video suspend suspend: success.     Running hook /etc/pm/sleep.d/novatel_3g_suspend suspend suspend:          /etc/pm/sleep.d/novatel_3g_suspend suspend suspend: success.     Sat Oct 12 11:10:09 CEST 2013: performing suspend


title: Linux Mint not detecting microSD card

text: I have a microSD card in my Android device and I would like to plug it into my computer to change the music and collected photos. However, I'm not able to do this. The OS does not seem to even notice that I have a microSD card plugged in (not even when I plug-in my Huawei Android with it as well). I have a dual boot of Windows and Linux Mint, with 2 auto-mounted partitions, but I do not think this is the problem. Could it be a driver problem? * * * I also tried the command `lspci -vnn | grep -A 12 SDXC`, however it prints no output at all in the console. However, I used kdepaste and posted the results of lspci -vnn here. Hope it helps. * * * Additional information:   1. What type of device is this?      * The problem is occurring in a laptop: CLEVO W150ER    2. Is it a microSD card or an SSD card?      * This is the microSD card that i use on my cellphone. It has an adapter, which is a bigger card in which the smaller one fits, just like in this image   3. Are you attempting to tether the device to your PC? If so what is the nature of the connection? USB? Bluetooth?     * My laptop has an entrance for SD cards. My SDcard worked before on Windows, so I know it should now as well.   4. Are you attempting to just mount and SSD card?     * Not sure what you mean by this :S


title: Zorin/Windows 7 Dual Boot on New Hard Drive, no GRUB!

text: So my computer had Windows 8 originally, and my hard drive died. I was able to get a dying hard drive from work to use temporarily, and decided to go with Windows 7 this time, as HP had drivers for it. Before I even got it installed, this hard drive completely died. For about a week, I used a Zorin 8 live disc, and found I really liked it a lot. I bought a new 500 gb hard drive today, and got Windows 7 installed and running perfectly. I then shrunk the partition to allow for about 70 gb for a Zorin dual boot, and installed Zorin to that with 1 gb swap. When I rebooted, it directly started loading up Windows. Since I had OS Boot Manager set as the first boot device, I restarted and tried booting from "Notebook Hard Drive", which gave me a "No bootable device-please insert boot disk and press any key to continue". Windows 7 boots with no problems. I've tried using EasyBCD in every way possible for GRUB2 to get it to show up in the Windows boot menu, but it just leads to a "NeoGrb.mbr (or something) is missing/corrupt". I'm also very new to Linux, and have no *nix terminal knowledge. If someone could be kind enough to suggest what I assume is most likely a simple solution that I am overlooking, I'd be eternally grateful, as I've been trying to get this work for the past 9 hours with no luck. Also, everything is in Legacy Mode, and the installer does NOT recognize an existing Windows 7 installation.


title: Java runtime.exec gives readlink:missing operand

text: I try to run the following with cmd = "mvn dependency:list" and workingDirectory a valid mvn project folder:               Process process = getRuntime().exec(cmd, EMPTY_ENVIRONMENT_VARS, workingDirectory);     BufferedReader r = new BufferedReader(newInputStreamReader(process.getErrorStream()));             String line = null;             while ((line = r.readLine()) != null) {                 System.out.println(line);             }     process.waitFor()      I get the following output (repeatedly):               readlink: missing operand          Try 'readlink --help' for more information.      Running the command from bash is fine.               tim@tim-ThinkPad-W530:/usr/share/maven2/bin$ which readlink     /bin/readlink     tim@tim-ThinkPad-W530:/usr/share/maven2/bin$ readlink -f `which mvn`     /usr/share/maven2/bin/mvn      An strace can be found here: http://pastebin.com/0a8hD5jd


title: Unexpected "authenticity of host can't be established."

text: Few months ago, I logged to server1 and scp files to server2. Now I want to do the same, but after the scp command I get message:               The authenticity of host ... can't be established.     RSA key fingerprint is ...      This is unexpected as I did this connection before. Unfortunately I already hit enter.               Warning: Permanently added ... (RSA) to the list of known hosts.      Please, how can I list RSA key fingerprint of server2 so that i could know if they match? Thank you very much.


title: `/srv/stevedore/` vs `/var/stevedore/` for data files for new application?

text: I am creating a new application. I currently have all of the server code, configuration, log and data files in directories that do not follow any kind of standard. Looking at the Wikipedia article on Filesystem Hierarchy Standard I have come up with this new arrangement:               /opt/stevedore/                     Server Code     /etc/stevedore/steve_site_config.pl Server Configuration     /var/log/stevedore/                 Server Logs     /srv/stevedore/                     Server Site Data (Document tree)      Having used Apache were the data files are located in `/var/www/` the pattern would seem to indicate that the data files should be located here instead:               /var/stevedore/                     Server Site Data (Document tree)      Additionally, the users check out local copies of documents for editing which are located in these directories:               ~/MyStevedore/                      User - Editable files     ~/MyStevedore/CheckOut/             User - Files to CheckOut     ~/MyStevedore/CheckInToPublish/     User - Files to CheckIn To Publish        1. Which is better for a default and why: `/srv/stevedore/` vs `/var/stevedore/`?   2. How about `~/MyStevedore/` for standard user specific directories? For more details on the application see the Stevedore Web Site and the code at the time of this posting.


title: How to pass a flag from one script to a function in another script

text: I have a script that installs a bunch of programs (homebrew, git, etc) and I have it log to `stdout` all the things that its doing along the way, but I want the ability to pass a flag, such as `\--no-log` to turn off the logging. The logging functions are sourced from a file that has a bunch of helper scripts and I'm having trouble getting the flag to pass around to these other files. [EDIT] **Given** (./bin/install.sh)               #!/usr/bin/env bash          # Test for known flags     for opt in $@     do         case $opt in             --no-log) export SILENT=true ;;             -*|--*)                  e_warning "Invalid option $opt"                  run_help                 ;;         esac     done          source ./lib/utils          e_process "Installing Homebrew"     ruby -e "$(curl -#fkL raw.github.com/Homebrew/homebrew/go/install)"      **and** (./lib/utils.sh)               #!/usr/bin/env bash          logging() {         # write your test however you want; this just tests if SILENT is non-empty         if [ -n "$SILENT" ]; then             "$@" &> /dev/null         else             "$@"         fi     }          # Command/Processing logging     e_process() {         logging printf "$(tput setaf 6)┃ $(tput sgr0)$(tput setaf 7)%s...$(tput sgr0)\n" "$@"     }      **Then** If I run `./bin/dotfiles` I expect to see the logging `┃ Installing Homebrew...`, but if I run `./bin/dotfiles --no-log` I expect to not see the logging, however its not working. **Output** (using `bash -x`)               $ bash -x ./bin/install.sh     + source ./lib/utils.sh     + e_process 'Installing Homebrew'     ++ tput setaf 6     ++ tput sgr0     ++ tput setaf 7     ++ tput sgr0     + logging printf '┃ %s...\n' 'Installing Homebrew'     + '[' -n '' ']'     + printf '┃ %s...\n' 'Installing Homebrew'     ┃ Installing Homebrew...      Using the `\--no-log`               bash -x ./bin/install.sh --no-log     + for opt in '$@'     + case $opt in     + export SILENT=true     + SILENT=true     + source ./lib/utils.sh     + e_process 'Installing Homebrew'     ++ tput setaf 6     ++ tput sgr0     ++ tput setaf 7     ++ tput sgr0     + logging printf '┃ %s...\n' 'Installing Homebrew'     + '[' -n true ']'     + printf '┃ %s...\n' 'Installing Homebrew'


title: How to display the non-sparse parts of a sparse file?

text: Imagine a file created with:               truncate -s1T file     echo test >> file     truncate -s2T file      I now have a 2 tebibyte file (that occupies 4kiB on disk), with `"test\n"` written in the middle. How would I recover that `"test"` efficiently, that is without having to read the whole file.               tr -d '\0' < file      Would give me the result but that would take hours. What I'd like is something that outputs only the non-sparse parts of the file (so above only `"test\n"` or more likely, the 4kiB block allocated on disk that stores that data). There are APIs to find out which part of the file are _allocated_ (FIBMAP, FIEMAP, SEEK_HOLE, SEEK_DATA...), but what tools expose those? A portable solution (at least to the OSes that support those APIs) would be appreciated.


title: What is Linux for VMS DCL "ON ERROR"?

text: Using VMS DCL command scripts one can catch errors by using the `on error` command:               $ on error then goto MyErrorHandler     $ directory samiam.txt     $ delete x.txt     $ exit     $MyErrorHandler:     $ print "Something."      How does one do this in Linuxland? In the example an error with `directory` or `delete` will cause control to go to `MyErrorHandler`.


title: How to setup PPTP on OpenWRT?

text: I'm trying to configure OpenWrt so clients can connect using PPTP. When I try to connect with networkmanager from a Fedora 14 box that's connected through Wifi, I get "failed to connect".               opkg update; opkg install pptpd kmod-mppe     /etc/init.d/pptpd enable     /etc/init.d/pptpd start          vim /etc/ppp/chap-secrets     #USERNAME PROVIDER PASSWORD IPADDRESS     SOMEONE pptpd SOMEPASSWORD 192.168.1.4


title: What is ANALYZE/CATALOG for Linux msginit binary message catalog?

text: VMS has an ANALYZE command that examines an item such as an executable image or an object file displaying information about its contents. Is there such a command for examining the output of msginit which is a binary message catalog file? Something equivalent to ANALYZE/CATALOG?


title: Set the language for a single program execution

text: Complete C++ i18n gettext() “hello world” example. sets the LANG environment variable using export before executing the program (Linux):               export LANG=es_MX.utf8     ./hellogt      Is there a way to set the language just while executing hellogt, like a command line argument? This would be handy for testing programs.


title: Linux Interrupts

text: I'm trying to write my own interrupt controller but I'm having some difficulties finding good documentation. Where can I find some information about interrupt management in Linux? * * * To be more specific, I have a simple interrupt controller, with enable, clear and status registers, and I'm trying to write a driver to control it. I've found some documentation and some examples, but nothing very helpful.


title: How to set up the server to use IPv6 network

text: I have a server which is able to connect the network through IPv6 tunneling. I want to use it as a proxy server. I have to things to understand:   1. How to set up the DNS? Is there any open DNS that supports IPv6? I found articles talking about setting up a private IPv6 DNS. Does that necessary?   2. How to make sure all network traffic go through the IPv6 tunneling?


title: timeline statistics with git

text: I would like to generate a statistic from my git repository to create a time- chart:               <commit> <timestamp> <changed-lines>          35abf648cfc  2011-04-04t17:23:58  +20 -4     93acb668f32  2011-04-04t17:59:01  -4 +1      so I can plot a "nice" graph for that with gnuplot or so. Where `<changed- lines>` might be anything that is generatable, i.e. `+20 -3` (added 20 lines, removed 3 lines) or just `23` or whatever. Important is, that _lines_ are counted -- changed files would not be useful in my scenario. It would be good, if I could apply this only on a _part_ of the repo, because some directories contain nasty binary files, which would destroy a statistics. I guess `git log` might come in there somehow, but I have no idea where to start...


title: How to use - as alias?

text: When I was using openSUSE 11.3, it came with several aliases already set up. Two that I used a lot were `+` for `pushd .` and `-` for `popd`. Now on Debian, I can't figure out how to create the second one. `alias -=popd` tries to read `-=` as a command option to alias. I've tried putting quotes (both single and double) around it, and preceding it with a backslash, but I just keep getting error messages. Any suggestions? Thanks


title: How can I benchmark my HDD?

text: I've seen commands to benchmark one's HDD such as this using `dd`:               $ time sh -c "dd if=/dev/zero of=ddfile bs=8k count=250000 && sync"      Are there better methods to do so than this?


title: About Clonezilla and how store the backup

text: I've never used Clonezilla before. When storing a backup, Clonezilla needs a free partition or free space? I mean, I have a disk for backups with only one partition. Do I have to create a partition for save the backup (what means have 2 partitions) or it is stored just like a normal HUGE file?


title: Why is vi apparently broken (viminfo error E576), and how can I fix it?

text: I am proficient at using Unix/Linux, but I am not an expert. If I want to open a file (for example, `file.txt`), I use `vi`:               vi file.txt      This opens the file, and if I want to close it, I use `:q!`. I have been using this method for the two years that I have been using Unix/Linux. My institution has a cluster running Ubuntu Linux. Today, however, I tried to open a file, and I got these error messages:               E576: viminfo: Missing '>' in line: newest to oldest):     E576: viminfo: Missing '>' in line: ?/CJ     E576: viminfo: Missing '>' in line: ?/CG     E576: viminfo: Missing '>' in line: ?/CC     E576: viminfo: Missing '>' in line: ?/OEP     E576: viminfo: Missing '>' in line: ?/CEP     E576: viminfo: Missing '>' in line: ?/dih     E576: viminfo: Missing '>' in line: ?/ang     E576: viminfo: Missing '>' in line: ??b     E576: viminfo: Missing '>' in line: ?/xvg     E136: viminfo: Too many errors, skipping rest of file     Press ENTER or type command to continue      So I press `Enter`. I get the same messages:               E576: viminfo: Missing '>' in line: newest to oldest):     E576: viminfo: Missing '>' in line: ?/CJ     E576: viminfo: Missing '>' in line: ?/CG     E576: viminfo: Missing '>' in line: ?/CC     E576: viminfo: Missing '>' in line: ?/OEP     E576: viminfo: Missing '>' in line: ?/CEP     E576: viminfo: Missing '>' in line: ?/dih     E576: viminfo: Missing '>' in line: ?/ang     E576: viminfo: Missing '>' in line: ??b     E576: viminfo: Missing '>' in line: ?/xvg     E136: viminfo: Too many errors, skipping rest of file     Press ENTER or type command to continue      Again I press `Enter`, and finally the file opens for reading/editing. However, the problem repeats when I try to close the file using `:q!`, and also when I try to open any other file using `vi`. The key words `CJ`, `CG`, `CC`, `OEP`, `CEP`, `dih`, `ang`, and `xvg` (I am not sure about `b`, though) are all strings that often appear in files that I read using `vi`, although I am not certain that they all exist in the particular file that I am opening (I do not think so). Thus, perhaps something is wrong with my `viminfo` file? However, I _am_ using `vi`, _not_ `vim`. I am not sure what has happened; do you have any suggestions of how I can diagnose, and possibly fix, this problem?


title: How do I set Nautilus as default file manager in Elementary OS

text: Elementary OS uses a program called files as the default file manager. I would like to use Nautilus as my default file manager as used in Ubuntu 12.04 . I have GNOME Nautilus 3.4.2 installed on my machine, but however the only way to invoke this file manager is using the terminal. How do I set this as default and have an icon in the application menu. The Desktop Entry, `nautilus.desktop` looks like this.               [Desktop Entry]     Name=Files     Comment=Access and organize files     Exec=nautilus %U     Icon=system-file-manager     Terminal=false     Type=Application     StartupNotify=true     OnlyShowIn=GNOME;Unity;     Categories=GNOME;GTK;Utility;Core;     MimeType=inode/directory;application/x-gnome-saved-search;     X-GNOME-Bugzilla-Bugzilla=GNOME     X-GNOME-Bugzilla-Product=nautilus     X-GNOME-Bugzilla-Component=general     X-GNOME-Bugzilla-Version=3.4.2     Actions=Window;     X-Ubuntu-Gettext-Domain=nautilus          [Desktop Action Window]     Name=Open a New Window     Exec=nautilus     OnlyShowIn=Unity;      Edit: Updated the Desktop entry to get answer for adding Nautilus to Application menu.


title: How to change the output redirection of a running process?

text: I know how to redirect output and how to suppress them in bash. Now, suppose I accidentally forgot to append the output redirection part to the command (e.g. `2>&1` or `> /tmp/mystdout`) and my background process is already running for a while, can I still change to where `stdout` and `stderr` are being written to? I really would like not to kill and restart the application. To be more specific as asked by Gilles in his comment, I would like to fiddle with it in these scenarios in specific:   * wrong output file   * forgot to redirect `stderr` to `stdout` or a combination of both E.g. I have Apache running and I can _see_ the file descriptors:               /proc/8019/fd/0 -> /dev/null     /proc/8019/fd/1 -> /dev/null     /proc/8019/fd/2 -> /var/log/apache2/error.log


title: what is the required ports to be opened on the firewall?

text: Currently I'll be installing one AIX server behind a firewall, I just asked to open port 443 to use the SSH protocol to access this UNIX server. I already changed the default ssh port to be 443 instead of 22 to log in and manage the server. My question: is this enough to access and manage this server which is behind the firewall or is there any additional ports that should be included in the firewall rules?


title: Fedup fails to update Fedora 19 to 20

text: I'm trying to upgrade my Fedora install from 19 (3.12.8-200.fc19.x86_64) to 20. I have installed and ran `fedup`, it creates a new entry on the boot list but a progress screen is briefly displayed and then it reboots back to Fedora 19. Here's what I tried:               # yum install fedup     # yum --enablerepo=updates-testing upgrade fedup     # fedup --network 20     # fedup-cli --network 20      and by following this post:               # yum install rpmconf; rpmconf -a      # find /etc /var -name '*?.rpm?*'      # yum install yum-utils; package-cleanup --leaves     # package-cleanup --orphans      # yum install fedup     # fedup-cli --network 20 --debuglog /root/fedupdebug.log      Is there a way to log what happens at the post-reboot stage? It seems to be failing at this phase.


title: How to use UPSTART feature of ubuntu to restart the python script but not as root?

text: I am running my Python script using upstart feature of Ubuntu so that if for whatever reason my Python script dies or gets killed, it can be restarted automatically and everything is working fine - So I decided to use `UPSTART` feature of Ubuntu to restart the Python script automatically. After creating the `testing.conf` file like this in `/etc/init/testing.conf` -               start on runlevel [2345]     stop on runlevel [016]          chdir /tekooz     respawn          post-stop script       sleep 30     end script          exec python testing.py      I ran below sudo command to start it and I can see that process running using `ps ax` and my python script is also running fine. And when I check the pid of the above process, I always see it is running as root. I don't want to run that as root. Instead I want to run that as `deds` account               deds@bx13:/$ sudo start testing     testing start/running, process 3635     deds@bx13:/$ ps aux | grep testing     root      3635  2.4  0.1 364136 15660 ?        Ssl  12:24   0:00 python testing.py      Is there some other place where I need to put the `testing.conf` file and then run it with some other command? I don't want to start my python script by doing `sudo` as `sudo start testing` and also I don't want to start as root, I just want to start as `deds` account. Is there any other way of doing this?


title: How to write a Java Program / Shell Script combination such that you can call the Java program as a remote command and yet supply a local file?

text: This is related to How to execute a remote command on a local file? I wrote a simple Java program that prints the first line of a file -               import java.io.BufferedReader;     import java.io.BufferedWriter;     import java.io.FileReader;     import java.io.OutputStreamWriter;          public class ReadFirstLine      {         public static void main(String[] args) throws Exception          {            String filename = args[0];                 BufferedReader iR  = new BufferedReader (new FileReader(filename));            BufferedWriter oW = new BufferedWriter(new OutputStreamWriter(System.out));                 outputWriter.write(iR.readLine());                 iR.close();            oW.close();         }     }      Then, I created a symlink in the /usr/bin directory called `ReadFirstLine` which points to the /usr/local/RFL/ReadFirstLine script -               #! /bin/bash          java -cp "/usr/local/RFL" ReadFirstLine "$1"       (/usr/local/RFL has ReadFirstLine.class) Now, I can call ReadFirstLine from any directory like this -               $ ReadFirstLine simplefile.txt      This same script I want to call from a different machine. So from the remote machine I tried -               $ ssh username@xyz ReadFirstLine < localfile.txt        However, I got the error               Exception in thread "main" java.io.FileNotFoundException:  (No such file or directory)         at java.io.FileInputStream.open(Native Method)         at java.io.FileInputStream.<init>(FileInputStream.java:146)         at java.io.FileInputStream.<init>(FileInputStream.java:101)         at java.io.FileReader.<init>(FileReader.java:58)         at ReadFirstLine.main(ReadFirstLine.java:12)      How can I modify the Java Program / script such that this remote invocation works?


title: Fedora 20 Heartbleed openssl fix

text: I am just trying to fix the Heartbleed bug associated with OpenSSL on Fedora Core 20. I am trying to follow the instructions as described here: http://www.forums.fedoraforum.org/showthread.php?t=298372 That is, installing packages as follows:               yum -y install koji     koji download-build --arch=x86_64 openssl-1.0.1e-37.fc20.1     yum localinstall openssl-1.0.1e-37.fc20.1.x86_64.rpm      However, I keep on running into this error:               Error: Package: 1:openssl-1.0.1e-37.fc20.1.x86_64 (/openssl-1.0.1e-37.fc20.1.x86_64)            Requires: openssl-libs(x86-64) = 1:1.0.1e-37.fc20.1            Installed: 1:openssl-libs-1.0.1e-37.fc20.x86_64 (@updates)                openssl-libs(x86-64) = 1:1.0.1e-37.fc20            Available: 1:openssl-libs-1.0.1e-30.fc20.x86_64 (fedora)                openssl-libs(x86-64) = 1:1.0.1e-30.fc20     You could try using --skip-broken to work around the problem     You could try running: rpm -Va --nofiles --nodigest      I have tried installing openssl-libs separately but I run into this error:               Error: Package: 1:cups-libs-1.7.1-8.fc20.i686 (@updates)            Requires: libssl.so.10(libssl.so.10)            Removing: 1:openssl-libs-1.0.1e-37.fc20.i686 (@updates)                libssl.so.10(libssl.so.10)            Updated By: 1:openssl-libs-1.0.1e-37.fc20.1.x86_64 (/openssl-libs-1.0.1e-37.fc20.1.x86_64)                Not found            Available: 1:openssl-libs-1.0.1e-30.fc20.i686 (fedora)                libssl.so.10(libssl.so.10)     Error: Package: VirtualGL-2.3.3-2.fc20.i686 (@fedora)            Requires: libssl.so.10(libssl.so.10)            Removing: 1:openssl-libs-1.0.1e-37.fc20.i686 (@updates)                libssl.so.10(libssl.so.10)            Updated By: 1:openssl-libs-1.0.1e-37.fc20.1.x86_64 (/openssl-libs-1.0.1e-37.fc20.1.x86_64)                Not found            Available: 1:openssl-libs-1.0.1e-30.fc20.i686 (fedora)                libssl.so.10(libssl.so.10)     Error: Package: 1:cups-libs-1.7.1-8.fc20.i686 (@updates)            Requires: libcrypto.so.10            Removing: 1:openssl-libs-1.0.1e-37.fc20.i686 (@updates)                libcrypto.so.10            Updated By: 1:openssl-libs-1.0.1e-37.fc20.1.x86_64 (/openssl-libs-1.0.1e-37.fc20.1.x86_64)                Not found            Available: 1:openssl-libs-1.0.1e-30.fc20.i686 (fedora)                libcrypto.so.10     Error: Package: VirtualGL-2.3.3-2.fc20.i686 (@fedora)            Requires: libssl.so.10            Removing: 1:openssl-libs-1.0.1e-37.fc20.i686 (@updates)                libssl.so.10            Updated By: 1:openssl-libs-1.0.1e-37.fc20.1.x86_64 (/openssl-libs-1.0.1e-37.fc20.1.x86_64)                Not found            Available: 1:openssl-libs-1.0.1e-30.fc20.i686 (fedora)                libssl.so.10     Error: Package: libssh2-1.4.3-8.fc20.i686 (@fedora)            Requires: libssl.so.10            Removing: 1:openssl-libs-1.0.1e-37.fc20.i686 (@updates)                libssl.so.10            Updated By: 1:openssl-libs-1.0.1e-37.fc20.1.x86_64 (/openssl-libs-1.0.1e-37.fc20.1.x86_64)                Not found            Available: 1:openssl-libs-1.0.1e-30.fc20.i686 (fedora)                libssl.so.10     Error: Package: 1:cups-libs-1.7.1-8.fc20.i686 (@updates)            Requires: libcrypto.so.10(libcrypto.so.10)            Removing: 1:openssl-libs-1.0.1e-37.fc20.i686 (@updates)                libcrypto.so.10(libcrypto.so.10)            Updated By: 1:openssl-libs-1.0.1e-37.fc20.1.x86_64 (/openssl-libs-1.0.1e-37.fc20.1.x86_64)                Not found            Available: 1:openssl-libs-1.0.1e-30.fc20.i686 (fedora)                libcrypto.so.10(libcrypto.so.10)     Error: Package: trousers-0.3.11.2-3.fc20.i686 (@updates)            Requires: libcrypto.so.10            Removing: 1:openssl-libs-1.0.1e-37.fc20.i686 (@updates)                libcrypto.so.10            Updated By: 1:openssl-libs-1.0.1e-37.fc20.1.x86_64 (/openssl-libs-1.0.1e-37.fc20.1.x86_64)                Not found            Available: 1:openssl-libs-1.0.1e-30.fc20.i686 (fedora)                libcrypto.so.10     Error: Package: VirtualGL-2.3.3-2.fc20.i686 (@fedora)            Requires: libcrypto.so.10            Removing: 1:openssl-libs-1.0.1e-37.fc20.i686 (@updates)                libcrypto.so.10            Updated By: 1:openssl-libs-1.0.1e-37.fc20.1.x86_64 (/openssl-libs-1.0.1e-37.fc20.1.x86_64)                Not found            Available: 1:openssl-libs-1.0.1e-30.fc20.i686 (fedora)                libcrypto.so.10     Error: Package: trousers-0.3.11.2-3.fc20.i686 (@updates)            Requires: libcrypto.so.10(libcrypto.so.10)            Removing: 1:openssl-libs-1.0.1e-37.fc20.i686 (@updates)                libcrypto.so.10(libcrypto.so.10)            Updated By: 1:openssl-libs-1.0.1e-37.fc20.1.x86_64 (/openssl-libs-1.0.1e-37.fc20.1.x86_64)                Not found            Available: 1:openssl-libs-1.0.1e-30.fc20.i686 (fedora)                libcrypto.so.10(libcrypto.so.10)     Error: Package: VirtualGL-2.3.3-2.fc20.i686 (@fedora)            Requires: libcrypto.so.10(libcrypto.so.10)            Removing: 1:openssl-libs-1.0.1e-37.fc20.i686 (@updates)                libcrypto.so.10(libcrypto.so.10)            Updated By: 1:openssl-libs-1.0.1e-37.fc20.1.x86_64 (/openssl-libs-1.0.1e-37.fc20.1.x86_64)                Not found            Available: 1:openssl-libs-1.0.1e-30.fc20.i686 (fedora)                libcrypto.so.10(libcrypto.so.10)     Error: Package: 1:cups-libs-1.7.1-8.fc20.i686 (@updates)            Requires: libssl.so.10            Removing: 1:openssl-libs-1.0.1e-37.fc20.i686 (@updates)                libssl.so.10            Updated By: 1:openssl-libs-1.0.1e-37.fc20.1.x86_64 (/openssl-libs-1.0.1e-37.fc20.1.x86_64)                Not found            Available: 1:openssl-libs-1.0.1e-30.fc20.i686 (fedora)                libssl.so.10     Error: Package: VirtualGL-2.3.3-2.fc20.i686 (@fedora)            Requires: libcrypto.so.10(OPENSSL_1.0.1)            Removing: 1:openssl-libs-1.0.1e-37.fc20.i686 (@updates)                libcrypto.so.10(OPENSSL_1.0.1)            Updated By: 1:openssl-libs-1.0.1e-37.fc20.1.x86_64 (/openssl-libs-1.0.1e-37.fc20.1.x86_64)                Not found            Available: 1:openssl-libs-1.0.1e-30.fc20.i686 (fedora)                libcrypto.so.10(OPENSSL_1.0.1)     Error: Package: libssh2-1.4.3-8.fc20.i686 (@fedora)            Requires: libcrypto.so.10(libcrypto.so.10)            Removing: 1:openssl-libs-1.0.1e-37.fc20.i686 (@updates)                libcrypto.so.10(libcrypto.so.10)            Updated By: 1:openssl-libs-1.0.1e-37.fc20.1.x86_64 (/openssl-libs-1.0.1e-37.fc20.1.x86_64)                Not found            Available: 1:openssl-libs-1.0.1e-30.fc20.i686 (fedora)                libcrypto.so.10(libcrypto.so.10)     Error: Package: libssh2-1.4.3-8.fc20.i686 (@fedora)            Requires: libcrypto.so.10            Removing: 1:openssl-libs-1.0.1e-37.fc20.i686 (@updates)                libcrypto.so.10            Updated By: 1:openssl-libs-1.0.1e-37.fc20.1.x86_64 (/openssl-libs-1.0.1e-37.fc20.1.x86_64)                Not found            Available: 1:openssl-libs-1.0.1e-30.fc20.i686 (fedora)                libcrypto.so.10     Error: Package: trousers-0.3.11.2-3.fc20.i686 (@updates)            Requires: libssl.so.10            Removing: 1:openssl-libs-1.0.1e-37.fc20.i686 (@updates)                libssl.so.10            Updated By: 1:openssl-libs-1.0.1e-37.fc20.1.x86_64 (/openssl-libs-1.0.1e-37.fc20.1.x86_64)                Not found            Available: 1:openssl-libs-1.0.1e-30.fc20.i686 (fedora)                libssl.so.10      You could try using --skip-broken to work around the problem      What am I missing? Thank you.


How to disable bluetooth device when startup on Ubuntu 12.4, I've accessed `/etc/init/bluetooth.conf` file and comment `#start on started dbus` line. But when PC bootup Bluetooth device still running. How can I disable bluetooth device when system startup?


title: sed remove characters from new line

text: After some processing, I have my input file like below. **file1.txt**               12345|john|student     43321|jack|professor          78965|alex|lecturer      I need to process the above file further and so I need a line breaker at the end of the line too. Currently, I can accomplish it as below.               sed 's/$/|/' file1.txt      The above command results in the output as,               12345|john|student|     43321|jack|professor|     |     78965|alex|lecturer|      As we can see, the `|` is appended to blank lines too. When I tried to remove the `|` character again from blank lines using below command,               sed 's/|//g' file1.txt      The `|` character is getting deleted everywhere. How can I delete only the `|` in blank lines? I need to keep the blank line also.


title: How to install Firefox version 29.0 on Slackware 14.1?

text: The problem is that I need to sync Firefox bookmarks between my PC and my notebook, but the notebook uses the Firefox version 29.0 on Ubuntu 14.04 and the PC using Firefox version 24.4.0 on Slackware 14.1 64 bits and when I go to Help> about Firefox, it says Firefox is updated. The old sync does not work with the new according to what I read on the Mozilla site, so I need Firefox version 29.0 to sync with the notebook, but I can not find.txz for Slackware. Can someone help me?