Wifi card not detected - Archlinux

I've recently installed Archlinux on my Asus N76V Notebook but the system doesn't seem to detect my wifi card. It is not listed in any of the normal detection commands : lspci               00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)     00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09)     00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)     00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)     00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)     00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)     00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)     00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)     00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)     00:1c.3 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 4 (rev c4)     00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)     00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04)     00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)     00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)     01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 630M] (rev a1)     04:00.0 Ethernet controller: Qualcomm Atheros AR8161 Gigabit Ethernet (rev 08)      lsusb               Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 004: ID 1bcf:2883 Sunplus Innovation Technology Inc.      Bus 003 Device 003: ID 8087:07da Intel Corp.      Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub     Bus 001 Device 003: ID 046d:c52f Logitech, Inc. Unifying Receiver     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub      The interface for wifi is not installed : ip link               1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     2: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000         link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff      How can I identify the wireless device and install the appropriate driver? I use Archlinux, up-to-date, with kernel 3.14.2.


If I sudo execute a Bash script file, will all commands inside the Bash script be executed as sudo as well?

I want to write an automated post-installation script in Bash (called `post- install.sh`, for instance). The script will automatically add and update repositories, install and update packages, edit config files, etc. Now, if I execute this script, for instance with `sudo post-install.sh`, will I only be prompted for a `sudo` password once, or will I need to enter the `sudo` password on each invocation of a command inside the script, that needs `sudo` permission? In other words, do the commands inside the bash script 'inherit' the execution permissions, so to speak? And, if they indeed _do_ , is there still a possibility that the `sudo` permissions will time out (if, for instance, a particular command takes long enough to exceed the `sudo` timeout)? Or will the initial `sudo` password entrance last for the complete duration of whole script?


Mass .flac --> .mp3 transcoding: How to write a shell script that preserves ID3 tag information?

In recent weeks I've gone from a fairly 'hands-on' approach to .flac --> .mp3 transcoding, to one that's far more 'set & forget'. The first step was to stop using a GUI front end (Audacity with a LAME plug- in) and instead use the method I outlined here. The second step was to find a bash shell script that would tell that command loop to work recursively, allowing directories with many subdirectories containing .flac files to be transcoded in one simple step. That answer was provided by a user at askubuntu.com. Now I wish to learn how to further refine things so that ID3 tag information is preserved. The methods linked to above strip ID3 tag data, leaving the bare minimum (i.e. only the title field remains). Can anyone teach me how to write such a shell script? Many thanks in advance. * * * The shell script has been updated thus:               #!/bin/bash     file="$1"     flac -cd "$file" | lame --preset fast extreme - "${file%.flac}.mp3"     id3cp "$file" "${file%.flac}.mp3"      Doing `find . -name '*.flac' -exec ~/bin/flac2mp3 '{}' \;` in ~/Desktop/stack gives the following output:               01 - Amon Tobin - Chomp Samba.flac: done              LAME 3.98.4 64bits (http://www.mp3dev.org/)     Using polyphase lowpass filter, transition band: 19383 Hz - 19916 Hz     Encoding <stdin> to ./01 - Amon Tobin - Chomp Samba.mp3     Encoding as 44.1 kHz j-stereo MPEG-1 Layer III VBR(q=0)     Parsing ./01 - Amon Tobin - Chomp Samba.flac: done.  Copying to ./01 - Amon Tobin - Chomp Samba.mp3: done      `id3info` for the original .flac and resultant .mp3 gives, respectively:               *** Tag information for 01 - Amon Tobin - Chomp Samba.flac      (i.e. nothing);               *** Tag information for 01 - Amon Tobin - Chomp Samba.mp3     *** mp3 info     MPEG1/layer III     Bitrate: 128KBps     Frequency: 44KHz      The .flac definitely has tag information. I can verify this by opening up EasyTAG. EasyTAG refers to this as 'FLAC Vorbis Tag' but 'ID3 Tag' for the .mp3. Is this the problem?


Keep newlines in output of cut

Let's imagine we have a file:               foo bar     foo1 bar1      I want to cut every second word in every line, so I want file to look like this:               foo     foo1      I am trying to use `cut -d ' ' -f -1` but what I get is:               foo foo1      How can i preserve line endings in the file?


Switching on numlock by default in Linux Mint

Whenever I boot in to Linux Mint the NumLock is switched off by default. As my username consists of some numbers, I need to switch on NumLock each time. I want it to be switched on by default each time I log in. I had a look at the following question but could not find the `conf` file that the author is talking about: Enable num-lock as default in Linux I dual boot with Windows XP and Linux Mint 14 Mate using the default US Keyboard Layout.


How to recover my directory structure and files from a messed-up partition

