title: unix process showing unusual cpu usage and timing in ps aux

text: USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND     root       684 186912060  0.0 17140 988 ?      Ss   Feb24 54195432:44     root      7319 288895842  0.0 4096 668 ?       S    04:30 42395300:24     saas     25057 245345663  0.3 235900 24384 ?   S    Apr20 40625337:05 /usr/sbin/apache2 -k start      this is snap of ps aux, you can see some processes are showing unusual timing and cpu usage, other processes are coming with normal usage, like 0.02 and timings are also normal. How can I figure out that what is going wrong here? following is os specification, Ubuntu 10.04.1 LTS Here is the content of `/proc/684/stat`:               684 (dovecot) S 1 684 684 0 -1 4202816 144434 3852269 1 28 66836029252570838 18446744073709551615 4618082254236597460 -4618082254236581157 20 0 1 0 960 17551360 247 18446744073709551615 139981395468288 139981395671908 140735117731776 18446744073709551615 139981388365027 0 0 4096 90627 18446744071580056442 0 0 17 0 0 0 0 0 0


title: Possible to see dead proccesses?

text: In `man ps`, it clearly states the different states a process can have on Linux.               D    Uninterruptible sleep (usually IO)     R    Running or runnable (on run queue)     S    Interruptible sleep (waiting for an event to complete)     T    Stopped, either by a job control signal or because it is being traced.     W    paging (not valid since the 2.6.xx kernel)     X    dead (should never be seen)     Z    Defunct ("zombie") process, terminated but not reaped by its parent.      Even tho `X` is a process state, it should never be seen. But is that correct? Is there a theoretical way to see that as a state on a process? Or is it completely 100% impossible?


title: gnome-tweak-tool

text: Gnome tweak tool is reporting an error that the extension to choose your GNOME shell theme is not enabled, although it is. Is there any way to manually override it, other than through the tool itself?


title: Different forms of executing a shell script

text: There are a few similar questions around that I've already seen, but I've come up with something different. I'm reading this http://www.tldp.org/LDP/abs/html/invoking.html and I got confused when I read: "Not recommended is using > sh scriptname , since this effectively disables reading from stdin within the script." There are two things here: first, I tried to execute a script like > sh myscript.sh < file.txt and it reads from stdin fine. The second thing is that I understand that adding shebang at the top of the script > #!/bin/bash means exactly the same as > bash myscript.sh , so I don't get what the author is pointing out there. I just got confused. Anyon that understands what's the author's point? Thanks so much in advance.


title: How can I adjust this short shell script to fit my needs?

text: I am attempting to force `powertop` to run when I log in by using the Startup Applications wizard in Ubuntu. Under the 'Command' entry, I've placed `gnome- terminal -x /home/***/Documents/programming/scripts/powertop.sh`. It's using a one-line bash shell script:               echo "******" | sudo -S powertop      This inputs my superuser password correctly but doesn't allow me to interact with powertop after it's initialized because it's continuously running echo. How can I get privileges to run powertop using a shell script, yet still be able to use it in gnome-terminal?


title: MySQL 5.1.73 in Oracle LINUX : Which is the correct mysql configuration file?

text: I have installed **MySQL 5.1.73** manually by RPM on **Oracle LINUX 5**. When I searched configuration file - **my.cnf** I run below command and get list of multiple configuration files. $ locate *.cnf               /etc/pki/tls/openssl.cnf     /u000/local/openssl/openssl.cnf     /u000/local/openssl/opensslnew.cnf     /usr/openv/pdde/pdopensource/ssl/openssl.cnf     /usr/share/doc/MySQL-server-community-5.1.73/my-huge.cnf     /usr/share/doc/MySQL-server-community-5.1.73/my-innodb-heavy-4G.cnf     /usr/share/doc/MySQL-server-community-5.1.73/my-large.cnf     /usr/share/doc/MySQL-server-community-5.1.73/my-medium.cnf     /usr/share/doc/MySQL-server-community-5.1.73/my-small.cnf     /usr/share/mysql/my-huge.cnf     /usr/share/mysql/my-innodb-heavy-4G.cnf     /usr/share/mysql/my-large.cnf     /usr/share/mysql/my-medium.cnf     /usr/share/mysql/my-small.cnf     /usr/share/mysql-test/include/default_my.cnf     /usr/share/mysql-test/include/default_mysqld.cnf     /usr/share/mysql-test/include/default_ndbd.cnf     /usr/share/mysql-test/std_data/bug15328.cnf     /usr/share/mysql-test/std_data/ndb_config_mycnf1.cnf     /usr/share/mysql-test/std_data/ndb_config_mycnf2.cnf     /usr/share/mysql-test/suite/federated/my.cnf     /usr/share/mysql-test/suite/ndb/my.cnf     /usr/share/mysql-test/suite/rpl/my.cnf     /usr/share/mysql-test/suite/rpl/rpl_1slave_base.cnf     /usr/share/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf     /usr/share/mysql-test/suite/rpl/t/rpl_current_user.cnf     /usr/share/mysql-test/suite/rpl/t/rpl_rotate_logs.cnf     /usr/share/mysql-test/suite/rpl/t/rpl_test_framework.cnf     /usr/share/mysql-test/suite/rpl_ndb/my.cnf     /usr/share/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf      I am not sure which one is the correct configuration file which I have to modify? My application has 260 tables.   * So, should I also need to modify `my-large.cnf or my-medium.cnf or my-small.cnf`?    * Should I need to move the selected configuration file in /etc/ directory? Please advice...


title: Remap input keys in /dev/input level

text: I want to remap input keys from keyboard and mouse, but I need it to be in low level, so that reading `/dev/input*` shows remapped functions. Example: I have regular keyboard and I want `ENTER` key to emit `left mouse` button click. Is that possible and how?


title: Shellscript! Syntax error: unexpected "("

