How to deal with a problematic 3G dongle

I have an old 3G USB modem and I wonder if it's dying because it's very unreliable. Connecting it gives the following (`/var/log/syslog`):               Feb 18 22:39:56 thome kernel: [ 5310.999854] usb 1-2: new full-speed USB device number 38 using xhci_hcd     Feb 18 22:39:56 thome mtp-probe: checking bus 1, device 38: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2"     Feb 18 22:39:56 thome kernel: [ 5311.017000] usb 1-2: New USB device found, idVendor=12d1, idProduct=1003     Feb 18 22:39:56 thome kernel: [ 5311.017004] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0     Feb 18 22:39:56 thome kernel: [ 5311.017005] usb 1-2: Product: HUAWEI Mobile     Feb 18 22:39:56 thome kernel: [ 5311.017007] usb 1-2: Manufacturer: HUAWEI Technologies     Feb 18 22:39:56 thome mtp-probe: bus: 1, device: 38 was not an MTP device     Feb 18 22:39:56 thome kernel: [ 5311.017625] usb-storage 1-2:1.0: USB Mass Storage device detected     Feb 18 22:39:56 thome kernel: [ 5311.017976] scsi68 : usb-storage 1-2:1.0     Feb 18 22:39:56 thome kernel: [ 5311.019304] usb 1-2: USB disconnect, device number 38     Feb 18 22:39:56 thome systemd[1]: Starting USB_ModeSwitch...     Feb 18 22:39:56 thome systemd[1]: Started USB_ModeSwitch.     Feb 18 22:39:56 thome udisks-daemon[1319]: **** scsi_host ADDING /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host68/scsi_host/host68     Feb 18 22:39:56 thome udisks-daemon[1319]: **** scsi_host IGNORING ADD /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host68/scsi_host/host68     Feb 18 22:39:56 thome udisks-daemon[1319]: **** scsi_host IGNORING REMOVE /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host68/scsi_host/host68     Feb 18 22:39:56 thome kernel: [ 5311.459645] usb 1-2: new full-speed USB device number 39 using xhci_hcd     Feb 18 22:39:56 thome kernel: [ 5311.476931] usb 1-2: New USB device found, idVendor=12d1, idProduct=1003     Feb 18 22:39:56 thome kernel: [ 5311.476934] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0     Feb 18 22:39:56 thome kernel: [ 5311.476936] usb 1-2: Product: HUAWEI Mobile     Feb 18 22:39:56 thome kernel: [ 5311.476937] usb 1-2: Manufacturer: HUAWEI Technologies     Feb 18 22:39:56 thome kernel: [ 5311.477745] usb-storage 1-2:1.0: USB Mass Storage device detected     Feb 18 22:39:56 thome kernel: [ 5311.477918] option 1-2:1.0: GSM modem (1-port) converter detected     Feb 18 22:39:56 thome kernel: [ 5311.477988] usb 1-2: GSM modem (1-port) converter now attached to ttyUSB0     Feb 18 22:39:56 thome kernel: [ 5311.478274] usb-storage 1-2:1.1: USB Mass Storage device detected     Feb 18 22:39:56 thome kernel: [ 5311.478323] option 1-2:1.1: GSM modem (1-port) converter detected     Feb 18 22:39:56 thome kernel: [ 5311.478372] usb 1-2: GSM modem (1-port) converter now attached to ttyUSB1     Feb 18 22:39:56 thome kernel: [ 5311.478414] usb-storage 1-2:1.2: USB Mass Storage device detected     Feb 18 22:39:56 thome kernel: [ 5311.478554] scsi71 : usb-storage 1-2:1.2     Feb 18 22:39:56 thome mtp-probe: checking bus 1, device 39: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2"     Feb 18 22:39:56 thome mtp-probe: bus: 1, device: 39 was not an MTP device     Feb 18 22:39:56 thome systemd[1]: Starting USB_ModeSwitch...     Feb 18 22:39:56 thome udisks-daemon[1319]: **** scsi_host ADDING /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/host71/scsi_host/host71     Feb 18 22:39:56 thome udisks-daemon[1319]: **** scsi_host IGNORING ADD /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/host71/scsi_host/host71     Feb 18 22:39:56 thome systemd[1]: Started USB_ModeSwitch.     Feb 18 22:39:57 thome kernel: [ 5312.476715] scsi 71:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2     Feb 18 22:39:57 thome kernel: [ 5312.482692] sr0: scsi-1 drive     Feb 18 22:39:57 thome kernel: [ 5312.482844] sr 71:0:0:0: Attached scsi CD-ROM sr0     Feb 18 22:39:57 thome kernel: [ 5312.482916] sr 71:0:0:0: Attached scsi generic sg2 type 5     Feb 18 22:39:57 thome kernel: [ 5312.505690] xhci_hcd 0000:00:14.0: WARN Event TRB for slot 28 ep 6 with no TDs queued?     Feb 18 22:39:58 thome udisks-daemon[1319]: **** ADDING /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/host71/target71:0:0/71:0:0:0/block/sr0     Feb 18 22:39:58 thome udisks-daemon[1319]: **** UPDATING /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/host71/target71:0:0/71:0:0:0/block/sr0     Feb 18 22:39:58 thome udisks-daemon[1319]: **** ADDED /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/host71/target71:0:0/71:0:0:0/block/sr0     Feb 18 22:39:58 thome udisks-daemon[1319]: **** EMITTING ADDED for /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/host71/target71:0:0/71:0:0:0/block/sr0     Feb 18 22:39:58 thome kernel: [ 5312.534063] xhci_hcd 0000:00:14.0: WARN Event TRB for slot 28 ep 6 with no TDs queued?     Feb 18 22:39:58 thome udisks-daemon[1319]: **** CHANGING /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/host71/target71:0:0/71:0:0:0/block/sr0     Feb 18 22:39:58 thome udisks-daemon[1319]: **** UPDATING /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/host71/target71:0:0/71:0:0:0/block/sr0     Feb 18 22:39:58 thome udisks-daemon[1319]: **** EMITTING CHANGED for /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/host71/target71:0:0/71:0:0:0/block/sr0     Feb 18 22:39:58 thome udisks-daemon[1319]: **** CHANGED /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/host71/target71:0:0/71:0:0:0/block/sr0     Feb 18 22:39:58 thome org.gtk.Private.UDisks2VolumeMonitor[1200]: ### debug: emit_signal: 0x1cf01b0     Feb 18 22:40:02 thome kernel: [ 5316.956198] xhci_hcd 0000:00:14.0: WARN Event TRB for slot 28 ep 6 with no TDs queued?     Feb 18 22:40:02 thome udisks-daemon[1319]: **** CHANGING /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/host71/target71:0:0/71:0:0:0/block/sr0     Feb 18 22:40:02 thome udisks-daemon[1319]: **** UPDATING /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/host71/target71:0:0/71:0:0:0/block/sr0     Feb 18 22:40:02 thome udisks-daemon[1319]: **** EMITTING CHANGED for /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/host71/target71:0:0/71:0:0:0/block/sr0     Feb 18 22:40:02 thome udisks-daemon[1319]: **** CHANGED /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/host71/target71:0:0/71:0:0:0/block/sr0     Feb 18 22:40:02 thome org.gtk.Private.UDisks2VolumeMonitor[1200]: ### debug: emit_signal: 0x1cf01b0      It does not work (i.e. it is not available via **nm-applet** so that I can connect to the internet). I have seen this issue on two separate Debian machines. The one reliable workaround for this problem is rebooting the machine :(


Exec in ".desktop" with arguments don't work?

I need help, I made a script, this script run a getopts; the script have some options example: `./people -n 0ad` I need make a desktop entry, running the above example, but wasn't run the 'Exec' in the option... This is my actual desktop entry (doesn't work):               [Desktop Entry]     Version=1.0     Name=0 A.D.     Comment=A real-time strategy game of ancient warfare     Exec=/home/makerpm/people -n 0ad      Icon=0ad     Terminal=false     Type=Application     Categories=Game;StrategyGame;


Root Cron Won't Run Script (permission denied)

I've edited my root cron tab to periodically execute a script located in a particular user's folder using this command:               sudo crontab -e      When cron runs the script, this is the output:               sh: 1: /home/user/Location/Of/Script: Permission denied      I thought that the root cron had permission to do anything. I have no issue when I manually run this script as root. I've read in the documentation that further error info can be found here:               sudo cat /var/log/syslog      Here's what I found:               Jan 30 12:30:01 backup CRON[17702]: (CRON) info (No MTA installed, discarding output)      However, I think this is probably unrelated to the permission denied issue. So what do I really need to do?


RPM specfile for C/C++ project: how do I know how to fill in Requires and BuildRequires fields?

I have several C/C++ projects with sources and makefiles and I'm trying to pack them into rpms. Defining the dependencies for the created packages has become a problem for me. Concretely I need to find out what to put into the **Requires** and **BuildRequires** fields of the specfile.   1. Assuming that **Requires** field requests the list of libraries used by the executable during the runtime, I am trying to parse `ldd`'s output and pass it to the `rpm -q --whatrequires` (here is my simple script). Moreover, I need to do that recursively (get dependencies for the packages that contain first-level dependencies) someway.   2. I can guess that **BuildRequires** field should contain all the *-devel.rpm packages with a С/С++ headers ( ** _only?_** ). I can check several source files manually, but I don't understand how to analyze the thousands lines of code...  Parsing sources by #include keyword can lead to collision (because of headers with the same name but lying in different directories). Is it possible to force Make script or gcc to be more verbose in order to define which headers had been used by default? This would solve the second problem. Lack of such a useful tool for the developers in RHEL-based distros seems strange for me.


How to setup a static IP on Red Hat 6.5 using VMware?

I have VMware 5.5 with a vmguest RHEL 6.5. I get connectivity with DHCP from **RHEL -> switch1 group -> physical-> to internet**. Once I set up the vmguest with RHEL 6.5 with a static IP, it nolonger has connectivity. Is there a cook book out there on setting up a RHEL 6.x guest to a working static IP? Am I missing the obvious ?


Why does Linux heat up my computer?

I have been using Linux on my Acer 5740 for a couple of years now. Lately, I noticed that my computer starts heating up and steadies at around 70 degrees. If I fire up Eclipse or ffmpeg or something, the computer shoots to 85-90 degrees. Maybe this has happened before but I might have ignored it. I have a dual-boot with Windows 7 and 70 degrees is the maximum even when I play games. I expect Linux to heat up a little because of drivers but 70 degrees @ idling is a little too much. * * * My prior research on this shows:   1. A friend of mine with exact same Laptop but with an ATI card instead of the Intel (present on mine) was struggling with heat problems of much greater intensity. He installed fgrlx and his Laptop is as cool as Siberia.   2. I have attempted to install Intel drivers for my card. I have the latest version of Xorg and xorg for Intel. It doesn't help.   3. The problem is independent of Distribution. I have tried Ubuntu, Debian, Fedora and FreeBSD.   4. The graph for temperature versus time after boot-up is fairly steady. There are no sudden jumps.   5. All temperatures are in Celcius and correspond to `max(acpi -t)` * * * Any solutions? _Edit_ : My CPU if scaled at 933MHz still doesn't help. I can't find Fan Control for my Laptop. There are few scripts for Acer Aspire One but I can't find one for 5740. My `/proc/acpi/fan` folder is empty!                blah@blah-Laptop:/proc/acpi/fan$ ls -l      total 0


