Active Directory Domain with SAMBA or Other Tool

Can I create a domain using SAMBA and set up Active Directory with SAMBA on it? And by this I mean no windows servers involved. I would also like to be able to log in from a Windows machine. Preferably on OpenSuSE. My objective is to have a domain with centralized authentication just like AD. I want to be able to log in using both Windows and Linux computers.   * How can I do that in SAMBA?   * What other solution you guys recommend if Samba4 is not a viable one?


Viewing large image on Linux

I need to view a large (50000x40000 px) png image on Linux. Unfortunately most tools (eog, convert etc.) either crashes or fail with note about too little memory. Is there a way to view this image (I would prefer to see both the resized image and details)?


Is there a way to make Screen scroll like a normal terminal?

I love screen, but it drives me nuts that I have to stop typing input, hit `CTRL+A [`, and then find what I need. Is there a way to make the scroll wheel function normally, rather than scrolling commands? Also, is it possible to enable Shift+PageUp/PageDn?


Theoretical possibilities for cpu emulation built into boot-loader or kernel?

Is it a crazy idea to somehow make a blend of grub and qemu in order to boot linux kernels or any kernel of any cpu type supported by qemu or the built-in cpu? I know it might be impossible to detach the bootloader if its emulating the cpu, but maybe the work around would be to make the cpu emulation built into a linux kernel so that the boot-loader can detach. But is this kind of idea crazy and would never work or just too much work for anybody to take on?


How to stage part of hunk with added newline at EOF?

Is there some way to stage _individual lines_ of a file which has just been changed to include newline at EOF? I tried `add -p`, but it wouldn't split the relevant hunk into small enough parts, and it's well known that git-gui throws a "corrupt patch" error when dealing with files without a newline at the end. The relevant hunk:                $courier:   "courier new", courier, freemono, "nimbus mono l",                   "liberation mono", monospace;     -                 -$monaco:    monaco, "lucida console", "dejavu sans mono",      -            "bitstream vera sans mono", "liberation mono",      -            monospace;     \ No newline at end of file     +     +$monaco:    monaco, "lucida console", "dejavu sans mono",     +            "bitstream vera sans mono", "liberation mono",     +            monospace;     +     +h1 {     +  font-size: 2em;     +}     [snip]      I'd like to commit everything up to `h1` as a whitespace fix, and everything after in a separate commit.


Is Webmin oriented toward a particular Linux distro?

I have used Webmin on multiple distros, both on the Red Hat-based side and the Debian-based side, and have had various issues with it on both. My issues have included things like configuration failing when restarting a service from within Webmin, or settings not sticking when I enter them via Webmin and apply changes. A couple of examples are with bind9 and samba. I tried to set up a new samba user but it failed to do so, and I can't even tell exactly where, I just know that restarting the server failed. Same with bind9, after configuring a zone and adding A and PTR records, the bind server failed to start and didn't give any helpful reason why, so I ended up merely using the configuration file editor to get it done. My frustration with it has led me to try other configuration tools. It also has brought up the question -- is there a particular distro that Webmin was developed and tested on? I know Webmin is available for a variety of distros but it doesn't seem to work really well for any of them. Maybe I just haven't used it on the right one?


Which linux distro is based on Arch, runs LXDE and out of the box ready to use?

Besides that, have full multimedia, driver, network and essential software support?


What is $debian_chroot in .bashrc?

What is the `debian_chroot` variable in my bashrc file? and what is it doing here? `PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '`


In Bash, why is PROMPT_COMMAND set to something invisible?

On RHEL6 and CentOS 6, `/etc/bashrc` sets `PROMPT_COMMAND` here:               case $TERM in     xterm*)         if [ -e /etc/sysconfig/bash-prompt-xterm ]; then             PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm         else             PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"'         fi         ;;     screen)         if [ -e /etc/sysconfig/bash-prompt-screen ]; then             PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen         else             PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\033\\"'         fi      All of these options, as far as I know, are printed invisibly. What is the use of this? I know that `PROMPT_COMMAND` is to be executed before display the prompt (`PS1` usually). I do not understand why echoing something that is not visible is of any use.


How to associate a seperate station to a Wifi AP

My Linux machine (A) is connected with some Wifi AP over my wireless device (`wlan0`). I want to give some other Linux machine (B), which is connected to me by ethernet (`eth0`), access to this network. I do not want to use NAT. So I create a `bridge` device and bridge `wlan0` and `eth0`. This does not work. I suspect, the main reason lies in the fact, that B’s MAC was never associated to the AP. So it would simply drop B’s packets. If B would know at this point, that his ethernet is bridged to wireless, could it associate to the AP itself? Is it necessary to know the network credentials to do this (after all, it is bridged over my already-secured connection)? If this is not possible, could I somehow associate B’s MAC for it? And are there other obstacles in this scenario?


How to run grep on a single column?

I want to grep the output of my `ls -l` command:               -rw-r--r--   1 root root       1866 Feb 14 07:47 rahmu.file     -rw-r--r--   1 rahmu user     95653 Feb 14 07:47 foo.file     -rw-r--r--   1 rahmu user   1073822 Feb 14 21:01 bar.file      I want to run `grep rahmu` on column $3 only, so the output of my `grep` command should look like this:               -rw-r--r--   1 rahmu user     95653 Feb 14 07:47 foo.file     -rw-r--r--   1 rahmu user   1073822 Feb 14 21:01 bar.file      What's the simplest way to do it? The answer must be portable across many Unices, preferably focusing on Linux and Solaris. _NB: I'm not looking for a way to find all the files belonging to a given user. This example was only given to make my question clearer._


Android - what's the permission difference on normal and rooted devices

I have two android phones, one rooted the other not. When I run following code without asking for root permission on the two phones,               system("echo \"abc\" > /data/a.txt\n");      the rooted phone returns me error-2 (512); the normal phone returns error-1 (256, permission denied). So my question is, what makes this difference.


SOLVED: linux vmware player installation "VMs are running" error

I was evaluating vmware workstation lately but as my trial period ran out i decided not to go for a license so I uninstalled the now defunct workstation 9 in order to re install the player. The removal went uneventful but when I now run the vmware player installer i get an error message saying that there are still vms running on the machine. I have checked my packages and there is no other virtualization host software present. the vmware modules are not loaded in the kernel and no other indicator exists that something the like should be happening (no unexplained network interfaces, memory usage etc). What can be the cause of this false positive? Some additional information: up-to-date arch linux, vmware workstation was the first virtualization product in this machine. Any help is gladly appreciated. Solution: delete all references to vmware and vmware workstation. Apparently the uninstaller doesn't keep a very good track of its assets so I had files existing in /etc/vmware /etc/vmware-workstation /etc/rc.d the systemd directories /usr/bin etc.


emacs auto indentation

I have Auctex and auto indentation set in my `~/.emacs` but it doesn't work correctly for `\end{enumerate}`. If I had the following, (below is what would happen if I hit tab on the `\end{enumerate}`               \begin{enumerate}       \item         text       \item         text       \end{enumerate}      So when I hit tab to auto align `\end{enumerate}` it aligns with `\item`. This doesn't happen for other begin and enter commands so it is isolated to enumerate only. How can I fix this?


Download files and create same file structure as the source

I have a config file which consists of list of URIs I want to download. For example,                 http://xyz.abc.com/Dir1/Dir3/sds.exe       http://xyz.abc.com/Dir2/Dir4/jhjs.exe       http://xyz.abc.com/Dir1/itr.exe      I want to read the config file and and copy each URL but at the same time create the same directory structure as on the host. For example, for the first line in the config file, I want to create the directory structure Dir1/Dir3 on my local machine (if it doesn't exist) and then copy sds.exe to .../Dir1/Dir3/ I found that I can download all the URLs in a file using 'wget -i' but how can I create the corresponding directory structure with that


Ubuntu: how do you swap eth0 and eth1? (Ubuntu 13.10 server in a VirtualBox VM)

I installed Ubuntu 13.10 server (64-bit) in a VirtualBox 4.3.6 VM (Windows host) with one NAT adapter assigned. The only non-default software selected during installation was OpenSSH. So far so good... I could ping the world and the address is 10.0.2.15 as would be expected (per ifconfig the NAT adapter is eth0 at this point). I want to access the VM via the host without any port-mapping. Since bridging isn't an option (I can't get a second direct IP from outside the host) I created a host-only adapter (with DHCP enabled and all), edited /etc/network/interfaces (duplicating the eth0 defaults for eth1), shut the VM down, attached the new host-only adapter (selected paravirtualized), and rebooted. At this point /etc/network/interfaces contained the following:               auto lo     iface lo inet loopback          auto eth0     iface eth0 inet dhcp          auto eth1     iface eth1 inet dhcp      And indeed it all works... but per ifconfig the NAT adapter is now eth1, while the newly-added host-only adapter is eth0. I want it the other way around - and that leads to all kinds of problems! First I tried adding the MAC addresses to the interfaces file, e.g., "hwaddress ether xx:xx:xx:xx:xx:xx" as I expect it to be for eth0 and eth1. No joy... that ends up breaking networking entirely. I commented out those lines and rebooted (I actually had to disable that host-only adapter and reboot again, then I could finally re-enable it... this may be a clue.) Reading further, I see many references to updating /etc/udev/rules.d/70-persistent-net.rules to swap the MAC addresses. Great idea! Except that _other than a README file /etc/udev/rules.d is completely empty._ I tried "sudo udevadm trigger" (and a few permutations thereof)... no change. **So question #1: what happened to 70-persistent-net.rules? Is that deprecated? /etc/udev/rules.d is empty except for a README file.** Next, I tried the following: sudo ifconfig eth0 down sudo ifconfig eth1 down sudo ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx sudo ifconfig eth1 hw ether yy:yy:yy:yy:yy:yy sudo ifconfig eth0 up sudo ifconfig eth1 up Hmm. ifconfig now reports the expected mac addresses but the IP addresses are still as they were. So I reboot... And again, networking is broken (it is around this point that one learns the merit of editing /etc/init/failsafe.conf to shorten network delays during the networking debug process). The contents of /etc/network/interfaces are unchanged from how they look above. ifconfig now reports that eth0 and eth1 have the same (NAT adapter MAC) address even though I really did swap the MAC addresses above. Restore the MACs per the same procedure and reboot and we're back where we started (eth0 = host-only and eth1 = NAT). **Therefore, the main question is: how do you swap eth0 and eth1 correctly on Ubuntu 13.10?** On CentOS (given DHCP) it was as easy as swapping the MAC addresses in /etc/sysconfig/network-scripts/ifcfg-eth0 and ifcfg-eth1 and then rebooting. On Ubuntu _it's like pulling teeth_... everything that should work won't work, and I am stumped. I suspect there's something relatively new going on under the hood (thus the "missing" rules files and so on) but what could it be? Note that the network-manager isn't installed by default either (and it's definitely not present). * * * **Update:** Just for grins I created another VM with the same default server setup (including OpenSSH as before), with one network adapter (NAT). No change - networking works as it normally would for this configuration, but there's nothing in /etc/udev/rules.d except a README file (I even checked as root... nothing).