text: **Update:** After the changes from the first answer I got some more error codes. : not found: line 23: { esxidown.sh: line 24: redir error Insufficient arguments. : not found: line 26: esxidown.sh: line 53: syntax error: unexpected word (expecting "do") I am new to shellscripting so I barely understand whats going on but unfortunately not enough to debug it properly. I got a problem with a script I am trying to run. The situation is: Me having a UPS and wanting to get a script which shuts down my VM's and afterwards shuts down the Host if the UPS starts running. I already found a script that should savely shut down the VM's and then shut down the host. But I get the following error: syntax error: unexpected "(" I tried a few things but nothing worked. I hope you can help me. **Script without personal changes:**               #!/bin/sh     # ESXi 5.1 host automated shutdown script          # these are the VM IDs to shutdown in the order specified     # use the SSH shell, run "vim-cmd vmsvc/getallvms" to get ID numbers     # specify IDs separated by a space     SERVERIDS=$(vim-cmd vmsvc/getallvms | sed -e '1d' -e 's/ \[.*$//' | awk '$1 ~ /^[0-9]+$/ {print $1}')          # New variable to allow script testing, assuming the vim commands all work to issue shutdowns     # can be "0" or "1"     TEST=0          # script waits WAIT_TRYS times, WAIT_TIME seconds each time     # number of times to wait for a VM to shutdown cleanly before forcing power off.     WAIT_TRYS=20          # how long to wait in seconds each time for a VM to shutdown.     WAIT_TIME=10          # ------ DON'T CHANGE BELOW THIS LINE ------          validate_shutdown()     {         vim-cmd vmsvc/power.getstate $SRVID | grep -i "off" > /dev/null 2<&1         STATUS=$?              if [ $STATUS -ne 0 ]; then     if [ $TRY -lt $WAIT_TRYS ]; then             # if the vm is not off, wait for it to shut down             TRY=$((TRY + 1))             echo "Waiting for guest VM ID $SRVID to shutdown (attempt #$TRY)..."             sleep $WAIT_TIME             validate_shutdown         else             # force power off and wait a little (you could use vmsvc/power.suspend here instead)             echo "Unable to gracefully shutdown guest VM ID $SRVID... forcing power off."             if [ $TEST -eq 0 ]; then     vim-cmd vmsvc/power.off $SRVID             fi     sleep $WAIT_TIME         fi     fi     }          # enter maintenance mode immediately     echo "Entering maintenance mode..."     if [ $TEST -eq 0 ]; then     esxcli system maintenanceMode set -e true -t 0 &     fi          # read each line as a server ID and shutdown/poweroff     for SRVID in $SERVERIDS     do     TRY=0          vim-cmd vmsvc/power.getstate $SRVID | grep -i "off\|Suspended" > /dev/null 2<&1     STATUS=$?          if [ $STATUS -ne 0 ]; then     echo "Attempting shutdown of guest VM ID $SRVID..."         if [ $TEST -eq 0 ]; then     vim-cmd vmsvc/power.shutdown $SRVID         fi     validate_shutdown     else     echo "Guest VM ID $SRVID already off..."     fi     done          # guest vm shutdown complete     echo "Guest VM shutdown complete..."          # shutdown the ESXi host     echo "Shutting down ESXi host after 10 seconds..."     if [ $TEST -eq 0 ]; then     esxcli system shutdown poweroff -d 10 -r "Automated ESXi host shutdown - esxidown.sh"     fi          # exit maintenance mode immediately before server has a chance to shutdown/power off     # NOTE: it is possible for this to fail, leaving the server in maintenance mode on reboot!     echo "Exiting maintenance mode..."     if [ $TEST -eq 0 ]; then     esxcli system maintenanceMode set -e false -t 0     fi          # exit the session     exit


title: Xargs and rm with a *

text: I am trying to execute the following command               ls -d a* | xargs -i sudo rm -rf {}/*      The problem is that when I add the `/*` part the command does not work. I want to remove the directory contents (not the directory itself).


title: Man page with preserved text decorations, proportional text and fixed-width code

text: How can I get contents of a man page without the text being wrapped around column 80 or so? I'd prefer the output to have proper formatting, line bolding, underscores, fixed-width font for examples etc. However, all the command-line utilities and online man page resources provide either wrapped (http://linux.die.net) or un-formatted (`man mmap | col -bx > mmap.txt`), or improperly formatted (`man -t mmap | ps2pdf - mmap.pdf`) versions. How can I get the properly formatted unwrapped text from a man page to be used for further booklet printing?


title: How to proceed solving ppp connection problems?

text: I got an embedded system trying to create a ppp connection using a GSM modem. However the connection is never established and all I get is this error message in syslog:               Oct 12 08:38:48 pppd[451]: pppd 2.4.4 started by root, uid 0     Oct 12 08:38:59 pppd[451]: Connect script failed     Oct 12 08:39:00 pppd[451]: Exit.      I now need some hints how to proceed finding the cause of this problem. Where should I start looking?


title: what is the best way to convert CRLF to LF and the viceversa for C++ files in my project

text: > **Possible Duplicate:**   >  How to bulk convert all the file in a file system branch between Unix and > Windows line break format? which is the best tool to convert the CRLF to LF for my project in C++,one of the guideline is to do so before review.


title: How to replace all the tabs in each file in a file system branch with 2 spaces each?

text: I code Scala and it's convention is to use double spaces per level for identiation. But using different editors makes my sources filled with a mix of spaces and tabs. I'd like to refactor all the files (*.scala files, actually, but specifying this is not necessary) (in a given directory and all the underlying FS branch (recursively)) automatically, replacing all the tabs with double spaces. I believe there is an easy and beautiful way to do this with classic Unix/GNU tools, but I lack any experience in this area. Would you be so kind to help me?


title: Is there a way to dump a CPU's CPUID information?

text: I'm familiar with `lshw`, `/proc/cpuinfo`, etc. But is there a method for getting at a CPU's CPUID opcode?


title: Allow non-root user to read/write /dev files

text: In my `/dev` folder, I would like the following files to be user readable and writable:               /dev/ttyUSB0     /dev/gpib0      How do I do this without using `chgrp`? I can edit `/etc/udev/rules.d` but I do not know the syntax.


title: How to get 3 minutes future date?

text: I want to get the date 3 minutes on the future. For example, if "now" is               01-Jan-70 00:00:00 GMT       I want to get               01-Jan-80 00:03:00 GMT      How should I do it? I'm working with busybox linux.


title: Where is the source code for copy-paste?

text: I've been working with copy paste functionality on a Linux system. I downloaded the kernel source for the first time. Where can I find the code related to copy paste functionality? My guess is that it does not belongs to Kernel part of Linux. If I'm right, Where can I find it?


title: Linux distribution that still ships with KDE3?

text: Is there any Linux distribution that still comes with support of KDE3?


title: Safely use SD cards when power can go out at any time

text: We're working on a small embedded Linux system (2.6.35-ish) with a smallish internal NAND device for the OS and applications (250-500Meg) and an SD card with 8Gb SDHC SD cards for data. The unit's power can be cut at any time. The system must store data to SD cards. This data is pretty important... it's the whole purpose of the system. The systems are usually entirely disconnected from any network in remote locations and data is retrieved via sneakernet every 4-8 weeks. Currently, we've simply got VFAT on the SD cards. That was mainly so the first test clients could easily copy data off manually onto their Win7 laptops. However, I'm now worried that it's only a matter of time until a power outage at the wrong time causes data loss. What's the best way to configure such a system to prevent data loss? JFFS2 sounds like what I would want in terms of how it writes data (and the performance needs are not high at all), but it sounds fairly kludgy to use block2mtd, etc. I'm also not sure how the card's wear leveling will interact with it. What's the best way to do this? **EDIT** I'm now thinking of leaving the filesystem VFAT and allocating day-sized files at a time, filled with 0xFF, that should greatly limit the exposure to power cycle failures. I could then only append records within those precreated blocks, and hopefully the SD cards aren't so stupid that they'd erase/wear level writes to 0xFF regions. I can use noatime, but is there a VFAT nomtime equivalent to prevent writes to the modified time field? I'd need some way to prevent any metadata updates at all until a new day's file is created. **EDIT 2** Someone on the electronics stack exchange reminded me there's also ECC data on NAND, so there's no way to prevent the need for an erase. So, would JFFS2 via block2mtd be appropriate in this situation? **EDIT 3** It's worse than I thought. The SD cards I have will erase the data blocks even if you write the exact same contents to disk. The eraseblocks are 64KB, and that's too large to entirely delay writes for. I'll store up to 128KB of data in NAND flash (which I can control the write behavior of), in a kind of journal, and then write 128KB blocks to a 128KB-aligned file in a VFAT partition on the SD card (in case other SD cards have 128KB eraseblocks).


title: What's the last number in this ip address?

text: An IP address like this `223.248.0.0/24` or `223.248.0.0/16` What's the last number mean in the IP address (24 or 16 in the above example)? Is there a simple way to understand how to set the number after the slash?


title: Making shortcuts cross desktop environment, possible?

text: I'm a big fan of keyboards, so a lot of thing a done by combination of keys, like open a file browser, web browser etc. Is there some daemon that can monitor my key presses, and launch some program afterwards, so that I won't have to configure anything else after moving to another desktop environment?


title: Is there any reason why I get ^[[A when I press up arrow at the console login screen?

text: Whenever I'm at the console login, I press `up` arrow intentionally to see the previously typed commands. But I see this `^[[A`. But when I press `Ctrl` `Alt` `Print Screen` `Scroll Lock` `Pause Break` `Page Up` `Page Down` `Win` keys doesn't echo any characters. What might be the reason behind? Does `^[[A` sort of characters imply anything? ![enter image description here](http://i.stack.imgur.com/4UL2M.png)


title: Is it possible to import vmail folder from old iRedMail to new iRedMail installation?

text: Basically, what I did:   1. Copied vmail folder to my local machine.   2. Reinstalled my VPS.   3. Installed iRedMail again.   4. Created same users on the same domain. Question is - can I somehow copy over my old vmail folder in new one to import the old emails ? Ubuntu 12.04, iRedMail 0.8.5 on postgresql. Previous installation was on MySQL, I have full database backup. I do not know what info to give more, surely ask for any other.


title: How to use redobackup without free partition

text: I had a spare 250GB drive a while ago from an old Windows Vista computer. There wasn't much data on the drive. I wanted to use it for a new OS in my computer, and I was in a rush to use it, so I backed up the partition with Redo Backup to a folder on my current NTFS drive. It didn't work right away, and I ended up having 3 folders worth of backup data, each about 30GB. When I tried to restore it in VMware or Virtualbox to a virtual disk, there were a lot of "write errors". Is there a way to transfer these backup files to a virtual disk file? Any way (Windows, Linux, Livecd, VM) is good, but I'm trying not to use free space, so a solution that doesn't require a lot of working space would be optimal.


title: Hard drive partition and updating trouble

text: I'm new to linux and am using Linux Mint 15 Olivia. I am running it alongside windows 7 and I want to increase the size of my current linux hard drive partition. I read somewhere that I should install the GParted package, but I get this error:               $ sudo apt-get install gparted     Reading package lists... Done     Building dependency tree      Reading state information... Done     E: Unable to locate package gparted      And then someone told me I should try entering:               $ sudo apt-get update      And then I keep getting this at the bottom of the installation log: > W: GPG error: http://archive.canonical.com raring Release: The following > signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic > Signing Key Then I tried running: > sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com > 40976EAF437D05B5 and get the output: > Executing: gpg --ignore-time-conflict --no-options --no-default-keyring > --secret-keyring /tmp/tmp.q0RYkOedsz --trustdb-name /etc/apt//trustdb.gpg > --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg > --recv-keys --keyserver keyserver.ubuntu.com 40976EAF437D05B5 gpg: > requesting key 437D05B5 from hkp server keyserver.ubuntu.com gpg: key > 437D05B5: "Ubuntu Archive Automatic Signing Key " not changed gpg: Total > number processed: 1 gpg: unchanged: 1 And when I run: > for f in /etc/apt/sources.list.d /etc/apt/sources.list.d/*; do echo "$f:"; > cat "$f"; done I get: http://pastebin.com/eaDM7ive I already changed the softer source to my local mirror. As I said I am very new to all of this. Any ideas about what could be wrong?


title: Script to split string

text: @terdon's answer provides this script:               find . -type f -name "*mp3" | while read file; do          album="$(basename "$(dirname "$file")")";          filename="$(basename "$file")";          artist=${filename%%-*};          title=${filename##*-};          title=${title%%.mp3};          eyeD3 -A "$album" -t "$title" -a "$artist" "$file";      done      It makes use of `eyeD3` to update mp3 tags. It extracts Album, Artist and Title from file name, supposing that the file name is `Album/Artist - Title.mp3`. Well, after running it the Title field is starting with a blank space. See below: ![enter image description here](http://i.stack.imgur.com/B5DL1.png) How to fix this if my mp3 files have the pattern               Album/<Artist with possible spaces> - <track number> - <Title with possible spaces>.mp3


title: How do I stop charging the battery way prior to 100% in OpenBSD?

text: I'm thinking about using a netbook as an OpenBSD server. I'd like it to have UPS -- so the integrated battery is quite useful. However, I'm very familiar with the batteries going dead very quickly if stored at 100% charge, plus topped up back to 100% all the time is guaranteed to make it only worse. I'd like to avoid this, to ensure the battery could easily cover one to two hours of power loss for years to come -- which means that charging should only start when below 40% to 50%, and stop at about 60% to 80% (else, it'll probably already only hold at most 60% of charge after a year, and be entirely useless some short time after that). There's a similar question, which has also been cross-posted, and it appears to suggest that ThinkPads and Dell laptops have some proprietary features to this effect; but what about cheapo Acer netbooks?


title: Alcor Multi Flash Reader Arch Linux

text: OS: Arch Linux Hardware: Toshiba S55 lsusb -v               Bus 001 Device 004: ID 058f:6366 Alcor Micro Corp. Multi Flash Reader     Device Descriptor:       bLength                18       bDescriptorType         1       bcdUSB               2.01       bDeviceClass            0 (Defined at Interface level)       bDeviceSubClass         0        bDeviceProtocol         0        bMaxPacketSize0        64       idVendor           0x058f Alcor Micro Corp.       idProduct          0x6366 Multi Flash Reader       bcdDevice            1.00       iManufacturer           1        iProduct                2        iSerial                 3        bNumConfigurations      1       Configuration Descriptor:         bLength                 9         bDescriptorType         2         wTotalLength           32         bNumInterfaces          1         bConfigurationValue     1         iConfiguration          0          bmAttributes         0xa0           (Bus Powered)           Remote Wakeup         MaxPower              100mA         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        0           bAlternateSetting       0           bNumEndpoints           2           bInterfaceClass         8 Mass Storage           bInterfaceSubClass      6 SCSI           bInterfaceProtocol     80 Bulk-Only           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x01  EP 1 OUT             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x82  EP 2 IN             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0      lspci               00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)     00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)     00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)     00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)     00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 04)     00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)     00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 04)     00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 04)     00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d4)     00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d4)     00:1c.3 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #4 (rev d4)     00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 04)     00:1f.0 ISA bridge: Intel Corporation HM86 Express LPC Controller (rev 04)     00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 04)     00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 04)     01:00.0 3D controller: NVIDIA Corporation GK208M [GeForce GT 740M] (rev ff)     03:00.0 Network controller: Qualcomm Atheros QCA9565 / AR9565 Wireless Network Adapter (rev 01)     04:00.0 Ethernet controller: Qualcomm Atheros QCA8171 Gigabit Ethernet (rev 10)      The OS doesn't seem to detect my SDHC card when I insert it. Does Linux support this hardware? ls /dev/sd*               /dev/sda  /dev/sda1  /dev/sda2  /dev/sda3  /dev/sda4  /dev/sda5  /dev/sd


title: Unable to install g++

text: How to fix this:               sahil@sahil-XPS-L501X ~ $ sudo apt-get install g++      Reading package lists... Done      Building dependency tree             Reading state information... Done      Some packages could not be installed.      This may mean that you have requested an impossible situation     or if you are using the unstable distribution that     some required packages have not yet been created      or been moved out of Incoming. The following information     may help to resolve the situation:          The following packages have unmet dependencies:       g++ : Depends: gcc (>= 4:4.8.1-2ubuntu3) but it is not going to be installed            Depends: g++-4.8 (>= 4.8.1-4~) but it is not going to be installed            Depends: gcc-4.8 (>= 4.8.1-4~) but it is not going to be installed      E: Unable to correct problems, you have held broken package          sahil@sahil-XPS-L501X ~ $ sudo apt-cache policy g++ gcc g++-4.8 gcc-4.8     g++:       Installed: (none)       Candidate: 4:4.8.1-2ubuntu3       Version table:          4:4.8.1-2ubuntu3 0             500 http://archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages     gcc:       Installed: (none)       Candidate: 4:4.8.1-2ubuntu3       Version table:          4:4.8.1-2ubuntu3 0             500 http://archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages     g++-4.8:       Installed: (none)       Candidate: 4.8.2-1ubuntu1       Version table:          4.8.2-1ubuntu1 0             500 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu/ saucy/main amd64 Packages          4.8.1-10ubuntu9 0             500 http://archive.ubuntu.com/ubuntu/ saucy-updates/main amd64 Packages          4.8.1-10ubuntu8 0             500 http://archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages     gcc-4.8:       Installed: (none)       Candidate: 4.8.2-1ubuntu1       Version table:          4.8.2-1ubuntu1 0             500 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu/ saucy/main amd64 Packages          4.8.1-10ubuntu9 0             500 http://archive.ubuntu.com/ubuntu/ saucy-updates/main amd64 Packages          4.8.1-10ubuntu8 0             500 http://archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages


title: Take copy of TTY0 text

text: I have some output in `TTY1` that I think might hold clues as to why my last GUI session froze (`Ctrl``Alt``Backspace` was able to get me back to the terminal and I reloaded the GUI). However, I cannot seem to find a way of copying the text that is on screen, but (I hope) not vanished from a file/device yet. Any suggestions?


title: Detecting if duplicity will perform a full backup

text: I'm using `duplicity` with the `\--full-if-older-than <time>` option to make a new full backup now and then. The problem is that I can hold only two full backups at my destination. This means that whenever a new full backup needs to be done, I _first_ need to have a call to `remove-all-but-n-full 1`. Is there an easy way of achieving that with `duplicity` command's line tool or I need to do the scheduling logic by myself ? I just need to know if the original `duplicity` call will lead to a full backup. Or is there an option to automatically prune backups once the destination is full ?


title: How can i change the format of text using sed?

text: cat > inputfile          X1 a1,b1,c1,d1.................. dn     X2 a2,b2,c2,d2.................. and so on upto n     ................................................     ................................................     Xn an,bn,cn,dn....................and so on upto n      output format:               X1 a1 +        b1 +        c1 +        .        .        .        .          X2 a2 +        b2 +        c2 +        .        .        .               and so on      I am trying something like                sed ':b;s/,/\     /;tb;s/\     / +/g'      NOTE : I need to add a tab before `b1 +,c1 +....` ,`b2 +,c2 +,...` etc


title: How can I install MS Windows fonts on Fedora 15?

text: I've just installed Fedora 15 and here is some troubles with fonts. How can I install MS fonts?


title: dd behavior, default writing and partitions

text: I am confused about the behavior of dd. Say we have some SD card called `/dev/foo` and this card has partitions `/dev/foop0` and `/dev/foop1`. Using dd, I can set the `of` argument to `/dev/foo` and `dd` won't complain. But what exactly will happen? Will `dd` just write to the first partition? Or will it overwrite both partitions?


title: Every few minutes sound is reset

text: I'm running Debian testing and I have a script that sets the volume of speakers on startup that looks like this:               amixer -c 0 set Surround  50% > /dev/null &     amixer -c 0 set Center   100% > /dev/null &     amixer -c 0 set Front     80% > /dev/null &     amixer -c 0 set LFE       50% > /dev/null &     amixer -c 0 set Side      80% > /dev/null &      The problem I'm having is that this configuration is reset to the default every few minutes so I have to continuously run the script to fix my configuration. I think it happens most often when I'm watching something that is using flash or a browser. I can successfully watch a movie with VLC without this happening. Anyone have any clue as to what the problem is?


title: sshfs and Emacs: file changed on the disk

text: I am using Mac 10.6.8 SSHFS version 2.4 fuse4x library version: FUSE 2.8.7 / fuse4x 0.9.2 I connect via sshfs to a remote cluster (via a bridge). I modify the remote files with emacs. The problem is that emacs very often tells me that a file that I modifying has changed on the disk. I have used sshfs successfully and without error on other client, but with the same cluster. I can't understand the origin of this behavior, could it be that the internet connection is not very stable? This problem is very serious because I have experienced data loss in more of one occasion. Is there something I can do, maybe changing come option of ssh? currently I have the following configuration:               Host            remote     HostName        localhost     Port            2222     HostKeyAlias    remote.address     User            username               Host            bridge     HostName        bridge.address     HostKeyAlias    bridge     User            username     TCPKeepAlive    no     LocalForward    localhost:2222 remote:22


title: SSH tunneling: connect_to localhost port 22: failed

text: I want to connect from my computer to a remote computer using a middle server(u port forwarding). I run this command on remote computer:               ssh -R 9300:localhost:22 user@middleserver      and this one on my system:               ssh remoteuser@middelserver -p 9300      But I get this error on my system:               ssh_exchange_identification: Connection closed by remote host      this is the log of remote computer:               debug1: client_request_forwarded_tcpip: listen localhost port 9309, originator xxx.xxx.xx.xx port 21470     debug2: fd 7 setting O_NONBLOCK     debug1: connect_next: host localhost ([::1]:22) in progress, fd=7     debug2: fd 7 setting TCP_NODELAY     debug3: fd 7 is O_NONBLOCK     debug3: fd 7 is O_NONBLOCK     debug1: channel 1: new [xx.xx.xx.xx]     debug1: confirm forwarded-tcpip     debug3: channel 1: waiting for connection     debug1: channel 1: connection failed: Connection refused     debug2: fd 8 setting O_NONBLOCK     debug1: connect_next: host localhost ([127.0.0.1]:22) in progress, fd=8     debug2: fd 8 setting TCP_NODELAY     debug3: channel 1: waiting for connection     debug1: channel 1: connection failed: Connection refused     connect_to localhost port 22: failed.     debug2: channel 1: zombie     debug2: channel 1: garbage collecting     debug1: channel 1: free: xxx.xxx.xxx.xxx, nchannels 2     debug3: channel 1: status: The following connections are open:       #0 client-session (t4 r2 i0/0 o0/0 fd 4/5 cc -1)      What's the problem?


title: du reports size for a directory 4 KBs more than the sum total of the contents

text: ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1$ ls ./control     amer  calls  q1  q2  q3  quit.c  RCS  SCCS     ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1$ du ./control     20  ./control/calls     16  ./control/RCS     40  ./control/SCCS     96  ./control     ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1$ du ./control/*     0   ./control/amer     20  ./control/calls     4   ./control/q1     4   ./control/q2     4   ./control/q3     4   ./control/quit.c     16  ./control/RCS     40  ./control/SCCS     ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1$      Please note `du` reports that control directory occupies 96 bytes. Now when I add the bytes consumed by the individual files, it comes to be 92 bytes. In the same way, for all reporting du shows 4 bytes more than the sum total of the contents. What this extra 4 bytes from? > EDIT#1               ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1$ ls -ld $_     drwxrwxr-x 5 ravbholua ravbholua 4096 Dec  8 21:39 control      `du` ( or linux) uses 1024-byte blocks (1KB) for reporting (1024 * 4 = 4096) a file.               ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1/control$ ls     ame  amer  calls  q1  q2  q3  quit.c  RCS  SCCS     ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1/control$ du ame     4   ame     ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1/control$ cat ame     a     ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1/control$ ll ame     -rw-rw-r-- 1 ravbholua ravbholua 2 Dec  8 21:39 ame      So the above file 'ame' which contains only letter 'a' and 'enter key' occupies 4 KBs of my disk space. So that means for a file/directory linux is allocating 4KB of my disk space!!!! and it will allocate in multiples of 4KB. Also adding one more thing: `ls -l` reports size in units of byte for a directory but not for a regular file. With ref. to the above file 'ame', its clear that for a regular file `ls -l` reports size as character count and not bytes.


title: How can I reset the bash filename completion for "more"?

text: I've done something that has changed the way TAB auto-complete works, but only for the more command. Every other command lists the possible completions, but more now lists ALL of the possibilities inside a pair of single quotes. So in /etc, if I type               more pass<TAB>      The result is               $ more 'passwdqc.conf     passwd     passwd-'       Typing               less pass<TAB>      Results in               $ less passwd     passwd         passwd-        passwdqc.conf        How can I reset it so that `more`'s autocompletion behaves more like `less`? Edit:               $ shopt -u     autocd          off     cdable_vars     off     cdspell         off     checkhash       off     checkjobs       off     compat31        off     compat32        off     compat40        off     compat41        off     direxpand       off     dirspell        off     dotglob         off     execfail        off     extdebug        off     failglob        off     globstar        off     gnu_errfmt      off     histreedit      off     histverify      off     hostcomplete    off     huponexit       off     lastpipe        off     lithist         off     login_shell     off     mailwarn        off     no_empty_cmd_completion off     nocaseglob      off     nocasematch     off     nullglob        off     restricted_shell    off     shift_verbose   off     xpg_echo        off     $ set -o     allexport       off     braceexpand     on     emacs           on     errexit         off     errtrace        off     functrace       off     hashall         on     histexpand      on     history         on     ignoreeof       off     interactive-comments    on     keyword         off     monitor         on     noclobber       off     noexec          off     noglob          off     nolog           off     notify          off     nounset         off     onecmd          off     physical        off     pipefail        off     posix           off     privileged      off     verbose         off     vi              off     xtrace          off


title: BSD browser information

text: I am developing an application and I need some BSD browser information. Specifically the output of http://browserspy.dk/browser.php If someone could post the output of Firefox on FreeBSD. OpenBSD and Dragonfly or NetBSD would help too if anybody has them installed but I mainly need the FreeBSD information.


title: apt repository not showing in apt-cache policy, why?

text: I have a private mini-dinstall based repository. `sources.list.d` has an entry for it, like               https://user:pass@my.host/repos/ tools/      I have installed `apt-transport-https` and I can happily install packages in aptitude. That's good. But `apt-cache policy` does not list it. And I wonder why and how to debug this? Update: This is on debian/stable, and as requested, here is the output for a package in the private repos:               # apt-cache policy elrond-tools     elrond-tools:       Installed: 1.0       Candidate: 1.0       Version table:          1.0 0             500 https://my.host/repos/ tools/ Packages      *** 1.0 0             100 /var/lib/dpkg/status      **Update 2** : Okay, my confusion is increased now. I have switched the URI to `http://10.*/` and suddenly it shows up. Then turned it back to the original `https` URL. And now that one works too. Luckily my old stuff was still in the scrollback, and double checking it did not reveal anything new (as in: I have not missed something in the first place). So I am confused now.


title: Measuring CPU %steal on VMware and Hyper-V hypervisors

text: For Xen Linux guests, `%steal` time is readily available via top and other utilities. Is it possible to get this and related metrics from within a Linux guest when running a non-Xen hypervisor such as ESXi or Hyper-V? For Windows guests, both VMware and Microsoft provide perfmon counters. Example: ![vmware perfmon](https://gs1.wac.edgecastcdn.net/8019B6/data.tumblr.com/5fb69f67fe9976259b0209c63cb6d7fc/tumblr_mtzr01k5iF1qzcm9mo1_500.png) But these don't seem to be exposed via vanilla `top` in Centos 6.4.


title: Best solution advice for backup to NAS over WAN

text: What is the best solution for daily backup of linux folder to NAS server over WAN? Here is situation: My customer has expressed a wish that source code for his project must be backed up every day on my local server and then exported to his NAS. He gave me access to NAS via FTP protocol and now I want to use cron scheduler for ftp upload to his server. Is this ok and how is this done?


title: mdadm raid doesn't mount

text: I have a raid array defined in `/etc/mdadm.conf` like this:               ARRAY /dev/md0 devices=/dev/sdb6,/dev/sdc6     ARRAY /dev/md1 devices=/dev/sdb7,/dev/sdc7      but when I try to mount them, I get this:               # mount /dev/md0 /mnt/media/     mount: special device /dev/md0 does not exist     # mount /dev/md1 /mnt/data     mount: special device /dev/md1 does not exist      `/proc/mdstat` meanwhile says:               # cat /proc/mdstat      Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]      md125 : inactive dm-6[0](S)           238340224 blocks          md126 : inactive dm-5[0](S)           244139648 blocks          md127 : inactive dm-3[0](S)           390628416 blocks          unused devices: <none>      So I tried this:               # mount /dev/md126 /mnt/data     mount: /dev/md126: can't read superblock     # mount /dev/md125 /mnt/media     mount: /dev/md125: can't read superblock      The fs on the partions is `ext3` and when I specify the fs with `-t`, I get               mount: wrong fs type, bad option, bad superblock on /dev/md126,            missing codepage or helper program, or other error            (could this be the IDE device where you in fact use            ide-scsi so that sr0 or sda or so is needed?)            In some cases useful info is found in syslog - try            dmesg | tail  or so      How can I get my raid arrays mounted? It's worked before. **EDIT 1**               # mdadm --detail --scan     mdadm: cannot open /dev/md/127_0: No such file or directory     mdadm: cannot open /dev/md/0_0: No such file or directory     mdadm: cannot open /dev/md/1_0: No such file or directory      **EDIT 2**               # dmsetup ls     isw_cabciecjfi_Raid7    (252:6)     isw_cabciecjfi_Raid6    (252:5)     isw_cabciecjfi_Raid5    (252:4)     isw_cabciecjfi_Raid3    (252:3)     isw_cabciecjfi_Raid2    (252:2)     isw_cabciecjfi_Raid1    (252:1)     isw_cabciecjfi_Raid     (252:0)     # dmsetup table     isw_cabciecjfi_Raid7: 0 476680617 linear 252:0 1464854958     isw_cabciecjfi_Raid6: 0 488279484 linear 252:0 976575411     isw_cabciecjfi_Raid5: 0 11968362 linear 252:0 1941535638     isw_cabciecjfi_Raid3: 0 781257015 linear 252:0 195318270     isw_cabciecjfi_Raid2: 0 976928715 linear 252:0 976575285     isw_cabciecjfi_Raid1: 0 195318207 linear 252:0 63     isw_cabciecjfi_Raid: 0 1953519616 mirror core 2 131072 nosync 2 8:32 0 8:16 0 1 handle_errors      **EDIT 3**               # file -s -L /dev/mapper/*     /dev/mapper/control:              ERROR: cannot read `/dev/mapper/control' (Invalid argument)     /dev/mapper/isw_cabciecjfi_Raid:  x86 boot sector     /dev/mapper/isw_cabciecjfi_Raid1: Linux rev 1.0 ext4 filesystem data, UUID=a8d48d53-fd68-40d8-8dd5-3cecabad6e7a (needs journal recovery) (extents) (large files) (huge files)     /dev/mapper/isw_cabciecjfi_Raid3: Linux rev 1.0 ext4 filesystem data, UUID=3cb24366-b9c8-4e68-ad7b-22449668f047 (extents) (large files) (huge files)     /dev/mapper/isw_cabciecjfi_Raid5: Linux/i386 swap file (new style), version 1 (4K pages), size 1496044 pages, no label, UUID=f07e031f-368a-443e-a21c-77fa27adf795     /dev/mapper/isw_cabciecjfi_Raid6: Linux rev 1.0 ext3 filesystem data, UUID=0f0b401a-f238-4b20-9b2a-79cba56dd9d0 (large files)     /dev/mapper/isw_cabciecjfi_Raid7: Linux rev 1.0 ext3 filesystem data, UUID=b2d66029-eeb9-4e4a-952c-0a3bd0696159 (large files)     #       Also when I have one additional disk `/dev/mapper/isw_cabciecjfi_Raid` in my system - I tried to mount a partition but got:               # mount /dev/mapper/isw_cabciecjfi_Raid6 /mnt/media     mount: unknown filesystem type 'linux_raid_member'      I rebooted and confirmed that RAID is turned of in my `BIOS`.               I tried to force a mount which seems to allow me to mount but the content of the partition is inaccessible sio it still doesn't work as expected:     # mount -ft ext3 /dev/mapper/isw_cabciecjfi_Raid6 /mnt/media     # ls -l /mnt/media/     total 0     # mount -ft ext3 /dev/mapper/isw_cabciecjfi_Raid /mnt/data     # ls -l /mnt/data     total 0      **EDIT 4** After executing suggested commands, I only get:               $ sudo mdadm --examine /dev/sd[bc]6 /dev/sd[bc]7     mdadm: cannot open /dev/sd[bc]6: No such file or directory     mdadm: cannot open /dev/sd[bc]7: No such file or directory      **EDIT 5** I got `/dev/md127` mounted now but `/dev/md0` and `/dev/md1` are still not accessible:               # mdadm --examine /dev/sd[bc]6 /dev/sd[bc]7     mdadm: cannot open /dev/sd[bc]6: No such file or directory     mdadm: cannot open /dev/sd[bc]7: No such file or directory                    root@regDesktopHome:~# mdadm --stop /dev/md12[567]     mdadm: stopped /dev/md127     root@regDesktopHome:~# mdadm --assemble --scan     mdadm: /dev/md127 has been started with 1 drive (out of 2).     root@regDesktopHome:~# cat /proc/mdstat     Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]      md127 : active raid1 dm-3[0]           390628416 blocks [2/1] [U_]          md1 : inactive dm-6[0](S)           238340224 blocks          md0 : inactive dm-5[0](S)           244139648 blocks          unused devices: <none>     root@regDesktopHome:~# ls -l /dev/mapper     total 0     crw------- 1 root root  10, 236 Aug 13 22:43 control     brw-rw---- 1 root disk 252,   0 Aug 13 22:43 isw_cabciecjfi_Raid     brw------- 1 root root 252,   1 Aug 13 22:43 isw_cabciecjfi_Raid1     brw------- 1 root root 252,   2 Aug 13 22:43 isw_cabciecjfi_Raid2     brw------- 1 root root 252,   3 Aug 13 22:43 isw_cabciecjfi_Raid3     brw------- 1 root root 252,   4 Aug 13 22:43 isw_cabciecjfi_Raid5     brw------- 1 root root 252,   5 Aug 13 22:43 isw_cabciecjfi_Raid6     brw------- 1 root root 252,   6 Aug 13 22:43 isw_cabciecjfi_Raid7     root@regDesktopHome:~# mdadm --examine     mdadm: No devices to examine     root@regDesktopHome:~# cat /proc/mdstat     Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]      md127 : active raid1 dm-3[0]           390628416 blocks [2/1] [U_]          md1 : inactive dm-6[0](S)           238340224 blocks          md0 : inactive dm-5[0](S)           244139648 blocks          unused devices: <none>     root@regDesktopHome:~# mdadm --examine /dev/dm-[356]     /dev/dm-3:               Magic : a92b4efc             Version : 0.90.00                UUID : 124cd4a5:2965955f:cd707cc0:bc3f8165       Creation Time : Tue Sep  1 18:50:36 2009          Raid Level : raid1       Used Dev Size : 390628416 (372.53 GiB 400.00 GB)          Array Size : 390628416 (372.53 GiB 400.00 GB)        Raid Devices : 2       Total Devices : 2     Preferred Minor : 127              Update Time : Sat May 31 18:52:12 2014               State : active      Active Devices : 2     Working Devices : 2      Failed Devices : 0       Spare Devices : 0            Checksum : 23fe942e - correct              Events : 167                     Number   Major   Minor   RaidDevice State     this     0       8       35        0      active sync             0     0       8       35        0      active sync        1     1       8       19        1      active sync     /dev/dm-5:               Magic : a92b4efc             Version : 0.90.00                UUID : 91e560f1:4e51d8eb:cd707cc0:bc3f8165       Creation Time : Tue Sep  1 19:15:33 2009          Raid Level : raid1       Used Dev Size : 244139648 (232.83 GiB 250.00 GB)          Array Size : 244139648 (232.83 GiB 250.00 GB)        Raid Devices : 2       Total Devices : 2     Preferred Minor : 0              Update Time : Fri May  9 21:48:44 2014               State : clean      Active Devices : 2     Working Devices : 2      Failed Devices : 0       Spare Devices : 0            Checksum : bfad9d61 - correct              Events : 75007                     Number   Major   Minor   RaidDevice State     this     0       8       38        0      active sync             0     0       8       38        0      active sync        1     1       8       22        1      active sync     /dev/dm-6:               Magic : a92b4efc             Version : 0.90.00                UUID : 0abe503f:401d8d09:cd707cc0:bc3f8165       Creation Time : Tue Sep  8 21:19:15 2009          Raid Level : raid1       Used Dev Size : 238340224 (227.30 GiB 244.06 GB)          Array Size : 238340224 (227.30 GiB 244.06 GB)        Raid Devices : 2       Total Devices : 2     Preferred Minor : 1              Update Time : Fri May  9 21:48:44 2014               State : clean      Active Devices : 2     Working Devices : 2      Failed Devices : 0       Spare Devices : 0            Checksum : 2a7a125f - correct              Events : 3973383                     Number   Major   Minor   RaidDevice State     this     0       8       39        0      active sync             0     0       8       39        0      active sync        1     1       8       23        1      active sync     root@regDesktopHome:~#       **EDIT 6** I stopped them with `mdadm --stop /dev/md[01]` and confirmed that `/proc/mdstat` wouldn't show them anymore, then executed `mdadm --asseble --scan` and got               # mdadm --assemble --scan     mdadm: /dev/md0 has been started with 1 drives.     mdadm: /dev/md1 has been started with 2 drives.      but if I try to mount either of the arrays, I still get:               root@regDesktopHome:~# mount /dev/md1 /mnt/data     mount: wrong fs type, bad option, bad superblock on /dev/md1,            missing codepage or helper program, or other error            In some cases useful info is found in syslog - try            dmesg | tail  or so      * * * In the meantime, I've figured out that my superblocks seem to be damaged (PS I have confirmed with `tune2fs` and `fdisk` that I'm dealing with an `ext3` partition):               root@regDesktopHome:~# e2fsck /dev/md1     e2fsck 1.42.9 (4-Feb-2014)     The filesystem size (according to the superblock) is 59585077 blocks     The physical size of the device is 59585056 blocks     Either the superblock or the partition table is likely to be corrupt!     Abort<y>? yes     root@regDesktopHome:~# e2fsck /dev/md0     e2fsck 1.42.9 (4-Feb-2014)     The filesystem size (according to the superblock) is 61034935 blocks     The physical size of the device is 61034912 blocks     Either the superblock or the partition table is likely to be corrupt!     Abort<y>? yes      But both partitions have some super blocks backed up:               root@regDesktopHome:~# mke2fs -n /dev/md0 mke2fs 1.42.9 (4-Feb-2014)     Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment     size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 15261696     inodes, 61034912 blocks 3051745 blocks (5.00%) reserved for the super     user First data block=0 Maximum filesystem blocks=4294967296 1863     block groups 32768 blocks per group, 32768 fragments per group 8192     inodes per group Superblock backups stored on blocks:              32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 265408,              4096000, 7962624, 11239424, 20480000, 23887872          root@regDesktopHome:~# mke2fs -n /dev/md1 mke2fs 1.42.9 (4-Feb-2014)     Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment     size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 14901248     inodes, 59585056 blocks 2979252 blocks (5.00%) reserved for the super     user First data block=0 Maximum filesystem blocks=4294967296 1819     block groups 32768 blocks per group, 32768 fragments per group 8192     inodes per group Superblock backups stored on blocks:              32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,              4096000, 7962624, 11239424, 20480000, 23887872      What do you think, should I try to restore the backup on both arrays to `23887872`? I think I could do that with `e2fsck -b 23887872 /dev/md[01]` do you recommend giving this a shot?   I don't necessarily want to try around with something I don't exactly know abd that might destroy the data on my disks... `man e2fsck` doesn't necessarily say it's dangerous but there might be another, saver way to fix the superblock...? * * * **AS A LAST UPDATE TO THE COMMUNITY** , * * * I used `resize2fs` to get my superblocks back in order and my drives mounted again! (`resize2fs /dev/md0` & `resize2fs /dev/md1` got my back up!) Long story but it finally worked out! And I learned a lot in terms of `mdadm` along the way! Thank you @IanMacintosh


title: Windows installer complains that it can only be installed on a primary partition

text: I have Linux mint installed on my system as primary partition. I want to install windows 8 along side with it (Dual boot). But when I try to install windows 8 installer says (windows can only be install Primary partition). I have only 1 primary partition in which Linux is running, other are extended or logical ones. ![Partition Details](http://i.stack.imgur.com/2FF9i.png) I want to use my last Partition (Label : Apps) for installing Windows. Can I convert a logical partition to primary or any other better suggestion?


title: Force the owner and group for the contents of a tar file?

text: I would like to create a tar file with contents belonging to an owner:group pair who do not exist on the system from which the file is being made. Here's the direction I've tried:               tar ca --owner='otherowner' --group='othergroup' mydata.tgz mydata      And when running this command, I get the following error:               tar: otherowner: Invalid owner     tar: Error is not recoverable: exiting now      Is there a way to force tar to accept the owner:group, even though neither of them exist on the system from which the file is being created?


title: CentOS, PHP file is running from browser, not from cron daemon

text: I am working on CentOS. I have created a PHP file which run from browser               http://mydomain.com/backupfile/dobackup.php      I have added the script from crontab and made the file executable, but it is not running               30 0 * * * /var/www/vhost/mydomain.com/httpdocs/backupfile/dobackup.php      what should i do?


title: SSH using keys in external storage - permissions?

text: I have a set of SSH keys to login to accounts and servers. However, ever since I moved my main work profile to a USB drive (for sync and ease of use among other reasons) I have been unable to _directly_ use the SSH keys in the profile for authentication, having to create local copies instead. Normal SSH workflow usually goes               ssh-add $HOME/.ssh/id_server_key      ssh username@domain      Which works without problems. However, to prevent each machine from having a copy of my keys I moved them to an xexternal drive, USB formatted as `vfat`. Then workflow _should_ become like this:               ssh-add  /run/media/myself/USB/.ssh/id_server_key     ssh username@domain      ...Which doesn't work. SSH complains about doing something to protect me:               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@     @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @     @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@     Permissions 0644 for 'id_server_key' are too open.     It is required that your private key files are NOT accessible by others.     This private key will be ignored.     bad permissions: ignore key: id_server_key     Permission denied (publickey).      Which, while I can understand, it's not _really_ protecting me in this case. The USB drive automounts in my distro, with a fmask of (I think) `022`. I could unmount and remount the USB drive with a fmask of `077` but that would (1) require superuser privilege each time and (2) affect every single file in the device, not only the SSH keys. I've tried creating a symlink to the key, even with previous use of `umask` as I've seen in some tips&tricks:               cd .ssh     umask 077     ln -s /run/media/myself/USB/.ssh/id_server_key       But the permissions can not be used this way for a symbolic link, so I get nothing. So, what **options** do I have here available if the goal is to **not** have a physical copy of the key on the machine? One of the machines is a family laptop that goes to various places, so I have an interest in avoiding some of the keys being discovered. So far I've considered the following:   * Is there for example an option to force SSH (`ssh-add` primarily) to accept the keys from the external device? (I presume there should be - most programs follow a "I-know-what-I'm-doing" flag, but so far I can't find it in the manpage.    * Setting a `bindfs` over the `.ssh/` directory, but the problem is that the directory is non-empty (as it contains `known_hosts` and other data).   * `fuse-zip`-ing the keys over `/dev/shm` seems to be a possible path as well. **EDIT** : As per @Gilles 's comment, yes, `bindfs` solves the issue. After a checking of the manpage, initial testing succeeded using the following invocation:               bindfs -n -r -p 0700 -o nonempty /run/media/myself/USB/.ssh/ ~/.ssh       Which binds disallowing access from other users (apparently even from `root`!), read-only, with reflected `0700` permissions. That reflection was the part that I lacked when working with bindfs originally. The `nonempty` flag was needed because of preexisting files such as `known_hosts`. This preserves the original workflow exactly except for an extra warning messae about not being able to add information to `known_hosts` (which in the end I might not mind). Of course, I'm bindfs-ing to another directory now (in /dev/shm) as originally suggested to make things slightly easier. I'm not as conspiranoid so as to `encfs` my USB drive (yet) so privacy-wise this is good enough for me.


title: Install Arch(Bang) - Create Usb - Uefi

text: I am pretty new to Linux and want to install ArchBang-Linux, but I fail at creating a bootable USB-Stick. Can someone explain this procedure to me in a little more detail? https://wiki.archlinux.org/index.php/UEFI#Create_UEFI_bootable_USB_from_ISO Especially:   * First create a MBR partition table in the USB using fdisk. Mount the USB partition and create a FAT32 filesystem with LABEL as used in the Archiso configuration.   * How do I create a MBR partition table?   * How to mount?   * with LABEL? what label? as used in the Archiso config? or do I just have to execute the shown commands? Somehow I couldn't manage to do this.... Would really appreciate any help - especially a step by step guide would be nice. I just don't know how to do this :(


title: Data pivot with awk

text: I'm trying to pivot a file using awk. This is an example of my input File:               VarName;TimeString;VarValue;Validity;Time_ms     A;23.11.201215:03:53;1;1;41236627696,7593     C;23.11.201215:03:53;2;1;41236627696,7593     D;23.11.201215:03:53;3;1;41236627696,7593     A;23.11.201215:04:53;31;1;41236628391,2037     B;23.11.201215:04:53;12;1;41236628391,2037     C;23.11.201215:04:53;1;1;41236628391,2037     D;23.11.201215:05:53;8;1;41236629097,2222     B;23.11.201215:05:53;7;1;41236629097,2222     C;23.11.201215:05:53;15;1;41236629097,2222      And this is my desired output:               TimeString;Time_ms;A;B;C;D     23.11.201215:03:53;41236627696,7593;1;;2;3     23.11.201215:04:53;41236628391,2037;31;12;1;     23.11.201215:05:53;41236629097,2222;;7;15;8          Which is the best way to obtain this result? Solved using the script writed by @steve


title: Mint 12 - Error updating MySQL (mysql-client-core-5.1)

text: I have MySQL 5.5 installed via packages.dotdeb.org. When trying to update 5.1, which is also installed, I get the following error: > E: /var/cache/apt/archives/mysql-client- > core-5.1_5.1.66-0ubuntu0.11.10.2_amd64.deb: trying to overwrite > '/usr/share/man/man1/mysqlcheck.1.gz', which is also in package mysql- > client-core-5.5 5.5.28-1~dotdeb.0 I'm unsure how to proceed. I installed 5.1 before learning how to get more up- to-date packages in Mint's update/package manager. I don't want to keep 5.1 since I do have 5.5, but I'm concerned that removing it via `apt` will mess up my 5.5 installation. Can I safely remove 5.1? If not, how should I proceed?


title: Checking integrity of my server data

text: I want to make a log to detect the nature of intrusions into my Unix/Linux based server. For that I want to learn some tools like Open Source Tripwire and OSSEC. Please suggest to me similar tools. What kind of info can I get about the intruder from the tools of this kind? Can I automate the process of keeping track of the alerts generated by these tools in a file?


title: Gnome on an external hard drive?

text: I have a GuruPlug computer with an external HDD mounted. I would like to set up Gnome and try to access it via remote desktop. My first roadblock is installing Gnome. I tried running `sudo apt-get install gnome` and I got this message:               Need to get 681MB of archives.     After this operation, 1758MB of additional disk space will be used.     E: You don't have enough free space in /var/cache/apt/archives/.      Is it even possible to install Gnome on my external hard drive. If so, how?               $ df -h     Filesystem            Size  Used Avail Use% Mounted on     tmpfs                 251M     0  251M   0% /lib/init/rw     udev                   10M  696K  9.4M   7% /dev     tmpfs                 251M  4.0K  251M   1% /dev/shm     rootfs                463M  237M  226M  52% /     tmpfs                 251M   48M  204M  20% /var/cache/apt     //10.0.1.1/Elements   2.8T  1.2T  1.6T  42% /mnt/ExternalHDD


title: How to get which version of cron daemon is running

text: Background: I am working on CentOS **Details**               # cat /proc/version     Linux version 2.6.18-308.4.1.el5PAE (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)) #1 SMP Tue Apr 17 17:47:38 EDT 2012      Question: How can i know which **version cron daemon** installed and running on machine


title: How to associate only one public key with a restricted shell like scponly?

text: I'd like to use a passwordless key to perform e.g. unison synchronization while being able to SSH into the server only with a password-protected key. The usual way of using `scponly` is changig the login-shell of my server account, but that is too global. Can an entry in `authorized_keys` achieve this instead?


title: how to compare total file

text: Suppose i have 2 config files such as: file 1:               smtpd_sasl_auth_enable = yes     broken_sasl_auth_clients = yes     smtpd_sasl_authenticated_header = yes     virtual_gid_maps = static:5000      File 2:               virtual_gid_maps = static:5000     broken_sasl_auth_clients = yes     smtpd_sasl_authenticated_header = yes      if you see carefully, you'll see together have a line begin with `virtua_gid_*` but file 1 have it in end of file but file 2 have it head of file. Suppose i have 2 files with same lines with difference positions , but positions not important for me, to be or not to be is important. HOW CAN I COMPARE MY FILES?


title: Is TRESOR included in the latest kernel?

text: Did TRESOR get included in the mainline Linux kernel? Where would I look to find out? Is there any documentation describing its use? Reading about cold boot attacks on Wikipedia makes me think TRESOR would be essential to having reasonably secure dm-crypt+LUKS system.


title: VNC: Disable local cursor on connect

text: Currently I use UltraVNC to connect to vino server Everytime after VNC connection is established, I need to hit F8, menu pops up and click local cursor to disable it How do I disable local cursor upon connect automatically?


title: Create a link but don't change the canonical path

text: In each users' directory there exists a symbolic link to `/var/www/website/public_html/`. However, whenever a user `cd`s into the link, he sees the path as `/home/username/public_html/`. Is there any way to link to a directory however when the user changes into the directory, the command `pwd` will show the canonical or real path to the directory? Thanks.


title: Linux Icon Naming Conventions

text: Is there a naming convention in Linux when it comes to application icon filenames? What I'm referring to is the practice of including the icon size in the filename if the application uses multiple icon files (PNGs, for example) for different views (desktop, lists, menus, etc.). OS X has the `icon_16x16`, `icon_32x32`, etc. convention, so I'm wondering if there's a similar practice in Linux.


title: Would it be possible to compile and bootstrap GNU?

text: A new Guix release came out some time ago. And I got the idea that if I can bootstrap glibc, gcc, and guix to HURD and Mach, I can have a non-Linux GNU system. But I also need some software like bash, emacs, binutils, coreutils, an init system. Do any of those have any system calls that are linux dependent? Would I be able to do it like in LFS?


title: Owner of directory set to 518?

text: I recently installed some PHP site on a server for a customer. A guy calls me up and tells me he can't seem to upload to the `img` directory. I went in and took a look at the owner of said directory. The owner was set to a user named `518`. I was still able to `chown -R someuser img/` and fix the issue, but I am more concerned that the owner of the directory was set to `518`. I have never seen the owner set as a number and I certainly did not set that owner myself. What does it mean when a user is set to 518? Did I get broken into? When I run `cat /etc/passwd` I do not see any user named `518` in there. I am running Ubuntu.


title: Why does Ctrl-D (EOF) exit the shell?

text: Are you literally "ending a file" by inputting this escape sequence, i.e. is the interactive shell session is seen as a real file stream by the shell, like any other file stream? If so, which file? Or, is the `Ctrl`+`D` signal just a placeholder which means "the user has finished providing input and you may terminate"?


title: how to configure cross compilation for cubieboard?

text: I have a cubieboard 2 : ARMv7l Cortex-A7 dual core and this will be the first time I build Linux from scratch. I know I could download an image but I want to learn how to do it and configure things myself, and I have been a SWE for many years. I have downloaded crosstool-ng and I am trying to figure out what configuration I should take. I see things for cortex a8 and a9, arm-unknown etc. but nothing for cortex a7. I have found a few configs on the internet about cortex a7 but   * they don't mention if it is for dual core or not   * CT_ARCH_ARCH="armv7-a" is seen in conf files for cortex a8, a9. Should I put that too for cortex a7 ? or "armv7-l"?  Here is the conf "arm-cortex_a8-linux-gnueabi".               CT_LOCAL_TARBALLS_DIR="${HOME}/src"     CT_SAVE_TARBALLS=y     CT_LOG_EXTRA=y     CT_ARCH_ARCH="armv7-a"     CT_ARCH_CPU="cortex-a8"     CT_ARCH_TUNE="cortex-a8"     CT_ARCH_FLOAT_SW=y     CT_ARCH_arm=y     CT_TARGET_VENDOR="cortex_a8"     CT_KERNEL_linux=y     CT_BINUTILS_V_2_20_1a=y     CT_BINUTILS_FOR_TARGET=y     CT_CC_V_4_4_6=y     CT_CC_LANG_CXX=y     CT_LIBC_glibc=y     CT_LIBC_GLIBC_V_2_9=y     # CT_LIBC_GLIBC_FORCE_UNWIND is not set     CT_DEBUG_dmalloc=y     CT_DEBUG_duma=y     CT_DEBUG_gdb=y     CT_GDB_NATIVE=y     CT_GDB_V_6_8a=y     CT_DEBUG_ltrace=y     CT_DEBUG_strace=y     CT_STRACE_V_4_5_19=y     CT_GMP_V_4_3_2=y     CT_MPFR_V_2_4_2=y     CT_PPL_V_0_10_2=y     CT_CLOOG_V_0_15_9=y      Should I just replace cortex a8 by a7? What about dual core?   What would you suggest? What are the variables that matter in this conf?


title: Flush data to file frequently for long running command?

text: I have a command that processes data slowly. The command processes lines from a file and writes the results to the output file `data.txt`: `my_command > data.txt` The issue I have is that I'd like to examine output lines in the `data.txt` file as they are processed. The problem is that no output appears in my output file until the OS decides to dump data to the output file, which happens every few hours. Is there anyway I can force data to be flushed to the file more frequently?


title: strange behaviour of strings command

text: I am trying to capture mysql traffic and pass those traffic to strings command as follows:               tcpdump -i any -s 0 -l -w - dst port 3306 | strings      This is working as expected and printing all mysql queries like               select * from mytables     show databases      But when i am trying to redirect the output to a file, its not printing the output to `/tmp/out` file:               tcpdump -i any -s 0 -l -w - dst port 3306 | strings > /tmp/out      Can someone explain me the behaviour of above command and why it is not redirecting the output to file.


title: Can I force Linux to boot its initializations parallel?

text: I was wondering if I could manage to initialize drivers, services etc. (all these jobs what Linux does during startup) in parallel instead of sequentially. I want to aggressively lower the boot time. I know some services depend on each other but to make an easy example: during probing the network devices, it shall take care of the audio too, instead of waiting 10 s until the network is ready. I heard of concepts like _systemd_ and _InitNG_ but I'm sure there has to be other methods. Isn't there an option or flag for the kernel itself to boot this way?


title: I wiped my /etc/yum.repos.d

text: I think I seriously messed things up on my EC2 instance which I'm currently hacking on. I tried to install some rpmfusion repository from which to install FFMPEG, but it broke things and I wasn't able to do any updates or install anything. So, I ran a pretty straightforward rm command: `rm /etc/yum.repos.d/rpmfusion-*`. I think this really messed things up, though, as I can't seem to find `rpmbuild` which I need to install FFMPEG. Can anyone help me recover from this? I don't have access to the EC2 control panel, otherwise I'd just up another instance and start over. Can anyone instruct me on how to simply install FFMPEG on a CentOS-like OS?


title: mount to nfs server failed, system error: no route to host

text: I have fedora based linux machines in a closed network. In one of the lab machines, I am getting the below error.               Mount to NFS server failed. System error: No route to host      I restarted the **nfs** , **nfslock** and **portmap** services. I restarted the **iptables** service. I also disabled the **iptables** service and restarted the machine. I compared the contents of the below files from another perfectly working client.               /etc/hosts.allow      /etc/sysconfig/iptables     /etc/fstab      ping/ssh from the affected machine to the server and other clients is working fine. `rpcinfo -p` gives the same output as I get in the other client machines.


title: Reloading Samba4's smb.conf without restarting the service

text: I want to tweak smb.conf without causing network hiccups for folks who rely on our samba4 fileshare. I made an obvious path change that should only affect my own private share, and ran `smbcontrol smbd reload-config`. It didn't complain, but didn't affect my share, either. I also tried `smbcontrol samba4 reload-config`, which returned `Can't find pid for destination 'samba4'`, so I tried without the '4', and it had the same no-change behaviour as `smbd`. Is there a way to reload the conf in Samba 4 without closing open files and the like?


title: What is the difference between apt-get and dpkg?

text: I have several questions regarding `apt-get` vs. `dpkg`.   * Do they install to the same place?   * Is info from these tools 1 to 1 with each other?   * Is there any difference in the commands utility?


title: Why do I see more processes in KVM than in OpenVZ?

text: I've got a 512mb Centos 6 VPS running on KVM. Now another VPS from a org. I manage is running on OVZ. When I type top on the KVM one, I get a whole list of all sort off processes. But when I do this in the OVZ one, I only get around 20, which is normal. So how do I close all those (unneccesary?) processes and keep it clean? Here is a screen of what top looks like now: ![top](http://i.stack.imgur.com/Af1Fj.png)


title: track down executables installer

text: I have a freshly installed debian system It has vim installed using `apt-get install vim`   Now I have the command xxd installed on the system. I know that this had to have come from the vim installation but I can not find the commands installer. How can I track down what it was that has installed this command.


title: How can I run a linux build on an NTFS drive?

text: I'm running under Ubuntu but using a shared drive which is NTFS formatted. I've got blender sitting in a folder (it's the 2.66RC build with some trivial python customisations.) I'm calling blender from a script, which is why I want a contained, local copy of the program that won't get updated. The whole thing runs cheerfully on my desktop but the minute I move it to the shared drive, I run into problems. First I have to skip all the symlinks because NTFS doesn't support them (I have to skip libGL.so and libGLU.so, along with their respective *.so.1 selves.) Then I can't run the `blender` binary directly because you can't change NTFS file permissions with `chmod`. So I have to run it using `sudo bash blender-2.66RC/blender`, at which point I get the message, > cannot execute binary file Is what I'm trying to do even possible? It would mean a lot less organisational hassle if I could work off the shared drive rather than keep copying everything over to my desktop and back.


title: Multiple screens on debian

text: I have two screens on my computer, but they all show the same image (i.e I can't activate dual screen). I saw on some blogs that I need to configure `xrandr` for this, but it fails to do so. Here is the output `xrandr` returns:               sam@BARDT071:~$ xrandr     xrandr: Failed to get size of gamma for output default     Screen 0: minimum 640 x 480, current 1600 x 1200, maximum 1600 x 1200     default connected 1600x1200+0+0 0mm x 0mm        1600x1200       0.0*         1280x1024       0.0          1280x960        0.0          1024x768        0.0          800x600         0.0          640x480         0.0        It seems that only one screen is visible to my Debian system, even though I have two screens displaying something. Any pointers would be appreciated! EDIT: I run xfce4, and going to `Start -> Settings -> Display` shows only one screen.


title: Gnome 3 bottom panel is hiding - how to unhide (reproducable! :) or change behaviour

text: After upgrading Debian Wheezy to Jessie, I experience some random unhiding behaviour of the bottom panel. It is not unhiding - as before - by moving the mouse into lower right corner. It seems it is unhiding, when you move the mouse in the middle of the bottom... but only in 1 out of 15 cases...   * How is the right way to unhide (is ticking enough or does keeping the mouse there for a few seconds help ... and where)?   * Are there ways to change the behaviour?


title: Blocking Websites with /etc/hosts

text: There's a website, www.example.com, that I tried to block myself from accessing because it wastes too much of my time. So I configured my `/etc/hosts` file. I added the following lines, to block the website on both IPv4 and IPv6:               127.0.0.1 www.example.com     ::1 www.example.com     127.0.0.1 http://www.example.com     ::1 http://www.example.com     127.0.0.1 example.com     ::1 example.com      I restarted my computer, and I cannot `wget www.example.com`, and pinging `www.example.com` works as expected, but the website is not actually blocked in my browser! I can still access it in Firefox 28 and Chromium. ### Questions   * What's going on?    * How do I block this site using systems-level tools instead of using browser extensions?


title: How does downloading speed vary between download managers?

text: I used several download managers on Ubuntu and found variation in downloading speed.   1. uGet (recommended)   2. Flareget   3. xdm (Xtreme Download Manager)   4. Steadyflow I find variation in downloading speed. **My question is** : Which factors affect downloading speed? How do download managers work differently? Note: I don't want opinions from users but factors affecting the speed and raise knowledge about how working differentely?


title: What does ll alias to?

text: ll is a common alias in many linux distros.   How can you tell what it aliases to? I've tried checking my .bashrc, but I am not able tell what ll is equivalent to.


title: $_GET getting cut off on server but works on local

text: Our developers all work on their local machines and we have an issue where $_GET is getting cut off on the server but not on the local. (MAC, Apache/MySQL build -NOT MAMP) Is there a setting on CENTOS for this? Same code, same database on both Here is the correct URI               [REQUEST_URI] => /mapp/index/redirectToCart?productID=732&product=732&related_product=&qty=      From the server (CentOS release 6.5 (Final))                 Array         (             [HTTP_AUTHORIZATION] =>              [HTTPS] => on             [SSL_TLS_SNI] => www.mydomain.com             [SSL_SERVER_S_DN_OU] => Domain Control Validated             [SSL_SERVER_S_DN_CN] => mydomain.com        ......             [HTTP_HOST] => www.mydomain.com             [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8             [HTTP_CONNECTION] => keep-alive             [HTTP_COOKIE] => frontend=rb7ehmse7lfrile9q0o5gkj0h1; CATEGORY_INFO=%5B%5D; LAST_CATEGORY=3403; VIEWED_PRODUCT_IDS=732; _ga=GA1.2.549931750.1410525313; _gat=1             [HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.78.2 (KHTML, like Gecko) Version/7.0.6 Safari/537.78.2             [HTTP_ACCEPT_LANGUAGE] => en-us             [HTTP_REFERER] => http://www.mydomain.com/apw-wyott-cheesemelter-countertop-36-wide-ea.html             [HTTP_ACCEPT_ENCODING] => gzip, deflate             [PATH] => /sbin:/usr/sbin:/bin:/usr/bin             [SERVER_SIGNATURE] =>              [SERVER_SOFTWARE] => Apache             [SERVER_NAME] => www.mydomain.com             [SERVER_ADDR] => 10.2.5.5             [SERVER_PORT] => 443             [REMOTE_ADDR] => [removed]             [DOCUMENT_ROOT] => /var/www/mydomain.com/staging/current/             [SERVER_ADMIN] => webmaster@mydomain.com             [SCRIPT_FILENAME] => /var/www/mydomain.com/staging/current/index.php             [REMOTE_PORT] => 15070             [GATEWAY_INTERFACE] => CGI/1.1             [SERVER_PROTOCOL] => HTTP/1.1             [REQUEST_METHOD] => GET             [QUERY_STRING] =>              [REQUEST_URI] => /index.php/mapp/index/redirectToCart             [SCRIPT_NAME] => /index.php             [PATH_INFO] => /mapp/index/redirectToCart             [PATH_TRANSLATED] => redirect:/index.php/index/redirectToCart             [PHP_SELF] => /index.php/mapp/index/redirectToCart             [REQUEST_TIME_FLOAT] => 1410543560.059             [REQUEST_TIME] => 1410543560         )      From local                  Array     (         [REDIRECT_HTTP_AUTHORIZATION] =>          [REDIRECT_STATUS] => 200         [HTTP_AUTHORIZATION] =>          [HTTP_HOST] => fsss.local         [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8         [HTTP_CONNECTION] => keep-alive         [HTTP_COOKIE] => _ga=GA1.2.2052654414.1410539051; CART=1af3799f2a75e89cb32e44ba38ab155d; CUSTOMER=37853b37ccdeca3c78270537e91e1f58; CUSTOMER_INFO=d65ce707afe805e0549ec6b9f8c68708; frontend=ru4dl80guqbho0h979srj4str0; persistent_shopping_cart=zblxqfEcDKDmSbs8o2mJFqoOUv56aFRabxIlnqEfL2WNukdAzp; VIEWED_PRODUCT_IDS=732         [HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.78.2 (KHTML, like Gecko) Version/7.0.6 Safari/537.78.2         [HTTP_ACCEPT_LANGUAGE] => en-us         [HTTP_REFERER] => http://client.local/apw-wyott-cheesemelter-countertop-36-wide-ea.html         [HTTP_ACCEPT_ENCODING] => gzip, deflate         [PATH] => /usr/bin:/bin:/usr/sbin:/sbin         [SERVER_SIGNATURE] =>          [SERVER_SOFTWARE] => Apache/2.2.26 (Unix) PHP/5.4.24 Phusion_Passenger/4.0.40 DAV/2 mod_ssl/2.2.26 OpenSSL/0.9.8y mod_perl/2.0.7 Perl/v5.16.2         [SERVER_NAME] => client.local         [SERVER_ADDR] => 127.0.0.1         [SERVER_PORT] => 80         [REMOTE_ADDR] => 127.0.0.1         [DOCUMENT_ROOT] => /Volumes/Data/prjs/sources/mydomain/         [SERVER_ADMIN] => [revoved]         [SCRIPT_FILENAME] => /Volumes/Data/prjs/sources/mydomain/index.php         [REMOTE_PORT] => 57218         [REDIRECT_QUERY_STRING] => productID=732&product=732&related_product=&qty=0         [REDIRECT_URL] => /mapp/index/redirectToCart         [GATEWAY_INTERFACE] => CGI/1.1         [SERVER_PROTOCOL] => HTTP/1.1         [REQUEST_METHOD] => GET         [QUERY_STRING] => productID=732&product=732&related_product=&qty=0         [REQUEST_URI] => /mapp/index/redirectToCart?productID=732&product=732&related_product=&qty=0         [SCRIPT_NAME] => /index.php         [PHP_SELF] => /index.php         [REQUEST_TIME_FLOAT] => 1410543740.533         [REQUEST_TIME] => 1410543740     )


title: Outputting common lines from 2 files and uncommon lines from both the files in one output file

text: I have 2 text files. Lets name them file1.txt and file2.txt file1.txt is as follows               chr10   181144  225933     chr10   181243  225933     chr10   181500  225933     chr10   226069  255828     chr10   255989  267134     chr10   255989  282777     chr10   267297  282777     chr10   282856  283524     chr10   283618  285377     chr10   285466  285995      file2.txt is as follows               chr10   181144  225933     chr10   181243  225933     chr10   181500  225933     chr10   255989  282777     chr10   267297  282777     chr10   282856  283524     chr10   375542  387138     chr10   386930  387138     chr10   387270  390748     chr10   390859  390938     chr10   391051  394580     chr10   394703  395270      What I want to output in a single file is 1. All the common lines between file1 and file2 2. All the lines which are in file1 but are not common to both 3. All the lines which are in file2 but are not common to both. I wrote a Perl script to do this but I am pretty sure there must be a command line or an easier way to do it. Any help would be appreciated. Thanks


title: Linux won't install on RAID set: disks "contain BIOS RAID metadata, but [are] not part of any recognized BIOS RAID sets"

text: I plugged a Q-Tec 340R ATA-133 IDE RAID card, with two IDE connectors and support for up to four IDE drives, into an old P4 machine, attached two hard drives and managed to set up RAID0 and install Fedora. Things were going well, but I wanted to play around with various RAID set-ups, so a week later I got a few extra IDE drives, attached them, reset the RAID configuration and configured the four drives as a striped set. That's where things stopped working. As soon as the Fedora (or CentOS, or any other distro's) installer starts looking at the storage devices, it throws up a warning that all drives in the RAID set need to be "re-initialized". If I re-initialize the drives, I can only use them individually, not as a RAID set. If I hit ignore, I'm told that "Disk sdb [and other] contains BIOS RAID metadata, but is not part of any recognized BIOS RAID sets. Ignoring disk sdb." Then it also notes there's an incorrect number of devices in the RAID array, presumably because it just ignored one or other of the disks. I've subsequently tried dd-ing the whole disks, removing all data, but then of course I set up RAID again with the BIOS utility, and so metadata is added again, and I get the same errors. Researching the error message of the disks containing RAID metadata, but not being part of any recognized BIOS RAID sets, all I find is people trying to use hard drives previously used in a RAID set-up, who now want to use them individually. I need to use these disks in a RAID set-up, but for some reason the Linux installer does not recognize them as such. I've also tried reverting to a two-disk RAID0 setup, like the one I set up initially, but now that won't work either. What could this be? Is my card faulty? Did I miss something?


title: Dual boot windows on second harddrive, UEFI/GPT system

text: I'd like to install linux, but I don't want to risk damaging my current windows installation as I have heard a lot of horror stories. Fortunately, I have an extra hard drive. Can I install linux onto that and then dual boot windows without having to modify the windows drive? **Also, I have a UEFI "BIOS" and the windows drive is in GPT format.**


title: Using an email without email services

text: I know that I can send email with the `mail` command. Something like `echo “Hello world” | mail -s “Hello world” foo@bar.com` would do the trick. But, given that I and a partner are online, how can we communicate with each other receiving and sending email only using the command line? The idea is to send and receive emails messages between two computers (with known IPs, and eventually with dynamic DNS), so that each can monitor the work of the other, and that without connecting through an email provider like yahoo.com, gmail, or hotmail.


title: Linux - File change time versus modification time

text: I'm using Ubuntu 12.04, though I'd imagine this question spans all Linux variants. In the manpage for the `stat` command, there are two (four) formatting options that appear to mean the same thing: > The valid format sequences for files (without --file-system): > > ... > > %y Time of last modification, human-readable > > %Y Time of last modification, seconds since Epoch > > %z Time of last change, human-readable > > %Z Time of last change, seconds since Epoch However, these values aren't always equal. For example, `stat --printf="%y\n%z\n" /usr/local` on my system outputs the following: > 2012-04-26 10:29:13.000000000 -0500 > > 2013-05-06 18:08:19.000000000 -0500 So what is the difference between "change time" and "modification time"?


title: Preferred approaches to remote logging of a script / daemon?

text: I run a script as a daemon which gets started and stopped via `/etc/init.d` on a Raspberry Pi. For a number of reasons - including limited local file storage - I'd like to direct stdout and stderr from the script to a remote server for logging and post-mortem analysis. At the risk of asking an overly general question: what's the preferred technique for remote logging? Should I create a second process on the Raspberry Pi that does `tail -f` on whatever daemon creates? Would `syslog-ng` be useful here? Should I expect to write custom code on the remote server, or are there packages already set up to do this sort of stuff? Etc. I would be surprised if this wasn't already completely solved; I simply don't know what phrases and package names to Google.


title: Huge CPU load due to high system usage

text: Tasks: 747 total, 176 running, 560 sleeping,   0 stopped,  11 zombie     Cpu(s): 10.5%us, 89.2%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.3%si,  0.0%st     Mem:  74236420k total, 73285344k used,   951076k free, 12261184k buffers     Swap:  8388600k total,    10404k used,  8378196k free, 27872176k cached      89% of CPU is being used by %sy. What is that %sy? This is how iostats look like               root@host [~]# iostat -xk 5     Linux 2.6.32-431.20.3.el6.x86_64 (host.superhostsite.com)       09/03/2014      _x86_64_        (8 CPU)          avg-cpu:  %user   %nice %system %iowait  %steal   %idle               43.02    0.28   50.00    0.05    0.00    6.65          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util     sdb               0.25    64.95   14.21   79.82    91.86   579.51    14.28     0.15    1.60   0.09   0.84     sda               0.87   182.70   28.06  206.05   247.08  1629.10    16.03     0.49    2.07   0.09   2.22          avg-cpu:  %user   %nice %system %iowait  %steal   %idle                8.45    0.00   91.55    0.00    0.00    0.00          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util     sdb               0.00    14.00    0.20   15.00     3.20   116.00    15.68     0.03    1.92   0.28   0.42     sda               0.00    23.20    2.00   47.80    25.60   284.00    12.43     0.02    0.42   0.14   0.70      So disk usage is small. Everything is small. And yet, huge 89.2% cpu used by system. Why Why %sy is high? Why not %us?


title: Server load is very high with unusual iftop result

text: Sometimes my server load is insanely high. Things like 120 or something. I checked what's wrong. What I see can be seen in this question: How do I interpret this IFTOP result Basically when I run iftop, a lot of connection has things like ns2.zerolimites.com,ns2.zerolimites.com,ns1.zerolimites.com,ns1626.ztomy.com,ns1626.ztomy.com I have no idea what zerolimites.com is, what ztomy.com is. Suddenly the left side of iftop is filled with that sort of thing and my load exploded. People say that the left side of iftop is for "me". I wonder what it means. Obviously the left side of iftop is filled with many different IP and hosts. They can't all be me. So what should I do?


title: Unable to clone git repository: foo.git/info/refs not found

text: I tried to clone a git repository using the command:               git clone http://git.denx.de/cgibin/gitweb.cgi?p=uboot.git;a=summary      but I got the error: > fatal: http://git.denx.de/cgibin/gitweb.cgi?p=uboot.git/info/refs not > found: did you run git update-server-info on the server?


title: How to install caffeine on Scientific Linux 6.3

text: caffeine     Traceback (most recent call last):       File "/usr/bin/caffeine", line 40, in <module>         import caffeine       File "/usr/lib64/python2.6/site-packages/caffeine/__init__.py", line 23, in <module>         from gi.repository import Gtk, Gio     ImportError: No module named gi.repository      This is what I get after installing caffeine.               rpm -qa | egrep -i 'caffeine|gobject'     caffeine-2.4.419-1.el6.nux.noarch     pygobject2-2.20.0-5.el6.x86_64      How can I install it? what am I missing? https://launchpad.net/caffeine


title: How to find last matching line with ex?

text: The `ex` command `$` navigates to the **first** character of the last line. Therefore, when doing a backwards search it skips the line it's currently on. How do I navigate to the last character with `ex`, or alternatively search for the last occurrence of a regular expression? Example:               $ cd -- "$(mktemp --directory)"     $ printf '%s\n' foo bar foo bar > test.txt     $ ex -c '$' -c '?bar' -c 'visual' test.txt      At this point the cursor is on line 2 instead of line 4, as expected. Using `ex -c '?bar' -c 'visual' test.txt` produces the same result, even though I'd expect it to find the last line when wrapping around (`vim` does). Using Vim 7.3.


title: Simulate desktop over SSH?

text: I want some kind of desktop DE when connecting to my linux box over ssh. Something like winscp works but I'll be running on linux instead of windows. The box doesn't have much ram and is not running a DE. I'd want to execute programs/scripts but it's ok if it disappears and I need to use the command line to see/connect to it


title: How to do "netcat" relays properly so that I have more control?

text: How to use the `netcat` to have relays? Like following I tried but not working:               cd /tmp     mknod backpipe p     nc -l -p 7007 0<backpipe | nc 192.168.1.101 9001 | tee backpipe        1. I want to receive data on 7007 must be listening mode   $ another application is putting packets here   2. what ever comes to 7007 I need to move to 9001 (which is also a listening port)              $ telnet localhost 9001      will show 7007 packets? Any idea? Optional: will it be also possible that I can put some extra header packets? to simulate http headers as image content type?


title: What does this awk script do

text: echo 1 | awk '{ srand(); print int (rand()*67) }'      I get a different o/p everytime I run it. However if I omit the 1 I get same o/p ..why?


title: Information about the device files: /dev

text: ls /dev       command lists the device files. How to know the **associated drivers** /major_numbers/minor_numbers with those device files?


title: List symlinks in current directory?

text: This question talks about finding directories in a current diretory. The solution is basically:               ls -d */      That's great but how can I easily list symlinks? Do I have to use something like               find . -xtype l -d 1     (intended to find symlinks max depth 1 - doesn't work)      Or is there an easier way? Can ls be used for this?


title: GSettings is reset during reboot

text: Formatting is a pain, especially due to all the package installation, configurations and so on. To make this easier, I made a large script with simple config files that is easily changed. So once I need a format (like when new OS versions is out), I just install and then execute the script after the first boot and I'm ready to go. Or at least that is how it was meant to be. But for some reason gsettings does not work properly.               gsettings set schema key value      The above line works just fine. But the script is executed as root since it needs to access config files on /etc, install and update package etc. so the above is not an option.               sudo $user -c "gsettings set schema key value"      Using `sudo` should work, but it does not. Some of the keys will take affect right away, others will not. And once I reboot or logout, everything is reset to default.               sudo $user -c "gsettings get schema key"      If I test the values using the above command, I do get the correct ones. So it seems that they do get set correctly, but still they only affect some and they still get reset during reboot or logout. I'm currently running Ubuntu Gnome 14.04. This used to work in 13.04 and before, but since 13.10 this has been a problem.


title: Allowing a user to use sudo without a password

text: On a sandbox VM environment, I have a setup of Ubuntu Linux which is firewalled and cannot be accessed from outside the local system. Therefore, on that VM, I'd like to give the administrative user (which I set up) the ability to run anything with sudo and not need a password. While I know this is not secure, this VM is not on all the time, and requires my personal passcode to run. So even though this is not "secure", is there a way to get the desired functionality?


title: udiskd: force -o data=journal for ext3/4 filesystems

text: LinuxMint uses udiskd to automount removable drives (e.g. USB). It works reasonably well, though I often have to re-plug the device before udiskd discovers the device. I would prefer if the removable disks never had data-loss (at least not more than the currently file being written). I have earlier succeeded by using ext3fs with -o data=journal. How can I force udiskd to mount removable devices with ext3fs and ext4fs using -o data=journal?


title: Minimal Linux distribution for compiling C programs

text: What would be the Linux distribution that is minimal? Just enough to run eclipse and the c/c++ compiler. This Linux will be installed on a VM so I don't want to have a full loaded distribution. What I need is just: Linux kernel with a GUI, c/c++ compiler, java, and eclipse *debian base is preferable


title: Customising markdown syntax highlighting in Geany

text: I'm using Geany 1.23.1 on Lubuntu 13.10. I've copied over `filetypes.markdown` from `/usr/share/geany` to `~/.config/geany/filedefs`. `filetypes.markdown` has the following content:               # For complete documentation of this file, please see Geany's main documentation     [styling]     # Edit these in the colorscheme .conf file instead     default=default     strong=string_3     emphasis=string_4     header1=keyword_1     header2=keyword_1     header3=keyword_1     header4=keyword_1     header5=keyword_1     header6=keyword_1     ulist_item=tag_unknown     olist_item=tag_unknown     blockquote=tag_unknown     strikeout=tag_unknown     hrule=tag_unknown     link=keyword_1     code=attribute_unknown     codebk=attribute_unknown          [settings]     # default extension used when saving files     extension=mkd          # sort tags by appearance     symbol_list_sort_mode=1      Why is the third line present: **# Edit these in the colorscheme .conf file instead**? What is wrong with editing `filetypes.markdown` itself? I would think that, at least from a user's perspective, editing `~/.config/geany/filedefs/filetypes.markdown` (or any other filetypes file) would be preferable to editing a `.conf` file (in `~/.config/geany/colorschemes`) as suggested because editing a `.conf` file would affect all filetypes not just `filetype.markdown`.


title: How do I prevent Xorg from loading one-time?

text: My current Xorg configuration is freezing the machine (and text based terminals don't seem to work). Is there a way (e.g. holding down a hot-key) I can prevent the loading of X at boot time? I cannot access the terminal at this time.


title: How to delete (not disable/mask) a unit in Systemd?

text: Sometimes I make a new unit in mistake, and then I have to go to /etc/systemd to look for the unit and delete all of its associated files/scripts/links/etc. Is there a better way? Like a single command that deletes everything associated with a unit name?


title: Can you run a linux system properly without internet connection?

text: I am have come across my old computer in my attic. It is a very old windows 98 HP computer. I can give more specs if needed. I was wondering if I could install Damn Small Linux on a flash drive and boot to it and install it over the current operating system and run linux properly without an internet connection. Like what is there to do on a linux system without internet? will this be a good learning environment for me to familiarize myself with linux? Should/Could I possibly try to take apart the operating system and look into it. Another added on question is should I maybe run archlinux instead of DSL and temporarily connect to the internet to get that set up or is that too advanced for me and even that old of a computer. The reason that I cannot connect to the internet is because I am going to be hooking this computer up in my bedroom and the internet is in my parents room and I do not believe that this old of a system can run with wireless internet. However, I can temporarily connect via ethernet cable but not for long.