Install wicd on Slackware 14.1

I am trying to install wicd-1.7.2.4 on Slackware 14.1. I couldn't find `configure` or `makefile` in `wicd-1.7.2.4.tar.gz`. Running `python setup.py configure` (following the INSTALL guide) causes:               sh: pybabel: command not found      Then I tried to install `pybabel` but couldn't find sources and libraries. How can I install `wicd`?


Command history in Zsh

How does Zsh keep track of command history? I see two files in my home directory: `.zhistory` and `.zsh_history`. What is the difference between them? Does Zsh keep appending lines to one of them _forever_? Wouldn't that make history search too slow? Can I safely make these files symbolic links to another location? (e.g. a git repository to keep track of changes to the history)


Why does `xdg-mime query filetype ...` fail to find a new added file type?

I installed a new file type to share MIME database. But `xdg-mime query filetype` cannot tell the new type. This problem only happens on my own Linux OS which does not use GNOME or KDE as its desktop. On Ubuntu, the same process works well. I found that `xdg-mime query filetype` uses "file -i filename" under the hood on my OS but uses gnomevfs on Ubuntu. Here are my steps:   1. wrote a xml file for my new file type `my_file.xml`   2. `xdg-mime install my_file.xml`   3. `xdg-mime query filetype` <name of file to query> .... no output :-( I checked `/usr/share/mime/applications` and found the xml entry generated by update-mime-database there. And the C API `g_file_info_get_content_type()` can get the proper mime type. So it seems the shared-mime-info has been updated successfully. But the "file" command still fails, why? Here is my xml file:               <?xml version="1.0" encoding="UTF-8"?>     <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>         <mime-type type="application/vnd.xxx.xxx.xxx">             <comment>xxxx</comment>             <glob pattern="*.dcf"/>         </mime-type>     </mime-info>


How can I get the error code (exit code) of "xdg-mime query filetype" command?

I ran `xdg-mime query filetype` <file name> to check the MIME type of a file, and it failed. How can I print the error code (exit code) of the `xdg-mime` command? I want to know what error happened:   1. Error in command line syntax.    2. One of the files passed on the command line did not exist.    3. A required tool could not be found.    4. The action failed.    5. No permission to read one of the files passed on the command line.


Unmet dependencies

I am trying to compile vim and install with "--enable-pythoninterp" flag, which needs the python-dev package. INFO   I obtained the vim source from ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2   Vim7.3 is not available yet using apt.   Using Ubuntu 10.10 But, `sudo apt-get python-dev` results in broken packages error message -> The following packages have unmet dependencies:   python-dev : Depends: python (= 2.6.6-2ubuntu1) but 2.6.6-2ubuntu2 is to be installed   E: Broken packages How can I best resolve this issue? * * *               $ apt-cache policy vim python python-dev                      python:       Installed: 2.6.6-2ubuntu2       Candidate: 2.6.6-2ubuntu2       Version table:      *** 2.6.6-2ubuntu2 0             100 /var/lib/dpkg/status          2.6.6-2ubuntu1 0             500 http://archive.ubuntu.com/ubuntu/ maverick/main i386 Packages     vim:       Installed: (none)       Candidate: 2:7.2.330-1ubuntu4       Version table:          2:7.2.330-1ubuntu4 0             500 http://archive.ubuntu.com/ubuntu/ maverick/main i386 Packages     python-dev:       Installed: (none)       Candidate: 2.6.6-2ubuntu1       Version table:          2.6.6-2ubuntu1 0             500 http://archive.ubuntu.com/ubuntu/ maverick/main i386 Packages


Alternatives to Symphony OS Orchestra Application Environment

I just read that Symphony OS has an wonderful concept, called Orchestra, where applications (can be even written HTML + JAVAscript) can be ran via a reduced localhost server and a leaned down mozilla bases UI renderer. The concept of a unified UI renderer triggered my curiosity, and I am wondering, if such other unified UI solutions for Linux.


Automatically include N latest kernel versions in GRUB / GRUB2 menu on kernel upgrade

What I like about Ubuntu is that the GRUB menu always allows me to pick the latest (default) or second-latest (etc.) kernel version at boot time. In Arch Linux, I can't do that by default. The only options are normal and fallback images, and both boot the latest kernel. How can I achieve the Ubuntu-like behavior in Arch? I use Grub and Grub2, but I guess that I wouldn't have to configure the bootloader much. It will probably include the images it finds in `/boot` in the menu automatically. I can be wrong, though. So, what I need, from most to least important, is:   1. That the new kernel image created by `mkinitcpio` during the upgrade doesn't overwrite the previous one;   2. That the latest kernel is present in the bootloader menu as default option;   3. That very old versions are excluded from the menu or hidden into "older version" menu item _(not that important)_. How would one go about this? Should I look into `mkinitcpio` config or maybe `pacman` config? I've actually tried looking at configuration files for both, no ideas so far.


How do I get a .desktop in KDE to open a new browser window?

I setup a link to web app that my company uses on my desktop, which resulted in a `.desktop` file like this:               [Desktop Entry]     Icon=/home/kris/Pictures/gplus.png     Name[en_US]=Google Plus     Name=Google Plus     Type=Link     URL[$e]=https://plus.google.com/      This works pretty well, but I can't figure out how to add an option to force it to open in a new window, or possibly even as an "app" window. I have tested in a console that what I want will work:               $ firefox -new-window plus.google.com      Does anyone know of a way to modify the `.desktop` to do this? Is the only way to re-do it as a `Exec` style launcher? Is there an editor in KDE for this?


How could i flip content of a binary file with bash commands

I was wondering if it's possible to do bitwise conversion on a binary file, with bash commands, (in my case bitwise negation).


Live USB stuck in software rendering mode

I recently aquired an Aspire E15 Touch from the store to find i had a bit of an issue with using Linux Mint or any Linux distro for that matter. At first, Mint booted, i heard the splash noise, but my screen was black. Now after adding `nomodeset` to the GRUB boot command, it loaded the desktop properly, but now it's stuck in software rendering mode. Is there any way to fix this? I don't have Mint currently installed. I'm just running it from the Live USB. Here's a few extra details: I'm running in legacy boot mode, and i have USB devices prioritized over everything else in the boot order. The native OS that came packed with my computer is Windows 8.1.


Problem with Disk or Cable or Controler or?

i plug in a new disk and found this in systemlog on my debian:                [639.840138] ata9.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen     [  639.840379] ata9.00: failed command: IDENTIFY DEVICE     [  639.840532] ata9.00: cmd ec/00:01:00:00:00/00:00:00:00:00/00 tag 23 pio 512 in     [  639.840536]          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)     [  639.840888] ata9.00: status: { DRDY }     [  639.841055] ata9: hard resetting link     [  640.168183] ata9: SATA link up 6.0 Gbps (SStatus 133 SControl 300)     [  641.120031] ata9.00: configured for UDMA/133     [  641.120064] ata9: EH complete     [ 1840.864140] ata9.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen     [ 1840.864293] ata9.00: failed command: IDENTIFY DEVICE     [ 1840.864399] ata9.00: cmd ec/00:01:00:00:00/00:00:00:00:00/00 tag 6 pio 512 in     [ 1840.864403]          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)     [ 1840.864675] ata9.00: status: { DRDY }     [ 1840.864755] ata9: hard resetting link     [ 1841.192185] ata9: SATA link up 6.0 Gbps (SStatus 133 SControl 300)     [ 1841.456378] ata9.00: configured for UDMA/133     [ 1841.456427] ata9: EH complete      It seems to have no problems except the speed from 6.0 to udma 133. i ask myself if the disk will die or the cable is damage or anything else perhaps the powerunit cant work with 9 disks. Any idea to analyse this? I will change the sata cable next.


When is it useful to use "grep -- SOMEPATTERN"?

So under Linux/AIX where ever.., when is it useful to use:               grep -- SOMEPATTERN      the Question is the "--" part. When is it usefull to use?


How to convince tar (etc.) to archive block device contents?

I have six Linux logical volumes that together back a virtual machine. The VM is currently shutdown, so its easy to take consistent images of them. I'd like to pack all six images together in an archive. Trivially, I could do something like this:               cp /dev/Zia/vm_lvraid_* /tmp/somedir     tar c /tmp/somedir | whatever      But that of course creates an extra copy. I'd like to avoid the extra copy. The obvious approach:               tar c /dev/Zia/vm_lvraid_* | whatever      does not work, as tar recognizes the files a special (symlinks in this case) and basically stores the `ln -s` in the archive. Or, with `--dereference` or directly pointed at `/dev/dm-X`, it recognizes them as special (device files) and basically stores the `mknod` in the archive. I've searched for command-line options to tar to override this behavior, and couldn't find any. I also tried `cpio`, same problem, and couldn't find any options to override it there, either. I also tried `7z` (ditto). Same with `pax`. I even tried `zip`, which just got itself confused. edit: Looking at the source code of GNU tar and GNU cpio, it appears neither of them can do this. At least, not without serious trickery (the special handling of device files can't be disabled). So, suggestions of serious trickery would be appreciated or alternate utilities. _TLDR:_ Is there some archiver that will pack multiple disk images together (taken from raw devices) and stream that output, without making extra on-disk copies? My preference would be output in a common format, like POSIX or GNU tar.


Linux file command classifying files

I need to recognize type of data contained in random files. I am new to Linux. I am planning to use the `file` command to understand what type of data a file has. I tried that command and got the output below. Someone suggested to me that the `file` command looks at the initial bytes of a file to determine data type. The `file` command doesn't look at a file extension at all. Is that correct? I looked at the man page but felt that it was too technical. I would appreciate if anyone can provide a link which has much simpler explanation regarding how the `file` command works. What are different possible answers that I could get after running the `file` command? For example, in the transcript below I get JPEG, ISO media, ASCII, etc: The screen output is as follows                m7% file date-file.csv     date-file.csv: ASCII text, with CRLF line terminators     m7% file image-file.JPG     image-file.JPG: JPEG image data, EXIF standard     m7% file music-file.m4a     music-file.m4a: ISO Media, MPEG v4 system, iTunes AAC-LC     m7% file numbers-file.txt     numbers-file.txt: ASCII text     m7% file pdf-file.pdf     pdf-file.pdf: PDF document, version 1.4     m7% file text-file.txt     text-file.txt: ASCII text     m7% file video-file.MOV     video-file.MOV: data      * * * **Update 1** Thanks for answers and they clarified a couple of things for me. So if I understand correctly folder /usr/share/mime/magic has a database that will give me what are the current possible file formats (outputs that I can get when I type file command and follow it by a file). is that correct? Is it true that whenever 'File' command output contains the word "text" it refers to something that you can read with a text viewer, and anything without "text" is some kind of binary?


