Trying to make my default selection for USB c920 webcam work in Gstreamer, but still opens laptop internal cam

For the past week I have been trying to get my Logitech c920 to act as my default webcam. Despite everything seeming to be in order, it's just not working. I have GUVCview and V4L installed. I have Gstreamer and Multimedia selector installed. In Multimedia selector, I have c920 selected as my default webcam. I get there by running root               $ sudo gstreamer-properties      However, when I open G chat/Hangouts or GUVCview, it still opens up my laptop screen camera and I have to select "New" or "Restart" to open up external cam. I get this message after running `sudo gstreamer-properties`               (gstreamer-properties:2885): Gtk-WARNING **: Unknown property: GtkDialog.has-separator          (gstreamer-properties:2885): Gtk-WARNING **: Unknown property: GtkDialog.has-separator     gstreamer-properties-Message: Skipping unavailable plugin 'artsdsink'     gstreamer-properties-Message: Skipping unavailable plugin 'esdsink'     gstreamer-properties-Message: Skipping unavailable plugin 'sunaudiosink'     gstreamer-properties-Message: Skipping unavailable plugin 'glimagesink'     gstreamer-properties-Message: Skipping unavailable plugin 'v4lmjpegsrc'     gstreamer-properties-Message: Skipping unavailable plugin 'qcamsrc'     gstreamer-properties-Message: Skipping unavailable plugin 'v4lsrc'     gstreamer-properties-Message: Skipping unavailable plugin 'esdmon'     gstreamer-properties-Message: Skipping unavailable plugin 'sunaudiosrc'        * Could these unavailable plug ins be the problem?   * Could there be a bad setting somewhere?     ![screenshot](http://i.stack.imgur.com/noE7s.png)                             ![screenshot](http://i.stack.imgur.com/Penw8.png) I'm running:   * Windows 7 and Ubuntu 12.04 LTS on Toshiba Satellite L755   * memory: 3.8 Gib   * processor: Intel® Core™ i5-2410M CPU @ 2.30GHz × 4   * graphics: Intel® Sandybridge Mobile   * OS-type 64bit   * disk: 40.2 GB ### EDIT #1: Readout on Terminal after running `lsusb` and `lusub -t`               mike@Mike-Ubuntu12:~$ lsusb     Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 001 Device 003: ID 04f2:b289 Chicony Electronics Co., Ltd      Bus 002 Device 003: ID 046d:082d Logitech, Inc.      mike@Mike-Ubuntu12:~$ lsusb -t     /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M         |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/6p, 480M             |__ Port 2: Dev 3, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M             |__ Port 2: Dev 3, If 1, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M             |__ Port 2: Dev 3, If 2, Class=audio, Driver=snd-usb-audio, 480M             |__ Port 2: Dev 3, If 3, Class=audio, Driver=snd-usb-audio, 480M     /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M         |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/6p, 480M             |__ Port 4: Dev 3, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M             |__ Port 4: Dev 3, If 1, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M      ### EDIT #2:               $ lsusb -vv     dwMaxVideoFrameBufferSize     1179648             dwDefaultFrameInterval         333333             bFrameIntervalType                  7             dwFrameInterval( 0)            333333             dwFrameInterval( 1)            416666             dwFrameInterval( 2)            500000             dwFrameInterval( 3)            666666             dwFrameInterval( 4)           1000000             dwFrameInterval( 5)           1333333             dwFrameInterval( 6)           2000000           VideoStreaming Interface Descriptor:             bLength                            54             bDescriptorType                    36             bDescriptorSubtype                  7 (FRAME_MJPEG)             bFrameIndex                        15             bmCapabilities                   0x00               Still image unsupported             wWidth                           1280             wHeight                           720             dwMinBitRate                 73728000             dwMaxBitRate                442368000             dwMaxVideoFrameBufferSize     1843200             dwDefaultFrameInterval         333333             bFrameIntervalType                  7             dwFrameInterval( 0)            333333             dwFrameInterval( 1)            416666             dwFrameInterval( 2)            500000             dwFrameInterval( 3)            666666             dwFrameInterval( 4)           1000000             dwFrameInterval( 5)           1333333             dwFrameInterval( 6)           2000000           VideoStreaming Interface Descriptor:             bLength                            54             bDescriptorType                    36             bDescriptorSubtype                  7 (FRAME_MJPEG)             bFrameIndex                        16             bmCapabilities                   0x00               Still image unsupported             wWidth                           1600             wHeight                           896             dwMinBitRate                114688000             dwMaxBitRate                688128000             dwMaxVideoFrameBufferSize     2867200             dwDefaultFrameInterval         333333             bFrameIntervalType                  7             dwFrameInterval( 0)            333333             dwFrameInterval( 1)            416666             dwFrameInterval( 2)            500000             dwFrameInterval( 3)            666666             dwFrameInterval( 4)           1000000             dwFrameInterval( 5)           1333333             dwFrameInterval( 6)           2000000           VideoStreaming Interface Descriptor:             bLength                            54             bDescriptorType                    36             bDescriptorSubtype                  7 (FRAME_MJPEG)             bFrameIndex                        17             bmCapabilities                   0x00               Still image unsupported             wWidth                           1920             wHeight                          1080             dwMinBitRate                165888000             dwMaxBitRate                995328000             dwMaxVideoFrameBufferSize     4147200             dwDefaultFrameInterval         333333             bFrameIntervalType                  7             dwFrameInterval( 0)            333333             dwFrameInterval( 1)            416666             dwFrameInterval( 2)            500000             dwFrameInterval( 3)            666666             dwFrameInterval( 4)           1000000             dwFrameInterval( 5)           1333333             dwFrameInterval( 6)           2000000           VideoStreaming Interface Descriptor:             bLength                             6             bDescriptorType                    36             bDescriptorSubtype                 13 (COLORFORMAT)             bColorPrimaries                     1 (BT.709,sRGB)             bTransferCharacteristics            1 (BT.709)             bMatrixCoefficients                 4 (SMPTE 170M (BT.601))         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       1           bNumEndpoints           1           bInterfaceClass        14 Video           bInterfaceSubClass      2 Video Streaming           bInterfaceProtocol      0            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            5               Transfer Type            Isochronous               Synch Type               Asynchronous               Usage Type               Data             wMaxPacketSize     0x00c0  1x 192 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       2           bNumEndpoints           1           bInterfaceClass        14 Video           bInterfaceSubClass      2 Video Streaming           bInterfaceProtocol      0            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            5               Transfer Type            Isochronous               Synch Type               Asynchronous               Usage Type               Data             wMaxPacketSize     0x0180  1x 384 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       3           bNumEndpoints           1           bInterfaceClass        14 Video           bInterfaceSubClass      2 Video Streaming           bInterfaceProtocol      0            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            5               Transfer Type            Isochronous               Synch Type               Asynchronous               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       4           bNumEndpoints           1           bInterfaceClass        14 Video           bInterfaceSubClass      2 Video Streaming           bInterfaceProtocol      0            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            5               Transfer Type            Isochronous               Synch Type               Asynchronous               Usage Type               Data             wMaxPacketSize     0x0280  1x 640 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       5           bNumEndpoints           1           bInterfaceClass        14 Video           bInterfaceSubClass      2 Video Streaming           bInterfaceProtocol      0            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            5               Transfer Type            Isochronous               Synch Type               Asynchronous               Usage Type               Data             wMaxPacketSize     0x0320  1x 800 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       6           bNumEndpoints           1           bInterfaceClass        14 Video           bInterfaceSubClass      2 Video Streaming           bInterfaceProtocol      0            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            5               Transfer Type            Isochronous               Synch Type               Asynchronous               Usage Type               Data             wMaxPacketSize     0x03b0  1x 944 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       7           bNumEndpoints           1           bInterfaceClass        14 Video           bInterfaceSubClass      2 Video Streaming           bInterfaceProtocol      0            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            5               Transfer Type            Isochronous               Synch Type               Asynchronous               Usage Type               Data             wMaxPacketSize     0x0a80  2x 640 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       8           bNumEndpoints           1           bInterfaceClass        14 Video           bInterfaceSubClass      2 Video Streaming           bInterfaceProtocol      0            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            5               Transfer Type            Isochronous               Synch Type               Asynchronous               Usage Type               Data             wMaxPacketSize     0x0b20  2x 800 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       9           bNumEndpoints           1           bInterfaceClass        14 Video           bInterfaceSubClass      2 Video Streaming           bInterfaceProtocol      0            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            5               Transfer Type            Isochronous               Synch Type               Asynchronous               Usage Type               Data             wMaxPacketSize     0x0be0  2x 992 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting      10           bNumEndpoints           1           bInterfaceClass        14 Video           bInterfaceSubClass      2 Video Streaming           bInterfaceProtocol      0            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            5               Transfer Type            Isochronous               Synch Type               Asynchronous               Usage Type               Data             wMaxPacketSize     0x1380  3x 896 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting      11           bNumEndpoints           1           bInterfaceClass        14 Video           bInterfaceSubClass      2 Video Streaming           bInterfaceProtocol      0            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            5               Transfer Type            Isochronous               Synch Type               Asynchronous               Usage Type               Data             wMaxPacketSize     0x13fc  3x 1020 bytes             bInterval               1         Interface Association:           bLength                 8           bDescriptorType        11           bFirstInterface         2           bInterfaceCount         2           bFunctionClass          1 Audio           bFunctionSubClass       2 Streaming           bFunctionProtocol       0            iFunction               0          Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        2           bAlternateSetting       0           bNumEndpoints           0           bInterfaceClass         1 Audio           bInterfaceSubClass      1 Control Device           bInterfaceProtocol      0            iInterface              0            AudioControl Interface Descriptor:             bLength                 9             bDescriptorType        36             bDescriptorSubtype      1 (HEADER)             bcdADC               1.00             wTotalLength           38             bInCollection           1             baInterfaceNr( 0)       3           AudioControl Interface Descriptor:             bLength                12             bDescriptorType        36             bDescriptorSubtype      2 (INPUT_TERMINAL)             bTerminalID             1             wTerminalType      0x0201 Microphone             bAssocTerminal          0             bNrChannels             1             wChannelConfig     0x0003               Left Front (L)               Right Front (R)             iChannelNames           0              iTerminal               0            AudioControl Interface Descriptor:             bLength                 9             bDescriptorType        36             bDescriptorSubtype      3 (OUTPUT_TERMINAL)             bTerminalID             3             wTerminalType      0x0101 USB Streaming             bAssocTerminal          0             bSourceID               5             iTerminal               0            AudioControl Interface Descriptor:             bLength                 8             bDescriptorType        36             bDescriptorSubtype      6 (FEATURE_UNIT)             bUnitID                 5             bSourceID               1             bControlSize            1             bmaControls( 0)      0x03               Mute Control               Volume Control             iFeature                0          Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        3           bAlternateSetting       0           bNumEndpoints           0           bInterfaceClass         1 Audio           bInterfaceSubClass      2 Streaming           bInterfaceProtocol      0            iInterface              0          Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        3           bAlternateSetting       1           bNumEndpoints           1           bInterfaceClass         1 Audio           bInterfaceSubClass      2 Streaming           bInterfaceProtocol      0            iInterface              0            AudioStreaming Interface Descriptor:             bLength                 7             bDescriptorType        36             bDescriptorSubtype      1 (AS_GENERAL)             bTerminalLink           3             bDelay                255 frames             wFormatTag              1 PCM           AudioStreaming Interface Descriptor:             bLength                11             bDescriptorType        36             bDescriptorSubtype      2 (FORMAT_TYPE)             bFormatType             1 (FORMAT_TYPE_I)             bNrChannels             2             bSubframeSize           2             bBitResolution         16             bSamFreqType            1 Discrete             tSamFreq[ 0]        16000           Endpoint Descriptor:             bLength                 9             bDescriptorType         5             bEndpointAddress     0x82  EP 2 IN             bmAttributes            5               Transfer Type            Isochronous               Synch Type               Asynchronous               Usage Type               Data             wMaxPacketSize     0x0044  1x 68 bytes             bInterval               4             bRefresh                0             bSynchAddress           0             AudioControl Endpoint Descriptor:               bLength                 7               bDescriptorType        37               bDescriptorSubtype      1 (EP_GENERAL)               bmAttributes         0x01                 Sampling Frequency               bLockDelayUnits         0 Undefined               wLockDelay              0 Undefined         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        3           bAlternateSetting       2           bNumEndpoints           1           bInterfaceClass         1 Audio           bInterfaceSubClass      2 Streaming           bInterfaceProtocol      0            iInterface              0            AudioStreaming Interface Descriptor:             bLength                 7             bDescriptorType        36             bDescriptorSubtype      1 (AS_GENERAL)             bTerminalLink           3             bDelay                255 frames             wFormatTag              1 PCM           AudioStreaming Interface Descriptor:             bLength                11             bDescriptorType        36             bDescriptorSubtype      2 (FORMAT_TYPE)             bFormatType             1 (FORMAT_TYPE_I)             bNrChannels             2             bSubframeSize           2             bBitResolution         16             bSamFreqType            1 Discrete             tSamFreq[ 0]        24000           Endpoint Descriptor:             bLength                 9             bDescriptorType         5             bEndpointAddress     0x82  EP 2 IN             bmAttributes            5               Transfer Type            Isochronous               Synch Type               Asynchronous               Usage Type               Data             wMaxPacketSize     0x0064  1x 100 bytes             bInterval               4             bRefresh                0             bSynchAddress           0             AudioControl Endpoint Descriptor:               bLength                 7               bDescriptorType        37               bDescriptorSubtype      1 (EP_GENERAL)               bmAttributes         0x01                 Sampling Frequency               bLockDelayUnits         0 Undefined               wLockDelay              0 Undefined         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        3           bAlternateSetting       3           bNumEndpoints           1           bInterfaceClass         1 Audio           bInterfaceSubClass      2 Streaming           bInterfaceProtocol      0            iInterface              0            AudioStreaming Interface Descriptor:             bLength                 7             bDescriptorType        36             bDescriptorSubtype      1 (AS_GENERAL)             bTerminalLink           3             bDelay                255 frames             wFormatTag              1 PCM           AudioStreaming Interface Descriptor:             bLength                11             bDescriptorType        36             bDescriptorSubtype      2 (FORMAT_TYPE)             bFormatType             1 (FORMAT_TYPE_I)             bNrChannels             2             bSubframeSize           2             bBitResolution         16             bSamFreqType            1 Discrete             tSamFreq[ 0]        32000           Endpoint Descriptor:             bLength                 9             bDescriptorType         5             bEndpointAddress     0x82  EP 2 IN             bmAttributes            5               Transfer Type            Isochronous               Synch Type               Asynchronous               Usage Type               Data             wMaxPacketSize     0x0084  1x 132 bytes             bInterval               4             bRefresh                0             bSynchAddress           0             AudioControl Endpoint Descriptor:               bLength                 7               bDescriptorType        37               bDescriptorSubtype      1 (EP_GENERAL)               bmAttributes         0x01                 Sampling Frequency               bLockDelayUnits         0 Undefined               wLockDelay              0 Undefined      ### EDIT #3 - JAN 5TH:               $ for i in /sys/bus/usb/devices/*/id{Vendor,Product}; do \         echo -n "$i | "; cat $i; done | sort | column -t     /sys/bus/usb/devices/1-1.4/idProduct  |  b289     /sys/bus/usb/devices/1-1.4/idVendor   |  04f2      **2nd edit:**               $ cat /sys/bus/usb/devices/1-1.4/bConfigurationValue     1      **3rd edit**               $ sudo su -c 'echo "0" > /sys/bus/usb/devices/1-1.4/bConfigurationValue'                              ![screenshot](http://i.stack.imgur.com/1aWey.png)


