title: Equivalent of pick command in linux

text: OS: Linux Mint 14 Is there an equivalent of the `pick` command available in Linux? Pick command is the one where for each given argument, it asks yes/no and prints the selection to stdout. This script is commonly described in unix books (unix power tools).


title: What's the name of the top-level directory

text: I am using Ubuntu. I know by using `cd ~/` , I can go to _home/_ directory. But if I want to go to the directory (I do not know the official name of this directory) which contains `etc/`, `var/`, `opt/`, ... sub-directories, what is the symbol used to refer to this directory? (And by the way what is the official name of this directory? root directory?) Basically, I would like to `cd` to that directory without using `cd ..` but one symbol to refer to it, is there such a symbol for it (like `~` refers to home directory)?


title: How to cut the output to only gather the filename and get-parameter?

text: I have multiple files with multiple links that are formatted like this:                                   Bear in mind that `FOO`, `BAR` and `FNORD` can differ. Now I want to make sure that all those files have the correct attributes set. For that purpose I want to use ack-grep and cut.               ack-grep -a ?parameter= *.txt      gettiting the output:               fileName.txt     1:          fileName2.txt     5:      Yet I am at a total lost about how I could cut the output so that I would only see:               fileName.txt     parameter=FOO-_-BAR-_-FNORD          fileName2.txt     parameter=POIT-_-NARF-_-BAZINGA


title: Getting black controls when running linux on vmware on windows