Why doesn't `restore` display my UTF-8 encoded filenames correctly in interactive mode?

When using the interactive mode of the `restore` utility to restore backups made with `dump` UTF-8-encoded filenames doesn't display correctly, see example below. The `??`s should be `ö`s ...               $ sudo restore -if dumpfile     Dump tape is compressed.     restore > ls     ./somedir:     lagerl??fSelma_k??rkarlen.txt          restore >      How come? What are the solutions do this problem? The dump and the restore are performed on the same machine, that has the locale set as follows:               $ locale     LANG=sv_SE.UTF-8     LANGUAGE=sv:en_US:en


modify date of symlink on bindfs

I have the feeling that I cannot modify the date of symlinks on bindfs. See the following transcript of what I tried. On EXT4:               nailor@needle:~$ mkdir /tmp/ex     nailor@needle:~$ cd /tmp/ex     nailor@needle:/tmp/ex$ touch realfile       nailor@needle:/tmp/ex$ ln -s realfile linkfile     nailor@needle:/tmp/ex$ stat realfile linkfile       File: `realfile'       Size: 0           Blocks: 0          IO Block: 4096   regular empty file     Device: 801h/2049d  Inode: 22678377    Links: 1     Access: (0644/-rw-r--r--)  Uid: ( 1000/  nailor)   Gid: ( 1000/  nailor)     Access: 2013-09-09 00:46:15.356004837 +0200     Modify: 2013-09-09 00:46:15.356004837 +0200     Change: 2013-09-09 00:46:15.356004837 +0200      Birth: -       File: `linkfile' -> `realfile'       Size: 8           Blocks: 0          IO Block: 4096   symbolic link     Device: 801h/2049d  Inode: 22678380    Links: 1     Access: (0777/lrwxrwxrwx)  Uid: ( 1000/  nailor)   Gid: ( 1000/  nailor)     Access: 2013-09-09 00:46:34.299766676 +0200     Modify: 2013-09-09 00:46:27.227855586 +0200     Change: 2013-09-09 00:46:27.227855586 +0200      Birth: -     nailor@needle:/tmp/ex$ touch -h realfile linkfile     nailor@needle:/tmp/ex$ stat realfile linkfile           File: `realfile'       Size: 0           Blocks: 0          IO Block: 4096   regular empty file     Device: 801h/2049d  Inode: 22678377    Links: 1     Access: (0644/-rw-r--r--)  Uid: ( 1000/  nailor)   Gid: ( 1000/  nailor)     Access: 2013-09-09 00:46:46.931607877 +0200     Modify: 2013-09-09 00:46:46.931607877 +0200     Change: 2013-09-09 00:46:46.931607877 +0200      Birth: -       File: `linkfile' -> `realfile'       Size: 8           Blocks: 0          IO Block: 4096   symbolic link     Device: 801h/2049d  Inode: 22678380    Links: 1     Access: (0777/lrwxrwxrwx)  Uid: ( 1000/  nailor)   Gid: ( 1000/  nailor)     Access: 2013-09-09 00:46:49.899570563 +0200     Modify: 2013-09-09 00:46:46.931607877 +0200     Change: 2013-09-09 00:46:46.931607877 +0200      Birth: -      On bindfs:               nailor@needle:/tmp/ex$ mkdir sub           nailor@needle:/tmp/ex$ bindfs -n . sub     nailor@needle:/tmp/ex$ cd sub     nailor@needle:/tmp/ex/sub$ touch -h realfile linkfile      nailor@needle:/tmp/ex/sub$ stat realfile linkfile        File: `realfile'       Size: 0           Blocks: 0          IO Block: 4096   regular empty file     Device: 17h/23d Inode: 2           Links: 1     Access: (0644/-rw-r--r--)  Uid: ( 1000/  nailor)   Gid: ( 1000/  nailor)     Access: 2013-09-09 00:47:34.000000000 +0200     Modify: 2013-09-09 00:47:34.000000000 +0200     Change: 2013-09-09 00:47:34.755006803 +0200      Birth: -       File: `linkfile' -> `realfile'       Size: 8           Blocks: 0          IO Block: 4096   symbolic link     Device: 17h/23d Inode: 3           Links: 1     Access: (0777/lrwxrwxrwx)  Uid: ( 1000/  nailor)   Gid: ( 1000/  nailor)     Access: 2013-09-09 00:46:49.899570563 +0200     Modify: 2013-09-09 00:46:46.931607877 +0200     Change: 2013-09-09 00:46:46.931607877 +0200      Birth: -      As you can see, the times for the symlink did not change on bindfs. This is a problem with e.g. rsync, because this way I get:               rsync: failed to set times on "link1": No such file or directory (2)     rsync: failed to set times on "link2": No such file or directory (2)     ...      I found this to be a known problem with sshfs ( http://bugs.debian.org/cgi- bin/bugreport.cgi?bug=640038 ) but found nothing mentioning bindfs. Now I am wondering if there is any such mentioning and/or and explanation for the missing functionality and/or an answer if this affect fuse in general...


Low-level disk access in FreeBSD

I'm developing a utility that needs to do low-level random access of disks (read individual sectors). In Linux I accomplish this by accessing the corresponding block device (e.g. `/dev/sda`). However, I've just installed FreeBSD, and I noticed that it doesn't have block devices. Instead, disks appear as character devices, which don't allow random "seeking". Is there a way to accomplish this in FreeBSD? (i.e. low-level random access)


Directory diff in bash script

I have a bash script that expands two archives (jar files) into two directories and then does a diff of the two folders. I want the diff to be piped into a file so I do this in the bash file.               diff -r $originalJarExtracted $assembledJarExtracted >target/$diffList      While this works it also stops the script and anything afterwards is not executed. How can I get diff to pipe its output into the file and for the script to keep going. I looked at the info and man pages for diff but could not get this to work. I am running the script on the mac btw. Just for reference the scripts are on github


Emacs auto encryption and gpg

Emacs encrypts/decrypts `.gpg` files automatically. But recently I have lost the ability to decrypt files encrypted by the Linux `gpg` tool and vice versa. I use:   * passphrase symmetric encryption   * gnupg 1.4.11   * emacs 24.0.92.1   * Debian sid Decrypting using `gpg` (encrypted by emacs) gives:               gpg: decryption failed: bad key      Decrypting using emacs (encrypted by gpg) gives:               epa-file--find-file-not-found-function: Opening input file: Decryption failed,      Any idea how to avoid this?


Using real time kernel headers to compile userspace code vs default headers

Per customer requirements, I installed CentOS 5.6 with the default kernel. With this kernel installed, the time.h file includes the `#define CLOCK_MONOTONIC`. Now, a real-time kernel was installed along with the kernel-devel and our code would like to use `CLOCK_MONOTONIC_RAW`. It does exist as a part of the kernel's header files, but when I compile our code, it does not find it in the standard userspace includes. My question is, what is the proper procedure to including/replacing the `time.h` found by default with the real-time kernel? From my research, it looks like symlinks are bad, so how should it be handled? What is the procedure or process? Upgrading to CentOS 6.0 or 5.7 is not an option per customer requirements.


Remotely work on Red Hat Box

So we're working on a project and currently,have the need to edit/save files remotely on a Red Hat box.   We are accessing this files mainly with sublime-text.   So we are trying to figure out what is the best option to do this, for example:   To have a folder on the ~user/remoteShare   and to be able to edit/save/delete any file under this remote folder from my local sublime-text editor I'm using local Ubuntu 14.04 and Red Hat Enterprise Linux 6 on the remote.


XEmacs: load all files in /home/barry/.emacs_barry

XEmacs creates an .emacs_barry file in my home directory that contain my active buffers + point positions in those buffers(?). It looks like this:               "Norma Jean"          "/home/barry/plan1.txt" 4504398     nil     "/home/barry/plan1.txt" 4504398     "/home/barry/file7.txt" 48480     "/home/barry/file9.txt" 32086     [...]      Previously, xemacs would restore my session on restart, but it no longer does that. I've tried "apropos session" and tried several commands to no avail. How do I tell xemacs to load all the files in .emacs_barry? Or, can I just get emacs to load a list of files in a given file/buffer? I realize my xinit.el or something is broken, but this is the only thing I really miss.


Desktop indexing with KDE

I have just upgraded to KDE 4.13 on Arch Linux and it has brought my system to a screeching halt. I am pretty sure it has something to do with Baloo the new desktop search indexing system. I am not sure I ever use desktop search although I use `kontact` and the associated programs (e.g., `kmail`, `korganizer`, and `kaddressbook`). What exactly does Baloo do and how does it interact with Nepomuk and Akonadi and KDE PIM/`kontact` and what would happen if I disable it by blacklisting my home directory?


Start linux in text mode

I know that it ask so many time, how to boot Linux in text mode; but all solution that i got is on installed Linux system, not on fresh system. Is there any way to load any Linux in live mode in text mode or console mode, not any service related to X must be started. Are there is any kernel option or parameter that don't touch X system and start the system in text mode, in Debian based system like Kali ? I want to start Kali in live mode on window machine, but in text mode, how it can be ?


How to let `named` (bind9) forward certain domains to a different nameserver?

In `dnsmasq`, it's possible to forward domains to different nameservers. How can I do that in `named`?               server=/foo.com/10.0.10.1     server=/vpn.foo.com/8.8.8.8


How to make dnsmasq avoid DNS cache poisoning?

Some domain gets DNS cache poisoning if dnsmasq is the nameserver. But the problem is gone if switch to BIND (named). Is there a easy configuration of dnsmasq so that DNS cache poisoning can be avoid?


Display numbers in meters of htop

My server is running on debian Wheezy and htop 1.0.1 but it does not display any values on the meters bar except the 100.0% value of CPUs. Is it possible to show always the values of a meter? This is the current display of htop on my server: ![current](https://lh4.googleusercontent.com/-VhkAyOpemk4/U1e0DT_zA5I/AAAAAAABplk/-qBLFkjBgv8/w621-h112-no/Capture.JPG) But I want to have the numbers always on my meters like on this screenshot from http://hisham.hm/htop/index.php?page=screenshots: ![expected](http://hisham.hm/htop/htop-0.4.png) My htoprc is located in ~/.config/htop/htoprc and contains the following data:               # The parser is also very primitive, and not human-friendly.     fields=0 48 17 18 38 39 40 2 46 47 49 1     sort_key=46     sort_direction=1     hide_threads=0     hide_kernel_threads=1     hide_userland_threads=0     shadow_other_users=0     show_thread_names=0     highlight_base_name=1     highlight_megabytes=1     highlight_threads=0     tree_view=0     header_margin=1     detailed_cpu_time=0     cpu_count_from_zero=0     color_scheme=0     delay=15     left_meters=LeftCPUs2 CPU Memory Swap     left_meter_modes=1 1 1 1     right_meters=RightCPUs2 Tasks LoadAverage Uptime     right_meter_modes=1 2 2 2


Stuck between these two books?

I'm new to Unix/Linux platforms so I was hunting for good books on *nix... I soon realized there is not one book or resource. But to gain confidence on the command line and scripting (the real *nix user) I finally found two books: 1.The Linux Command Line 2.Linux Command Line and Shell Scripting Bible Both seem to be great. The second one is almost double the size of the first one (I don't mind, I like reading books). But which one is more informative and also has better coverage of topics? It's for you people to tell. I looked at the reviews of the second one on Amazon. But I couldn't find the reviews of the first one. So please tell me which one should I get? Thanks.


How do I get the http status of a site in bash?

I figure curl would do the job. I wrote in a bash script:               #!/bin/sh          function test {         res=`curl -I $1 | grep HTTP/1.1 | awk {'print $2'}`         if [ $res -ne 200 ]         then             echo "Error $res on $1"         fi     }            test mysite.com     test google.com      The problem here is no matter what I do I can't get it to stop printing the below to stdout:                 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current      I want a cronjob to run this script and if it writes such a message then everytime I run it I'll get an email because something has been printed to stdout in cron, even though the site may be fine. How do I get the status code without getting junk into stdout? This code works except the bonus junk to the stdout preventing me from using it.


colorizing ls output based on filename

i'm on freeBSD and trying to colorize `ls` output, so i've added               alias ls        ls -lhG     setenv LSCOLORS gxfxcxdxbxegedabagacad      to my `.cshrc` and it works. but what i really want to - is to be able to colorize (for example) `*.pl` and `*.php` files different ways to quicly distiguish it. Can i modify `LSCOLORS` some way to colorize files dependong on their name?


How to setup DHCPD on two interfaces (Angstrom)

I have an embedded system running Angstrom just fine. This platform has multiple uses, one of which is to act as a home router, so it has wireless and wired network interfaces, which work correctly. I'm trying to configure DHCPD so that each interfaces hands out IP addresses from the same range, for instance 192.168.1.2 - 192.168.1.100, and I can't figure this out. Everything works fine if the interfaces handle different subnets, but when both interfaces are on the same subnet, things don't work. I've seen conflicting answers out there about whether this is even possible - but all home routers do this exact scenario, so there must be a way. I don't have my config files right now - will post them later. So I'm looking for advice if this is even possible. Tnanks! Update: here's the script that worked - thanks Bill               # route all packets between all interfaces     iptables -t nat -A POSTROUTING -s 172.16.0.0/16 -d 172.16.0.0/16 -j ACCEPT     iptables -t nat -A POSTROUTING -s 172.16.0.0/16 -j MASQUERADE          # set the MAC address           ifconfig eth0 0 0.0.0.0     ifconfig eth0 down     ip link set eth0 address 00:80:44:0F:06:C7          # setup the bridge          brctl addbr br0     brctl stp br0 off     brctl addif br0 eth0          # hostapd sets up the wireless before it is added to bridge       hostapd -B /etc/hostapd/hostapd.conf       brctl addif br0 wlan0       ifconfig wlan0 up       ifconfig wlan0 0 0.0.0.0            ifconfig eth0 up       ifconfig br0 172.16.10.247 netmask 255.255.0.0 up       route add default gw 172.16.1.1 br0


How can I tell what device or file name I am redirecting to

From within a shell script (sh/bash), how can I tell what device or file name I am redirecting to? For example, I have a shell script named `script.sh`. I run the shell script and redirect STDOUT to a file named `out.txt`, and redirect STDERR to a file named `err.txt`. So, that would look like this:               $ ./script.sh > out.txt 2> err.txt      Now, from within the shell script, I can tell **_if_** STDOUT (or STDERR) is being redirected, or not:               if [ -t 1 ]; then...     if [ ! -t 1 ]; then...      but, once I know STDOUT (or STDERR) is being redirected, how can I tell **_where_** it is being rdirected to?


How do I change which partition's grub.cfg is used? Can I merely reinstall grub?

I realize the title might be a bit ambiguous, so let me expand some more. This computer is ~3 years old at this point. For the first two, I used Ubuntu 11.04 installed on one partition; about a year ago, I switched to LMDE using a different partition on the same drive (Ubuntu and swap inside an extended, LMDE in a primary outside of and next to the extended). When I installed LMDE, somehow I "chose" to continue using the grub installation stored on and maintained by the Ubuntu partition; in retrospect this was probably a mistake. The end result is that despite going through a number of kernel updates in LMDE, I'm still using 3.2 even though I have 3.11 installed (and perhaps more shockingly, LMDE apparently runs flawlessly with the old kernel). Since the old partition's grub menu isn't being updated, I can't boot with the new kernel; meanwhile, LMDE has kept its own version of grub up to date (with the new kernels), and `sudo update-grub` updates that file fine, but of course none of it matters since the MBR still boots using the old partition's grub. How can I change/fix this? I tried to chroot to my old Ubuntu install but `update-grub` fails with `/usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?).`, which I interpret to mean that the old grub is smarter than the chroot. So, would it be safe for me to merely run `grub-install /dev/sdb` (from inside LMDE), or will that somehow break something? If the latter, then what can I do to fix this? Normally I would just try a couple of things, but of course this could potentially make my system unusable, which is something I want to avoid.


Is this redirecting to /dev/null?

I found this script on the arch wiki which prefixes an `ffmpeg` command like this               < /dev/null ffmpeg -i "$a" -qscale:a 0 "${a[@]/%flac/mp3}"      I understand the ffmpeg command, it is the `< /dev/null` part. Is it supposed to redirect the verbose output to `/dev/null/`?


Enabling carl9170 in xconfig

I am building the sunxi-linux kernel for a cubieboard and I need the carl9170 driver to make a usb wifi adapter work. I am using the 3.4 sunxi kernel, and no matter what I do in xconfig, I cannot enable the option CONFIG_CARL9170 because it is greyed out. I tried satifying all of its dependcies, but it is still greyed out. How can I enable the carl9170 driver?


the different type network adapter in virtual machines

There are different types of network adapter in VMware workstation:               bridged     nat     host-only     custom      what the difference between this types ,and when can I use each one?


Try to disable console output, console=null doesn't work

as mentioned above, I want to to completely turn off the console output, but putting `console=` or `console=null` in the kernel command line doesn't change a thing. When I enque `quiet` to the kernel command line it approximates this job, but I want to completely turn off the output. So why is `console=null` not working, there isn't even an error message?


Jboss application startup and shutdown asks for password. How to automate with init script?

Jboss application startup and shutdown of BMC-IDM asks for password (called keystore password, some Java stuff). How to automate with init script? Stop application               > stop_idm_suite.sh     Suite system password:      start application               > start_idm_suite.sh     -Didm.suite.home=/opt/jboss-app/bmc/idm/idm-suite7.5       -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol -Djavax.net.ssl.trustStore=/opt/jboss-app/bmc/idm/idm-suite7.5/security/keystore/idm.keystore -Dlog4j.configuration=-there-aint-no-such-file- -Djava.awt.headless=true -Didoox.debug.logger=log4j -Xms1024m -Xmx1024m -XX:MaxPermSize=258m -XX:PermSize=128m -Doracle.home=/opt/jboss-app/oracle/product/10.2.0/client_1 -Dess.root=/opt/jboss-app/bmc/idm/idm-suite7.5/ess_api          Suite system password:      Tried with start_idm_suite.sh < password-file but no luck


Recovering files from partitions at a corrupted SD card?

I got a problem with my SD card which had got Raspbian. Everything seemed to be ok while working with the raspberry. I inserted it to my laptop running Ubuntu 12.04.4 to fetch some files. It first couldn't load the files from Home partition (boot partition was shown too)so I tried to unmount it from nautilus and ejected the card manually. Then, when I inserted the card again, it showed one only partition named "+00, and all it shows are files with out any format or extension known and with weird names. Tried to boot the raspberry with the card but naturally it didn't boot at all. Partitions actually seem to have disappeared. Is there any way to recover my files? `fdisk -l` output:               Disk /dev/sdb: 8068 MB, 8068792320 bytes     249 heads, 62 sectors/track, 1020 cylinders, total 15759360 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x000981cb             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1            8192      122879       57344    c  W95 FAT32 (LBA)     /dev/sdb2          122880    15759359     7818240   83  Linux


How to debug system freeze?

I'm experiencing strange bug when I close lid of my laptop - system freezes (no reaction on keys, no response form ssh) hard and displays some strange colour effects. The kernel log (after reboot) shows nothing. My question is - how to debug it? Maybe there's a way to track last called kernel function or something similar?


Setting mobile broadband connection in Fedora 17

I am using a Dell Precision M4500. I've realized that there is a SIM slot underneath the battery slot, I suppose it is for using mobile broadband access. I am usually connecting to the internet through the tethered signal from my Android mobile and I was thinking that it maybe easier to configure the PC to use the SIM from my phone and get internet access directly. The first thing I need to confirm is that there is actually a broadband modem or some device that can connect to 3G and not just the slot in the computer bones. I've tried `lspci` and `lsusb` but I cannot recognize any device that could be a 3G modem. Here the output               $ lspci     00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev    02)     00:01.0 PCI bridge: Intel Corporation Core Processor PCI Express x16 Root Port (rev 02)     00:19.0 Ethernet controller: Intel Corporation 82577LM Gigabit Network Connection (rev 05)     00:1a.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05)     00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 05)     00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 05)     00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 (rev 05)     00:1c.2 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 3 (rev 05)     00:1c.3 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 4 (rev 05)     00:1d.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05)     00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a5)     00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller (rev 05)     00:1f.2 RAID bus controller: Intel Corporation Mobile 82801 SATA RAID Controller (rev 05)     00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 05)     00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 05)     01:00.0 VGA compatible controller: nVidia Corporation GT216 [Quadro FX 880M] (rev a2)     01:00.1 Audio device: nVidia Corporation High Definition Audio Controller (rev a1)     03:00.0 Network controller: Intel Corporation Centrino Ultimate-N 6300 (rev 35)     04:00.0 CardBus bridge: Ricoh Co Ltd Device e476 (rev 02)     04:00.1 SD Host controller: Ricoh Co Ltd MMC/SD Host Controller (rev 03)     04:00.4 FireWire (IEEE 1394): Ricoh Co Ltd FireWire Host Controller (rev 03)     3f:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 02)     3f:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 02)     3f:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 02)     3f:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 02)     3f:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 02)     3f:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 02)     $ lsusb     Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub     Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 001 Device 003: ID 05ca:1814 Ricoh Co., Ltd HD Webcam     Bus 002 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver     Bus 002 Device 004: ID 413c:8187 Dell Computer Corp. DW375 Bluetooth Module     Bus 002 Device 005: ID 0a5c:5800 Broadcom Corp. BCM5880 Secure Applications Processor`      Can someone help me understand if what I want to do is possible?


Awk: check for length of field

In `awk`. I am working on Solaris 10, so it's probably an old(er) version of `awk`. I came up with this rudimentary one-liner that works, at least for my particular input.               awk -F\; '$3 ~ /[ ]*...............................*/' file.csv       There may or may not be spaces around the separators hence the `[ ]*` part of the regex. Wanting to avoid printing 30 times the dot `.` character, I tried the following:               awk -F\; '$3 ~ /[ ]*.\{30\}.*/{print $3}' file.csv      This did not return any result. If it helps in any way, I'm using `ksh88`. What would be the best way to avoid entering those 30 consecutive dots?


How do I extract all .htaccess files from a tarball?

I want to extract all .htaccess files from a tarball, how can I do so? I see only one mention of "include" in the manual page of `tar` which is not related with an option for including only certain filenames at all. Is there an alternative other than mentioning all paths as argument?


Remove user space quota in Ubuntu 12.04?

I'm trying to install Unity3D but I only have 1.5GB (EDIT: I forgot to mention this is what the Unity3D installer says, but I have also had problems with downloading things of large sizes) free space left in my home directory. How can I remove/extend my user quota? output of `df -h` as requested:               amohr@ubuntu:~$ df -h     Filesystem      Size  Used Avail Use% Mounted on     /dev/loop0       29G   27G  1.6G  95% /     udev            2.5G  4.0K  2.5G   1% /dev     tmpfs           993M  936K  992M   1% /run     none            5.0M     0  5.0M   0% /run/lock     none            2.5G  4.4M  2.5G   1% /run/shm     /dev/sda3       293G   30G  264G  11% /host      I used a 300GB partition for Ubuntu and haven't installed much.. there is no way I can be running out of space.


Why does mount have the SUID bit set?

I'm not sure why `mount` is installed with SUID bit on many distributions. In graphical environment, it doesn't require user to type the `mount` command to mount a partition. Normally udisks will communicate with another daemon to mount the drive. And on a server, I don't see the necessity as well. So, is there any reason to have SUID bit set?


IDE or Editor for Front-end development (JavaScript/HTML/CSS)?

These days APTANA seems to be the IDE of choice for Javascript developers although there is no package for Ubuntu or any other distribution. How do I install Aptana on Ubuntu? Is it stable? (if you can suggest alternatives they are welcome)


Slow boot, how to program fsck to run like a cron job?

Sometimes my web server crashes, and it may take hours to boot. I've been told `fsck` might be the culprit, because it can only be run during boot, only runs after X days and Y mounts, and if the server was up for a lot of time, on the next reboot it will for sure be slow. So what can I do to fix this? I found about `tune2fs`. But I will need to coordinate that with a reboot cronjob? Say I do `tune2fs -i 1w /dev/sda1`. I'm afraid that if I set a cron to run after that date (which I can get with `-l`), on the following dates they will be out of sync, won't they? Another thing that is not clear: after a crash, will fsck run anyway no matter what? Should it? Will it still be slow, even if it was run less than a week ago?


Cross-compiling and CMake

I am trying to cross-compile CGAL on an amd64 Linux machine to the ARM architecture. CGAL uses CMake for building. CGAL has several dependencies, including GMP and MPFR libraries. When CMake runs, it needs to determine the versions of these dependencies. To find the versions, CMake compiles and runs several small test programs that simply link with these libraries and output their versions. This works fine during a regular, non-cross-compiled build. But when I cross-compile, naturally these test programs will not run on the host machine. Here's an example:               /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1     /opt/Company/ArmTools_GCC435_GLIBC_Q3_2011/bin/arm-rc-linux-gnueabi-g++        -fPIC CMakeFiles/cmTryCompileExec.dir/print_GMP_version.cpp.o  -o cmTryCompileExec -rdynamic /home/pmw/Software-Engineering/build/Lib/mpir-2.6.0/arm/lib/libgmp.a     gmake[1]: Leaving directory `/home/pmw/Software-Engineering/SW_Tools/CGAL-4.1/CMakeFiles/CMakeTmp'     /home/pmw/Software-Engineering/SW_Tools/CGAL-4.1/CMakeFiles/CMakeTmp/cmTryCompileExec: /home/pmw/Software-Engineering/SW_Tools/CGAL-4.1/CMakeFiles/CMakeTmp/cmTryCompileExec: cannot execute binary file          -- USING GMP_VERSION = 'unknown'      I found a suggestion (if I understand it correctly) to specify the GMP version explicitly; that should keep CMake from trying and failing to determine it. So I created a file containing this line:               SET(GMP_VERSION 2.6.0)      and invoked CMake with the argument `-C path/to/my/file`. But that didn't change anything. Then I tried invoking CMake with the argument `-DCMAKE_TOOLCHAIN_FILE=/path/to/my/file` instead. Again, no effect. I see that CMake is able to find and parse this file, however. So, how can I convince CMake to not try to build and execute cross-compiled programs on the host machine? I apologize in advance if this Unix & Linux StackExchange site is not the best place for this question. Last week I posted my question on the CGAL mailing list (which is now the top three Google results for "cross-compiling cgal"; I am famous!) but received no replies.