Black screen when splitting media files

When I run               for i in $(ls *mp4);         do ffmpeg -i $i -ss 0 -t 720.0 -vcodec copy -acodec copy $i-part1.mp4;         ffmpeg -i $i -ss 720.0 -vcodec copy -acodec copy $i-part2.mp4;     done;      in a directory of some mp4-files I get a ~3 second black screen with audio at the beginning of the part2 clips, how can I fix this? Am I missing something in my script?


Basename gives extra operand error

I 'm using the following script to merge few pcap files into one using mergecap command. But when I run it it gives me a `'basename: extra operand /mnt/md0/capture/DCN/dcn_2014_02_04_00_11_47_598.pcap'` error The script is as follows               #!/bin/bash     #find last 15 files older than +5 days     FILES=$(find /mnt/md0/capture/DCN/ -maxdepth 1 -type f -name "*.pcap"  -mtime +5 -print0 | xargs -0 ls -lt | tail -15 | awk '{print $8}')          N=15     TAG1=$(basename ${FILES[0]} | sed 's/.pcap//')     TAG2=$(basename ${FILES[$N-1]} | sed 's/.pcap//')     #merge the files     mergecap -w /mnt/md0/capture/DCN/"${TAG1}_to_${TAG2}".pcap ${FILES[@]}     sudo chmod +rw /mnt/md0/capture/DCN/"${TAG1}_to_${TAG2}".pcap      #delete originals     sudo rm  ${FILES[@]}


Splitting string by the first occurrence of a delimiter

I have a string in the next format               id;some text here with possible ; inside      and want to split it to 2 strings by first occurrence of the `;`. So, it should be: `id` and `some text here with possible ; inside` I know how to split the string (for instance, with `cut -d ';' -f1`), but it will split to more parts since i have `;` inside the left part.


mount does not print mounted partitions

When I type `mount`, I should get a list of mounted file systems. But I get nothing. I have the necessary files:               /proc/mounts      /etc/mtab -> /proc/mounts      Also, `cat /etc/mtab` works fine. I get the correct output, such as:               /dev/root / ext4 ro,relatime,data=ordered 0 0     ....      What files does `mount` need to print the correct output? I always thought, that `/etc/mtab` is sufficient. Where does `mount` get its information from, if not from `/etc/mtab` ?


Open .desktop files in text editor by default

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


Update yum fails

I'm using centOS 6.4. I'm getting this error when I use "yum update" in the terminal window.                Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was     14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"     Error: Cannot find a valid baseurl for repo: base      Is there any alternative mirror for Upgrading?


