title: NFS mount edits on local NFS-exported filesystem change permissions on the remote NFS mount

text: I believe there is a `noperm` or something to that effect option in NFS, but how do I make sure that if server A is exporting `/opt/nfs` and it is mounted as an NFS mount on server b `/export/serverA` that local changes to files on server A `/opt/nfs` folder do not change ownership or permissions on the server B `/export/serverA` filesystem? Assume RHEL 6 for OS.


title: Debian/Ubuntu:How to compile a Linux kernel on one machine and use on other machines (same architecture)

text: Debian/Ubuntu: How to compile a Linux kernel on one machine and use on other machines (same architecture)? I know how to do it on the same machine. But to use a compiled kernel other machines, is tricky for me. For example, I have done `make` But how about `sudo make modules_install install` ? This will install things to my current machine. What is good practice to compile a kernel on a fast machine but use it on other slow/(or fast too) machines. Otherwise I have to compile, install it every time, which is time consuming. Note: On Ubuntu webpage, there are ways to do similar thing. But it is only good for Ubuntu kernels. Not for upstream kernels.


title: Storage becomes unmanaged after Solaris and PowerPath upgrade

text: I have been performing an upgrade for a customer, using Solaris Live Upgrade to go from Solaris 10 update 2 to Solaris 10 update 10 and at the same time upgrade EMC powerpath from [an old version] to version 5.5 I am by no means a powerpath expert, but I am well aware of the issues with upgrading only the one without the other. The process I followed is:   1. Live-upgrade Solaris   2. Remove (pkgrm) powerpath from the ABE   3. Comment out the powerpath dependent file systems in the ABE   4. LUactivate and reboot   5. Install PowerPath 5.5 P 01 B 2 The install finds the left-over power-path config and asks whether I want to upgrade it. On some of the 5 servers, the old version is PowerPath version 5.2, on others it was still running 4.5, but the result is the same for all of them. At the end of the pkgadd it tells me the driver was successfully installed (it was) and tells me that no reboot is needed. However when I run powercf or powermt display I get an error stating `Device(s) not found` Rebooting did not help. cfgadm looks as expected (Sorry I did not save the output), devfsadm -Cv did not create or remove any device links. The HBAs were linking (confirmed by `luxadm -e probe` as well as `fcinfo hba-port`) `format` showed only the Solaris native links to the LUNs, with half of them in error state as expected due to them seen via both the avtive and passive path. mpathadm is not active. After googling around I found a suggestion to look at the output of `powermt display options` to confirm that clariion management is enabled, and found that is says "unmanaged"... All other storage classes showed as "managed" I then ran `powermt manage class=clariion` which returned an error stating `incompatible initiator information received from the array` Despite this error I then got the emcpower devices and could see everything looking normal in `powermt display dev=all`. For good measure I followed this by `powercf -q; powermt config; powermt save` I then un-commented the entries in /etc/vfstab and rebooted to make sure all was ok. I then ended up with a system in single-suer mode with filesystems/local in maintenance. I discovered with a lot of testing that I had to redo the `powermt manage class=clarion` procedure after every reboot. For now I have reverted to the old pre-upgrade ABE. Everything is still working perfectly when I moved back to the old versions of Solaris and PowerPath.


title: What is the difference between echo `date`, echo "`date`", and echo '`date`'?

text: What is the difference between these three commands?               echo `date`     echo "`date`"     echo '`date`'      I am confused on what the differences actually are. I think that when the ' are around it means that it is a string, therefore echo would literally output the string `date` instead of displaying the date?


title: How can I PGP decrypt an entire mbox?

