Wlan0 (Ralink RT2870/RT3070) missing after apt-get upgrade

As I've mentioned before I've run `apt-get update && upgrade` and my **wlan0** isn't working anymore - please help. The details you've may be asking me:               uname -a      `Linux pi.local 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux`               lsusb     Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.      Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB         Bus 001 Device 005: ID 148f:3070 Ralink Technology, Corp.        RT2870/RT3070 Wireless Adapter     Bus 001 Device 006: ID 04fc:0801 Sunplus Technology Co., Ltd      Bus 001 Device 007: ID 046d:c315 Logitech, Inc. Classic New Touch Keyboard      **ifconfig** & **iwconfig**               ifconfig          eth0      Link encap:Ethernet  HWaddr b8:27:eb:52:db:e1                 inet addr:192.168.0.182  Bcast:192.168.0.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:13098 errors:0 dropped:0 overruns:0 frame:0               TX packets:10478 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:8288713 (7.9 MiB)  TX bytes:4455841 (4.2 MiB)          iwconfig          lo        no wireless extensions.          eth0      no wireless extensions.               lsmod     Module                  Size  Used by     xt_multiport            1582  8      iptable_filter          1493  1      ip_tables              11490  1 iptable_filter     x_tables               16962  3 ip_tables,xt_multiport,iptable_filter     snd_bcm2835            16432  0      snd_pcm                77728  1 snd_bcm2835     snd_seq                53482  0      snd_timer              20110  2 snd_pcm,snd_seq     snd_seq_device          6462  1 snd_seq     snd                    58744  5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device     snd_page_alloc          5169  1 snd_pcm     crc_ccitt               1530  0      **rt2x00usb              11240  0      rt2x00lib              42342  1 rt2x00usb**     mac80211              273979  2 rt2x00lib,rt2x00usb     cfg80211              184390  2 mac80211,rt2x00lib     rfkill                 18298  1 cfg80211     leds_gpio               2243  0      led_class               3570  2 leds_gpio,rt2x00lib     evdev                   9450  2      joydev                  9356  0       I've already tried to reinstall drivers as a last time - this time it didn't help :(               pi@pi / $ cat /etc/network/interfaces           auto lo          iface lo inet loopback     iface eth0 inet dhcp          allow-hotplug wlan0     iface wlan0 inet manual     wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf     iface default inet dhcp      and finally wpa_supplicant.conf               sudo cat /etc/wpa_supplicant/wpa_supplicant.conf      ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev     update_config=1          #network={     #   ssid="SKYA767C"     #   psk="House!-01"     #   proto=RSN     #   key_mgmt=WPA-PSK     #   group=CCMP TKIP     #}          network={         ssid="SKYA767C"         psk="House!-01"         proto=WPA         key_mgmt=WPA-PSK         pairwise=TKIP         auth_alg=OPEN     }      Please note that above # are as I've try 1st and 2nd configuration and any of them didn't work. What else I need to do? Can anyone help to fix my **wlan0** interface


yum installs kernel-devel different from my kernel version

I am attempting to install the VMWare player in Fedora 19. I am running into the problem that multiple users have had where VMware player cannot find the kernel headers. I have installed the `kernel-headers` and `kernel-devel` packages through `yum` and the file that appears in `/usr/src/kernels` is:               3.12.8-200.fc19.x86_64      However, when I do `uname -r` my Fedora kernel version is:               3.9.5-301.fc19.x86_64      which is a different version. This seems to mean that when I point VMware player at the path of the kernels I get this error:               C header files matching your running kernel were not found.       Refer to your distribution's documentation for installation instructions.      How can I install the correct Kernel and where should I be pointing VMware if its not `/usr/src/kernels/<my-kernel>` ?


Bash: show prompts if arguments weren't provided

What is the best way of supporting in the script prompts and arguments at the same time? I want to show prompts if arguments weren't provided. Is there something better/shorter than this? ⇩               PROJECT_DIR=$1     SITE_NAME=$2     ADMIN_PWD=$3     THEME_DIR=$4     THEME_NAME=$5          if [ -z "${PROJECT_DIR}" ]; then         echo "Directory where project resides:"         read PROJECT_DIR     fi          if [ -z "${SITE_NAME}" ]; then         echo "Name of the website:"         read SITE_NAME     fi          if [ -z "${ADMIN_PWD}" ]; then         echo "Admin password:"         read ADMIN_PWD     fi          if [ -z "${THEME_DIR}" ]; then         echo "Directory of the theme:"         read THEME_DIR     fi          if [ -z "${THEME_NAME}" ]; then         echo "Name of the theme:"         read THEME_NAME     fi


Copy/paste into SSH'd VIM from local (Windows) clipboard

I would like to copy from a local machine and paste into vim on a remote box which I am SSH'd into. That's it. I have tried `"+p and "*p`, mouse middle-clicking, and a couple other things to no avail :( Also acceptable (though less convenient) is to just skip vim and pipe clipboard into file. My problem was that I am using PuttyTray and not Putty, when I tried to do the same thing in Putty it worked -- I didn't think there would be a problem with that.


How to measure the time a packet spends on the system(router)?

I have a streaming system and one if its components is a router/firewall. I'm using `iptables` for setting the required behaviour on the router. I'm having performance issues in forms of a constant multiple second lag on the destination computer where the stream is interpreted. I would like to try to eliminate the routers processing time as the source of the lag. Is there a way to measure the time a packet spends on the router?


Testing, from a script, if audio devices are in silent?

Is there a default program where I can check if my audio devices are in silent? **Edit:** By silence, I mean that if there is something playing on that (not just activated or opened) Something like this:               if [[ device0 is silent ]] ; then         radio $RANDOM     fi      **Edit 2:** What I'm trying to achieve is a script that plays radio and can keep playing when the player fails, e.g. if the internet connection goes down and the player didn't recovery, I will kill the player and start over again


Count and merge consecutive patterns

I'm searching for a short snippet to find, count and merge _consecutive_ duplicates using standard tools or a common scripting language. Say our input is:               1 2 2 2 7 22 a b b c c c c c d dd 2 2 c c      And as output we would like to have something _similar_ to:               1 3*2 7 22 a 2*b 5*c d dd 2*2 2*c      It is important to keep the order and to merge only _consecutive_ patterns.


Is the Linux implementation of the system configuration "variable" ARG_MAX different from other system variables and is it POSIX compliant?

In the shell, as explained in this this Q&A in the context of expansion, depending on the system, the maximum length of a command's argument is initially constrained by the kernel setup. The maximum value is revealed at runtime using the `getconf` command (see also IEEE Std 1003.1, 2013 Edition):               # getconf ARG_MAX     2097152     vs. value found in limits.h on my setup:     #define ARG_MAX       131072    /* # bytes of args + environ for exec() */      Indeed: > The sysconf() call supplies a value that corresponds to the conditions when > the program was either compiled or executed, depending on the > implementation; the system() call to getconf always supplies a value > corresponding to conditions when the program is executed. The manpages reference POSIX, from the prolog alluding the _POSIX Programmer's manual_ , to the _description_ itself: > The value of each configuration variable shall be determined as if it were > obtained by calling the function from which it is defined to be available by > this volume of POSIX.1-2008 or by the System Interfaces volume of > POSIX.1-2008 (see the OPERANDS section). The value shall reflect conditions > in the current operating environment. The basic variables which can be queried appear in the table for the `sysconf` function specification and there is more information about the values in the `limits.h` header documentation:               {ARG_MAX}         Maximum length of argument to the exec functions including environment data.         Minimum Acceptable Value: {_POSIX_ARG_MAX}     ...(nb you cannot be POSIX compliant under a certain value...)     {_POSIX_ARG_MAX}         Maximum length of argument to the exec functions including environment data.         Value: 4 096      The `xargs --show-limits` command confirms some of this:               Your environment variables take up 3134 bytes     POSIX upper limit on argument length (this system): 2091970     POSIX smallest allowable upper limit on argument length (all systems): 4096     Maximum length of command we could actually use: 2088836     Size of command buffer we are actually using: 131072      `sysconf` was initially designed to find the system value for the PATH variable, then it was extended to other variables. Now, the _Open Group_ documentation explores the rationale for having such a framework where applications can poll for system variables at runtime, and the related practical considerations about the baseline...: > (...) If limited to the most restrictive values in the headers, such > applications would have to be prepared to accept the most limited > environments offered by the smallest microcomputers. Although this is > entirely portable, there was a consensus that they should be able to take > advantage of the facilities offered by large systems, without the > restrictions associated with source and object distributions. > > During the discussions of this feature, it was pointed out that it is almost > always possible for an application to discern what a value might be at > runtime by suitably testing the various functions themselves. And, in any > event, it could always be written to adequately deal with error returns from > the various functions. In the end, it was felt that this imposed an > unreasonable level of complication and sophistication on the application > developer. ...as well as the shortcomings of such a setup as it relates to some file variables with `fpathconf`: > The pathconf() function was proposed immediately after the sysconf() > function when it was realized that some configurable values may differ > across file system, directory, or device boundaries. > > For example, {NAME_MAX} frequently changes between System V and BSD-based > file systems; System V uses a maximum of 14, BSD 255. On an implementation > that provides both types of file systems, an application would be forced to > limit all pathname components to 14 bytes, as this would be the value > specified in on such a system. So the intent was to relieve developers of some burden for the baseline while also acknowledging variety in the filesystems and generally enabling some customizing on different variants of the platform. The evolution of hardware, Unix and related standards (C and POSIX) plays a role here. **Questions:**   * The command `getconf` doesn't have a "list" option, and `set`, `printenv` or `export` don't show those variables. Is there a command which lists their value?   * Why facilities like `fpathconf` were seemingly built to introduce more flexibility, but only for PATH and file related system variables? Is it just because at that time getconf was only about PATH?   * What is the current Linux implementation, and is it POSIX compliant? In the linked Q there is reference in the answers to ARG_MAX varying with the stack size ("on Linux 3.11... a quarter of the limit set on the stack size, or 128kiB if that's less than 512kiB"):      * What is the rationale for this?      * Is this choice (1/4 of the stack size) a Linux specific implementation or just a feature on top of the basic implementation or did the historical UNIX implementation always yield basically that 1/4th of the stack size?     * Are many other variables besides ARG_MAX a function of the _stack_ size or similar resources or does the importance of this variable warrant a special treatment?     * Practically, does one deliver a POSIX compliant Linux system/solution and there's configuration of the stack size limit for example to allow some application to go beyond the basic maximum spec if it scales up with the hardware or is it a practice to customize directly `limits.h` and compile for specific needs?      * What is the difference for something like ARG_MAX between using `limits.h` vs. changing the variable at runtime with something like the `ulimit -s` command vs. having the kernel manage it directly? In particular is the (low)value of that variable in my `limits.h` obsolete on Linux because of kernel changes i.e. has it been superseded?   * The command line supposedly has shell specific length restrictions which are not related to expansion and ARG_MAX; what are they in `bash`?


Get ssh server key fingerprint

Is there a way to _programmatically_ obtain a SSH server key fingerprint _without authenticating_ to it? I'm trying `ssh -v user@host false 2>&1 | grep "Server host key"`, but this hangs waiting for a password if key based auth is not setup.


Splitting file using prefix

I need to split a file into 5 parts but the tricky part to append the numeric number in the prefix of the filename and not at the end.               split -n 5 -d -a 2 "$file" "$file"      Name of the file:- file = text creates the text01 but I want 01text.


Different version of Python cannot find modules

In my Suse system I have these 2 versions of Python:               # which python2.6     # /usr/bin/python2.6          # which python2.4     # /usr/local/bin/python2.4      2.6 is the system one, and 2.4 was compiled by me. If I try to import a package using the 2.4 version:               # python2.4 -c "import bz2; print bz2.__doc__"      I get the following error:               # ImportError: No module named bz2      What is the correct way to proceed with this?


Can somebody explain The Debian Apache2 configuration files cocondrum?

I am a newbie to `Apache2.4`. I know I am running the said version because of :-               $ sudo apache2ctl -v     Server version: Apache/2.4.10 (Debian)     Server built:   Jul 23 2014 13:15:48      Apparently there are three different configuration files which are needed to be configured :-               /etc/apache2$ ls *.conf     apache2.conf  ports.conf      and               /etc/apache2/conf.d$ ls *.conf     httpd.conf      Apparently these three files work something like this :- `apache2.conf` :- It is known as the **Global** configuration file. `ports.conf` :- This is apparently to tell Apache which IP Addresses and port to listen and bind to (to do web-serving). `httpd.conf` :- This is something to do with user configs. I do not have much idea about it. Now I have two questions :- a. Is my understanding of the three files correct ? If somebody could better explain it would be nice. b. why is httpd.conf supposed to be in /etc/apache2/conf.d/httpd.conf while the other two are in /etc/apache2/ ?


Will switching from Gnome to LXDE improve battery life?

I currently have Fedora 14 and the battery life is not so good. I am planning to switch to Fedora 16. Will I get significantly more battery life if I go for the LXDE spin instead of GNOME?


Windows 7/Ubuntu 11 dual boot plus VM?

I have installed Ubuntu on my Windows 7 machine, and can now happily dual- boot. What I'd like to do is retain this set-up but be able to use the same Ubuntu set-up as a virtual machine within Windows. I've seen solutions that allow this with a Windows VM within Ubuntu, but not the other way around. Can anyone help? Thanks in advance!


redirection and pipeline

I was wondering about differences and relation between redirection and pipeline.   1. Is pipeline only used to connect stdout output of a command to stdin input of another command?   2. Is redirection only used to connect a stdout output of a command to a file, and to connect a file to a stdin input of a command? But there seems to be `command >& 2`.   3. A pipeline `com1 | com2` can be replaced by redirection as `com1 > tempfile; com2 < tempfile`. Can the replacement be modified to be without using a file?   4. Can a redirection be replaced by a pipeline? Thanks and regards!


I regularly read development updates from various components of the Linux ecosystem. Of all these, the kernel is the one that seems least transparent to me. Typical kernel release notes mention tons of new and upgraded drivers, filesystem work (such as the ever-experimental `btrfs`), occasional network stack adjustments (such as the recent reworking of the firewall and iptables architecture) and many minor changes. **What I'm missing here is the _big picture_.** Where is Linux kernel development headed? What large-scale architectural changes are on the roadmap (is there even a published roadmap?)? What hardware platforms does the focus lie on (servers, Android, embedded)? Is there a slow shift from a monolithic to a hybrid kernel architecture? What other major changes are on the horizon? How can I keep up with those plans to get a rough idea of how the Linux kernel might look like in six months, in two years? Given the huge importance of Linux to the world of computing, I am certain that such long-term plans must exist somewhere.


How come crontab -e is different from less /etc/crontab?

Im pretty new to unix and crons, I was currently about to try to add crons to an existing cron file. I read you could do this with `crontab -e`. The confusing thing to me is just that `crontab -e` shows different crons/commands than `less /etc/crontab` - how come? Which one is the correct way/file to edit?


exec() and system() system calls

I do understand that while exec() does not return after it executes in Unix ,system() may or may not return depending on the situation.But can anyone explain why exec() system call does not return and also the differences between exec() and system() in Unix operating system


How much space for /home on a hadoop cluster?

What is a reasonable size to provide for a /home partition for 100 users on a hadoop cluster? Assume that a landing zone has been provided to store files/data for ingestion into the cluster, so the /home partition would be non-project type storage.


Open .desktop files in text editor by default

I wonder if it's possible to open files with the `.desktop` suffix in a text editor of choice by a simple double-click in a file manager. Even assigning the corresponding MIME type to a text editor with this command doesn't work:               xdg-mime default gedit.desktop application/x-desktop      I understand `.desktop` files are executables but is there a good reason it wouldn't be possible to do this?


MySQL stop/waiting issues; “can't connect … through socket”

So this was my first time putting up a LAMP stack on a Bodhi machine (previously experience with WAMP, and LAMP on 10.04); I got Apache going, and a Drupal install begun, then I go to create a new database and when I log in to phpmyadmin ... I get a 'cannot connect error'. Tracing this back, the issue began once I tried to get virtual hosts up and running in Apache; once that was done I started running into socket connection issues with mysql. Initially the problem looked like this: `ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)` Using `ls -lart /var/run/my*` I get this:                 total 0       drwxr-xr-x  2 mysql root  40 Jan 31 11:56 .       drwxr-xr-x 21 root  root 740 Jan 31 12:21 ..`      I ran `touch /var/run/mysqld/mysqld.sock` and set `chown -R mysql /var/run/mysqld` which allows for:               total 0     drwxr-xr-x 21 root  root 740 Jan 31 12:21 ..     -rw-r--r--  1 mysql root   0 Jan 31 13:58 mysqld.sock     drwxr-xr-x  2 mysql root  60 Jan 31 13:58 .        * So when I try to run `mysql -u root -p` I get one error - `ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13)` (note it is no longer ERROR 2002...(2) but rather ERROR 2002...(13))   * If I try `service mysql restart` (or stop, start) I get another error - `start: Rejected send message, 1 matched rules; type="method_call", sender=":1.49" (uid=1000 pid=8407 comm="start mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init") `   * When I run `sudo service mysql restart` I get `stop: Unknown instance: start: Job failed to start `   * When I run `service mysql status` I get "mysql stop/waiting" What can I do to diagnose the issues I am having with mysql? I may be overlooking an utterly simple mysql issue and would appreciate any feedback on what I've done so far. Also, being a Bodhi machine and most of the instruction/feedback being written for Ubuntu, I am unsure to what extent any Ubuntu instruction may not apply. In particular, am I running into a problem related to the difference between `/etc/init.d/...` and `service ... ...` commands? Or, perhaps, am I running into a difference between libraries of the two?


CentOS - how to install vsftpd for specific username to have specific directory access only?

I have VSFTPD installed in CentOS. Where i have one username "lesstrust1", when the user login i want the user only can upload/download to this path `/var/www/html/oxwall`               $ yum install vsfptd     $ chkconfig vsftpd on      How do i tell VSFTPD to do that? EDIT: I have tried following based on man but does not work.               $ vim /etc/vsftpd/config.conf     # end of the file new line added     user_config_dir=/etc/vsftpd          $ vim /etc/vsftpd/username1     local_root=/var/www/html/oxwall          $ service vsftpd restart      Now, when FTP is connected as username1 it does not go to /var/www/html/oxwall but username1 can browse whole system including / or /etc all. Is this a BUG?


How can I customize new mail notification in alpine?

I use alpine as my primary mail reader. While I spend most of my day in the terminal or emacs, it would still be nice to get pretty notification of new mail using notify-bin. Is there any way I can configure alpine to run a custom command when new mail is recieved?


Display 'PRI' and 'NI' via 'top -stats'

I'm trying to create a script that prints `top` stat for some specific fields (e.g. `pid, command, priority, nice value`). I can print most of them by using `-stats` option, but there is no arg for `ni` and `pri` there...   I know, that's possible to get if i use `ps`, but what about `top`?


Why is this apt-cache dumpavail with overrides not working?

I am trying to list available packages from a remote repository **without accessing /etc/apt or /var**.The following command doesn't return anything and exits with code zero.               apt-cache dumpavail -o Dir::Etc=tmp/ -o Dir::Cache=tmp/ -o Dir::State=tmp/      The command seems correct as per docs. Any idea what I am missing or how I could do it differently? I have my sources.list under /tmp with contents:               deb http://br.archive.ubuntu.com/ubuntu/ precise main restricted      and the current apt config is default               $apt-config dump     ...     Dir "/";     Dir::State "var/lib/apt/";     Dir::State::lists "lists/";          Dir::State::cdroms "cdroms.list";     Dir::State::mirrors "mirrors/";     Dir::State::extended_states "extended_states";     Dir::State::status "/var/lib/dpkg/status";     Dir::Cache "var/cache/apt/";     Dir::Cache::archives "archives/";     Dir::Cache::srcpkgcache "srcpkgcache.bin";     Dir::Cache::pkgcache "pkgcache.bin";     Dir::Etc "etc/apt/";     Dir::Etc::sourcelist "sources.list";     Dir::Etc::sourceparts "sources.list.d";


Favorite partitioning and mounting tricks

We all know that mounting a new partition as /home and maybe /boot is extremely useful. Or mounting a remote directory as /opt can be great for sharing system tools. Are there any other, maybe more esoteric, uses for extra partitions or hard drives or nifty ways to mount external volumes? Maybe even if anyone also has windows machines *shudder*, post some cool tricks involving partitioning and hard drive mounting.


vsftpd - Limit FTP access only to /var/www

I am running vsftpd as ftp server on my linux (rasbian), I log in to the machine as a root user. I would like to be still locked to using only /var/www, how can I configure vsftpd conf to accomplish it?


Run a given command on every subpath of a long path

Say I have a long path such as:               /a/b/c/d/e/f      I would like to run a command **only** on each of the subpaths of the path: e.g. If my command is `cmd`, I am looking for a one-liner that can do (perhaps using a one-line loop)               cmd /a     cmd /a/b     cmd /a/b/c     cmd /a/b/c/d     cmd /a/b/c/d/e     cmd /a/b/c/d/e/f      **One** of the reasons why I need this (I need it for other things as well), is because I would like to give somebody from my unix group the ability to `cd` incrementally her way to `/a/b/c/d/e/f`. To do this, I think I need to run `chmod g+x` on each of these subpaths (not sure if there is an alternative). Note that I want to avoid `chmod -R g+x /a`. I work primarily on zsh so I wonder if there is anything that takes advantage of specific zsh features.


Send a fax via SIP

How can I send a fax from my Linux machine using a SIP connection? I don't have a modem. Ideally, I'd like to provide a PDF or TIFF file, and send it via my SIP provider. Is this possible?


Stuck in separating chars into strings in my approach. Found a working approach but can not understand it

I am trying to figure out how to break a string to be on character per line.   I.e `ahebhaaa` to be:               a       h       e       b       h       a       a       a        I tried: `$ echo ahebhaaa | sed 's/\\(.\\)\\(.\\)/\1\n\2/g'`   I.e. my intention was "plugin" between chars a new line using capture groups but I get:               a       he       bh       aa       a         I guess this has to do with greedy/non-greedy but adding ?* anywhere in this does not do anything. What am I doing wrong here? Additionally I found that this:   `echo ahebhaaa | sed 's/[^\n]/&\n/g'`   Does the job. But I don't understand how it works. What is `&`? How does the `[^\n]` work?


Montage together five gifs

I have five gifs all with the same number of frames and the same framerate. Is it possible to montage these together into one gif where each frame is similar to a normal montage of static images and is the next frame in the gif. Furthermore, i would want the first two gifs on the first row, then a space, then the last three gifs.


How do I watch my webcams feed in linux

In windows I can open "My Computer" and click on the "Webcam" icon to get a feed from my webcam. I can also take snapshots of that feed. Can I do the same in Ubuntu? Without installing any extra applications like Photobooth.


Some packets are flagged as INVALID by iptables

I configured a proxypass rule in order to redirect requests from the port 443 to a JBoss server running on port 8080. All works fine except some 503 errors in the Apache log, around 10 per day: In the error log: > [error] (111)Connection refused: proxy: HTTP: attempt to connect to > 127.0.0.1:8080 (127.0.0.1) failed In the access log, I've a corresponding 503 error. Nothing in my JBoss log. For each error, coincide a packet flagged as invalid in the kernel log. I performed a tcpdump and for each invalid packet, it was a tcp SYN from the proxy to the JBoss server. Why these packets are flagged as invalid ? Is that a serious problem ? Can I accept all invalid packets from 127.0.0.1 to dport 8080 ?


Why is my inotifywait loop exiting after removing some subdirectories?

i have the following bash script:               #!/bin/sh     dir1=/source/dir/path/     while inotifywait -qqre modify "$dir1"; do        rm -r /destination/dir/path        find /source/dir/path/ -name .svn -exec rm -rf '{}' \;        cp -ruv /source/dir/path/* /destination/dir/path/     done      the thing is that the first 2 commands are working well but the process is killed after executing (successfully) the "find -exec" command. Any thoughts? BTW- if i remove the "find -exec" everything goes well.


mutt: ask for confirmation before moving message to archive

I have following macro defined in my `muttrc`:               macro  index s ":set confirmappend=no delete=yes auto_tag=yes\n\         <save-message>=archive\n<sync-mailbox>:set delete=ask-yes\n"      When I press `s` on a message, it will immediately be moved into my `archive` folder. I would like to modify my macro, so that I will be asked for confirmation before the message is moved. But when I change `confirmappend=yes`:               macro index s ":set confirmappend=yes delete=yes auto_tag=yes\n\         <save-message>=archive\n<sync-mailbox>:set delete=ask-yes\n"      and when I press `s`, mutt becomes immediately unresponsive, all keys stop working, I cannot even exit. The cpu runs at 100% and I have to log in from another console to kill mutt. Can somebody please advise how to correctly modify my macro?


Streaming video with VLC / WinTV has no audio

I'm trying to stream video between two PCs with a WinTV card. I can stream video, but the stream contains no audio.               # lspci -v:     06:04.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)         Subsystem: Hauppauge computer works Inc. WinTV Series         Flags: bus master, medium devsel, latency 32, IRQ 16         Memory at fb9ff000 (32-bit, prefetchable) [size=4K]         Capabilities: [44] Vital Product Data         Capabilities: [4c] Power Management version 2         Kernel driver in use: bttv          06:04.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)         Subsystem: Hauppauge computer works Inc. WinTV Series         Flags: bus master, medium devsel, latency 32, IRQ 16         Memory at fb9fe000 (32-bit, prefetchable) [size=4K]         Capabilities: [44] Vital Product Data         Capabilities: [4c] Power Management version 2         Kernel driver in use: snd_bt87x      Video is working with those vlc lines:               server:     vlc v4l2:///dev/video0 --sout '#transcode{vcodec=mp4v,acodec=mp3,vb=400,ab=128}:standard{access=http,mux=ts,dst=192.168.1.1:8080}'          client:     vlc http://192.168.1.1:8080      Scanning the logs I can find the following message:               [0xb2607160] v4l2 demux debug: tuning required: tuner 0     [0xb2607160] v4l2 demux debug: tuner Television (0) is Analog TV     [0xb2607160] v4l2 demux debug:  ranges from 44000.0 kHz to 958000.0 kHz     [0xb2607160] v4l2 demux debug:  supports primary audio language     [0xb2607160] v4l2 demux debug:  supports secondary audio language or program     [0xb2607160] v4l2 demux debug:  supports stereo audio     [0xb2607160] v4l2 demux debug: tuner 0 audio mode 3 set     [0xb2607160] v4l2 demux debug: tuner not tuned     [0xb2607160] v4l2 demux debug: no audio input available      I can watch TV with this card using mplayer, so I suspect there must be a way to get sound output:               player tv:// -tv driver=v4l2:width=768:height=576:outfmt=rgb24:channel=e9:device=/dev/video0      What am I doing wrong? Do I somehow have to set an additional sound input? If so, how? Using `lsof` shows me that mplayer is just holding `/dev/video0` as open file descriptor in `/dev`.


Can't block google logo in squid

I wanted to block google logo via Squid proxy: ![enter image description here](http://i.stack.imgur.com/FWiAj.png) So I added this line to block.acl:               google\..+/logos/.+      in squid.conf I have this:               acl bad_domain dstdom_regex "/etc/squid/block.acl"     acl good_domain dstdom_regex "/etc/squid/white.acl"          http_access deny bad_domain     http_access allow good_domain     http_access deny all      But the image is still not blocked: https://www.google.ru/logos/doodles/2013/doctor-whos-50th- anniversary-6317003539218432-res.png. What to do?


Moving an open file to a different device

I have an application running that is generating a large (~200GB) output file, and takes about 35 hours to run (currently I'm about 12 hours in). The application just opens the file once then keeps it open as it is writing until it is complete; the application also does a lot of random access writes to the file (i.e. not sequential writes). Right now the file is being saved to my local hard drive but I just decided that when it's done, I'm going to move it to a different device instead (a network drive, NTFS mounted via CIFS). To save time instead of moving the file later, is there some way I can suspend the program and somehow move the current partially complete file to the other device, do some tricks, and resume the program so it is now using the new location? I'm pretty much positive that the answer is no but I thought I'd ask, sometimes there are surprising tricks out there...


Having trouble with LVM snapshot

I have a funtoo linux machine which I am trying to add ubuntu to (thats a whole other issue). It is encrypted with luks and has lvm on top of that. I have a 2 TB harddrive (sdb) which I would like to use to take lvm snapshots of the important logical volumes on the machine. I don't need the whole external drive, so I split it up into 3 ~600G partitions. I formatted them with linux LVM, then added one partition (sdb2) to the same volume group of the logical volumes I want to back up on the funtoo machine (e.g. I want to backup /dev/cr/root, /dev/cr/portage...) Heres where things are weird. When I normally create an logical volume, it doesn't work. However, I can get it to work by specifying maximum verbosity when using lvcreate: `lvcreate -vvv`. Super weird. Unfortunately, this strange workaround doesn't work when I am trying to create a snapshot. Here is the end of the output after running `sudo lvcreate -vvv --size 35G --snapshot --name snaproot /dev/cr/root`                   Creating volume group backup "/etc/lvm/backup/cr" (seqno 21).             Writing cr metadata to /etc/lvm/backup/.lvm_agamemnon_5516_1152467130             Committing cr metadata (21)             Renaming /etc/lvm/backup/cr.tmp to /etc/lvm/backup/cr             Unlock: Memlock counters: locked:0 critical:0 daemon:0 suspended:0             Syncing device names       semid 1343490: semop failed for cookie 0xd4de368: incorrect semaphore state       Failed to set a proper state for notification semaphore identified by cookie value 223208296 (0xd4de368) to initialize waiting for incoming notifications.             Udev cookie 0xd4de368 (semid 1343490) destroyed             cr-snaproot: Skipping NODE_DEL [trust_udev]           Unlocking /var/lock/lvm/V_cr             _undo_flock /var/lock/lvm/V_cr             Closed /dev/mapper/root             Closed /dev/sdb2             Freeing VG cr at 0x7543d0.      Anyone ever seen this error before? I am running LVM version: 2.02.95(2) (2012-03-06) and udev version 171.. Should I upgrade udev? I could backup my disk another way, I just thought this would be the cleanest. Any better ideas?


add newlines in .cshrc command output

I'm trying to set up a "dynamic" motd for users when they log in on FreeBSD 10. I've got it set up so that it uses .cshrc and has a few commands to output some info. However one of those prints as a single line instead of adding newlines.               echo 'Uptime: '`uptime`     echo ''`who -H | awk '{print $0,"\n"}'`      The output of **who** comes out as a single line instead separated out. How can I accomplish it so that it adds a newline **\n** at the end of each line? I've tried a few alterations of **sed** as well, but it all comes up with the same result. I am testing with tcsh.


Touchpad utility

I'm new in the Linux area. I just installed Elementary OS, which is related to Ubuntu, and I want to know if there is a utility for my mouse pad. In Windows I had Synaptics that allowed me to scroll with my mouse pad using 2 fingers and other tricks like this. Is there a utility like this one on Linux?


Specify consistent week boundaries using date

I need to run a certain program passing it the week boundaries. (I use `CentOS release 6.4`, so a `bash`/`gnu date` solution is fine). I tried this yesterday (on Monday):               for ((w=1;w<=6;w++)) do        week=$(date --date "$w weeks ago" +"%G-%V")       beg=$(date --date "monday $w weeks ago" +"%F")       end=$(date --date "sunday $w weeks ago" +"%F")       echo "$week beg=$beg end=$end" $(( ($(date --date $end +"%s") - $(date --date $beg +"%s")) / 86400 ) + 1) "days"     done     2014-02 beg=2014-01-06 end=2014-01-12 7 days     2014-01 beg=2013-12-30 end=2014-01-05 7 days     2013-52 beg=2013-12-23 end=2013-12-29 7 days     2013-51 beg=2013-12-16 end=2013-12-22 7 days     2013-50 beg=2013-12-09 end=2013-12-15 7 days     2013-49 beg=2013-12-02 end=2013-12-08 7 days      looks good, but when I do the same thing today (Tuesday), I get this:               2014-02 beg=2014-01-13 end=2014-01-12 0 days     2014-01 beg=2014-01-06 end=2014-01-05 0 days     2013-52 beg=2013-12-30 end=2013-12-29 0 days     2013-51 beg=2013-12-23 end=2013-12-22 0 days     2013-50 beg=2013-12-16 end=2013-12-15 0 days     2013-49 beg=2013-12-09 end=2013-12-08 0 days      which does not look good. So, how do call `date` to get the week boundaries in the past?


Why below script is not able to find and delete files

Why below `find` command does not find and delete files ? I am launching it like this ./script.sh 1 MYFOLDER               days_period=$1     myuser=$(whoami)     folder_prefix=$2          LOGS_DIR=~/$folder_prefix/logs     if [ $# -eq 2  ]     then     df -k /users/$myuser            if [ -d "$LOGS_DIR" ]; then         cd $LOGS_DIR         find . -mtime +$days_period -type f -exec ls -la {} \;              find . -mtime +$days_period -type f -exec rm -rf {} \;       fi          fi


New local user can't login to vsftpd

I'm a bit puzzled with this one and could really use some help. We have a CentOS 6 box running VSFTPD as a dropbox for our customers. Each customer gets a local user and is chrooted to their home dir. Connections are made with explicit SSL. VSFTPD config as follows:               anonymous_enable=NO     local_enable=YES     write_enable=YES     local_umask=022     dirmessage_enable=YES     xferlog_enable=YES     connect_from_port_20=YES     xferlog_std_format=YES     chroot_local_user=YES     listen=YES     pam_service_name=vsftpd     userlist_enable=YES     tcp_wrappers=YES     rsa_cert_file=/etc/ssl/private/vsftpd.pem     rsa_private_key_file=/etc/ssl/private/vsftpd.pem     ssl_enable=YES     allow_anon_ssl=NO     force_local_data_ssl=YES     force_local_logins_ssl=YES     ssl_tlsv1=YES     ssl_sslv2=YES     ssl_sslv3=YES     require_ssl_reuse=NO     ssl_ciphers=HIGH     check_shell=NO      So far we have added 3 users, each in the same way.               useradd -s /sbin/nologin username     passwd username      The first 2 users work perfectly. The 3rd gets a `Login Incorrect` message from VSFTPD. I've change the 3rd users password to `test` just to check there wasn't a typo in the connection but get the same thing. Message in `/var/log/secure` for the 3rd user attempt is               pam_unix(vsftpd:auth): authentication failure; logname= uid=0 euid=0 tty=ftp ruser=user3 rhost=127.0.0.1  user=user3      Anyone have any suggestions. ### EDIT: In response to comments The SELinux status is disabled The output from `ls -lZd` in each directory is Working user: `drwx------ user1 user1 ? .` Non-working user: `drwxr-xr-x user2 user2 ? .` So there is an obvious difference in permissions, but the working user is _less_ permissive?


What does GNOME do with multimedia keys?

GNOME makes multimedia keys, such as fn+directional keys on my laptop, maybe dedicated keys on your keyboard, into very useful keys. They seem to work with a large number of application. What can I do to recreate this using something like xbindkeys?


Icon not showing in applications on OSX

![thumbnail](http://i.stack.imgur.com/ZqEbO.png) I just re-installed Firefox, but the thumbnail is not showing in the dock applications folder. The icon DOES show both in dock and in finder. I have tried to re-install Firefox again but without success. Any advice?


Is CTRL+C incorrect to use to return to command line?

When I'm using `tail -f` and I want to return to the shell, I always use `CTRL+C`. Or when I am typing a command and feel like aborting it and starting over, I simply `CTRL+C` to get back to an empty command line prompt. Is this considered bad practice? I sometimes feel there might be a better way to break away from something, but really have no idea.


Cannot mount eCryptfs

I tried to install eCryptfs on my server to open an eCryptfs I did on my home computer. I got these errors. > $ sudo mount -t ecryptfs /home/(place)/enc/ /home/(place)/enc/ > > Unable to get the version number of the kernel module. Please make sure that > you have the eCryptfs kernel module loaded, you have sysfs mounted, and the > sysfs mount point is in /etc/mtab. This is necessary so that the mount > helper knows which kernel options are supported. > > Make sure that your system is set up to auto-load your filesystem kernel > module on mount. > > Enabling passphrase-mode only for now. > > Unable to link the KEY_SPEC_USER_KEYRING into the KEY_SPEC_SESSION_KEYRING; > there is something wrong with your kernel keyring. Did you build key > retention support into your kernel? I have no idea what that means. My server has Debian on it. Should I do something?


pacman could not find database

I want to install `sudo`. So I type in `pacman -S sudo`. But then I get the following errors:               warning: database file for 'extra' does not exist     warning: database file for 'community' does not exist     error: failed to prepare transaction (could not find database)      How do I install the database files for `'extra'` and `'community'`? I am in Arch Linux.


ssh -D to my server

I want to route my `localhost:1500` to my server in US, my command is:               ssh -D 1500 192.241.79.124     password : ...      but this error appears :               cannot listen to port 1500     could not request local forwarding      what would I do?


How can I tell if a TCP port is open or not?

I am trying to implement socket programming in C. When I try to connect from a client to a server (Ubuntu), it shows an error like "connection failed". So I think the problem is with the port. I am using the 5454/tcp port for socket programming. How can I know if 5454 port is listening or not? If it is not, then which are the ports that I can use for TCP socket programming using C in Ubuntu? Is that the problem with port only or is there anything wrong in my code or any settings is required in LINUX Ubuntu? **EDIT:** Snippet of code:                 int socket_send;        struct sockaddr_in address;     printf("\n Initialization Socket....");          socket_send = socket(AF_INET,SOCK_STREAM,0);     if(socket_send == -1)     {         perror("\n Socket not created.Error:");         return 1;     }     printf("\n Socket created");          address.sin_family=AF_INET;     address.sin_addr.s_addr=inet_addr(ip);     address.sin_port=htons(5454);          if(connect(socket_send,(struct sockaddr*)&address,sizeof(struct sockaddr))<0)     {         perror("\nConnetion failed.Error:");         return 1;     }     printf("\n Connected");          if(send(socket_send,(char*)buffer,size,flag)<0)     {         perror("\nSending failed.Error:");         return 1;     }     printf("\n Data successfully sent");      close(socket_send);      **EDIT** : Problem is in port, so I just re installed Ubuntu, and it's working. Thank you all of you.


How can I see output from a command progressively?

I have fired an `ls -1` command that runs and displays a long list of values. When the command ends I can not see the output which is outside the screen vertical length. How can I see those previous entries ? Is there a way to see the output progressively like :   1. Display first 15 rows    2. User hits a keystroke.   3. Then display the next 15 records


Intel Corporation 82852/855GM Integrated Graphics Device on Fedora 18: No drivers?

I've just installed Fedora 18 on an old laptop, and it seems I can't get drivers for the graphics card. "Intel Corporation 82852/855GM Integrated Graphics Device" is what `lspci` is reporting, but I'm struggling to find proprietary drivers, or a package for it. I've added RPM Fusion packages, but still, no drivers. Where (if there are any at all) do I get them?


Git hangs indefinitely when trying to push --all to GitHub

When I try and push `\--all` to GitHub, the Git transfer starts out fast, slows down, and eventually stops. It doesn't fail, it just slows to a halt. What's going on? This is really frustrating, I'd like to get my code pushed, but every time I try this, it slows to a stop. I've tried on multiple networks, so I don't think it's my network connection.


change the extension of all files based on user input

I was taking an online assessment and I got the below question.   * Create a script located at `/usr/local/bin/set-file-extensions` that will change the extension of all files in the directory `/var/dump/files` based on user input.   * The script should support the option flag `-E` that will allow a user to pass a three character extension(.i.e `log`).   * If a non three character extension is passed by the user, display the error " **Invalid input. A three character extension is required.** " and exit with a status code of 19.   * Once that file extension is received, the script should rename all files under the directory `/var/dump/files` with the given extension. I.e. A file named `myfile` should be renamed as `myfile.log`.


Unexpected condition outcome in a ksh script

I'm new to shell scripting. The below code is not working. Can anyone help me on this? I've given explanation for all the lines:               #!/bin/ksh     cat example.txt | while read LINE                 # reading line from file     do         var=$LINE                                     # assigning line to variable         echo $var                                     # printing the line         H_OR_T="${var:0:6}"                           # taking substring from the line          echo $H_OR_T                                  # printing the substring      up to here the code is working fine. If H_OR_T variable holds the hardcoded value (i.e., M$9001 kindly take a look on if condition below) I should enter the loop. But here I'm getting arithmetical errors. I've tried all the possible ways still, and I'm facing the same issue.                   if [[ $H_OR_T = "M$9001" ] || [ $H_OR_T = "M$9002" ]];             then            echo "************** MOVING HEADER OR TRAILER RECORD TO DOMESTIC FILE ************"            awk '{print $0}' example.txt > domestic.txt         else            echo "**************** MOVING RECORD TO LOGGER FILE **********************"            awk '{print $0}' example.txt > logger.txt         fi     done


Suppress warning from ps -aux on Linux

When I run the `ps` command i get a warning saying `Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ`. How do i suppress this warning? Is there some system setting that i must do for this. The command that I fire is:               [root@localhost home]# ps -aux | grep "curl -s -o Test"      Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ     root      4856  0.0  0.0   4044   672 pts/0    S+   07:20   0:00 grep curl -s -o Test     [root@localhost home]#       Note that I have to fire the exact same command as above(I cannot change the `-aux` to `aux`, I cannot redirect `STDERR` output). That is why i am looking for some system setting that will suppress the warning.


Vi mode in other console programs

I quite like the Vi mode of bash. Is there any way to make it work in other programs (gnuplot for instance)? **EDIT:** As Shawn suggested below, configuring `.inputrc` and using `rlwrap -a -c gnuplot` gives Vi mode for gnuplot.


How to browse file from sudoer account from guest account?

As I've mentioned earlier, I have been facing problem regarding isues with loging in with my primary account. I want to browse my files from that primary account using guest account. Is there any way to do that without logging in into primary account? If yes, what are they?


what are the different ways to set file permissions etc on gnu/linux

On Unix a long time back I learned about `chmod` to set permissions and to allow programs to gain privileges. I have recently discovered extra commands on GNU/Linux: `chattr`, `setfacl`, `setcap`. Are there any others?


Unset http_proxy enviroment variable

> **Updated 11/03** : After doing some test with your suggestions, I only can > be sure about one thing: there is something related to the graphical > environment, because if I login through `ssh` or using a virtual terminal, > the variable is not defined. Any new idea? I have defined in some persistent way the http_proxy variable. Always I open a terminal, I have the http_proxy already defined. This is not my desired behaviour, so I'm looking where I defined http_proxy environment variable. I'm pretty sure that is something user related, because with other users in the same computer I don't have the problem. I have checked the `.bashrc` and other bash-related configuration files, but any of them include the http_proxy variable definition. Obviously, I can `unset` de variable without any problem, but I want to know where the hell is the variable defined. Thanks in advance


Which GUI diff viewer would you recommend, with Copy-to-Left/Right functionality?

I've hardly ever used anything other than Meld. Can you recommend anything else? It would be extra nice if you give a reason for your recommendation (as a Comment). [ **note** ] I want an alternative because Meld has recently lost the feature to copy _entire_ contents from one file to another. I'm referring to the functionality available via the `Copy To Left/Right` right-click menu item. [ **update** ] I just checked, and the problem was introduced by **1.3.2**. **1.3.1** works well, and the latest I've checked is **1.4.0** , and it doesn't work.


Packets do not cross IP tables Postrouting when originating from an external IP

I'm trying to reflect traffic from the internet to an internal device that I only want to have local access. I have a host in my DMZ that I'm trying to DNAT traffic to this internal device, and SNAT so no internet route is needed. In testing, I am able to DNAT/SNAT from a local computer to this proxy host and access the resources on the internal device. However when accessing the port on my router, I can see the requests arriving at proxy host via tcpdump, and I see them increment the iptables DNAT rule counter, yet no connection is made. Further more local tests increment both the DNAT and SNAT rule counters, but external traffic only increments the DNAT counter. The proxy host was spun up for only this purpose and has no other services. There is one interface with two IPs .254 and .253, Incoming traffic should come to .254 and be SNAT'd from .253 on its way to the internal device. Kernel IPv4 forwarding is also enabled. Below is my iptables config:               # Generated by iptables-save v1.4.7 on Sun Jun 22 22:49:18 2014     *filter     :INPUT ACCEPT [32:4832]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [14:1016]     -A INPUT -p tcp -m tcp --dport 443 -j MARK --set-mark 7     -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT     -A INPUT -p icmp -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -i admin -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT     -A INPUT -i admin -p udp -m state --state NEW -m udp --dport 161 -j ACCEPT     -A INPUT -i local -p tcp -m state --state NEW -m tcp --dport 5308 -j ACCEPT     -A INPUT -i admin -p tcp -m state --state NEW -m tcp --dport 10050 -j ACCEPT     -A FORWARD -d 10.254.254.1/32 -p tcp -m state --state NEW,RELATED,ESTABLISHED -mm      tcp --dport 443 -j ACCEPT     -A FORWARD -j ACCEPT     -A INPUT -j ACCEPT     -A OUTPUT -j ACCEPT     COMMIT     # Completed on Sun Jun 22 22:49:18 2014     # Generated by iptables-save v1.4.7 on Sun Jun 22 22:49:18 2014     *mangle     :PREROUTING ACCEPT [73:6562]     :INPUT ACCEPT [33:4290]     :FORWARD ACCEPT [18:972]     :OUTPUT ACCEPT [18:1408]     :POSTROUTING ACCEPT [27:1624]     -A INPUT -s 173.214.161.60 -j MARK --set-xmark 0x6/0xffffffff     -A FORWARD -s 173.214.161.60 -j MARK --set-xmark 0x5/0xffffffff     -A POSTROUTING -s 173.214.161.60 -j MARK --set-xmark 0x4/0xffffffff     -A PREROUTING -s 173.214.161.60 -j MARK --set-xmark 0x3/0xffffffff     -A OUTPUT -s 173.214.161.60 -j MARK --set-xmark 0x2/0xffffffff     COMMIT     # Completed on Sun Jun 22 22:49:18 2014     # Generated by iptables-save v1.4.7 on Sun Jun 22 22:49:18 2014     *nat     :PREROUTING ACCEPT [31:3139]     :POSTROUTING ACCEPT [14:1016]     :OUTPUT ACCEPT [14:1016]     -A PREROUTING -d 10.254.254.254/32 -i dmz -j DNAT --to-destination 10.254.254.2     -A POSTROUTING -o dmz -j SNAT --to-source 10.254.254.253     COMMIT     # Completed on Sun Jun 22 22:49:18 2014


Solving "mv: Argument list too long"?

I have a folder with more than a million files that needs sorting, but I cant really do anything because `mv` outputs this message all the time               -bash: /bin/mv: Argument list too long      I'm using this command to move extension-less files:               mv -- !(*.jpg|*.png|*.bmp) targetdir/


Using makefile assignments from a shell script

For example:               srcdir = ../libc  # Src directory     prefix = /usr/local           // Installation path       The first line is from a makefile and second from `config.make`. I need to access the variable in a shell script as `$srcdir` and `$prefix`. One solution I found is cutting all `` = `` to ``=`` and the part after `#` and `//` and do `eval`. Is there any other easy and reliable solution? I am on `#!/bin/sh`.


can you make zsh autocorrect smarter?

I like `zsh` autocorrect, but it keeps asking me about things that don't need correcting.               dzil build     zsh: correct 'build' to '.build' [nyae]? %       `.build` is a directory created by the `build` (or any other commands that run that action so `dzil .build` is always wrong, and `dzil build` is always right. Is there any way I can communicate this to the autocorrect system?


What is the Linux command to display how many file names in the directory end in two digits? Using `ls` with a command like this :               ls -l | wc –l  *[0-9][0-9]


How to combine iptables rulesets

Say there are several iptables scripts (run at boot time), all of which run something like `iptables -A ...` to add rules. I'm thinking this could be improved, turning all those shell scripts into text files generated by iptables-save. But I must be doing something wrong, trying to read all those rulesets. The script run at boot time would loop through those files and read them using iptables-restore. Of course with -n or --noflush. This works for some rules (stored in the default chains) but not for most of my rules which are in other chains. Below is an example of 2 rulesets that flush each other (reading set a, check; reading set b, check but set a is gone). **How would you read a bunch of iptables rulesets?** Example:               $ cat fake1-a.rules      *nat     :PREROUTING ACCEPT [7:997]     :INPUT ACCEPT [7:997]     :OUTPUT ACCEPT [28:1810]     :POSTROUTING ACCEPT [28:1810]     COMMIT     *mangle     :PREROUTING ACCEPT [344:84621]     :INPUT ACCEPT [344:84621]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [296:37971]     :POSTROUTING ACCEPT [296:37971]     COMMIT     *filter     :INPUT ACCEPT [102:26513]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [89:10767]     :TESTCHAIN - [0:0]     -A TESTCHAIN -p tcp -m tcp --dport 12345 -j DROP     COMMIT     $ cat fake1-b.rules      *nat     :PREROUTING ACCEPT [7:997]     :INPUT ACCEPT [7:997]     :OUTPUT ACCEPT [28:1810]     :POSTROUTING ACCEPT [28:1810]     COMMIT     *mangle     :PREROUTING ACCEPT [344:84621]     :INPUT ACCEPT [344:84621]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [296:37971]     :POSTROUTING ACCEPT [296:37971]     COMMIT     *filter     :INPUT ACCEPT [102:26513]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [89:10767]     :TESTCHAIN - [0:0]     -A TESTCHAIN -p tcp -m tcp --dport 54321 -j DROP     COMMIT     # cat fake1-a.rules | iptables-restore --noflush     # iptables -nL | grep DROP     DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:12345     # cat fake1-b.rules | iptables-restore --noflush     # iptables -nL | grep DROP     DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:54321


Why dircolors don't return enything for bash called from php

I have this code in php:               header("Content-Type: text/plain");     exec("/bin/bash -c 'dircolors -b'", $result);     echo implode("\n", $result);      but it return               LS_COLORS='';     export LS_COLORS      Why I'm not getting color ANSI codes?


HSPA+ USB Modem Alcatel X600 1bbb:0195

The Modem Does anyone have this modem in Linux? I do not get to configure the device. I have tried other tutorials similar devices without success. I can't get the device /dev/ttyUSB0 My System:   * Debian testing 32 bits.   * kernel 3.14-1-686-pae More detailed device description: (Pay attention to the word UNRECOGNIZED)               Bus 003 Device 018: ID 1bbb:0195 T & A Mobile Phones      Device Descriptor:       bLength                18       bDescriptorType         1       bcdUSB               2.00       bDeviceClass            2 Communications       bDeviceSubClass         0        bDeviceProtocol         0        bMaxPacketSize0        64       idVendor           0x1bbb T & A Mobile Phones       idProduct          0x0195        bcdDevice            0.00       iManufacturer           3 USBModem       iProduct                2 3G PlugLink Dongle       iSerial                 0        bNumConfigurations      1       Configuration Descriptor:         bLength                 9         bDescriptorType         2         wTotalLength           75         bNumInterfaces          2         bConfigurationValue     1         iConfiguration          1 USBModem Configuration         bmAttributes         0xe0           Self Powered           Remote Wakeup         MaxPower              500mA         Interface Association:           bLength                 8           bDescriptorType        11           bFirstInterface         0           bInterfaceCount         2           bFunctionClass        224 Wireless           bFunctionSubClass       1 Radio Frequency           bFunctionProtocol       3 RNDIS           iFunction               0          Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        0           bAlternateSetting       0           bNumEndpoints           1           bInterfaceClass       224 Wireless           bInterfaceSubClass      1 Radio Frequency           bInterfaceProtocol      3 RNDIS           iInterface              0            ** UNRECOGNIZED:  05 24 00 00 01           ** UNRECOGNIZED:  05 24 01 00 01           ** UNRECOGNIZED:  04 24 02 00           ** UNRECOGNIZED:  05 24 06 00 01           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            3               Transfer Type            Interrupt               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0040  1x 64 bytes             bInterval               4         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       0           bNumEndpoints           2           bInterfaceClass        10 CDC Data           bInterfaceSubClass      0 Unused           bInterfaceProtocol      0            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x82  EP 2 IN             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x01  EP 1 OUT             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0     Device Qualifier (for other device speed):       bLength                10       bDescriptorType         6       bcdUSB               2.00       bDeviceClass            2 Communications       bDeviceSubClass         0        bDeviceProtocol         0        bMaxPacketSize0        64       bNumConfigurations      1     Device Status:     0x0000       (Bus Powered)      **dmesg output** :               [29031.944017] usb 3-1.2: new high-speed USB device number 19 using ehci-pci     [29032.039363] usb 3-1.2: New USB device found, idVendor=1bbb, idProduct=f017     [29032.039368] usb 3-1.2: New USB device strings: Mfr=3, Product=2, SerialNumber=4     [29032.039370] usb 3-1.2: Product: 3G PlugLink Dongle     [29032.039372] usb 3-1.2: Manufacturer: USBModem     [29032.039374] usb 3-1.2: SerialNumber: 1234567890ABCDEF     [29032.042753] usb-storage 3-1.2:1.0: USB Mass Storage device detected     [29032.042909] scsi12 : usb-storage 3-1.2:1.0     [29033.081320] usb 3-1.2: USB disconnect, device number 19     [29033.279534] usb 3-1.2: new high-speed USB device number 20 using ehci-pci     [29033.378130] usb 3-1.2: New USB device found, idVendor=1bbb, idProduct=0195     [29033.378134] usb 3-1.2: New USB device strings: Mfr=3, Product=2, SerialNumber=0     [29033.378137] usb 3-1.2: Product: 3G PlugLink Dongle     [29033.378139] usb 3-1.2: Manufacturer: USBModem     [29033.385558] rndis_host 3-1.2:1.0 eth1: register 'rndis_host' at usb-0000:00:1a.0-1.2, RNDIS device, 00:a0:c6:00:00:00     [29033.407898] systemd-udevd[11230]: renamed network interface eth1 to eth2


How does Linux know the Location of File Data on Disk

related to: What is a Superblock, Inode, Dentry and a File? None of the famous metadata structures hold onto to location data for the actual file. Dentry maps names to inodes, and inodes store information about the files -- how does the system know where the file's actual data bits are located on the disk? Is there some sort of default mapping of inode integers to disk location?


Unable to access an http sevice forwarded using ssh

I forwarded a port from a remote server (which has Tomcat running on it) to a local port on my machine. Say, if the remote server address is http://myremoteserver.com:8080, I forwarded the port to localhost this way: ssh -L 8080:myremoteserver.com:8080 -N watson Note: Access to myremoteserver is possible only through watson. After forwarding, if I run localhost:8080 on my browser, I can see the output. But if I try to access this localhost from any other machine on my network (DNS of localhost is server1) through browser, say server1:8080, it does not load at all. Strangely, if I run tomcat on localhost (instead of port forwarding through ssh), and access it through browser from another machine on network, server1:8080, it works. Please help. I thought it has to do something with iptables; but it doesn't work even after turning it off.


SSH session pauses mid datastream; resumes with a keypress

I've had this problem occur at random, intermittently, across boxes at multiple companies, multiple distros, and multiple kernel revs. I think that I'm just cursed. What happens is that I'll have a new box loaded, and I'll be doing something inside ssh, like a yum update or an apt-get. Everything will be progressing fine and then the session just stops. The ssh doesn't disconnect, it's almost as if someone sent a scroll lock keypress to the session. If I hit enter, or space, or just about any keystroke in the ssh session, the session wakes back up and its as if nothing went wrong. I once upon a time tracked down an issue like this and found that the interactive processes were entering SLEEP status. I can't confirm that this is the same behavior in this case, but I will amend the question if I can pinpoint that specific cause. Regardless, I was never able to figure out why the processes were randomly going into sleep. Has anyone had this or a similar issue and have any insight into what might be causing it?


Can selinux log an application owner name?

So I've set up selinux to log all file access operations in a certain directory. Here's some sample log output when doing an ls from sftp:               type=AVC msg=audit(1338465611.221:356): avc:  granted  { getattr } for  pid=5973 comm="sftp-server" path="/polog" dev=dm-0 ino=1966081 scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:polog_t:s0 tclass=dir      sftp in this case is running as user1, is there a way to have selinux log this username as well or should I be taking a different approach? Here's my policy files: ---polog.te---               policy_module(polog, 1.0.14)          require {         type fs_t;             type unconfined_t;             type sshd_t;             type setfiles_t;             class filesystem associate;             class dir relabelto;     }          type polog_t;          #============= polog_t ==============          allow polog_t fs_t:filesystem associate;     allow unconfined_t polog_t:dir relabelto;     allow setfiles_t polog_t:dir relabelto;          #====================================          auditallow unconfined_t polog_t : file *;     auditallow unconfined_t polog_t : dir *;          allow unconfined_t polog_t : file *;     allow unconfined_t polog_t : dir *;      * * * ---polog.fc---               /polog(/.*)?            gen_context(system_u:object_r:polog_t)


Disable sticky keys

Sometimes my X behaves like it has «sticky keys» turned on. I have no idea how I activated it. Usually hitting the "sticky" key multiple times solves the problem, but it is nevertheless annoying. I thought I had disabled sticky keys and other accessibility options with `xkbset -a`, but it still happens. Here are the relevant pieces from `xkbset q`:               Accessibility Features (AccessX) = Off     Sticky-Keys = Off     Two Keys Mask = On     Latch to Lock Mask = On     Slow-Keys = Off     Slow Keys Delay = 300     Bounce-Keys = Off     Debounce Delay = 300     AccessX Feedback = On     Use Fixed Pitch Bell = On      Any other places I should check? I'm running Debian testing, xmonad window manager, and many gnome and kde applications. I suspect that it could be a gnome or kde feature.


why there are six getty processes running on my desktop?

My desktop system is:               $ uname -a     Linux xmachine 3.0.0-13-generic #22-Ubuntu SMP Wed Nov 2 13:25:36 UTC 2011 i686 i686 i386 GNU/Linux      By running `ps a | grep getty`, I get this output:                 900 tty4     Ss+    0:00 /sbin/getty -8 38400 tty4       906 tty5     Ss+    0:00 /sbin/getty -8 38400 tty5       915 tty2     Ss+    0:00 /sbin/getty -8 38400 tty2       917 tty3     Ss+    0:00 /sbin/getty -8 38400 tty3       923 tty6     Ss+    0:00 /sbin/getty -8 38400 tty6       1280 tty1     Ss+    0:00 /sbin/getty -8 38400 tty1       5412 pts/1    S+     0:00 grep --color=auto getty      I think ttyX processes is for input/ouput devices but I am not quite sure. Based on this I am wondering that why there are 6 ttyX processes running? I have only one input devices(keyboard) actually.


GNU Emacs; Does the GUI version offer anything more than the ability to have a GUI menu?

I've been _looking_ at GNU Emacs for a few months now, on and off (mainly off), and I've really only gone as far as testing a few basic things which I especially want in an editor... I'm slowly getting to realize its topography, and it is starting to make (good) sense.... The main thing I've noticed is that it _seems_ to work exactly the same in the X-GUI version as it does in the X-Terminal version (and I suspect it would be pretty much the same in a non-GUI environment... I originally thought that I would feel very uncomfortable working in a non-GUI editor, and that has been the case, but the more I dabble in the Emacs waters, the less significant that **need** becomes... so I am now looking at it from the other end of the stick... I'm turning my focus to working primarily in the Terminal version.. My question is: Aside from the obvious GUI-menu (which has turned out to be quite unnecessary), is there any notable difference between the versions (X-GUI, X-Terminal, and no-GUI) ?*


How to move files with specific extensions to newly created directories

I want to `mv` files with specific extensions to newly created directories. This script moves files with all the extentions in all the newly created folders, which is not the intent. Instead, it should move extension-specific files to specific folders. How can I accomplish that?               for i in 1 2 3     do         mkdir -p backup/ch0${i}         if [ $? -eq ]; then             echo "directory backup/ch0${i} created"             for j in c h sh             do                 count=0                 count=`expr $count + 1`                 if [ $count==i ]; then                     cp /home/owner/*.${j} backup/ch0${i}                     if [ $count!=i ]; then                         continue;                     elif [ $? -ne 0 ]; then                         break 2;                     fi             done         else             echo "could not back up directory!!"         fi      done


Finding correct information to update mtab and fstab?

Is there an automated way to update my `mtab` and `fstab`? Or a command I can run so that I can copy the output into these files? I'm just nervous about tampering with these files because I know they are critical. I previously had a `md0` and `md1` array but they "disappeared." Now my `mtab` and `fstab` is stale and it is giving me problems trying to run this automatic RAID utility, raider. ### fstab               # /etc/fstab: static file system information.     #     # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc            /proc           proc    defaults        0       0     /dev/md0       /               ext3    errors=remount-ro 0       1     /dev/md1       none            swap    sw              0       0     /dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0      ### mtab               /dev/md0 / ext3 rw,errors=remount-ro 0 0     tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0     proc /proc proc rw,noexec,nosuid,nodev 0 0     sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0     udev /dev tmpfs rw,mode=0755 0 0     tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0     devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0      ### /proc/mounts               rootfs / rootfs rw 0 0     none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0     none /proc proc rw,nosuid,nodev,noexec,relatime 0 0     none /dev devtmpfs rw,relatime,size=1547340k,nr_inodes=215947,mode=755 0 0     none /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0     /dev/sda1 / ext3 rw,relatime,errors=remount-ro,data=ordered 0 0     tmpfs /lib/init/rw tmpfs rw,nosuid,relatime,mode=755 0 0     tmpfs /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0      ## Here's what I think based on observation ### My proposed update to fstab (should it be sda or sda1?)               # /etc/fstab: static file system information.     #     # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc            /proc           proc    defaults        0       0     /dev/sda1       /               ext3    errors=remount-ro 0       1     /dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0      ### My proposed update to mtab (should it be sda or sda1?)               /dev/sda1 / ext3 rw,errors=remount-ro 0 0     tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0     proc /proc proc rw,noexec,nosuid,nodev 0 0     sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0     udev /dev tmpfs rw,mode=0755 0 0     tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0     devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0


Best Disk Partitioning Scheme for a Linux-based Developer Machine

Is there some kind of "best disk partitioning scheme" for a Linux-based web and application **developer machine** , in terms of performance, organization or others?


How to install ia32-libs in Debian Wheezy?

I would like to install `ia32-libs` in Debian Wheezy however it seems it is deprecated. The solution in this question works when installing 32-bit packages from Debian repositories, but there are some external applications I would like to install (in `/opt/`) that are 32-bit. Is there a way to force-install `ia32-libs`?


Installing libxml2 on secure Debian box

I have a very stripped Debian distro on a small custom computer that I purchased (don't know much about this distro as it was recommended on some site). The name is 'sid' and runs 2.6.37.1 kernel. Unfortunately it doesn't have any PPA's in the sources.list file so I cannot apt-get any software. I am trying to get libxml2 (Gnome package) for a program called xmllint. Since I cannot apt-get this software I need to get each debian package. Going further it needs: libxml2 depends > multiarch (the computer is i586 not i386) > libc > libc-dev > ... and so on until infinity. This distro has the build-essentials installed but I can't instal libc and libc-dev alone as it leads to 100's of more dependencies. Where can I go from here?


Fast elimination of duplicate lines across multiple files

I have a huge amount of data in which each (data-)line should be unique. There are a lot of files in one folder in which this is already true. It is about 15GB splitted into roughly 170 files with 1000000 lines. Let's call that folder `foo`. Now there is a second folder (`bar`) with even more data: In each file, there are no multiple entries. The intersection of two files in `bar` is not necessarily empty. There are roughly 15k lines in each of the files there (and there are several thousands of files in `bar`). Right now I'm using               awk 'NR==FNR{a[$0]=$0;next}!a[$0]' foo/file bar/file > tmp     mv tmp bar/file      and a loop over all files in `foo` and a loop over all files in `bar`. I break the loop over `foo` if the `bar/file` is empty. I have parallelized this by locking (for use on several nodes) and parallel execution (on each node). But still, this needs a heck of a long time. What are possibilities of improving performance? What is the ideal file size of files in `foo`? Of course this is machine dependent (RAM/CPU/storage), but what is a good rule of thumbs here? **tl;dr** : `foo` contains unique data lines, `bar` contains data lines which can appear multiple times in `bar`and `foo`. Eliminate duplicates in `bar` such that they can be merged with `foo` **[Update]** There are no empty lines **[/Update]**


Placement of kernel binary and sources for kernel module building?

I'm trying to setup an environment for kernel module development in Linux. I've built the kernel in the home folder and would like to place the sources and binaries to the correct place so include correctly. The example for building the kernel module has the following includes:               #include <linux/init.h>     #include <linux/module.h>      What are the absolute paths that the linker looks for these headers?


How to monitor or kill a process which has been started by cron?

I have some bots, which are run by the System scheduler at given time interval. But sometimes due to some logical error I have to stop these bots manually. How can I find these processes run by the scheduler and kill them?


emacs can't open display

Just recently this has started happening; I run: `/usr/bin/emacsclient --alternate-editor="" --no-wait -c` and get: > ERROR: Display :0.0 can't be opened No other applications do this. The output from `xdpyinfo`:               name of display:    :0.0     version number:    11.0     vendor string:    The X.Org Foundation     vendor release number:    10707000     X.Org version: 1.7.7     .....      **Edit:** I discovered that old emacs servers/daemons are still running.               $ps ux | grep [e]macs     richard   2642  0.0  0.8  38788 24984 ?        Ss   Jun22   0:25 emacs --daemon     richard   7512  0.0  0.6  33896 19720 ?        Ss   Jun23   0:05 emacs --daemon     richard  15458  0.0  0.6  32836 19076 ?        Ss   09:40   0:01 emacs --daemon      Does anyone have any ideas how these can be shut-down when I log-off?


arch linux installation, "could not create filesystems"

im installing arch linux, the x86-64 net install. during the part where the hard drive is being processed/erased, i get: "Warning: Could not create all needed filesystems. Either the underlying blockdevices didn't become available in 10 iterations, or process filesystem failed." How do i fix that? How do i know which filesystem to use?


Open any kind of application with BASH

I have made a Java program that could open any application. Suppose there is a file name "*.jpg", the it would allow the OS to recognize the type of application and then open the default application. Another example: Suppose the file's name is "*.flv", then it would open up the default media player just like when you click an icon in nautilus but the only difference was that it was in command line. Here is the java program for that:               import java.awt.*;     import java.io.*;     public class OpenFile{         public static void main(String args[]){           try{               String filename = args[0];               System.out.println(args[0]);               Desktop.getDesktop().open(new File(filename));           }           catch(Exception e){               System.out.println("Sorry an exception occured. Could not perform the operation.");           }         }      }      Now this script leads to performance issues. Now I want to write a BASH script to do this task ??


"Destination Host Unreachable" when pinging wireless router

I'm a little new to all the intricacies of Linux workings, so please bear with me if this is a dumb question. I'm using Linux Mint 12 and I have an Asus PCE-N15 wireless card, which is running the Windows driver. Anyway, periodically I completely lose my connection, though Network Manager and iwconfig still claim that it's fine. If I ping my wireless router continually, I get something like the following:               64 bytes from 192.168.1.1: icmp_req=2368 ttl=64 time=132 ms     64 bytes from 192.168.1.1: icmp_req=2369 ttl=64 time=1239 ms     64 bytes from 192.168.1.1: icmp_req=2370 ttl=64 time=1098 ms     64 bytes from 192.168.1.1: icmp_req=2371 ttl=64 time=848 ms     From 192.168.1.119 icmp_seq=2408 Destination Host Unreachable     From 192.168.1.119 icmp_seq=2409 Destination Host Unreachable     From 192.168.1.119 icmp_seq=2412 Destination Host Unreachable     From 192.168.1.119 icmp_seq=2415 Destination Host Unreachable      The connection strength should not be an issue, nor do I believe that the router itself is the problem, as I do not have similar symptoms on any other computers. Interestingly, the problem seems to be correlated with my usage of the computer. When I'm not making any TCP requests, the continuous ping hums along fine, with an average latency of less than 10 ms. But when I start making requests, the average latency jumps way up and I start getting "Destination Host Unreachable". For reference here are the outputs of route, ifconfig, and iwconfig. None of these seems to be any different when I'm unable to ping the router.               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     default         192.168.1.1     0.0.0.0         UG    0      0        0 wlan0     link-local      *               255.255.0.0     U     1000   0        0 wlan0     192.168.1.0     *               255.255.255.0   U     2      0        0 wlan0               wlan0     Link encap:Ethernet  HWaddr 14:da:e9:f2:4b:b4                 inet addr:192.168.1.119  Bcast:192.168.1.255  Mask:255.255.255.0               inet6 addr: fe80::16da:e9ff:fef2:4bb4/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:610537 errors:0 dropped:0 overruns:0 frame:0               TX packets:594181 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:511435072 (511.4 MB)  TX bytes:81176260 (81.1 MB)          wlan0     IEEE 802.11bgn  ESSID:"Network"                 Mode:Managed  Frequency:2.437 GHz  Access Point: C0:C1:C0:53:A9:DA                  Bit Rate=144.4 Mb/s   Tx-Power=20 dBm                  Retry  long limit:7   RTS thr=2347 B   Fragment thr:off               Power Management:off               Link Quality=51/70  Signal level=-59 dBm                 Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0               Tx excessive retries:0  Invalid misc:14   Missed beacon:0      Thanks so much for your help.


How to do multiple brace expansions without combinatorial explosion?

I often use brace expansion on the command line, because it's handy. ### Example               {foo,bar}      expands to:               foo bar      Multiple brace expansion also expand, e.g.:               {foo,bar}Q{foo,bar}      would expand to:               fooQfoo fooQbar barQfoo barQbar      This is expected behavior, where the brace expansions are used in order. ### My Question Now, I'd like the output of any brace expansion (or other short command line trick) to be:               fooQfoo barQbar      Note: I'm using `bash 3.2`


Automatically adjust window width in tmux

Is there a way to set tmux so that it automatically adjusts window width when I switch to the pane so that it will be wide axactly as the longest (visible on screen) line in the file I have open? I'm doing this manually with the command      `:resize-pane -R 10`   or   `:resize-pane -L 10`      I always have to guess the number and when I switch to another pane I have to do it again Note that this functionality is relevant only to vertical panes.


In synaptic, is there a way to always expand "Details" when installing a package?

While using synaptic and update-manager in Debian (I'm using unstable), I always like to see what it is doing while installing and always manually expand the "Show installing files" and "Details" tabs. Is there a way to make this a permanent setting?


ld-2.14 segfaulting on KDE launch in ArchLinux

I just installed ArchLinux and then KDE. It was all working fine. After a reboot, KDE simply refuses to starts. Whenever I login using KDM, it shows the KDE splash screen.. and before the second icon loads, it sort of crashes and returns back to the login screen. This is the error I got from `/var/log/messages`:               Aug 21 23:33:23 meanmachine kernel: [   26.023430] kded4[1093]: segfault at 68 ip 00007fd16607012e sp 00007fff5ce4d2a0 error 4 in ld-2.14.so[7fd166065000+1f000]     Aug 21 23:33:23 meanmachine kernel: [   26.061628] kcminit_startup[1095]: segfault at 68 ip 00007fd16607012e sp 00007fff5ce4d3b0 error 4 in ld-2.14.so[7fd166065000+1f000]      I've tried:   1. Clearing the pacman cache.   2. Re-installing kde-meta, resyncing base, base-devel.   3. Doing a system-wide upgrade. However nothing seems to work. I am facing the same problem again. Any help is greatly appreciated.


Slow response time with Gnome shell in Virtualbox fullscreen mode

Today I installed Fedora 15 in a VBox VM to try out Gnome 3. After installing the guest extensions almost everything works fine. Except for the slow response time in fullscreen mode (HOST+F). By that I mean textareas responding only after I've typed whole words, window dragging won't register etc. However in maximized window mode everything runs smoothly. Anyone have a similar experience? What can I do? VirtualBox guest settings are as following.   * 1,5 GB RAM   * 1 CPU core (no limitations, 2,2Ghz host)   * 128 MB video memory      * 3d accel enabled     * 2d accel disabled (it says this is only for windows guests)   * rest is defaults I also have a graphics card that uses nvidia's optimus technology but I doubt that this is the problem. Host OS is Windows 7 Professional


How do I check if a file already has line with "contents" in it?

I need to know if a file aready has line with contents X in it, if not append line. here's the code I've tried.               if ! $(grep 'eval $(perl -I$HOME/foo/lib/perl5 -Mlocal::lib=$HOME/foo)' ~/.bashrc)     then         echo 'eval $(perl -I$HOME/foo/lib/perl5 -Mlocal::lib=$HOME/foo)' >> ~/.bashrc     fi


Which kernel module name is currently correct "usb-storage" or "usb_storage"?

I have found a number of examples how to prevent a kernel module from being loaded. One of them is about USB storage module. The next code has been provided: `echo "blacklist usb-storage" | sudo tee -a /etc/modprobe.d/blacklist.conf` then I decided to check the name by `lsmod`, so I plugged a USB stick in and found it to be different:               Module                  Size  Used by     usb_storage            62209  1      My question is: what spelling should I apply to the `blacklist`: `usb-storage` or `usb_storage`? I have doubts about it being one name for an earlier kernel, and changed to another one for a later kernel. Currently I am running the Kernel version `3.13.0-30-generic`


How to set message validity

I am using Shibboleth for single user authentication and it needs a ssl configuration which facilitates the user authentication process. Before it was working fine but now I am facing a **SSL handshake failure** error and the secure connection is being ignored. **Error Log:** Here is the Shibbolet error log:               2012-09-20 15:14:59 DEBUG Shibboleth.Listener [17]: dispatching message (default/SAML/POST)     2012-09-20 15:14:59 DEBUG OpenSAML.MessageDecoder.SAML1POST [17]: validating input     2012-09-20 15:14:59 DEBUG OpenSAML.MessageDecoder.SAML1POST [17]: decoded SAML response:     <Response xmlns="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" IssueInstant="2012-09-20T13:10:43.494Z" MajorVersion="1" MinorVersion="1" Recipient="https://inami-riziv.dokeosnet.com/Shibboleth.sso/SAML/POST" ResponseID="_faf482981786daacf938e158e87d75f8"><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">     <ds:SignedInfo>     <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:CanonicalizationMethod>     <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></ds:SignatureMethod>     <ds:Reference URI="#_faf482981786daacf938e158e87d75f8">     <ds:Transforms>     <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"></ds:Transform>     <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="code ds kind rw saml samlp typens #default xsd xsi"></ec:InclusiveNamespaces></ds:Transform>     </ds:Transforms>     <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod>     <ds:DigestValue>qgvrV2yDB88HKXStzqT3sFrpLlo=</ds:DigestValue>     </ds:Reference>     </ds:SignedInfo>     <ds:SignatureValue>     ifKK73UUbsOxqpsnfGcloErG5Vsrklckv/xpbsMAWDzrTm8ZvWjaLru0d7smEYmKFXdkJ/JayAXW     cM5aAKAwazWM7tj5YYvY3bTFlq4k/qI3GR46Kr5apGKkTEtDR9DkZDJ6N2+/vqOvdIxwefdFvaPs     FzsrZeGkt+IAcKmgCFZ78/2tbfckYd4sFGko0Lw3nIl9/dac03OJUsUVuScsiEVd6f/DjzedHgkk     3DD0xR2HFIY5MQzDdztz1f4PyuGFdXiyauUtm2bF+7XULQ8XwfGd+K0qIMOKBykTQuq0ijL+PpgZ     jRr3G2ylqSsJ1/NIwT6pRG79gJlcw55RB25XzA==     </ds:SignatureValue>     <ds:KeyInfo>     <ds:X509Data>     <ds:X509Certificate>     MIIE0DCCA7igAwIBAgILAQAAAAABMu4tWh8wDQYJKoZIhvcNAQEFBQAwNDELMAkGA1UEBhMCQkUx     FjAUBgNVBAMTDUdvdmVybm1lbnQgQ0ExDTALBgNVBAUTBDIwMTAwHhcNMTExMDEwMTUwMTMyWhcN     MTMwMTEwMTUwMTMyWjCBrTEcMBoGA1UEAxMTQ0JFPTA4MDkzOTQ0MjcsIElBTTELMAkGA1UEBhMC     QkUxDDAKBgNVBAsTA0lBTTEXMBUGA1UECxMOQ0JFPTA4MDkzOTQ0MjcxGTAXBgNVBAsTEEVIRUFM     VEgtUExBVEZPUk0xITAfBgNVBAsTGGVIZWFsdGgtcGxhdGZvcm0gQmVsZ2l1bTEbMBkGA1UEChMS     RmVkZXJhbCBHb3Zlcm5tZW50MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwgdTZNoR     CU7urB0+tdDDlVfrplxwcEwp+QoMJpiznNjMHZLxzwzl6PSMc8V7Gd2OGSGSHZJqrDz0643Djo6o     t59Tai2itHy9ZIQle3wmREi9ek86ousZuP6sZDw019xzztFLCaqO1Jfs28sBAeZovZZou7dDuD7w     86lkxvPssdJWZ0MO9FTwsseRoUowfWUfxp8E+3PpYdEy6BxGo5hh13lm2RphbcW0v0ouvR9yqVRh     cYhonol4Yj7nEm6tTc6NmCf2zEaX+F3e2hbj7bzgWJ1wKuhiMuQItLgN/XKhb6/jy44wjLj6IWIS     DH8LVPYITm+ImidDKI7WcGzJhu0IowIDAQABo4IBZzCCAWMwHwYDVR0jBBgwFoAUQZbOhaflXugW     WT0K8YTd8/K7TokwbgYIKwYBBQUHAQEEYjBgMDYGCCsGAQUFBzAChipodHRwOi8vY2VydHMucGtp     LmJlbGdpdW0uYmUvYmVsZ2l1bXJzMi5jcnQwJgYIKwYBBQUHMAGGGmh0dHA6Ly9vY3NwLnBraS5i     ZWxnaXVtLmJlMAkGA1UdEwQCMAAwRAYDVR0gBD0wOzA5BgdgOAkBAQMDMC4wLAYIKwYBBQUHAgEW     IGh0dHA6Ly9yZXBvc2l0b3J5LnBraS5iZWxnaXVtLmJlMD0GA1UdHwQ2MDQwMqAwoC6GLGh0dHA6     Ly9jcmwucGtpLmJlbGdpdW0uYmUvZ292ZXJubWVudDIwMTAuY3JsMA4GA1UdDwEB/wQEAwIE8DAR     BglghkgBhvhCAQEEBAMCBLAwHQYDVR0OBBYEFGtvDxQis8EQNHkujqvXW0CGhSbnMA0GCSqGSIb3     DQEBBQUAA4IBAQCDfqrhNJeB+tiesyXiAfuIwz2rJiVANb71VptyPGh96qMHBfU/w9fKdN87cF2J     IHg23ll0MEUo7I8oA2F5Dv0Jw/sB7GovOsosC6QcYzEo/D24vSYKI7Clw3SkKPUcqv3u68IPs8wF     L/Nowmxy6HGAvDlt1fQBpwePVKifGOygUcz0KWHMqNV7IJzyXrF2nbvg3TUJKaDR0zV4CjzLpaCI     IY1wY6e2/08mxf/Q5D7YO3sTxmjixkjRqCKXBCJa0CjXxT3/8Pfg5lHGNr7onIL84SMCZREur5I0     3u64HiqHBtSZaDWrw7d4CcjY/NoPfHO8hmAXEBMTm4zEhG4Nw0+2     </ds:X509Certificate>     </ds:X509Data>     </ds:KeyInfo></ds:Signature><Status><StatusCode Value="samlp:Success"></StatusCode></Status><Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion" AssertionID="_56927407beba7fd1762d43bb15f71303" IssueInstant="2012-09-20T13:10:43.494Z" Issuer="http://idp.smals-mvm.be/shibboleth" MajorVersion="1" MinorVersion="1"><Conditions NotBefore="2012-09-20T13:10:43.494Z" NotOnOrAfter="2012-09-20T13:15:43.494Z"><AudienceRestrictionCondition><Audience>https://inami-riziv.dokeosnet.com/shibboleth</Audience><Audience>urn:be:fgov:ehealth:trust:partners</Audience></AudienceRestrictionCondition></Conditions><AuthenticationStatement AuthenticationInstant="2012-09-20T13:10:43.494Z" AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified"><Subject><NameIdentifier Format="urn:mace:shibboleth:1.0:nameIdentifier" NameQualifier="http://idp.smals-mvm.be/shibboleth">_99e6f544a77e9b878ff54a1091c2c603</NameIdentifier><SubjectConfirmation><ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</ConfirmationMethod></SubjectConfirmation></Subject><SubjectLocality IPAddress="193.191.246.82"></SubjectLocality></AuthenticationStatement></Assertion></Response>          2012-09-20 15:14:59 DEBUG OpenSAML.MessageDecoder.SAML1 [17]: extracting issuer from SAML 1.x Response     2012-09-20 15:14:59 DEBUG OpenSAML.MessageDecoder.SAML1 [17]: response from (http://idp.smals-mvm.be/shibboleth)     2012-09-20 15:14:59 DEBUG OpenSAML.MessageDecoder.SAML1 [17]: searching metadata for response issuer...     2012-09-20 15:14:59 DEBUG OpenSAML.SecurityPolicyRule.MessageFlow [17]: evaluating message flow policy (replay checking on, expiration 60)     2012-09-20 15:14:59 ERROR OpenSAML.SecurityPolicyRule.MessageFlow [17]: rejected expired message, timestamp (1348146643), oldest allowed (1348146659)     2012-09-20 15:19:53 INFO XMLTooling.StorageService : purged 1 expired record(s) from storage     2012-09-20 15:34:53 INFO XMLTooling.StorageService : purged 1 expired record(s) from storage     2012-09-20 15:42:06 DEBUG Shibboleth.Listener [18]: dispatching message (default::getHeaders::Application)     2012-09-20 15:42:06 DEBUG Shibboleth.Listener [18]: dispatching message (default/Login::run::Shib1SI)     2012-09-20 15:42:06 DEBUG XMLTooling.StorageService [18]: inserted record (9699add17fc90926f21c8fa06efec1e1) in context (RelayState) with expiration (1348149126)     2012-09-20 16:04:53 INFO XMLTooling.StorageService : purged 1 expired record(s) from storage     2012-09-20 16:19:53 INFO XMLTooling.StorageService : purged 2 expired record(s) from storage     2012-09-20 16:20:21 DEBUG Shibboleth.Listener [21]: dispatching message (default::getHeaders::Application)     2012-09-20 16:20:21 DEBUG Shibboleth.Listener [21]: dispatching message (default/Login::run::Shib1SI)     2012-09-20 16:20:21 DEBUG XMLTooling.StorageService [21]: inserted record (5bfae2fab27dfd8026a14e253696bc3a) in context (RelayState) with expiration (1348151421)     2012-09-20 16:34:53 INFO XMLTooling.StorageService : purged 1 expired record(s) from storage     2012-09-20 16:39:19 DEBUG Shibboleth.Listener [22]: dispatching message (default::getHeaders::Application)     2012-09-20 16:39:19 DEBUG Shibboleth.Listener [22]: dispatching message (default/Login::run::Shib1SI)     2012-09-20 16:39:19 DEBUG XMLTooling.StorageService [22]: inserted record (fbf6b65fc660ed134500345faef56f0a) in context (RelayState) with expiration (1348152559)     2012-09-20 16:43:29 INFO Shibboleth.Listener [15]: detected socket closure, shutting down worker thread     2012-09-20 16:49:53 INFO XMLTooling.StorageService : purged 1 expired record(s) from storage     2012-09-20 17:20:55 INFO Shibboleth.Listener [19]: detected socket closure, shutting down worker thread     2012-09-20 17:31:10 INFO Shibboleth.Listener [21]: detected socket closure, shutting down worker thread     2012-09-20 18:21:09 INFO Shibboleth.Listener [18]: detected socket closure, shutting down worker thread     2012-09-20 18:28:29 INFO Shibboleth.Listener [17]: detected socket closure, shutting down worker thread     2012-09-20 18:28:31 INFO Shibboleth.Listener [20]: detected socket closure, shutting down worker thread     2012-09-20 18:48:23 DEBUG Shibboleth.Listener [23]: dispatching message (default::getHeaders::Application)     2012-09-20 18:48:23 DEBUG Shibboleth.Listener [23]: dispatching message (default/Login::run::Shib1SI)     2012-09-20 18:48:23 DEBUG XMLTooling.StorageService [23]: inserted record (0b316ef6e5acf1da562899feb0b84ec1) in context (RelayState) with expiration (1348160303)     2012-09-20 18:52:26 DEBUG Shibboleth.Listener [24]: dispatching message (default::getHeaders::Application)     2012-09-20 18:52:26 DEBUG Shibboleth.Listener [24]: dispatching message (default/Login::run::Shib1SI)     2012-09-20 18:52:26 DEBUG XMLTooling.StorageService [24]: inserted record (b89fbe4deecae876148bd470e7aa6f85) in context (RelayState) with expiration (1348160546)     2012-09-20 18:52:38 DEBUG Shibboleth.Listener [25]: dispatching message (default::getHeaders::Application)     2012-09-20 18:52:38 DEBUG Shibboleth.Listener [25]: dispatching message (default/Login::run::Shib1SI)     2012-09-20 18:52:38 DEBUG XMLTooling.StorageService [25]: inserted record (b76b99286d06dd0ce84da39c9947e344) in context (RelayState) with expiration (1348160558)     2012-09-20 18:53:03 INFO Shibboleth.Listener [16]: detected socket closure, shutting down worker thread     2012-09-20 18:53:27 DEBUG Shibboleth.Listener [26]: dispatching message (default::getHeaders::Application)     2012-09-20 18:53:27 DEBUG Shibboleth.Listener [26]: dispatching message (default/Login::run::Shib1SI)     2012-09-20 18:53:27 DEBUG XMLTooling.StorageService [26]: inserted record (59fc5fa8d1589ffc94077f4e0e079f38) in context (RelayState) with expiration (1348160607)     2012-09-20 19:00:41 DEBUG Shibboleth.Listener [27]: dispatching message (default::getHeaders::Application)     2012-09-20 19:00:41 DEBUG Shibboleth.Listener [27]: dispatching message (default/Login::run::Shib1SI)                                                                                3865,1        99%      **What I understand From error log:** The message is being expired when it reaches to the destination because the message validity is 5 min and i am in timezone 2+. **My Question:** How to set up message validity so that the message will remain valid and do not expire ?


Line 4: $data: ambiguous redirect when using passwordbox

I want to create a passwordbox using the dialog package.               #!/bin/bash     data=$(tempfile 2>/dev/null)     trap "rm -f $data" 0 1 2 5 15     dialog --title "Password" \     --clear \     --passwordbox "Enter your password" 10 30 2> $data          ret=$?          case $ret in       0)         echo "Password is $(cat $data)";;       1)         echo "Cancel pressed.";;       255)         [ -s $data ] &&  cat $data || echo "ESC pressed.";;     esac      However I get this error when I execute it:               line 4: $data: ambiguous redirect      What's wrong?