xe sr-create type=ext results in backend failure

I'm trying to create an ext based storage repository:               xe sr-create content-type="local SR" \        host-uuid=c7030a1f-15e3-7e7d-2932-b30200a15917 type=ext \        device-config-device=/dev/sdb1 \        shared=false name-label="Local File SR"      Results in:               There was an SR backend failure.     status: non-zero exit     stdout:     stderr: Traceback (most recent call last):       File "/usr/lib/xcp/sm/EXTSR", line 320, in <module>         SRCommand.run(EXTSR, DRIVER_INFO)       File "/usr/lib/xcp/sm/SRCommand.py", line 263, in run         ret = cmd.run(sr)       File "/usr/lib/xcp/sm/SRCommand.py", line 94, in run         return self._run_locked(sr)       File "/usr/lib/xcp/sm/SRCommand.py", line 131, in _run_locked         return self._run(sr, target)       File "/usr/lib/xcp/sm/SRCommand.py", line 214, in _run         return sr.create(self.params['sr_uuid'], long(self.params['args'][0]))       File "/usr/lib/xcp/sm/EXTSR", line 225, in create         util.pread2(cmd)       File "/usr/lib/xcp/sm/util.py", line 177, in pread2         return pread(cmdlist, quiet = quiet)       File "/usr/lib/xcp/sm/util.py", line 164, in pread         (rc,stdout,stderr) = doexec(cmdlist_for_exec)       File "/usr/lib/xcp/sm/util.py", line 129, in doexec         proc = subprocess.Popen(args,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE,close_fds=Tru       File "/usr/lib/python2.7/subprocess.py", line 679, in __init__         errread, errwrite)       File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child         raise child_exception     OSError: [Errno 2] No such file or directory