Troubleshooting a Kali Installation

I tried to install Lali Linux on VMware Workstation but got the following problem: ![enter image description here](http://i.stack.imgur.com/MWVS8.png) How can I fix it?


Writing a service in C: How to pass and process arguments to running service?

I want to write a service in C. While this service is running in background and processing some information I need to grab the results from this service from other applications or from command line. Background: I need a C application/service due to performance issues. The UI will be implemented in a higher language like Java or C#/Mono on Linux. The C application will basically process data, which will come in from another source. The UI layer should be able to grab the results in a loop every few milliseconds for example and display it to the user. Also it should be possible to pause/start/configure the service from the Java application. Thats where the question begins. How do I implement the service in C, so that it can respond to commands in runtime? Thanks, Eduard


SSH cannot connect from Remote computer after a while

I can successfully connect to Debian via SSH.   The problem is that after a while--1 or two days I think--it depends on the number of times I connect, Ii cannot connect remotely.. **only locally**. The machine must be restarted in order to reconnect. I haven't seen the error myself yet as they restart it at 4am in the morning and i am not there, but it is like "networking down" ? "connection table ...something".. Any ideas what I can do to trace/solve this problem ?   I get this also in the sshd log when it is down.. > debian exim4: gethostby*.getanswer: asked for "debian IN AAAA", got type "A"


What's wrong with my bash script?

I am trying to utilize zenity in my simple `ffmpeg-cut-mp3` script, but it hangs after the input into zenity :/ What's the matter with this?               #! /bin/bash          start=$(zenity --entry --title="CutMp3" --text="Start time ? (hh:mm:ss.ms)") &          duration=$(zenity --entry --title="CutMp3" --text="Duration in seconds ?") &          gnome-terminal -x ffmpeg -ss "$start" -t "$duration" -i "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" -acodec copy "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" &&          zenity --notification --text "File cut !"


Overwriting line in unix shell after printing

How can I modify a line after printing it in unix shell.We can delete the line and write again by using `\r` as shown below,but how can I overwrite on existing line and not delete it completely and get the output as in Expected output below. **Command:**               printf "12345";printf "\r67";      **Output:**               67      **Expected Output**               67345


how to look the value of thedata by lookup index?

I have list of data array which I want to look the values by its index (id) and store to the index id from the data array. I can do it in spreadsheet VALUE LOOKUP function, but I still have lots of data to do this and I don't think spreadsheet function will be fast for huge data sets. I want you help me to let me know the script that can do it faster. My data array, index id and proposed out put is as follows. data array               Id  Value           1    10     2    20     3    30     4    40     6    60     8    80     10   100      index               Id           1     2     3     4     5     6     7     8     9     10     11     12     13      Output will be               ID    Value     1  10     2  20     3  30     4  40     5  NULL     6  60     7  NULL     8  80     9  NULL      10 100     11  NULL     12  NULL     13  NULL      Thank you for helping again.


Why do I see different versions of bash history for the same user

I ssh into my servers using root. Sometimes when I scroll back in my history, I see a history from an earlier session, but not the last session. Why does this happen with the same user account? Is it related to the tty I am using? Bash 4


Postfix not responding to telnet

I am doing a Postfix installation on CentOS 6.5 I can't get `# telnet localhost 25` to do more than this:               Trying ::1...     Connected to localhost.     Escape character is '^]'.     EHLO                    ^]     telnet> quit     Connection closed.      I have gone through the `/etc/postfix//main.cf` and made the changes I need to I have set the `myhostname =` to the `# hostname -f` name in bash, plus all the others as per all the advice- one thing I have done is set the `mynetworks =` to `mynetworks = 127.0.0.0/8, 123.234.18.208/30` because I need external IP's `123.234.18.208` , `123.234.18.209` , `123.234.18.210` , `123.234.18.211` to all appear as local networks


set LC_* but not LC_ALL