Something strange (don't ask) happened on my external hard-drive, resulting in (important) data being unreachable... I am failing to mount it. That data was sitting on a vfat filesystem. I can get much of it with one tool, foremost. It sorts it into directories by file type, but I need the data intact in its original directory structure. Also, this tool gives the resulting files some random names, and is limited to a set number of file types. It appears to me that the partition table is damaged (not sure), and I don't know how to fix it. Here's the output of **`gpart`** for the whole drive:               # gpart -vd /dev/sdb          dev(/dev/sdb) mss(512) chs(121601/255/63)(LBA) #s(1953520065) size(953867mb)     Primary partition(1)        type: 000(0x00)(unused)        size: 0mb #s(0) s(0-0)        chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r        hex:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00          Primary partition(2)        type: 000(0x00)(unused)        size: 0mb #s(0) s(0-0)        chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r        hex:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00          Primary partition(3)        type: 131(0x83)(Linux ext2 filesystem)        size: 947827mb #s(1941150015) s(12370050-1953520064)        chs:  (770/0/1)-(1023/254/63)d (770/0/1)-(121600/254/63)r        hex:  00 00 C1 02 83 FE FF FF 82 C0 BC 00 3F 99 B3 73          Primary partition(4)        type: 000(0x00)(unused)        size: 0mb #s(0) s(0-0)        chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r        hex:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00      The one parition I'm interested in is one that's claimed to be **Linux ext2 filesystem**. That can't be accurate from my knowledge (it was vfat, but it could also have been NTFS, who knows). It also, that can't be accurate, according to another output of **`gpart`** (should I trust it?), this time specifying just that partition:               # gpart -vd /dev/sdb3          dev(/dev/sdb3) mss(512) chs(120831/255/63)(LBA) #s(1941150015) size(947827mb)          * Warning: strange partition table magic 0x606B.     Primary partition(1)        type: 031(0x1F)(UNKNOWN)        size: 522639mb #s(1070366139) s(4182104394-5252470532)        chs:  (961/156/44)-(97/173/28)d (260323/244/28)-(59601/209/5)r        hex:  F7 9C EC C1 1F AD 1C 61 4A D9 45 F9 BB 7D CC 3F          Primary partition(2)        type: 249(0xF9)(UNKNOWN)        size: 47812mb #s(97919955) s(4081875516-4179795470)        chs:  (993/11/62)-(249/64/22)d (254084/254/55)-(260180/59/54)r        hex:  D4 0B FE E1 F9 40 16 F9 3C 7A 4C F3 D3 23 D6 05          Primary partition(3)        type: 211(0xD3)(UNKNOWN)        size: 711401mb #s(1456950127) s(4249722057-5706672183)        chs:  (671/191/48)-(644/231/52)d (264532/245/43)-(87874/144/6)r        hex:  63 BF B0 9F D3 E7 B4 84 C9 9C 4D FD 6F 4B D7 56          Primary partition(4)        type: 089(0x59)(UNKNOWN)        size: 715318mb #s(1464971513) s(1293543745-2758515257)        chs:  (1003/227/11)-(789/19/55)d (80519/95/26)-(171709/161/30)r        hex:  43 E3 CB EB 59 13 F7 15 41 E9 19 4D F9 B0 51 57


Is it possible to record audio directly to a computer's optical drive?

There's a question over at audio.SE at the moment and I thought it may attract some answers here. I asked the user and he's happy to have it posted here to see if anyone has some ideas. Here it is verbatim: * * * I'm working with a client who needs to minimize the time between when recording is done and when the finalized audio CD ejects from the drive. All of the computer recording software I'm aware of will generate a file which can then be burned to an Audio CD. I know there is external hardware I could buy that would burn an analog stream directly to disc, but I'm wondering if any software exists that can achieve this with a computer's internal optical drive. Ideally for Mac, though if it only exists for Windows or Linux I would be interested to hear about it. (Other alternatives have been explored; I would much rather not deal with optical media at all, but this is a highly specialized situation.) * * * As to the source: "It would likely be an external USB audio interface." If you need more info let me know.


Rip an audio CD 1:1

Is there a way to rip an audio CD to an ISO9660 file? I've tried simple things like `dd` in the past and it hasn't worked. I'd like to essentially have a mirror image of exactly what's on the disk, not even necessarily a folder of WAV files. I do understand that I could rip the CD to WAV files or even FLAC files, but is there a way to just duplicate the disc to one file, so I could extract WAVs or FLACs from it later on? The idea is to be able to make a virtually identical copy of the source media.


Why doesn't this variable assignment work when using tee?

Consider:               $ FILE_NAME=`(cat somefile | head -1)` | tee -a dump.txt     $ echo $FILE_NAME          $         1. Now, why doesn't the output of `(cat somefile | head -1)` reach the standard input of tee ..?    2. If the output reached tee, then it could copy it to dump.txt file and the standard output.    3. Also the variable `$FILE_NAME` does not receive the value.


How to reset a shell environment?

This issue has been bugging me for a while, and although I've taught I've found my answer through EnvWatcher, unfortunately it only works on Bash. And I use zsh. I would like to replicate the things env-watcher does, to a lesser degree maybe, but I need to know if there is a command by which I could reset a shell to it's clean startup stage. As for example, I'd like to have the following workflow.               source some-functions     alias another-thing     export SVN_EDITOR=vim     RESET-ZSH # none of the above are valid any more      Is there such a built in possibility, or am I chasing butterflies?


How exactly do I create a sed script and use it to edit a file?

I know how to edit a file using sed one step at a time, but how would I create an actual sed script and then use it on the file to do the same things that the individual sed commands would do? For example these 3 sed commands: > sed -i '4i\ ' baconFile > > sed -i 's/,/\t\t/' baconFile > > sed -i 's/,/ /' baconFile


Audio quality issues with mpd

I have been using mpd for a long time now and absolutely love it.   However, I recently added a few video files to the mpd database. Now I understand mpd won't play the video files, I don't want it to. But when mpd plays the audio track of the video file, there is a lot of static noise in the output. My other audio files work perfectly with mpd. As do these video files in other players like mplayer and vlc.   This leads me to conclude that the audio track on these videos is not of bad quality. There is something wrong in the way mpd handles them. Can anyone suggest what might be wrong and how I can resolve it?   Yes, I know I could rip the audio tracks out of my video files and play them using mpd, but I would rather fix this issue with mpd than do that. Just a matter of choice.


What driver is behind a certain device file?

Given a device file, say `/dev/sdb`, is it possible to determine what driver is behind it? Specifically, I want to determine what driver my storage devices are using. `fdisk -l` lists 2 devices: `/dev/sda` and `/dev/sdb`. One is a SATA hard drive and the other is a USB Mass Storage device - actually an SD card. How do I determine, programmatically, which is which? I am writing a piece of software, and I want to protect the beginner from obliterating their hard drives, whilst allowing them to obliterate their SD cards.


Grub fails after install it on my macbook pro

I'm trying to install Archlinux on my macbook in dual boot mode. I part the disk that way :               /dev/sda1 -> EFI     /dev/sda2 ->MacOS     /dev/sda3 -> /boot     /dev/sda4 -> /     /dev/sda5 -> /home      As i read in the docs i don't install grub on my MBR, i put it in sda3 - the boot partition. I did it with a Ubuntu Live Cd and the command : sudo grub- install --boot-directory=/media/boot_partition /dev/sda3 --force When i reboot my mac i can choose the Linux partition with rEFIT. But it only show the GRUB minimal bash...               grub>      I tried to fix it up, but nothing really works.


More Information Regarding Upload Restriction in Squid Server

I've used `request_body_max_size 1024 KB` command in my `squid.conf` file and it is working in restricting my upload of files larger than 1 MB when I try to upload through upload sites. But I want to know why I am able to upload larger files to sendspace and wetransfer uploading site? Is there any way to customize uploading in `squid` server 3.1, so that if I want to upload bigger files larger than 1 MB, a screen of username and password will appear and when I enter correct username and password I can upload larger size files?


What are the disadvantages of uClibc?

I try to speed up my boot sequence, and somebody recommends to use the uClibc instead of Glibc. I've built an image with it, it gets smaller and faster to boot — but at which cost? Does anyone know the disadvantages of using uClibc as the C library?


Apache authentication mutiple domain but same subdirectory

I've got several sites: example.com, example1.com, and example2.com in my wordpress. All of them point to my server's `/public_html` folder, which is my Apache root folder. What do I need to add to my `.htaccess` file to use http authentication only if the user is coming from `example2.com/public_html`? `example.com/public_html` and `example1.com/public_html` should NOT use authentication.


Regarding the server distributions

I am confused as to what defines a "server" distribution against a normal, desktop distribution. What I mean is that if you wanted a corporate server, you might be able to pick just about any linux distro and go, however for some reasons to which I appear to be oblivious to, you might want to roll with `SUSE Enterprise, or RED HAT Enterprise`. Why would someone want to choose a specific server distribution? Is it because of the support offered by the companies behind them? Is it that these companies often include proprietary tools in their distros, not normally found in others, to give them an edge? Is it something else? Please help me clarify things in my mind. Thank you in advance.


Why is dd running forever on a 8 GB drive

I have a filesystem handled by ZFS and it's about 8 GB. I tried to zero out the filesystem by running:               dd if=/dev/zero of=/EMPTY bs=1M | true     rm -f /EMPTY      And normally on an ext4 filesystem, it completes in a few seconds. But this time it just kept going. I was able to launch a second terminal and see what the size of `/EMPTY` was. And after running `ll -h`, it said that `/EMPTY` was 800 GB! Obviously 800 GB does not fit into 8 GB. Furthermore by running `df -h`, it showed that the filesystem wasn't getting filled up. However the dd as consuming 50% of the CPU.. etc, heating up my laptop. I'm assuming it was doing a lot of work but achieving nothing. So why is dd running forever creating a file that doesn't take up any size? On ext4 it's meant to complete and give me an error so I can proceed.


Buildroot OpenGL Capable Backend

I'm trying to configure QT 5 through buildroot and some options are not available with the message `requires an OpenGL-capable backend`. I'm using buildroot 2013.08-rc1 but the same message comes up with 2013.05. I'm targeting x86_64 core2 platform and I can't find any options to select OpenGL backend (or OpenGL anything actually). How can I enable OpenGL backend in buildroot?


Peppermint linux issue on windows 8

I'm running an HP 2000 computer that came preinstalled with windows 8. I have peppermint fully set up on a partition, it's installed and ready to go. The only issue is that because of the way windows 8 and safe boot and Uefi are, I have to set up GRUB to act as the boot loader in order to run the Linux OS. I want to know how to do so, in simplest terms possible. I would also like to know if I could cause linux to activate by formatting the Partition that windows 8 is currently on, essentially, if I delete windows 8 then will the fully installed peppermint os on it's partition function? Been trying to figure this out for about a week now, and it's causing more and more hassle.


Why can't pgrep find scripts started via env?

For example:               $ cat foo.sh     #!/usr/bin/env bash     while true; do sleep 1 ; done     $ ./foo.sh &     $ pgrep foo.sh     $      Contrast with:               $ cat bar.sh     #!/bin/bash     while true; do sleep 1 ; done     $ ./bar.sh &     $ pgrep bar.sh     21202      The process started by `env bash` shows up in the output of `ps aux` as:               terdon 4203  0.0  0.0  26676  6340 pts/3    S    17:23   0:00 /bin/bash      while the one started with `/bin/bash` shows as               terdon  9374  0.0  0.0  12828  1392 pts/3    S    17:27   0:00 /bin/bash ./bar.sh      which probably explains why it the first is not being caught by `pgrep`. So, questions are:   * Why does the name of the script not show up when called through `env`?   * Does `pgrep` simply parse the output of `ps`?   * Is there any way around this so that `pgrep` can show me scripts started via `env`?


change shell in Solaris/SunOS for your user only wihtout access to /etc/passwd

How do I set the shell in Solaris/SunOS for my user only, without access to `/etc/passwd` or any other `su` stuff? It should thereafter work both for interactive `ssh` (1) and `ssh` when you send commands (2). `uname -a` says `SunOS ... 5.10 Generic_148889-04 i86pc i386 i86pc` **Edit in response to comments and answers** There is no `chsh`. I can't do `/usr/bin/passwd -e` - permission denied. The default shell is bash. I would like zsh. I already tried to set the `SHELL` environment variable manually, and start the shell manually in the `.profile` file, only this doesn't work for my **second case** (2): `ssh user@host command` will run `command` in bash. As compared to getting my preferred shell when I login, it is minor, so the workaround is certainly worth mentioning, only, my intention with this question was to get it right the right way. Because it just relates to one user, I thought it was doable without involving the SA, but now I'm less certain. (But any workaround that solves (1) and (2) is cool, for sure.)


Replacing Mac OSX with Linux Distro, or FreeBSD

I have a Macbook Pro 8,2 and really want to make the switch to something a little less stubborn and a little more flexible than the proprietary Mac OS X. I am a bit frustrated with MacPorts lately and Homebrew. I also would like to make the transition to a tiling window manager such as Awesome, RatPoison, or Xmonad. In the past I have had problems getting the Mac's wireless card working as well as setting up the EFI installer to boot to GRUB or LILO. So, I am curious if anyone here has had any experiences with running a Linux Distro like Slackware, Archlinux, Debian or a Unix OS such as FreeBSD on their MacBook Pro.


Port forwarding with ssh where the final destination does not have sshd running

I know how to use ssh to port forward a local port say like 7000 to a remote ssh server on port 50070. For example:               ssh -L 7000:127.0.01:50070 root@sshserver      "Me port 7000" - > "ssherver port 50070" But now say I have my "sshserver" at the office and I want to port forward my local port via the "sshserver" to the windows machine that has terminal services running on port 3389. To clarify the windows machine does not have sshd running. "Me port 7000" - > "sshserver" - > "windows machine port 3389" Is this possible with ssh?


smartd custom logfile on systemd + journald based system

An excerpt from smartd manpage reads: > **`-l FACILITY, --logfacility=FACILITY`**   >  `Uses syslog facility FACILITY to log the messages from smartd. Here > FACILITY is one of local0, local1, ..., local7, or daemon [default]. If this > command-line option is not used, then by default messages from smartd are > logged to the facility daemon.` Followed by steps how to accomplish this on a **syslog** based system. Apparently, if Arch Linux is up-to-date, it runs `journald` in conjunction with `systemd` for the same purpose. For the latter, I cannot find a way to configure facilities or whatnot. How to give `smartd` a logfile of it's own in a `journald` environment? * * * Mirrored from Arch Linux forums.


awk function with a number parameter for the column you want to print

I want to use my awk shortcut as a function, so that I can pass the column number which then prints me the output. My aliases are:               alias A="| awk '{print \$1}'     alias G="| grep -i'      Instad of typing:               ps -ef | grep mysql | awk 'print $2'      I want to be able to type this:               ps -ef G mysql A 2      Any suggestions? Thank you!


Firefox ignores settings in userContent.css (sometimes)

I have following code in my `$HOME/.mozilla/firefox/XXXXXXXX.default/chrome/userContent.css`:               input, textarea {     color:#000  !important;     background-color: rgb(255, 255, 255) !important;     }      The purpose is to have input fields and text areas always black on white color. My desktop theme is dark and without this hack, firefox would display input and text area black text on dark gray backround, which is pretty much unreadable. This works well for most websites, but some websites are still displayed as before (black text on gray background). For example this website. I have installed `dom inspector` and verified that the element is of type `input`. But why then are my css settings ignored for this site? # SUBQUESTION: Is there some documentation/manual, where these configuration options are explained? i.e. how do I know the keyword is `background-color` and not `background`? Also, what else can I configure other than `input` and `textarea` ?


WiFi not working in Backtrack 5r3 Acer Aspire V3-571 Laptop having “Broadcom Corporation NetLink BCM57785 Gigabit Ether” integrated wireless card

I have installed backtrack 5r3 in one hard disk partition alongside with windows7 in another partition in Acer Aspire V3-571 laptop having "Broadcom Corporation NetLink BCM57785 Gigabit Ether" integrated wireless card. My problem is I could not make WiFi working in my laptop even after trying a lot of command and methods found by googling. I downloaded tg3 driver from broadcom website and hopefully installed it but all in vain. In some forum I found that some guys having the same issue with Broadcom 43XXX seriers wireless card had fixed their issue by using some sta driver package by broadcom specific for 43XXX series, but I noticed I have 57XXX series wireless card not the same. I could not find any working solution for BCM57785 wireless card. Here's what I did......               root@bt:~# cd /lib/firmware     root@bt:/lib/firmware# unzip linux-3.133d.zip     Archive:  linux-3.133d.zip     creating: Server/Linux/Driver/     inflating: Server/Linux/Driver/ChangeLog       inflating: Server/Linux/Driver/README.TXT       inflating: Server/Linux/Driver/tg3-3.133d-1.src.rpm       inflating: Server/Linux/Driver/tg3-3.133d.tar.gz       inflating: Server/Linux/Driver/tg3_sup-3.133d-1.ISO.tar.gz       root@bt:/lib/firmware#           root@bt:/lib/firmware# rpm -ivh tg3-3.133d.src.rpm     The program 'rpm' is currently not installed.  You can install it by typing:     apt-get install rpm          root@bt:/lib/firmware/Server/Linux/Driver# apt-get install rpm     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages were automatically installed and are no longer required:     libecryptfs0 libdmraid1.0.0.rc16 libdebconfclient0 ecryptfs-utils cryptsetup     rdate bogl-bterm libdebian-installer4 reiserfsprogs dmraid python-pyicu     Use 'apt-get autoremove' to remove them.     The following extra packages will be installed:     librpmbuild0 rpm2cpio     Suggested packages:     alien elfutils rpm-i18n     The following NEW packages will be installed:     librpmbuild0 rpm rpm2cpio     0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.     Need to get 2,164kB of archives.     After this operation, 2,818kB of additional disk space will be used.     Do you want to continue [Y/n]? y     Get:1 ................ revolution/main librpmbuild0 4.7.2-1lbuild1 [716kB]     Get:2............ revolution/main rpm2cpio 4.7.2-1lbuild1 [651kB]     Get:3 .................. revolution/main rpm 4.7.2-1lbuild1 [797kB]     Fetched 2,164kB in 27s (77.4kB/s)                                                   Preconfiguring packages ...     Selecting previously deselected package librpmbuild0.     (Reading database ... 264111 files and directories currently installed.)     Unpacking librpmbuild0 (from .../librpmbuild0_4.7.2-1lbuild1_amd64.deb) ...     Selecting previously deselected package rpm2cpio.     Unpacking rpm2cpio (from .../rpm2cpio_4.7.2-1lbuild1_amd64.deb) ...     Selecting previously deselected package rpm.     Unpacking rpm (from .../rpm_4.7.2-1lbuild1_amd64.deb) ...     Processing triggers for man-db ...     Setting up librpmbuild0 (4.7.2-1lbuild1) ...          Setting up rpm2cpio (4.7.2-1lbuild1) ...     Setting up rpm (4.7.2-1lbuild1) ...     Trying rpm init...          Processing triggers for libc-bin ...     ldconfig deferred processing now taking place     root@bt:/lib/firmware/Server/Linux/Driver# rpm -ivh tg3-3.133d.src.rpm     rpm: please use alien to install rpm packages on Debian, if you are really sure use --                force-debian switch. See README.Debian for more details.     root@bt:/lib/firmware/Server/Linux/Driver# rpm -ivh tg3-3.133d.src.rpm --force-debian     error: open of tg3-3.133d.src.rpm failed: No such file or directory     root@bt:/lib/firmware/Server/Linux/Driver# rpm -ivh tg3-3.133d.src.rpm     rpm: please use alien to install rpm packages on Debian, if you are really sure use --   force-debian switch. See README.Debian for more details.     root@bt:/lib/firmware/Server/Linux/Driver# cd     root@bt:~# apt-get update     Fetched 7,978kB in 1min 54s (69.6kB/s)                                              Reading package lists... Done     root@bt:~# apt-get install alien     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages were automatically installed and are no longer required:     libecryptfs0 libdmraid1.0.0.rc16 libdebconfclient0 ecryptfs-utils cryptsetup     rdate bogl-bterm libdebian-installer4 reiserfsprogs dmraid python-pyicu     Use 'apt-get autoremove' to remove them.     The following extra packages will be installed:     debhelper html2text     Suggested packages:     lsb-rpm lintian dh-make     The following NEW packages will be installed:     alien debhelper html2text     0 upgraded, 3 newly installed, 0 to remove and 35 not upgraded.     Need to get 650kB of archives.     After this operation, 1,991kB of additional disk space will be used.     Do you want to continue [Y/n]? y     Get:1 .................. revolution/main html2text 1.3.2a-14build1 [104kB]     Get:2 ..................... revolution/main debhelper 7.4.15ubuntu1 [461kB]     Get:3 ....................... revolution/main alien 8.79ubuntu0.1 [85.4kB]     Fetched 650kB in 11s (55.7kB/s)                                                     Selecting previously deselected package html2text.     (Reading database ... 264205 files and directories currently installed.)     Unpacking html2text (from .../html2text_1.3.2a-14build1_amd64.deb) ...     Selecting previously deselected package debhelper.     Unpacking debhelper (from .../debhelper_7.4.15ubuntu1_all.deb) ...     Selecting previously deselected package alien.     Unpacking alien (from .../alien_8.79ubuntu0.1_all.deb) ...     Processing triggers for man-db ...     Setting up html2text (1.3.2a-14build1) ...          Setting up debhelper (7.4.15ubuntu1) ...     Setting up alien (8.79ubuntu0.1) ...     root@bt:~# alien -k tg3-3.133d-1.src.rpm     File "tg3-3.133d-1.src.rpm" not found.     root@bt:~# cd /lib/firmware/Server/Linux/Driver     root@bt:/lib/firmware/Server/Linux/Driver# alien -k tg3-3.133d-1.src.rpm     error: incorrect format: unknown tag     tg3_3.133d-1_amd64.deb generated     root@bt:/lib/firmware/Server/Linux/Driver# alien -k tg3-3.133d-1.src.rpm     error: incorrect format: unknown tag     tg3_3.133d-1_amd64.deb generated     root@bt:/lib/firmware/Server/Linux/Driver# dpkg tg3-3.133d-1.src.deb     dpkg: need an action option          Type dpkg --help for help about installing and deinstalling packages [*];     Use `dselect' or `aptitude' for user-friendly package management;     Type dpkg -Dhelp for a list of dpkg debug flag values;     Type dpkg --force-help for a list of forcing options;     Type dpkg-deb --help for help about manipulating *.deb files;     Type dpkg --license for copyright license and lack of warranty (GNU GPL) [*].          Options marked [*] produce a lot of output - pipe it through `less' or `more' !     root@bt:/lib/firmware/Server/Linux/Driver# dpkg -i tg3-3.133d-1.src.deb     dpkg: error processing tg3-3.133d-1.src.deb (--install):     cannot access archive: No such file or directory     Errors were encountered while processing:     tg3-3.133d-1.src.deb     root@bt:/lib/firmware/Server/Linux/Driver# dpkg -i tg3_3.133d-1_amd64.deb     Selecting previously deselected package tg3.     (Reading database ... 264518 files and directories currently installed.)     Unpacking tg3 (from tg3_3.133d-1_amd64.deb) ...     Setting up tg3 (3.133d-1) ...     root@bt:~# cd /lib/firmware/Server/Linux/Driver     root@bt:/lib/firmware/Server/Linux/Driver# tar xvzf tg3-3.133d.tar.gz     tg3-3.133d/     tg3-3.133d/tg3.h     tg3-3.133d/tg3_vmware.h     tg3-3.133d/README.TXT     tg3-3.133d/ChangeLog     tg3-3.133d/tg3_vmware.c     tg3-3.133d/tg3_compat2.h     tg3-3.133d/tg3_compat.h     tg3-3.133d/tg3.c     tg3-3.133d/LICENSE     tg3-3.133d/makeflags.sh     tg3-3.133d/tg3_firmware.h     tg3-3.133d/tg3.4     tg3-3.133d/esx_ioctl.h     tg3-3.133d/Makefile          root@bt:/lib/modules/3.2.6/kernel/drivers/net# insmod tg3.ko     insmod: error inserting 'tg3.ko': -1 File exists     root@bt:/lib/modules/3.2.6/kernel/drivers/net# modprobe tg3     root@bt:/lib/modules/3.2.6/kernel/drivers/net# cd     root@bt:~# cd /lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom     root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# insmod tg3.koinsmod:    error inserting 'tg3.ko': -1 File exists     root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# modprobe tg3     root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# cd src     bash: cd: src: No such file or directory     root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# make     make: *** No targets specified and no makefile found.  Stop.     root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# make KVER=3.2.6     make: *** No targets specified and no makefile found.  Stop.     root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# insmod tg3     insmod: can't read 'tg3': No such file or directory     root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# make install     make: *** No rule to make target `install'.  Stop.     root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# ethtool eth0     Settings for eth0:     Supported ports: [ TP ]     Supported link modes:   10baseT/Half 10baseT/Full                              100baseT/Half 100baseT/Full                              1000baseT/Half 1000baseT/Full      Supports auto-negotiation: Yes     Advertised link modes:  10baseT/Half 10baseT/Full                              100baseT/Half 100baseT/Full                              1000baseT/Half 1000baseT/Full      Advertised pause frame use: Symmetric     Advertised auto-negotiation: Yes     Link partner advertised link modes:  Not reported     Link partner advertised pause frame use: No     Link partner advertised auto-negotiation: No     Speed: Unknown!     Duplex: Unknown! (255)     Port: Twisted Pair     PHYAD: 1     Transceiver: internal     Auto-negotiation: on     MDI-X: Unknown     Supports Wake-on: g     Wake-on: g     Current message level: 0x000000ff (255)     Link detected: no     root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# cd     root@bt:~# ethtool eth0     Settings for eth0:     Supported ports: [ TP ]     Supported link modes:   10baseT/Half 10baseT/Full                              100baseT/Half 100baseT/Full                              1000baseT/Half 1000baseT/Full      Supports auto-negotiation: Yes     Advertised link modes:  10baseT/Half 10baseT/Full                              100baseT/Half 100baseT/Full                              1000baseT/Half 1000baseT/Full      Advertised pause frame use: Symmetric     Advertised auto-negotiation: Yes     Link partner advertised link modes:  Not reported     Link partner advertised pause frame use: No     Link partner advertised auto-negotiation: No     Speed: Unknown!     Duplex: Unknown! (255)     Port: Twisted Pair     PHYAD: 1     Transceiver: internal     Auto-negotiation: on     MDI-X: Unknown     Supports Wake-on: g     Wake-on: g     Current message level: 0x000000ff (255)     Link detected: no     root@bt:~# iwconfig     lo        no wireless extensions.          eth0      no wireless extensions.          root@bt:~#                root@bt:~# iwconfig     ppp0      no wireless extensions.          lo        no wireless extensions.          eth0      no wireless extensions.          root@bt:~# ifconfig     eth0      Link encap:Ethernet  HWaddr b8:88:e3:0a:0f:67             UP BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)           Interrupt:16                 lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:16436  Metric:1           RX packets:55 errors:0 dropped:0 overruns:0 frame:0           TX packets:55 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:9829 (9.8 KB)  TX bytes:9829 (9.8 KB)                 ppp0      Link encap:Point-to-Point Protocol             inet addr:101.218.175.244  P-t-P:10.64.64.64  Mask:255.255.255.255           UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1           RX packets:3531 errors:0 dropped:0 overruns:0 frame:0           TX packets:3855 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:3            RX bytes:3296893 (3.2 MB)  TX bytes:390972 (390.9 KB)          root@bt:~# lspci     00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM     Controller (rev 09)     00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor     Family Integrated Graphics Controller (rev 09)     00:14.0 USB Controller: Intel Corporation Panther Point USB xHCI Host Controller (rev 04)     00:16.0 Communication controller: Intel Corporation Panther Point MEI Controller #1 (rev 04)     00:1a.0 USB Controller: Intel Corporation Panther Point USB Enhanced Host Controller #2  (rev 04)     00:1b.0 Audio device: Intel Corporation Panther Point High Definition Audio Controller (rev 04)     00:1c.0 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 1 (rev c4)     00:1c.1 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 2 (rev c4)     00:1d.0 USB Controller: Intel Corporation Panther Point USB Enhanced Host Controller #1 (rev 04)     00:1f.0 ISA bridge: Intel Corporation Panther Point LPC Controller (rev 04)     00:1f.2 SATA controller: Intel Corporation Panther Point 6 port SATA AHCI Controller (rev 04)     00:1f.3 SMBus: Intel Corporation Panther Point SMBus Controller (rev 04)     02:00.0 Ethernet controller: Broadcom Corporation NetLink BCM57785 Gigabit Ethernet   PCIe (rev 10)     02:00.1 SD Host controller: Broadcom Corporation NetXtreme BCM57765 Memory Card Reader (rev 10)     02:00.2 System peripheral: Broadcom Corporation Device 16be (rev 10)     02:00.3 System peripheral: Broadcom Corporation Device 16bf (rev 10)     03:00.0 Network controller: Broadcom Corporation BCM43228 802.11a/b/g/n     root@bt:~# airmon-ng               Interface   Chipset     Driver               root@bt:~# cd /lib64/modules/3.2.6/kernel/drivers/net     root@bt:/lib64/modules/3.2.6/kernel/drivers/net# insmod tg3.ko     insmod: error inserting 'tg3.ko': -1 File exists          root@bt:/lib64/modules/3.2.6/kernel/drivers/net# modprobe tg3     root@bt:/lib64/modules/3.2.6/kernel/drivers/net#      root@bt:/lib64/modules/3.2.6/kernel/drivers/net# lsmod | grep tg3.ko     root@bt:/lib64/modules/3.2.6/kernel/drivers/net# lsmod | grep tg3     tg3                   147905  0      root@bt:/lib64/modules/3.2.6/kernel/drivers/net# sudo modprobe wl     FATAL: Module wl not found.     root@bt:/lib64/modules/3.2.6/kernel/drivers/net# sudo modprobe wl     FATAL: Module wl not found.     root@bt:/lib64/modules/3.2.6/kernel/drivers/net# sudo modprobe tg3     root@bt:/lib64/modules/3.2.6/kernel/drivers/net#


Is it safe to resize partition on /?

I currently have a 600gb disk, with Ubuntu installed, 600gb of which is given to the Ubuntu OS:               Filesystem      Size  Used Avail Use% Mounted on     /dev/sda1       592G   16G  547G   3% /     udev            1.9G  4.0K  1.9G   1% /dev     tmpfs           777M  944K  776M   1% /run     none            5.0M     0  5.0M   0% /run/lock     none            1.9G  3.8M  1.9G   1% /run/shm      Is it safe to unmount /dev/sda1 to shrink it to say, 300gb will I simply be able to remount it afterwards, or is it going to break everything and just die? Using Gparted?   If not then, how does it work in Windows Disk Manager, there I am able to resize mounted disks?


Migrate an entire volume group LVM2 to RAID5

I have a Virtual Host server build with Ubuntu and Xen ## SO   * Ubuntu 12.04.1 LTS 64Bits   * xen-hypervisor-4.1 ## Disk   * Hitachi SAS 15K 147GB (x2) in a Volume group   * sda1 1GB /boot    * sda2 146GB lvm   * sdb1 147GB lvm Every virtual machine has minimum two LV (root, swap) I have available three new disks Hitachi SAS 15K 600GB I want to create a RAID5 with this disk and migrate all partitions from the VG. Is this is possible and how? I know how to create a simple RAID with Simple RAID setup with mdadm but I want have the flexibility of the VG on my RAID. Is this is possible and how? My need is to have the flexibility of VG but RAID redundancy as you can guess I'm rookie in RAID topic.


What does this dd command do exactly?

I have the an embedded device with this SD card:               [root@(none) ~]# busybox fdisk -l     Disk /dev/mmcblk0: 3965 MB, 3965190144 bytes     4 heads, 16 sectors/track, 121008 cylinders     Units = cylinders of 64 * 512 = 32768 bytes                  Device Boot      Start         End      Blocks  Id System     /dev/mmcblk0p1             305        8497      262144+ 83 Linux     /dev/mmcblk0p2            8497       16689      262144+ 83 Linux     /dev/mmcblk0p3           16689       60352     1397247   b Win95 FAT32      and these partitions:               [root@(none) ~]# df     Filesystem           1K-blocks      Used Available Use% Mounted on     /dev/root               253871    140291    113580  55% /     none                     16384         4     16380   0% /tmp     none                    127016         4    127012   0% /dev     none                        16         4        12  25% /var/lib     none                        16         0        16   0% /var/log     none                       128        16       112  13% /var/run     /dev/mmcblk0p3         1394520    118036   1276484   8% /mnt/onboard      I have an u-boot kernel image file, uImage, of ~2 Mb. What happens exactly if I do               dd if=uImage of=/dev/mmcblk0 bs=512 seek=2048      ? Why am I asking this? This command is strange for me because:   1. ~~the copied image is smalled than target partition~~   2. ~~it seems that the image is extracted on /dev/mmcblk0p1, that is the root partition. It starts at 305, while dd skips 2048 blocks~~ EDIT: see Anthon's answer   3. there's not a boot partition   4. uImage is extracted; on the contrary I expected it will be used by u-boot as-is Background: the device is a Kobo Glo, and the command is executed by update scripts to update the kernel.


Does the Linux PreemptRT patch benefit desktop users?

Does the PREEMPT_RT patch (real-time kernel) have any benefit for regular desktop users?


How to start a service automatically, when Ubuntu starts?

I am using Ubuntu 12.04 and want to have a service starting, when the system is booted normally. As 'service' I understand some code, for example cd my_directory; my_command -host 0.0.0.0 -port 1234 -arg x that just should be running as if it has been started on the command line. There are services to be started as normal user, but also services to be started as root (in fact, it is not required the services to be run on user level). I also require to configure the behavior when a 'service' stops. I want them to be restarted in my case, with the same argument, in a specified directory. All of the services should be started automatically when the system is started normally, i.e. if the power switch is pressed. No other action should be required. There are some documents spread on the internet, but they all confuse me. They talk about `init`, `init.d`, `rc.d`, but I never saw a simple-to-follow step- by-step instruction to easily as a service using e.g. upstart. If this is easy, I would appreciate if those steps are given here.


Running Open Vas via KALI Linux

We would like to run open-vas penentration test on a remote server and would no like to install it on the remote machine. Thus we have setup a Kali Linux Live machine for this purpose. So we first went into open-vas setup and towards the end we capture as below.               sent 1953267 bytes  received 3317820 bytes  71715.47 bytes/sec     total size is 159182950  speedup is 30.20     [i] Checking dir: ok     [i] Checking MD5 checksum: ok     Stopping OpenVAS Manager: openvasmd.     Stopping OpenVAS Scanner: openvassd.     All plugins loaded                                        Starting OpenVAS Scanner:      openvassd.     Starting OpenVAS Manager: openvasmd.     Restarting OpenVAS Administrator: openvasad.     Restarting Greenbone Security Assistant: gsad.     Enter password:      ad   main:MESSAGE:30553:2002-01-01 00h34.24 UTC: No rules file provided, the new user will have no restrictions.     ad   main:MESSAGE:30553:2002-01-01 00h34.24 UTC: User admin has been successfully created.      Next went to setup openvas-gsd I try to login but then I read at the site it says this "Note: that the scan engine must have OMP support enabled for the given port for a successful connection? What should I do here?


Is it possible to create a "file" that can be used by any process without actually saving the file on disk?

Suppose I do a `grep` that gives me a lot of results. I want to use the output of grep and pass it to a command that takes a filename as it's first argument. For example -               myCommand filename.txt      I would like to do something like this -               grep "xyz" | myCommand      However, since myCommand doesn't read from stdin, this piping does not work. I don't want to create a temporary file on disk with the results of grep. Is it possible by any other means to create a "file", say in memory and let `myCommand` use that?


File uploads successfully however it is 0 bytes

I have an interesting problem where I have the ability to upload files, change permissions, download files using FTP on Cent OS. However, the interesting and annoying part is that the files are completely blank (0 bytes) when they get uploaded. What might be the trouble here? Here is the log from the client (FileZilla):               Status: Starting upload of C:\gettweetmodel_dev.php     Status: Retrieving directory listing...     Command:    TYPE I     Response:   200 Switching to Binary mode.     Command:    PASV     Response:   227 Entering Passive Mode.     Command:    LIST -a     Response:   150 Here comes the directory listing.     Response:   226 Directory send OK.     Command:    TYPE A     Response:   200 Switching to ASCII mode.     Command:    PASV     Response:   227 Entering Passive Mode     Command:    STOR gettweetmodel_dev.php     Response:   150 Ok to send data.     Response:   451 Failure writing to local file.


why do I have two different results if I run a program through terminal(as root) or /etc/init.d(or /etc/rc.local)

**Background:** I use Debian Lenny on an embedded device               uname -a     Linux device 3.4.0 #83 Sun May 26 17:07:14 CEST 2013 armv4l GNU/Linux      I have a C code (say `my_C_program`) that calls a board specific binary file (via `system("spictl someparameters")` ) called `spictl` to use SPI interface               user:~# ls -al /usr/local/bin/spictl     lrwxrwxrwx  1 root staff      24 Jun  9  2011 spiflashctl -> /initrd/sbin/spiflashctl      if I run my code (`my_C_program`) from the command line               user:~# /user/sbin/my_C_program      the `spictl` is executed without problem and outputs data from the SPI interface. **Problem:** I need the program to be run when the board is powered. Therefore, I add `/user/sbin/my_C_program` line before the `exit 0` at`/etc/rc.local`. When the board is powered, the my_C_program is executed and `spictl` is executed but the SPI interface does not output any data. I tried to run the program via `/etc/init.d/` script on this link. The script works fine and it executes the `my_C_program`, the program executes the `spictl` successfully (as `system()` return value says), but the SPI interface does not output any data!               ls -l /usr/sbin/my_C_program     -rwxrwxrwx 1 root root 61713 Jun 28  2013 /usr/sbin/my_C_program      `top` shows that the program is run as root                 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                1095 root      20   0  2524 1140  924 R  4.2  1.8   0:00.35 top                                                                                1033 root      RT   0 35092  34m 1852 S  3.0 56.5   0:14.06 node       **Question** if I execute the `my_C_program` on terminal, the program calls the `spictl` (via `system(spictl someparameters)`) and it is executed without any problem. But if I run `my_C_program` through `/etc/rc.local` or `/etc/init.d` script, then `spictl` does not work as it supposed to be. I suspect that it has something to do with the root privilege. When I execute the program on the terminal (as root) all works fine. But I guess `/etc/rc.local` and `/etc/init.d` somehow runs the program with a lower privilege. I could not really solve the difference between executing a command from the terminal as root or executing the program via `/etc/rc.local` or `/etc/init.d/` script. If you also think that it is a privilege problem, could you please explain how can I ensure that init.d script or rc.local would run the program with the highest privilege. Or what could be the issue? Please note that the problem/question is not SPI related. P.S. in order not to have unnecessary conversation like "oh Debian lenny is too old, you should use wheezy etc.", the board has armv4l processor and as the producer says it does not support wheezy because of some processor instructions.


Benefit of kernel module compiled inside kernel?

What's the benefit of compiling kernel modules into the kernel (instead of as loadable modules)?


Kernel memory allocator patch

Is there any patch for Linux kernel to use different memory allocators, such as ned allocator or TLSF allocator?


dash compatibility to bash

Wikipedia says that `dash` executes faster than `bash`. My question is, if I set `/bin/sh` to `dash`, will all scripts that use `/bin/sh` in their shebang line that was intended for `bash` work under `dash`?


Bash Script : Passing a variable to a bash script that contains quotes, single quotes. etc

lets assume this is the string:                  'a',"b"      it contains both single and double quotes. how would you pass this to a bash script as a single string ? this is the bash script:               #!/bin/bash     echo $1      it must echo               'a',"b"      but we can not assume the string is this tiny. ultimately i plan on sending the whole                /etc/httpd/conf/httpd.conf      as a string to this bash script. so i can not really escape quotes and single quotes one at a time.


How can I search filenames which are starting with xy_* and are created/edited today?

Hello I´m currently trying to search for logfiles which are starting with xy_Number and are created/edited today(not last 24 hrs). I tried:               find /home/USER/logfilesError/ -maxdepth 1 -type f -daystart -mtime -1 print0 | xargs -0 grep - l xy_*      Output:               find: paths must precede expression: print0      I need to combine:               find -maxdepth 1 -type f -daystart -mtime -1      and               ls | grep -E "xy_"      What I want to achieve is: Search logfiles from a specific location which today's date and then go a step further and search those files and output the ones which have lines starting with ERROR. (other lines INFO and DEBUG) * * * So the search works fine and I want to go further with checking the files after the search with a grep to find the files containing ERROR               grep -rl "ERROR" /home/USER/logfilesError/      How do I combine those in a script? With If? Can someone help me with this?


How to set the tab name to an alias hostname of the remote host I'm connected to?

As you might know, by default, the hostname of an AWS instance is something like `ip-12-34-56-78.us-west-2.compute.internal`, so when I ssh to this host, the tab name is changed to `root@ip-12-34-56-78` (a bit of difficult for me to identify which is which). Since I have the following in the `~/.ssh/config`:               Host mail.domain.com         Hostname 1.2.3.4         User root          Host web.domain.com         Hostname 5.6.7.8         User root      I'm wondering that is there any way to change the tab name to the "alias" hostname of the remote host I'm connected to (instead of the "real" hostname): ![iTerm tab title when ssh](http://i.stack.imgur.com/DfWwp.png) * * * My current `PS1` settings:               PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '      I have tried to add a ssh wrapper into `~/.bashrc`:               ssh() {         echo -ne "\033]0;${@: -1}\007"         exec ssh $@     }      then `. ~/.bashrc` and test by running `ssh web.domain.com`:   * while **connecting** : the tab name is changed to `web.domain.com`, as expected   * when **connected** : it is overwritten with `root@ip-5-6-7-8` Why? Is there something related to `PS1` here? * * * **UPDATE Fri Jun 6 21:58:04 ICT 2014** There is something quite strange going on: looks like this only happened with AWS instance. With other hosts, the tab name remain after logging in. `PS1` on the AWS instance:               # echo $PS1     [\u@\h \W]\$      `PS1` on the other hosts:               ~ echo $PS1     \[\]\[\][\[\]\t\[\]] \u\[\]@\[\]\h\[\]\[\]:\[\]\w\[\] \[\]      I also have tried to set the `PS1` variable on the AWS to the value of working host but it didn't help.


My Red Hat 6.4 goes once more in sleep after wake up

When I wake up my Red Hat 6.4 desktop it goes into sleep mode once again and when I restart my machine it never restarts again, after a shutdown just the LED lights are on so in this case I have to down the power and once again have to restart my PC. And one more when I shutdown or restart network configuration from `/etc/resolv.conf` clean out and I have to make entry in this file after every shutdown.


Copy file permissions from user to group

I have a folder with some files, which each have different permissions. Some are read-only, some are read/write, some are read/execute. How can I copy the permissions from user to group, so that for example a file marked read-write for user will be set to read-write for group, but a file read-executable for a user will be set read-executable for the group. Can this be done with a single command?


Address types used in Linux

I am trying to understand the Memory address types used by the Linux kernel, which are   * User virtual address   * Physical address   * Bus address   * Kernel logical address   * Kernel virtual address I understood the following:   **User virtual address:** User sees an address, which might not be in RAM, it might be a swap address.   **Physical address:** Every memory address, in some form, has to represent the physical address. Physical address is in direct form.   Similarly: Kernel Logical address and Kernel virtual address. I cant understand the Bus address and its requirement. If its quite naive to explain, materials to refer can be useful.


How to find duplicate files with identical content and identical or different names

I have several directories containing a few hundred files in each. Each directory contains files that are duplicated (i.e. have the same content) within the same directory, and/or are duplicated in one or more other directories, and the duplicates may or may not have the same names. For example, `dir_A/file_6` might be identical to `dir_A/file_85` as might `dir_B/file_6` and `dir_B/file_30`. How could I determine which files are duplicates, so that I can delete all the duplicates and be left with only one of each file? Is using a checksum the only method? How could I automate this? I'm using a Linux desktop.


How to remove files which do not end with ".c"?

I have a directory which contains all the C programs. I have also compiled them at the creation time so as to check my code. There are a lot of programs nearly 100 of them. So I want a BASH script that would check whether the file ends with ".c". If it does then it does not do anything, which if it doesn't then it would remove them. Suppose one of my file name is "Hello.c" then I have named its binary during compile time as "Hello". So can anyone make this script for me?


CentOS 5.6 live time feature without repeatedly executing date command

I am using CentOS 5.6, is there a way to view a "live" time, without constantly executing the `date` command? Constantly excuting the `date` command can be quite frustrating and repetitive when checking the time for running cron jobs.


fprintd-enroll works with right-index finger only

When I try any other finger with:               %> fprintd-enroll left-index-finger     Using device /net/reactivated/Fprint/Device/0     failed to claim device: Not Authorized: net.reactivated.fprint.device.setusername      It doesn't work for me; But if I don't specify finger (which uses right-index by default):               %> fprintd-enroll      Using device /net/reactivated/Fprint/Device/0     Enrolling right index finger.      It works Running on Arch Linux , and packages installed from aur:               fprintd 0.4.1-4     libfprint 0.4.0-3      **UPDATE**               %> fprintd-enroll -f left-index-finger     Using device /net/reactivated/Fprint/Device/0     Enrolling right index finger.


Taking complete backup of System and then restoring?

I am using kubuntu 10.04 and now I want to install Mac on my PC. I have my data scattered in over 200 Gb and I want take a backup such that with one command all my data is saved into a single file. Then if my MAC installation fails then just format my hard drive and restore the system in its original form. I know about "dd" but I am skeptic about it . Is it possible?


Why do all my DNS queries resolve to 192.168.1.251?

All my queries on one machine on my network have suddenly started to resolve to 192.168.1.251. This machine was used as the DNS server by other machines, so I noticed it as soon as it started happening and have switched all other machines to use 8.8.8.8 directly, which works. The machines are all on a 192.168.0.x IP. It does run dnsmasq, which I've restarted to no effect and so stopped, again, no difference. /etc/resolv.conf did have entries for 127.0.0.1 and the router's IP, I've changed it to just contain one for 8.8.8.8 and there's nothing in /etc/hosts for a 192.168.1.251 IP. Any ideas would be appreciated!               $ dig google.co.uk @8.8.8.8          ; <<>> DiG 9.7.0-P1 <<>> google.co.uk @8.8.8.8     ;; global options: +cmd     ;; Got answer:     ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49227     ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0          ;; QUESTION SECTION:     ;google.co.uk.          IN  A          ;; ANSWER SECTION:     google.co.uk.       0   IN  A   192.168.1.251          ;; Query time: 0 msec     ;; SERVER: 8.8.8.8#53(8.8.8.8)     ;; WHEN: Thu Jan  6 20:22:03 2011     ;; MSG SIZE  rcvd: 46               $ uname -a     Linux america 2.6.32-27-generic #49-Ubuntu SMP Wed Dec 1 23:52:12 UTC 2010 i686 GNU/Linux      Edit: This seemed to start working without any sign of any changes having effected the behaviour. I'm still none the wiser, but including the files below for completeness (and in case it comes back!)               $ cat /etc/hosts     127.0.0.1   localhost     127.0.0.1   america          192.168.0.1 england     192.168.0.2 america     192.168.0.3 germany     192.168.0.4 france     192.168.0.5 sweden          # The following lines are desirable for IPv6 capable hosts     ::1     localhost ip6-localhost ip6-loopback     fe00::0 ip6-localnet     ff00::0 ip6-mcastprefix     ff02::1 ip6-allnodes     ff02::2 ip6-allrouters     ff02::3 ip6-allhosts          $ cat /etc/resolv.conf      # Generated by NetworkManager     #nameserver 127.0.0.1     nameserver 8.8.8.8     #nameserver 4.2.2.2          $ cat /etc/nsswitch.conf      # /etc/nsswitch.conf     #     # Example configuration of GNU Name Service Switch functionality.     # If you have the `glibc-doc-reference' and `info' packages installed, try:     # `info libc "Name Service Switch"' for information about this file.          passwd:         compat     group:          compat     shadow:         compat          hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4     networks:       files          protocols:      db files     services:       db files     ethers:         db files     rpc:            db files          netgroup:       nis          $ sudo iptables -L     Chain INPUT (policy ACCEPT)     target     prot opt source               destination                   Chain FORWARD (policy ACCEPT)     target     prot opt source               destination                   Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination


Graphical boot-up screen lost after upgrading the kernel

I used the Ubuntu 10.10 alternate install CD to install Maverick to an encrypted partition on a USB stick. This worked perfectly, but after the first cycle of updates that took the kernel from 2.6.35-22 to 2.6.35-24 I no longer get the graphical boot screen that asks for my passphrase. Instead I get a similar looking one that uses ASCII art. If I select the older 22 kernel from the bootloader, I still get the nice graphical screen. What do I need to do to get the nicer boot-up interface with the newer 24 kernel? Thanks, PaulH


FTP client with a good GUI?

I love linux because I get control over my system. But I do herald from the school of mac, where things are simple, beautiful, and powerful. I like it that way, as opposed to having lots of knobs and levers and everything. **Does anyone know of a strong FTP client for linux that is in the vein of Panic's Transmit?** It's my choice FTP software in Mac OS, but I doubt I need to convince anyone here that I don't want to DEVELOP web apps in OS X. It's a pain, imo. Currently I use Filezilla. It works fine. But it's UI is a mess, imho.


How do you make RPROMPT in zsh update itself on every enter?

My `RPROMPT` is set to display svn info using `vcs_info`. It reads `RPROMPT=${vcs_info_msg_0_}`. `vcs_info` is called using `precmd()`. However, RPROMPT doesn't update when I change directories. It works only if I invoke the prompt again (either by source ~/.zshrc or prompt ) and doesn't change upon chdir, unless I invoke the prompt again. Is there any way to change this behaviour?


Packaging MATLAB

I have decided to try and package MATLAB for Arch Linux. The MATLAB program consists of a core program and a number of add on toolboxes. I would like to create a different independent package for each "toolbox" (or potentially subsets of toolboxes). The heart of my Arch PKGBUILD is               ./install -t -inputFile installer_input.txt -mode silent      where `inputFile` is basically a list of toolboxes to be installed. If I install both `product.MATLAB` (the core MATLAB program) and `product.Signal_Processing_Toolbox` (a toolbox), everything works fine. If I only install `product.Signal_Processing_Toolbox` the installer gives me the error > Error: One or more of the following products are required to proceed with > the installation: > > MATLAB 8.1 (Not available) > > You must select a folder where at least one of these products is installed > or select these additional products for installation. where `MATLAB 8.1` corresponds to `product.MATLAB`. The installer is proprietary (although parts of it are open source), but I think it will be hard to hack the installer to not require `product.MATLAB`. I don't want a toolbox package to conflict with the core package. Is there a standard way of dealing with this or is it specific to MATLAB? Is it possible to remove the "core" package from the chroot environment after installing the toolbox?


Installed TigerVNC, can't connect?

I've just installed TigerVNC on my Fedora 15 machine from the package manager then in terminal (as root):               chkconfig vncserver on service     vncserver start      None gave me errors, so I went back to the Windows 7 machine and fired up the viewer. But after a few seconds i get               unable to connect to socket: connection timed out(10060)      Does anyone know what to open up or fix on the Fedora machine to make this happen?


Find creator of resource in X

> **Possible Duplicate:**   >  What process created this X11 window? Recently I've been bugged by a mysterious invisible window in X on my Ubuntu machine. It takes the form of an always-top-most window with absolutely nothing showing; no window border, no content, no nothing. That means that entire area of the screen is now unusable with any pointer, since the window captures all events in it's context - I can't even click on the desktop in that area ! As you might have guess this is rather annoying, and I want to get rid of it permanently. However, running `xwininfo` on it gives the following:               xwininfo: Window id: 0x1601b9f (has no name)     [...]     Map State: IsViewable     Override Redirect State: yes     Corners:  +395+315  -383+315  -383-263  +395-263     -geometry 502x222+395+315      So, I've got an ID, but no name. This fortunately means I can kill it with `xkill`, but unfortunately means I have no idea what created it. So what I'm looking for is some advice or help finding a way to identify the root and cause of this window. Any suggestions ?


What process created this window with no PID associated?

> **Possible Duplicate:**   >  What process created this X11 window? I need to kill a process that spawned a window which seems to have no PID associated with it. At least that is what xdotool says:               ~$ xdotool getwindowpid 79691780     window 79691780 has no pid associated with it.      `wmctrl -lp` prints `0x04c00004 0 0 N/A Window name` `xprop _NET_WM_PID` says `_NET_WM_PID: not found.` The solutions in What process created this X11 window? don't work. I'm out of ideas, is there really now way of telling which process owns this window?


find out the culprit process

This is rather a basic linux administration question. We have a CentOS linux machine running a production application. There are 10 application specific processes running on that machine. `Once in every 3/4 days, the linux machine freezes` and the only way to get it back is to hard reboot it from Amazon AWS console. We have Amazon Cloudwatch enabled which captures the CPU usage every 5 minutes. We see that the CPU reaches 100% (8 cores) within in 10-15 seconds just before it freezes. And unfortunately we could not figure out anything from the process log files. How do we really pin point `which process out of those 10 processes is causing the linux server to freeze?` Are there any simple CPU/memory monitoring applications that can record the top cpu/memory hoggers to disk, say every 2 seconds? Appreciate any other ideas to figure out the culprit process.


Send a command from the console to a running X server

Is it possible to send a command from the console, say `tty1`, to the terminal currently occupied with X (in my case `tty7` as I use Debian), to tell for example `mplayer` to play a movie? **Edit** - made a shorthand function with the commands I learned in the answer below:               function movie () {       ORIG_TTY=`fgconsole`       chvt 7       DISPLAY=":0" mplayer -fs $1 > /dev/null 2> /dev/null       chvt $ORIG_TTY     }


Creating a complete Wine headless setup

I've have a headless server with `X11 Forwarding` but a lot of Wine applications fail to start with the following error:               Application tried to create a window, but no driver could be loaded.      It has to be said that every other X application (such as `Firefox`, `xclock` and so on) work beautifully. So I was asking myself if there was another way to accomplish a full Wine installation on a headless server other than setting up a VM (which **I DO NOT NEED** ). Thank you very much!


How to install KDE on Debian 6?

I have GNOME 2.30.2 that came with my default Debian installation. I have the following Debian installation:               Distributor ID: Debian     Description:    Debian GNU/Linux 6.0.5 (squeeze)     Release:        6.0.5     Codename:       squeeze      I want to install some other desktop environment. What is the procedure for installing KDE or Xfce on Debian 6?


How to find and count how many files contain a certain word?

I am supposed to find and display the count of the number of files that contain the word carrot (case ignored) So far this is what I have, I am just not sure how to add the wc into it to count how many files there are that have the word carrot > find . -exec grep -i carrot {} \;


Installing a .tgz....how?

Admitted: My search in this regard was not so successful there were different approaches. I want to install it in a Debiandistro. I am a beginner!! Thanks for your suggestions.


SSH to a machine that is getting it's network connection from an Android device(Google TV)

I have a Linux(Ubuntu) machine for my HTPC. It's running XBMC and I control it via my IR remote control. I don't have a (wired) keyboard to control it. It has Wifi adaptor but it's not installed. I also have a Sony Google TV (model NSZ-GT1) which runs Android 3.0 and have Wifi and an ethernet port. Luckily I was able to connect a wire from Google TV to XBMC machine and get internet connection. My wireless modem is far away and I don't have a long cable to connect XBMC machine directly to it. With all weird setup I have, now I want to SSH to the XBMC to try to install Wifi adapter on it. XBMC show IP address and MAC address of machine. SSH-ing to IP times out. Can I use MAC address for SSH to bypass Google TV? Is there anything smart in software side that I can do to avoid a lot of physical work?


Arch Linux install doesn't boot

I've got Arch Linux mostly installed, and I seem to have installed GRUB with no problem. My partition table looks like this:                                             cgdisk 0.8.7                               Disk Drive: /dev/sda                            Size: 625142448, 298.1 GiB          Part. #     Size        Partition Type              Partition Name     ------------------------------------------------------------------                 1007.0 KiB  free space        1        15.0 GiB    Linux filesystem            root        2        1007.0 KiB  BIOS boot partition         bios                 17.0 KiB    free space        3        283.1 GiB   Linux filesystem            home      After partitioning my drive like this, I ran:               root@archiso ~ # arch-chroot /mnt /bin/zsh     root@archiso [02:19:45] [/]     -> # grub-install --target=i386-pc --recheck /dev/sda     Installation finished. No error reported.      However, when I boot, I get               GRUB _      The underscore blinks, but I can't type anything. I still have access to the Arch installation by using the original install disk and `chroot`ing into it, but obviously I don't want to do this every time I start up my laptop. What could possibly be preventing me from booting properly? I've made sure my partitions conform to what the GRUB page says I need, but to no avail. For reference, I'm using the Arch Beginner's Guide and I've chronicled the epic story of how I spent my Saturday on my wiki.


Run a command after acquiring IP address

I would like to run the command `Urlsnarf -n -i p33p1 >> file` when the p33p1 network interface gets its IP address. Initially I tried to run the command at bootup by adding the a crontab entry `@reboot command`. For some reason, `Urlsnarf` failed to start and I assume it is because the NIC is not ready yet. I am using Fedora Beefy Miracle.


How do I drop to a shell after exiting a command I started by scripting tmux?

I'm following this tutorial for scripting the creation of tmux windows.               tmux new-window t $SESSION:0 -k -n MAIN 'cd ~/main/ && perl -Ilib myapp'      sometimes I kill myapp after I've started tmux, I want to drop back to a shell in that directory, but instead this kills the window entirely. What is the best way to fix this? I think at least one answer involves running a shell and having that shell run commands, but I'm not sure on the best way to accomplish that.


HTOP nice level mismatch with the nice command?

I executed some commands with `nice -20` but in `htop` the NI appears in red and as 19, why is this?


Linux Source Routing with one gateway

I've a Linux box which have IP 10.1.1.100/24 on eth0 with gateway 10.1.1.1 and as well as 20.1.1.1 on eth0:1 and 20.1.1.2 on eth0:2 . Is there any way that I could communicate to a remote machine having IP 192.168.1.1 using 20.1.1.1 or 20.1.1.2 ? I've only one gateway and one physical interface to out my traffic however 20.1.1.2 is accessible from 192.168.1.1 but traffic out only from 10.1.1.100 when I try to communicate to 192.168.1.1 from my server. Linux Box ( eth0 IP: 10.1.1.100 GW: 10.1.1.1 "eth0:1 20.1.1.2") ------- | Internet | ------ RemoteMachine ( eth0 IP: 192.168.1.1 ) in the above example I've public IPs on both local and remote machines so therefore remote machine can communicate to 20.1.1.2 using same gateway of 10.1.1.100 which is 10.1.1.1 I want to get some services from remote machine using IP 20.1.1.2 but when i try to communicate to remote machine IP 10.1.1.100 goes out to communicate to it. Regards,


Python3 error “no module named bluetooth” on Linux Mint

I am trying to connect my Lenovo S10E to a Nintendo Wiimote via bluetooth. I am using a simple Python script, reproduced below. I am calling it from the Linux Mint (version 16, "Petra") command line using `python3 find_wii.py` My goal is to connect a wiimote to Mint, then output MIDI (eventually). I am using Python due to its cross-platform advantages. Script:               import bluetooth          target_name = "Nintendo RVL-CNT-01"     target_address = "00:1C:BE:29:75:7F"          nearby_devices = bluetooth.discover_devices()          for bdaddr in nearby_devices:         if target_name == bluetooth.lookup_name( bdaddr ):             target_address = bdaddr             break          if target_address is not None:         print("found target bluetooth device with address "), target_address     else:         print("could not find target bluetooth device nearby")      I am receiving the error               Traceback (most recent call last):       File "find_wii.py", line 1, in <module>         import bluetooth     ImportError: No module named 'bluetooth'      I have installed bluez and python wrappings for it (`sudo aptitude install python-bluez`). I have upgraded my system (`sudo apt-get update`, `sudo apt- get upgrade`). I did consulted Google, and the only official bugs I could find are here and here, and neither of the answers worked for me. How can I get the Bluetooth module to work with Mint? [Note: Question cross-posted to stackoverflow]


Debian 7.3 can't remove postgresql

Solved: I removed `/var/lib/dpkg/info/postgresql-8.4` Now everything is fine.               sudo rm -r /var/lib/dpkg/info/postgresq*      * * * I got this problem:               alex@VRIL ~ % sudo apt-get install python3     Reading package lists... Done     Building dependency tree            Reading state information... Done     You might want to run 'apt-get -f install' to correct these:     The following packages have unmet dependencies:      postgresql-8.4 : Depends: postgresql-client-8.4 but it is not installable                       Depends: postgresql-common (>= 109~) but it is not going to be installed      postgresql-9.1 : Depends: postgresql-client-9.1 but it is not going to be installed                       Depends: postgresql-common (>= 115~) but it is not going to be installed      python3 : Depends: python3.2 (>= 3.2.3) but it is not going to be installed                Depends: python3-minimal (= 3.2.3-6) but it is not going to be installed     E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).     100 alex@VRIL ~ %      I tried the following commands:               sudo apt-get install -f     sudo apt-get autoremove     sudo aptitude remove postgre*     sudo apt-get remove --purge postgres*      The problem is, i don't need postgres, I don't even know where it comes from ... but it prevents me from installing something. if I do `sudo apt-get -f install` I get this result:               /var/lib/dpkg/info/postgresql-8.4.prerm: 7: .: Can't open /usr/share/postgresql-common/maintscripts-functions     dpkg: error processing postgresql-8.4 (--remove):      subprocess installed pre-removal script returned error exit status 2     Errors were encountered while processing:      postgresql-8.4     E: Sub-process /usr/bin/dpkg returned an error code (1)      Any ideas?


Easy way to determine virtualization technology

I have command line access to a Linux machine which may or may not be virtualized. I want to determine what kind of virtualization technology it runs on, if any (VMWare, VirtualBox, KVM, OpenVZ, Xen, ). This isn't a hostile environment: I'm not trying to work against a VM that is trying to disguise itself, I'm diagnosing a flaky server that I know little about. More precisely, I'm helping someone diagnose the issue, I'm not sitting at the helm. So I have to convey instructions like “copy-paste this command” and not “poke around `/proc` somewhere”. Ideally, it would be something like `lshw`: an easily-installable (if not preinstalled) command that does the poking around and prints out relevant information. What's the easiest way of determining what virtualization technology this system may be a guest of? I'd appreciate if proposals mentioned which technologies (including bare hardware) can be conclusively detected and which can be conclusively eliminated. I'm mostly interested in Linux, but if it also works for other unices that's nice.


Indentifying a linux container

Is there a simple way to identifying a linux container?, just like with a xenserver vm you can input the command uname -a and the result contains the word "xen". Linux hostname 2.6.18-348.6.1.el5xen #1 SMP Tue May 21 16:10:52 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux So is there a command or particular function to do this? Thanks!


How to find out which virtualisation technology is used on Linux VPS server?

I have access to some Debian Linux vps servers, however I cannot access their controls panel directly: only server administrator himself can do that. Is there any way to find out what visualization technology is used on server from inside VPS? I need it only to know which kernel header package should I install (xen, openvz or any other).


How to check which hypervisor is used from my VM?

So I'm running a VM somewhere and want to know what hypervisor the host is running. Any way to check whether it's running KVM or in a container? The vm is running Ubuntu


strange "bad file descriptor" error

I've run into a perplexing error that I'd like to understand better. The problem seems to require the presence of a "wrapper" shell function (as described below), so my immediate interest is to find out how to modify such a shell function to get rid of the error. (I give a more specific statement of my question at the end of the post.) The simplest code that I've come up with to reproduce this error is given in the following script. (This script is certainly artificial and silly, but the real-life situation in which the error first surfaced is a bit too complicated for a demonstration like this one.)               # create an input file     cat <<EOF > demo.txt     a     b     c     EOF          # create a "wrapper shell function" for /usr/bin/join     my_join_fn () {       /usr/bin/join "$@"     }     cat <(my_join_fn  <(cat demo.txt) <(cat demo.txt))     cat <(my_join_fn  <(cat demo.txt) <(cat demo.txt)) | head -1          # create a "wrapper shell function" for /usr/local/bin/gjoin, a port of     # GNU's join function for OS X     my_gjoin_fn () {       /usr/local/bin/gjoin "$@"     }     cat <(my_gjoin_fn <(cat demo.txt) <(cat demo.txt))     cat <(my_gjoin_fn <(cat demo.txt) <(cat demo.txt)) | head -1          # show the version of zsh     $SHELL --version      If one sources this script (under `zsh`), it terminates successfully, and produces the following (correct) output:               % source demo.sh     a     b     c     a     a     b     c     a     zsh 5.0.2 (x86_64-apple-darwin11.4.2)      But if one then re-executes _directly from the command line_ either one of the two lines in the script that end with `| head -1`, one gets a `bad file descriptor` error:               % cat <(my_join_fn  <(cat demo.txt) <(cat demo.txt)) | head -1     join: /dev/fd/11: Bad file descriptor     % cat <(my_gjoin_fn <(cat demo.txt) <(cat demo.txt)) | head -1     /usr/local/bin/gjoin: /dev/fd/11: Bad file descriptor      _These are the only two lines in the script that produce an error when run directly on the command line._ As indicated in the output of `$SHELL --version`, the results shown above were obtained under OS X, but I get similar results when I perform an analogous test under Linux:               % cat <(my_join_fn  <(cat demo.txt) <(cat demo.txt)) | head -1     /usr/bin/join: /proc/self/fd/11: No such file or directory     % $SHELL --version     zsh 4.3.10 (x86_64-unknown-linux-gnu)      * * * I have not been able to reproduce this error under `bash` (OS X or Linux). This leads me to suspect that the error is due to a bug in `zsh`. But, if so, it is an extremely arcane bug, and thus not likely to be fixed any time soon. Therefore, I'd like to find a workaround. My question is: > How should I modify the definition of the wrapper shell function > `my_gjoin_fn` so as to avoid this error? (The real-life counterpart for `my_gjoin_fn` is almost identical to the one given above, differing only in the inclusion of a flag in the invocation of `gjoin`:               my_gjoin_fn () {       /usr/local/bin/gjoin -t$'\t' "$@"     }      I use this wrapper shell function _all the time_ , therefore I'd really like to "salvage" it.) EDIT: The error persists even if I replace the `| head -1` at the end of the command with `| head -10`, `| cat`, `| tee /dev/null`, `| :`, etc. E.g.:               % cat <(my_join_fn  <(cat demo.txt) <(cat demo.txt)) | cat     /usr/bin/join: /proc/self/fd/11: No such file or directory      Also, adding `ls -l /proc/self/fd`, as suggested by msw, produces the following:               % cat <(ls -l /proc/self/fd; my_join_fn  <(cat demo.txt) <(cat demo.txt)) | cat     total 0     lrwx------ 1 jones jones 64 Aug 21 12:29 0 -> /dev/pts/18     l-wx------ 1 jones jones 64 Aug 21 12:29 1 -> pipe:[312539706]     lrwx------ 1 jones jones 64 Aug 21 12:29 2 -> /dev/pts/18     lr-x------ 1 jones jones 64 Aug 21 12:29 3 -> /proc/23849/fd     /usr/bin/join: /proc/self/fd/11: No such file or directory      ...which doesn't tell _me_ much, but may be more informative to others. FWIW, the output produced by the `ls -l /proc/self/fd` subcommand looks the same whether I run this under `zsh` or under `bash`. Also, FWIW, the output of `ls -l /proc/self/fd` when run by itself is               % ls -l /proc/self/fd     total 0     lrwx------ 1 jones jones 64 Aug 21 12:32 0 -> /dev/pts/18     lrwx------ 1 jones jones 64 Aug 21 12:32 1 -> /dev/pts/18     lrwx------ 1 jones jones 64 Aug 21 12:32 2 -> /dev/pts/18     lr-x------ 1 jones jones 64 Aug 21 12:32 3 -> /proc/5246/fd


Exclude paths that make find complain about permissions

I need to generate a file list from a disk volume. Some of the directories (all hidden directories under the root directory) have strange permissions that causes find to complain. I try to exclude all these paths, but one directory still complains:               find . -type f -not -path './.*/*'     find: ./.DocumentRevisions-V100: Permission denied      The rights are like this (set so by the operating system, so I assume they shouldn't be messed with).               d--x--x--x root  wheel   .DocumentRevisions-V100      How do I change the `find` statement to effectively omit all the hidden directories as to not complain. (I do not want to do `2>/dev/null` as I want to know about other problems).


Zsh script how to concatanate array elements with string

I have written a `zsh` script to automize an analysis in high energy physics and now I would like to use an element of the one of the defined array some string and another element of some another array in a command that is passed to one of the string. My code follows below:               bkgarr=(TopJets BosonJets DiBoson TTbar)     sigarr=(NM1 NM2 NM3 Scenario4 Scenario6)     puarr=(50PU 140PU)     lumarr=(30 300 3000)          echo Please type 1 for 50PU samples and 2 for 140PU samples     read PU     if [[ $PU -ne 1 && $PU -ne 2 ]] ; then         echo You have to enter 1 or 2         return 1     fi          echo Please type 1 for 300fb-1 and 2 for 3000fb-1     read lum          if [[ $lum -ne 1 && $lum -ne 2 ]] ; then         echo You have to enter 1 or 2         return 1     fi          if [ $PU = 1 ]; then         let "lum = $lum + 1"         #echo $lum     fi          root -l << EOF     .L readerSummerStd.C+     .q     EOF          ex NEWrunReader.py  <<EOEX       :43s/Lumi.*/Lumi=$lumarr[lum]/       :x     EOEX          echo Press any key to proceed or Ctrl+C to abort!     read     for index in $bkgarr     do         screen -dmS $index"_"$lumarr[lum]         #screen -S $index -p 0 -X stuff "$(typeset -p bkgarr)"$'\r'         screen -S $index"_"$lumarr[lum] -p 0 -X stuff "./NEWrunReader.py SummerStd $puarr[PU]_$index >& $index"_"$lumarr[lum].txt &"$'\r'     done     for sigind in $sigarr     do         screen -dmS $sigin"_"$lumarr[lum]         #screen -S $sigind -p 0 -X stuff "$(typeset -p bkgarr)"$'\r'         screen -S $sigin"_"$lumarr[lum] -p 0 -X stuff "./NEWrunReader.py SummerStd $puarr[PU]_$sigind >& $sigind"_"$lumarr[lum].txt &"$'\r'     done     return 0      I thought the following code snippets would do, but they failed:               $index+"_"+$lumarr[lum]     $index"_"$lumarr[lum]      I would appreciate it if you could help me with this.


Different behavior of mktemp Ubuntu 12.02 / Mint 9 Isadora

In a bash script I use ImageMagick's convert command for doing some image processing. I generate a temporal gif file for convert to write to. I really need the file to have the .gif extension so convert knows that the destination file should be a gif file. In Ubuntu 12.04 the following works fine:               mktemp /tmp/pre_XXXXXXXXXX.gif      But in Mint 9 Isadora I get the following error:               mktemp: too few X's in template       No matter how many X's I give it, it gives the same error, which is only fixed when I delete the ".gif" suffix. **Why is that ? Isn't Mint based on Ubuntu ?**


Why does uucp take group 10?

According to YoLinux, group ID 10 typically belongs to wheel. And on my Arch Linux installation, sure enough there in `/etc/group` is wheel:10. However, on my Ubuntu machine instead I'm greeted with `uucp`. A quick search turns up the Ubuntu man page of uucp, which seems to have a different purpose. So why does `uucp` get that group ID? Can I replace it or should I just make wheel a different group ID instead?


Unable to delete file, even when running as root

I am in the process of migrating a machine from RHEL 4 to 5. Rather than actually do an upgrade we have created a new VM (both machines are in a cloud) and I am in the process of copying across data between the two. I have come across the following file, which I need to remove from the new machine but am unable to, even when running as root:               -rw-------  1 2003 2003  219 jan 11 14:22 .bash_history      This file is inside /home/USER/, where USER is the account of the guy who built the machine. He doesn't have an account on the old machine, so I am trying to remove his home folder so that the new machine tallies with the old one, but I get the following error:               rm: ne peut enlever `.bash_history': Opération non permise      (translated from the French: cannot remove XXX, operation not permitted) I have tried using the following command but this has made no difference:               chattr -i .bash_history      Is the only choice to create a user with the ID 2003, or is there another way around it? * * * # Edit I have tried using `rm -f`, and I get the same error. I get the same kind of error using `chmod 777` first. I have been able to `chown` the folder that contains the file I am trying to delete, so it is:               drwx------ 2 root root 1024 jan 24 15:58 USER      * * * # Edit2 Running the `lsattr` command as suggested by Angus gave the following output:               -----a------- USER/.bash_history     ------------- USER/..     ------------- USER/.      The file is flagged as append-only - on changing this flag using `chattr -a .bash_history` I was able to delete the file.


How to get vim to work with tmux properly?

I'm trying to figure out how to get `vim` and `tmux` play together. My problem is: When I use `xterm-256color` I get `vim` to work nicely, but the background doesn't render properly. I fixed this by using `screen-256color`. This looks nice but breaks the `Ctrl + arrow keys` (they go in insert mode and delete 4 lines). I want to use these mappings instead to switch tabs in `vim`. How do I get this to work?


Delete range of lines above pattern with sed (or awk)

I have the following code that will remove lines with the pattern `banana` and 2 lines after it:               sed '/banana/I,+2 d' file      So far, so good! But I need it to remove 2 lines **before** banana, but I can't get it with a `minus sign` or whatever (similar to what `grep -v -B2 banana file` should do but doesn't):               teresaejunior@localhost ~ > LC_ALL=C sed '-2,/banana/I d' file     sed: invalid option -- '2'     teresaejunior@localhost ~ > LC_ALL=C sed '/banana/I,-2 d' file     sed: -e expression #1, char 16: unexpected `,'     teresaejunior@localhost ~ > LC_ALL=C sed '/banana/I,2- d' file     sed: -e expression #1, char 17: unknown command: `-'


xargs -r0 vs xargs -0

I have seen examples on the web of `xargs` with the argument `-r0`. What does this argument mean? My man pages don't show any entries for -`r0` nor do most man pages I have seen (e.g. http://linux.die.net/man/1/xargs)


cp file device:directory on Minix

In my operating systems class we had to modify the boot screen of the Minix OS. I understood just about everything we did, but at the end of the make for compiling the new OS, there's a line:               cp image /dev/c0d0p0:/minix/2.0.4r2      I don't understand what the colon is for, can anybody explain this? I've searched all over with no luck.


Command substitution: file or command not found

The following script               #!/bin/bash     QUERY='select * from cdr;'     MYROWS=$("sqlite3 -list -nullvalue NULL -separator ',' /var/log/asterisk/master.db '${QUERY}'")      gives me               ./bla.sh: row 35: sqlite3 -list -nullvalue NULL -separator ',' /var/log/asterisk/master.db 'select * from cdr;': file or directory not found      If I execute directly               sqlite3 -list -nullvalue NULL -separator ',' /var/log/asterisk/master.db 'select * from cdr;'      then it works. I guess there is some error with the quotes that can't be seen on the error message. Please note that I need the single quotes around               select * from cdr;      Thanks for any hint on what I am doing wrong!


online installer Qt for chessx on Centos 6.4 compile with qmake

Using `yum install qt` has installed `qt.i686 1:4.6.2-28.el6_5` to my `/usr/share` folder on Centos 6.5 but I need to follow these instructions to get chessx working: > To compile ChessX, you need Qt version 4.2.0 or above.   1. Compilation Compiling the source is simple. Execute: qmake and then make If the compilation is successful you should be able to run ChessX executable in bin subdirectory. It is called: chessx on Linux, chessx.app on Mac OS, chessx.exe on Windows   1. Problems If you have both Qt3 and Qt4 installed, verify that Qt4 is first on your path. You may check it, running: qmake -v But I don't know how to do the above exactly. chessx I have downloaded and installed in `/usr/local/games` as that seems logical to me.How do I set the path to make qmake work? Read "For simple projects, you only need to run qmake in the top level directory of your project." So the directory above chessx or qt4? NB: Since found out this is only to install locally where I was attempting to install remotely.


PS tags does not work

I run a ps command inside a startup script, if I put in:               ps -A -o euser,pid...      I get this output:               EUSER      PID CMD                         %CPU   RSS    SZ     ELAPSED      root       644 ./code                       0.0   996  2963       00:00      It's there each time. If I run:               ps -C ./code -o euser....      it does not display anything at all. Any suggestions?


How to stop XEmacs from teaching me that my keyboard settings are "bad"?

I've changed (using the keyboard layout options in Linux Mint 13) the keyboard layout as follows:   * The Caps Lock key is reconfigured as Compose key.   * Pressing both Shift keys at once toggles Caps Lock. Since both options are offered by the menus (no `xmodmap` or similar involved), I figure they should work fine, and indeed, I've never noticed any problems (including inside XEmacs), with one exception: Whenever I start XEmacs (version 21.4.22), I get an extra window (in the Emacs sense of "window") with the following text:               (1) (key-mapping/warning)          The meanings of the modifier bits Mod1 through Mod5 are determined         by the keysyms used to control those bits.  Mod1 does NOT always         mean Meta, although some non-ICCCM-compliant programs assume that.          (2) (key-mapping/warning)          The semantics of the modifier bits ModShift, ModLock, and ModControl         are predefined.  It does not make sense to assign ModControl to any         keysym other than Control_L or Control_R, or to assign any modifier         bits to the "control" keysyms other than ModControl.  You can't         turn a "control" key into a "meta" key (or vice versa) by simply         assigning the key a different modifier bit.  You must also make that         key generate an appropriate keysym (Control_L, Meta_L, etc).          (3) (key-mapping/warning) XEmacs:  Shift_L (0x32) generates ModLock, which is nonsensical.      Is there any way to tell XEmacs to stop teaching me that my keyboard settings are "bad"?


How do I find a tag that contains a commit?

I have the SHA ID of a commit that I am interested in and would like to know how to find the first tag that contains it.


Run one screensaver across multiple monitors

Is there a way to make `xscreensaver` run a single screen saver across the whole X display, ignoring Xinerama/XRANDR geometry? I have three monitors appearing as a single X screen on one X display. XRANDR provides information about where each physical monitor starts and ends on the single X screen. `xscreensaver` uses this to either run a different screen saver on each monitor, or to run the same screen saver three times, once for each monitor. I would like to change this so that only one screen saver is run, and it spans all three monitors (i.e. it takes up the entire X screen.) This way animations in the screen saver will be free to roam from one monitor to the next. Is this possible?


dd and rm -r commands

For me, the following commands do exactly the same thing:               dd if=/dev/zero of=/dev/sd1          dd if=/dev/null of=/dev/sd1          rm -r /dev/sd1/*      meaning, the result of their application is the same. Or least, that's true for the first and the third ones. Is this really the case?


how can I set yate to be my default tel: protocol handler?

On http://www.frigidaire.com/kitchen-appliances/ranges/ I clicked on the support link and a phone number popped up. It was formatted via the tel: protocol, and as such was underlined and highlighted like a web link. On my phone, clicking on such a link opens my default dialer and places the call. When links are not formatted via this protocol, my browser's Google voice plugin usually auto-detects the phone number and gives me a chance to call via Google voice. It would be nice if I could also do this for tel: formatted numbers, or better yet, as I don't always have a voice session open, set tel:formatted numbers be handled by `yate`. ### How can I fix my browser's handling of the `tel:` protocol links such that it opens in `yate` or google voice?   * In Chromium I get a warning saying that xdg-open will be used to handle the link, but when I click 'Launch Application' nothing happens.   * In Firefox, clicking on the link leads me to a blank page with the url tel:18003744432   * In Konqueror clicking on the link produces a "Access by untrusted page to tel:18003744432 denied." error I'm using Linux Mint 16 KDE x64


Redmine upgrade doesn't find mocha dependency

I've tried to upgrade my redmine 1.3.0 to 2.0.0 following these instructions. I am at step 3/6. In this step, I am trying to run the `rake generate_session_store` command, but I receive the following error: `Could not find gem 'mocha (= 0.12.3) ruby' in any of the gem sources listed in your Gemfile.` Do you have any idea how this can be solved?