How to get 'TZ' with out '$TZ' being set?

I writing a Ruby program. I need a way to get something like `America/New_York` as `ActiveSupport::TimeZone` and `require "tzinfo"` can't get my current timezone. (Note that `Time.now.zone` can get things like `EST` but I need the tz database format, e.g. `America/New_York`.) Though the eazy way to do this is to just have the user set `$TZ`, `TZ='America/New_York'; export TZ` or `tzselect`. I'm looking for a way to do this without having the user set `TZ`. Is there some system file I can load, or a network location I can query? I need the timezone for things like.               require "active_support/core_ext/time/zones"          Time.zone = ENV['TZ']     p Time.zone.now # Returns current time in the local time zone using ActiveSupport.


How to install pandoc

I tried to install pandoc on manjaro and therefore I installed ghc and caball- install, but I got an error by executing "cabal update"               $ cabal update     Downloading the latest package list from hackage.haskell.org     cabal: Codec.Compression.Zlib: premature end of compressed stream      I also were not able to install Pandoc with help AUR.


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

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


How do I safely unmount a network share on Linux STB without crashing (I get GSOD)?

I have a network share named **_dreambox_** on **_C:\dreambox_** that is shared with the group **Everyone** in Windows. I have mounted it to **/hdd** on a Linux-based STB with OpenDreambox (OpenEmbedded) using Telnet (PuTTY). I have done so to enable the STB to record TV show to my PC without a dedicated eSATA disk drive. I now wish to undo this, because I want to use a different PC for this and stop using this one. This is the command I have used after connecting to the box over telnet and logging in:               cd /     umount -t cifs      This command was accepted. But I was still able to press the Record button on the STB remote control and get the popup menu for recording. But if I chose to record the _REC_ symbol would start flashing on the Info-bar but there were no files actually recorded to my network share. So it kind of... only kind of... worked... Also, when I stopped the recording I got a _GSOD_ ( **green screen of death** ) showing me some basic crash information and told me to send the log to the manufacturer to their e-mail address. It also stated that it would have to reboot. But I don't think it actually rebooted. So when I went to _Menu_ , _Standby/Restart_ , and choose _Restart_ I could see the gears animation as if it was loading settings and then I got the same kind of GSOD again. I don't think it fully rebooted at all. I have done it repeatedly and got the GSOD every time. I then switched it off from power and put it back on, and after booting I had the same problem again. If it's any help, these are the steps I have done to enable this:               1. PuTTY start     2. Connect to 192.168.0.107     3. Log in as root     4. cd /     5. mkdir /hdd/movie     6. mount -t cifs -o username=*,password=* //192.168.0.101/dreambox /hdd     7. cd /hdd     8. ls (showed nothing - empty folder)      Also, the Linux box is running BusyBox, and from what I understand, as a noob, this is the package that gives it the shell command. I mention this because this shell doesn't seem to support all shell commands found on a regular Linux distro. I did try this command first:               umount -t cifs -t cifs -o username=*,password=* //192.168.0.101/dreambox      Is this the proper syntax? This is the same command as the one I used to mount, only this is the `umount` command to unmount. And it didn't work, it didn't find the directory, file, or device (not sure of exact word). So I decided to unmount everything `cifs` (as seen above), and it worked, but caused the Linux box to act up. I have now done the same command again:               mount -t cifs -o username=*,password=* //192.168.0.101/dreambox /hdd      It got mounted, and I no longer get any GSOD and I can record once again. But how do I stop it for good?... I think it has something to do with bad references. Something is referring to my network share which is no longer there when I unmount it, which in turn causes Linux to start acting up. But as a noob I have no idea how to sort this out. FWIW, this is the content of my _fstab_ file in `/etc/fstab`:               rootfs               /                    auto       defaults              1 1     proc                 /proc                proc       defaults              0 0     devpts               /dev/pts             devpts     mode=0620,gid=5       0 0     usbfs                /proc/bus/usb        usbfs      defaults              0 0     /dev/mtdblock2       /boot                jffs2      ro                    0 0     tmpfs                /var                 tmpfs      defaults              0 0     tmpfs                /tmp                 tmpfs      defaults              0 0     /dev/sda1            /media/hdd           auto       defaults              0 0      I did use a different set of commands in my first attempts to mount the share in the box. And to make it mount on reboot I have edited this file. But I have undone those changes, so this should not have any effect anymore. What you see here above is what the fstab file looks like by default. Oh right... the `/hdd` actually redirects to `/media/hdd`. So the `movie` folder I created in the process is actually in `/media/hdd/movie` and not `/hdd/movie` (step 5. mkdir /hdd/movie). I would greatly appreciate any help with this.


Slackware boot error after fresh install

I'm currently running Ubuntu and Slackware on my system. After just installing Slackware, with everything appearing to work fine, I boot into GRUB only to see an "error: no such disk" or something of another when I try to load Slackware. Does anyone know why this is the case? **update** I first installed Slackware with a full install on one of my partitions, a swap included. During this time I chose _not_ to install LILO. After this, I then proceeded to install Ubuntu just so I could have something which would work when I needed it to. This is when I installed GRUB2, and when Slackware just refused to work. Should I reinstall it with LILO this time? If I do this, will it scrap my Ubuntu or should I still be able to use it? **update 2** I think this is the problem:               menuentry "Slackware Linux (Slackware 13.37.0) (on /dev/sda8)" --class gnu-linux --class g      nu --class os {            insmod part_gpt            insmod ext2            set root='(/dev/sda,gpt8)'            search --no-floppy --fs-uuid --set=root 89ba52ea-8afa-4d93-adac-e4a9258a2aae            linux /boot/vmlinuz root=/dev/sda8       }      I don't know much about grub.cfg, but from it seems like (and from what I've been reading of the ubuntu documentation), this appears to be correct. I think the uuid isn't being found, however. Should I replace the uuid with the partition it's located on?


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

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


Debian, two network cards - "no route to host" on eth1

I have added a secound nic in a debian box. That nic is ment for doing some test stuff, so those devices connected should just be able to access the debian box or be accessed from it. To set up the nic, I have added to /etc/network/interfaces               iface eth1 inet static         address 192.168.0.2         netmask 255.255.255.0         broadcast 192.168.0.255         network 192.168.0.0      Those values shows up when I do an ifconfig, and route shows:               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     default         adim.hhv3       0.0.0.0         UG    0      0        0 eth0     192.168.0.0     *               255.255.255.0   U     0      0        0 eth1     192.168.1.0     *               255.255.255.0   U     0      0        0 eth0      SO it seems to me as if everything is set up correctly, but when I try to access any of the devices on the 192.168.0.x network, I just get a "no route to host" error. Have I forgotten or overlooked something? (presently I cannot test the other way around. The nic leds are indicating that there is a link) Things get weirder. I have set up an old wireless router that acts as a dhcp server on the eth1 network. Then eth1 works just as intended - but if I try to set it manually, it does not work. When setting manually, I just use the above mentioned interfaces file. Set from dhcp:               root@sorbus:~# ip addr (removed loopback and eth0)     3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000     link/ether 00:11:95:84:6b:6c brd ff:ff:ff:ff:ff:ff     inet 192.168.0.142/24 brd 192.168.0.255 scope global eth1     inet6 fe80::211:95ff:fe84:6b6c/64 scope link         valid_lft forever preferred_lft forever          root@sorbus:~# ip route     default via 192.168.1.1 dev eth0  proto static      192.168.0.0/24 dev eth1  proto kernel  scope link  src 192.168.0.142      192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.23       And now it seems to work also for the manual setup.... :-/ Good that it works but it would be nice to know why... (I cannot use dhcp on the 192.168.0 since it messes up my resolv.conf - at least I have not seen any way of stopping it from doing it)


Failure to install MySQL

I attempted to install MySQL using Synaptic but it failed to start on update with the following output:               Selecting previously unselected package mysql-client.     (Reading database ... 131143 files and directories currently installed.)     Unpacking mysql-client (from .../mysql-client_5.5.29-0ubuntu0.12.04.1_all.deb) ...     Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.04.1) ...     start: Job failed to start     invoke-rc.d: initscript mysql, action "start" failed.     dpkg: error processing mysql-server-5.5 (--configure):      subprocess installed post-installation script returned error exit status 1     Setting up mysql-client (5.5.29-0ubuntu0.12.04.1) ...     Errors were encountered while processing:      mysql-server-5.5     E: Sub-process /usr/bin/dpkg returned an error code (1)     A package failed to install.  Trying to recover:     Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.04.1) ...     130201 13:36:05 [Note] Plugin 'FEDERATED' is disabled.     130201 13:36:05 InnoDB: The InnoDB memory heap is disabled     130201 13:36:05 InnoDB: Mutexes and rw_locks use GCC atomic builtins     130201 13:36:05 InnoDB: Compressed tables use zlib 1.2.3.4     130201 13:36:05 InnoDB: Initializing buffer pool, size = 128.0M     130201 13:36:05 InnoDB: Completed initialization of buffer pool     130201 13:36:05 InnoDB: highest supported file format is Barracuda.     130201 13:36:06  InnoDB: Waiting for the background threads to start     130201 13:36:07 InnoDB: 1.1.8 started; log sequence number 1595685     130201 13:36:07  InnoDB: Starting shutdown...     130201 13:36:08  InnoDB: Shutdown completed; log sequence number 1595685     start: Job failed to start     invoke-rc.d: initscript mysql, action "start" failed.     dpkg: error processing mysql-server-5.5 (--configure):      subprocess installed post-installation script returned error exit status 1     Errors were encountered while processing:      mysql-server-5.5      I am not sure how to pull apart the where the initialization broke down, or how to get it started. Is it likely that I am missing a library somewhere that would account for this? Does the disabled 'FEDERATED' plugin matter? What is going on with InnoDB anyway?