text: Thunderbird cannot search PGP-encrypted emails. Hence, I was considering copying all my emails from IMAP to local storage, then decrypting them all locally, so that they are searchable. Is this possible? Thunderbird stores email folders as a single mbox file. I attempted `gpg -d mbox_file`, but this only decrypted a single email, and then failed with an error as follows.               gpg: [don't know]: invalid packet (ctb=46)     gpg: decryption failed: Bad signature     gpg: packet(3) too short      N.B. the mbox also contains non-encrypted email. I could perhaps filter these out from within Thunderbird, but the solution would preferably deal with this elegantly.


title: lftp exclude syntax confusion

text: I am confused with the syntax description given for lftp from their website:               -x RX,   --exclude=RX              exclude matching files     -X GP,   --exclude-glob=GP         exclude matching files      How exactly do I exclude certain files during mirroring ??               --exclude filea --exclude fileb --exclude filec     --exclude filea fileb filec     --exclude ./filea ./fileb filec      I have also googled it and cannot find any examples of exclude statements ?!


title: What do the terms used in Geany's color schemes mean?

text: I guess this is not a true Unix & Linux but I'm taking my chance! I'm using Geany 1.23.1 on Lubuntu 13.10. I've downloaded additional color schemes from https://github.com/kugel-/geany- themes and placed them in `~/.config/geany/colorschemes` as specified by the installation instructions. I've compared the various color schemes and am in the process of making my own but I'd appreciate help in understanding the terms used in the colorscheme file. For example, here's a part of one color scheme, `gedit.conf`:               # Programming languages     #-------------------------------------------------------------------------------          comment=#00f     comment_doc=comment     comment_line=comment     comment_line_doc=comment_doc     comment_doc_keyword=comment_doc,bold     comment_doc_keyword_error=comment_doc,italic          number=#f0f     number_1=number     number_2=#a52a2a;;true          type=#2e8b57;;true     class=number     function=default     parameter=function          keyword=number_2     keyword_1=keyword     keyword_2=keyword_1     keyword_3=keyword_1     keyword_4=keyword_1          identifier=default     identifier_1=identifier     identifier_2=identifier_1     identifier_3=identifier_1     identifier_4=#008a8c          string=number     string_1=string     string_2=string_1     string_3=;;true;false     string_4=;;false;true     string_eol=string_1,italic      By trial and error, I figured out what some of them do. I replace the right- hand part of each line with a unique color and see where that color appears up in a variety of different filetypes. Filetypes I looked at include `gtkrc`, `.mkd`, `.css`, `.xml,`.html`,`.js`,`.py`,`.rc`,`.sh`, and`.svg`. But my question is this: is there any technical resource to explain when, for example, `identifier` would be used as instead of `identifier_1`, or `identifier_2`, or `identifier_3`, or `identifier_4`. I looked at file:///usr/share/doc/geany/html/index.html and at `man geany` and `info geany` but couldn't find the information I'm looking for.


title: DNS cache for wget

text: I want wget to use a global DNS cache, not just in memory for the current instance. The wget manual mentions > `\--no-dns-cache`   >  Turn off caching of DNS lookups. Normally, Wget remembers the IP addresses > it looked up from DNS so it doesn't have to repeatedly contact the DNS > server for the same (typically small) set of hosts it retrieves from. This > cache exists in memory only; a new Wget run will contact DNS again. So I need a cache mechanism for wget. What do you recommend?


title: Where Do I get Source package for Perf tool

text: I am looking for source package of perf tool ,which I wanted to compile for ARM Linux ,I have already set up the cross compile tool chain. I have compiled the the oprofile and got it source(Oprofile-0.9.8.tar.bz2) from sourceforge.net. Can anyone point me to perf tool source ??


title: Where are Python dist-packages stored in FreeBSD?

text: I am trying to find this path on FreeBSD but it is not working: `/usr/local/lib/python2.7/dist-packages` This same path is working on Ubuntu. Can please some tell me where I can find Python dist-packages? Actually, I am trying to find the Django folder.


title: Can ping Debian VM via IP but not via hostname

text: On my work's network, my new debian headless VM is not visible via its hostname. I'm using: Debian Jessie Virtualbox bridged adapter I can see other VMs on my machine from the headless VM, and I can see other machines on the network from the headless VM (that is, `ping machine` works for both cases). I can also ping the host machine. I tried installing acahi-daemon and avahi-discover, as per this thread with no success. Additionally, I edited dhclient.conf to have the line `send host-name "Peridot";` (Peridot being the VM's hostname). Specifically, I'm hosting an instance of `haste-server` on the machine, which I can access via browser by the machine's IP but not by it's hostname (which is what I'd like). I cannot ping it from any other machine on the network by name, but it can be reached via its IP. Any help appreciated


title: How do I convert my old PC to a data logging and presentation terminal?

text: Take an old PC (e.g. 1.8GHz P4 with 256MB RAM), install e.g. Ubuntu 10.04 LTS on it. Now go to your PIC or AVR based home project and hook up the thing. With only three connections and the onboard peripherals of every microcomputer, you now have a large screen and keyboard easily interfaced to the $5 gadget. Use minicom to read/write easily to the device. I would like to take this one step further. I need the data logged, plotted and analysed Essentially, I imagine the product of my search as a   1. **free and open** MatLab clone, adept at   2. **handling real-time data streams** , with intuitive interface to   3. **graphing one or several parameters at various time spans** (e.g. the temperature of 4 sensors over the last minute or week and the setpoint). **Basic control theory functions would be a significant plus** (e.g. max, min, overshoot, state-space model transformations, PID tuning, controller synthesis). What tools can I use here?


title: Is there a simple way of limiting the number of child processes that execute in parallel?

text: I have a bash script that kicks off multiple rsync processes in parallel. I'd like to limit the number of simultaneous child processes but not serialize the whole script. Here's a simplified version of the current script:               #!/bin/bash     (       flock -n 200 || exit 0       {         for f in $(ssh $1 ls /var/images/)         do           rsync … &         done         wait       } &> /var/log/my.log     ) 200>/var/lock/my.lockfile      I believe `xargs` with `\--max-procs` might be a solution but I can't figure out how to integrate that with my script. Can it be done like this, or is there a better way?


title: (g)vim - NerdTree and tagbar above each other left to edited file?

text: Any chance to get (g)vim displaying NerdTree and tagbar above each other left to edited file?               +-----------+-------------+     | nerd tree | edited file |     | contents  |             |     +-----------+             |     | tagbar    |             |     | contents  |             |     +-----------+-------------+      I'd like to have it done in `.vimrc` somehow. Up to now the relevant section in my `.vimrc` looks like this:               " NERDTree shortcut     :nmap \e :NERDTreeToggle<CR>     " tagbar settings     let g:tagbar_left=1     nnoremap <silent> <F9> :TagbarToggle<CR>      However when displayed, they're shown like this:               +----------+-----------+-------------+     | tagbar   | nerd tree | edited file |     | contents | contents  |             |     |          |           |             |     |          |           |             |     |          |           |             |     +----------+-----------+-------------+


title: Computers are restarting spontaneously and simultaneously, how do I find the cause?

text: I have two computers that spontaneously shut down and rebooted (this happened more than once), both are identical hardware and were installed from the same image (CentOS 5). They are controlling some equipment, and each shutdown is a significant annoyance and waste of money. The logs don't give any clue, I can only determine that it is not a clean restart, but behaves like a spontaneous loss of power. There is no entry at all that is typical for a controlled shutdown as initiated by `init 0` or `init 6`, just the entries typical for booting the computer. The computers also don't go out completely, but they boot again. I'm reasonably certain that it is not a human intervening, though I can't be absolutely certain. A power loss or fluctuation is also unlikely as the computers are the only equipment affected each time, and they are also in different parts of the building. There are no cronjobs executing at the time of the shutdowns. I'm now trying to find out if it is a hardware defect, or a software-initiated problem. But from what I know, a kernel panic should not restart the computer but leave the panic message on the screen. Which kind of software errors could cause the computer to spontaneously restart without leaving an entry in the logs about the shutdown? Where should I look to further isolate the problem?


title: Making XMonad redetect two monitors

text: I accidentally pressed Meta-Q and xmonad restarted. Now, it has mirrored the same thing on both of my monitors. How do I get it go back to treating them as two separate screens? Things I have tried:   * Pressing Meta-Q again   * Turning one of the monitors off and back on This has happened before, and logging out and back in again worked. But I don't want to do that every time I accidentally press Meta-Q. This has started happening since I started using dmenu_run to launch apps. Previously, Meta-Q would restart xmonad harmlessly (without going into mirrored mode).


title: Group within group file permissions

text: I tried finding this on here, but couldn't so sorry if it's a duplicate. Say I have 2 groups and a user: group1, group2, user1 with the following structure: group1 is a member of group 2, user1 is a member of group1 Now say I have the following files with relevant permissions               file1 root:group1 660     file2 root:group2 660      Now when I log into user1, I'm able to edit file1, but not edit file2. Short of adding user1 to group2, is there any way of doing this? or is there no way? I'm using Ubuntu btw.


title: awk,how to change the value of the file using parameter sets?

text: I am trying to reset my data using `awk`. I have a data of 54 columns where I want to change six of the column values using the following script.               #!/bin/bash -x     # optimal parameters     set BI2=0.02841513     set DS2=0.37837487     set WS2=0.85392380     set D22=1.00048351     set D32=0.63893676     set DSMAX2=28.15795517          # change the calibration parameter     awk '{if($1==2) {       $6 = "${BI2}"       $7 = "${DS2}"       $8 = "${DSMAX2}"       $9 = "${WS2}"       $25 = "${D22}"       $26 = "${D32}"}       print $0;}' soil_params > tmp     mv -f tmp soil_params      my data looks like:               999 0   123 65.183534   -147.655522 0.2 0.001   10  0.9 2   10.84   9.79    9.76    812.42  1546.28 1334.35 -999    -999    -999    18.579  68.139  26.914  548 0.1 0.3 0.192752    -0.8725 4   35.39   30.13   19.34   0.323   0.347   0.382   1160.4  1196.2  1208.9  2186.08 2253.52 2411.44 -9.8    0.582   0.489   0.443   0.396   0.4841  0.28    0.001   0.0005  383.7   0.1 0.1 0.1 1   16.733299   16.733299                                                2   1   124 65.183534   -147.639897 ${BI2}  ${DS2}  ${DSMAX2}   ${WS2}  2   10.84   9.79    9.77    812.51  1544.96 1331.78 -999    -999    -999    18.579  68.277  26.915  676 0.1 ${D22}  ${D32}  -0.529166   4   35.45   30.19   19.37   0.323   0.347   0.382   1160.3  1196.3  1208.8  2185.87 2253.63 2411.11 -9.8    0.582   0.49    0.443   0.396   0.4851  0.28    0.001   0.0005  400.8   0.1 0.1 0.1 1   16.32   16.32                                                             when I run the above script, it didn't change the value from the parameter set assigned rather it simple changes to the parameters as you can Would you please help me on this regards?


title: What is the Run prompt equivalency in Linux?

text: In Windows, there is the Run prompt, which you can access with Win+R key. ![run](http://i.stack.imgur.com/PEmpf.png) What is the equivalency to this in Linux? Is there even such a thing or is the Terminal the main prompt you would use in Linux for the type of tasks you normally use the Run prompt for in Windows? Here is a use case. I want to access `\\\192.168.0.103\` on my home network. On Windows, I can use the Run prompt for this. Like so: ![run2](http://i.stack.imgur.com/Pk0qF.png) Where do you type in UNC paths and how do you access them on Linux? What do I have to consider if the remote is a Windows based computer? Do I have to spend a day or two configuring things or will it just work out of the box? You know... SMB, Samba and all that.


title: What user should apache and PHP be running as? What permissions should /var/www files have?

text: I just spun up an Ubuntu 11.10 box and then ran `apt-get install apache2 php5` to install apache2 and PHP 5 on the box. Now it is functioning as a "web server" and it loads the "It Works!" page. Now I'm trying to tighten up security and I have the following questions about linux web servers:   1. Who should apache be running as?   2. What group(s) should this user be in?   3. What package(s) can make PHP (and Apache?) run as the owner of the files? (like on shared web hosts) Should I use these packages? Are they easy / feasible to maintain on a small system?   4. What should the default permissions be for files and folders being served out to the web with apache running as `www-data`? For apache/php running as the user? I have done the following things in examination of the default setup: ### File Structure When I `cd /` and do a `ls -al` listing of the contents, I see `/var`:               drwxr-xr-x 13 root root  4096 2012-02-04 20:47 var/      If I `cd` into `var` and do `ls -al` I see:               drwxr-xr-x  2 root root  4096 2012-02-04 20:47 www/      Finally, inside `/var/www` I see:               drwxr-xr-x  2 root root 4096 2012-02-04 20:47 ./     drwxr-xr-x 13 root root 4096 2012-02-04 20:47 ../     -rw-r--r--  1 root root  177 2012-02-04 20:47 index.html      My key takeaway is that so far all of these files belong to `root:root`, files have permissions of 644, and directories have permissions of 755. ### Apache's Permissions If I create a file as root in `/var/www/test.php` with the contents:               <?php echo shell_exec('whoami');      and load that file into a browser it tells me `www-data`, which is the same as in the `/etc/apache2/envvars` file:               export APACHE_RUN_USER=www-data     export APACHE_RUN_GROUP=www-data      If I do `ps aux | grep -i apache` I see the following:               root      1916  1.2 104664  7488 Ss   20:47 /usr/sbin/apache2 -k start     www-data  1920  0.8 105144  5436 S    20:47 /usr/sbin/apache2 -k start     www-data  1921  1.0 105144  6312 S    20:47 /usr/sbin/apache2 -k start     www-data  1922  0.7 104688  4624 S    20:47 /usr/sbin/apache2 -k start     www-data  1923  0.7 104688  4624 S    20:47 /usr/sbin/apache2 -k start     www-data  1924  0.7 104688  4624 S    20:47 /usr/sbin/apache2 -k start     www-data  1925  0.7 104688  4624 S    20:47 /usr/sbin/apache2 -k start      So who is apache running as? It looks like perhaps the first process is as `root`, maybe from the `/etc/init.d/apache` script when the system started, and the other ones as `www-data` spawned from the first. Is that correct? Next, if I type in `groups www-data` then I see `www-data : www-data` - so it looks to only be in the `www-data` group. I'm guessing this is standard practice as well. ### Shared Hosting and Security So if I understand things correctly, if apache is running as `www-data` and I want apache to be able to read a directory, the `x` bit needs to be set for the world (other) group (`o+x`), and that also needs to be set on all parent directories all the way up the chain (`www`, `var`). And if I want apache to be able to read from a file, then the `o+r` bit needs to be set. Unfortunately I believe this introduces a security hole for multiple applications and/or multiple users on the same linux box: All web files need to be world-readable, and so they are also accessible by other applications and other users on the system. If one application installed on the system had a security vulnerability that allowed raw, unvalidated user input, which was then executed by PHP, a remote attacker could then browse all the other files on the web system which were world readable. Likewise, if the box had multiple users, and a user knew the path of another user's web files, s/he could then read the file contents (and see sensitive things like database connection strings, etc). I've heard of two packages, `suphp` and `phpsuexec` that deal with allowing users' files to be served out "as them" on a shared system. One of the niceties of this is that it allows web applications (like Wordpress) to create and modify files - very helpful for adding themes, plugins, and upgrading software. Of course it is probably more secure to do these things manually, but can a compromise be made perhaps with one of the packages mentioned above? Or by possibly using `chown` to make the wordpress directory group belong to `www-data` and set the sticky bit on the group (`g+s`)? I have only used these as the end user of a web hosting company, and so I don't know the ins-and-outs of them, and if they are even reasonable to install on a small system, or if there are some other security measures I should use instead, but I thought I would mention them here as they seem like one possible way to address some of my concerns. ### Back to the Questions   1. Who should apache be running as?   2. What group(s) should this user be in?   3. What package(s) can make PHP (and Apache?) run as the owner of the files? (like on shared web hosts) Should I use these packages? Are they easy / feasible to maintain on a small system?   4. What should the default permissions be for files and folders being served out to the web with apache running as `www-data`? For apache/php running as the user?


title: How to reduce ClamAV memory usage?

text: I'm running a Ubuntu based web server (Apache, MySQL) on a 512MB VPS. This is more than sufficient for the website it is running (small forum). As I wanted to add some protection against viruses I installed ClamAV and use it to scan uploaded files as part of the upload handling script (PHP). I'm running the clamav-daemon service so the definitions don't have to be loaded every time a file is scanned. One downside to this practise seems to be the "huge" amount of memory used by clamav-daemon service: >200 MB. This already resulted in the service being forced to stop and the uploads being rejected. I can simply upgrade the memory of the VPS to 1024MB, but I want to know if there is a way to reduce the memory usage of ClamAV by e.g. not loading unwanted definitions.


title: What do the different version elements specify in debian package name?

text: In Debian, I found many different packet versioning, do you know what they stand for?   For example :               bind9 1:9.7.3.dfsg-1~squeeze11      What do `9.7.3`, `dfsg-1` and `squeeze11` stand for?


title: Program for two-way synchronization of big files (VM disk images)

text: I heavily use virtual machines in my work and I need an efficient way of synchronizing them between my PCs. I know of bigsync, but this program works well only for one-way synchronizing (like rsync). Unison is also insufficient, because it always copies target files before updating them, which is unacceptable for >16GB disk images. I need a tool or a script for two-way synchronization in place, something that will work like `bigsync` except it will first test which file is more recent by inspecting the modification date and whether the contents changed after last use (btrfs filesystem has nice features to test that), and - unlike `bigsync` will work efficiently both ways (AFAIK `bigsync` works efficiently only one way: from source to destination. For the other way, one needs to call it from the remote end).


title: mdadm - RAID5 array size vs. actual disk size mismatch

text: I have 4x 3TB WD RED disks that are in mdadm RAID5, which should total an array size of 9TB usable space, however I only have 6TB. I have confirmed all disks are in the array, the only strange thing is that fdisk returns different partition IDs, head sizes, and sector sizes, etc. for each of the drives. As these drives were added at different times it's possible I followed a different tutorial and this lead to some mishap. I of course don't want to start trying things willy-nilly, as I don't want to lose data. So I'm hoping it's an easy fix and just something that I'm missing. Once I know which disk is at fault I can re-add this to the array correctly.               root@bobserv:~# cat /proc/mdstat     Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]     md0 : active raid5 sdb1[5] sdc1[3] sdd1[1] sde1[4]           6442053120 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]          unused devices: none                    root@bobserv:~# mdadm --detail /dev/md/0     /dev/md/0:             Version : 1.2       Creation Time : Thu Oct 17 20:19:10 2013          Raid Level : raid5          Array Size : 6442053120 (6143.62 GiB 6596.66 GB)       Used Dev Size : 2147351040 (2047.87 GiB 2198.89 GB)        Raid Devices : 4       Total Devices : 4         Persistence : Superblock is persistent              Update Time : Tue Feb 11 09:36:33 2014               State : active      Active Devices : 4     Working Devices : 4      Failed Devices : 0       Spare Devices : 0                   Layout : left-symmetric          Chunk Size : 512K                     Name : bob:0                UUID : aa43b63e:1c359341:077e94c8:36875aaf              Events : 84216              Number   Major   Minor   RaidDevice State            4       8       65        0      active sync   /dev/sde1            1       8       49        1      active sync   /dev/sdd1            3       8       33        2      active sync   /dev/sdc1            5       8       17        3      active sync   /dev/sdb1                    root@bobserv:~# fdisk -l          Disk /dev/sda: 85.9 GB, 85899345920 bytes     255 heads, 63 sectors/track, 10443 cylinders, total 167772160 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00045481             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048   165675007    82836480   83  Linux     /dev/sda2       165677054   167770111     1046529    5  Extended     /dev/sda5       165677056   167770111     1046528   82  Linux swap / Solaris          WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.               Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes     255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x79c7d1c7             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1               1  4294967295  2147483647+  ee  GPT          Disk /dev/sdc: 3000.6 GB, 3000592982016 bytes     90 heads, 3 sectors/track, 21705678 cylinders, total 5860533168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x6b7a81a1             Device Boot      Start         End      Blocks   Id  System     /dev/sdc1            2048  4294967294  2147482623+  fd  Linux RAID autodetect          Disk /dev/sdf: 500.1 GB, 500107862016 bytes     255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00083e19             Device Boot      Start         End      Blocks   Id  System     /dev/sdf1            2048   123844607    61921280   83  Linux     /dev/sdf2       123846654   156248063    16200705    5  Extended     /dev/sdf5       123846656   156248063    16200704   82  Linux swap / Solaris          WARNING: GPT (GUID Partition Table) detected on '/dev/sde'! The util fdisk doesn't support GPT. Use GNU Parted.               Disk /dev/sde: 3000.6 GB, 3000592982016 bytes     255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000             Device Boot      Start         End      Blocks   Id  System     /dev/sde1               1  4294967295  2147483647+  ee  GPT          Disk /dev/sdd: 3000.6 GB, 3000592982016 bytes     90 heads, 3 sectors/track, 21705678 cylinders, total 5860533168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x83a606dd             Device Boot      Start         End      Blocks   Id  System     /dev/sdd1            2048  4294967294  2147482623+  fd  Linux RAID autodetect          Disk /dev/md0: 6596.7 GB, 6596662394880 bytes     2 heads, 4 sectors/track, 1610513280 cylinders, total 12884106240 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 524288 bytes / 1048576 bytes     Disk identifier: 0x00000000          Disk /dev/md0 doesn't contain a valid partition table     root@bobserv:~#      EDIT: I have also unmounted the array and tried both _fsck.ext4 -f /dev/md0_ & _resize2fs /dev/md0_ to no avail.               # parted -l     Model: VMware, VMware Virtual S (scsi)     Disk /dev/sda: 85.9GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start   End     Size    Type      File system     Flags      1      1049kB  84.8GB  84.8GB  primary   ext4            boot      2      84.8GB  85.9GB  1072MB  extended      5      84.8GB  85.9GB  1072MB  logical   linux-swap(v1)               Model: VMware, VMware Virtual S (scsi)     Disk /dev/sdb: 3001GB     Sector size (logical/physical): 512B/512B     Partition Table: gpt          Number  Start   End     Size    File system  Name     Flags      1      1049kB  3001GB  3001GB  ntfs         primary               Model: VMware, VMware Virtual S (scsi)     Disk /dev/sdc: 3001GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start   End     Size    Type     File system  Flags      1      1049kB  2199GB  2199GB  primary               raid               Model: VMware, VMware Virtual S (scsi)     Disk /dev/sdd: 3001GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start   End     Size    Type     File system  Flags      1      1049kB  2199GB  2199GB  primary               raid               Model: VMware, VMware Virtual S (scsi)     Disk /dev/sde: 3001GB     Sector size (logical/physical): 512B/512B     Partition Table: gpt          Number  Start   End     Size    File system  Name     Flags      1      1049kB  3001GB  3001GB               primary               Model: VMware, VMware Virtual S (scsi)     Disk /dev/sdf: 500GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start   End     Size    Type      File system     Flags      1      1049kB  63.4GB  63.4GB  primary   ext4      2      63.4GB  80.0GB  16.6GB  extended      5      63.4GB  80.0GB  16.6GB  logical   linux-swap(v1)               Model: Linux Software RAID Array (md)     Disk /dev/md0: 6597GB     Sector size (logical/physical): 512B/512B     Partition Table: loop          Number  Start  End     Size    File system  Flags      1      0.00B  6597GB  6597GB  ext4               root@kierserv:/media/store/TV Shows/Bob's Burgers#


title: Owner of init and xterm

text: I don't understand what is owner of process. Owner of bash is me. Then who is owner of init and xterm? I searched on google but I can't find.


title: When did Automake switch to using Perl

text: I tried to get remove Perl from my Ubuntu machine, but found that `automake` not only depends on Perl but itself is a Perl program. I read somewhere this was not always the case. Today I looked in the archives, but even version 1.0 already is in Perl. Did I misread, or was `automake` always in Perl? Are there any drop-in replacements that does not depend on Perl?


title: Running git with higher memory allocation

text: I am facing memory/data segment issues while running git. However, if I set my ulimits to a bit higher like below.               ulimit -m 262144          ulimit -d 262144      It runs fine. Don't we have anyway to allocate more memory/data segment while running git commands. Please help...I am really to new to git and unix both.


title: HP LaserJet M1536DNF network scanning on Scientific Linux 6.4 - Error during device I/O

text: [root@NOTEBOOK ~]# scanimage -L     device `hpaio:/usb/HP_LaserJet_M1536dnf_MFP?serial=ZZXXYYXXYYXX' is a     Hewlett-Packard HP_LaserJet_M1536dnf_MFP all-in-one          [root@NOTEBOOK ~]# scanimage --format=tiff > a.tiff     scanimage: open of device     hpaio:/usb/HP_LaserJet_M1536dnf_MFP?serial=ZZXXYYXXYYXX failed: Error during device I/O          [root@NOTEBOOK ~]# dmesg     usb 1-3: new high speed USB device number 5 using ehci_hcd     usb 1-3: New USB device found, idVendor=03f0, idProduct=012a     usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3     usb 1-3: Product: HP LaserJet M1536dnf MFP     usb 1-3: Manufacturer: Hewlett-Packard     usb 1-3: SerialNumber: ZZXXYYXXYYXX     usb 1-3: configuration #1 chosen from 1 choice     usblp0: USB Bidirectional printer dev 5 if 1 alt 0 proto 2 vid 0x03F0 pid     0x012A     type=1400 audit(1380474171.846:23488): avc:  denied  { module_request } for      pid=5354 comm="udev-configure-" kmod="net-pf-10"     scontext=system_u:system_r:cupsd_config_t:s0-s0:c0.c1023     tcontext=system_u:system_r:kernel_t:s0 tclass=system     type=1400 audit(1380474171.849:23489): avc:  denied  { module_request } for      pid=5354 comm="udev-configure-" kmod="net-pf-10"     scontext=system_u:system_r:cupsd_config_t:s0-s0:c0.c1023     tcontext=system_u:system_r:kernel_t:s0 tclass=system     type=1400 audit(1380474171.849:23490): avc:  denied  { module_request } for     pid=5354 comm="udev-configure-" kmod="net-pf-10"     scontext=system_u:system_r:cupsd_config_t:s0-s0:c0.c1023     tcontext=system_u:system_r:kernel_t:s0 tclass=system          [root@NOTEBOOK ~]# lsusb     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 003 Device 002: ID 0483:2016 SGS Thomson Microelectronics Fingerprint     Reader     Bus 006 Device 002: ID 17ef:1003 Lenovo Integrated Smart Card Reader     Bus 001 Device 005: ID 03f0:012a Hewlett-Packard          [root@NOTEBOOK ~]# lsb_release -a     LSB Version:     :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch     Distributor ID: Scientific     Description: Scientific Linux release 6.4 (Carbon)     Release: 6.4     Codename: Carbon          [root@NOTEBOOK ~]# rpm -qa|egrep -i 'hp|scan|sane'     hpijs-3.12.4-4.el6_4.1.x86_64     hplip-common-3.12.4-4.el6_4.1.x86_64     xsane-0.997-8.el6.x86_64     xsane-common-0.997-8.el6.x86_64     sane-backends-libs-1.0.21-3.el6.x86_64     hplip-libs-3.12.4-4.el6_4.1.x86_64     sane-backends-libs-gphoto2-1.0.21-3.el6.x86_64     libsane-hpaio-3.12.4-4.el6_4.1.x86_64     sane-backends-1.0.21-3.el6.x86_64     [root@NOTEBOOK ~]#      **Q:** can someone bring the HP LaserJet M1536DNF scanner via network to life? - since scanning over USB isn't working..


title: Window placement when switching to multiple monitors

text: Suppose you have several windows open distributed across multiple monitors. Then you switch to using a single monitor (perhaps because you have removed your laptop from its docking station). All your windows are now on one screen. Then you switch back to your multiple monitor configuration. You now have more screen space, but all your windows are initially piled up on a single monitor. It would be nice if your windows would go back to the monitor they were on originally. Any ideas on how to make this happen?


title: What's wrong with my Arch installation? Randomly bizarre screen output since last upgrade

text: Since my last upgrade of Arch Linux (a month ago perhaps), my screen looks weird. It happens randomly, and it would become normal with a slight update to the current window. See this screenshot of chromium browser for example, ![enter image description here](http://i.stack.imgur.com/aMcvv.png) If I scroll up or do anything that "updates" the browser, it would become normal again. Was it a problem related to X or the chromium browser? Anyone knows that?


I tried using this:               $ if [$a == 1] then { echo 'yes'; } fi;      but I get an error:               -bash: syntax error near unexpected token `}'      What is the correct format? I tried several with no luck.


title: Multicolored Grep

text: I'm trying to get each grep command to highlight it's results in a different color. I can do it manually with a line like this:               ls -l GREP_COLORS='mt=01;32' grep c | GREP_COLORS='mt=01;31' grep o | GREP_COLORS='mt=01;34' grep n | GREP_COLORS='mt=01;36' grep f      ![](http://i.imgur.com/SML5PI8.png) Every `c` character will be highlighted in green and every `o` character will be highlighted in red, etc... > **For this example to work you'll need to ensure that you always > have`\--color=always` on your grep commands. I've set this in my `.bashrc` > so grep will always have colors:** > > `export GREP_OPTIONS='--color=always'` * * * What I'm attempting to accomplish is to wrap this functionality with an alias so I can just call `grep` and have a different `GREP_COLORS` value each time. I understand the consideration of multiple shells for each new piped grep and I'm trying to over come this by creating some files (one for each color), to indicate that they have already been u I have made some attempts but strangely, this one seems to work the "best". I have this in my `.bashrc`:               alias mg="mygrep"     mygrep(){         # define possible colors         COLORS=("01;32" "01;31" "01;34" "01;36")         COUNTER=0         NUM=0         # as long as the color has already been used, keep searching         while [ -f /home/lior/Desktop/mygrep_$NUM ]; do             # get a random index             let NUM=`shuf --input-range=0-$(( ${#COLORS[*]} - 1 )) | head -1`             wait ${!}             $(( COUNTER+=1 ))             if [ "$COUNTER" -ge ${#COLORS[@]} ]; then                 # remove all color locks                 rm /home/lior/Desktop/mygrep_*                 wait ${!}             fi         done         # mark this color as used         touch /home/lior/Desktop/mygrep_$NUM         wait ${!}              # lets go!         GREP_COLORS="mt=${COLORS[$NUM]}" grep "$@"     }      I'm using this alias like so:               ll | mg c | mg o | mg n | mg f      The results are quite cool. There are however some errors that are slightly different each time. Here are a couple of screenshots: ![](http://i.imgur.com/J0dUNlY.png) ![](http://i.imgur.com/VSx1b9n.png) ![](http://i.imgur.com/FK5t46N.png) Looks like as the shell goes through each pipe command, the previous function did not yet finish it's execution. It tries to remove files that don't exist any more. I'm not too sure where those other `command not found` errors are coming from. As you can see, I've put in some `wait` commands to try let the file manipulation complete but this doesn't seem to be working too well. Another thing I have already tried is to use shared memory `/dev/shm` but it yielded similar results. How would I go about getting the results I want? > ### Note: > > I am looking for answers that simply wrap the grep command as it has lots of > functionality that I'm wanting to use and intend to insert other logic > between the pipes, so I don't want to provide all of the search terms at > once. I'm also not looking for other "grep like" tools. Sorry to @terdon who > has already posted an awesome perl suggestion.


title: USB 3.0 host controller suddenly stopped working

text: sudo lshw             *-usb:0 UNCLAIMED                  description: USB controller                  product: 7 Series/C210 Series Chipset Family USB xHCI Host Controller                  vendor: Intel Corporation                  physical id: 14                  bus info: pci@0000:00:14.0                  version: 04                  width: 64 bits                  clock: 33MHz                  capabilities: pm msi xhci cap_list                  configuration: latency=0                  resources: memory:f7120000-f712ffff      Only the two USB 2.0 controllers function properly:               sw3@pc90313-sw3:~$ ls /dev/bus/usb     001  002      The 3.0 controller was listed as `004`, but now it's suddenly gone.               sw3@pc90313-sw3:~$ dmesg | grep USB     [    0.156319] ACPI: bus type USB registered     [    0.459505] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver     [    0.459593] ehci-pci 0000:00:1a.0: new USB bus registered, assigned bus number 1     [    0.472274] ehci-pci 0000:00:1a.0: USB 2.0 started, EHCI 1.00     [    0.472286] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002     [    0.472287] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1     [    0.472355] hub 1-0:1.0: USB hub found     [    0.472493] ehci-pci 0000:00:1d.0: new USB bus registered, assigned bus number 2     [    0.488286] ehci-pci 0000:00:1d.0: USB 2.0 started, EHCI 1.00     [    0.488293] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002     [    0.488294] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1     [    0.488364] hub 2-0:1.0: USB hub found     [    0.488449] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver     [    0.488453] uhci_hcd: USB Universal Host Controller Interface driver     [    0.488543] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 3     [    0.784538] usb 1-1: new high-speed USB device number 2 using ehci-pci     [    0.916941] usb 1-1: New USB device found, idVendor=8087, idProduct=0024     [    0.916943] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0     [    0.917078] hub 1-1:1.0: USB hub found     [    1.188920] usb 1-1.1: new low-speed USB device number 3 using ehci-pci     [    1.285374] usb 1-1.1: New USB device found, idVendor=046d, idProduct=c05a     [    1.285375] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0     [    1.285376] usb 1-1.1: Product: USB Optical Mouse     [    1.357061] usb 1-1.2: new full-speed USB device number 4 using ehci-pci     [    1.451516] usb 1-1.2: New USB device found, idVendor=1366, idProduct=0101     [    1.451517] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3     [    1.521200] usb 1-1.3: new low-speed USB device number 5 using ehci-pci     [    1.619030] usb 1-1.3: New USB device found, idVendor=046d, idProduct=c31c     [    1.619031] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0     [    1.619032] usb 1-1.3: Product: USB Keyboard     [   25.307285] xhci_hcd 0000:00:14.0: USB bus 3 deregistered     [   25.358978] usbhid: USB HID core driver     [   25.362327] input: Logitech USB Optical Mouse as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/input/input2     [   25.362388] hid-generic 0003:046D:C05A.0001: input,hidraw0: USB HID v1.11 Mouse [Logitech USB Optical Mouse] on usb-0000:00:1a.0-1.1/input0     [   25.362469] input: Logitech USB Keyboard as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3/1-1.3:1.0/input/input3     [   25.362517] hid-generic 0003:046D:C31C.0002: input,hidraw1: USB HID v1.10 Keyboard [Logitech USB Keyboard] on usb-0000:00:1a.0-1.3/input0     [   25.364344] input: Logitech USB Keyboard as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3/1-1.3:1.1/input/input4     [   25.364394] hid-generic 0003:046D:C31C.0003: input,hidraw2: USB HID v1.10 Device [Logitech USB Keyboard] on usb-0000:00:1a.0-1.3/input1     [   25.517596] usb 2-1: new high-speed USB device number 2 using ehci-pci     [   25.650056] usb 2-1: New USB device found, idVendor=8087, idProduct=0024     [   25.650058] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0     [   25.650208] hub 2-1:1.0: USB hub found      What could be going on?               sw3@pc90313-sw3:~$ uname -a     Linux pc90313-sw3 3.11.0-13-generic #20-Ubuntu SMP Wed Oct 23 07:38:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux


title: Where is the description of man sections' contents?

text: I have read in many places that section 1 is about User Commands , section 2 about kernel API , section 3 about C library ...so on and so forth. My question is this: How do you get to the short desriptions (like above) of the type of contents in man's sections from the command line (not some other source, but the command line) PS: I'm using a Fedora 19 desktop


title: Disable GNU Indent backup files

text: I am using GNU Indent to format C code in my project. By default backup files are created ending with a `~`. I don't want to have any backup files created, is there a way to disable it?


title: Why is my machine not showing anything when booting?

text: I'm using Ubuntu Server 11.10 x86, and after I make my normal selection (Ubuntu, with Linux 3.0.0-12-generic-pae) from the GRUB menu, the screen just goes blank - there's not even a cursor showing up. Basically I (suspect that I) had a bad NFS mount tying up the boot process so I fixed that and now it seems like the boot is actually worse off. Here's the problem I had before: Is a bad NFS mount preventing a clean boot? Not sure if this is useful, but when I hit the 'e' key in the GRUB menu, this is the configuration that shows up:               setparams 'Ubuntu, with Linux 3.0.0-12-generic-pae'          recordfail     set gfxpayload=$linux_gfx_mode     insmod gzio     insmod part_msdos     insmod ext2     set root='(hd0, msdos2)'     search --no-floppy --fs-uuid --set=root <long hex value>     linux /vmlinuz-3.0.0-12-generic-pae root=UUID=<another long hex value> ro     initrd /initrd.img-3.0.0-12-generic-pae      Recovery mode works just fine, networking and all. In fact, if select recovery mode it actually brings up the following menu:               Recover Menu (limited read-only menu)       resume - Resume normal boot       fsck - Check all file systems (will exit read-only mode)       remount - Remount / read/write and mount all other file systems       root - Drop to root shell prompt      and if I select `resume` I get the following output:               <timestamp> tpm_tis 00:00: tpm_transmit: tpm_send: error 4294967234     initctl:Event failed          Ubuntu 11.10 <server> tty1     <server> login:      Everything works fine after that. Other things I've noticed: 1) when booting normally, the Num Lock and Scroll Lock lights on they keyboard show (after pressing the corresponding keys), but the Caps Lock doesn't 2) Ctrl+Alt+Fx to switch TTY's doesn't work 3) this link doesn't help much: https://wiki.ubuntu.com/X/Troubleshooting/BlankScreen 4) hitting Esc or any other keys doesn't work after I've selected normal boot mode So, back to the original question: why is my machine not showing anything when booting (in non-recovery mode)?


title: Graphical issues in vim

text: Not sure if this is the best place to ask this but does anyone know why I'm seeing those purple-ish bars in my vim? My vimrc http://dpaste.com/698999/ Also, I'm using Lion OSX ![enter image description here](http://i.stack.imgur.com/F0oVd.png)


title: Problem accessing Internet on Linux (kubuntu)

text: I am new to Linux (in fact just installed it last night). I am setting up my internet. I made a switch from Windows 7 to Linux in order to learn it. On Windows 7 I was accessing the internet by spoofing my mac address with the mac Address of guy who use to live in my room before. When I changed my mac address all the settings were automatically configured (IP address, subnet mask, default gateway). I tried the same approach with Linux today. I changed the mac address of my ethernet card, but unfortunately it isn't working for some reason. When I checked the settings I found that although my IP address as well as my subnet mask were configured automatically, the same as were on Windows, for some reason my default gateway was 130.83.219.127 (on Windows it used to be 130.83.219.126). Now since I am not a network expert I don't exactly know what the hell this means. I wonder if maybe Linux users are assigned a different Gateway than Windows users? (I don't even know if this Statement makes sense since I don't have any idea of networks) What can I do to troubleshoot this?


title: How can I get ssh working on Mint Olivia?

text: I have a Mint KDE VM (under VMware Fusion on Mavericks), and it is refusing ssh connections. I have not enabled UFW, and openssh-server installed without reported error. However, when I attempt to open a ssh connection from the Mint VM or the Mavericks host, the connection is refused. From Mint:               christos@christos-virtual-machine:~ > ssh localhost     Read from socket failed: Connection reset by peer      From Mavericks:               Inner Sanctum ~/mirror $ ssh christos@mint     Connection closed by 172.16.144.182      What can I do so sshd is listening and not impaired on Mint Olivia? --EDIT--               christos-virtual-machine christos # service sshd status     sshd: unrecognized service     [1]christos-virtual-machine christos # service iptables status     iptables: unrecognized service     [1]christos-virtual-machine christos # nmap localhost          Starting Nmap 6.00 ( http://nmap.org ) at 2013-12-13 15:40 CST     Nmap scan report for localhost (127.0.0.1)     Host is up (0.0000040s latency).     Not shown: 996 closed ports     PORT    STATE SERVICE     22/tcp  open  ssh     139/tcp open  netbios-ssn     445/tcp open  microsoft-ds     631/tcp open  ipp          Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds


title: How can I create a file that just contains a binary number?

text: I would like to create a file that just contains a binary number. I think that `touch` can be used to create an empty file, but is there any way I can fill it with a binary number e.g. `10` (ten)? And how can I validate that the file contains the binary value of ten? See also How can I check the Base64 value for an integer?


title: Extracting fixed width records with no delimiter from a single line

text: I need to extract strings of text from a single file containing one very long line of text with no delimiters. Using the sample line below, these are the following known facts: ???????A1XXXXXXXXXX???????B1XXXX???????A1XXXXXXXXXX???????C1XXXXXXX               1.  It contains 38 fixed width record types      2.  The record marker is a 7 alphanumeric character followed by, for example, ‘A1’.     3.  Each record type has varying widths, for example, A1 record type will have 10 characters following it, if B1 then 4, and if C1 then 7.     4.  The record types aren’t clumped together and can be in any order. As in the example, its A1,B1,A1,C1     5.  The example above has 4 records and each record type needs to go to separate files. In this case 38 of them.      ???????A1XXXXXXXXXX ???????B1XXXX ???????A1XXXXXXXXXX ???????C1XXXXXXX               6.  The record identifier, e.g. ????????A1, can appear in the body of the record so cannot use grep.      7.  With the last point in mind, I was proposing 3 solutions but not sure on how to script this and of course would greatly appreciate some help.      a. Traverse through the file from the beginning and sequentially strip out the record to the appropriate output file. For example, strip out first record type A1 to A1file which I know is 10 characters long then re-interrogate the file which will then have B1 which I know is 4 chars long, strip this out to B1file etc.. <<< this seems painful >>     b. Traverse through the file and append some obscure character to each record marker within the same file. Much like above but not strip out. I understand it still will use the same logic but seems more elegant     c. I did think of simply using the proposed grep -oE solution but then re-interrogate the output files to see if any of the 38 record markers exist anywhere other than at the beginning. But this might not always work.


title: Hard disk labels

text: How do I add a label to a partition on a disk, and how do I then mount it by label (manually and via `fstab`)? _note: this is an external hard drive_


title: mount defaults and various filesystems

text: I read on the man page `defaults Use default options: rw, suid, dev, exec, auto, nouser, async, and relatime.` Do the options set depend on a mounted filesystem or not?


title: I recently cloned my drive, while booting I have to wait at this screen which has a number of error messages

text: Once booted the computer works fine (debian 7 sid), no other issues. I just have to wait at this screen for around 3 minutes, unfortunate since I have an SSD. Are these error messages causing the wait time? Is it one specific error message causing it? How do I go about resolving the error? This seems to be causing the hold up:               Jul 26 14:58:00 Optimus systemd[1]: Timed out waiting for device dev-disk-by\x2duuid-1f4e32fd\x2ddf53\x2d4c2a\x2d9939\x2d7d5d93250655.device.     Jul 26 14:58:00 Optimus systemd[1]: Dependency failed for /dev/disk/by-uuid/1f4e32fd-df53-4c2a-9939-7d5d93250655.     Jul 26 14:58:00 Optimus systemd[1]: Dependency failed for Swap.      What do I do about this device that no longer exists? ![screenshot of boot](http://i.stack.imgur.com/gmJcn.jpg)


title: How to send data to a serial port and see any answer?

text: On Linux, I want to send a command string (i.e. some data) to a serial port (containing control characters), and listen to the response (which also usually might contain control characters). How can I do this as simplest as possible on Linux? An example is appreciated!


title: Is it mandatory to have a file system and MMU in Linux?

text: Suppose I do not need a filesystem and I have only applications where data reloading may not be required - so MMU may be redundant. Can I remove these two items from Linux, and boot the OS successfully? I am trying to develop small sized Linux kernel, and I found filesystem and MMU are taking considerable space. So I thought of removing them. Any advice on this?


title: How to migrate SVN to git

text: Can someone tell me the steps on how to migrate `svn` to `git`? I have repositories in `svn` and I want to move all them to `git` without the loss of data.


title: missed X-Spam- headers for all messages in exim4 + spamassassin

text: I'm trying to configure spam filter on VPS Debian Squeeze, exim4-heavy + `spamassassin` and `dovecot`. Exim version 4.72, SpamAssassin version 3.3.1, Perl version 5.10.1 And I have an irritating problem with spamassassin: messages has no `X-Spam` headers. Exim4 config:               ### main/02_exim4-config_options     spamd_address = 127.0.0.1 783          ### acl/40_exim4-config_check_data     warn  spam = nobody:true        add_header = X-Spam-Score: $spam_score          accept      `/etc/spamassassin/local.cf` ( defaults omitted )               report_contact hostmaster@domain.name          add_header spam Flag _YESNOCAPS_     add_header all Status _YESNO_, score=_SCORE_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_     add_header all Level _STARS(*)_          required_score 4.5      All messages have `X-Spam-Score` header added by exim, but no one has `X-Spam-` headers which should be added by `spamd`. I have received some spam email and tried gtube.txt, but no additional headers was added Headers of the spam ( score greater than 4.5, but no `X-Spam-Flag` )               X-Priority: 3     X-MSMail-Priority: Normal     X-Mailer: Microsoft Windows Live Mail 14.0.8117.416     X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416     X-Spam-Score: 8.8      What did I miss?


title: setfacl default --x on directories and r-- on files for user

text: Having the following directory structure               [sr@server directory]$ tree     .     ├── folder1     │   ├── fileA     │   └── fileB     └── folder2         └── fileC          2 directories, 3 files      I want to set a default facl on folder1 and folder2 that, for the user `jim` has the following permissions               .     ├── folder1      --x     │   ├── fileA    r--     │   └── fileB    r--     └── folder2      --x         └── fileC    r--      I.E. all files have `r--` and all folders have `\--x` Any _files_ created under folder1 or folder2 should be given the `r--` permission for user `jim`, any _folders_ should be given the `\--x` permission for user `jim` I can set the permissions so folders created have `r-x` and files have `r--` but I can't figure out a way to set the default permissions so folders don't get the read permission. While I can manually set the permissions for the currently existing files I want those permissions to apply as defaults to all newly created files and folders. setfacl version `2.2.49` on RHEL 6.4


title: Multidigit ranges of files in lexicographical order in zsh

text: I would like to specify a range of files (in lexicographical order) with two integers (e.g. 2 to 57) in zsh by globbing. For example: "pick the files 2 to 57 in lexicographical order under the path that matches some globbing pattern". I thought using square brackets would do it                for x in /foo/bar/*[2-57]; do print $x; done      but zsh apparently thinks I am asking for the files `2` to `5` (or something like that) instead of files `2` to `57`. Any thoughts why? How can I accomplish this?


title: Disable touchpad special functions

text: I use Linux Mint with MATE. The touchpad of my laptop displays occasional erratic behavior that I attribute to my touches triggering some "special functions". This manifests while browsing with firefox when the browser suddenly moves forward or back or loads some previous site seemingly at random. Other occurrences are random insertions when I edit a file. I do not want to use any of these special functions and I would like to disable these special functions. The touchpad itself I want to keep using when I do not have mouse. However, I have not found any of the according options. Can you give me an advise?


title: Why doesn't text piped into an echo get outputted?

text: Why doesn't this command output "1"?               echo 1 | echo      I imagine it working this way:               1. echo 1 (outputs 1)     2. | echo (takes the 1 as an input, then echos it)      Isn't this what should happen?


title: Fedora 20 system freezes when the Fedora logo appears

text: The system is feodra20-64bit. After I tried to install a rpm of adobe reader, I am not able to log in. It feezes at that "f" logo.   However I can use command line to log in.   The below is `vi /var/log/messages` and `vi /var/log/secure` ![messeage](http://i.stack.imgur.com/tL6db.jpg) and ![enter image description here](http://i.stack.imgur.com/bXPqL.jpg)


title: Replace new line + 4x space to new line in stdout

text: I need join 2 lines into one in `stdout` - replace new line AND 4x space with one space but new line without space don't touch               tcpdump -vvv ... -l | xyz      this is output:               2014-06-06 AAA         BBB     2014-06-06 CCC         DDD      but I need:               2014-06-06 AAA BBB     2014-06-06 CCC DDD


title: arm Glibc 2.19 'make check' error and ld error post install (non-standard dir), Should I report a bug, or have I done something wrong?

text: [I have a Galaxy SIII with the Snapdragon S4 and the Krait CPU.] Well I burnt out my laptop one way or the other, so I am stuck with this old computer and my phone which has 4x the memory and about the same Ghz CPU. I have also been trying to make Android more "GNU/Linux" like off and on for some time and have come up with a hack that is suitable at the moment, at least for myself. So I am using my old tower as an NFS and x11 server and my phone does all the real work (i.e. X forwarding over ssh), I con barely surf the web from my tower's browser unless I launch iceweasel on my phone over ssh with x forwarding, hope that makes sense. Note that I am trying to build a toolchain and all the prebuilts required by the Android build system. I want to see if my phone can build an OS for itself natively. So I have managed to compile GCC 4.8.2, the test suite reported about the same amount of errors as the same guy who builds the debian packages for armhf so I used it to build. I built Binutils 2.24 and the testsuite reported zero errors. I decompiled my wifi firmware with those tools and get the same results as with debian's binutils, nice! But, when I compiled glibc 2.19 I got 2 errors from testsuite:               make[2]: *** [check-abi-libc] Error 1     make[2]: Leaving directory `/home/edge-case/Android-Lab/glibc/2.19/glibc-2.19/elf'     make[1]: *** [elf/tests] Error 2     make[1]: Leaving directory `/home/edge-case/Android-Lab/glibc/2.19/glibc-2.19'     make: *** [check] Error 2      And the glibc wiki says to look into any errors reported by the tests. Also, I did make install (to a non-standard directory) and then set up my environment variables, PATH, LD_LIBRARY_PATH, etc so that I would use the new glibc (maybe thats where I went wrong) and then commands like ls through an error and even exit threw a seg fault. Something about "ld-linux-armhf.so.3" I lost the error on my screen already, too far up. I will try to reproduce if needed. Here is my environment and my configurations for the builds, maybe I did something wrong for my CPU and someone else knows better than I, I am just starting to learn ARM assembly: My Environment:               export LAB_ROOT=$(pwd)     export HOST_ARCH=$(uname -m)          # Find a way to make these more flexible     export HOST_CPU=krait     export BUILD_TARGET=native          export TOOL_PATH=${LAB_ROOT}/toolchains          # GCC-4.8.2     GCC_PATH=${TOOL_PATH}/gcc/armv7l-unknown-linux-gnueabihf-4.8.2     GCC_LEX_PATH=${GCC_PATH}/libexec/gcc/armv7l-unknown-linux-gnueabihf/4.8.2     GCC_BIN_PATH=${GCC_PATH}/bin:${GCC_LEX_PATH}     GCC_INC_PATH=${GCC_PATH}/include     GCC_LIB_PATH=${GCC_PATH}/lib:${GCC_LEX_PATH}          # Binutils-2.24     BINUTILS_PATH=${TOOL_PATH}/binutils-2.24     BINUTILS_BIN_PATH=${BINUTILS_PATH}/bin:${BINUTILS_PATH}/armv7l-unknown-linux-gnueabihf/bin     BINUTILS_LIB_PATH=${BINUTILS_PATH}/lib:${BINUTILS_PATH}/armv7l-unknown-linux-gnueabihf/lib     BINUTILS_INC_PATH=${BINUTILS_PATH}/include          # Glibc-2.19     #GLIBC_PATH=${TOOL_PATH}/glibc-2.19     #GLIBC_LEX_PATH=${GLIBC_PATH}/libexec/getconf     #GLIBC_BIN_PATH=${GLIBC_PATH}/bin:${GLIBC_PATH}/sbin:${GLIBC_LEX_PATH}     #GLIBC_LIB_PATH=${GLIBC_PATH}/lib     #GLIBC_INC_PATH=${GLIBC_PATH}/include          TOOLS=${GCC_BIN_PATH}:${BINUTILS_BIN_PATH}     TOOL_LIBS=${GCC_LIB_PATH}:${BINUTILS_LIB_PATH}          export PATH=${TOOLS}:${PATH}     LD_LIBRARY_PATH=${TOOL_LIBS}:${LD_LIBRARY_PATH}     export LD_LIBRARY_PATH=${LD_LIBRARY_PATH/%:/}     export CFLAGS="-mabi=aapcs-linux -mfloat-abi=hard -mtune=cortex-a15 -mfpu=neon-vfpv4"     export CPPFLAGS=${CFLAGS}     export CC="gcc -I${GCC_INC_PATH} -I${BINUTILS_INC_PATH}"     export CXX="g++ -I${GCC_INC_PATH} -I${BINUTILS_INC_PATH}"          function lab {         cd ${LAB_ROOT};     }      My Configuration options for GCC-4.8.2 (Note that I had not set up the previously mentioned Environment for this build, this config is all that got passed to the GCC build):               $PWD/../gcc-4.8.2/configure \         --prefix=$HOME/Android-Lab/toolchains \         --disable-multilib \         --with-float=hard      My Configuration for Binutils(Note- I had set up the Environment at this point minus the Binutils variables, I added those after this ):                   cd ${BINUTILS_BUILD_DIR} && \         ${BINUTILS_SRC_DIR}/configure \             --prefix=${TOOLCHAIN_DIR} \             --enable-shared \             --disable-werror \             --disable-multilib && \      My Configuration for Glibc:               export CFLAGS="-O1 ${CFLAGS}"     export CXXFLAGS=${CFLAGS}          ../glibc-2.19/configure \         --prefix=${TOOL_PATH}/glibc-2.19 \         --with-binutils=${TOOL_PATH}/binutils-2.24 \         --enable-add-ons \         --host=armv7-unknown-linux-gnueabi \         --with-binutils=/home/edge-case/Android-Lab/toolchains/binutils-2.24 \         --enable-kernel=3.0.0      Running the testsuite resulted in the mentioned errors and then after using the uncommented `GLIBC_*` variables I got seg faults and ld error regarding the "ld-linux-armhf.so.3" lib. Note that I am running the 3.4.53 kernel with Android patches, except for "Paranoid_Networking". Also Note that I had the `GLIBC_*_PATH` variables in the `TOOLS_PATH` and `TOOL_LIBS` variables when I got these errors, I got rid of them from the variables after I got the errors. Did I get something wrong with the configuration for my hardware? Is this a bug and I should report it? Or, is my environment not set up properly?


title: Compiling multiple C++ files with make

text: I made a makefile to help compile multiple C++ files, but it is giving me "command not found" errors. Could anyone help me to fix it? The errors I get:               Make: line 1: main.out::command not found      g++: error: GradeBook.o: No such file or directory      g++: error: main.o: No such file or directory      g++: fatal error: no input files      compilation terminated.      Make: line 4: main.o:: command not found      Make: line 7: GradeBook.o:: command not found      Make: line 10: clear:: command not found       Here is my makefile:               main.out: GradeBook.o main.o         g++ -Wall -g -o main.out GradeBook.o main.o           main.o: main.cpp GradeBook.h         g++ -Wall -g -c main.cpp          GradeBook.o: GradeBook.cpp GradeBook.h         g++ -Wall -g -c GradeBook.cpp          clean:         rm -f main.out main.o GradeBook.o


title: compiling nginx shell fails from salt provisioner

text: I have a salt provisioner that is calling a shell script to compile Nginx with a few modules that are needed. This is the call to the script in the `.sls`:               nginx:     #  pkg.installed:     #    - name: nginx       file.directory:         - name: /src/         - user: root         - group: root         - mode: 644       cmd.run:         - name: /srv/salt/config/nginx/compiler.sh | bash         - cwd: /         - require:           - pkg: nginx-compiler-base      So it's `/srv/salt/config/nginx/compiler.sh | bash` that is run which does start. The script run is:               #!/bin/bash     cd ../../../../     cd /src/          nginxVersion="1.5.5" # set the value here from nginx website     wget http://nginx.org/download/nginx-$nginxVersion.tar.gz     tar -xzf nginx-$nginxVersion.tar.gz     #rm nginx # removes the soft link     ln -sf nginx-$nginxVersion nginx          cd nginx              ./configure --with-http_auth_request_module \         --with-http_gzip_static_module        \         --with-http_stub_status_module        \         --with-http_ssl_module                \         --with-pcre                           \         --with-file-aio                       \         --with-http_realip_module             \         --without-http_scgi_module            \         --without-http_uwsgi_module           \         --without-http_fastcgi_module          make     make install      Which does get to the untaring part. After which I get this as the output and failed message:     ![enter image description here](http://i.stack.imgur.com/cJLyQ.png) If I `ssh` into the server, then `su`, I can run each line in the script and it works. I'm unsure why it's failing when the provisioner is failing.


title: Install b43 firmware from Arch Install Media

text: I'm currently attempting to install Arch on my dual booted Linux box, however my system uses b43 which I have and used post-install on Mint and Ubuntu. I'm not sure how to run `makepkg` from the Arch install or how to add to the ISO to use for the install? My current system config:               sda 250gib     sda1 6gib -mint 16 x86_64     sda2 6gib - ubuntux86_64     sda3 6gib - intended arch     sda4 12gib swap     sda5 220 gib home My system is a Dell d620 with Nvidia support and running b43, non detected by default. I have the `tar.gz` from the Mint and Ubuntu installs but not sure how to use `makepkg` that will work for Arch from off my runnning system.


title: How to start ipsec on Gentoo after migrated to systemd?

text: My system is Gentoo 64bit, and is using _systemd_ as the initialization system. After I migrated to systemd, I found there's not service to start **ipsec**. I tried to run `/etc/init.d/ipsec`, but it says it would only work with _openrc_. What is the corresponding service to start _ipsec_?


title: Difference between xattr and chattr

text: What is the relation and the difference between `xattr` and `chattr`? I want to know when I set a `chattr` attribute in Linux what is happening inside the Linux kernel and inode metadata.


title: Can I figure out why port X is a dependency of port Y?

text: Is there an easy way to figure out why, when I'm trying to install a certain port in FreeBSD, some other certain port is listed as a dependency? Specifically, I'm trying to install the Webalizer port on my VPS, and along the way it's wanting to install Python. I'd really rather not install any new programming languages on the server that I'm not going to use directly. I suspect Webalyzer is (depending on something which is)+ depending on Python, and hopefully I can stop that by changing the configuration settings of one of those dependencies, but I'm not sure how to find it. I know pkg_info can find similar information for _installed_ ports, but I'm hoping to find this info _before_ installation.


title: Different ARP results between host and virtual machine

text: Recently, using VMWare Player, I have configured a Linux virtual machine on a Windows host. I set the network adapter to be a bridged network with the Replicate option checked. The IP address was on the physical network but using the command `arp -a` will result differently between the host and the virtual machine--the host can spot other hosts on the Wi-Fi network while the VM cannot. Knowing that the host is like a switch that forwards the network information to the VM, I think the VM is able to access the real network, but I cannot understand why it cannot. I want to know how exactly this bridged network works and if I can grab the actual network inside the virtual machine. ### --- edit --- The funny thing is that I see some but not all results through `arp-scan -l` Here is the output:   1. `arp -a` result on Windows host   2. `arp` result on Linux VM   3. `arp-scan -l` on VM   !['arp -a' result on Windows host](http://i.stack.imgur.com/QlsvZ.png) !['arp' result on Linux VM](http://i.stack.imgur.com/8uype.png)   !['arp-scan -l' on VM](http://i.stack.imgur.com/tonET.png)


title: shell script to batch convert M4V to MP3 using VLC?

text: I want to batch convert a directory of M4V video files to MP3 audio files using VLC. (I don't mind using ffmpeg alternatively.) I found a bash script to get me started, but I don't know which VLC parameters to plug into the script. I want to use either a variable bitrate or 64kb/s. The sample rate can be 44100 (or lower). I'm not outputting video so I'm not sure if VLC requires those parameters. Can anyone help me fix up this script to meet my needs?               #!/bin/sh                                                                                vcodec="mp4v"     acodec="mp4a"     bitrate="1024"     arate="128"     mux="mp4"          vlc="/usr/bin/vlc"                                                                                if [ ! -e "$vlc" ]; then         echo "Command '$vlc' does not exist"         exit 1     fi          for file in "$@"; do         echo "=> Transcoding '$file'... "              dst=`dirname "$file"`         new=`basename "$file" | sed 's@\.[a-z][a-z][a-z]$@@'`.$mux              $vlc -I dummy -q "$file" \            --sout "#transcode{vcodec=mp4v,vb=1024,acodec=mp4a,ab=128}:standard{mux=mp4,dst=\"$dst/$new\",access=file}" \            vlc://quit         ls -lh "$file" "$dst/$new"         echo     done


title: How to install libssl-dev on Slackware?

text: libssl-dev does not seem to be installed on my Slackware server and is needed for various dependencies. How can I install this on Slackware? Searching around did not find anything and there really isn't a package manager with Slackware. I did try slackpkg, but there are no libssl packages on there. I do already have `openssl` installed and have for a long time. Is this a separate package from OpenSSL?


title: Mount var to another directory, Mysql Database not found

text: I had an issue with rootfs and /dev/root/ because it was full at 100%. I did this command:               du -h      So I read this post: > How to increase the size of rootfs? And I decided to mount /var to another directory by doing this:               mv /var /oldvar     mount --bind /home/vardisk /var      cd /oldvar     tar cf - . |(cd /var; tar xpf -)      However, on my website, Mysql Database couldn't be found. What can I do ? Thanks.


title: How it is decided which certificate of a Certificate Authority will be used in a system certificate chain

text: I am looking for PKI (Public Key Infrastructure) knowledge and particularly at OS's built-in certificate chain list. Of course on Windows the company decides which certificate will be built-in, but what about OpenSource operating system like Linux?


title: regex replace text in xml file within node from the command line

text: I have an XML file and I would like to replace everything that is between the open and closing tag within multiple instances of the g:gtin node with nothing. Is this possible from the command line, using sed or something similar?               <g:gtin>31806831001</g:gtin>


title: How to use a PS gamepad with OpenWRT?

text: I'm fairly new to OpenWRT and Linux in general so please bare with me. I'm trying to print the button presses from a playstation gamepad to the console on an Arduino Yun which has OpenWRT. I've used `opkg` to install a few packages like:               kmod-input-core - 3.8.3-1     kmod-input-joydev - 3.8.3-1      And if I use `lsusb` I can see the controller:               root@Arduino:~# lsusb -D /dev/bus/usb/001/004     Device: ID 054c:05c4 Sony Corp.     Device Descriptor:       bLength                18       bDescriptorType         1       bcdUSB               2.00       bDeviceClass            0 (Defined at Interface level)       bDeviceSubClass         0       bDeviceProtocol         0       bMaxPacketSize0        64       idVendor           0x054c Sony Corp.       idProduct          0x05c4       bcdDevice            1.00       iManufacturer           1 Sony Computer Entertainment       iProduct                2 Wireless Controller       iSerial                 0       bNumConfigurations      1       Configuration Descriptor:         bLength                 9         bDescriptorType         2         wTotalLength           41         bNumInterfaces          1         bConfigurationValue     1         iConfiguration          0         bmAttributes         0xc0           Self Powered         MaxPower              500mA         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        0           bAlternateSetting       0           bNumEndpoints           2           bInterfaceClass         3 Human Interface Device           bInterfaceSubClass      0 No Subclass           bInterfaceProtocol      0 None           iInterface              0             HID Device Descriptor:               bLength                 9               bDescriptorType        33               bcdHID               1.11               bCountryCode            0 Not supported               bNumDescriptors         1               bDescriptorType        34 Report               wDescriptorLength     483              Report Descriptors:                ** UNAVAILABLE **           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x84  EP 4 IN             bmAttributes            3               Transfer Type            Interrupt               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0040  1x 64 bytes             bInterval               5           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x03  EP 3 OUT             bmAttributes            3               Transfer Type            Interrupt               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0040  1x 64 bytes             bInterval               5     Device Status:     0x0000       (Bus Powered)      I did a quick search and most results related to accessing a gamepad from linux mention accessing through `/dev/input/js0` for example, where I only have `/dev/input/event0` which is always there, and I can see the sony gamepad under `/dev/usb/001/004` so I'm not sure if it's correctly initialized or not to begin with. Any hints/tips will be helpful. The other issue would be accessing the keys being pressed and printing to the console. Disk space is limited on the Yun and I haven't setup an SD card yet so no gcc/g++ yet. The quickest options for now I think are using Python or shell scripts. I've started with a little script from this post:               #!/usr/bin/env python     import sys               pipe = open('/dev/bus/usb/001/004','r')     #pipe = open('/dev/input/event0','r')     byte = []          while 1:             for bit in pipe.read(1):                     byte.append('%5X' % ord(bit))                     if len(byte) == 8:                             print byte                             byte = []      Which outputs this:               ['   12', '    1', '    2', '    0', '    0', '    0', '    0', '   40']     ['    5', '   4C', '    5', '   C4', '    1', '    0', '    1', '    2']     ['    0', '    1', '    9', '    2', '   29', '    0', '    1', '    1']     ['    0', '   C0', '   FA', '    9', '    4', '    0', '    0', '    2']     ['    3', '    0', '    0', '    0', '    9', '   21', '   11', '    1']     ['    0', '    1', '   22', '   E3', '    1', '    7', '    5', '   84']     ['    3', '   40', '    0', '    5', '    7', '    5', '    3', '    3']      and this never changes. I've also seen a lot of examples using pygame, but I haven't managed to install pygame yet(using `opkg install python-pygame`) and until I setup an SD I won't have space for gcc/g++ to compile from source. In short: how can I check if the gamepad is correctly installed ? If it's not, what would be the correct way to install an usb gamepad on openwrt ? What is the easiest/simplest way to print the gampad presses to console ?


title: Command-line parameters in bash script not recognised

text: I use Debian (Raspbian) Wheezy. If this command line works fine:               smsd -c sms/out -i 60 -0 -f sms/smsd.log      and this alias also works fine:               bsmsd='smsd -c sms/out -i 60 -0 -f sms/smsd.log'      then why does this self-same command line in an executable bash script start the command `smsd`, but does not see any of the parameters I'm specifying? This is the script:               #!/bin/bash          smsd -c sms/out -f /home/pi/sms/smsd.log -i 60 -0 -v      I've tried redirecting and piping, to no avail. I'm invoking the script (it's called ssmsd) from the command line like so:               ./ssmsd      After that, this is the output from `ps -fC smsd`:               UID        PID  PPID  C STIME TTY          TIME CMD      Edit: I know it doesn't recognise the parameters, because it tells me I didn't specify a spooling directory. But I _did_ : `-c sms/out`. When called from the script, it gives version number and author, and exits. Perhaps I should add: it calls itself a daemon, but it's not a _well-behaved_ daemon. You can't `smsd start|stop|restart` it, and it doesn't run in the background. So if I call it from a command line (or with that alias) and then start another terminal and do `ps -fC smsd`, I get:               UID        PID  PPID  C STIME TTY          TIME CMD     pi        2860  2621  0 17:49 pts/0    00:00:00 smsd -c xxxxxxx -i 60 -0 -f sms/smsd.log


title: How do I load a module to PulseAudio server?

text: I recently followed this guide to simultaneous audio outputs. It works great but now I have a huge name for the virtual device in the audio control panel making it expand off my screen. In Pulse Audio Control Panel (pavucontrol), I tried right clicking and using "Rename Device..." but an error pops up saying the following: ![Error I get in pavucontrol when renaming a device.](http://i.stack.imgur.com/vmlSi.png) My next logical question is how do I load `module-device-manager` in the PulseAudio server? I tried googling it but nothing i found was relevant. A little bit of help please? I dont care what it gets renamed to, I just want the control panel to fit on my screen. The current name is "Simultaneous output to GF100 High Definition Audi Controller Digital Stereo, EMU20k2 [X-Fi Titanium Series] Analog Stereo, GF108 High Definition Audio Controller Digital Stereo (HDMI), Built-in Audio Stereo"


title: How do I "cat and follow" a file?

text: A file is being sequentially downloaded by `wget`. If I start unpacking it with `cat myfile.tar.bz2 | tar -xj`, it may unpack correctly or fail with "Unexpected EOF", depending on what is faster. How to "cat and follow" a file, i.e. output content of the file to stdout, but don't exit on EOF, instead keep subsribed to that file and continue outputting new portions of the data, exiting only if the file is closed by writer and not re-opened within N seconds. * * * I've created a script cat_and_follow based on @arielCo's answer that also terminates the `tail` when the file is not being opened for writing anymore.


title: Howto find my xorg.conf. Where is it?

text: I can't find my xorg.conf. There is no xorg.conf file by default in Ubuntu 11.04. If I run: "whereis xorg.conf" I am seeing: xorg: /usr/lib/xorg /usr/lib64/xorg /usr/include/xorg may be I just can create it by myself? at /etc/X11/xorg.conf?


title: What libraries are there for reading/editing ID3s of mp3?

text: I think the title says it all. I need a library to allow me to read and edit ID3 Tags from C++ in Linux. Suggestions?


title: shrinking partition containing root filesystem

text: > **Possible Duplicate:**   >  Change main partition size to install another distribution ![](http://i.stack.imgur.com/Qp9ZW.png) this is the image showing partitions on my hard drive. I am reading linux from scratch and so i need to create a dedicated partition to make my machine. sda1 is alloted to root but it uses only 3.45 GB of about 15 GB. Rest ~ 11GB is free. So, I need to shrink sda1 and make a dedicated partition. This is my only option as only 1 MB is free on the disk and i need approx 3 GB. So, i searched and found this but can i shrink a partition by this method? If not, then please tell how to do that? Note: I have backed up my files on ubuntu one cloud. So, backup shouldn't be a problem.


title: Building from source on linux - mess in installed packages

text: Everytime when I want to build application from source on linux, I have to install dependencies libraries in my operating system (ubuntu). Typical scenario: Start ./configure Got error about missing library: xyz sudo apt-get install libxyz-dev Go to step 1. At the end I finish with mess in my operating system and problem with dependencies. For instance: The following packages have unmet dependencies:                librsvg2-dev : Depends: libglib2.0-dev (>= 2.12.0) but it is not going to be installed                     Depends: libgdk-pixbuf2.0-dev (>= 2.21.6) but it is not going to be installed                     Depends: libcairo2-dev (>= 1.2.0) but it is not going to be installed                     Depends: libgtk2.0-dev (>= 2.21.5) but it is not going to be  installed      Always ask myself what now ? Should I force ubuntu to install higher version of library ? Here is my question: Maybe there is another way to building software on linux(ubuntu) from source. Some isolate way. Not integrating to my OS ? I'm coming from java world and there, building a application != install every dependency in system. Any suggestion ? Best practice ?


title: How do you know what development packages to install before compiling a program from source?

text: An example for Python: What are the packages/libraries I should install before compiling Python from source? At this point, the only way I know is to `./configure` and wait for it to stop at errors, try to understand the error, and google the error message to find out which development package to download. That's inefficient. Which part of the documentation or code should I look? Is there some standard location?


title: portable command to unzip and untar on non GNU and old unix

text: On AIX 6.1 without `GNU Tool` installed I have a `.tar.gz` file.   On Ubuntu I would use the very useful command :               tar xzf myfile.tar.gz      but in this case the `z` switch is not possible.   I do remeber a long time ago a way to use `gzip | tar` but I really can't remember. Can someone help me with that with a command that could work on almost every system even oldfashion unix ?


title: Evolution and Exchange Server 2007 without MAPI

text: My organization is running an exchange server 2007 with MAPI disabled for security reasons. How do I connect with evolution? When I connect using the Microsoft Exchange option I get the error > The Exchange server is not compatible with Exchange Connector. > > The server is running Exchange 5.5. Exchange Connector supports Microsoft > Exchange 2000 and 2003 only. If I use the Exchange MAPI option I get > Authentication failed. > > MapiLogonProvider:MAPI_E_NETWORK_ERROR Which appears to be a network timeout, which confirms that administrators have MAPI turned off.


title: Ubuntu won't Hibernate

text: With my new built computer Ubuntu 10.4 lucid won't hibernate or suspend. It's a custom-built Core i7 on the Gigabyte X58A-UD3R motherboard. Hibernate is enabled in the bios. Running `sudo hibernate` gives: > hibernate:Warning: Tuxonice binary signature file not found. Some modules > failed to unload: nvidia hibernate: Aborting suspend due to errors in > ModulesUnloadBlacklist (use --force to override). After installing, linux-generic-tuxonice and linux-headers-generic-tuxonice, and rebuilding my nvidia dev drivers, it still does not work. But I think I'm closer. Now, when I run `sudo hibernate` I get:               hibernate: TuxOnIce reported the following errors:      - TuxOnIce was aborted (see dmesg).      - Some devices refused to suspend (see dmesg).      "gmesg | grep error" returns                [  736.173906] PM: Device usb9 failed to freeze: error -2      [  736.642208]                  : A device suspend/resume returned an error.      Any ideas how to find out what is on usb9 and why it's failing to freeze. The only thing that I have on usb is the keyboard and mouse.


title: Bash autocomplete in ssh session

text: It seems that bash doesn't want to autocomplete commands (what's annoying me right now is not autocompleting apt-get) when I'm logged into my machine from SSH. Is there some setting that will allow bash to autocomplete inside an ssh session?


title: How to run a cronjob in my regular environment?

text: Both the shell and environment variables that cronjobs are run in is completely different from the ones presented to me in `gnome-terminal`. How can I run a cronjob under the same circumstances as if I had run it in the terminal? My current solution is running the cronjob `env DISPLAY=:0.0 gnome-terminal -e my-command`, but this pops up a gnome-terminal, which isn't really acceptable.


title: Any good LVM tutorial?

text: I'm planning to user LVM in my next Linux installation, any links to good LVM tutorials/guides/FAQs would be welcomed.


title: replace text after match

text: aaaaaaaaa        bbbbbbbbb        -th ccccccccc_RD \            DDDDDDDD       FFFFFFFF       -th GGGGGGG_RD \      using sed/grep/awk etc, In the above text, if a line ends with "RD \" , replace "-th" with "-to" at the beginning of line. Desired output:               aaaaaaaaa        bbbbbbbbb        -to ccccccccc_RD \            DDDDDDDD       FFFFFFFF       -to GGGGGGG_RD \      any help is greatly appreciated.


title: Kernel clears the U-Boot splashscreen

text: We have a proprietary embedded board design based on the AM335x EVM. I have configured MLO to display a `linux_logo.h` image and `u-boot.img` to display a bitmap image using the `bmp` command. When the kernel starts it clears the screen. I would like to have the splashscreen persist until something else writes to the screen. Where can I find the relevant code in the Linux kernel to do this?


title: Why does \033 escape work for vars like PS1 and \x1b doesn't?

text: According to the documentation of `echo` builtin, (as well as `printf`), `\033` and `\x1b` should both translate to the same ASCII control code (`Esc`, which is decimal 27). While both `\x1b` and `\033` work the same for simple `echo -e` commands, they cannot be interchangeably used in prompt variables, such as `PS1`. Why?


title: Can I set a bash timeout only for virtual consoles (ctrl+alt+{f1-f6})

text: I know that I can set a `TMOUT` variable to automatically end a bash session after a specified period of inactivity. However, what I want is to apply that _only_ to my 6 built-in virtual consoles, which are accessed by `ctrl`+`alt`+{`F1`...`F6`}. I almost always use a Terminal app when I want to open a terminal. When I leave my computer, I lock the screen, which prevents anyone from accessing those terminals. So I would like to not have a timeout on those. However, on rare occasions I will use one of my virtual consoles to work on my computer. Usually it is due to my main Gnome session being frozen or otherwise unusable. I kill the offending app, then switch back to my main session. On top of that, a few times I have forgotten to exit out of my virtual console when I have restored my Gnome session. Thus, my computer is completely unprotected if I walk away, since locking the screen on Gnome only locks the GUI; a user could switch to a virtual console and kill my gnome lockscreen or otherwise mess with my computer. Can I set a timeout value for the built-in virtual consoles only, while allowing a Terminal app session to remain inactive indefinitely?


title: Default exit code when process is terminated?

text: When a process is killed with a handle-able signal like `SIGINT` or `SIGTERM` but it does not handle the signal, what will be the exit code of the process? What about for unhandle-able signals like `SIGKILL`? From what I can tell, killing a process with `SIGINT` likely results in exit code `130`, but would that vary by kernel or shell implementation?               $ cat myScript     #!/bin/bash     sleep 5     $ ./myScript     <ctrl-c here>     $ echo $?     130      I'm not sure how I would test the other signals...               $ ./myScript &     $ killall myScript     $ echo $?     0  # duh, that's the exit code of killall     $ killall -9 myScript     $ echo $?     0  # same problem