Minimize the current width of a window in Vim

To maximize the width of a current window in Vim, we type:               ctrl-w |      Is there a similar alternative for minimizing a current window in Vim?


Google chrome has the wrong docky icon

I'm using fedora 20 with xfce. The launcher icon on docky is the xfce panel icon instead of the google chrome icon, I've made sure the correct icon is inside /usr/share/applications but it's still the panel icon.


Running additional binaries in Wine?

I have a Wine app with which I need to launch an additional executable after the main program launches. This is on a Cider installation of an app. It is a simple executable that lives in any folder and simply needs to be executed and run in parallel with the primary application.


kvm usb modem passthrough

I'm trying to set up a USB modem passthrough in kvm virt-manager. The host is Fedora 20. The guest is Centos 6               $ ifconfig     wlp0s29u1u6: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500         ether 00:1a:3f:66:28:92  txqueuelen 1000  (Ethernet)         RX packets 0  bytes 0 (0.0 B)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 0  bytes 0 (0.0 B)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0      The modem works connecting from the host. As bridged networking does not work with wireless I installed this second USB modem. The primary one is PCI. I configured the passthrough in the virt-manager interface but when I try to start the guest I get this error message:               Error starting domain: Cannot set interface MAC on 'wlp0s29u1u6': Device or resource busy          Traceback (most recent call last):       File "/usr/share/virt-manager/virtManager/asyncjob.py", line 91, in cb_wrapper     callback(asyncjob, *args, **kwargs)       File "/usr/share/virt-manager/virtManager/asyncjob.py", line 127, in tmpcb     callback(*args, **kwargs)       File "/usr/share/virt-manager/virtManager/domain.py", line 1260, in startup     self._backend.create()       File "/usr/lib64/python2.7/site-packages/libvirt.py", line 708, in create     if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)     libvirtError: Cannot set interface MAC on 'wlp0s29u1u6': Device or resource busy      I guess I must first detach or unmount the device but how? EDIT               # virsh dumpxml rhel6     <domain type='kvm'>       <name>rhel6</name>       <uuid>23b78cf9-f0a0-4929-adc1-10e285f938fb</uuid>       <title>Centos6</title>       <memory unit='KiB'>4194304</memory>       <currentMemory unit='KiB'>4194304</currentMemory>       <vcpu placement='static'>1</vcpu>       <os>     <type arch='x86_64' machine='pc-i440fx-1.6'>hvm</type>     <boot dev='hd'/>       </os>       <features>     <acpi/>     <apic/>     <pae/>       </features>       <cpu mode='custom' match='exact'>     <model fallback='allow'>SandyBridge</model>     <vendor>Intel</vendor>     <feature policy='require' name='vme'/>     <feature policy='require' name='dtes64'/>     <feature policy='require' name='vmx'/>     <feature policy='require' name='erms'/>     <feature policy='require' name='xtpr'/>     <feature policy='require' name='smep'/>     <feature policy='require' name='pcid'/>     <feature policy='require' name='est'/>     <feature policy='require' name='monitor'/>     <feature policy='require' name='smx'/>     <feature policy='require' name='tm'/>     <feature policy='require' name='acpi'/>     <feature policy='require' name='osxsave'/>     <feature policy='require' name='ht'/>     <feature policy='require' name='pdcm'/>     <feature policy='require' name='fsgsbase'/>     <feature policy='require' name='f16c'/>     <feature policy='require' name='ds'/>     <feature policy='require' name='tm2'/>     <feature policy='require' name='ss'/>     <feature policy='require' name='pbe'/>     <feature policy='require' name='ds_cpl'/>     <feature policy='require' name='rdrand'/>       </cpu>       <clock offset='utc'>     <timer name='rtc' tickpolicy='catchup'/>     <timer name='pit' tickpolicy='delay'/>     <timer name='hpet' present='no'/>       </clock>       <on_poweroff>destroy</on_poweroff>       <on_reboot>restart</on_reboot>       <on_crash>restart</on_crash>       <devices>     <emulator>/usr/bin/qemu-kvm</emulator>     <disk type='file' device='disk'>       <driver name='qemu' type='raw'/>       <source file='/home/cpn/VirtualBox VMs/Centos6/Centos6.raw'/>       <target dev='vda' bus='virtio'/>       <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>     </disk>     <controller type='usb' index='0' model='ich9-ehci1'>       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>     </controller>     <controller type='usb' index='0' model='ich9-uhci1'>       <master startport='0'/>       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>     </controller>     <controller type='usb' index='0' model='ich9-uhci2'>       <master startport='2'/>       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>     </controller>     <controller type='usb' index='0' model='ich9-uhci3'>       <master startport='4'/>       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>     </controller>     <controller type='pci' index='0' model='pci-root'/>     <controller type='virtio-serial' index='0'>       <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>     </controller>     <interface type='network'>       <mac address='52:54:00:a7:f0:d7'/>       <source network='default'/>       <model type='virtio'/>       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>     </interface>     <interface type='direct'>       <mac address='52:54:00:c1:c5:1d'/>       <source dev='wlp0s29u1u6' mode='passthrough'/>       <model type='virtio'/>       <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>     </interface>     <serial type='pty'>       <target port='0'/>     </serial>     <console type='pty'>       <target type='serial' port='0'/>     </console>     <channel type='spicevmc'>       <target type='virtio' name='com.redhat.spice.0'/>       <address type='virtio-serial' controller='0' bus='0' port='1'/>     </channel>     <input type='tablet' bus='usb'/>     <input type='mouse' bus='ps2'/>     <graphics type='spice' autoport='yes'/>     <sound model='ich6'>       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>     </sound>     <video>       <model type='qxl' ram='65536' vram='65536' heads='1'/>       <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>     </video>     <memballoon model='virtio'>       <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>     </memballoon>       </devices>     </domain>