rsync all directories that start with a specific digit

I have directory loaded with thousands of sub directories:               /home/tmp/               1               12               123               1234               2345               234               3456               345               34      Each subdirectory in turn has hundreds of subdirectories that I want to rsync if the first level subdirectory matches... What I need is a way to copy/rsync only the directories that start with a given digit [1-9]... What I think I want is basically something that would allow me to use wild cards to match               rsync -rzvvhP remotehost:/home/tmp/1* /home/tmp/      I want rsync to sync up the               /home/tmp/1/     /home/tmp/12/     /home/tmp/123/     /home/tmp/1234/      directories and any child subdirectories they have but not any of the first level directories that start with a different digit...               /home/tmp/234/     /home/tmp/2345/     ........./3*/     ........./4*/ etc..      **What I've tried:**               rsync -rzvvhP --exclude='*' --include-from=1.txt remotehost:/home/tmp/ /home/tmp/      where 1.txt contains:               1     12     123     1234      When I do this with 2.txt though rsync still seems to run through all the directories that start with 1 and 3 etc... How can I do this so that I can have one command to rsync only the directories that start with any given digit?


How get program name that produced an IO error redirected to a LOG in a nohup command?

I have a program that executes other programs in the background. The main program would be programA, and the programs executed by the main one, would be program1a, program1b and program1c. I need the programs to continue the execution no matter if the shell connection is lost, so I'm using the `nohup` command. However, each program has its own log file, like this: programA --> `logfileA.txt`   program1a --> `logfile1a.txt`   program1b --> `logfile1b.txt`   program1c --> `logfile1c.txt` When an error occurs in one of the child programs, the error message is displayed in the LOG file corresponding to the main program. Examples:   1. The programA is invoked from another routine.-              nohup nice -10 programA 2>&1 > logfileA.txt        2. Inside programA it invokes the other 3 programs.-              nohup nice -10 program1a 2>&1 > logfile1a.txt     nohup nice -10 program1b 2>&1 > logfile1b.txt     nohup nice -10 program1c 2>&1 > logfile1c.txt      When an error occurs, it is showm or displayed in `logfileA.txt`, instead of being displayed in `logfile1a.txt` or `logfile1b.txt` or `logfile1c.txt`. How can I know what program produced the error that is displayed in the main program's log file?


How can I automatically disable my laptop's built-in keyboard in X.org?

## Distro and X.org Version Information I am using Ubuntu 12.10 with xserver-xorg/quantal 1:7.7+1ubuntu4. ## Disabling Built-In Keyboard in X11 I have a laptop with a built-in keyboard that no longer recognizes certain letters. I am currently disabling the built-in keyboard by opening a terminal and running the following shell function:               disable_keyboard () {       xinput --set-int-prop $(         xinput --list |         ruby -ane 'if /AT.*keyboard/ then puts $_.match(/(?<==)\d+/) end'       ) "Device Enabled" 8 0     }      This works (albeit manually) by disabling the built-in _AT Translated Set 2 keyboard_ while allowing my external _Chicony USB Keyboard_ to continue working. However, I'd really like this to happen automatically during X11 sessions. I tried modifying my X.org configuration as follows:               # /etc/X11/xorg.conf.d/disable_keyboard     Section "InputClass"         Identifier      "disable built-in keyboard"         MatchIsKeyboard "on"         MatchProduct    "AT Translated Set 2 keyboard"         Option          "Ignore"    "on"     EndSection      However, either this is not being sourced when X11 starts, or it is not the correct incantation. How can I correctly configure X11 to use _only_ the USB keyboard?


command --help vs man command

What is the difference between invoking the help using a --help key compared to invoking a "man command"? When should I choose one over another.


How can I customize new mail notification in alpine?

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


Manage Windows in different ways on different workspaces/activites in KDE 4.5 possible?

I'm just wondering if it's possible to on one workspace (or maybe activity) to use Tiling, and use normal management on another, maybe change some grouping settings on another.


missing man pages of some commands

Typing `man alias` gives me > No manual entry for alias The same thing goes for `export` and `eval`. At first I thought it only happens to shell built-in commands but `man echo` gives me the man page. Except for googling, is there a way that I can view the documentation of those commands? If not, is there a way to "install" those missing man pages?


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

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


Unix - Filter Commands

I want to know about the "filter-command" which are available in Unix. I am confused regarding this:   1. What is the purpose of "Filter-Command" ?   2. Which are the Filter-commands available in Unix? I have read some books/articles on web, in some books i found few filter commands and in some books i found some other.


how does this work in awk even without print?

bash-3.00# cat > b1.txt     AAA,Apples,123     BBB,Bananas,124     CCC,Carrot,125     bash-3.00# cat > b2.txt     Store1|AAA|123|11     Store2|BBB|124|23     Store3|CCC|125|57     Store4|DDD|126|38     bash-3.00# awk -F"[,|]" 'NR==FNR{a[$1]++;next} !a[$2]' b1.txt b2.txt     Store4|DDD|126|38      When `NR==FNR` returns true for first file `a[$1]` gets incremented. `next` brings back to beginning of the script. But what is `!a[$2]` doing here? How does it print without even a `print` command?


cannot create symbolic link on CentOS 5.6 - File exists error

I am trying to setup a symbolic link on my CentOS 5.6 machine to point `dev_crmpicco/` to `~/vhosts/dev/dev_crmpicco/web/` I am using the following command:               [crmpicco@devel dev]$ ln -s ~/vhosts/dev/dev_crmpicco/web/ dev_crmpicco/      However, I get this error:               ln: creating symbolic link `dev_crmpicco/web' to `/home/crmpicco/vhosts/dev/dev_crmpicco/web/': File exists      I'm aware the file exists as I want `dev_crmpicco/` to point to it. Basically, my DOCROOT used to be in `dev_crmpicco/` but now it is all moved into a `web/` directory and I don't want to have to go round changing all my Apache config and i'd rather do it through a symlink if at all possible.


Auto login for Ubuntu (or other Linux) without GUI?

I am thinking about doing an Ubuntu installation with their mini ISO, which comes only with the barebones system without a desktop environment/GUI. I remember being given the option to set up automatic login when doing a full Ubuntu desktop installation, but how to I enable that for the mini ISO install? Did I miss something? Also, is there a generalised way to do this on any Linux OS? Thanks!


Making a process read a different file for the same filename

I have an application that reads a file. Let's call it **processname** and the file _~/.configuration_. When **processname** runs it always reads _~/.configuration_ and can't be configured differently. There are also other applications that rely on "~/.configuration", before and after, but not while **processname** is running. Wrapping **processname** in a script that replaces the contents of _~/.configuration_ is an option, but I recently had a power outage (while the contents were swapped out), where I lost the previous contents of said file, so this is not desirable. Is there a way (perhaps using something distantly related to `LD_DEBUG=files processname`?) for fooling a process into reading different contents when it tries to read a specific file? Searching and replacing the filename in the executable is a bit too invasive, but should work as well. I know it's possible to write a kernel module that takes over the `open()` call (https://news.ycombinator.com/item?id=2972958), but is there a simpler or cleaner way? EDIT: When searching for _~/.configuration_ in the **processname** executable I discovered that it tried to read another filename right before reading _~/.configuration_. Problem solved.


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

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


Understanding the Buddy Allocator

I have a conceptual doubt in understanding the way Linux Kernel manages Free blocks. Here is what I interpreted through reading so far. The Buddy Allocator implementation is allocation scheme that combines a normal power-of-2 allocation. At times when we need a block of size which is not available, it divides the large block into two. Those two blocks are Buddies, probably hence it is called the Buddy Allocator. Through a source I learnt that an array of `free_area_t` structs are maintained for each order that points to a linked list of blocks of pages that are free. Which I found in `<linux/mm.h>`               typedef struct free_area_struct {         struct list_head free_list;         unsigned long *map;       } free_area_t;        The `free_list` appear to be a linked-list of page blocks? My question is, whether it is a list of Free pages or Used pages? And `map` appears to be a bitmap that represents the state of a pair of buddies. My question is How can it be a single-bit that holds the state bit for a pair of buddies? Because if, I use one of the block in a _Buddy-pair_ to allocats, and the other left free, what would be the state then, and how is that managed to be stored in a single bit? Does it represent the entire block of the size of power-of-two, which can be divided in two parts when we need a block size which is not available, so the allocated half is _Buddy_ of the other half which is free? If this is the case that half is being allocated and half remains free, then what will be status of `map` ? What if both are free? and what if both are allocated? How can be a binary value representing 3 states of a block? **Edit:** After further reading, the first doubt is cleared. Which says: If a free block cannot be found of the requested order, a higher order block is split into two buddies. One is allocated and the other is placed on the free list for the lower order. So it is linked list of free pages.