I'd like to have a German (Austria) locale (A4 paper size, 24 hour time, yyyy- mm-dd), but an English-language user interface (I don't like poor translations). I figured that the correct way to achieve this is to set the `LC_` variables as follows in my `.bashrc` (please correct me if I'm wrong):               LC_MESSAGES=en_US.UTF-8     LC_$everythingelse=de_AT.UTF-8      Is there a more elegant way to set LC_$everythingelse rather than setting every single value? Setting LC_ALL is not an option, since it takes precedence over LC_MESSAGES:               $ export LC_ALL=de_AT.UTF_8     $ export LC_MESSAGES=en_US.UTF_8     $ echo $LC_MESSAGES     en_US.UTF_8     $ locale | grep LC_MESSAGES     LC_MESSAGES="de_AT.UTF_8"      PS: It's a shared machine and I'm not sudoer, so changing system-wide settings is not an option.


Debian wheezy re - installation

I am new to linux and I wanted to start learning it. So, I had installed debian. But while installation, I forgot to give username and password for login and also for root. Is it possible to log in to debian now without the username and password being set during installation? If that is not possible, how do I re-install debian. Shall I just do it the same way I did the last time(by inserting the DVD?)? If I re-install then during partitioning should I free both the main partition and the "Swap" partition or is it enough if I just delete the main partition.


Renaming a bunch of files but keeping the number part

I have a bunch of files like this:               pic100.png     pig102.png     box103a.png     superb103b.png     px103c.png     rotor110 - new.png     ready1323 (yellow car).png     motorhome1036x red circle.png     ...      so, you can notice that files may have 3 parts:   * a prefix that can be any string   * a number that may contain a suffix like "a", "b", etc.   * an optional ending, that is always a string and starts with a space, like " (yellow car)", " red circle", etc. What I need is this: I want in one operation to:   * change the prefix to the one I want   * keep the number and the suffix (a, b, c...) if there's one    * get rid of the ending using the first example, I may want to transform that in               object100.png     object102.png     object103a.png     object103b.png     object103c.png     object110.png     object1323.png     object1036x.png      how do I do that? As you see the only thing I am keeping is the number and the suffix "a, b, c" when there is one... To make it simple, the command must operate in all files in a given directory. Thanks in advance.


How do you make tmux count windows starting with 1 instead of 0?

I was able to make GNU Screen start counting windows with the number 1 instead of the default 0 with this code in my .screenrc:               # Get rid of screen 0     bind c screen 1     bind ^c screen 1     bind 0 select 10      When I created windows in .screenrc I used `screen 1` so that it would first try 1 and then count up if that window number was taken.


How does this shell command work?

The following command puts the content of the local `id_rsa.pub` into the `authorized_keys` file on the host. But I don't quite understand how `cat` and `|` works together to achieve this goal, can someone explain?               cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'


Store a file for all users within a group

If user A is member of group foo, is it then possible for A to share a file for all members within foo without root permissions?               chown foo:foo file       Is not permitted without privileges. A can say               chmod o+rw file      but if A do not want to make it public for other users than those within foo, that does not work.


Slow hard drive?

Some time ago I noticed, that my desktop has become slower, than usual. It looks like a source of troubles is the hard drive (there is no such issue with Live USB) - but I don't understand the reason for this. There is an info from `smartctl` - can anybody explain, what may be wrong?               smartctl --all /dev/sda          smartctl 6.1 2013-03-16 r3800 [x86_64-linux-3.8.2] (local build)     Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org          === START OF INFORMATION SECTION ===     Model Family:     Western Digital Scorpio Blue Serial ATA (AF)     Device Model:     WDC WD5000BPVT-00HXZT3     Serial Number:    WD-WXF1E62KSHM2     LU WWN Device Id: 5 0014ee 658207174     Firmware Version: 01.01A01     User Capacity:    500 107 862 016 bytes [500 GB]     Sector Sizes:     512 bytes logical, 4096 bytes physical     Rotation Rate:    5400 rpm     Device is:        In smartctl database [for details use: -P show]     ATA Version is:   ATA8-ACS (minor revision not indicated)     SATA Version is:  SATA 2.6, 3.0 Gb/s     Local Time is:    Sun May  4 23:07:15 2014 NOVT     SMART support is: Available - device has SMART capability.     SMART support is: Enabled          === START OF READ SMART DATA SECTION ===     SMART overall-health self-assessment test result: PASSED          General SMART Values:     Offline data collection status:  (0x00) Offline data collection activity                         was never started.                         Auto Offline Data Collection: Disabled.     Self-test execution status:      (   0) The previous self-test routine completed                         without error or no self-test has ever                          been run.     Total time to complete Offline      data collection:        (12060) seconds.     Offline data collection     capabilities:            (0x7b) SMART execute Offline immediate.                         Auto Offline data collection on/off support.                         Suspend Offline collection upon new                         command.                         Offline surface scan supported.                         Self-test supported.                         Conveyance Self-test supported.                         Selective Self-test supported.     SMART capabilities:            (0x0003) Saves SMART data before entering                         power-saving mode.                         Supports SMART auto save timer.     Error logging capability:        (0x01) Error logging supported.                         General Purpose Logging supported.     Short self-test routine      recommended polling time:    (   2) minutes.     Extended self-test routine     recommended polling time:    ( 120) minutes.     Conveyance self-test routine     recommended polling time:    (   5) minutes.     SCT capabilities:          (0x7035) SCT Status supported.                         SCT Feature Control supported.                         SCT Data Table supported.          SMART Attributes Data Structure revision number: 16     Vendor Specific SMART Attributes with Thresholds:     ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE       1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       8       3 Spin_Up_Time            0x0027   178   177   021    Pre-fail  Always       -       2083       4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       966       5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0       7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0       9 Power_On_Hours          0x0032   095   095   000    Old_age   Always       -       3887      10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0      11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0      12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       966     192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       48     193 Load_Cycle_Count        0x0032   185   185   000    Old_age   Always       -       46771     194 Temperature_Celsius     0x0022   103   100   000    Old_age   Always       -       44     196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0     197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0     198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0     199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0     200 Multi_Zone_Error_Rate   0x0008   100   253   000    Old_age   Offline      -       0          SMART Error Log Version: 1     No Errors Logged          SMART Self-test log structure revision number 1     Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error     # 1  Short offline       Completed without error       00%      3884         -     # 2  Short offline       Completed without error       00%      2834         -          SMART Selective self-test log data structure revision number 1      SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS         1        0        0  Not_testing         2        0        0  Not_testing         3        0        0  Not_testing         4        0        0  Not_testing         5        0        0  Not_testing     Selective self-test flags (0x0):       After scanning selected spans, do NOT read-scan remainder of disk.     If Selective self-test is pending on power-up, resume after 0 minute delay.


Negative lookbehind/ahead assertions in Linux less pager (or vim)

I want to find all instances of "index" not followed by .php in a log using `less`. `/index(?!\\.php)` does not work. Is this possible? What is the regex for less and vim (do they differ?). Is this not possible with these application's respective regex libraries?


How to loop over the lines of a file?

Say I have this file:               hello     world     hello world      This program               #!/bin/bash          for i in $(cat $1); do         echo "tester: $i"     done      outputs               tester: hello     tester: world     tester: hello     tester: world      I'd like to have the `for` iterate over each line individually ignoring whitespaces though, i.e. the last two lines should be replaced by               tester: hello world      Using quotes `for i in "$(cat $1)";` results in `i` being asigned the whole file at once. What should I change?


What is the fastest way to process line by line in bash?

> **Possible Duplicate:**   >  How to loop over the lines of a file? Let's say I `cat` a file and I want to run a bash command on each line and write each line as output. How can I run a bash command on a single line the most succinct way?               cat something | lineBylineInplpace grep -E "spo" > &1 (I forget the standard descriptor symbol = / ) Should output the output of each line to the new file in place with the line it used for input. I realize that this is very similar to awk. Is there a bash builtin kind of way to make this faster?


How do I tell if a program is printing to stderr or stdout in the terminal?

**NOTE:** a newline appears but od -c doesn't display it. My music player's status command (`quodlibet --status | od -c`) has three states, and I'm trying to write a conditional based on that output. The outputs from that command are like this (may differ depending on the configuration).   1. I think this is printing to stderr because `od -c` doesn't display properly, even though it does for the other commands.              not-running     0000000        2. paused              0000000   p   a   u   s   e   d       P   a   n   e   d   B   r   o   w     0000020   s   e   r       1   .   0   0   0       s   h   u   f   f   l     0000040   e       o   n       0   .   2   2   8  \n     0000053        3. playing              0000000   p   l   a   y   i   n   g       P   a   n   e   d   B   r   o     0000020   w   s   e   r       1   .   0   0   0       s   h   u   f   f     0000040   l   e       o   n       0   .   2   3   2  \n     0000054      My goal is to remove everything except "not-running", "paused", or "playing" and use that in a conditional, like this:               #!/bin/bash          status=$(quodlibet --status | awk '{split($0,m," "); printf "%s",m[1]}' | tr -d '\000\007\010\n')     if [ "$status" = "playing" ]; then       quodlibet --print-playing '<artist>: <title>' | cut -c1-45     else       echo -n "$status"     fi      In the case where the player isn't running though this always prints a newline in the terminal after "not-running." Even if I do something like this               echo -n "$(quodlibet --print-playing '<artist>: <title>' | cut -c1-45)"      If I pipe that output to `od -c`, I get the same               not-running     0000000      which isn't right. The newline doesn't show up, but its their in the terminal. ### Questions   * What's causing this?   * Is the command printing to standard error when the program isn't running?   * How can I determine this?


Max Brightness too low on Debian

Using Debian wheezy 7.5 x64 on a Acer Aspire 5738Z, I found that maximum brightness (value '9' in `/sys/class/backlight/acpi_video0/max_brightness`) is much lower than maximum brightness offered by hardware (i.e., when using windows on the same machine is almost 1.5 times!). Considering that:   1. many googled related questions suggest that `max_brightness` should be '15' on Debian;   2. the file `max_brightness` is not modifiable by root even with rwx permissions (it says I/O error) Is there any workaround to this boundary?


Fdisk expert mode not available

It seems that the eXpert mode in fdisk is no longer available. When I try sudo fdisk -x, terminal returns "fdisk: invalid option -- 'x'" I have fdisk from util-linux 2.24.1 Is this a "feature"?


skip line that doesn't contain perticular character eg .colon

I am reading lines from the file in while loop.               while read line     do       #process line     done      I want to skip the line that does not contain colon. Any help?


How to echo variables using cat into file?

I have simple script like this:               #!/bin/bash          BOO=bla-bla-bla          cat > ./Makefile <<'EOF'             Hello             INCLUDES := -I/data/opt/include/ -Ideps/ -I$BOO/include     EOF      Yet it outputs into file:                Hello      INCLUDES := -I/data/opt/include/ -Ideps/ -I$BOO/include      how to make `cat` use my variables values, not names inside that string?


How can I change the gedit tab colouring?

I'm using Debian Jessie, and xfce desktop environment. I find the look of tabs for other applications, such as chrome, and the file manager (thunar), and terminal (xfce4-terminal), display the active tab as a brighter color than the other tabs. The exception to this is gedit, which displays the active document as a darker tab, which is confusing when only two tabs are open. I have tried cycling through different gtk/xfce themes available using the xfce4-appearance-settings app, but this affects the tab appearance of everything except gedit! I'm using gedit 3.10.4 and xfce version 4.10. I have tried to find the solution to this online, but I found myself going down various rabbit-holes of gnome and gtk and gtksourceview settings, which don't seem to have any useful documentation. ![gedit tabs](http://i.stack.imgur.com/jCqEK.png)


Disable Composite without restarting X

In order for me to watch HD videos without tearing, I need to disable my Composite setting in `xorg.conf`               Section "Extensions"         Option "Composite" "Disable"     EndSection      But I love my transparency, so, how do I enable and disable it without restarting X? (Preferably using command line)


How to use iphone internet tethering via USB with Ubuntu 10.04

What are the steps to use iPhone 3G internet tethering via USB on Ubuntu 10.04? Is there software I need to install on Ubuntu for this? The tethering works fine on Windows.


Install g++ when having gcc (C only) -- RH6

I have a RedHat 6 machine, which came with `gcc` but without `g++`. The gcc version is 4.4.4 20100726 (this is what I got from `gcc --version`). How can I get g++ working? Currently, the shell just returns "command not found".


Is autocompletion for applications done by shell?

When I type `evince`, and then hit tab, the bash shell will list all files that can be opened by `evince`, which seems to be based on the ext part of the filename. Is this done by shell or the application `evince`? If former, how does the shell know what the application needs?


On linux, how to get "incompatible" i386 f77 libraries to work with current Fortran compilers, like gfortran?

I would like to run the elf32-i386 library libkernlib.a with a Fortran 77 program on my latest Ubuntu linux machine. From what I've read, `gfortran` is backwards compatible with Fortran 77, but I'm having trouble to get it to work with the library. I've tried -ff2c, -fbackflash, etc. but everything is still giving me               $ gfortran -ff2c -O -o output f77fortran.f -lkernlib          /usr/bin/ld: skipping incompatible //usr/local/lib/libkernlib.a when searching for -lkernlib     /usr/bin/ld: canot find -lkernlib      I have also tried using `fort77`. I cannot find a `f77` that works. **If anyone knows how to run f77 programs and its libraries, whether using`gfortran` or something else, that would be great.** Btw, the libkernlib.a library has older versions from "libraries" links on this page, but the ones I've tried all give the same error and are all i386 (I figured out that by `objdump -f libkernlib.a`). Context: This is part of a Mathematica project that uses old code.


Linux and Windows 8 shared data partition

I currently have a dual-boot system between Linux Mint and Windows 8. I currently have it set up that both systems have about 500 GB for data storage. I prefer using Linux, but school requires me to use Windows. So I frequently switch back and forth. I find it annoying having to move data from one to the other when I need, requiring to restarts to finally move the data. So I want to make a single "Data" partition that is shared between the OSes (the Windows partition doesn't like to be accessed inside Linux, and obviously Windows doesn't even recognize Linux). So what format should I use? I want one that both Linux and Windows can use and has a largish max file limit (i.e. not Fat32).


In zsh, what is the meaning of the '$==*' idiom

I have found the `$==*` idiom in several zsh solutions that I use. It seems to be equivalent to `$argv`. But I don't know how it gets interpreted. Could you explain?


Linux mint parse error

I try too much method but still don't work.               W: Failed to fetch gzip:/var/lib/apt/lists/partial/linux-mint.froonix.org_dists_olivia_main_binary-amd64_Packages Hash Sum mismatch     W: Failed to fetch gzip:/var/lib/apt/lists/partial/linux-mint.froonix.org_dists_olivia_upstream_binary-amd64_Packages Hash Sum mismatch     W: Failed to fetch gzip:/var/lib/apt/lists/partial/linux-mint.froonix.org_dists_olivia_import_binary-amd64_Packages Hash Sum mismatch     W: Failed to fetch gzip:/var/lib/apt/lists/partial/linux-mint.froonix.org_dists_olivia_romeo_binary-amd64_Packages Hash Sum mismatch     W: Failed to fetch gzip:/var/lib/apt/lists/partial/linux-mint.froonix.org_dists_olivia_main_binary-i386_Packages Hash Sum mismatch     W: Failed to fetch gzip:/var/lib/apt/lists/partial/linux-mint.froonix.org_dists_olivia_upstream_binary-i386_Packages Hash Sum mismatch     W: Failed to fetch gzip:/var/lib/apt/lists/partial/linux-mint.froonix.org_dists_olivia_import_binary-i386_Packages Hash Sum mismatch     W: Failed to fetch gzip:/var/lib/apt/lists/partial/linux-mint.froonix.org_dists_olivia_romeo_binary-i386_Packages Hash Sum mismatch     W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_raring_main_binary-amd64_Packages Hash Sum mismatch     W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_raring_restricted_binary-amd64_Packages Hash Sum mismatch     W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_raring_universe_binary-amd64_Packages Hash Sum mismatch     W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_raring_multiverse_binary-amd64_Packages Hash Sum mismatch     W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_raring_main_binary-i386_Packages Hash Sum mismatch     W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_raring_restricted_binary-i386_Packages Hash Sum mismatch     W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_raring_universe_binary-i386_Packages Hash Sum mismatch     W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_raring_multiverse_binary-i386_Packages Hash Sum mismatch     E: Some index files failed to download. They have been ignored, or old ones used instead.      How can I fix this?


Creation of a WORM file

I wanted to create few files which are Write Once Read Many (WORM). How do I do this? I assigned a permission level of 4000 to a file. Also I have to set retention to the files. So I created a file. Set the permission levels to 4000 and then used the touch command to set the retention to a specific time.               touch -a -t 201303240215.10 a.txt.      When I ran the `stat` command I got this.               File: `a.txt'       Size: 6               Blocks: 8          IO Block: 4096   regular file     Device: fd00h/64768d    Inode: 19267589    Links: 1     Access: (0400/-r--------)  Uid: (    0/    root)   Gid: (    0/    root)     Access: 2013-03-24 02:15:10.000000000 -0600     Modify: 2013-03-23 05:41:45.000000000 -0600     Change: 2013-03-24 02:00:53.000000000 -0600      Is this the way to create a WORM file?


How to install Tuxpaint on Debian 7?

I want to use tuxpaint in Debian 7. Is there any software to get this software? I can't change my operating system. When I try to install through `apt-get`, I get this:               utkarsh@Utkarsh[~]$sudo apt-get install tuxpaint     [sudo] password for utkarsh:      Reading package lists... Done     Building dependency tree      Reading state information... Done     E: Unable to locate package tuxpaint     utkarsh@Utkarsh[~]$      ### EDIT #1               root@Utkarsh[utkarsh]#lsb_release -a     LSB Version:    core-2.0-ia32:core-2.0-noarch:core-3.0-ia32:core-3.0-noarch:core-3.1-ia32:core-3.1-noarch:core-3.2-ia32:core-3.2-noarch:core-4.0-ia32:core-4.0-noarch:core-4.1-ia32:core-4.1-noarch:cxx-3.0-ia32:cxx-3.0-noarch:cxx-3.1-ia32:cxx-3.1-noarch:cxx-3.2-ia32:cxx-3.2-noarch:cxx-4.0-ia32:cxx-4.0-noarch:cxx-4.1-ia32:cxx-4.1-noarch:desktop-3.1-ia32:desktop-3.1-noarch:desktop-3.2-ia32:desktop-3.2-noarch:desktop-4.0-ia32:desktop-4.0-noarch:desktop-4.1-ia32:desktop-4.1-noarch:graphics-2.0-ia32:graphics-2.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch:graphics-3.1-ia32:graphics-3.1-noarch:graphics-3.2-ia32:graphics-3.2-noarch:graphics-4.0-ia32:graphics-4.0-noarch:graphics-4.1-ia32:graphics-4.1-noarch:languages-3.2-ia32:languages-3.2-noarch:languages-4.0-ia32:languages-4.0-noarch:languages-4.1-ia32:languages-4.1-noarch:multimedia-3.2-ia32:multimedia-3.2-noarch:multimedia-4.0-ia32:multimedia-4.0-noarch:multimedia-4.1-ia32:multimedia-4.1-noarch:printing-3.2-ia32:printing-3.2-noarch:printing-4.0-ia32:printing-4.0-noarch:printing-4.1-ia32:printing-4.1-noarch:qt4-3.1-ia32:qt4-3.1-noarch:security-4.0-ia32:security-4.0-noarch:security-4.1-ia32:security-4.1-noarch     Distributor ID: BOSS     Description:    BOSS GNU/Linux 5.0 (anokha)     Release:    5.0     Codename:   anokha


recreate mysqld file centos

I have tried installing mysql several times but keep getting this error:               mysqld: unrecognized service      I've tried:               yum remove mysql-server      yum remove mysql     yum remove MySQL-*      then               yum install mysql-server      yum install mysql      yum install mysql-devel      and then both               /etc/init.d/mysqld start     service mysqld start      but keep getting that error. Is there a way to recreate that file possibly?


/sys/ documentation?

Are there any man pages on the `/sys/` directory and how devices are setup? I'm hoping that there may be something similar to `man proc`, but cant really find anything to push me in the right direction.


Install nagios3 on debian by apt, file not found error

I have a Wheezy Debian system, and I've installed nagios3 using `apt-get`. When I go to `myhost.com/nagios3` and then go to a page, for example "Tactical Overview" I get the error message: > The requested URL /cgi-bin/nagios3/tac.cgi was not found on this server. which is odd. These lines are in `/etc/apache2/conf.d/nagios3.conf`:               ScriptAlias /cgi-bin/nagios3 /usr/lib/cgi-bin/nagios3     ScriptAlias /nagios3/cgi-bin /usr/lib/cgi-bin/nagios3      And this is output of `ls /usr/lib/cgi-bin/nagios3`:               avail.cgi        config.cgi     graphs.cgi     history.cgi       outages.cgi     rrd2-system.cgi  status.cgi     statuswml.cgi  summary.cgi       trends.cgi     cmd.cgi          extinfo.cgi    histogram.cgi  notifications.cgi rrd2-graph.cgi       showlog.cgi      statusmap.cgi  statuswrl.cgi  tac.cgi         What's going on here? **UPDATE:**   as @slm has said, i've checked apache log files after trying to open the faulty page, and this is what i can see in `access.log`: > 127.0.0.1 - - [16/Aug/2013:09:04:23 -0400] "GET / HTTP/1.1" 200 494 "-" > "check_http/v1.4.16 (nagios-plugins 1.4.16)" and i've changed the log level of `error.log` to `debug`, but when i search for `nagios` or `perl` in it I get nothing.


How to create directory ranging from 1 to nth?

In my scenario, I have some photos and I want to keep them seperate. At present I am doing `mkdir gallery1 gallery2 gallery3 gallery4 gallery5 gallery6`, this is a pain. I think we can do it easily as well. Suppose I want to make directories from _gallery7_ to _gallery50_. How would I do that?


Dual boot Win8/Fedora19

I just installed Fedora 19 (gnome, 64 bit), in addition to my Windows 8 installation. But when I start the computer, it goes straight to windows, not providing any option to boot into Fedora. How do I boot into Fedora?


crash shell: any way to check if a command executed Successfully

I'm automating a test using crash package. Is there some thing like `$?`, which can be used to check if the previous command executed successfully or not inside a crash shell? For example, when command:               crash> bt -a      Is executed, how do I know if it was successful or not? The only solution in my mind is greping through the results, but it's not reliable when the environment changes. This is what i get when I try `echo $?`:               crash> bt asd     bt: invalid task or pid value: asd     crash> $?     crash: command not found: $?     crash> echo $?     0     crash>     crash> q     root@at0012-ubuntu:~/crashKernel#       `$?` always appears to be 0. I already asked this question on superuser a few days back, but no help from there. Any help would be appreciated.


Is the desktop environment responsible for affecting behaviour to certain keys?

I have a laptop which has a `Fn` key. Using `xev` command shows that `Fn + UpArrow` is affected to `XF86AudioRaiseVolume`. If I use KDE, is it KDE that is responsible for affecting a behaviour to that symbol? I have Arch linux installed with openbox and this key (and other `Fn + ...`) does not work. On Ubuntu + KDE, it works. I was wondering if it was my responsability to configure Openbox in Arch linux to provide those keys with a behaviour.


Is there some sort of PDF to text -converter?

I need PDF files to text so I can search over them in bulk from commandline. Is there some converter for Ubuntu, OBSD or similar distro? Perhaps related post, OCR with ubuntu here.


Having Virtualbox disk images on /opt

**Background** After a recent HDD crash I did a clean install of Linux Mint 15 on a new disk. Seeing the potential problems with having backups of my documents and eclipse workspace, I realized that a smarter backup solution would be to take the entire home folder. Thus I partitioned my new HDD with `/`, `/home`, and `/opt` as separate partitions. My intention with this scheme was to use `/` for the system, `/home` for documents etc that will be backed up, and `/opt` for stuff that are sort of self-contained and do not require a backup, such as Virtual Windows installations that sometimes need. **Questions:** I noticed today when I was setting up the VM that it uses a folder in `/home` to store the vdi files, by default. When I changed the location of that folder to `/opt` I came to realize and remember that `/opt` has 755 permissions.   * Does it make sense to put a folder e.g. `/opt/vm` and try to put the vdi files there? I assume that Virtualbox will run with my normal user permissions and thus won't be able to write there anyways.    * Does giving such a folder 777 permissions solve the problem? My feeling is that the writing bit would be OK, but I am worried that this might cause more trouble later on.    * If the above scheme is really error-prone, what options do I have? It would be a pity to leave `/opt` as is (120 GB) only to create another partition. I could,in theory, resize `/opt/` and create another partition `/vm`, right?


Installing a .ko module on an embedded Linux system that does not support modules

From the answers to this question I have discovered that the embedded Linux distribution provided to me, by my hardware supplier, was not built with kernel support. If I am to use this distribution I have to be able to install drivers for some CANBUS hardware that will be attached. The source for the drivers is provided by the CANBUS part manufacturer but since the OS I have been given does not have gcc installed on it and does not support loadable modules, I have no idea how to continue. Is there anything at all I can do to try get around this problem? The alternative is to use DOS as the OS on the embedded device which I am very keen to avoid so any potential solutions would be gratefully received.


Drag and drop between windows in tiling i.e. minimalist WMs?

Do any any minimal WMs, like scrotwm or xmonad (OR any others), support drag and drop _between_ windows out of the box? If so which? If not, is there a way to enable such functionality? A classic example would be to have a file manager in one window, from which you drag a file into an open application in another window to open it, etc. etc. Thanks.


Converting syslog-ng 3.0? format to 3.2 format

Just rebooted my system to this warning               :: Starting Syslog-NG                                                                       [BUSY]     WARNING: Configuration file format is too old, please update it to use the 3.2 format as some constructs might operate inefficiently;     WARNING: the expected message format is being changed for unix-domain transports to improve syslogd compatibity with syslog-ng 3.2. If you are using custom applications which bypass the syslog() API, you might need the 'expect-hostname' flag to get the old behaviour back;      Anyone know of any good resources on converting formats? my `syslog-ng.conf` is primarily from the Gentoo Security Handbook and thus simply using the the `.pacnew` file won't work here's my current conf file               @version: 3.0     #     # /etc/syslog-ng.conf     #          options {       stats_freq (0);       flush_lines (0);       time_reopen (10);       log_fifo_size (1000);       long_hostnames(off);        use_dns (no);       use_fqdn (no);       create_dirs (no);       keep_hostname (yes);       perm(0640);       group("log");     };          source src {       unix-stream("/dev/log");       internal();       file("/proc/kmsg");     };          destination d_authlog { file("/var/log/auth.log"); };     destination d_syslog { file("/var/log/syslog.log"); };     destination d_cron { file("/var/log/crond.log"); };     destination d_daemon { file("/var/log/daemon.log"); };     destination d_kernel { file("/var/log/kernel.log"); };     destination d_lpr { file("/var/log/lpr.log"); };     destination d_user { file("/var/log/user.log"); };     destination d_uucp { file("/var/log/uucp.log"); };     destination d_mail { file("/var/log/mail.log"); };     destination d_news { file("/var/log/news.log"); };     destination d_ppp { file("/var/log/ppp.log"); };     destination d_debug { file("/var/log/debug.log"); };     destination d_messages { file("/var/log/messages.log"); };     destination d_errors { file("/var/log/errors.log"); };     destination d_everything { file("/var/log/everything.log"); };     destination d_iptables { file("/var/log/iptables.log"); };     destination d_acpid { file("/var/log/acpid.log"); };     destination d_console { usertty("root"); };          # Log everything to tty12     destination console_all { file("/dev/tty12"); };     #destination knotifier { program('/usr/local/bin/knotifier'); };          filter f_auth { facility(auth); };     filter f_authpriv { facility(auth, authpriv); };     filter f_syslog { program(syslog-ng); };     filter f_cron { facility(cron); };     filter f_daemon { facility(daemon); };     filter f_kernel { facility(kern) and not filter(f_iptables); };     filter f_lpr { facility(lpr); };     filter f_mail { facility(mail); };     filter f_news { facility(news); };     filter f_user { facility(user); };     filter f_uucp { facility(cron); };     filter f_news { facility(news); };     filter f_ppp { facility(local2); };     filter f_debug { not facility(auth, authpriv, news, mail); };     filter f_messages { level(info..warn) and not facility(auth, authpriv, mail, news, cron) and not program(syslog-ng) and not filter(f_iptables); };     filter f_everything { level(debug..emerg) and not facility(auth, authpriv); };     filter f_emergency { level(emerg); };     filter f_info { level(info); };     filter f_notice { level(notice); };     filter f_warn { level(warn); };     filter f_crit { level(crit); };     filter f_err { level(err); };     filter f_iptables { match("IN=" value("MESSAGE")) and match("OUT=" value("MESSAGE")); };     filter f_acpid { program("acpid"); };          log { source(src); filter(f_acpid); destination(d_acpid); };     log { source(src); filter(f_authpriv); destination(d_authlog); };     log { source(src); filter(f_syslog); destination(d_syslog); };     log { source(src); filter(f_cron); destination(d_cron); };     log { source(src); filter(f_daemon); destination(d_daemon); };     log { source(src); filter(f_kernel); destination(d_kernel); };     log { source(src); filter(f_lpr); destination(d_lpr); };     log { source(src); filter(f_mail); destination(d_mail); };     log { source(src); filter(f_news); destination(d_news); };     log { source(src); filter(f_ppp); destination(d_ppp); };     log { source(src); filter(f_user); destination(d_user); };     log { source(src); filter(f_uucp); destination(d_uucp); };     #log { source(src); filter(f_debug); destination(d_debug); };     log { source(src); filter(f_messages); destination(d_messages); };     log { source(src); filter(f_err); destination(d_errors); };     log { source(src); filter(f_emergency); destination(d_console); };     log { source(src); filter(f_everything); destination(d_everything); };     log { source(src); filter(f_iptables); destination(d_iptables); };          #log { source(src); filter(f_messages); destination(knotifier); };     # Log everything to tty12     log { source(src); destination(console_all); };


Installing Elementary OS on a MacBook Pro 13" Early 2011 (8,1)

I'm trying to install elementaryOS (which is based on Ubuntu 10.10) on my MacBook Pro 13" Early 2011 (model No 8,1). I have resized a partition on my hard drive, and I've installed refit. Two things I've noticed:   1. refit doesn't notice the optical Drive, however pressing `c` allows me to boot the CD.   2. When I try to install or "try" the OS, I always end up with the following message:  > `(initramfs) unable to find a medium containing a live filesystem`   3. I think these two things are connected - perhaps the OS isn't giving access to the optical drive somehow?


How does tr '[a-z]' '[n-za-m]' work?

I found an obfuscated e-mail address that can be decrypted using this command:               echo "cbyrzba@cbyrzba.bet" | tr '[a-z]' '[n-za-m]'      How does that output a valid e-mail address? What is that command doing?


How to make those old-school GUIs (like the debian/arch installer)

I've been doing a lot of installs lately, and when possible I usually opt for the text install from the Live CD's GRUB menu. Most installers looks like this: ![enter image description here](http://i.stack.imgur.com/eWG0v.png) I always thought these GUIs (if you can call them as such) were really awesome and lightweight. Seeing as a lot of applications/distros use them, it must be a shared library or something right? Is there a way I can make stuff like this?


Grep command to find files containing text string and move them

I am able to locate files in a folder containing a specific text string using this command:               grep -lir 'string' ~/directory/*      How do I move the files that appear in the above result to another location?


ACPI wakeup from keyboard/mouse via /proc/acpi/wakeup after suspend. How to find the correct device?

I'd like to wakeup my system via keyboard or mouse. This can be done via _/proc/acpi/wakeup_ and a simple               echo DEVNAME > /proc/acpi/wakeup      my wakeup file looks like this                      Device   S-state   Status   Sysfs node       ---------------------------------------       1. P0P2     S4    *disabled  pci:0000:00:01.0       2. P0P3     S4    *disabled         3. P0P1     S4    *disabled  pci:0000:00:1e.0       4. UAR1     S4    *disabled  pnp:00:0c       5. EUSB     S4    *disabled  pci:0000:00:1d.7       6. USBE     S4    *disabled  pci:0000:00:1a.7       7. P0P5     S4    *disabled         8. P0P6     S4    *disabled         9. P0P7     S4    *disabled         10. P0P8    S4    *disabled  pci:0000:00:1c.4       11. P0P9    S4    *disabled  pci:0000:00:1c.5       12. GBEC    S4    *disabled         13. USB0    S4    *disabled  pci:0000:00:1d.0       14. USB1    S4    *disabled  pci:0000:00:1d.1       15. USB2    S4    *disabled  pci:0000:00:1d.2       16. USB3    S4    *disabled         17. USB4    S4    *disabled  pci:0000:00:1a.0       18. USB5    S4    *disabled  pci:0000:00:1a.1       19. USB6    S4    *disabled  pci:0000:00:1a.2       20. P0P4    S4    *disabled  pci:0000:00:1c.0      My question is: **How can I find out which (USB) device belongs to my mouse/keyboard?** I failed with _lsusb_ so far, but maybe I just missed the right switches.


Doing actions on a list from the shell

I have a list of packages I want to deinstall. The deinstaller program `pkg_deinstall` doesn't take a list of packages as parameter to deinstall. How would I deinstall from the list (like a foreach loop)?               [root@fbsd01 /usr/ports/editors/vim]# pkg_info | grep proto| sed 's/\([a-z0-9]*\).*/\1/'     bigreqsproto     compositeproto     damageproto     fixesproto     fontsproto     inputproto     kbproto     randrproto     renderproto     xcb     xcmiscproto     xextproto     xf86bigfontproto     xineramaproto      I would think a command similar to this would work, but I have to pass the list as a parameter and not a stream: `pkg_info | grep proto| sed 's/\\([a-z0-9]*\\).*/\1/' | head -n 1 pkg_deinstall` If you could give me some clues as to what program and syntax to use, that would be helpful. I know since it's unique you might have a hard time coming up with an exact answer. If my question is too complicated, maybe someone could show me how to do actions on an `ls` of files in a dir.


How to convert a zImage into uImage for booting with u-boot

I have a zImage that I want to boot using u-boot. I think zImage is not understood by u-boot,as I am getting the following error after uboot executes:               Wrong Image Format for bootm command     ERROR: can't get kernel image!     U-Boot-cortex>      Is there any tool that converts a zImage into uImage which u-boot understands?


How does `find . -name *foo*` work?

I thought the wildcard `*` in the command `find . -name *foo*` is replaced by bash, and yet the command works unless `*foo*` matches something in the current directory, then it doesn't. It's confusing.


sed one-liner to delete any line that begins with a digit

![enter image description here](http://i.stack.imgur.com/tGD5v.png) Pretend I am working with this file. The beginning of the first visible line is obscured, so ignore that. 43 is the beginning of the next line, and that line would be deleted. The next line (which begins with 44 and ends with a period) would be deleted. The next line (which consists solely of 424) is also gone. The next line (which consists of '11. King and Hero') is also gone. The next line stays.


Problem installing software in UNIX (Sun Solaris)

I am new to UNIX. I have some software which need to be installed in UNIX. I have below the list of OS provided by a third party software provider. Can anyone help me out: which OS Software will be compatible with Solaris? For example I want to install `oracle.rpm` for Solaris but Oracle has not provided an RPM for solaris. They have provided RPMs for the below OS. Which one will be compatible with Sun Solaris?               CentOS_CentOS-5/             Fedora_12/                   Fedora_13/                   RHEL_5/                      SLES_9/                      SLE_10_SDK/                  SLE_11_SP1/                  openSUSE_11.3/               xUbuntu_10.04/


Limit a text file to 100MB

I have several log files on my server that I would like to limit to 100MB large. I'm considering creating a cron job that will run once a month and remove the oldest characters (closest to the top) from each log file, making each 100 megs or less in size. How can I do this?


How can I use mutt execute command tag-pattern and then delete-pattern via shell?

Is there a way to execute `mutt`'s `tag-pattern` and then `delete-pattern` via shell?                 -e <command>  specify a command to be executed after initialization      Could someone provide an example please?


Find and replace different columns using awk

I try to make a change in a file: Find a certain value and substitute it with another value in a different column using `awk`. **Input** (`UiO-66Zr-EH.mof`):               unit ntype qqatom       1  'Zr1'  0.0d0     vibration     0     improper     0     unit ntype qqatom       2  'H1'  0.0d0     vibration     0     improper     0     unit ntype qqatom       3  'C25'  0.0d0     vibration     0     improper     0     unit ntype qqatom       4  'O1'  0.0d0      **Output** (`output`):               unit ntype qqatom       1  'Zr1'  2.222d0     vibration     0     improper     0     unit ntype qqatom       2  'H1'  3.333d0     vibration     0     improper     0     unit ntype qqatom       3  'C25'  7.456d0     vibration     0     improper     0     unit ntype qqatom       4  'O1'  9.99d0      I've tried this command:               awk < UiO-66Zr-EH.mof '$2 ~ /Zr1/ {$3 ="2.222.d0"}1''$2 ~ /O1/ {$3 ="9.99d0"}1''$2 ~ /C25/ {$3 ="7.45d0"}1''$2 ~ /H1/ {$3 ="3.333d0"}1' > output      But it didn't function very well. Can I do that with `awk`, while also keeping the same formation?


I want to create a folder inside `/home` directory and another one inside `/home/$USER` directory. Does another user on the same system may be able to access the folder which was inside the `/home` directory? Is there any disadvantage of creating a folder just inside `/home` directory? What are the differences between creating a directory inside /home and /home/$USER directories?


tcp dump outgoing connection packets

What is the command syntax to log all tcp connection packets? I am trying to see what address and ports my computer is trying to connect to outgoing so that I may config my firewall.


Do ssh_config rules cascade?

I have the following rules               Host *        Compression yes          Host sop         HostName 192.168.56.101      if i `ssh sop` will the compression flag also be added?


How can number of subdirectories and files be determined from ls -ld command?

How can number of subdirectories and files be determined from the output of using ls -ld command? I realize that this command only lists the directories.


List all commands of a specific Debian package

I want to know the commands that a specific Debian package offers me. For example lets say I installed a package called `x.deb`. This package surely contains some commands that i can use. How to list these commands. I know I can use `compgen` bash command to generate list of all available commands in my system but what i need is just for specific package. I tried the solutions:               dpkg -L postgresql-9.3 | egrep '(bin|games)/'     /usr/lib/postgresql/9.3/bin/pg_upgrade     /usr/lib/postgresql/9.3/bin/pg_ctl     /usr/lib/postgresql/9.3/bin/pg_resetxlog     /usr/lib/postgresql/9.3/bin/postgres     /usr/lib/postgresql/9.3/bin/pg_xlogdump     /usr/lib/postgresql/9.3/bin/initdb     /usr/lib/postgresql/9.3/bin/pg_controldata     /usr/lib/postgresql/9.3/bin/postmaster      I tried the command `postgres`               user@userPc:~$ postgres     No command 'postgres' found, did you mean:      Command 'postgrey' from package 'postgrey' (universe)     postgres: command not found


How to limit the disk space for any user?

> **Possible Duplicate:**   >  Managing disk space on servers I want to limit disk space for any specific user. Actually I need to do this for every user. I am building a Scientific Linux server and I want to create boundary for every users. For example: /home/thorn/* directory has at most 20 GB. How can I do that?


Testing LS_COLORS in zsh

A few years ago I found an interesting code snippet that prints each type of file in its corresponding color according to the colors set up in `LS_COLORS`. Unfortunately, I can't remember the link anymore. Here is the snippet `test_colors.sh` in question               eval $(echo "no:global default;fi:normal file;di:directory;ln:symbolic link;pi:named pipe;so:socket;do:door;bd:block device;cd:character device;or:orphan symlink;mi:missing file;su:set uid;sg:set gid;tw:sticky other writable;ow:other w\     ritable;st:sticky;ex:executable;"|sed -e 's/:/="/g; s/\;/"\n/g')                                                                                {                                                                                IFS=:                                                                                for i in $LS_COLORS                                                                                do                                                                                echo -e "\e[${i#*=}m$( x=${i%=*}; [ "${!x}" ] && echo "${!x}" || echo "$x" )\e[m"                                                                                done                                                                                }         The snippet works great in `bash`, but not in `zsh`, and I can't tell why. When I run it in `zsh` I get the following error:               > sh .test_colors.sh     .eval_colors:1: * not found     [00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.flac=01;35:*.mp3=01;35:*.mpc=01;35:*.ogg=01;35:*.wav=01;35:m      ## Update (Nov. 1, 2011) I tested the script by @Stéphane Gimenez below. I noticed that some characters seem to not escape correctly. Any thoughts why? **Answer:** See comments on @Stéphane Gimenez's answer.                                                       ![enter image description here](http://i.stack.imgur.com/7S0FW.png)


How can I tell if the pipe buffer is full?

I am piping output from one program into some Perl I wrote. This is a long running process , sometimes days, so I want to find out where my bottlenecks are and try to open them up. I want to know if data is being piped into my script faster than my script can process it. If this is the case I will try to tune up my script, but not if I don't need to. I see talk about a flag being set when the buffer is full that prevents any more writes to it but how do I check to see if or how often that flag is set? Any ideas?


Using syslog from a kernel module

I am writing a linux kernel module to report statistics and send some log messages. Can I use syslog to accomplish this job? Or is `printk` the only way?


ssh, start a specific shell, and run a command on the remote machine?

I am in a situation where several users are sharing the same user account on a remote machine. I have a "personal" directory where I wrote my own `.zshrc` file, and I would like to have a way to:   1. Start a ssh session in the remote machine with directives from my ssh config file (e.g. `ControlMaster auto`)   2. This session runs a Z shell   3. It runs a `.zshrc` in my "personal" directory (not on the shared user's home directory) It would be nice to have an alias or a simple way of starting such ssh sessions (that's why I thought about using the OpenSSH's config file), but I am open to any other ideas! ### Using OpenSSH's config file? I read on the OpenSSH's ssh_config man page that I can use the directive `LocalCommand` to specify a command to run **locally** after successfully connecting to the server. This made me think there may be a way to tell the `config` file what command to run **remotely** after connecting to the server, but there doesn't seem to be any.


Unable to open Windows Disk partitions in solaris 11

I have recently installed solaris 11, but I am an absolute beginner in unix systems. The only unix like environment I have got myself into before is ubuntu which was quite a bit different from solaris in my opinion. The main problem I am facing at the moment is that the NTFS windows HD partitions are not appearing in solaris file system, which was not the case when I used ubuntu. Every single file on my HD was exposed to me when I was in ubuntu. I have already tried to find the solution in the internet. Tried to solve it with the help of this But had no success. The download links given for both FSWpart and FSWfsmisc is not working(giving a 404). I installed something called ntfs -g drive but I think I am not using it correctly as most of the time I am copying and pasting commands because I do not have sufficient knowledge to write them myself. Please any assistance in this matter is greatly appreciated. Thanks in advance.


device mapper on RHEL6 unable to create devs for LVM logical volume

I have XEN guest running RHEL6, and it has a LUN presented from the Dom0. This contains an LVM volume groups called vg_ALHINT (INT for Integration and ALH is an abbreviation of its Oracle database name). The data is Oracle 11g. The VG was imported, activated and udev created the maps for each logical volume. However device mapper did not create mappings for one of the logical volumes [LV], and for the LV in question it created /dev/dm-2 with different major minor number compared to the rest of LVs.               #  dmsetup table     vg_ALHINT-arch: 0 4300800 linear 202:16 46139392     vg0-lv6: 0 20971520 linear 202:2 30869504     vg_ALHINT-safeset2: 0 4194304 linear 202:16 35653632     vg0-lv5: 0 2097152 linear 202:2 28772352     vg_ALHINT-safeset1: 0 4186112 linear 202:16 54528000     vg0-lv4: 0 524288 linear 202:2 28248064     vg0-lv3: 0 4194304 linear 202:2 24053760     vg_ALHINT-oradata:     **     vg0-lv2: 0 4194304 linear 202:2 19859456     vg0-lv1: 0 2097152 linear 202:2 17762304     vg0-lv0: 0 17760256 linear 202:2 2048     vg_ALHINT-admin: 0 4194304 linear 202:16 41945088      ** You can see above vg_ALHINT-oradata is empty.               # ls -l /dev/mapper/     total 0     [root@iui-alhdb01 ~]# ls -l /dev/mapper/     total 0     crw-rw---- 1 root root  10, 58 Apr  3 13:43 control     lrwxrwxrwx 1 root root       7 Apr  3 13:43 vg0-lv0 -> ../dm-0     lrwxrwxrwx 1 root root       7 Apr  3 13:43 vg0-lv1 -> ../dm-1     lrwxrwxrwx 1 root root       7 Apr  3 14:35 vg0-lv2 -> ../dm-2     lrwxrwxrwx 1 root root       7 Apr  3 13:43 vg0-lv3 -> ../dm-3     lrwxrwxrwx 1 root root       7 Apr  3 13:43 vg0-lv4 -> ../dm-4     lrwxrwxrwx 1 root root       7 Apr  3 13:43 vg0-lv5 -> ../dm-5     lrwxrwxrwx 1 root root       7 Apr  3 13:43 vg0-lv6 -> ../dm-6     lrwxrwxrwx 1 root root       7 Apr  3 13:59 vg_ALHINT-admin -> ../dm-8     lrwxrwxrwx 1 root root       7 Apr  3 13:59 vg_ALHINT-arch -> ../dm-9     brw-rw---- 1 root disk 253,  7 Apr  3 14:37 vg_ALHINT-oradata     lrwxrwxrwx 1 root root       8 Apr  3 13:59 vg_ALHINT-safeset1 -> ../dm-10     lrwxrwxrwx 1 root root       8 Apr  3 13:59 vg_ALHINT-safeset2 -> ../dm-11      vg_ALHINT-oradata was not created until when I ran `dmsetup mknodes`               # cat /proc/partitions     major minor  #blocks  name           202        0   26214400 xvda      202        1     262144 xvda1      202        2   25951232 xvda2      253        0    8880128 dm-0      253        1    1048576 dm-1      253        2    2097152 dm-2      253        3    2097152 dm-3      253        4     262144 dm-4      253        5    1048576 dm-5      253        6   10485760 dm-6      202       16   29360128 xvdb      253        8    2097152 dm-8      253        9    2150400 dm-9      253       10    2093056 dm-10      253       11    2097152 dm-11      dm-7 would have been vg_ALHINT-oradata and it's missing. I ran `dmsetup mknodes` and `dm-7` was created yet still missing from `/proc/paritions`.               # ls -l /dev/dm-7     brw-rw---- 1 root disk 253, 7 Apr  3 13:59 /dev/dm-7      Its major and minor numbers are `253:7` yet the devices and the same LVs in its VG have 202:nn `lvs` tells me this LV was suspended:               # lvs         Logging initialised at Thu Apr  3 14:44:19 2014         Set umask from 0022 to 0077         Finding all logical volumes       LV       VG        Attr       LSize   Pool Origin Data%  Move Log Cpy%Sync Convert       lv0      vg0       -wi-ao----   8.47g       lv1      vg0       -wi-ao----   1.00g       lv2      vg0       -wi-ao----   2.00g       lv3      vg0       -wi-ao----   2.00g       lv4      vg0       -wi-ao---- 256.00m       lv5      vg0       -wi-ao----   1.00g       lv6      vg0       -wi-ao----  10.00g       admin    vg_ALHINT -wi-a-----   2.00g       arch     vg_ALHINT -wi-a-----   2.05g       oradata  vg_ALHINT -wi-s-----  39.95g       safeset1 vg_ALHINT -wi-a-----   2.00g       safeset2 vg_ALHINT -wi-a-----   2.00g         Wiping internal VG cache      The disc was created from a snapshot from our production databases. Oracle was shutdown and VG had been exported prior to the snapshot. I should note I perform this same take for 100s of databases weekly via a script. Because this was a snapshot then I have the table from device mapper from the original and I used this to try and recreate its missing table:               0 35651584 linear 202:16 2048     35651584 4087808 linear 202:16 50440192     39739392 2097152 linear 202:16 39847936     41836544 41943040 linear 202:16 58714112      After suspending the device with `dmsetup suspend /dev/dm-7` I ran `dmsetup load /dev/dm-7 $table.txt` Next I tried to resume this device,               # dmsetup resume /dev/dm-7     device-mapper: resume ioctl on vg_ALHINT-oradata failed: Invalid argument     Command failed     #      Any ideas because I'm really lost. (Yep I've rebooted and re-snapshotted this lots and always have the same problem. I've even reinstalled this server and run `yum update`.) // EDIT. I forgot to add that this is the original dmsetup table from our production environment and I tried to load the oradata layout into our integration server like I noted above.               #  dmsetup table     vg_ALHPRD-safeset2: 0 4194304 linear 202:32 35653632     vg_ALHPRD-safeset1: 0 4186112 linear 202:32 54528000     vg_ALHPRD-oradata: 0 35651584 linear 202:32 2048     vg_ALHPRD-oradata: 35651584 4087808 linear 202:32 50440192     vg_ALHPRD-oradata: 39739392 2097152 linear 202:32 39847936     vg_ALHPRD-oradata: 41836544 41943040 linear 202:32 58714112     vg_ALHPRD-admin: 0 4194304 linear 202:32 41945088      //EDIT I ran vgscan --mknodes and had:               The link /dev/vg_ALHINT/oradata should have been created by udev but it was not found. Falling back to direct link creation.                    # ls -l /dev/vg_ALHINT/oradata     lrwxrwxrwx 1 root root 29 Apr 3 14:50 /dev/vg_ALHINT/oradata -> /dev/mapper/vg_ALHINT-oradata      Still cannot activate this and had this error message:               device-mapper: resume ioctl on failed: Invalid argument Unable to resume vg_ALHINT-oradata (253:7)       //EDIT I see stack traces in /var/log/messages:               Apr  3 13:58:09 iui-alhdb01 kernel: blkfront: xvdb: barriers disabled     Apr  3 13:58:09 iui-alhdb01 kernel: xvdb: unknown partition table     Apr  3 13:59:35 iui-alhdb01 kernel: device-mapper: table: 253:7: xvdb too small for target: start=58714112, len=41943040, dev_size=58720256     Apr  3 14:02:31 iui-alhdb01 ntpd[1093]: 0.0.0.0 c612 02 freq_set kernel 5.242 PPM     Apr  3 14:02:31 iui-alhdb01 ntpd[1093]: 0.0.0.0 c615 05 clock_sync     Apr  3 14:30:13 iui-alhdb01 kernel: device-mapper: table: 253:2: xvdb too small for target: start=58714112, len=41943040, dev_size=58720256     Apr  3 14:33:34 iui-alhdb01 kernel: INFO: task vi:1394 blocked for more than 120 seconds.     Apr  3 14:33:34 iui-alhdb01 kernel:      Not tainted 2.6.32-431.11.2.el6.x86_64 #1     Apr  3 14:33:34 iui-alhdb01 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.     Apr  3 14:33:34 iui-alhdb01 kernel: vi            D 0000000000000000     0  1394   1271 0x00000084     Apr  3 14:33:34 iui-alhdb01 kernel: ffff88007aef19b8 0000000000000082 ffff88007aef1978 ffffffffa000443c     Apr  3 14:33:34 iui-alhdb01 kernel: ffff88007d208d80 ffff880037cabc08 ffff880037cda0c8 ffff8800022168a8     Apr  3 14:33:34 iui-alhdb01 kernel: ffff880037da45f8 ffff88007aef1fd8 000000000000fbc8 ffff880037da45f8     Apr  3 14:33:34 iui-alhdb01 kernel: Call Trace:     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffffa000443c>] ? dm_table_unplug_all+0x5c/0x100 [dm_mod]     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff810a7091>] ? ktime_get_ts+0xb1/0xf0     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff811bf1f0>] ? sync_buffer+0x0/0x50     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff815286c3>] io_schedule+0x73/0xc0     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff811bf230>] sync_buffer+0x40/0x50     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8152918f>] __wait_on_bit+0x5f/0x90     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff811bf1f0>] ? sync_buffer+0x0/0x50     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff81529238>] out_of_line_wait_on_bit+0x78/0x90     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8109b310>] ? wake_bit_function+0x0/0x50     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff811bf1e6>] __wait_on_buffer+0x26/0x30     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffffa0085875>] __ext4_get_inode_loc+0x1e5/0x3b0 [ext4]     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffffa0088006>] ext4_iget+0x86/0x7d0 [ext4]     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffffa008ec35>] ext4_lookup+0xa5/0x140 [ext4]     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff81198b05>] do_lookup+0x1a5/0x230     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff81198e90>] __link_path_walk+0x200/0xff0     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8114a667>] ? handle_pte_fault+0xf7/0xb00     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff811a3c6a>] ? dput+0x9a/0x150     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff81199f3a>] path_walk+0x6a/0xe0     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8119a14b>] filename_lookup+0x6b/0xc0     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8119b277>] user_path_at+0x57/0xa0     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8104a98c>] ? __do_page_fault+0x1ec/0x480     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8119707b>] ? putname+0x2b/0x40     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8118eac0>] vfs_fstatat+0x50/0xa0     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff811c4645>] ? nr_blockdev_pages+0x15/0x70     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8115c4ad>] ? si_swapinfo+0x1d/0x90     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8118ec3b>] vfs_stat+0x1b/0x20     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8118ec64>] sys_newstat+0x24/0x50     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff810e2057>] ? audit_syscall_entry+0x1d7/0x200     Apr  3 14:33:34 iui-alhdb01 kernel: [<ffffffff8100b072>] system_call_fastpath+0x16/0x1b     Apr  3 14:35:34 iui-alhdb01 kernel: INFO: task vi:1394 blocked for more than 120 seconds.     Apr  3 14:35:34 iui-alhdb01 kernel:      Not tainted 2.6.32-431.11.2.el6.x86_64 #1     Apr  3 14:35:34 iui-alhdb01 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.     Apr  3 14:35:34 iui-alhdb01 kernel: vi            D 0000000000000000     0  1394   1271 0x00000084     Apr  3 14:35:34 iui-alhdb01 kernel: ffff88007aef19b8 0000000000000082 ffff88007aef1978 ffffffffa000443c     Apr  3 14:35:34 iui-alhdb01 kernel: ffff88007d208d80 ffff880037cabc08 ffff880037cda0c8 ffff8800022168a8     Apr  3 14:35:34 iui-alhdb01 kernel: ffff880037da45f8 ffff88007aef1fd8 000000000000fbc8 ffff880037da45f8     Apr  3 14:35:34 iui-alhdb01 kernel: Call Trace:     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffffa000443c>] ? dm_table_unplug_all+0x5c/0x100 [dm_mod]     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff810a7091>] ? ktime_get_ts+0xb1/0xf0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811bf1f0>] ? sync_buffer+0x0/0x50     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff815286c3>] io_schedule+0x73/0xc0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811bf230>] sync_buffer+0x40/0x50     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8152918f>] __wait_on_bit+0x5f/0x90     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811bf1f0>] ? sync_buffer+0x0/0x50     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff81529238>] out_of_line_wait_on_bit+0x78/0x90     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8109b310>] ? wake_bit_function+0x0/0x50     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811bf1e6>] __wait_on_buffer+0x26/0x30     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffffa0085875>] __ext4_get_inode_loc+0x1e5/0x3b0 [ext4]     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffffa0088006>] ext4_iget+0x86/0x7d0 [ext4]     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffffa008ec35>] ext4_lookup+0xa5/0x140 [ext4]     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff81198b05>] do_lookup+0x1a5/0x230     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff81198e90>] __link_path_walk+0x200/0xff0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8114a667>] ? handle_pte_fault+0xf7/0xb00     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811a3c6a>] ? dput+0x9a/0x150     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff81199f3a>] path_walk+0x6a/0xe0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8119a14b>] filename_lookup+0x6b/0xc0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8119b277>] user_path_at+0x57/0xa0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8104a98c>] ? __do_page_fault+0x1ec/0x480     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8119707b>] ? putname+0x2b/0x40     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8118eac0>] vfs_fstatat+0x50/0xa0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c4645>] ? nr_blockdev_pages+0x15/0x70     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8115c4ad>] ? si_swapinfo+0x1d/0x90     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8118ec3b>] vfs_stat+0x1b/0x20     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8118ec64>] sys_newstat+0x24/0x50     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff810e2057>] ? audit_syscall_entry+0x1d7/0x200     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8100b072>] system_call_fastpath+0x16/0x1b     Apr  3 14:35:34 iui-alhdb01 kernel: INFO: task vgdisplay:1437 blocked for more than 120 seconds.     Apr  3 14:35:34 iui-alhdb01 kernel:      Not tainted 2.6.32-431.11.2.el6.x86_64 #1     Apr  3 14:35:34 iui-alhdb01 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.     Apr  3 14:35:34 iui-alhdb01 kernel: vgdisplay     D 0000000000000000     0  1437   1423 0x00000080     Apr  3 14:35:34 iui-alhdb01 kernel: ffff88007da35a18 0000000000000086 ffff88007da359d8 ffffffffa000443c     Apr  3 14:35:34 iui-alhdb01 kernel: 000000000007fff0 0000000000010000 ffff88007da359d8 ffff88007d24d380     Apr  3 14:35:34 iui-alhdb01 kernel: ffff880037c8c5f8 ffff88007da35fd8 000000000000fbc8 ffff880037c8c5f8     Apr  3 14:35:34 iui-alhdb01 kernel: Call Trace:     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffffa000443c>] ? dm_table_unplug_all+0x5c/0x100 [dm_mod]     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff810a7091>] ? ktime_get_ts+0xb1/0xf0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff815286c3>] io_schedule+0x73/0xc0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c8a9d>] __blockdev_direct_IO_newtrunc+0xb7d/0x1270     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c4400>] ? blkdev_get_block+0x0/0x20     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c9207>] __blockdev_direct_IO+0x77/0xe0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c4400>] ? blkdev_get_block+0x0/0x20     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c5487>] blkdev_direct_IO+0x57/0x60     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c4400>] ? blkdev_get_block+0x0/0x20     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811217bb>] generic_file_aio_read+0x6bb/0x700     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c5fd0>] ? blkdev_get+0x10/0x20     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c5fe0>] ? blkdev_open+0x0/0xc0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8118617f>] ? __dentry_open+0x23f/0x360     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c4841>] blkdev_aio_read+0x51/0x80     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff81188e8a>] do_sync_read+0xfa/0x140     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff810ec3f6>] ? rcu_process_dyntick+0xd6/0x120     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8109b290>] ? autoremove_wake_function+0x0/0x40     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811c479c>] ? block_ioctl+0x3c/0x40     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8119dc12>] ? vfs_ioctl+0x22/0xa0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8119ddb4>] ? do_vfs_ioctl+0x84/0x580     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff81226496>] ? security_file_permission+0x16/0x20     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff81189775>] vfs_read+0xb5/0x1a0     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff811898b1>] sys_read+0x51/0x90     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff810e1e4e>] ? __audit_syscall_exit+0x25e/0x290     Apr  3 14:35:34 iui-alhdb01 kernel: [<ffffffff8100b072>] system_call_fastpath+0x16/0x1b     Apr  3 14:39:19 iui-alhdb01 kernel: device-mapper: table: 253:7: xvdb too small for target: start=58714112, len=41943040, dev_size=58720256     Apr  3 14:53:57 iui-alhdb01 kernel: device-mapper: table: 253:7: xvdb too small for target: start=58714112, len=41943040, dev_size=58720256     Apr  3 15:02:42 iui-alhdb01 yum[1544]: Installed: sos-2.2-47.el6.noarch     Apr  3 15:52:29 iui-alhdb01 kernel: device-mapper: table: 253:7: xvdb too small for target: start=58714112, len=41943040, dev_size=58720256     Apr  3 15:59:08 iui-alhdb01 kernel: device-mapper: table: 253:7: xvdb too small for target: start=58714112, len=41943040, dev_size=58720256


Running bash script on a remote Windows Machine

I am planning to run a bash script on a remote Windows system from my local Linux machine. For this purpose, I will have to log in to Windows machine from the local one and then execute the bash Script. First of all, is this possible? If yes, then how can it be done?


init process: ancestor of all processes?

I have always learned that the init process is the ancestor of all processes. Why does process 2 have a PPID of 0?               $ ps -ef | head -n 3     UID        PID  PPID  C STIME TTY          TIME CMD     root         1     0  0 May14 ?        00:00:01 /sbin/init     root         2     0  0 May14 ?        00:00:00 [kthreadd]


Does ksplice work with updates from repos?

If there is a kernel update from an upstream repository (such as debian or centos) does ksplice work with those updates? If not, how does one update the kernel without a reboot and without paying Oracle?


Cannot mount USB 3.0 Flash drive

I have a 16GB USB 3.0 thumb drive that has worked wonderfully up until two days ago... When ever I plug it into a USB3.0 slot:   * The light flickers indefinitely; Nautilus shows the Open/Eject popup as usual but when attempting to open in any file manager it hangs and after a while complains /dev/sdx no longer exists (even though lsblk says otherwise)   * Trying to inspect with gparted produces a similar error, cannot find stat for /dev/sdx - it does not exist.   * And a lot of scary dmesg output that I do not understand at all. I can modify the device using fdisk. I have tried restoring the boot code and I have tried resetting the partition table and trying various different file systems. Using the drive in a USB 2.0 slot works normally. Other USB 3.0 external drives and flash drives in the USB 3.0 slots work normally. The device works on USB 3.0 ports in Windows and other Linux computers. My main reason for posting is to try to **learn and understand** what is happening. Any advice is appreciated!


libmpg123 bugging up yum

I had to manually install some dependencies in my fumbling attempts to get netflix working yesterday with pipelight, and ultimately failed. I uninstalled everything I installed during that process, but when I run yum update now I get this:               Transaction Summary     ================================================================================     Install             ( 2 Dependent packages)     Upgrade  1 Package          Total size: 442 k     Is this ok [y/d/N]: y     Downloading packages:     Running transaction check     Running transaction test               Transaction check error:       file /usr/lib/libmpg123.so.0 from install of libmpg123-1.19.0-1.fc19.i686 conflicts with file from package mpg123-1.18.1-1.fc19.i686      ## Error Summary Is there a way to get this out of my life without having to do anything drastic?


How to remove silence part from mp3 that is extracted from tv drama

I hear a mp3 that is extracted from some tv dramas as a English exercise. So in that mp3 there are lot of "silence part" in which no one speaks and there is no background music. Is there a way to remove that silence part by using `ffmpeg` or some other program from command line?


Why is the .config file not copied to /boot after installing new kernel?

I run across such a weird problem: According to this: > The kernel and modules must be moved to special locations in order to be > used, >   >   >     1. make modules_install >     2. make install >   > > The first will create the /lib/modules/ directory and place the modules > there. The second make target will, >   >   >     1. Move the kernel, bzImage, to /boot and rename it vmlinuz-<revision>, >     2. Move the System.map to /boot, >     3. Create initrd.img-<revision> >     4. Copy .config to /boot, renaming it to config-<revision> >     5. Modifies the boot loader configuration file /boot/grub/menu.lst >        so that the new kernel is listed on the boot menu. >   I configure and compile the latest Linux kernel 3.15, and run `make install` to install the new kernel. Everything seems OK except for the .config file is not copied to `/boot`. Why is the .config file under the root directory of the source tree not copied to /boot ? PS. My running OS is fedora 20.


Why does media wiki install stop?

I am building a new MediaWiki installation on a CentOS 6.4 system.               Server version: Apache/2.2.15 (Unix)     Server built:   May 13 2013 22:11:16          PHP 5.3.3 (cli) (built: Feb 22 2013 02:51:11)      Copyright (c) 1997-2010 The PHP Group     Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies          MediaWiki 1.21.1      `mysql Ver 14.14 Distrib 5.1.69, for redhat-linux-gnu (x86_64) using readline 5.1` I can reach the index.php page and get this message               MediaWiki 1.21.1          LocalSettings.php not found.          Please set up the wiki first.      When I click on the `Please set up the wiki first.` hyperlink, This is the URL, which is correct. `http://appcentral:8587/mw-config/index.php` The page stays blank, and nothing happens. What should I check to see what is going wrong. This is a fresh, clean installation. There is no existing MySQL DB already setup for the wiki. Here is the error in error.log under /var/log/httpd. `PHP Fatal error: Class 'DOMDocument' not found in /var/www/arlington_it/includes/cache/LocalisationCache.php on line 546, referer: http://localhost:8587/index.php`


Postfix email bounced (mail for domain loops back to myself)

I have problem when i send a mail to example@orbialia.es for example2@orbialia.es My emails has bounced for this error: `status=bounced (mail for orbialia.es loops back to myself)`               May  9 09:33:58 ns3285243 postfix/smtpd[1606]: connect from localhost.localdomain[127.0.0.1]     May  9 09:33:58 ns3285243 postfix/smtpd[1606]: 1EF6FA1DB9: client=localhost.localdomain[127.0.0.1]     May  9 09:33:58 ns3285243 postfix/cleanup[1584]: 1EF6FA1DB9: message-id=<004801cf6b58$a6516540$f2f42fc0$@orbialia.es>     May  9 09:33:58 ns3285243 postfix/qmgr[1575]: 1EF6FA1DB9: from=<jonatan.soler@orbialia.es>, size=7184, nrcpt=1 (queue active)     May  9 09:33:58 ns3285243 postfix/smtpd[1606]: disconnect from localhost.localdomain[127.0.0.1]     May  9 09:33:58 ns3285243 amavis[15721]: (15721-16) Passed CLEAN {RelayedInbound}, [79.145.170.251]:1991 [79.145.170.251] <jonatan.soler@orbialia.es> -> <consultanos@orbialia.es>, Queue-ID: 9D0DCA1DB4, Message-ID: <004801cf6b58$a6516540$f2f42fc0$@orbialia.es>, mail_id: 8JHrgdOkE3Pw, Hits: -0.999, size: 6675, queued_as: 1EF6FA1DB9, 26690 ms     May  9 09:33:58 ns3285243 postfix/smtp[1588]: 9D0DCA1DB4: to=<consultanos@orbialia.es>, relay=127.0.0.1[127.0.0.1]:10024, delay=28, delays=1/0.02/0.01/27, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 1EF6FA1DB9)     May  9 09:33:58 ns3285243 postfix/qmgr[1575]: 9D0DCA1DB4: removed     May  9 09:33:58 ns3285243 postfix/smtp[1607]: 1EF6FA1DB9: to=<consultanos@orbialia.es>, relay=none, delay=0.11, delays=0.09/0.02/0/0, dsn=5.4.6, status=bounced (mail for orbialia.es loops back to myself)     May  9 09:33:58 ns3285243 postfix/cleanup[1584]: 42EC4A1DB4: message-id=<20140509073358.42EC4A1DB4@rentabiliza.net>     May  9 09:33:58 ns3285243 postfix/bounce[1608]: 1EF6FA1DB9: sender non-delivery notification: 42EC4A1DB4     May  9 09:33:58 ns3285243 postfix/qmgr[1575]: 42EC4A1DB4: from=<>, size=9465, nrcpt=1 (queue active)     May  9 09:33:58 ns3285243 postfix/qmgr[1575]: 1EF6FA1DB9: removed     May  9 09:33:58 ns3285243 postfix/smtp[1607]: 42EC4A1DB4: to=<jonatan.soler@orbialia.es>, relay=none, delay=0.05, delays=0.04/0/0/0, dsn=5.4.6, status=bounced (mail for orbialia.es loops back to myself)     May  9 09:33:58 ns3285243 postfix/qmgr[1575]: 42EC4A1DB4: removed      This is my postfix config               alias_database = hash:/etc/aliases     alias_maps = hash:/etc/aliases     append_dot_mydomain = no     biff = no     config_directory = /etc/postfix     content_filter = smtp-amavis:[127.0.0.1]:10024     inet_interfaces = all     mailbox_command = procmail -a "$EXTENSION"     mailbox_size_limit = 0     milter_default_action = accept     milter_protocol = 2     mydestination = localhost, ns3285243.ip-5-135-177.eu     myhostname = rentabiliza.net     mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128     myorigin = /etc/mailname     non_smtpd_milters = inet:localhost:8891     policy-spf_time_limit = 3600s     readme_directory = no     recipient_delimiter = +     relayhost =     smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)     smtpd_milters = inet:localhost:8891     smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination check_policy_service unix:private/policy-spf     smtpd_sasl_auth_enable = yes     smtpd_sasl_path = private/auth     smtpd_sasl_type = dovecot     smtpd_tls_auth_only = yes     smtpd_tls_cert_file = /etc/ssl/certs/dovecot.pem     smtpd_tls_key_file = /etc/ssl/private/dovecot.pem     smtpd_use_tls = yes     virtual_alias_domains = mysql:/etc/postfix/sql-domain-aliases.cf     virtual_alias_maps = mysql:/etc/postfix/sql-aliases.cf, mysql:/etc/postfix/sql-domain-aliases-mailboxes.cf, mysql:/etc/postfix/sql-email2email.cf, mysql:/etc/postfix/sql-catchall-aliases.cf     virtual_mailbox_domains = mysql:/etc/postfix/sql-domains.cf     virtual_mailbox_maps = mysql:/etc/postfix/sql-mailboxes.cf     virtual_transport = lmtp:unix:private/dovecot-lmtp      I use virtual domains/users in a mysql database hostname: `ns3285243.ip-5-135-177.eu` hostname -f: `ns3285243.ip-5-135-177.eu` /etc/hosts               # Do not remove the following line, or various programs     # that require network functionality will fail.     127.0.0.1 localhost.localdomain localhost     5.135.177.115           ns3285243.ip-5-135-177.eu       ns3285243     2001:41D0:8:B873::1     ns3285243.ip-5-135-177.eu       ns3285243          # The following lines are desirable for IPv6 capable hosts     #(added automatically by netbase upgrade)          ::1     ip6-localhost ip6-loopback     fe00::0 ip6-localnet     ff00::0 ip6-mcastprefix     ff02::1 ip6-allnodes     ff02::2 ip6-allrouters     ff02::3 ip6-allhosts      When i try to send mail to gmail.com to destination it recieve the email succesfully If i put orbialia.es to mydestination i recieve this:               May  9 09:47:28 ns3285243 postfix/smtpd[2601]: NOQUEUE: reject: RCPT from 251.Red-79-145-170.dynamicIP.rima-tde.net[79.145.170.251]: 550 5.1.1 <consultanos@orbialia.es>: Recipient address rejected: User unknown in local recipient table; from=<jonatan.soler@orbialia.es> to=<consultanos@orbialia.es> proto=ESMTP helo=<50l3rport>      i have multiple virtual domains. How can resolve it?