obsoleted package breaks yum install of older JBoss

I need to install an older version of JBoss. 6.1.0 EAP is what has been approved and supported for my application. So when I try to force install the correct version of the jbossas packages the install fails. A number of times in the dependancy resolution stage I get the following error:               Package shrinkwrap is obsoleted by shrinkwrap-impl-base, but obsoleting package does not provide for requirements      Then at the end I get the following error:               Error: Package: jbossas-modules-eap-7.2.0-8.Final_redhat_8.ep6.el6.noarch (jb-eap-6-for-rhel-6-server-rpms)            Requires: shrinkwrap >= 1.0.0            Available: shrinkwrap-1.0.0-14.redhat_1.ep6.el6.noarch (jb-eap-6-for-rhel-6-server-rpms)                shrinkwrap = 1.0.0-14.redhat_1.ep6.el6            Available: shrinkwrap-1.0.0-16.redhat_2.ep6.el6.noarch (jb-eap-6-for-rhel-6-server-rpms)                shrinkwrap = 1.0.0-16.redhat_2.ep6.el6      If I try:               yum install shrinkwrap-1.0.0-16.redhat_2.ep6.el6.noarch      It changes it to `shrinkwrap-impl-base-1.1.2`. So I'm not sure the best way to proceed. Is it possible to force yum to install the 1.0.0 package? If not, is it possible to install `shrinkwrap-impl-base` then install JBoss and ignore only that dependency? (there are several hundred other dependancies so I don't want to ignore all dependancies.) Or is there some other solution? System if RHEL 6.4 with base entitlement and `jb-eap-6-for-rhel-6-server-rpms` channel installed.


Strange behaviour from special keyboard keys

> **OS: Linux Mint 13 Maya - MATE** So, I had a new keyboard through today and there is something strange going on. The following keys are identified as the Shift key. > LEFT SHIFT > > RIGHT SHIFT > > LEFT CONTROL > > RIGHT CONTROL > > WINDOWS KEY ( SUPER ) > > LEFT ALT > > RIGHT ALT That's a lot of keys... So these keys not only do the same as the shift key but they are also identified as the shift key, I mean in Javascript the `event.keyCodes` are all 16 and they are also have identical info and key codes in `xev`. I thought at one point it could be the keyboard, so I tried it in a separate machine running windows 7 and it worked fine. I then thought it was the computer, so I pressed `E` on the GRUB menu screen and the control keys were working fine there so it's got to be something to do with mint, the problem only occurs when mint boots to the login screen everything before that is fine. I'm not sure what the problem is, at first I thought I would be able to do something to manually set the keys, but it turns out they are all identified as the same key so if I change one, then surely they'll all change. In the keyboard settings it's default English (UK) Generic 105-key. (Intl) PC


Using grep to search a file

Re : grep command. I have to search a file for the names of all the students in the school's Linux system. I am able to do this and return about 665 names. (First string of `/etc/passwd` file). From there, I need to sort on the students who's name ends in 'o' and also those who have two or more 'o' in their name. This isn't actually for me -- it is indeed homework but for a friend. I am way past the age of homework :) He has to use grep to get the results. I haven't used grep for years, I played a round a little but can't stay away from using other commands to achieve this. I was just curious to see if someone in the community knew how to do this using grep. For the names in the `/etc/passwd` file ending in letter 'o' :               grep -Eo '^[a-zA-Z0-9._-]+' /etc/passwd | grep -Eo 'o$'      This works but doesn't display the whole name , just the letter 'o' for the one single match to the request in the file. Not sure : 1) how to display the output , ie.. whole name ? 2) how to search for those names with more than one 'o' in their name ? From the `/etc/passwd` file for example.... I want to display the output of all users ending in the letter 'o' in a file I want to display all users that contain more than one letter 'o' in another file


How to add each output of awk

How would you perform addition on the output of every line from awk? For example               cat foo | awk '{print $1}     42     42     42      I'm looking for the answer to 42+42+42 (126). I'm trying to write a for loop to do this, but there must be a simpler way               #Not Working, and way too complex     cat foo |awk  '{ print $1 }'|for i in $1 do; foo=$(( foo+$(i) )) done| echo $foo      I could pipe to `wc -l` but that only prints the number of lines, it does not evaluate them. How can I evaluate each line from awk?


Alsa & JACK - card and device names (different naming conventions)

I am a bit confused about audio device names. If I use command `aplay -l` i get the list of all audio devices on my system:               **** List of PLAYBACK Hardware Devices ****     card 0: NVidia [HDA NVidia], device 0: VT1708S Analog [VT1708S Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: NVidia [HDA NVidia], device 2: VT1708S Alt Analog [VT1708S Alt Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: NVidia [HDA NVidia], device 3: VT1708S Digital [VT1708S Digital]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 3: USB [Scarlett 2i4 USB], device 0: USB Audio [USB Audio]       Subdevices: 1/1       Subdevice #0: subdevice #0      Notice that the order is `card 0`, `card 1`, `card 3` where `card 2` is not listed. This confuses me. I know that every entry here is a single device (not card) so if I am correct (and please confirm or correct me if I am wrong) I would name my soundcard "Scarlet 2i4" like `hd:3,0`? Or is it `hd:2,0` because `card 2` is missing? Now when I open a JACK and want to tweak audio settings, I have different names than ones above. The names are:   * `hw:USB,0`   * `hw:USB`   * `hw:0`   * `plughw:0`   * `/dev/audio`   * `/dev/dsp` Where does a JACK get this device table? What kind of naming convention is this and how can i figure out which device is which (I want JACK to primarly use my "Scarlet 2i4")? Is there any terminal comand which will let me know this? At the moment my `~/.jackrc` settings are like this:               /usr/bin/jackd -nziga-scarlet-2i4 -t2000 -dalsa -dhw:0 -r48000 -p128 -n2


Is the Unix Programmers Manual relevant for Linux?

I've been looking for an all around Linux Programmers manual but there isn't one... So that leads me to ask if the Unix Programmers Manual is relevant for Linux? The manual is here: http://cm.bell-labs.com/7thEdMan/v7vol1.pdf


How can I use sed to only print what appears between these two strings?

How can I use sed to only post what appears between iterations of:                   "<title><![DATA["      and                    ]]></title>      I tried doing                    sed 's/<title><![DATA[/(.*)/]]//g'      but it just prints the whole file


Bluetooth profile info in linux

As Bluetooth device has a number of Bluetooth profiles. when want to do communication is Bluetooth device, first pair Bluetooth device and then starts sending data using Bluetooth. In Linux, `hcitool` is used to scan nearby Bluetooth devices. Questions:   1) How can I know which Bluetooth profile is supported by selected nearby Bluetooth device?Is there any particular command to know Bluetooth profile supported by selected nearby Bluetooth device in Linux? 2) suppose, I come to know selected nearby Bluetooth device support abcd and xyz Bluetooth profiles. How can i select particular Bluetooth profile in Linux?, example abcd out of supported profiles. 2) How can I connect to that selected Bluetooth device as SPP profile for transferring data as serial port in linux? May be its is related to How do I connect and send data to a bluetooth serial port on Linux?. That is using `sdptool`, but how can I `sdptool` is supported by the device.


Can I install a sync completion hook with rsync daemon?

Like hooks in svn or git, can I install a server-side hook script for rsync daemon? For sync completion event. I am using FreeBSD9/rsyncd.


How to add words to an existing column

I have a tab delimited file with 10 columns and in one of the columns (with about 40 million rows), I would like to add a word before the existing entry in each row (same word in each row!) and a `;` after the entry. e.g. two rows before               1 2 3 4 5 6 7 8 text still more text in this column 10     1 2 3 4 5 6 7 8 text2 still more text in this column 10      to               1 2 3 4 5 6 7 8 test=text; still more text in this column 10     1 2 3 4 5 6 7 8 test=text2; still more text in this column 10      At the end of the day it's the basic "concatenate" function in excel, but I can't use excel for such large files and also need to move to linux anyways. I looked into concatenate questions here on the forum but I only found topics dealing with merging two strings, eg.               foo="Hello"     foo="$foo World"     echo $foo        but not using variables.


What information is stored on the gap before the first partition?

Partitioning tools(for example `fdisk`) tend to leave a 2047 sector(LBA 1-2047, 1048064 bytes) between the MBR and first partition. On LBA 0 there is a MBR and from LBA 2048 starts the first partition. GRUB should keep it's stage 1.5 data in this gap and Linux software-RAID should keep it's superblock in this area at least in case of some superblock versions(e.g. version 1.2), but what else may be stored on this gap? Is this area used for anything else?


Changing default permissions for wget?

I'm using a PHP script to call `shell_exec` and execute wget to download some files to `/var/www/dir/`. (Internal tool, so security isn't much of an issue) The directory has 777 permissions. But when I run wget, all of the files are 644 by default. Ideally I would like 665 for group write access, for group `www-data`. How do I set the permissions for wget downloaded files? I don't want to run `chmod -R` after every call.


Download copy of file which updates on change

Sorry about the title, I didn't know how to write it - It's kind of confusing. Ok, I am using my Raspberry Pi (Debian) and I store code on this server in which people have access to. My problem at the moment is, I can open the file using SSH and then compile and run the code on the Pi but this is very slow. What I want to do: I want it so I can make changes of the file(s) on my computer and this updates with the files on the server and I can then compile the code on my machine AND I do not have to keep pushing the files back onto the file server. I hope this makes sense. Any ideas?


Add ipv4 support to CentOS 6.3

I've installed two identical versions of CentOS using VirtualBox. The first instance works fine and has ipv4 configuration automatically working, but the second instance doesn't; it only comes with ipv6 and no ipv4. How can I manually add ipv4 support?