Favorite partitioning and mounting tricks

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


Mint: locale problem

When compiling a java application, I got an issue with some characters that are encoded in ISO-8859-1. On my machine I am using UTF-8. How can I change temporarily the locale so compilation goes fine? I tried changing the locale,but it seems I am missing something:               $ export LC_ALL=en_US.ISO-8859-1     bash: warning: setlocale: LC_ALL: cannot change locale (de_DE.ISO-8859-1): No such file or directory     $      Output of `locale -a`:               $ locale -a     C     C.UTF-8     en_AG     en_AG.utf8     en_AU.utf8     en_BW.utf8     en_CA.utf8     en_DK.utf8     en_GB.utf8     en_HK.utf8     en_IE.utf8     en_IN     en_IN.utf8     en_NG     en_NG.utf8     en_NZ.utf8     en_PH.utf8     en_SG.utf8     en_US.utf8     en_ZA.utf8     en_ZM     en_ZM.utf8     en_ZW.utf8     de_DE.utf8     POSIX      I have tried `locale-gen` but it does not help. Placed `en_US ISO-8859-1` in `/etc/locale.gen` and executed `locale-gen`:                 en_US.UTF-8... /usr/sbin/locale-gen: line 177: warning: setlocale: LC_ALL: cannot change locale (en_US.ISO-8859-1)     up-to-date


Where is config file of ibus stored?

I'm wondering where is the config file of ibus stored? I checked `~/.config/ibus`, and there's only a dbus socket. And no ~/.ibus folder available.


Access files from BTRFS image on similar filesystem

Backgroud: Running XBian (Debian ARM distribution for Raspberry Pi), which uses BTRFS. I fragged my system and decided to start over. However, I ripped the image from the root filesystem device before starting fresh. I have a running BTRFS system, and an image (raw filesystem data) file which contains the data from a previous installation. I want to access the data from this image file to restore configuration and things like that. So, I mount this image with the following command (I found the offset with `fdisk /path/to/image.img`, print, and then multiplied the start sector by 512, the sector size - e.g. start sector 10000, offset = 512*10000 = 5120000):               mount -t btrfs -o loop,offset=5120000 /path/to/image.img /mnt/prev-image      After this command, I see that (at `/mnt/prev-image/`) the filesystem doesn't look as straightforward as ext2 or other traditional filesystems. I am probably having a misunderstanding at this point, or with the `mount` command. When I try to access a file from the image, say my Samba configuration, I navigate to `/mnt/prev-image/root/@/etc/samba/smb.conf`. But, I notice that I'm seeing the same filesystem as my main filesystem and that the `smb.conf` file I access is the same as my current Samba configuration in `/etc/samba/smb.conf`. I think BTRFS is treating the data in the image file as a baseline snapshot for my base system, and serving me the "latest" `smb.conf` file, which comes from my fresh installation. I want to know how to access the data from the image file, and where my misunderstandings lie.


IPs that I bound keep stop responding to ping

So Internic sent over a few cs, and it seems fine on some of them. However, on some I have to run `arping -U on` to get them up and they only seem to stay up for a short time. They are a `/24` properly bound via the `ifcfg-eth0-range` scripts. Problem is if I don't leave the arping program on, they don't stay up! Suggestions? The box is Centos 5.x.


dircolors: rules for _ext (rather than .ext)

In UNIX, many file extensions do not contain the dot in front, as in `bashrc` rather than `bash.rc` or `ssh_config` rather than `ssh.config` I would like to add dircolor rules for `_config` as well. However, when I add the line:               _config 01;31      I get an error: `dircolors: `/etc/dircolors':126: unrecognized keyword _config` Is it possible to add extensions `_ext` to dircolors?


vsftpd - Limit FTP access only to /var/www

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


How to have X server on another graphics card which keeps refreshing when I'm working on my main display?

For presentations I want to use the external USB connected video adapter connected to the projector (especially as the standard VGA output in my laptop got damaged). My idea was to start a dedicated X server on this additional video adapter, and make it available via VNC. Then I can connect to it with xvncviewer to manage the presentation from my main X session (and have additional applications open, which are not visible for the audience). Hover the problem is, that if I start the X server in this additional video adapter, it uses certain virtual console. As soon as I switch the virtual console to return to my main X session (to access the presentation X server via VNC), the presentation X server stops refreshing (as it sees, that its virtual console is not active). Is there any way to start the additional X server in such a way, that it keeps refreshing, when I'm working in my main X session? **Update** It seems, that I have found a working solution:   1. I start the X server with the -sharevts flag:  > X -config displaylink.conf -sharevts :2   2. I start my applications: > DISPLAY=2: x-window-manager DISPLAY=2: xterm   3. I start the vnc server: > x11vnc -localhost -display :2 The displaylink.conf has the following contents:               Section "Device"       Identifier      "dl1"       driver          "fbdev"       Option  "fbdev" "/dev/fb1"     EndSection          Section "InputDevice"        Identifier      "Generic Keyboard"        Driver          "void"        Option          "CoreKeyboard"     EndSection          Section "InputDevice"        Identifier      "Configured Mouse"        Driver          "void"        Option          "CorePointer"     EndSection          Section "Monitor"        Identifier "monitor0"      EndSection          Section "Screen"       Identifier "screen0"       Device "dl1"       Monitor "monitor0"       DefaultDepth 16     EndSection          Section "ServerLayout"       Identifier     "external"       Screen  "screen0"        InputDevice "Generic Keyboard" "CoreKeyboard"       InputDevice "Configured Mouse" "CorePointer"           Option "AutoAddDevices" "Off"     EndSection


Searching for Failed attemps in /var/log/secure

I'm currently writing a script to examine /var/log/secure file and report how many failed attempts there were that day. I need to output it in the following format:               Date: 03/15/10 Time: 10:30 Number of failed attempts: 8      Heres my code so far (Haven't done much)... Am I on the right track?               #!/bin/bash          classGID=5000     passfile=/var/log/secure               for i in $(grep ${classGID} ${passfile} | cut -d: -f1)     do          date=$(grep $i{passfile} | cut -d: -f2)          echo "Date: ${date}"          done


How can I determine the date when a piece of software was installed from source?

I've been asked to find out when a specific version of software was installed. The only thing I have to go on are the modification times of the directories in question. I'm having a hard time deciphering when _we_ installed it:               /opt/pkg/totalview:     drwxr-xr-x. 3 root root 4 Jan 23  2013 8.11.0-0          /opt/pkg/totalview/8.11.0-0:     lrwxrwxrwx. 1 root root 32 Jan 23  2013 bin -> toolworks/totalview.8.11.0-0/bin     drwxrwxr-x. 5 root root  5 Dec 11  2012 toolworks          /opt/pkg/totalview/8.11.0-0/bin:     -r-xr-xr-x. 1 root root  3391 Oct 25  2012 htmlhelp.sh     lrwxrwxrwx. 1 root root    38 Dec 11  2012 memscape -> ../../memoryscape.3.3.0-0/bin/memscape     lrwxrwxrwx. 1 root root    39 Dec 11  2012 memscript -> ../../memoryscape.3.3.0-0/bin/memscript     -r-xr-xr-x. 1 root root  9161 Oct 25  2012 mrnet_commnode     lrwxrwxrwx. 1 root root     3 Dec 11  2012 sctotalview -> tv8     lrwxrwxrwx. 1 root root     6 Dec 11  2012 sctotalviewcli -> tv8cli     lrwxrwxrwx. 1 root root     3 Dec 11  2012 sctv8 -> tv8     lrwxrwxrwx. 1 root root     6 Dec 11  2012 sctv8cli -> tv8cli     lrwxrwxrwx. 1 root root     3 Dec 11  2012 totalview -> tv8     lrwxrwxrwx. 1 root root     6 Dec 11  2012 totalviewcli -> tv8cli     -r-xr-xr-x. 3 root root 21970 Oct 25  2012 tv8     -r-xr-xr-x. 3 root root 21970 Oct 25  2012 tv8cli     -r-xr-xr-x. 2 root root 19093 Oct 25  2012 tvdbootstrap     -r-xr-xr-x. 2 root root 19093 Oct 25  2012 tvdsvr     -r-xr-xr-x. 3 root root 21970 Oct 25  2012 tvscript     -r-xr-xr-x. 1 root root  6968 Oct 25  2012 visualize          /opt/pkg/totalview/8.11.0-0/toolworks:     drwxrwxr-x.  5 root root  9 Dec 11  2012 flexlm-10.8.0-3     drwxrwxr-x.  5 root root 19 Oct 25  2012 memoryscape.3.3.0-0     drwxrwxr-x. 17 root root 17 Dec 11  2012 totalview.8.11.0-0      I see three primary dates:   * January 23, 2013    * December 11, 2012   * October 25, 2012 What can I look at to try and determine when this software was actually installed? This software was installed from source, and is not part of an `rpm` or `yum` install. I understand that I can do `stat` to get some more information, but I'm not able to confidently determine which one of these three dates was when it was installed. EDIT: the results of `ls -lc`               /opt/pkg/totalview:     drwxr-xr-x. 3 root root 4 Jan 23  2013 8.11.0-0          /opt/pkg/totalview/8.11.0-0:     lrwxrwxrwx. 1 root root 32 Jan 23  2013 bin -> toolworks/totalview.8.11.0-0/bin     drwxrwxr-x. 5 root root  5 Dec 11  2012 toolworks          /opt/pkg/totalview/8.11.0-0/bin:     -r-xr-xr-x. 1 root root  3391 Nov  5 03:34 htmlhelp.sh     lrwxrwxrwx. 1 root root    38 Dec 11  2012 memscape -> ../../memoryscape.3.3.0-0/bin/memscape     lrwxrwxrwx. 1 root root    39 Dec 11  2012 memscript -> ../../memoryscape.3.3.0-0/bin/memscript     -r-xr-xr-x. 1 root root  9161 Nov  5 03:34 mrnet_commnode     lrwxrwxrwx. 1 root root     3 Dec 11  2012 sctotalview -> tv8     lrwxrwxrwx. 1 root root     6 Dec 11  2012 sctotalviewcli -> tv8cli     lrwxrwxrwx. 1 root root     3 Dec 11  2012 sctv8 -> tv8     lrwxrwxrwx. 1 root root     6 Dec 11  2012 sctv8cli -> tv8cli     lrwxrwxrwx. 1 root root     3 Dec 11  2012 totalview -> tv8     lrwxrwxrwx. 1 root root     6 Dec 11  2012 totalviewcli -> tv8cli     -r-xr-xr-x. 3 root root 21970 Nov  5 03:34 tv8     -r-xr-xr-x. 3 root root 21970 Nov  5 03:34 tv8cli     -r-xr-xr-x. 2 root root 19093 Nov  5 03:34 tvdbootstrap     -r-xr-xr-x. 2 root root 19093 Nov  5 03:34 tvdsvr     -r-xr-xr-x. 3 root root 21970 Nov  5 03:34 tvscript     -r-xr-xr-x. 1 root root  6968 Nov  5 03:34 visualize          /opt/pkg/totalview/8.11.0-0/toolworks:     drwxrwxr-x.  5 root root  9 Dec 11  2012 flexlm-10.8.0-3     drwxrwxr-x.  5 root root 19 Dec 11  2012 memoryscape.3.3.0-0     drwxrwxr-x. 17 root root 17 Dec 11  2012 totalview.8.11.0-0