text: I want to run ubuntu 12.04 LTS. I want to put the graphics in it, but when I open it, I get this. I used this command               sudo apt-get install --no-install-recommends ubuntu-desktop      to put the desktop version on it. Also I have an intel chipset, and nvidia 420m graphics card. Does anyone know how to fix this? Thanks ![enter image description here](http://i.stack.imgur.com/PKoq8.png)


title: Disabling Web camera

text: My Eee PC comes with a Web cam, which I never use. How can I ensure that it is effectively disabled, so that no software can use it?


title: Securing a Debian installation for general home usage

text: Debian comes with several `harden` packages, designed to make a computer more secure. My needs are very simple: word processing and Web browsing. I do not run any special servers, do not use SSH, telnet, etc. The only software that should use the Internet, that I know of, is `iceweasel` and `apt`.   * Is there a way to ensure that only these two pieces of software can access the Internet?   * Are any of the `harden` packages suitable for these needs?


title: How to specify timeout for tab completion in zsh?

text: Zsh's completion feature is great except for this one. When I try to complete in a folder with lots of files/network folder, it takes a couple of minutes and prints this error.               example.com:~$ ls /path/to/some/bigFolder/[TAB]     zsh: do you wish to see all 620 possibilities (124 lines)?      Instead Is there a way to specify a timeout after which zsh should not try to auto-complete? I am not able to cancel its search too.


title: How to identify the program that uses most bandwidth?

text: How can I know which application is using the most network bandwidth? I saw some graph from KDE's network monitor, but don't know which process did that.


title: How to limit application memory usage?

text: I have spend 2 hours reading questions about this matter, and still there is some misunderstanding. I have this process:               USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND         root 1452 0.4 1.8 1397012 19308 ? Sl 04:23 3:48 ./transaction_server      This shows it uses `19.3Mb` of system resident memory (I have no swap file), around `1.8%` of whole `1GB` system memory. Virtual size is `1.39GB`?!?. I have read that `ulimit -m` doesn't work. People use `ulimit -v` e.g. setting virtual memory for the process. Is this virtual memory is the one VSZ listed with `ps`? What value I should set if I want to restrict this process to use `100MB` system memory at most. I have read documentation for `setrlimit` and this seems legit:               RLIMIT_AS             This  is  the maximum size of a process' total available memory,              in bytes. If this limit is exceeded, the malloc() and mmap()              functions shall fail with errno set to [ENOMEM]. In addition,              the automatic stack growth fails with the effects outlined above.      But on other versions of the documentation this `RLIMIT_AS` parameter sets virtual memory size. What is the truth?


title: Weird SSH issue, ssh works with -t but freezes without it

text: When I `ssh` into one of my servers, it seems to log in, but then hangs before giving me the prompt (`message debug2: shell request accepted on channel 0 is the last log entry`). Though the odd thing is `ssh -t "/bin/bash"` works when `ssh` doesn't. _What I have found out so far_   * I can log in fine from servers in the same geographical location normally   * If I `ssh -t '/bin/bash'` \- I can log in perfectly from ANY location.   * If I use `rsync` _to_ the server , it seems to work, and then locks   * If I use `rsync` _from_ the server, it works without problem _What I have tried_   * removing or changing all login options `.profile`, `.bashrc /etc/profile`   * Changing the `ssh_config` _and/or_ `sshd_config` to one from an identical server that works fine   * I've checked the routing   * I've had a network expert examine `tcpdump` to no avail (though there do seem to be a lot of re-transmissions) _I really can't think of anything else_ Apart from a dodgy network card driver/firmware.


title: Checking Boot Volume

text: Programmatically, how can I check whether the lun node is a boot volume or not (the lun node is created under `/dev/` on Linux systems (such as RHEL or Ubuntu or any other linux flavour). To my knowledge, there is a way to check using the utility like `dd`, `hexdump`, `file`, or by reading the first 512 bytes programmatically, etc (by checking/reading the fist 512 bytes from the lun node). Is there any other alternative efficient way to do that? Thanks in advance.


title: SSH connection refused

text: I have a CentOS Linux server with a SSH connection. It works perfectly but from time to time, the server refuses the connection. If I reboot the server, I can SSH again. What could be wrong?


title: Send file by xmodem or kermit protocol with GNU screen

text: I work with an RS-232 device via GNU `screen`.               $ screen /dev/ttyUSB0 115200      At some point I need to send a local file to the device using either the `xmodem` or `kermit` protocol. On Windows I use TeraTerm which has a corresponding menu item. How can I achieve this in GNU screen?


title: Accidentally set /lib permissions to 644

text: Long story short, I've got an Ubuntu server box that was recently compromised (I believe through a known exploit of an older version of Tomcat, which has already been updated). Part of the exploit set the permissions on pretty much everything to 777. In attempting to fix the incorrect permissions I inadvertently set /lib to 644 instead of 755 as it should have been. As a result of this, _no_ programs can be run (including but not limited to chmod), and the system cannot fully boot (either normally or into recovery mode). Is there any way to gracefully recover from this mistake, or do I basically have to reinstall Ubuntu from scratch at this point? The one thing I can do is access a limited command prompt through grub. Using this I can browse the machine's filesystem, but I haven't found any way to use it to modify any permissions. Is there a a way to do this using grub's command prompt?


title: Detect other machine's address in link local?

text: I have two machines connected in link local IPv4 over a CAT6 cable. Is there a way from `host1` that I can determine `host2`'s IPv4 address? I'm on an Debian-derivative running kernel 3.2.0-34-generic.


title: Battery not detected on my embedded device on reboot

text: I have an ARM based embedded device with Linux Kernel 2.6.31 running on it. I have seen that while rebooting the device sometimes battery won't get detected and the device will just fail to boot. Any pointers on :   1. What is the root cause of this problem?   2. How can I find the root cause of this problem?   3. What can I do to fix this?   4. Is this a software or hardware bug?


title: Second GPU does not show up in `lspci`

text: I switched the second GPU in one of our servers (Ubuntu 12.04.1 LTS). But now `lspci` only gives one entry:               $lspci | grep -i nvidia     04:00.0 VGA compatible controller: NVIDIA Corporation G94 [Quadro FX 1800] (rev a1)      I already executed `sudo update-pciids` and re-installed the nvidia dev driver. What other steps can I do?


title: How to disable moving between workspaces feature?

text: I have installed Linux Mint 14 Cinnamon - have been upgrading from Linux Mint 13. There is a feature:   I can move between workspaces by moving cursor to the edge of screen and holding it there for about 1.5 seconds. It is very useful, but sometimes annoying. And I cannot find where to turn off it.


title: Slackware Upgrade on new release

text: I am about to install Slackware . Likely using Salix however a little concerned getting in st the rear end of the 13.37 cycle . If I install now and in a month anew release of Slackware occurs will a brand new install be required or is there a similar facility to dist-upgrade? Should I just use slackel and stay on Slackware current?


title: Why is my fstab entry for an external USB drive not working?

text: I have an external USB drive which my system recognizes as `/dev/sdb1`. I want to have it automounted with 755 permissions on boot and shared over the network with samba. I created the mount point `/mnt/mybook` for it, and I've mounted it manually with no problems. If I do `mount /dev/sdb1 /mnt/mybook`, it mounts correctly and I can access the contents. I figured this would be simple enough, so I read up on _fstab_ and came up with the following line for it:               UUID=C252-9CA3 /mnt/mybook vfat defaults,mode=755 0 0      I got the UUID from blkid. When I reboot, the drive is not automounted, much less with the 755 permissions I want. How can I make it so the drive gets correctly automounted with the desired permissions?


title: The best Linux Open-source wiki with native support for Windows (NTLM) authentication

text: I need to set up a wiki for our engineering group; we are part of an Enterprise-wide Windows Active Directory domain. Most of the corporate IT applications use NTLM to authenticate (automatically via Internet Exploder); while I'm not part of corporate IT, I recognize that Single Sign-On (SSO) is important for user acceptance. I am hoping to find a free and open-source wiki that is well-tested and can be hosted on linuxSee End Note 1, while allowing corporate windows laptops to automatically authenticate without a password prompt. I have seen some hacks to make moin authenticate with NTLMSee End Note 2, but I don't know how well this would actually work in practice; so any deployment experiences with moin + NTLM would be valuable. I have also seen FOS Wiki, but FOS Wiki doesn't seem to have support for automatic login. ## Question: In short, I am looking for the best free, open-source, linux wiki implementation with native, automatic NTLM authentication supportSee End Note 3; I give bonus points if it can use Markdown or reStructured Text. * * * End Notes:   1. If I felt like running this under Windows, I could use Screwturn wiki; however, the thought of hosting web services on windows makes me feel all dirty inside.   2. See this post on wikimatrix   3. If such a thing even exists


title: how to input this command line

text: hume@linux-o1dm:~> gnomesu -u legum java -jar '/home/legum/frem/frem.jar'     Unknown option -jar      I want `-u` for `gnomesu` and `-jar` for `java`, but the openSUSE treat `-u -jar` only for `gnomesu`. What is the correct way of putting this on the command-line?


title: bit rot detection and correction with mdadm

text: I'm about to re-organise all my HDDs in my linux box nas and would like to use mdadm raid for data protection and its flexibility for reshaping the arrays. However, before I use mdadm for this I'd like to know how it handles bit rot. Specifically the kinds of bit rot that do not result from unrecoverable read errors. Given that I'll likely be using at least 21TB of HDDs in 8 disks in the nas and the various quotes on probabilities of failures on HDDs, I'm thinking that during a rebuild from a single disk failure I'm reasonably likely to encounter some form of bit rot on the remaining disks. If it is an unrecoverable read error on 1 of the drives, that the drive actually reports it as an error, I believe that should be fine with raid6(is it?). However if the data read from the disk is bad but not reported as such by the disk, then I can't see how this can be automatically corrected even with raid6. Is this something we need to be concerned about? Given the article It is 2010 and RAID5 still works, and my own successful experiences at home and work, things are not necessarily as doom and gloom as the buzz words and marketing would have us believe, but I hate having to restore from backups just because a HDD failed. Given that the usage patterns will be, write at most a few times, and read occasionally, I'll need to perform data scrubbing. I see on the archlinux wiki the mdadm commands for data scrubbing an array as               echo check > /sys/block/md0/md/sync_action      then to monitor the progress               cat /proc/mdstat      This seems to me that it will read all sectors of all disks and check that the data matches the parity and vice-versa. Though I notice there is heavy emphasis in the docs to say that there are significant circumstances that the "check" operation will not be able to auto correct, only detect, and it will leave it up to the user to fix. What mdadm RAID level(s) should I choose to maximise my protection from bit rot and what maintenance and other protective steps should I be doing? And what will this not protect me from? Edit: I'm not looking to start a RAID vs ZFS or any other technology QA. I want to know specifically about mdadm raid. That is also why I'm asking on Unix & Linux and not on SuperUser.


title: How come no core dump is create when an application has SUID set?

text: I setup my environment to create a core dump of everything that crashes, however when I run an program with SUID set on a different user than the executing user it doesn't create a core dump. Any idea's why this might be? I couldn't find it anywhere on the web, I think it's some sort of security feature but I would like to have it disabled... Problem:               $ cd /tmp     $ cat /etc/security/limits.conf | grep core     *     -     core     unlimited     root  -     core     unlimited          $ ls -l ohai     -rwsr-sr-x 1 root root 578988 2011-06-23 23:29 ohai          $ ./ohai     ...     Floating point exception          $ sudo -i     # ./ohai     ...     Floating point exception (core dumped)     # chmod -s ohai     # exit     $ ./ohai     ...     Floating point exception (core dumped)      **Edit:** To make it work as secure as possible I now have the following script to setup the environment:               mkdir -p /var/coredumps/     chown root:adm /var/coredumps/     chmod 772 /var/coredumps/          echo "kernel.core_pattern = /var/coredumps/core.%u.%e.%p" >> /etc/sysctrl.conf     echo "fs.suid_dumpable = 2" >> /etc/sysctl.conf          echo -e "*\t-\tcore\tunlimited" >> /etc/security/limits.conf     echo -e "root\t-\tcore\tunlimited" >> /etc/security/limits.conf      Now all that's left to do is add ACL to /var/coredumps so users can only add files and don't modify nor read them ever again. The only downsize is that I would still have a problem with chroot'ed applications which would need a `bind mount` or something like that.


title: My Ping command does not seem to ever finish. Does that mean it is suceeeding?

text: I am pinging a remote IP. I know very little about the Ping command. When I ping the IP, it keeps going and going... I am not using the -t option.               Me$ ping 137.30.124.104     PING 137.30.124.104 (137.30.124.104): 56 data bytes     64 bytes from 137.30.124.104: icmp_seq=0 ttl=62 time=3.378 ms     64 bytes from 137.30.124.104: icmp_seq=1 ttl=62 time=3.825 ms     64 bytes from 137.30.124.104: icmp_seq=2 ttl=62 time=4.882 ms     64 bytes from 137.30.124.104: icmp_seq=3 ttl=62 time=1.822 ms     64 bytes from 137.30.124.104: icmp_seq=4 ttl=62 time=4.572 ms     ....     64 bytes from 137.30.124.104: icmp_seq=290 ttl=62 time=3.273 ms      Does that mean it is successfully pinging the IP? Or that it is trying and failing and trying again? How do I get it to stop?


title: reorder GRUB to list Windows on top

text: I have **win 7** and **linux mint 14** installed. Is it possible to modify the `GRUB Menu` to show `Windows` as the first option instead of `Linux`, which it currently does. Mainly so that during boot it **starts Windows by default**.


title: EFI boot to Linux on a MacBook Pro

text: 8,3 MacBook Pro 2011, running Ubuntu 11.10 amd64. Here's the situation. Screen backlight and a few other things only work if booting in EFI, so I need to boot Ubuntu in EFI to get things working. If I hold down Alt while booting and start Linux _that_ way, then I boot into EFI just fine to my existing GRUB2 setup with screen brightness working. I'd like to make this a bit more "automatic." I'm currently using rEFIt to allow me to boot into the various operating systems I've got on the machine. Unfortunately, rEFIt doesn't boot Linux in EFI mode, it uses a legacy mode, I believe, which seems to be equivalent to BIOS. Thus, I installed a GRUB2 EFI module to rEFIt and I can now see that in my boot menu just fine. The problem is that I'm having boot problems. With the following GRUB command, I can see the kernel boot, but it hangs at               *ERROR* failed to get supported _DSM functions      and never actually completes. Here's my GRUB configuration file:               set debug=fg     insmod efi_uga     insmod font          if loadfont ${prefix}/unicode.pf2     then          insmod gfxterm         set gfxmode=auto         set fgxpayload=keep         terminal_output gfxterm     fi          menuentry "Linux (BIOS)" {         search --file --no-floppy --set=root /vmlinuz         loadbios /boot/vbios.bin /boot/int10.bin         linux /vmlinuz root=/dev/sda4 video=efifb         initrd /initrd.img     }      I basically have two questions.   1. **Is there a way to enable EFI booting to Linux in rEFIt?** If that were possible, I could avoid having to mess with GRUB altogether and that'd be great.   2. **What am I doing wrong with GRUB?** If I can't get rEFIt to play nice, how should I be booting my kernel in the EFI GRUB configuration file? I tried using the one on my system at `/boot/grub/grub.cfg`, but that didn't work either. I've been messing around with this for a while, but since I'm totally new to messing with GRUB, I'm utterly lost. Why can I use Apple's "alt" loader to boot into Linux with EFI support, while I can't use rEFIt to boot into Linux with EFI support?


title: ZFS under Linux, does it work?

text: Could I get ZFS to work properly in Linux? Are there any caveats / limitations?


title: Is btrfs stable enough for home usage?

text: btrfs has finally found its way into the latest kernels, is it considered stable and safe enough to use in a home backup scenario (as an alternative to zfs) ?


title: Explain to a Linux user how do BSD/OSX drivers work

text: Linux drivers come in a form of kernel modules (`*.ko` files), which can be given parameters when loaded into the kernel and usually live in `/lib/modules/<kernel version>`. What's the similar arrangement for BSD/OSX? For example, I've just installed MacFUSE and have hard time understanding what exactly did the installer put into my system.


title: How to assign USB driver to device

text: This question is two-fold: First, how do you manually detach a driver from a USB device and attach a different one? For example, I have a device that when connected automatically uses the usb-storage driver. ### usbview output               Vendor Id: xxxx     Product Id: xxxx     ...         Number of Interfaces: 2         Interface Number: 0             Name: usb-storage             Number of Endpoints: 2             ...         Interface Number: 1             Name: (none)             Number of Endpoints: 2             ...      I do not want to use the usb-storage driver, so in my application I use the `libusb` library to detach the usb-storage driver and then I claim the interface. I then can send data to and from the applications running on my USB device and on my host Linux system. How do you detach a driver manually outside of an application? * * * Second, how do I automatically assign the driver to attach on device plugin? I currently have a udev rule setup to set the device permissions automatically:               SUBSYSTEM=="usb", ATTR{idVendor}=="xxxx", MODE="0666"      Can I use udev rules to assign drivers to specific interfaces on the USB device? For example, if I wanted the usbnet module to be used on automatically on interface 0 instead of usb-storage, is that possible in udev?


title: Create a manpage adressing several executable

text: I am packaging an application with a bunch of executable accepting roughly the same arguments. I would like to write (and provide) only one manpage with common explanations and the list of arguments. In short, I would like that               man execFoo     man execBar      point to the same page. I know how to generate two identical `execFoo.1` and `execBar.1` but these seems suboptimal. Since I plan to release this package for Debian, solutions relying on Debian packaging chain (such as `dh_installmake`) would also be fine.


title: modify user-defined System Variables(that is a number) of remote Server machine using ssh?

text: I want to modify the value of a System Variable of a remote server . The IP of server is 172.16.22.53. The server runs Windows OS,and Cygwin instlled in it.In /cygdrive/c/cygwind/home/sikaiwei/.bashrc file(in Windows),I created a new System Variables and definded it.And I want the Variable to be a number,so I can change its value freely using ssh in my bash script . I try it ,but the system variable seem be a string instead of a number.               [sikaiwei@login-1-2 ~]$ $ORANGE     -bash: 1: command not found     [sikaiwei@login-1-2 ~]$ export ORANGE=1+$ORANGE     [sikaiwei@login-1-2 ~]$ $ORANGE     -bash: 1+1: command not found     [sikaiwei@login-1-2 ~]$      Like that,I defined a system variable $ORANGE to 1.Then 1 plus it to get 2，but I got '1+1' instead of '2'！ @skwllsp @Thorsten Staerk ,thanks! Your ways work well both. But if I ues sshpass like this :               [sikaiwei@login-1-2 v1.4]$ sshpass -p 'CHUN~19900405' ssh 172.16.22.53 -l sikaiwei     "getId=$ORANGE;echo $ORANGE;let ORANGE=$ORANGE+1;echo $ORANGE;echo 'getId is'$getId;"     1     1     getId is      But the result should like this:               1     2     getId is 1      What happened? I try this：               [sikaiwei@login-1-2 v1.4]$ sshpass -p 'CHUN~19900405' ssh 172.16.22.53 -l sikaiwei "getId=$ORANGE;echo $ORANGE;ORANGE=$((ORANGE+1));echo $ORANGE;echo 'getId is '+$getId;"     1     1     getId is +      and               [sikaiwei@login-1-2 v1.4]$ sshpass -p 'CHUN~19900405' ssh 172.16.22.53 -l sikaiwei "getId=$ORANGE;echo $ORANGE;((ORANGE=ORANGE+1));echo $ORANGE;echo 'getId is '+$getId;"     1     1     getId is +      I find a big error. The value of $ORANGE in               sshpass -p 'CHUN~19900405' ssh 172.16.22.53 -l sikaiwei "getId=$ORANGE;echo $ORANGE;    ((ORANGE=ORANGE+1));echo $ORANGE;echo 'getId is '+$getId;"      is not the value of the System Variable of the Server host. It is the value of the System Variable of my Client host.


title: Sftp interface to Scp

text: I have a linux based router that doesn't have the SFTP server installed. More specifically, when I `sftp user@ipaddress` I get a `sh: /user/libexec/sftp- server: not found` error. My interest isn't trying to resolve this error by installing a new package ("distro" is specific to the router, and I'm not interested in trying to modify it). What I am interested in is finding a command line utility that works like sftp but uses scp as the transfer mechanism.


title: understanding sudoers

text: I have a unix script which creates a temporary log file, say `tempfl.log`. When this file is created it has permission `rw-r--r--`. There is a line               chmod 0440 /etc/sudoers tempfl.log 2>&1      But when the script is done the permission changes to `r--r--r--` but it should be `rw-r--r--`. If I change the line to               chmod 0644 /etc/sudoers tempfl.log      the permissions are right for `tempfl.log` but it throws errors saying > sudo: /usr/local/etc/sudoers is mode 0644, should be 0440 I do not understand what sudoers is doing and what is wrong.


title: Disable keyboard shortcuts in Thunderbird

text: Is there a way to disable those evil keyboard shortcuts in `Thunderbird` ? When I accidentally hit `a`, suddenly the message gets archived and a new `Archives` folder is created. Similarly other keys bring havoc to my workflow. Who asked for these silly keyboard shortcuts ? While googling, I have found many complains similar to mine, but no working solution offered. There used to be a `KeyConfig` addon, but this is incompatible with new versions of `Thunderbird`. My Thunderbird version is Icedove 24.6.0.


title: Can I speed up pasting into vim?

text: I copied a part of the HTML out of a web page and wanted to save it in a file. For that I started a new `vim` session in a terminal window, with a (new) filename specified on the commandline, hit `i` to get to insert mode and then `Ctrl``Shift`+`V` and waited while `[-- INSERT --]` showed at the bottom and waited... As `vim` was non-responsive after several seconds, I opened 'Text Editor' from the Applications->Accessoiries menu pasted the text (which showed up within a fraction of a second, saved it under a new name, closed, and killed the Vim session that still was not done, 1.5 minutes later. The amount of text was 186K in 3200 lines, not excessive I would say, nor with overly long lines. Is there a way to speed up these kind of insertions in `vim` and/or is there an explanation why this is so slow compared to using the, otherwise horrible and mouse oriented, Text Editor? (The %CPU according to `top` doesn't come above 5%, although I have some processors free in the system, so it might be some I/O bound problem, that doesn't exist when reading the same text from a file) Version info:   Ubuntu 12.04   Vim: 7.3, with patches as supplied by Ubuntu 12.04   bash: 4.2.25   gnome-terminal: 3.4.1.1


title: How can I send data from sound input to output (e.g. linear input/output)? Preferably with pulseaudio

text: Need to get data from audio input, make some changes (a pulseaudio module for this conversion is available), and send data for output. How I can make do this? "Redirect" raises questions but I can't find any information in Russian, and what I've found in English doesn't seem to be formulated correctly.


title: Older Computer Not Stable With Mint 17

text: I have an older desktop computer (about 10 years), a Sony Viao PCV-1132 (I can't find a spec sheet on it), that would not reliably boot up with Windows XP. The only difference from stock is a wireless card. The first time it tried to boot it would crash, but the second time was usually stable. Since XP is essentially no more, I thought I would put Mint 17 32 Bit on it, but some problems still persist. So, I'm convinced it is hardware, which is not my strong suit. It will still not boot reliably the first time, but will when it feels like it. Most of the time, it will either stop functioning with the Mint logo splash screen, or drop to terminal and the last message given is "panic occurred". I took pictures of the screens, tried the Linux Memtest, and that returned one bad result. I have no idea if it is serious or not. ![enter image description here](http://i.stack.imgur.com/TxhMJ.jpg) ![enter image description here](http://i.stack.imgur.com/xuaTs.jpg) ![enter image description here](http://i.stack.imgur.com/LaOxn.jpg) Any ideas on what is wrong and how to fix it?


title: Prompting when redirecting content of script to remote machine

text: I have simple script:               #!/bin/bash          while getopts ":u:" opt; do       case $opt in         u)           USER="${OPTARG}"         ;;         \?)           echo "Unknown flag has been used: -$OPTARG" >&2           exit 1           ;;         :)           echo "Option -$OPTARG requires an argument." >&2           exit 1           ;;       esac     done          stty -echo     read -p "New password for user ${USER}: " USER_PWD     stty echo          mysql -uroot -p -e "CREATE DATABASE IF NOT EXISTS ${USER}; GRANT ALL ON *.* TO '${USER}'@'localhost' IDENTIFIED BY '${USER_PWD}'; FLUSH PRIVILEGES;"      I would like to use it on another machine without copying it there. So I'm doing:               cat myscript.sh | ssh myserver bash -s - -u some_user      However it doesn't prompt me for passwords, instead it outputs me only an error: > stty: standard input: Invalid argument Enter password: ERROR 1045 (28000): > Access denied for user 'root'@'localhost' (using password: NO) What I'm doing wrong? Is it impossible to being prompted when redirecting script like that? **Added:** I realized that my script have more problems (like using $USER variable, that is standard environmental variable), however my question really is about prompting. I reduced a problem to this simple script:               #!/bin/bash          read -p "Please write something: " SOME_VARIABLE     echo "Done"      And when I'm doing this:               cat test.sh | ssh user@server bash -s      It just echoes "Done", and doesn't let me to input anything on "read". Is it normal and why is that?


title: Installing Fedora 16 from an external HDD?

text: How can I install Fedora 16 Live (32-bit) from an external HDD connected via USB? I tried it with Universal-USB-Installer and received an error message that there was no drive found to be mounted and the NTFS format was not recognized. In Netbootin, the external HDD does not even get recognized in Windows 8 CP and is not selectable in the drop down menu, even though it is visible and writable in Windows Explorer. I have successfully installed with this method before with Ubuntu 12.04 and Universal-USB-Installer, but with Fedora 16 it did not work for me. How do I fix this issue? Will it work if I simply format the external HDD in vFat instead of NTFS? I have read that others have gotten it to work with vFat.


title: Renaming files works, but soft links point to the old names. How can I fix that?

text: For example, I'm renaming many files inside a tree like this:               [bash]$ for file in `find . -name "*gsf*"`; do `mv $file ${file/gsf/msf}`; done      That renames all the instances of "gsf" in file names matching _gsf_ to "msf", but softlinks continue to point to now-non-existent files containing "gsf". For example, this is what happens after the rename:               lrwxrwxrwx 1 trusktr users     20 Apr 25 14:39 libmsf-1.so -> libgsf-1.so.114.0.23     lrwxrwxrwx 1 trusktr users     20 Apr 25 14:39 libmsf-1.so.114 -> libgsf-1.so.114.0.23     -rwxr-xr-x 1 trusktr users 265584 Apr 21 04:41 libmsf-1.so.114.0.23      As you can see, the soft links point to `libgsf-1.so.114.0.23` which doesn't exist anymore because it was renamed to `libmsf-1.so.114.0.23`. What can I do so that the rename also happens to the soft link pointers?


title: What is the correct way to upgrade 7zip on Solaris 10?

text: I currently have an old old version of 7zip installed (`4.55 beta`) on Solaris 10. It is located in `/usr/bin/7z`. Found using `which 7z` I have downloaded a new version `9.20.1`. The README says to edit the `install.sh` and change `DEST_HOME` to where I want it installed. The default location is `/usr/local` So do I just change this to `/usr/bin/7z`? Will it upgrade/overwrite the old version ok? I want to install this system wide for everyone to use. I really don't want to screw anything up or make my life miserable by doing something dumb.


title: How to strip unused architectures, drivers, etc from headers when building a custom linux kernel?

text: I am building custom linux kernel packages in a Ubuntu 13.10 amd64 environment using   `apt-get source linux-image-$(uname -r)`   the debian way `make-kpkg clean;fakeroot make-kpkg --initrd --append-to- version=-custom kernel_image kernel_headers`. ### Linux headers is larger than image The result are two .deb files where the file `linux-headers-` is **8.2M** in size and the resulting `linux-image-` is only **6.1M**. After having a look in what files the `linux-image-` contains, I see that there are loads of headers for items which are disabled in the `.config` file. ### Linux-headers-... content   * unused file systems, like `/fs/reiserfs/`,   * unused security modules, like `/security/selinux/`,   * unused includes, like `/include/pcmcia/` or `/include/sound/`,   * unused architectures, like `/arch/powerpc/`, `/arch/s390/`, `/arch/parisc/`, `/arch/blackfin/`, `/arch/cris/`, `/arch/xtensa/`, `/arch/alpha/`, `/arch/ia64/`, `/arch/h8300/`, `/arch/arm/`, etcetera,   * unused drivers, like `/drivers/leds/`, `/drivers/eisa/`, `/drivers/isdn/`, `/drivers/net/ppp/`, `/drivers/net/wireless/`, etcetera,   * unused networking like `/net/bluetooth/`, `/net/wimax/`, `/net/decnet/`, etcetera What (and how) are the options for **stripping** the unused items out of the `linux-headers-` package and/or otherwise **reduce** the **file size**?


title: Can I use Gnome 3 Shell "Activities" hot corner in VMWare Player VM?

text: I have Fedora 19 running Gnome 3 Shell installed on my laptop, and in a virtual machine running inside VMWare Player on my desktop. The VM has the proprietary VMWare tools and is up to date as of today. On the laptop I am used to opening the menu by "poking" the corner with the mouse. However I am unable to be able to get it to work in the VM. I have tried putting the VM to fullscreen and also installing an extension to Gnome that allowed me to configure things like the hot corner threshold. However they did not seem to have any kind of effect. Is there something in the fact that I run it inside a VM that keeps me from being able to use the hot corner?


title: how does /etc/init.d/networking restart cause wpa_supplicant to be run using the previous configurations?

text: **Background:** I use Debian Lenny and have two WiFi interfaces. I use a generic configurations on `/etc/network/interfaces`               iface wlan0 inet static             address 10.0.0.1             network 10.0.0.0             netmask 255.255.255.0             broadcast 10.0.0.255          auto wlan1     iface wlan1 inet static             address 192.168.5.1             network 192.168.5.1             netmask 255.255.255.0             broadcast 192.168.0.25      So it has no sign about the `wpa_supplicant`. I use wpa_supplicant (v2.0) manually to connect them to a WLAN via `/etc/wpa_supplicant.conf` (for wlan0) and `/etc/wpa_supplicant2.conf` (for wlan1). **Problem:** While the wifi interfaces are connected to WLANs, I do               ip link set wlan0 down     ip link set wlan1 up     rm /var/run/wpa_supplicant/wlan0     rm /var/run/wpa_supplicant/wlan1      Then I do `ip link set wlan0 (and 1) up`. In that case, the iwconfig shows that the wifi interfaces are not connected to any network. After that, I run `/etc/init.d/networking restart`. When the process is completed, iwconfig shows that the wifi interfaces are connected to the WLANs that they were previously connected. **Question:** How come `/etc/init.d/networking restart` cause wpa_supplicant to be run by using the .config file for the interface that were used before (wpa_suppliant.conf for wlan0 and wpa_supplicant2.conf for wlan1)? I repeated this procedure many times and each time the wifi interfaces are connected to the same network that are defined on the .config files. **What I have done:** **1)** I suspected that `/etc/init.d/networking` script uses wpa_supplicant somehow. Therefore, I took a look at the script:                    #!/bin/sh -e         ### BEGIN INIT INFO         # Provides:          networking         # Required-Start:    mountkernfs ifupdown $local_fs         # Required-Stop:     ifupdown $local_fs         # Default-Start:     S         # Default-Stop:      0 6         # Short-Description: Raise network interfaces.         ### END INIT INFO     PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"          [ -x /sbin/ifup ] || exit 0          . /lib/lsb/init-functions          process_options() {         [ -e /etc/network/options ] || return 0         log_warning_msg "/etc/network/options still exists and it will be IGNORED! R     ead README.Debian of netbase."     }          check_network_file_systems() {         [ -e /proc/mounts ] || return 0              exec 9<&0 < /proc/mounts         while read DEV MTPT FSTYPE REST; do             case $DEV in             /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)                 log_warning_msg "not deconfiguring network interfaces: network devic     es still mounted."                 exit 0                 ;;             esac             case $FSTYPE in             nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse     .curlftpfs)                 log_warning_msg "not deconfiguring network interfaces: network file      systems still mounted."                 exit 0                 ;;             esac         done         exec 0<&9 9<&-     }          case "$1" in     start)                  process_options                  log_action_begin_msg "Configuring network interfaces"             if ifup -a; then                 log_action_end_msg $?             else                 log_action_end_msg $?             fi             ;;          stop)             check_network_file_systems                  log_action_begin_msg "Deconfiguring network interfaces"             if ifdown -a --exclude=lo; then                 log_action_end_msg $?             else                 log_action_end_msg $?             fi             ;;          force-reload|restart)             process_options                  log_action_begin_msg "Reconfiguring network interfaces"             ifdown -a --exclude=lo || true             if ifup -a --exclude=lo; then                 log_action_end_msg $?             else                 log_action_end_msg $?             fi             ;;          *)             echo "Usage: /etc/init.d/networking {start|stop|restart|force-reload}"             exit 1             ;;     esac          exit 0      `ifupdown` is a script that kills the wpa_supplicant before ifdown is executed (as that script explains so). I don't know shell or bash programming, but as I understood, restart only does ifdown and ifup the interfaces. **2)** Read the ifup's man page which says: > The ifup and ifdown commands may be used to configure (or,respectively, > deconfigure) network interfaces based on interface definitions in the file > /etc/network/interfaces. my `/etc/network/interfaces` does not include any configuration about the wpa_supplicant.


title: How do you force the navigation and extension buttons to appear on a pop-up window in Chrome?

text: Sometimes a link on a website causes a new browser window to pop up and sometimes this window doesn't show any navigation buttons, the options menu, or any extension buttons. For example, this occurs when you "pop-out" a chat window in gmail: ![gmail popped-out chat window](http://i.stack.imgur.com/yCiW9.png) How can I force the navigation and extension buttons to appear?


title: Get files on remote copy but not local

text: I have a folder. I have one copy of this folder locally and one on a server. I edited my local folder as I wanted and then rsync it to the server. Is there any way of comparing those two copies, local and remote, and get back a list of files that are on the remote one and not the local one?


title: linux-firmware-nonfree hangs my system, but I need it for 3D graphics

text: I'm on Debian Sid, fully up-to-date. I need `firmware-linux-nonfree` in order to get 3D graphics, but unfortunately, when I install it, my system hangs at boot at the point where it waits for /dev to be populated. I'm using System V Init (Debian default). Is there anything I can do about this? Here's my graphics card information:               alex-debian ओम् ~:(14h4m|git@master)     590 ± lspci | grep VGA         00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)     01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Whistler [Radeon HD 6630M/6650M/6750M/7670M/7690M]     alex-debian ओम् ~:(14h4m|git@master)     591 ±


title: I can't access my computer through specific port?

text: On Fedora I tried to access port 1521, so I opened the following port on my firewall:               $ sudo iptables -I INPUT -i eth0 -p tcp -m tcp --dport 1521 -j ACCEPT     $ sudo service iptables save      I then tried to telnet to my inner IP (the IP that the router gave me) and got connection refused:               $ telnet 192.168.1.103 1521     Trying 192.168.1.103...          telnet: connect to address 192.168.1.103: Connection refused      I then tried to telnet to my internet IP and didn't get any response:               $ telnet x.x.x.x 1521     Trying x.x.x.x...      As far as I can tell, I've opened my port on the router also, BTW, I also tried it with port 22 and got the same result.


title: Expanding functionality of case switching commands in Vim

text: In my current work of refactoring a fairly large codebase, I find myself wanting to replace apostrophes and quotes with each other from time to time. Up until now I've been applying `s/"/'/g` for visual selections I've made, and it works fine. Recently though, I discovered the tilde (`~`) command. I thought it would be nice if I could expand its functionality to not only change the case of characters, but also exchange `"` with `'` and vice versa. Is it possible to expand its functionality to accomplish this?


title: Per process firewall?

text: I've been reading around but can't seem to find a way to create per-process firewall rules. I know about `iptables --uid-owner` but that only works for outgoing traffic. I've considered scripting `netstat` and `iptables` but this seems terribly inefficient since if a process is only active for a small time- frame the script might miss it. Basically I want to enforce specific restrictions regarding port and dst on a process while leaving other processes unaffected. Any ideas? * * * For reference selinux can do exactly this and it works fairly well. Setup is a bit of a pain though.


title: Shomehow the rx/tx-counters on the interface resets

text: When doing ifconfig from hour to hour I notice that the counters for RX/TX bytes transfers resets: RX bytes:921640934 (921.6 MB) TX bytes:4001470884 (4.0 GB) How come? I would like to keep track how much data i transfer from day to day but they keep resetting.


title: Optimal Linux Distro to Install to SD card to use as USB-Bootloader for PC?

text: (Copied from andoid stackexchange) Many people install Linux-based distros on USB drives to use for, largely, basic PC troubleshooting. Has anyone tried installing such a thing on their Android phone's SD card? That way instead of carrying about both a USB drive and a phone, one could simply plug their phone in, boot the PC from USB, and set about performing whatever actions are necessary. Does anyone have any recommendations for particular flavors of Linux which are best suited to this task?


title: Share a directory over FTP with chroot_local enabled

text: I'm using vsftpd. By default, when I create a user, they are jailed in their directory which is `/home/user`. I have enabled `chroot_local_user=YES`. On the other hand, I also wanted to create a shared directory for all the FTP users. so in a nutshell, they have their own directory and they have a shared group folder               /     +/home        +user1        +shared_folder      How can I give the users access to the shared directory over FTP?


title: Is there a way to mirror USB outputs?

text: I'm currently writing a program for a project. It is for a braille reading system where I have a braille display connected via USB that is controlled by a program called brltty. One of the requirements for this project is to have the ability to connect more than one braille display although only let the master display have control of the system. I thought the easiest way to do this was, rather than having to send commands to every instance of brltty in my program, I could just mirror what is output to the main USB, to each USB port. Is this possible?


title: GRUB2 chainloader: Why doesn't this work?

text: I'm trying to create a multiboot USB flash drive by using GRUB2 to chainload different partitions on the drive. It's not working. I _do not_ want advice on how to create a multiboot flash drive; I know there are lots of ways to do that. I am _only_ interested in figuring out why this particular method doesn't work. Some background: I have two USB drives, let's call them USB1 and USB2. I am currently trying to install Debian Wheezy on either one of them in a multiboot-friendly way. Now, if I simply dd the iso onto USB1 (/dev/sdb):               dd conv=notrunc bs=4M if=/path/to/iso of=/dev/sdb      That creates a nice, bootable drive from which I can installed Debian. Furthermore, if I install GRUB2 on USB2 I can successfully chainload USB1 from it with:               search --label --set=root "Debian 7.0.0 i386 1"     chainloader +1     boot      Now for my problem: If I instead create a second partition on USB2 and dd the iso onto that:               dd conv=notrunc bs=4M if=/path/to/iso of=/dev/sdc2      Chainloading that doesn't work. It doesn't throw any error message, but simply gives me a black screen with a blinking dash (unresponsive). (I tried this with both drives, so I don't think faulty hardware is to blame). Why doesn't this work? What's the difference between chainloading a different drive, and chainloading a different partition on the same drive when they contain the exact same data?


title: Is there apt-get for windows?

text: If it was windows machine that had no internet connection, what I would do is downloading the installers/programs on another computer, putting them on a portable media, copying them on the conectionless machine and install them. Linux does not work that simple unfortunately - though I hope you'll prove me wrong on this point. On linux (debian), I never had the pleasure installing anything differently than through:               sudo apt-get install package_name(s)      Thing impossible without connection to the internet. Unfortunately, it's also very unclear which files are to be downloaded - and from where. Often apt downloads dozens of files which is something I'd hate to do manually. So, is there a program that would download the files on my Windows PC with no need to do anything more than telling it package name?


title: How do I minimize disk space usage

text: One of my machines is the **2GB EeePC Surf** , a neat netbook with very limited resources. So limited that right now, I have **22MB** free space left. On it, I'm running **Arch Linux** with the **Openbox** DE and a host of needed applications for it to function as a mobile PC. What methods are available to stamp out some unnecessary used space?


title: Command-line mv exclusion list

text: Is there a way to `mv`,`cp`, or any file operation such that I could specify all the files I _don't_ want affected? For example, say I have a folder with the files `file1`, `file2`, and `file3`, and I want to move `file1` and `file2` somewhere. Rather than explicitly naming the files to move (`mv file1 file2 /path/to/destination`), I want to name the files _not_ to move and have all the others in the folder get moved (`mv --some-switch file3 /path/to/destination`)


title: Human readable system memory reading crom CLI?

text: On OS X, I get a nice _human readable_ system memory reading like so:               printf -v system_memory \               "$(system_profiler SPHardwareDataType \                  | awk -F ': ' '/^ +Memory: /{print $2}')"     echo "$system_memory"      prints out the friendly:               4 GB      Although this on Linux is correct:               lshw -class memory      it outputs:               size: 4096MiB      I need to painfully parse it and try to make it into a string as nice as the one above. Am I using the wrong command?


title: Is it possible to break long lines in sshd_config?

text: Specifically `AllowUsers` parameter: e.g. convert this               AllowUsers user1 user2 user3 user4      to this               AllowUsers         user1         user2         user3         user4


title: Remapping a keyboard key to print ⸮ (irony mark)

text: I find myself using the irony mark ⸮ unicode U+2E2E (or ؟ unicode U+061F) in both mcabber and vim a lot. The old copy-and-paste antipattern is tedious so I thought I would rename one of the many useless keyboard keys I have to print it. So, my question is three-fold (but really the same question):   * How to do it in mcabber?   * How to do it in awesome? Since that's the window manager I use, it should work for all application, right?   * How to do it using xmodmap or some other arcane X11 incantation? Note that in vim this is trivial, just add `map! ;; ⸮` in your `~/.vimrc` file so in insert mode all you need is to type ";;" to get it replaced.


title: operator in if condition

text: I am using the below script to move two days back when script runs at starting two days of the year and also check first and second days of every month and move two days back.               if [$month="01"] && [$day="01"];     then         date="$last_month/$yes_day/$last_year"           fulldate="$last_month/$yes_day/$last_year"     else     if [$month="01"] && [$day="02"];     then              date="$last_month/$yes_day/$last_year"           fulldate="$last_month/$yes_day/$last_year"     else        if [ $day = "01" ];     then         date="$last_month/$yes_day/$year"                 fulldate="$year$last_month$yes_day"     else             if [ $day = "02" ];     then         date="$last_month/$yes_day/$year"             fulldate="$year$last_month$yes_day"     else         date="$month/$yes_day/$year"             fulldate="$year$month$yes_day"                     fi                    fi                   fi     fi      But my bad am getting the below error message               Etime_script.sh: line 19: [06=01]: command not found     Etime_script.sh: line 24: [06=01]: command not found


title: Install qtile 1.6 from the source

text: I try to install qtile from the source, you can see also this link: Install libxcb from source When I try to launch `qtile` I have this error, I do not understand why:               Traceback (most recent call last):       File "/usr/local/bin/qtile", line 5, in <module>         pkg_resources.run_script('qtile==0.6', 'qtile')       File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script         self.require(requires)[0].run_script(script_name, ns)       File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script         execfile(script_filename, namespace, namespace)       File "/usr/local/lib/python2.7/dist-packages/qtile-0.6-py2.7.egg/EGG-INFO/scripts/qtile", line 26, in <module>         from libqtile import confreader, manager       File "/usr/local/lib/python2.7/dist-packages/qtile-0.6-py2.7.egg/libqtile/confreader.py", line 29, in <module>         import utils       File "/usr/local/lib/python2.7/dist-packages/qtile-0.6-py2.7.egg/libqtile/utils.py", line 26, in <module>         import xcbq       File "/usr/local/lib/python2.7/dist-packages/qtile-0.6-py2.7.egg/libqtile/xcbq.py", line 5, in <module>         from xcb.xproto import CW, WindowClass, EventMask     ImportError: No module named xcb.xproto      I installed all the dependency and xpyb also.


title: Copy a file that is in the middle of being written

text: I have a program that writes to the standard output. It does not write all info at once, it does computation and then writes new bits. The output of the program is being stored in a file.               $ ./theprogram.sh > results.csv      While the script was running I copied `results.csv` to peek at numbers. After that, next copies of the file show no changes even though some records should be added there. What happened to the original file after I copied during writing? Are new records being discarded?


title: System packages not detected by the Oracle installer

text: I am installing Oracle 11g 32bit on Ubuntu Linux and the setup shows the following error message on `Prerequisite Checks` screen:               This is a prerequisite condition to test whether the package "make-3.80" is available on the system. (more details)     Expected Value      : make-3.80     Actual Value      : missing      On the commandline when I run `sudo apt-get install make` I get:               make is already the newest version.      There are lot of other dependencies that setup is not able to find. Why can't it find them?


title: The HOST variable in /etc/sudoers

text: suppose `mymachine:/etc/sudoers` includes the line               joe  someremotehost = (ALL) NOPASSWD: ALL      but `someremotehost:/etc/sudoers` does **not** say anything special about `joe`, then what effect does the above line have?


title: Joining two files with unique identifier

text: I have two files with approximately 12900 and 4400 entries respectively, that I want to join. The files contain location information for all landbased weather observing stations around the globe. The largest file is updated biweekly, and the smaller once a year or so. The original files can be found here (http://www.wmo.int/pages/prog/www/ois/volume-a/vola-home.htm and http://weather.rap.ucar.edu/surface/stations.txt). The files I have are already manipulated by me with some mixed awk, sed, and bash script. I use the files to visualize data using the GEMPAK package, that is freely available from Unidata. The largest file will work with GEMPAK, but only not with its full capability. For this a join is needed. File 1 contains location information for weather observing stations, where the first 6 digits is the unique station identifier. The different parameters (station number, station name, country code, latitude longitude, and station elevation) are defined only by its position in the line, i.e. no tabs.                        060090 AKRABERG FYR                        DN  6138   -666     101              060100 VAGA FLOGHAVN                       DN  6205   -728      88              060110 TORSHAVN                            DN  6201   -675      55              060120 KIRKJA                              DN  6231   -631      55              060130 KLAKSVIK HELIPORT                   DN  6221   -656      75              060160 HORNS REV A                         DN  5550    786      21              060170 HORNS REV B                         DN  5558    761      10              060190 SILSTRUP                            DN  5691    863       0              060210 HANSTHOLM                           DN  5711    858       0              060220 TYRA OEST                           DN  5571    480      43              060240 THISTED LUFTHAVN                    DN  5706    870       8              060290 GROENLANDSHAVNEN                    DN  5703   1005       0              060300 FLYVESTATION AALBORG                DN  5708    985      13              060310 TYLSTRUP                            DN  5718    995       0              060320 STENHOEJ                            DN  5736   1033      56              060330 HIRTSHALS                           DN  5758    995       0              060340 SINDAL FLYVEPLADS                   DN  5750   1021      28      File 2 contains the unique identifier in File 1 and a second, 4 character identifier (ICAO locator).               060100 EKVG     060220 EKGF     060240 EKTS     060300 EKYT     060340 EKSN     060480 EKHS     060540 EKHO     060600 EKKA     060620 EKSV     060660 EKVJ     060700 EKAH     060780 EKAT      I want to join the two files, so that the resulting file will have the 4 character identifier in the first 4 positions in the line, i.e. the identifier should replace the 4 spaces.                        060090 AKRABERG FYR                        DN  6138   -666     101     EKVG     060100 VAGA FLOGHAVN                       DN  6205   -728      88              060110 TORSHAVN                            DN  6201   -675      55              060120 KIRKJA                              DN  6231   -631      55              060130 KLAKSVIK HELIPORT                   DN  6221   -656      75              060160 HORNS REV A                         DN  5550    786      21              060170 HORNS REV B                         DN  5558    761      10              060190 SILSTRUP                            DN  5691    863       0              060210 HANSTHOLM                           DN  5711    858       0     EKGF     060220 TYRA OEST                           DN  5571    480      43     EKTS     060240 THISTED LUFTHAVN                    DN  5706    870       8              060290 GROENLANDSHAVNEN                    DN  5703   1005       0     EKYT     060300 FLYVESTATION AALBORG                DN  5708    985      13              060310 TYLSTRUP                            DN  5718    995       0              060320 STENHOEJ                            DN  5736   1033      56              060330 HIRTSHALS                           DN  5758    995       0     EKSN     060340 SINDAL FLYVEPLADS                   DN  5750   1021      28      Is it possible to accomplish this task with some bash and/or awk script?


title: Only value required using mysql command

text: I created following command to get value of Innodb_data_writes using command show status in mysql database.                mysql -u root -p**** -e  "show  status" | grep  Innodb_data_writes      **Current Output** : Innodb_data_writes 3 **Desired Output:** 3 How can I eliminate Innodb_data_writes ?


title: FreeBSD: Partition with Multiple Mount Points

text: On the latest FreeBSD installation, how can I make a partition have both `/var/` and `/tmp/` as a mount point? That is, one partition would contain `/var/` and `/tmp/`. Is that even possible? I know of course that a mount point of / will contain everything not specified, but can I specifically say `/dev/ad0p3/` has `/tmp/` and `/var/` as a mount point?


title: FreeBSD: Put Server Files on Its Own Partition/Slice

text: When installing FreeBSD v9, can I specify that a particular partition/slice have /var/www/ as a mount point?


title: GRUB doesn't see ext4 partitions (error: no such partition)

text: I have strange trouble with Linux Mint 13 installation. I have Windows XP installed, I want to install Linux Mint as a second system (with dual boot), I've already done it multiple times on several machines, with exactly the same Mint version and even exactly the same installation media. But this time, I'm running into troubles: just after new Linux Mint installation is complete, I reboot, and I see the following:               error: no such partition     grub rescue>      I googled much and tried all of this: http://itsfoss.com/solve-error- partition-grub-rescue-ubuntu-linux/ and similar howto-s, nothing helped. I.e. I've reinstalled grub, no errors reported, but when I reboot, I got the same error again. But then, I've noticed strange fact. I have two NTFS partitions: `/dev/sda1` and `/dev/sda5`. My main Linux partition is on `/dev/sda6`, swap is `/dev/sda7`. Then, in grub rescue prompt, I've entered `ls`, and the output is:               (hd0) (hd0,msdos5) (hd0,msdos1)      But, all of these partitions are actually NTFS! So that it doesn't see my `ext4` partition completely. That's why it says "no such partition". Note that if I load via livecd and gun gparted, I see all of these partitions, everything looks fine. Of course I can mount it somewhere and `chroot` into it, it works. But, GRUB doesn't see them. What could be the trouble, and how to fix it? **UPD:** output of `sfdisk -d /dev/sda`:               mint@mint ~ $ sudo sfdisk -d /dev/sda     Warning: extended partition does not start at a cylinder boundary.     DOS and Linux will interpret the contents differently.     # partition table of /dev/sda     unit: sectors          /dev/sda1 : start=       63, size=102392577, Id= 7, bootable     /dev/sda2 : start=102392701, size=522749059, Id= 5     /dev/sda3 : start=        0, size=        0, Id= 0     /dev/sda4 : start=        0, size=        0, Id= 0     /dev/sda5 : start=102392703, size=324082017, Id= 7     /dev/sda6 : start=426475520, size=194473984, Id=83     /dev/sda7 : start=620951552, size=  4190208, Id=82      I'm not sure what exactly does that warning mean, but note that on another machine with the same configuration (WinXP + Linux Mint) I have very similar output of `sfdisk`, so that it shouldn't be a problem. **UPD2:** As @AvinashRaj suggested, I tried boot-repair, but it didn't help. Log: http://paste.ubuntu.com/7209498/ (it seems there was some problems, but at the end it reported `Boot successfully repaired.`) And let me repeat that the GRUB just doesn't see my linux partitions (`sda6` and `sda7`), for some reason. http://paste.ubuntu.com/7209498/


title: vsftpd - how to allow user to delete files added by another user/group

text: I have 2 CentOS servers, A and B A, our live server, has an instance of Apache Tomcat running, that downloads files from an external FTP server. After it has downloaded these files, it also copies them to another folder "outbox". These files are all owned by user:group tomcat7:tomcat7, with 664 permissions. I have installed vsftp on A, and created a user, "dev_user", whose home directory is the "outbox" B, our dev server, has an instance of Apache Tomcat running, that downloads files from A's FTP server. What I would like, is that once "dev_user" has completed a GET on a file, they can also issue RM on that file, and it will then be removed from "outbox" Any ideas?


title: Remove complete line in text files based on Tags

text: For example : 01.txt, 02.txt, 03.txt and 04.txt has following values.               HDR|A|B|C|D|F|||||||     DTL|1|2|3|4|5|||||||||||     DTL|5|6|7|8|9|||||||||||     TLR|A|B|C|D|F|||||||      I have to remove complete lines based on tags like HDR, TLR. Once HDR and TLR lines are removed from four files, it should merge into single file . we should merge in such way , should maintain files orders after removing HDR , TLR lines.(01_latest.txt, 02_latest_txt, 03_latest.txt and 04_latest.txt) How can we achieve in UNIX Script?


title: Remove 2 and 3 newlines in a text file but not 1

text: I'm developing on a max osx 10.8 and have no preferences to which tool to use probably `sed` but it doesn't matter. **Update after comment:** The input file uses windows new lines if that's complicates things I can pre process them to change the new lines to linux style.               Text          Text                    text               text          text      And I would like an output file like this               Text          Text     text     text          text


title: Display possible corrections but do not apply them automatically

text: I have the following completion:               zstyle ':completion:*' completer _complete _approximate       As a result if I type something incorrectly and hit TAB I will see a list with corrected propositions (what I like) and at the same time misspelled word will be changed automatically at command line with first proposition (what I do not like). So how to get rid of this in-line automatic correction? I just want list of possible correction but command line should stick with original text.


title: How do I find the window dimensions and position accurately including decorations?

text: I've been trying to figure out the size of a window for use in a small script. My current technique is using `wmctrl -lG` to find out the dimensions. However, the problem is this: The x and y figures it gives are for the top left of the window decorations, while the height and width are for just the content area. This means that if the window decorations add 20px of height and 2px of width, wmctrl will report a window as being 640x480, even if it takes up 660x482 on screen. This is a problem because my script's next step would be to use that area to tell ffmpeg to record the screen. I would like to avoid hardcoding in the size of the window decorations from my current setup. What would suit is either a method to get the size of the window decorations so I can use them to figure out the position of the 640x480 content area, or a way to get the position of the content area directly, not that of the window decorations. This horribly-rough not-at-all-to-scale diagram should illustrate: ![](http://i.stack.imgur.com/6fn4U.png)


title: ignore hosts file in ZSH ssh/scp tab-complete

text: I use a hosts file to block ads/malware domains. When I use ssh or scp in zsh and try to tab-complete, it takes a good 5-10 seconds before anything appears and what does appear is usually a list of 20+ domains I have blocked, and buried in there is the file I need. I've search online quite a bit, and found helpful hints of how to add this sort of auto-completion, but I can't figure out how to remove it. I basically never want the tab-complete to search my hosts file (I use known-hosts for the servers I actually do want to tab-complete to). This is on OS X.


title: Puzzle: transfering files between two servers (ssh, ftp, http multipart...)

text: A puzzle: files being uploaded in realtime by SCP to SERVER1 need to be transfered to SERVER2. But:   * SERVER1 doesn't actually have network access to SERVER2 (NAT), however SERVER2 has SSH access to SERVER1   * SERVER1 and SERVER2 both are running Linux   * SERVER2 has FTP server running, can ran HTTP server to receive files,    * SFTP server on SERVER2 is not an option   * Files transfered to SERVER2 need to be deleted from SERVER1 on successful transfer Preference is to use running FTP server on SERVER2 Any ideas on simple ways to transfer files from SERVER1 to SERVER2? ps. FTP over reverse SSH tunnel was ruled out, curl would probably work over reverse SSH tunnel with HTTP server running on SERVER2 but it requires HTTP server which is more work.


title: Problem with formating Flash Disk

text: I have intsalled Arch Linux ISO file into Flash disk through following command :               dd bs=2M if=~/archlinux-2013.11.01-dual.iso of=/dev/sdd      Now, I'm trying to format flash disk with following command :               sudo mkfs.vfat -F 32 /dev/sdd      But it gets me following error : > mkfs.vfat: Device partition expected, not making filesystem on entire device > '/dev/sdd' (use -I to override) **P.S :** The output of `sudo fdisk -l` :               Disk /dev/sda: 298.1 GiB, 320072933376 bytes, 625142448 sectors     Units: sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disklabel type: dos     Disk identifier: 0xf3286bd2          Device    Boot     Start       End    Blocks  Id System     /dev/sda1 *    119700315 154850534  17575110  83 Linux     /dev/sda2       19834880 119700314  49932717+  7 HPFS/NTFS/exFAT     /dev/sda3      154850535 174385574   9767520  83 Linux     /dev/sda4      174385575 625137663 225376044+  f W95 Ext'd (LBA)     /dev/sda5      174385638 185610192   5612277+ 82 Linux swap / Solaris     /dev/sda6      185610256 338423679  76406712   7 HPFS/NTFS/exFAT     /dev/sda7      338423808 477687807  69632000   7 HPFS/NTFS/exFAT     /dev/sda8      477689856 625137663  73723904   7 HPFS/NTFS/exFAT          Partition table entries are not in disk order.          Disk /dev/sdd: 7.5 GiB, 8019509248 bytes, 15663104 sectors     Units: sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disklabel type: dos     Disk identifier: 0x00000000


title: jbd2 journal constant i/o

text: `iotop` reports a constant i/o about 3% of [jbd2/vda1-8], I think this is the journal manager for ext4. my `fstab` is:               UUID=X       /         ext4 defaults,noatime,nodiratime 1 1     tmpfs        /dev/shm  tmpfs    defaults,noatime,nodiratime 0 0     devpts       /dev/pts        devpts gid=5,mode=620  0 0     sysfs        /sys      sysfs    defaults    0 0     proc         /proc     proc defaults    0 0     /usr/tmpDSK  /tmp      ext3 rw,noexec,nosuid,nodev,noatime  0 0     UUID=Y       swap      swap defaults    0 0     /tmp         /var/tmp  ext3    defaults,bind,noauto      How can I get rid of this i/o, or at least reduce it.


title: Cron does not execute xinit command

text: I have a command that works perfectly when launched from the prompt:               xinit /home/user/myscript.sh -- /usr/bin/Xvfb :1 -screen 0 1x1x8      But is not executed when put in crontab:               @reboot xinit /home/user/myscript.sh -- /usr/bin/Xvfb :1 -screen 0 1x1x8      Content of myscript.sh :               #!/bin/sh     dbus-launch     pulseaudio --start     sleep 99999999      See output of `htop`, command is weirdly executed: ![enter image description here](http://i.stack.imgur.com/1S4lB.png) Even though the X session is active on reboot.


title: How to add zero (0) in blanks in a big file (example file is below)

text: Here is a example file where I need to replace blanks with zero               A   2   2   2   2   2     B   2   2   2   2   2     C   2   2   2   2   2     D   A                    E   B                    F     D     R


title: pass piped variable to perl oneliner

text: if you have something like:               find . -d -maxdepth 1 | wc -l | perl ...      what ways do you have to tell perl to take this variable that's coming its way and substract 1? I try to substract 1 since find is counting 1 too much.


title: Empathy sets status to "offline" when I set it to "invisible"?

text: my system is Fedora 18 and my empathy version is 3.6.4, when I change the Empathy status to invisible, it changes to offline and contact lists disappear and my profile status changes to unavailable(the top-right corner of the screen). as you see... ![image description](https://ask.fedoraproject.org/upfiles/13649135712519489.png) the only difference between this state and "offline mode" is : when I choose invisible and this state happens, I am still connected, because when I choose available, I can see the contact list instantly and it doesn't need to connect again to my accounts. I updated the whole system , but I still have this problem.


title: How to resolve midgard2 already loaded?

text: When running PHP on my Ubuntu 13.04 machine I get the following warning:                PHP Warning:  Module 'midgard2' already loaded in Unknown on line 0      This tells me exactly nothing. How could I resolve this issue? I tried purging all components having midgard in their name and reinstalling `php5-midgard2` \-- the error remains.


title: How to debug and fix slow autocomplete in bash?

text: After a recent update (Ubuntu 12.04 LTS), TAB complete on the command line is slow. After entering a partial command (e.g `evi [TAB]`) or partial filename (e.g. `evince somedocu[TAB]`) the shell, sometimes though not always, hangs for several seconds. Personally, I'd prefer a less powerfull autocomplete to a slow one. Is there a simple fix? **Edit:** Additional information related to comments:   * PATH is pretty standard. ~/bin has some bash scripts              $ echo $PATH     /home/USERNAME/bin:/usr/local/bin:/usr/bin:/bin:/usr/games        * The number of files in the working directory is less than 100.   * The autocomplete feature was especially slow after unusual disk activity (system upgrade). It is, thus, possible, that rereading /usr/bin and other directories caused the lag.


title: How to tell Linux Kernel > 3.0 to completely ignore a failing disk?

text: I am asking this question here in the hope that some Linux-kernel guru can have an answer. This question has been asked on AskUbuntu and on SuperUser without answers: thinking better, it is really Linux-kernel specific, so I think its natural place is on this forum. I have a Samsung laptop (Chronos s7) with one SATA hard disk on bus `ata:1`, which is detected as `/dev/sda`, an 8G SSD on `ata:2`, `/dev/sdb`, and various other devices on the rest of SATA interface. The problem is that the SSD disk is   * soldered to the main board (unmovable)    * busted (it just gives I/O errors for any operation)    * it does not appear in the bios (probably because it is broken) Now this disk:   * delays the boot three to five minutes trying to probe the failing disk, which is annoying;   * but the most annoying thing is that the system fails to suspend due to `/dev/sdb` failing.  Notice that I can live with the delay at boot --- what worries me is the resume/suspend thing. * * * **So the question is:** can I tell the kernel to avoid even probing the device on ata:2? In older kernel (<3.0), when I was still able to dig a bit into the source, there was a command-line parameter of the style `hdb=ignore` that would have done the trick. I have tried all the tricks proposed below with `udev` and `libata:force` kernel parameters, to no avail. Specifically, the following does not work:   1. Adding to one of the following `/etc/udev/rules.d/` a file (in early execution like `00-ignoredisk.rules` or in late as `99-ignoredisk.rules` or in both places)              SUBSYSTEMS=="scsi", DRIVERS=="sd", ATTRS{rev}=="SSD ", ATTRS{model}=="SanDisk iSSD P4 ", ENV{UDISKS_IGNORE}="1"       nor              KERNEL=="sdb", ENV{UDISKS_IGNORE}="1"      nor a lot of intermediate solutions --- this makes the disk not accessible after boot, but it is probed at boot, and still checked when suspending --- causing the suspend to fail.   2. Editing the system files `/lib/udev/rules.d/60-persistent-storage.rules` (and `udisks`, `udisks2`) changing               KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-|md", GOTO="persistent_storage_end"      to              KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-|md|sdb*", GOTO="persistent_storage_end"      again, this has some effect, masking the disk from userspace, but the disk is still visible to the kernel.   3. Booting with all the possible combinations (well, a lot of them) of the `libata:force` parameters (found for example here) in order to disable DMA, lower speed or whatever about the failing disk --- does not work. The parameter is used, but the disk is still probed and fails. Full `udevadm info -a -n /dev/sdb` pasted to http://paste.ubuntu.com/6186145/ `smartctl -i /dev/sdb -T permissive` gives:              root@samsung-romano:/home/romano# smartctl -i /dev/sdb -T permissive     smartctl 5.43 2012-06-30 r3573 [x86_64-linux-3.8.0-31-generic] (local build)     Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net          Vendor:               /1:0:0:0     Product:                   User Capacity:        600,332,565,813,390,450 bytes [600 PB]     Logical block size:   774843950 bytes     >> Terminate command early due to bad response to IEC mode page      which is clearly wrong. Nevertheless:              root@samsung-romano:/home/romano# fdisk -b 512 -C 970 -H 256 -S 63 /dev/sdb     fdisk: unable to read /dev/sdb: Input/output error      (SSD data from http://ubuntuforums.org/showthread.php?t=1935699&p=11739579#post11739579 ).


title: How to add pattern to bash completion (for unzip)?

text: When I type               unzip <tab>      I get a list of all files ending in `.zip`, which is the standard behavior of tab completion for the `unzip` command. However, I also want bash completion for `unzip` list files which end in `.udp`, in addition to `.zip` files. How can I achieve this behavior in my local `.bashrc`?


title: how to include a new file into a patch

text: I try to make a patch as introduced here.   Say I have two directories `pp1(modified version)` and `pp0(clean version)`, I make a patch file `pp0.patch` with the `diff` command:                diff -crB pp0 pp1 > pp0.patch      The problem is if there is a file only in pp1, it won't be included into the patch. How to work around it? **UPDATE** :   I firstly change into the directory of pp0 and test whether the patch will succeed                 patch --dry-run -p1 -i /path-to-pp0.patch      Though I've added `--new-file` to the `diff` command, those only in `pp1` are not listed in the result **UPDATE** :   I've accidentally patched the wrong file so                 diff -crb --new-file pp1 pp0 > pp0.patch      or                 diff -crNb pp1 pp0 > pp0.patch      will do


title: Detect if an ELF binary was built with gprof instrumentation?

text: Is it possible to check if given program was compiled with GNU gprof instrumentation, i.e. with '-pg' flag passed to both compiler and linker, _without_ running it to check if it would generate a `gmon.out` file?


title: Gentoo versus Funtoo

text: I've heard that Funtoo is a somewhat improved version of Gentoo, but I haven't been able to find any concrete sources for this. Funtoo's website says this: > Funtoo Linux features native UTF-8 support enabled by default, a git-based, > distributed Portage Tree and funtoo overlay, an enhanced Portage with more > compact mini-manifest tree, automated imports of new Gentoo changes every 12 > hours, GPT/GUID boot support and streamlined boot configuration, enhanced > network configuration, up-to-date stable and current Funtoo stages, all > built using Funtoo's Metro build tool. Are those features actually worth the trouble of choosing Funtoo over Gentoo? Is the difference that noticeable?


title: Booting Laptop with external monitor stalls

text: Whenever I try to boot linux with an external monitor attached to my laptop, it hangs after checking the battery state with the following message repeated several times:               ...crtc_helper_set_config...      The only solution is to boot without the monitor attached, then attach it, and readjust my settings (turning off laptop screen, etc). Some have told me this is a kernel issue, others just shrug. Any ideas for a solution?


title: Does mc (Midnight Commander) have favourites for directories?

text: If I am in remote directory on different server via ssh I want to do to directory like `/var/lib/edumate/backup` without typing the whole path. Is there any way to do that in mc?


Why would someone choose FreeBSD over Linux? What are the advantages of FreeBSD compared to Linux? (My shared hosting provider uses FreeBSD.)


title: How can I display file info of a man?

text: I know when you are in a man page it will display the file name at the bottom inside the man. How can I do the same thing manually?


title: Installing AMD Radeon HD 7400M series fedora 20

text: I just installed fedora 20 on my second pc and its running pretty hot, I found a driver on the site http://support.amd.com/en- us/download/desktop?os=Linux%20x86_64. And i unpack it and i try sh sudo sh amd-driver- installer-13.35.1005-x86.x86_64.run and I get this Supported adapter detected. Check if system has the tools required for installation. fglrx installation requires that the system have kernel headers for 3.7 release. /lib/modules/3.11.10-301.fc20.i686+PAE/build/include/generated/uapi/linux/version.h cannot be found on this system. One or more tools required for installation cannot be found on the system. Install the required tools before installing the fglrx driver. Optionally, run the installer with --force option to install without the tools. Forcing install will disable AMD hardware acceleration and may make your system unstable. Not recommended. and I dont know what to do to het this right i have already tried: yum install kernel-devel kernel-headers gcc -y http://www.amd.com/US/PRODUCTS/NOTEBOOK/GRAPHICS/7000M/7400M/Pages/radeon-7400m.aspx


title: Search through kernel make menuconfig configuration menu entries

text: When I run make menuconfig inside /usr/src/linux directory, the kernel configuration wizard appears. How can I search through the menu entries inside the make menuconfig wizard? I've tested /, but / it appears that / searches only through the .config file. I.e. when I search for "pci dma", there are no results, however there exists an appropriate kernel menu entry to enable DMA for PCI devices. I was able to find the text of the menu entries inside Kconfig files. The Kconfig files are located in many subdirectories of /usr/src/linux directory. Still, searching through Kconfig files doesn't give me the actual "tree" view of the option I want to find. The command I used to find that one out: `grep -i --directories=recurse 'kprobes' /usr/src/linux --color=always | less` How can I search through the menu entries inside the make menuconfig wizard? ![enter image description here](http://i.stack.imgur.com/r67pV.jpg) //edit: A working solution: `find /usr/src/linux/ -name 'Kconfig' -exec egrep -i -B 1 '(tristate|bool|menu)' '{}' \; | grep -i -B 1 --color=always 'Device Drivers'` This will show up, what kernel .config name contains the .config label specified. All I have to do now is to look for the config name inside make menuconfig (by using /).


title: Binding lsmod module name with kernel configuration menu entry

text: Lets suppose I have a module named "mptsas". How can I find out, what kernel configuration menu entry (make menuconfig inside /usr/src/linux) corresponds to that module? By 'corresponds' I mean what menu entry compiles the appropriate module into the kernel. ![enter image description here](http://i.stack.imgur.com/wwI2H.png) //edit: it works very nicely: ![enter image description here](http://i.stack.imgur.com/ZR17K.jpg)


title: only one workspace

text: In the process of upgrading in Linux Mint, I've gotten a strange star-studded window with a spiraling spaceship but NO workspace options.               $ uname -a     3.1.0-1-686-pae #1 SMP Sun Dec 11 20:40:16 UTC 2011 i686 GNU/Linux      and `/etc/lsb-base` yields the distribution as: `debian "Linux Mint Xfce Edition"`. In Linux desktops, I have formerly been able to request a workspace manager via a right click in the lower or upper border. Now I get no response to a right click in any location!


title: Is it safe to close shell just by clicking "X" or using "ctrl+d"?

text: Is it safe to close shell just by clicking "X" or using "ctrl+d" while logged in as root with su or is it safer to close it by typing "exit"? Is there any difference (security-wise) at all or is it the same and it does not matter which way you use?


title: missing pieces of certain letters in text in Linux Mint

text: My problem is that as I type this message, in the second word, "problem", there are horizontal slices of missing bits in both the l and the m. Following perusal of a similar question on the askUbuntu site, my problems persist. Here are the results of my following several suggestions (answers) that were given: I've tried the `gksudo nvidia-settings` and `sudo fc-cache -v -f` suggestions to no avail /etc/lsb-base yields the distribution as: debian "Linux Mint Xfce Edition" `lspci | grep VGA` produces `00:02.0 VGA compatible controller: Intel Corporation 82915G/GV/910GL Integrated Graphics Controller (rev 04)` One suggestion suggested reinstalling an nVidia driver. Since I have an Intel VGA controller, is that suggestion pertinent? I was directed to "Administration - Hardware Drivers" but no such option is in my current "Applications" menu options. I currently have an new, odd desktop (window manager?) Another suggestion was to make an addition to xorg.conf in `/etc` or `/etc/X11`. I have no such file, only a directory: `/usr/share/X11/xorg.conf.d`


title: why does grep -A n give more lines than n?

text: I am verifying UID/GID for certain users using the dscacheutil command. Using grep with -A flag gives me what I need but the number of lines doesn't make sense. Output below:               Edit8:~ edit08$ dscacheutil -q user | grep -A 6 "userX"     name: userX     password: ********     uid: 2063     gid: 1021     dir: /Users/userX     shell: /bin/sh     gecos: User X          name: userA     password: ********     uid: 2013     Edit8:~ edit08$ dscacheutil -q user | grep -A 4 "userX"     name: userX     password: ********     uid: 2063     gid: 1021     dir: /Users/userX     shell: /bin/sh     gecos: User X          name: userA     Edit8:~ edit08$ dscacheutil -q user | grep -A 2 "userX"     name: userX     password: ********     uid: 2063     --     dir: /Users/userX     shell: /bin/sh     gecos: User X     Edit8:~ edit08$ dscacheutil -q user | grep -6 "userX"     uid: 2012     gid: 1010     dir: /Users/userB     shell: /bin/sh     gecos: User B          name: userX     password: ********     uid: 2063     gid: 1021     dir: /Users/userX     shell: /bin/sh     gecos: User X          name: userA     password: ********     uid: 2013     Edit8:~ edit08$ dscacheutil -q user | grep -A 2 "userX"     name: userX     password: ********     uid: 2063     --     dir: /Users/userX     shell: /bin/sh     gecos: User X     Edit8:~ edit08$ dscacheutil -q user | grep -A 3 "userX"     name: userX     password: ********     uid: 2063     gid: 1021     dir: /Users/userX     shell: /bin/sh     gecos: User X          Edit8:~ edit08$       While my logic dictates the magic number of lines would be 6, in fact it is 3. Anybody? Thanks


title: Understanding tc qdisc and iperf

text: I'm trying to limit bandwidth with `tc` and check the results with `iperf`. I started like this:               # iperf -c 192.168.2.1     ------------------------------------------------------------     Client connecting to 192.168.2.1, TCP port 5001     TCP window size: 23.5 KByte (default)     ------------------------------------------------------------     [  3] local 192.168.2.7 port 35213 connected with 192.168.2.1 port 5001     [ ID] Interval       Transfer     Bandwidth     [  3]  0.0-10.0 sec   830 MBytes   696 Mbits/sec      The two instances are directly connected with through Ethernet. I then set up a `htb` `qdisc` with one default class to limit bandwidth to 1mbit/sec:               # tc qdisc add dev bond0 root handle 1: htb default 12     # tc class add dev bond0 parent 1: classid 1:12 htb rate 1mbit      But I don't get what I expect:               # iperf -c 192.168.2.1     ------------------------------------------------------------     Client connecting to 192.168.2.1, TCP port 5001     TCP window size: 23.5 KByte (default)     ------------------------------------------------------------     [  3] local 192.168.2.7 port 35217 connected with 192.168.2.1 port 5001     [ ID] Interval       Transfer     Bandwidth     [  3]  0.0-12.8 sec   768 KBytes   491 Kbits/sec      If I double the rate, the measured bandwidth does not change. What am I missing? Why doesn't the the measured bandwidth correspond to the 1mbit from the `rate` parameter? What parameters do I need to set to limit the bandwidth to an exact given rate? However, the `man` page says that `tbf` should be the `qdisc` of choice for this task: > The Token Bucket Filter is suited for slowing traffic down to a precisely > configured rate. Scales well to large bandwidths. `tbf` requires parameters `rate`, `burst` and (`limit`| `latency`). So I tried the following without understanding how `burst` and (`limit`| `latency`) affect the available bandwidth:               # tc qdisc add dev bond0 root tbf rate 1mbit limit 10k burst 10k      This got me a measured bandwidth of 113 Kbits/sec. Playing around with those parameters didn't change that much until I noticed that adding a value for `mtu` changes things drastically:               # tc qdisc add dev bond0 root tbf rate 1mbit limit 10k burst 10k mtu 5000      resulted in a measured bandwidth of 1.00 Mbits/sec. What parameters would I need to set to limit the bandwidth to an exact given rate? Should I use the `htb` or `tbf` queueing discipline for this? **EDIT** : Based on these resources, I have made some tests:   * https://help.ubuntu.com/community/UbuntuBonding   * https://help.ubuntu.com/community/LinkAggregation   * /usr/share/doc/ifenslave-2.6/README.Debian.gz http://lartc.org/ I have tried the following setups. ## On a Physical Machine `/etc/network/interfaces`:               auto lo     iface lo inet loopback          auto br0     iface br0 inet dhcp     bridge_ports eth0      Measurement with `iperf`:               # tc qdisc add dev eth0 root handle 1: htb default 12     # tc class add dev eth0 parent 1: classid 1:12 htb rate 1mbit     # iperf -c 192.168.2.1     ------------------------------------------------------------     Client connecting to 192.168.2.1, TCP port 5001     TCP window size: 23.5 KByte (default)     ------------------------------------------------------------     [  3] local 192.168.2.4 port 51804 connected with 192.168.2.1 port 5001     [ ID] Interval       Transfer     Bandwidth     [  3]  0.0-11.9 sec  1.62 MBytes  1.14 Mbits/sec      Whereas the `iperf` server calculated a different bandwidth:               [  4] local 192.168.2.1 port 5001 connected with 192.168.2.4 port 51804     [  4]  0.0-13.7 sec  1.62 MBytes   993 Kbits/sec      ## On a Virtual Machine without Bonding `/etc/network/interfaces`:               auto lo     iface lo inet loopback          auto eth0     iface eth0 inet dhcp      Measurement with `iperf`:               # tc qdisc add dev eth0 root handle 1: htb default 12     # tc class add dev eth0 parent 1: classid 1:12 htb rate 1mbit     # iperf -c 192.168.2.1     ------------------------------------------------------------     Client connecting to 192.168.2.1, TCP port 5001     TCP window size: 23.5 KByte (default)     ------------------------------------------------------------     [  3] local 192.168.2.7 port 34347 connected with 192.168.2.1 port 5001     [ ID] Interval       Transfer     Bandwidth     [  3]  0.0-11.3 sec  1.62 MBytes  1.21 Mbits/sec      Whereas the `iperf` server calculated a different bandwidth:               [  4] local 192.168.2.1 port 5001 connected with 192.168.2.7 port 34347     [  4]  0.0-14.0 sec  1.62 MBytes   972 Kbits/sec      ## On a Virtual Machine with Bonding (tc configured on eth0) `/etc/network/interfaces`:               auto lo     iface lo inet loopback          auto eth0     allow-bond0 eth0     iface eth0 inet manual         bond-master bond0         bond-primary eth0 eth1          auto eth1     allow-bond0 eth1     iface eth1 inet manual         bond-master bond0         bond-primary eth0 eth1          auto bond0     iface bond0 inet dhcp         bond-slaves none         bond-mode 1     #    bond-arp-interval 250     #    bond-arp-ip-target 192.168.2.1     #    bond-arp-validate 3      Measurement with `iperf`:               # tc qdisc add dev eth0 root handle 1: htb default 12     # tc class add dev eth0 parent 1: classid 1:12 htb rate 1mbit     # iperf -c 192.168.2.1     ------------------------------------------------------------     Client connecting to 192.168.2.1, TCP port 5001     TCP window size: 23.5 KByte (default)     ------------------------------------------------------------     [  3] local 192.168.2.9 port 49054 connected with 192.168.2.1 port 5001     [ ID] Interval       Transfer     Bandwidth     [  3]  0.0-11.9 sec  1.62 MBytes  1.14 Mbits/sec      Whereas the `iperf` server calculated a different bandwidth:               [  4] local 192.168.2.1 port 5001 connected with 192.168.2.9 port 49054     [  4]  0.0-14.0 sec  1.62 MBytes   972 Kbits/sec      ## On a Virtual Machine with Bonding (tc configured on bond0) `/etc/network/interfaces`:               auto lo     iface lo inet loopback          auto eth0     allow-bond0 eth0     iface eth0 inet manual         bond-master bond0         bond-primary eth0 eth1          auto eth1     allow-bond0 eth1     iface eth1 inet manual         bond-master bond0         bond-primary eth0 eth1          auto bond0     iface bond0 inet dhcp         bond-slaves none         bond-mode 1     #    bond-arp-interval 250     #    bond-arp-ip-target 192.168.2.1     #    bond-arp-validate 3      Measurement with `iperf`:               # tc qdisc add dev bond0 root handle 1: htb default 12     # tc class add dev bond0 parent 1: classid 1:12 htb rate 1mbit     # iperf -c 192.168.2.1     ------------------------------------------------------------     Client connecting to 192.168.2.1, TCP port 5001     TCP window size: 23.5 KByte (default)     ------------------------------------------------------------     [  3] local 192.168.2.9 port 49055 connected with 192.168.2.1 port 5001     [ ID] Interval       Transfer     Bandwidth     [  3]  0.0-13.3 sec   768 KBytes   475 Kbits/sec      Whereas the `iperf` server calculated a different bandwidth:               [  4] local 192.168.2.1 port 5001 connected with 192.168.2.9 port 49055     [  4]  0.0-14.1 sec   768 KBytes   446 Kbits/sec      The result does not change if I remove `eth1` (the passive interface) from the bond. # Conclusion _Traffic Control_ on a bond interface does not work, or at least not as expected. I will have to investigate further. As a workaround one could add the _queueing disciplines_ directly to the interfaces belonging to the bond.


title: Walking through files in directory randomly

text: How to change `for track in *.mp3; do` so that all `.mp3` files in the current directory are walked through but in a random way?


title: Unable to change permissions of file system root

text: When I write ls -la the output is :               tusharmakkar08-Satellite-C660 tusharmakkar08 # ls -la     total 88     drwxr-x---+ 10 root root  4096 Apr 18 19:43 .     drwxr-xr-x   4 root root  4096 Mar 18 17:35 ..     drwxr-xr-x   4 root root 32768 Jan  1  1970 CFB1-5DDA     drwxrwxrwx   2 root root  4096 Feb 23 00:09 FA38015738011473     drwxrwxrwx   2 root root  4096 Apr 17 14:00 Local     drwxrwxrwx   2 root root  4096 Mar 19 05:04 Local\040Disk1     drwxrwxrwx   2 root root  4096 Apr 18 19:43 Local\134x20Disk1     drwxrwxrwx   2 root root  4096 Feb 23 00:09 Local Disk     drwxrwxrwx   1 root root 24576 Apr 19 15:15 Local\x20Disk1     drwxrwxrwx   2 root root  4096 Feb 23 00:08 PENDRIVE      Now I want to change the permissions of CFB1-5DDA .. but i am unable to do so . When I write               chmod 777 CFB1-5DDA      still the permissions remain unchanged. The output of               sudo blkid -c /dev/null      is               tusharmakkar08-Satellite-C660 tusharmakkar08 # sudo blkid -c /dev/null     /dev/sda2: UUID="FA38015738011473" TYPE="ntfs"      /dev/sda3: LABEL="Local Disk" UUID="01CD72098BB21B70" TYPE="ntfs"      /dev/sda4: UUID="2ca94bc3-eb3e-41cf-ad06-293cf89791f2" TYPE="ext4"      /dev/sda5: UUID="CFB1-5DDA" TYPE="vfat"      The output of               cat /etc/fstab       is               tusharmakkar08-Satellite-C660 tusharmakkar08 # cat /etc/fstab     # /etc/fstab: static file system information.     #     #                          #Entry for /dev/sda4 :     UUID=2ca94bc3-eb3e-41cf-ad06-293cf89791f2   /   ext4    defaults    01     #Entry for /dev/sda2 :     UUID=FA38015738011473   /media/sda2 ntfs-3g defaults,locale=en_IN   0   0     #Entry for /dev/sda5 :     UUID=CFB1-5DDA  /media/tusharmakkar08/CFB1-5DDA vfat    defaults    0   0     /dev/sda3   /media/tusharmakkar08/Local\134x20Disk1 fuseblk defaults,nosuid,nodev,allow_other,blksize=4096  0   0     /dev/sda3   /media/tusharmakkar08/Local\x20Disk1    ntfs-3g defaults,nosuid,nodev,locale=en_IN  0   0          #/dev/sda3  /media/tusharmakkar08/Local\134x20Disk1 ntfs    defaults,nls=utf8,umask=0222,nosuid,nodev   0   0      And the output of               mount      is               tusharmakkar08-Satellite-C660 tusharmakkar08 # mount     /dev/sda4 on / type ext4 (rw)     proc on /proc type proc (rw,noexec,nosuid,nodev)     sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)     none on /sys/fs/fuse/connections type fusectl (rw)     none on /sys/kernel/debug type debugfs (rw)     none on /sys/kernel/security type securityfs (rw)     udev on /dev type devtmpfs (rw,mode=0755)     devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)     tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)     none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)     none on /run/shm type tmpfs (rw,nosuid,nodev)     none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)     cgroup on /sys/fs/cgroup type tmpfs (rw,relatime,mode=755)     cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,relatime,cpuset)     cgroup on /sys/fs/cgroup/cpu type cgroup (rw,relatime,cpu)     cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,relatime,cpuacct)     cgroup on /sys/fs/cgroup/memory type cgroup (rw,relatime,memory)     cgroup on /sys/fs/cgroup/devices type cgroup (rw,relatime,devices)     cgroup on /sys/fs/cgroup/freezer type cgroup (rw,relatime,freezer)     cgroup on /sys/fs/cgroup/blkio type cgroup (rw,relatime,blkio)     cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,relatime,perf_event)     /dev/sda2 on /media/sda2 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)     /dev/sda5 on /media/tusharmakkar08/CFB1-5DDA type vfat (rw)     /dev/sda3 on /media/tusharmakkar08/Local\x20Disk1 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)     binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)     gvfsd-fuse on /run/user/tusharmakkar08/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=tusharmakkar08)


title: Why is dmesg called dmesg?

text: Is there any explanation/history behind the name of the command `dmesg` (which prints out some kernel messages)?


title: How to change title in gnome-terminal profile

text: I know how to load a specific terminal profile as well as loading a config file that the terminal reads, but every time I try to set the title and save the config file, it still returns to the default. I can only change the window title for that session and only with in the menus. If I try something like gnome-terminal --title="MyTerminal" this brings up a terminal, but the title is still at its default. So, how do I change the title from the command line and within a config file.