How do I use wget with a list of URLs and their corresponding output files?

Suppose `list_of_urls` looks like this:               http://www.url1.com/some.txt     http://www.url2.com/video.mp4      I know how to use that with:               wget -i list_of_urls      But, what if my `list_of_urls` has this, and they all return proper files like PDF's or videos:               http://www.url1.com/app?q=123&gibb=erish&gar=ble     http://www.url2.com/app?q=111&wha=tcha&mac=allit      For a single file I could do this:               wget -O some.txt "http://www.url1.com/app?q=123&gibb=erish&gar=ble"      How do I use `wget` to download that list of URLs and save the returned data to the proper local file?


What features are in zsh and missing from bash, or vice versa?

As a Linux user, I've always just used bash because it was the default on every distro I used. People using other Unix systems such as BSD seem to use other shells far more frequently. In the interests of learning a bit more, I've decided to try out zsh. As a bash user:   * What features will I miss?   * And what ones should I look out for?


Extract code excerts from markdown file

I have a pandoc markdown file which has a lot of code. I want to extract all the code bits from file preferably using `sed`. The syntax of code in pandoc is three or more ``` signs to start and finish the code segment. ````` `Code is here` ````` I can extract one line but I have no way of extracting _between markers_.


Linux doesn't boot after update-grub

I had a problem with my HDMI without sound and I found this fix.               Edit /etc/default/grub and change this line:          GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"          to this line          GRUB_CMDLINE_LINUX_DEFAULT="quiet splash radeon.audio=1"          Now run "sudo update-grub", then reboot your computer.      Now, the boot stuck in a file systems check. Each time it's stucked in a different message. Sometimes, about bluetooth, others for network monitor etc. I cannot open Linux from recovery and from older versions, each one stuck in a black screen. I cannot access my pc and if I will not find a sollution soon, I will turn to a clean install with losing all my data :(


How can I pass argument stored on a variable to WGET

I'm writing a bash script that extensively uses wget. To define all common parameters in one place I store them on variables. Here's a piece of code:               useragent='--user-agent="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0"'     cookies_file="/tmp/wget-cookies.txt"     save_cookies_cmd="--save-cookies $cookies_file --keep-session-cookies"     load_cookies_cmd="--load-cookies $cookies_file --keep-session-cookies"          function mywget {         log "#!!!!!!!!!# WGET #!!!!!!!!!# wget $quiet $useragent $load_cookies_cmd $@"           wget $useragent $load_cookies_cmd "$@"     }      Saddly isn't working. Somehow I'm missing the right way to store parameters on variables $useragent, $save_cookies_cmd, $load_cookies_cmd and caling wget passing these vars as parameters. I want the result commandline as this:               wget --user-agent="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0" --load-cookies /tmp/wget-cookies.txt --keep-session-cookies http://mysite.local/myfile.php      * * * **EDIT:** My final solution: In the end my script is correctly working with this:               useragent="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0"     useragent_cmd="--user-agent=$useragent"     cookies_file="/tmp/wget-cookies.txt"     save_cookies_cmd="--save-cookies $cookies_file --keep-session-cookies"     load_cookies_cmd="--load-cookies $cookies_file --keep-session-cookies"          function mywget {         log "#!!!!!!!!!# WGET #!!!!!!!!!# wget $load_cookies_cmd $useragent_cmd $@"           wget $load_cookies_cmd "$useragent_cmd" "$@"     }      Thanks for all your responses.


How can I set up environmental variables for www-data?

I asked a question on dba.se about how I can give my Perl CGI script the password it needs to access the MySQL database it needs to query. I have received only one answer but that one suggests I save the password as an environmental variable. OK, `apache2` runs as `www-data` and according to `/etc/passwd`, the user's `$HOME` is `/var/www`:               $ grep www /etc/passwd     www-data:x:33:33:www-data:/var/www:/bin/sh      I tried creating `/var/www/.profile` with this line               export db_pass="password"      And then had my Perl script print `$ENV{"db_pass"}` but that failed, the variable is empty. I checked with `$ENV{PATH}` and that was printed as expected. So, how can I set an arbitrary environmental variable for this user? The server is an Ubuntu Server running on a VM (which runs on Windows, not my choice, don't ask).               $ apache2 -version     Server version: Apache/2.2.14 (Ubuntu)     Server built:   Feb 14 2012 16:42:25


Ubuntu 13.10 installing libcurl gives conflict - but 7.32.0-1ubuntu1.2 is to be installed

I'm not sure what the problem is here. I've googled around for this issue but couldn't find anything. Only thing I did was install a new postgres and I made following change:               sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"     wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -     sudo apt-get update     sudo apt-get install postgresql-common -t saucy     sudo apt-get install postgresql-9.2 libpq-dev      After I wanted to install libcurl openssl and gnutls dev and got:               me@kippeke:~$ sudo apt-get install libcurl4-openssl-dev libcurl4-gnutls-dev     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:     libcurl4-gnutls-dev : Conflicts: libcurl4-openssl-dev but 7.32.0-1ubuntu1.2 is to be     installed     libcurl4-openssl-dev : Conflicts: libcurl4-gnutls-dev but 7.32.0-1ubuntu1.2 is to be  installed     E: Unable to correct problems, you have held broken packages.     me@kippeke:~$ uname -a     Linux kippeke 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux     me@kippeke:~$      Can't answer my own question until after 8 hours I posted it because my reputation is to low. But I know the answer: Don't mind the idiot who can't understand the error message :) I can install libcurl4-openssl-dev or libcurl4-gnutls-dev and not both. That's the conflict...


I disabled Compiz and the title bar on every windows is missing now

I am on Linux Mint 15 (Mate). I installed Compiz following the steps in this tutorial. Then due to some problems I faced, I decided to disable it. So I executed the following command:               metacity --replace      Then removed `compiz --replace` from the Startup Applications and reverted `org > mate > desktop > session > required-components > windowmanager` back to `marco`. After logging out and logging in again, I realized that none of my windows have any title bar. What should I do? ![enter image description here](http://i.stack.imgur.com/VNjQ6.png) p.s. When I click the `show desktop` icon, the following error appears: ![enter image description here](http://i.stack.imgur.com/lTdAM.png)


Delete files specified by the output of find: rm thinks argument list is too long.

When I run the following command, it gives me an error:               $ rm -f `find /home/domain/imap/domain.com/*/Maildir -mtime +190 | grep -E '/cur/|/new/'`     -bash: /bin/rm: Argument list too long      How can I run it without the error? (Or how can I put it in `.sh`?)


proftpd via mysql & web management of FTP users

I have installed prftpd and proftpd-mysql rpm on a linux machine. Intention is to have usermanagement of ftpusers via web. So I have installed proftpadmin from Here Now when I am adding the below lines in /etc/proftpd.conf file               SQLConnectInfo                  proftpd@localhost root root      SQLAuthenticate                 users   groups      SQLAuthTypes                    Crypt   Backend      SQLUserInfo                     users userid passwd uid gid homedir shell      SQLGroupInfo                    groups groupid gid members           SQLLog                          PASS logincount      SQLNamedQuery                   logincount UPDATE "login_count=login_count+1 WHERE userid='%u'" users      SQLLog                          PASS lastlogin      SQLNamedQuery                   lastlogin UPDATE "last_login=now() WHERE userid='%u'" users      SQLLog RETR                     dlbytescount      SQLNamedQuery                   dlbytescount UPDATE "dl_bytes=dl_bytes+%b WHERE userid='%u'" users      SQLLog RETR                     dlcount      SQLNamedQuery                   dlcount UPDATE "dl_count=dl_count+1 WHERE userid='%u'" users      SQLLog STOR                     ulbytescount      SQLNamedQuery                   ulbytescount UPDATE "ul_bytes=ul_bytes+%b WHERE userid='%u'" users      SQLLog STOR                     ulcount      SQLNamedQuery                   ulcount UPDATE "ul_count=ul_count+1 WHERE userid='%u'" users      SQLUserWhereClause              "disabled!=1"      service proftpd start fails . If I remove those lines service starts, I cannot manage users via mysql, as above lines are mendatory. Can anyone please suggest where I am going wrong Please find my below /etc/proftpd.conf file               # This is the ProFTPD configuration file     # $Id: proftpd.conf,v 1.1 2004/02/26 17:54:30 thias Exp $          ServerName                      "ProFTPD server"     ServerIdent                     on "FTP Server ready."     ServerAdmin                     root@localhost     ServerType                      standalone     #ServerType                     inetd     DefaultServer                   on     AccessGrantMsg                  "User %u logged in."     #DisplayConnect                 /etc/ftpissue     #DisplayLogin                   /etc/ftpmotd     #DisplayGoAway                  /etc/ftpgoaway     DeferWelcome                    off          # Use this to excude users from the chroot     DefaultRoot                     ~ !adm          # Use pam to authenticate (default) and be authoritative     #AuthPAMConfig                  proftpd     AuthOrder                       mod_auth_pam.c* mod_auth_unix.c          # Do not perform ident nor DNS lookups (hangs when the port is filtered)     IdentLookups                    off     UseReverseDNS                   off          # Port 21 is the standard FTP port.     Port                            21          # Umask 022 is a good standard umask to prevent new dirs and files     # from being group and world writable.     Umask                           022          # Default to show dot files in directory listings     ListOptions                     "-a"          # See Configuration.html for these (here are the default values)     #MultilineRFC2228               off     #RootLogin                      off     #LoginPasswordPrompt            on     #MaxLoginAttempts               3     #MaxClientsPerHost              none     #AllowForeignAddress            off     # For FXP          # Allow to resume not only the downloads but the uploads too     AllowRetrieveRestart            on     AllowStoreRestart               on          # To prevent DoS attacks, set the maximum number of child processes     # to 30.  If you need to allow more than 30 concurrent connections     # at once, simply increase this value.  Note that this ONLY works     # in standalone mode, in inetd mode you should use an inetd server     # that allows you to limit maximum number of processes per service     # (such as xinetd)     MaxInstances                    20          # Set the user and group that the server normally runs at.     User                            nobody     Group                           nobody          # Disable sendfile by default since it breaks displaying the download speeds in     # ftptop and ftpwho     UseSendfile                     no          # This is where we want to put the pid file     ScoreboardFile                  /var/run/proftpd.score          # Normally, we want users to do a few things.     <Global>       AllowOverwrite                yes       <Limit ALL SITE_CHMOD>         AllowAll       </Limit>     </Global>          # Define the log formats     LogFormat                       default "%h %l %u %t \"%r\" %s %b"     LogFormat                       auth    "%v [%P] %h %t \"%r\" %s"          # TLS     # Explained at http://www.castaglia.org/proftpd/modules/mod_tls.html     #TLSEngine                      on     #TLSRequired                    on     #TLSRSACertificateFile          /etc/pki/tls/certs/proftpd.pem     #TLSRSACertificateKeyFile       /etc/pki/tls/certs/proftpd.pem     #TLSCipherSuite                 ALL:!ADH:!DES     #TLSOptions                     NoCertRequest     #TLSVerifyClient                off     ##TLSRenegotiate                ctrl 3600 data 512000 required off timeout 300     #TLSLog                         /var/log/proftpd/tls.log          # SQL authentication Dynamic Shared Object (DSO) loading     # See README.DSO and howto/DSO.html for more details.     #<IfModule mod_dso.c>     #   LoadModule mod_sql.c     #   LoadModule mod_sql_mysql.c     #   LoadModule mod_sql_postgres.c     #</IfModule>          # A basic anonymous configuration, with an upload directory.     #<Anonymous ~ftp>     #  User                         ftp     #  Group                                ftp     #  AccessGrantMsg               "Anonymous login ok, restrictions apply."     #     #  # We want clients to be able to login with "anonymous" as well as "ftp"     #  UserAlias                    anonymous ftp     #     #  # Limit the maximum number of anonymous logins     #  MaxClients                   10 "Sorry, max %m users -- try again later"     #     #  # Put the user into /pub right after login     #  #DefaultChdir                        /pub     #     #  # We want 'welcome.msg' displayed at login, '.message' displayed in     #  # each newly chdired directory and tell users to read README* files.     #  DisplayLogin                 /welcome.msg     #  DisplayFirstChdir            .message     #  DisplayReadme                        README*     #     #  # Some more cosmetic and not vital stuff     #  DirFakeUser                  on ftp     #  DirFakeGroup                 on ftp     #     #  # Limit WRITE everywhere in the anonymous chroot     #  <Limit WRITE SITE_CHMOD>     #    DenyAll     #  </Limit>     #     #  # An upload directory that allows storing files but not retrieving     #  # or creating directories.     #  <Directory uploads/*>     #    AllowOverwrite             no     #    <Limit READ>     #      DenyAll     #    </Limit>     #     #    <Limit STOR>     #      AllowAll     #    </Limit>     #  </Directory>     #     #  # Don't write anonymous accesses to the system wtmp file (good idea!)     #  WtmpLog                      off     #     #  # Logging for the anonymous transfers     #  ExtendedLog          /var/log/proftpd/access.log WRITE,READ default     #  ExtendedLog          /var/log/proftpd/auth.log AUTH auth     #     #</Anonymous>          SQLConnectInfo                  proftpd@localhost root root      SQLAuthenticate                 users   groups      SQLAuthTypes                    Crypt   Backend      SQLUserInfo                     users userid passwd uid gid homedir shell      SQLGroupInfo                    groups groupid gid members           SQLLog                          PASS logincount      SQLNamedQuery                   logincount UPDATE "login_count=login_count+1 WHERE           userid='%u'" users      SQLLog                          PASS lastlogin      SQLNamedQuery                   lastlogin UPDATE "last_login=now() WHERE userid='%u'"           users      SQLLog RETR                     dlbytescount      SQLNamedQuery                   dlbytescount UPDATE "dl_bytes=dl_bytes+%b WHERE           userid='%u'" users      SQLLog RETR                     dlcount      SQLNamedQuery                   dlcount UPDATE "dl_count=dl_count+1 WHERE userid='%u'"           users      SQLLog STOR                     ulbytescount      SQLNamedQuery                   ulbytescount UPDATE "ul_bytes=ul_bytes+%b WHERE           userid='%u'" users      SQLLog STOR                     ulcount      SQLNamedQuery                   ulcount UPDATE "ul_count=ul_count+1 WHERE userid='%u'"           users      SQLUserWhereClause              "disabled!=1"      SQL Script looks as below which is updated on respective Database               #     # Table structure for table `groups`     #          CREATE TABLE `groups` (       `groupid` varchar(10) NOT NULL default '',       `gid` int(10) unsigned NOT NULL auto_increment,       `members` varchar(255) NOT NULL default '',       PRIMARY KEY  (`gid`)     ) TYPE=InnoDB ;          #     # Table structure for table `users`     #          CREATE TABLE `users` (       `id` smallint(2) NOT NULL auto_increment,       `userid` varchar(10) NOT NULL default '',       `uid` int(10) unsigned NOT NULL default '',       `gid` int(10) unsigned NOT NULL default '',       `passwd` varchar(255) NOT NULL default '',       `homedir` varchar(255) NOT NULL default '',       `comment` varchar(255) NOT NULL default '',       `disabled` int(10) unsigned NOT NULL default '0',       `shell` varchar(20) NOT NULL default '/sbin/nologin',       `email` varchar(255) NOT NULL default '',       `name` varchar(255) NOT NULL default '',       `ul_bytes` bigint(20) NOT NULL default '0',       `dl_bytes` bigint(20) NOT NULL default '0',       `login_count` bigint(20) NOT NULL default '0',       `dl_count` bigint(20) NOT NULL default '0',       `ul_count` bigint(20) NOT NULL default '0',       `last_login` datetime default NULL,       PRIMARY KEY  (`id`)     ) TYPE=InnoDB ;


My local DNS don't resolv specific hostnames IP's

I've been trying to accomplish a DNS set up on my local machine using Linux and CentOS. I've been following couple of tutorials and eventually everything seemed to work but when surfing to my example website I realized it didn't... This is what I've done after installing bind. **named.conf:**                  zone "ims.be" IN {                 type master;                 file "example.com.zone";                 allow-update { none; };         };      **example.com.zone:**               $TTL 86400     @    IN    SOA    localhost.    root.localhost. (                 42 ; serial                 3600      ; refresh after 6 hours                 900       ; retry after 1 hour                 1W     ; expire after 1 week                 1D )    ; minimum TTL of 1 day          @       NS      localhost.             A       192.168.0.***     www     A       192.168.0.***     ftp     CNAME   www      **example.conf**               <VirtualHost *:80>         ServerAdmin webmaster@example.com         DocumentRoot /home/ims.be/         ServerName ims.be         ServerAlias www.ims.be         ErrorLog logs/ims.be-error_log         CustomLog logs/ims.be-access_log common     </VirtualHost>      I am able to ping, dig and nslookup to my example website called ims.be. **PING** ![PING](http://i.stack.imgur.com/o3qg0.jpg) **DIG** ![DIG](http://i.stack.imgur.com/nONzD.jpg) **NSLOOKUP** ![NSLOOKUP](http://i.stack.imgur.com/Na5IT.jpg) **NAMESERVERS** ![enter image description here](http://i.stack.imgur.com/PsuJl.jpg) But when surfing to ims.be or www.ims.be using Chrome/Firefox/IE/Safari I get an error that the webpage is not available... However when I surf to my IP address this displays the page ims.be like it should. I'm working on a Windows 7 using CentOS to access Linux. I discovered that I'm able to ping etc to ims.be from my Linux but when I'm in command line in Windows I'm unable to ping/nslookup/... ims.be: > Ping request could not find host ims.be I thought I had to change settings in Windows to get this done but nothing changed just yet... What I've done: ![enter image description here](http://i.stack.imgur.com/BjpmR.jpg) ![enter image description here](http://i.stack.imgur.com/as1td.jpg)


Why does octave give different results for 9 ^ 1/2 and 9 ^ 0.5?

Lately I've been trying to brush up on the math I should have learned in high school. (I didn't pay much attention.) Regarding this, college entrance exams and `octave` make a great pair. This morning I got to fractional powers. And `octave` had something surprising in store:               octave:41> (9 ^ 1/2)     ans =  4.5000     octave:42> (9 ^ .5)     ans =  3     octave:43> (9 ^ 0.5)     ans =  3      Maybe I dozed off when we covered this in high school, but no... According to this website, > By the way, some decimal powers can be written as fractional exponents, too. > If you are given something like "35.5", recall that 5.5 = 11/2, so: > > 3 ^ 5.5 = 3 ^ 11/2 So evidently there's some reason why `octave` evaluates these two expressions differently... Why does `octave` evaluate fractional powers differently? Is this a non- feature, or is there a good reason why it should?


OpenVswitch in Linux kernel configuration

There's a kernel configuration variable _Open vSwitch (CONFIG_OPENVSWITCH)_. This enables openVswitch support inside the kernel, but still to use it, we need a userspace daemon. My question is, what libraries and/or structures are to be used from Linux to make use of this feature if I want to write a process of my own? ( _Like we use route.h for normal routing daemons in_ **_C_** ) Any link to a tutorial and/or example code will be appreciated.


Why is this binary file being changed?

I am trying to copy files over SSH, but cannot use `scp` due to not knowing the exact filename that I need. Although small binary files and text files transfer fine, large binary files get altered. Here is the file on the server:               remote$ ls -la     -rw-rw-r--  1 user user 244970907 Aug 24 11:11 foo.gz     remote$ md5sum foo.gz      9b5a44dad9d129bab52cbc6d806e7fda foo.gz      Here is the file after I've moved it over:               local$ time ssh me@server.com -t 'cat /path/to/foo.gz' > latest.gz          real    1m52.098s     user    0m2.608s     sys     0m4.370s     local$ md5sum latest.gz     76fae9d6a4711bad1560092b539d034b  latest.gz          local$ ls -la     -rw-rw-r--  1 dotancohen dotancohen 245849912 Aug 24 18:26 latest.gz      Note that the downloaded file is **bigger** than the one on the server! However, if I do the same with a very small file, then everything works as expected:               remote$ echo "Hello" | gzip -c > hello.txt.gz     remote$ md5sum hello.txt.gz     08bf5080733d46a47d339520176b9211  hello.txt.gz          local$ time ssh me@server.com -t 'cat /path/to/hello.txt.gz' > hi.txt.gz      real 0m3.041s user 0m0.013s sys 0m0.005s               local$ md5sum hi.txt.gz     08bf5080733d46a47d339520176b9211  hi.txt.gz      Both file sizes are 26 bytes in this case. **Why might small files transfer fine, but large files get some bytes added to them?**


Syntax error near unexpected token `('

When I use below code in SSH terminal for CentOS it works fine:               paste <(printf "%s\n" "TOP")      But if I place the same line code in a shell script (test.sh) and run shell script from terminal, it throws error as this               ./test.sh: line 30: syntax error near unexpected token ('        ./test.sh: line 30:     paste <(printf "%s\n" "TOP")      How can I fix this problem?


Using sed to replace only the first two regex catches with different strings

So I'm trying to change two instances of a regex pattern to two different strings with sed like:               sed -E "s/\\t([A-Za-z]|[-])+$/\\t`get_addr.py -1`/" /path/to/file.ext     sed -E "s/\\t([A-Za-z]|[-])+$/\\t`get_addr.py -2`/" /path/to/file.ext      I've tried a lot of things, and done a solid amount of manpage scouring, but I just can't quite figure out how make it happen. Is there a way I can tell sed to replace each match with a different string with something like               sed -E "s/\\t([A-Za-z]|[-])+$/[1st replacement],[2nd replacement]/" /path/to/file.ext      and/or is there a way I can specify in the regex that I'm looking for the nth match, so that I can just call sed twice?