find /var/log/ -type f -name *.log doesn't return list of log files

Instead, it returns the following error:               find: paths must precede expression: file1.log     Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]     d41d8cd98f00b204e9800998ecf8427e  -      Is there something wrong with the command syntax? (encountered this problem upon trying the accepted answer of this stackoverflow question)


Run a given command on every subpath of a long path

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


Gnome3/Archlinux move windows with keys?

Looking for an app that will allow me to move my Gnome3 windows with keys like `Ctrl`+`Alt`+`Home` to move to top left corner of the screen. Essentially, this is what Winsplit revolution does on windows. Here is one solution, over at ubuntu, but it is a realy PITA: http://askubuntu.com/questions/84066/is-it-possible-to-place-windows-with- keyboard-shortcuts-in-gnome-shell


Not able to do password-free access to remote machine!

When I run               ravbholua@ravbholua-Aspire-5315:~$ rlogin 109.202.101.166      it promps me for password as below:               ravbholua@ravbholua-Aspire-5315:~$ rlogin 109.202.101.166     ravbholua@109.202.101.166's password:      To make password free access, I created a file /etc/hosts.equiv in the remote machine (ravi.com) as below:               root@ravi:/etc# cat hosts.equiv     localhost     42.110.54.211     root@ravi:/etc#      But still whenever I run the above command to login to this remote machine, it asks for password. Additionally, I also created .rhosts file in my same like-to-like account in remote machine in home dir. as below:               ravbholua@ravi:~$ cat .rhosts     localhost     42.110.54.211     ravbholua@ravi:~$      What may be the problem that I am not able to have password-free access. One important point to be noted: To know what's my internet IP address is, I got from the below two sites (both gave the same IP address)               http://www.ipchicken.com/     http://whatismyip.org/      You may please refer to the below link where I had asked for the same query but couldn't get resolved. not-able-to-do-password-free-access-to-remote- machine * * * **Edit** : I ran:               ravbholua@ravbholua-Aspire-5315:~$ sudo scp ~/.ssh/id_rsa.pub rs:.ssh/authorized_keys      as without sudo, it messaged:permission denied. Then I tried both               sudo ssh rs      and               ssh rs       Still I was prompted for password. I entered my remote server after entering password and found the file that was transferred in /root/.ssh as shown ahead.               root@ravi:~/.ssh# ls                                  authorized_keys known_hosts                                           root@ravi:~/.ssh#       Please note rs is an alias for my remote server.


Send a fax via SIP

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


How do you install mutt on Mac OS X?

Is there any way of installing Mutt on Mac OS X without using a compiler, homebrew or MacPorts?


Is there any way to set Mac OS X to use xinetd instead of launchd?

Can Mac OS X run xinetd instead of launchd and if so, how do you do it?


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

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


How to add Flash support on a PowerPC debian

I have a PowerBook G4 running Debian. I followed the instructions from the debian wiki but for installation, it just said > Install flashplugin-nonfree (from section contrib). I was not sure what that meant, So I just ran               apt-get install flashplugin-nonfree      But got this error               Reading package lists... Done     Building dependency tree            Reading state information... Done     Package flashplugin-nonfree is not available, but is referred to by another package.     This may mean that the package is missing, has been obsoleted, or     is only available from another source          E: Package 'flashplugin-nonfree' has no installation candidate      here is my `sources.list` - **Edited:**               #          # deb cdrom:[Debian GNU/Linux 7.3.0 _Wheezy_ - Official powerpc CD Binary-1 20131215-05:55]/ wheezy main          deb cdrom:[Debian GNU/Linux 7.3.0 _Wheezy_ - Official powerpc CD Binary-1 20131215-05:55]/ wheezy main          deb http://ftp.us.debian.org/debian/ wheezy main contrib non-free     deb-src http://ftp.us.debian.org/debian/ wheezy main          deb http://security.debian.org/ wheezy/updates main     deb-src http://security.debian.org/ wheezy/updates main          # wheezy-updates, previously known as 'volatile'     deb http://ftp.us.debian.org/debian/ wheezy-updates main     deb-src http://ftp.us.debian.org/debian/ wheezy-updates main     deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main     deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main


get time of file in inotifywait tool

for this script:               inotifywait -m /path -e create -e moved_to |     while read path action file; do         echo "The file '$file' appeared in directory '$path' via '$action'"         # do something with the file     done      How can I modify the above script to get the times of file or folder?               echo "The file '$file' appeared in directory '$path' via '$action' on date '$date'  and '$time'"


Mail server broken my LAMP installation

I was installing mail server, postfix/sendmail I suppose. Then I had no need to use it anymore so I removed it. But now when I type `localhost` in my browser it redirects me to `https://mail.example.com`. So now I cannot access my php/apache installation.   i.e I cannot open webpages in my `/var/www` folder. It says server not found. I also removed all unwanted hosts in my `hosts` file. It now contains:                   127.0.0.1 localhost.localdomain localhost         127.0.1.1 asus-vlado              # The following lines are desirable for IPv6 capable hosts         ::1     ip6-localhost ip6-loopback         fe00::0 ip6-localnet         ff00::0 ip6-mcastprefix         ff02::1 ip6-allnodes         ff02::2 ip6-allrouters      `/etc/hostname` contains only `asus-vlado` `/etc/network/interfaces` is:                   auto lo         iface lo inet loopback      `httpd.conf` contains:                   ServerName localhost         `nslookup localhost` gives me this:                   Server: 127.0.0.1 Address: 127.0.0.1#53 Name: localhost Address: 127.0.0.1      I also installed bind9. It wasn't installed. Tried start/stop, still the same thing. This file was empty:`/etc/resolv.conf` In my `/etc/apache/sites-available` folder, there are `default` and `default- ssl` links.   I tried                   sudo a2ensite default      it says: `default already enabled`. I tried reload/restart all works well, but still when I write localhost in browser it redirects me to mail.example.com I also tried                   sudo a2dissite mail.example.com      it says it doesn't exist. Apache `default` and `default-ssl` available sites contains :   **default** :               <VirtualHost *:80>     ServerAdmin webmaster@localhost          DocumentRoot /var/www     <Directory />         Options FollowSymLinks         AllowOverride All     </Directory>     <Directory /var/www/>         Options Indexes FollowSymLinks MultiViews         AllowOverride All         Order allow,deny         allow from all     </Directory>          ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/     <Directory "/usr/lib/cgi-bin">         AllowOverride None         Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch         Order allow,deny         Allow from all     </Directory>          ErrorLog ${APACHE_LOG_DIR}/error.log          # Possible values include: debug, info, notice, warn, error, crit,     # alert, emerg.     LogLevel warn          CustomLog ${APACHE_LOG_DIR}/access.log combined          Alias /doc/ "/usr/share/doc/"     <Directory "/usr/share/doc/">         Options Indexes MultiViews FollowSymLinks         AllowOverride None         Order deny,allow         Deny from all         Allow from 127.0.0.0/255.0.0.0 ::1/128     </Directory>          </VirtualHost>      **default-ssl** :               <IfModule mod_ssl.c>     <VirtualHost _default_:443>     ServerAdmin webmaster@localhost          DocumentRoot /var/www     <Directory />         Options FollowSymLinks         AllowOverride All     </Directory>     <Directory /var/www/>         Options Indexes FollowSymLinks MultiViews         AllowOverride All         Order allow,deny         allow from all     </Directory>          ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/     <Directory "/usr/lib/cgi-bin">         AllowOverride None         Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch         Order allow,deny         Allow from all     </Directory>          ErrorLog ${APACHE_LOG_DIR}/error.log          # Possible values include: debug, info, notice, warn, error, crit,     # alert, emerg.     LogLevel warn          CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined          Alias /doc/ "/usr/share/doc/"     <Directory "/usr/share/doc/">         Options Indexes MultiViews FollowSymLinks         AllowOverride None         Order deny,allow         Deny from all         Allow from 127.0.0.0/255.0.0.0 ::1/128     </Directory>          #   SSL Engine Switch:     #   Enable/Disable SSL for this virtual host.     SSLEngine on          #   A self-signed (snakeoil) certificate can be created by installing     #   the ssl-cert package. See     #   /usr/share/doc/apache2.2-common/README.Debian.gz for more info.     #   If both key and certificate are stored in the same file, only the     #   SSLCertificateFile directive is needed.     SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem     SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key          #   Server Certificate Chain:     #   Point SSLCertificateChainFile at a file containing the     #   concatenation of PEM encoded CA certificates which form the     #   certificate chain for the server certificate. Alternatively     #   the referenced file can be the same as SSLCertificateFile     #   when the CA certificates are directly appended to the server     #   certificate for convinience.     #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt          #   Certificate Authority (CA):     #   Set the CA certificate verification path where to find CA     #   certificates for client authentication or alternatively one     #   huge file containing all of them (file must be PEM encoded)     #   Note: Inside SSLCACertificatePath you need hash symlinks     #         to point to the certificate files. Use the provided     #         Makefile to update the hash symlinks after changes.     #SSLCACertificatePath /etc/ssl/certs/     #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt          #   Certificate Revocation Lists (CRL):     #   Set the CA revocation path where to find CA CRLs for client     #   authentication or alternatively one huge file containing all     #   of them (file must be PEM encoded)     #   Note: Inside SSLCARevocationPath you need hash symlinks     #         to point to the certificate files. Use the provided     #         Makefile to update the hash symlinks after changes.     #SSLCARevocationPath /etc/apache2/ssl.crl/     #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl          #   Client Authentication (Type):     #   Client certificate verification type and depth.  Types are     #   none, optional, require and optional_no_ca.  Depth is a     #   number which specifies how deeply to verify the certificate     #   issuer chain before deciding the certificate is not valid.     #SSLVerifyClient require     #SSLVerifyDepth  10          #   Access Control:     #   With SSLRequire you can do per-directory access control based     #   on arbitrary complex boolean expressions containing server     #   variable checks and other lookup directives.  The syntax is a     #   mixture between C and Perl.  See the mod_ssl documentation     #   for more details.     #<Location />     #SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \     #            and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \     #            and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \     #            and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \     #            and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20       ) \     #           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/     #</Location>          #   SSL Engine Options:     #   Set various options for the SSL engine.     #   o FakeBasicAuth:     #     Translate the client X.509 into a Basic Authorisation.  This means that     #     the standard Auth/DBMAuth methods can be used for access control.  The     #     user name is the `one line' version of the client's X.509 certificate.     #     Note that no password is obtained from the user. Every entry in the user     #     file needs this password: `xxj31ZMTZzkVA'.     #   o ExportCertData:     #     This exports two additional environment variables: SSL_CLIENT_CERT and     #     SSL_SERVER_CERT. These contain the PEM-encoded certificates of the     #     server (always existing) and the client (only existing when client     #     authentication is used). This can be used to import the certificates     #     into CGI scripts.     #   o StdEnvVars:     #     This exports the standard SSL/TLS related `SSL_*' environment variables.     #     Per default this exportation is switched off for performance reasons,     #     because the extraction step is an expensive operation and is usually     #     useless for serving static content. So one usually enables the     #     exportation for CGI and SSI requests only.     #   o StrictRequire:     #     This denies access when "SSLRequireSSL" or "SSLRequire" applied even     #     under a "Satisfy any" situation, i.e. when it applies access is denied     #     and no other module can change it.     #   o OptRenegotiate:     #     This enables optimized SSL connection renegotiation handling when SSL     #     directives are used in per-directory context.     #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire     <FilesMatch "\.(cgi|shtml|phtml|php)$">         SSLOptions +StdEnvVars     </FilesMatch>     <Directory /usr/lib/cgi-bin>         SSLOptions +StdEnvVars     </Directory>          #   SSL Protocol Adjustments:     #   The safe and default but still SSL/TLS standard compliant shutdown     #   approach is that mod_ssl sends the close notify alert but doesn't wait for     #   the close notify alert from client. When you need a different shutdown     #   approach you can use one of the following variables:     #   o ssl-unclean-shutdown:     #     This forces an unclean shutdown when the connection is closed, i.e. no     #     SSL close notify alert is send or allowed to received.  This violates     #     the SSL/TLS standard but is needed for some brain-dead browsers. Use     #     this when you receive I/O errors because of the standard approach where     #     mod_ssl sends the close notify alert.     #   o ssl-accurate-shutdown:     #     This forces an accurate shutdown when the connection is closed, i.e. a     #     SSL close notify alert is send and mod_ssl waits for the close notify     #     alert of the client. This is 100% SSL/TLS standard compliant, but in     #     practice often causes hanging connections with brain-dead browsers. Use     #     this only for browsers where you know that their SSL implementation     #     works correctly.     #   Notice: Most problems of broken clients are also related to the HTTP     #   keep-alive facility, so you usually additionally want to disable     #   keep-alive for those clients, too. Use variable "nokeepalive" for this.     #   Similarly, one has to force some clients to use HTTP/1.0 to workaround     #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and     #   "force-response-1.0" for this.     BrowserMatch "MSIE [2-6]" \         nokeepalive ssl-unclean-shutdown \         downgrade-1.0 force-response-1.0     # MSIE 7 and newer should be able to use keepalive     BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown


I want to add the above date to each line on a prstat log file

I have a prstat log, as you all know the date and time is recorded on the top of the log file, I would like to add that date and time to the begging of each line until it gets to a new date, then I would do the same for that part of the log. Is this possible?, is there a way to do this through commands or a script, I would've created a script to do so, but it's too late as the data has already been collected.


How to do the ESCAPE + "_" shortcut in bash?

How can I set up my bash to replace `ESCAPE`+`_` with the last word from the previous command?


Cannot delete bridge - "bridge br0 is still up; can't delete it"

I have the same problem as this guy : Bring down and delete bridge interface that's up But that solution does not work for me. I remove all interfaces from the bridge using brctl delif . I then set the link to down using either ifconfig or ip. I then try to remove the bridge using brctl br0 "bridge br0 is still up; can't delete it". The platform is Raspbian on a Raspberry Pi. Any ideas? Identical output from ifconfig and ifconfig -a :               br0   Link encap:Ethernet  HWaddr 54:e6:fc:89:be:4b           inet6 addr: fe80::56e6:fcff:fe89:be4b/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:36 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0           RX bytes:0 (0.0 B)  TX bytes:6569 (6.4 KiB)          eth0  Link encap:Ethernet  HWaddr b8:27:eb:47:0d:a5           inet addr:192.168.2.29  Bcast:192.168.2.255  Mask:255.255.255.0           inet6 addr: fe80::ba27:ebff:fe47:da5/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:287 errors:0 dropped:0 overruns:0 frame:0           TX packets:389 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:25109 (24.5 KiB)  TX bytes:64247 (62.7 KiB)          lo    Link encap:Local Loopback           inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:16436  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)          mon.wlan1 Link encap:UNSPEC  HWaddr 54-E6-FC-89-BE-4B-00-00-00-00-00-00-00-00-00-00           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:277 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:62535 (61.0 KiB)  TX bytes:0 (0.0 B)          wlan0 Link encap:Ethernet  HWaddr 80:1f:02:84:f8:3f           UP BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:15 errors:0 dropped:17 overruns:0 frame:0           TX packets:7 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:3828 (3.7 KiB)  TX bytes:1294 (1.2 KiB)          wlan1 Link encap:Ethernet  HWaddr 54:e6:fc:89:be:4b           inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0           inet6 addr: fe80::56e6:fcff:fe89:be4b/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:104 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:0 (0.0 B)  TX bytes:21016 (20.5 KiB)


What's the best tool chain or single tool to transform a NTFS to ext[n] filesystem?

I've decided to go Linux only, finally! This also means that I have a bunch of disks still under NTFS. I don't have spare space anywhere to transfer the files to and then just re- format the drive so I need a tool, or tool chain, to make it on the disk itself. I imagine I could do it with some patience like this:   1. Defrag NTFS.   2. Shrink NTFS partition some percent.   3. Create ext[n] partition on left space.   4. Copy some files until ext[n] is full.   5. Shrink NTFS partition.   6. Grow etx[n] partition.   7. Copy files. and repeat 5, 6 and 7 until it's all transferred. It's a last resource path if I can't find any tool or tool-chain to do it automatically.


Alternative to DNS for internal servers

I am setting up my first network at work. All the servers are running CentOS 6.3 and have statically assigned IP addresses. For example:               server1 192.168.0.101     server2 192.168.0.102      I want to be able to type something at the command line like               $> ssh myuser@server1        The quickest solution is to edit the hosts file and after some research the preferred way seems to be running a DNS server. I think both solutions mean that I have to manually edit files but I would like my internal servers to auto-discover over UDP.   I could write something that runs a UDP service and updates the hosts file with new servers as they come online / get removed, but it seems like such a simple thing that it must exist already and I don't want to reinvent (this potentially dangerous) wheel, does anyone know of software that already does this?


How to fix the shifted function keys in vim in xterm in gnome-terminal?

When I hit the `<s-f2>` key to execute my `nnoremap <s-f2> :set number!` mapping Vim opens its "Insert" mode above (`O`) and types the `1;2Q` string. In order to see the entire terminal key code – not eaten up half-way by the "Normal" mode – I hit `<c-v><s-f2>` in "Insert" mode and get `^[O1;2Q`, where `^[` is the `<esc>` character. Even after reading the "Mapping fast keycodes in terminal Vim" I don't understand why the `^[O1;2Q` terminal key code is not mapped to the `<s-f1>` Vim code. Therefore I defined the following function in my `~/.vimrc` file:               function! s:Mod_fix_shift_fkey()       let a=0           let b='PQRS'           while a < 4             exec 'set <s-f' . (a + 1) . ">=\eO1;2" . b[a]             let a+=1           endwhile         endfunction      By calling it I fix the shifted function keys from `<s-f1>` to `<s-f4>` and the mapping bound to `<s-f2>` suddenly works. Can someone explain? Also I had to fix the shifted function keys from `<s-f5>` to `<s-f12>` like:                 "...       let a=5        let b='1517181920212324'        let c=0        while a < 16          exec 'set <s-f' . a . ">=\e[" . b[c : c + 1] . ';2~'          let a+=1          let c+=2       endwhile       "...      And from `<c-s-f1>` to `<c-s-f4>` and `<c-s-f5>` to `<c-s-f12>` the control- shifted function keys like:               " ...     exec 'map <esc>O1;6' . b[a] ' <c-s-f' . (a + 1) . '>'     " ...     exec 'map <esc>[' . b[c : c + 1] . ';6~ <c-s-f' . a . '>'     " ...


Montage together five gifs

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


How do I watch my webcams feed in linux

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


Linux distro installation on 64 bit processor

I am trying to install Ubuntu/Fedora 64 bit versions on my machine and they shout back saying my CPU does not support x86_64 bit architecture and forces me to use i686 versions. I am currently running Windows 7 64 bit version on my laptop. The processor is : Intel Centrino Core 2 Duo CPU T6500 @ 2.10 GHz I am hoping this is the right place to ask this question. Why is it that even though I have a 64 bit CPU, I am unable to install Linux 64 bit OS?


How can I disable the X-server on Fedora 17?

I want to use a Fedora 17 "Beefy Miracle" system as a network-shared desktop for cooperative work. For this I'm using TigerVNC which brings its own X-Server and starts a completely separate desktop session in it, which then is exposed via VNC. As I don't need the regular X-server I would like to completely disable it to free some resources and to enable the VNC desktop to a `$DISPLAY` of `0` . I have no experience using `systemd` and Fedora's service structure and therefore have no idea how to securely disable the service. I tried disabling `prefdm.service` which seems to be the peak of the iceberg, but I'm not allowed to do that because it's a `static` service, whatever that may actually mean.


SVN server with remote GUI administration

I have 2 Linux servers. One is Centos 5.5 another is Centos 6. I want to install SVN server on both server separately.   1. Can anyone tell me which svn server has a good remote administration GUI.   2. Also it's supported clients should be compatible with MAC and Windows systems. Both 1 and 2 are important Please suggest.


How do I change the drag and drop threshold in Linux? (I'm using Gnome 3)

I'm not sure if it's a gnome setting or something deeper into the Linux OS, but I'd like to change the drag and drop threshold. It happens too often on my clickable touchpad that I try clicking and it highlights text instead because I barely moved and it thinks I'm trying to drag. I need a threshold of like 5 pixels instead of what currently seems like 1 pixel. Where can I configure this behavior?


Some packets are flagged as INVALID by iptables

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


No such device: grub rescue

I have got a machine with Windows and Linux Mint. Now that I needed to upgrade my Mint because I needed the new fixes, I cannot boot. I get the error message `no such device, grub rescue`. My guess is that the disk id has been changed and grub cannot find it. I **do not remember** where I originally installed the grub. The output from `fdisk`:               Disk /dev/sda: 256.1 GB, 256060514304 bytes     255 heads, 63 sectors/track, 31130 cylinders, total 500118192 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x5e24ae5b             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT     /dev/sda2          206848   500115455   249954304    7  HPFS/NTFS/exFAT          Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x5e24ae82             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1   *        2048   929521663   464759808    7  HPFS/NTFS/exFAT     /dev/sdb2       929523710  1953523711   512000001    5  Extended     Partition 2 does not start on physical sector boundary.     /dev/sdb5       929523712  1887181915   478829102   83  Linux     /dev/sdb6      1887184896  1953523711    33169408   82  Linux swap / Solaris      I have searched the forums and ran the `grub-install` on `/dev/sdb1`. Still getting the same error. However, during startup when I change the boot disk to the second one (`/dev/sdb1`), I am able to boot, and even to the old Windows I had. My yet another guess is that if I do `grub-install` on `/dev/sda1`, it will fix my problem, but I am hesitating doing so because I cannot and must not lose data on that partition. So, my question is: Is it safe to do `grub-install /dev/sda`? How do I check if the old grub was installed there, the one that is not able to boot?


Disable Gnome on boot in Antergos

I use Antegos (a distribution based on Arch Linux) and I installed GNOME in my system.   * How can I disable GNOME running at system boot?   * After booting without GNOME, how can I start it again?


FFMPEG stream won't show up on Justin.tv

INRES="1366x768"                                            # input resolution     OUTRES="1366x768"                                           # Output resolution     FPS="35"                                                    # target FPS     QUAL="medium"                                               # one of the many FFMPEG preset on (k)ubuntu found in `/usr/share/ffmpeg`                                                                 # If you have low bandwidth, put the qual preset on 'fast' (upload bandwidth)                                                                 # If you have medium bandwitch put it on normal to medium     STREAM_KEY="Obviously I won't post my live key"   # This is your streamkey generated by jtv/twitch found at: http://www.justin.tv/broadcast/adv_other          ffmpeg -f x11grab -s "$INRES" -r "$FPS" -i :0.0+0,0 -itsoffset 00:00:01 \            -f alsa -ac 2 -i hw:0,0  -vcodec libx264 -preset "$QUAL" -s "$OUTRES" \            -acodec libmp3lame -ab 96k -threads 6 -qscale 5 -b:v 1024k -ar 44100 \            -f flv "rtmp://live.justin.tv/app/$STREAM_KEY"       This is what I have been using, but the stream won't screencast. Any help?


What is the terminal width by COLUMNS?

in `man bash`, I saw the environment variable `COLUMNS` is the terminal width. I played with its different values, but it doesn't seem to be the actual terminal width in terms of number of characters:               $ dpkg -l | grep mozilla     ii  rhythmbox-mozilla                      2.96-0ubuntu4.3                         Rhythmbox Mozilla plugin     ii  totem-mozilla                          3.0.1-0ubuntu21.1                       Totem Mozilla plugin     $ echo $COLUMNS     135     $ COLUMNS=13 dpkg -l | grep mozilla     ii  totem-mozilla  3.0.1-0ubuntu2 Totem Mozilla plugin     $ COLUMNS=1 dpkg -l | grep mozilla     ii  totem-mozilla  3.0.1-0ubuntu2 Totem Mozilla plugin     $ COLUMNS=100 dpkg -l | grep mozilla     ii  rhythmbox-mozilla   2.96-0ubuntu4.3     Rhythmbox Mozilla plugin     ii  totem-mozilla       3.0.1-0ubuntu21.1   Totem Mozilla plugin     $ COLUMNS=200 dpkg -l | grep mozilla     ii  rhythmbox-mozilla                            2.96-0ubuntu4.3                              Rhythmbox Mozilla plugin     ii  totem-mozilla                                3.0.1-0ubuntu21.1                            Totem Mozilla plugin      What is the terminal width by COLUMNS? Thanks.