Problems with Dell Wireless 5570 HSPA+ Mobile Broadband card

I've got a new Dell Latitude e7440, and a Dell Wireless 5570 HSPA+ mobile broadband card. I cannot get the broadband card to work. I can see the card:               # lshw       ....       *-network DISABLED            description: Ethernet interface            physical id: 1            logical name: wwan0            serial: 46:51:4c:75:9d:ad            capabilities: ethernet physical            configuration: broadcast=yes driver=cdc_mbim driverversion=22-Aug-2005 firmware=CDC MBIM link=no multicast=yes      And I can get rid of the DISABLED text:               # ifconfig wwan0 up     # ifconfig wwan0     wwan0     Link encap:Ethernet  HWaddr 46:51:4c:75:9d:ad                 inet6 addr: fe80::4451:4cff:fe75:9dad/64 Scope:Link               UP BROADCAST RUNNING NOARP MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:11 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 B)  TX bytes:3937 (3.9 KB)     # lshw       ....       *-network            description: Ethernet interface            physical id: 3            logical name: wwan0            serial: 46:51:4c:75:9d:ad            capabilities: ethernet physical            configuration: broadcast=yes driver=cdc_mbim driverversion=22-Aug-2005 firmware=CDC MBIM link=yes multicast=yes      But I cannot _use_ the card in any way.   * There's no `/dev/ttyUSBx` to which I could input AT commands.    * I cannot see a mobile broadband connection in the Network manager.    * tools like `mbim-network` simply say the connection to the modem failed My Dell BIOS version is `A10`, and from BIOS I can see the card. It's enabled and from that perspective there shouldn't be anything wrong with it. If I need to debug the driver, I'm willing to give that a try but I need some pointers on where to start. Any help is much appreciated Below is a list of debug output. Please ask for more in the comments if you think of anything that's helpful. * * * Here's `lsusb -v`:               # lsusb -v     Bus 002 Device 017: ID 413c:81a3 Dell Computer Corp.      Device Descriptor:       bLength                18       bDescriptorType         1       bcdUSB               2.00       bDeviceClass            0 (Defined at Interface level)       bDeviceSubClass         0        bDeviceProtocol         0        bMaxPacketSize0        64       idVendor           0x413c Dell Computer Corp.       idProduct          0x81a3        bcdDevice            0.06       iManufacturer           1 Sierra Wireless, Incorporated       iProduct                2 Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card       iSerial                 3        bNumConfigurations      2       Configuration Descriptor:         bLength                 9         bDescriptorType         2         wTotalLength          204         bNumInterfaces          4         bConfigurationValue     1         iConfiguration          0          bmAttributes         0xe0           Self Powered           Remote Wakeup         MaxPower              500mA         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        2           bAlternateSetting       0           bNumEndpoints           3           bInterfaceClass       255 Vendor Specific Class           bInterfaceSubClass      0            bInterfaceProtocol      0            iInterface              0            ** UNRECOGNIZED:  05 24 00 10 01           ** UNRECOGNIZED:  05 24 01 00 00           ** UNRECOGNIZED:  04 24 02 02           ** UNRECOGNIZED:  05 24 06 00 00           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x82  EP 2 IN             bmAttributes            3               Transfer Type            Interrupt               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x000c  1x 12 bytes             bInterval               9           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x01  EP 1 OUT             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        3           bAlternateSetting       0           bNumEndpoints           3           bInterfaceClass       255 Vendor Specific Class           bInterfaceSubClass      0            bInterfaceProtocol      0            iInterface              0            ** UNRECOGNIZED:  05 24 00 10 01           ** UNRECOGNIZED:  05 24 01 00 00           ** UNRECOGNIZED:  04 24 02 02           ** UNRECOGNIZED:  05 24 06 00 00           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x84  EP 4 IN             bmAttributes            3               Transfer Type            Interrupt               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x000c  1x 12 bytes             bInterval               9           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x83  EP 3 IN             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x02  EP 2 OUT             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        8           bAlternateSetting       0           bNumEndpoints           3           bInterfaceClass       255 Vendor Specific Class           bInterfaceSubClass    255 Vendor Specific Subclass           bInterfaceProtocol    255 Vendor Specific Protocol           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x86  EP 6 IN             bmAttributes            3               Transfer Type            Interrupt               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x000a  1x 10 bytes             bInterval               9           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x85  EP 5 IN             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x03  EP 3 OUT             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0             ** UNRECOGNIZED:  2c ff 42 49 53 54 00 01 07 f5 40 f6 00 00 00 00 01 f7 c4 09 02 f8 c4 09 03 f9 88 13 04 fa 10 27 05 fb 10 27 06 fc c4 09 07 fd c4 09         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        0           bAlternateSetting       0           bNumEndpoints           2           bInterfaceClass       255 Vendor Specific Class           bInterfaceSubClass    255 Vendor Specific Subclass           bInterfaceProtocol    255 Vendor Specific Protocol           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x87  EP 7 IN             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x04  EP 4 OUT             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0       Configuration Descriptor:         bLength                 9         bDescriptorType         2         wTotalLength           82         bNumInterfaces          2         bConfigurationValue     2         iConfiguration          0          bmAttributes         0xe0           Self Powered           Remote Wakeup         MaxPower              500mA         Interface Association:           bLength                 8           bDescriptorType        11           bFirstInterface        12           bInterfaceCount         2           bFunctionClass          2 Communications           bFunctionSubClass      14            bFunctionProtocol       0            iFunction               0          Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber       12           bAlternateSetting       0           bNumEndpoints           1           bInterfaceClass         2 Communications           bInterfaceSubClass     14            bInterfaceProtocol      0            iInterface              0            CDC Header:             bcdCDC               1.10           CDC MBIM:             bcdMBIMVersion       1.00             wMaxControlMessage   4096             bNumberFilters       16             bMaxFilterSize       128             wMaxSegmentSize      4064             bmNetworkCapabilities 0x20               8-byte ntb input size           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x82  EP 2 IN             bmAttributes            3               Transfer Type            Interrupt               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0040  1x 64 bytes             bInterval               9         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber       13           bAlternateSetting       0           bNumEndpoints           0           bInterfaceClass        10 CDC Data           bInterfaceSubClass      0 Unused           bInterfaceProtocol      2            iInterface              0          Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber       13           bAlternateSetting       1           bNumEndpoints           2           bInterfaceClass        10 CDC Data           bInterfaceSubClass      0 Unused           bInterfaceProtocol      2            iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x01  EP 1 OUT             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0     Device Qualifier (for other device speed):       bLength                10       bDescriptorType         6       bcdUSB               2.00       bDeviceClass            0 (Defined at Interface level)       bDeviceSubClass         0        bDeviceProtocol         0        bMaxPacketSize0        64       bNumConfigurations      2     Device Status:     0x0000       (Bus Powered)      And the `usb-devices` output for the modem:               # usb-devices     T:  Bus=02 Lev=01 Prnt=01 Port=06 Cnt=02 Dev#= 17 Spd=480 MxCh= 0     D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  2     P:  Vendor=413c ProdID=81a3 Rev=00.06     S:  Manufacturer=Sierra Wireless, Incorporated     S:  Product=Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card     C:  #Ifs= 2 Cfg#= 2 Atr=e0 MxPwr=500mA     /usr/bin/usb-devices: line 79: printf: c: invalid number     I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim     /usr/bin/usb-devices: line 79: printf: d: invalid number     I:  If#= 0 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim      Here's the `rfkill`-information:               # cat /sys/kernel/debug/dell_laptop/rfkill     status: 0x1015D     Bit 0 : Hardware switch supported:   1     Bit 1 : Wifi locator supported:      0     Bit 2 : Wifi is supported:           1     Bit 3 : Bluetooth is supported:      1     Bit 4 : WWAN is supported:           1     Bit 5 : Wireless keyboard supported: 0     Bit 8 : Wifi is installed:           1     Bit 9 : Bluetooth is installed:      0     Bit 10: WWAN is installed:           0     Bit 16: Hardware switch is on:       1     Bit 17: Wifi is blocked:             0     Bit 18: Bluetooth is blocked:        0     Bit 19: WWAN is blocked:             0          hwswitch_state: 0x1F     Bit 0 : Wifi controlled by switch:      1     Bit 1 : Bluetooth controlled by switch: 1     Bit 2 : WWAN controlled by switch:      1     Bit 7 : Wireless switch config locked:  0     Bit 8 : Wifi locator enabled:           0     Bit 15: Wifi locator setting locked:    0      This is what you can see via `dmesg` whenever the device is enabled:               [ 2101.897753] usb 2-7: new high-speed USB device number 17 using xhci_hcd     [ 2102.026467] usb 2-7: config 1 has an invalid interface number: 8 but max is 3     [ 2102.026480] usb 2-7: config 1 has no interface number 1     [ 2102.026926] usb 2-7: config 2 has an invalid interface number: 12 but max is 1     [ 2102.026930] usb 2-7: config 2 has an invalid interface number: 13 but max is 1     [ 2102.026941] usb 2-7: config 2 has an invalid interface number: 13 but max is 1     [ 2102.026942] usb 2-7: config 2 has no interface number 0     [ 2102.026943] usb 2-7: config 2 has no interface number 1     [ 2102.027618] usb 2-7: New USB device found, idVendor=413c, idProduct=81a3     [ 2102.027621] usb 2-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3     [ 2102.027623] usb 2-7: Product: Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card     [ 2102.027624] usb 2-7: Manufacturer: Sierra Wireless, Incorporated     [ 2102.029821] cdc_mbim 2-7:2.12: cdc-wdm0: USB WDM device     [ 2102.029954] cdc_mbim 2-7:2.12 wwan0: register 'cdc_mbim' at usb-0000:00:14.0-7, CDC MBIM, 46:51:4c:75:9d:ad      `nmcli` output:               # nmcli nm status     RUNNING         STATE           WIFI-HARDWARE   WIFI       WWAN-HARDWARE   WWAN           running         connected       enabled         enabled    enabled         enabled         This is what I get when I try to start it with `mbim-network`:               # mbim-network /dev/cdc-wdm0 start     Querying subscriber ready status 'mbimcli -d /dev/cdc-wdm0 --query-subscriber-ready-status --no-close'...     error: couldn't open the MbimDevice: Failure          Querying registration state 'mbimcli -d /dev/cdc-wdm0 --query-registration-state --no-open= --no-close'...     error: invalid transaction ID specified:           Attaching to packet service with 'mbimcli -d /dev/cdc-wdm0 --attach-packet-service --no-open= --no-close'...     error: invalid transaction ID specified:      Starting network with 'mbimcli -d /dev/cdc-wdm0 --connect= --no-open= --no-close'...     error: invalid transaction ID specified:      Network start failed      The driver should be OK, grepping for the vendor and product id combination from `modprobe` output:               # modprobe -c | grep -i 413c.*81a3     alias usb:v413Cp81A3d*dc*dsc*dp*ic*isc*ip*in00* qcserial     alias usb:v413Cp81A3d*dc*dsc*dp*ic*isc*ip*in02* qcserial     alias usb:v413Cp81A3d*dc*dsc*dp*ic*isc*ip*in03* qcserial     alias usb:v413Cp81A3d*dc*dsc*dp*ic*isc*ip*in08* qmi_wwan      Here's my linux version. I'm running a modified kernel due to a multiheading docking station problem, but this modem issue occurs identically on the 3.13 kernel which was the default when I installed ubuntu 14.04.               # uname -a     Linux slartibartfast 3.15.0-rc8+ #5 SMP Mon Jul 21 14:18:58 EEST 2014 x86_64 x86_64 x86_64 GNU/Linux      Using `libqmi` and `qmicli`, I get some interaction with the modem, but still some fairly confusing error messages. I have not yet had time to look into this further.               $ sudo qmicli -d /dev/cdc-wdm0 --verbose --wds-start-network= --client-no-release-cid     [27 elo 2014, 12:41:16] [Debug] QMI Device at '/dev/cdc-wdm0' ready     [27 elo 2014, 12:41:16] [Debug] [/dev/cdc-wdm0] Assuming service 'wds' is supported...     [27 elo 2014, 12:41:16] [Debug] [/dev/cdc-wdm0] Allocating new client ID...     [27 elo 2014, 12:41:16] [Debug] [/dev/cdc-wdm0] Sent message...     <<<<<< RAW:     <<<<<<   length = 16     <<<<<<   data   = 01:0F:00:00:00:00:00:01:22:00:04:00:01:01:00:01          [27 elo 2014, 12:41:16] [Debug] [/dev/cdc-wdm0] Sent message (translated)...     <<<<<< QMUX:     <<<<<<   length  = 15     <<<<<<   flags   = 0x00     <<<<<<   service = "ctl"     <<<<<<   client  = 0     <<<<<< QMI:     <<<<<<   flags       = "none"     <<<<<<   transaction = 1     <<<<<<   tlv_length  = 4     <<<<<<   message     = "Allocate CID" (0x0022)     <<<<<< TLV:     <<<<<<   type       = "Service" (0x01)     <<<<<<   length     = 1     <<<<<<   value      = 01     <<<<<<   translated = wds          [27 elo 2014, 12:41:16] [Debug] [/dev/cdc-wdm0] Received message...     >>>>>> RAW:     >>>>>>   length = 24     >>>>>>   data   = 01:17:00:80:00:00:01:01:22:00:0C:00:02:04:00:00:00:00:00:01:02:00:01:08          [27 elo 2014, 12:41:16] [Debug] [/dev/cdc-wdm0] Received message (translated)...     >>>>>> QMUX:     >>>>>>   length  = 23     >>>>>>   flags   = 0x80     >>>>>>   service = "ctl"     >>>>>>   client  = 0     >>>>>> QMI:     >>>>>>   flags       = "response"     >>>>>>   transaction = 1     >>>>>>   tlv_length  = 12     >>>>>>   message     = "Allocate CID" (0x0022)     >>>>>> TLV:     >>>>>>   type       = "Result" (0x02)     >>>>>>   length     = 4     >>>>>>   value      = 00:00:00:00     >>>>>>   translated = SUCCESS     >>>>>> TLV:     >>>>>>   type       = "Allocation Info" (0x01)     >>>>>>   length     = 2     >>>>>>   value      = 01:08     >>>>>>   translated = [ service = 'wds' cid = '8' ]          [27 elo 2014, 12:41:16] [Debug] [/dev/cdc-wdm0] Registered 'wds' (version unknown) client with ID '8'     [27 elo 2014, 12:41:16] [Debug] Asynchronously starting network...     [27 elo 2014, 12:41:16] [Debug] [/dev/cdc-wdm0] Sent message...     <<<<<< RAW:     <<<<<<   length = 13     <<<<<<   data   = 01:0C:00:00:01:08:00:01:00:20:00:00:00          [27 elo 2014, 12:41:16] [Debug] [/dev/cdc-wdm0] Sent message (translated)...     <<<<<< QMUX:     <<<<<<   length  = 12     <<<<<<   flags   = 0x00     <<<<<<   service = "wds"     <<<<<<   client  = 8     <<<<<< QMI:     <<<<<<   flags       = "none"     <<<<<<   transaction = 1     <<<<<<   tlv_length  = 0     <<<<<<   message     = "Start Network" (0x0020)          [27 elo 2014, 12:41:16] [Debug] [/dev/cdc-wdm0] Received message...     >>>>>> RAW:     >>>>>>   length = 32     >>>>>>   data   = 01:1F:00:80:01:08:02:01:00:20:00:13:00:02:04:00:01:00:0E:00:10:02:00:03:00:11:04:00:03:00:D1:07          [27 elo 2014, 12:41:16] [Debug] [/dev/cdc-wdm0] Received message (translated)...     >>>>>> QMUX:     >>>>>>   length  = 31     >>>>>>   flags   = 0x80     >>>>>>   service = "wds"     >>>>>>   client  = 8     >>>>>> QMI:     >>>>>>   flags       = "response"     >>>>>>   transaction = 1     >>>>>>   tlv_length  = 19     >>>>>>   message     = "Start Network" (0x0020)     >>>>>> TLV:     >>>>>>   type       = "Result" (0x02)     >>>>>>   length     = 4     >>>>>>   value      = 01:00:0E:00     >>>>>>   translated = FAILURE: CallFailed     >>>>>> TLV:     >>>>>>   type       = "Call End Reason" (0x10)     >>>>>>   length     = 2     >>>>>>   value      = 03:00     >>>>>>   translated = generic-no-service     >>>>>> TLV:     >>>>>>   type       = "Verbose Call End Reason" (0x11)     >>>>>>   length     = 4     >>>>>>   value      = 03:00:D1:07     >>>>>>   translated = [ type = 'cm' reason = '2001' ]          error: couldn't start network: QMI protocol error (14): 'CallFailed'     call end reason (3): generic-no-service     verbose call end reason (3,2001): [cm] no-service     [/dev/cdc-wdm0] Client ID not released:         Service: 'wds'             CID: '8'     [27 elo 2014, 12:41:16] [Debug] [/dev/cdc-wdm0] Unregistered 'wds' client with ID '8'     [27 elo 2014, 12:41:16] [Debug] Client released      I can also set my pin code with `qmcli`:               # qmicli --dms-uim-verify-pin=PIN,xxxx -d /dev/cdc-wdm0     [/dev/cdc-wdm0] PIN verified successfully      And get some information:               # qmicli -d /dev/cdc-wdm0 --dms-get-manufacturer      [/dev/cdc-wdm0] Device manufacturer retrieved:         Manufacturer: 'Sierra Wireless, Incorporated'          # qmicli -d /dev/cdc-wdm0 --dms-get-model     [/dev/cdc-wdm0] Device model retrieved:         Model: 'MC8805'          # qmicli -d /dev/cdc-wdm0 --dms-get-capabilities     [/dev/cdc-wdm0] Device capabilities retrieved:         Max TX channel rate: '5742000'         Max RX channel rate: '42200000'                Data Service: 'non-simultaneous-cs-ps'                         SIM: 'supported'                    Networks: 'gsm, umts'


Bash script to remove user

I need to create a Bash script to remove a user.   We use RHEL version 4, 5, & 6.   Lets say usernames are Ray4 & Ray6 & the script name is deal.   Specific tasks for this script are:   1. Does the user exist ?   2. If user exists, backup /homedirectory for this user, remove username and place in /root/DeletedUsers   3. If /root/DeletedUsers directory doesn't exist, create it.    4. If any firewall rules exist for this user, email me the results for those rules and on which nodes.    5. If this user exists in sudoers, don't delete, but comment out.  This is what I have so far. I want to make sure this works, before I run it in RHN Satellite. After making the suggested changes. Here are the new errors I am getting now.               [root@localhost bin]# ./deal     ./deal: line 7: [[!: command not found     Usage: userdel [options] LOGIN          Options:       -f, --force                   force removal of files,                                     even if not owned by user       -h, --help                    display this help message and exit       -r, --remove                  remove home directory and mail spool       -Z, --selinux-user            remove SELinux user from SELinux user mapping          Usage: userdel [options] LOGIN          Options:       -f, --force                   force removal of files,                                     even if not owned by user       -h, --help                    display this help message and exit       -r, --remove                  remove home directory and mail spool       -Z, --selinux-user            remove SELinux user from SELinux user mapping          Null message body; hope that's ok     ./deal: line 22: [: -me: binary operator expected                    This is source code:                    [root@localhost bin]# cat -n deal           1  #!/bin/bash      2        3  count=$(egrep -c Ray[46] /etc/passwd)      4  firewall=$(grep -c "192.168.5.5" /etc/sysconfig/iptables)      5  doers=$(egrep -c Ray[46] /etc/sudoers)      6        7  if [[! -d /root/DeletedUsers]]      8  then mkdir /root/DeletedUsers      9       10  fi     11       12  cp -Rf /home/Ray[46] /root/DeletedUsers     13  userdel -rf Ray [4]     14  userdel -rf Ray [6]     15       16  if [ $firewall -ne 0 ]     17       18  then mail -s "$firewallrulesexist" emailaddress < /dev/null     19       20  fi     21       22  if [ $doers -me 0 ]     23  then sed ^Ray[46] /#/i     24       25  EOF     26  fi


How to empty a log file?

Currently my log files get very big. Is there a command to empty the files without delete and restore it? It involves 2 command which is sometimes taking too long.


Which Unix tool for Pixel-art -generation?

I have had problems to generate pixel art for a game where units are of specific sizes such as 55x55 (not geometry but by pixels i.e. 55 pixels by 55 pixels). I have tried Gimp where I have misread many-times the sizes with the select tool -- it is irritating to get a bit too distorted size. Then I have used Inkscape that works actually quite good -- you generate the vector-image and select it and then you go to `"Export to bitmap"` where you can specify the size (this same feature is probably also in Blender, probably as easy). Anyway I am looking for something more powerful like having helper color- palettes easily or automatically-done perhaps like here with Gimp. I can find a variety of tools mentioning pixels but I hope you to point out the best before trying all of them.               $ apt-cache search pixel|wc          99     861    6029      > **Perhaps related** > >   1. http://graphicdesign.stackexchange.com/questions/7860/how-can-i-adjoin- > images-with-imagemagick-for-pixel-art > >   2. Some example with Photoshop here, create pixel art by reusing basic > things such as hands, hairs and bodies (create separate files for them). > >   3. A pixel-art competition here. > >   4. Using blender for generating stuff here programmatically. > >


How to actually test locale

So I know what locale does. Sets the output format of certain programs depending on what country/language you're in, for example 1000000 can be formatted like 1,000,000.00 1 000 000.00 1.000.000,00 and a variety of others on output. But is there a program to literally test this so that I could do `export LC_ALL=en_GB.utf8` vs `export LC_ALL=en_US.utf8` and observe different output?


Install pandas for python3 on Fedora 20

The Fedora project lists a package called python3-pandas. When I enter `sudo yum install python3-pandas` I get the message `No package python3-pandas available.`. How can I install this package? I am accessing a Fedora 20 machine via ssh. `yum repolist`:               repo id                             repo name     fedora/20/x86_64                    Fedora 20 - x86_64     rpmfusion-free/20/x86_64            RPM Fusion for Fedora 20 - Free     rpmfusion-free-updates/20/x86_64    RPM Fusion for Fedora 20 - Free - Updates     rpmfusion-nonfree/20/x86_64         RPM Fusion for Fedora 20 - Nonfree     rpmfusion-nonfree-updates/20/x86_64 RPM Fusion for Fedora 20 - Nonfree - Updates     updates/20/x86_64                   Fedora 20 - x86_64 - Updates


Custom access/launcher

I'm not sure what to call what I want, so I'll just describe what I want to do. What I'm doing is setting up an old laptop, with gentoo, for my kids. I want to have some program on there that, with a password, gives access to do homework, to play games for 30 min, watch netflix for an hour, etc. I can't imagine that there already exists a program that can do that, but it would be less work for me if there was. So I will have to make this launcher program. My question is this, after I make such a program, how do I make it so this program is running at start up and no other programs can be ran from any menus or anything. I have not decided which window manager to use yet. Is there a lite window manager that would help me accomplish this task?


VMO Changes After Adding New RAM To AIX?

We have a server at a client site running AIX 5.3, which we just up the RAM to 32GB, from initially 16GB (if I'm not mistaken). This server is our Application server running J2EE applications on top of Oracle Internet Application Server. Recently we encountered one of the batch jobs hitting out of memory error. From NMON I see that on average, there's 5GB of free memory available. `%MAXPERM` is set to '15' and `%MINPERM` is '5'. `lru_file_repage` is '0'. `%comp` is around '70' and `%numperm` is '15'. I would like to ask:   1. After adding real memory to the server, is there any additional changes we need to do to the VMO?   2. Is the `%MAXPERM` too low?


I'm running qemu's like this:               $ sudo qemu -boot d -m 1024 \     -netdev tap,id=tap0 \     -device virtio-net-pci,netdev=tap0,id=vth0 \     -drive file=ubuntu.iso,media=cdrom,cache=none,if=ide \     -monitor pty \     -serial pty \     -parallel none \     -nographic      When I check `/dev/pts/`:               $ sudo lsof +d /dev/pts/      Qemu pty's do not show up, although they do work using for example:               $ sudo screen /dev/pts/8      How can I figure out which pty's are from which qemu?


Collapse repeating characters

Is there a more Bashist way than `echo "$PWD//" | sed -e 's#//\\+#/#g'` to replace repeating slashes with a single one? Thanks Steven D, now there's a fully working function to find the _longest common path of two or more paths_ : path_common.


Disabling readahead with hdparm or POSIX_FADV_RANDOM

From Linux kernel's doc the advice POSIX_FADV_RANDOM seems to disable readahead. But whent I disable Readhead using (sudo hdparm -A 0 /dev/sdb) I get huge degradation in performances; also noticed that read(2) seems to get split every 512k and acts as separate calls (Not sure about the reason, may be the max sector per request). So which option really disables the read-ahead? Does POSIX_FADV_RANDOM also disable OS caching, or shall I add a POSIX_FADV_DONTNEED.


Dynamically reformatting man pages on terminal dimension changes

One common workflow of mine is to open a manual page in a terminal, then another terminal in which to test things. The man page is formatted to the initial dimensions of the first terminal. When I now resize my windows (or have my WM do that for me automatically), there is either a gap to the right of the preformatted page, or lines wrap. At this point I usually `q`(uit) and `!!` (run again), which loses my position in the page. I assume the formatting process is quite CPU intensive, or maybe it stems from ancient times of fixed terminal sizes. The `less` pager dynamically reacts to terminal resize events, so it should be possible in theory. I tried perusing man pages, searching the Web, asking on IRC -- the whole lot -- but couldn't come up with anything.   * Can I trigger reformatting from within or outside of the man utility?   * Is there a version of the man utility that resizes the page dynamically?    * Is there way to customize some part of the formatting/display process to make it update on `SIGWINCH`?


Perl script, do cd on terminal

In Script to change current directory (cd, pwd) it is shown how to run a bash script that changes terminal directory. But how do i run a perl script that runs a bash script that changes terminal directory?


Scientific Linux 6.3 hangs on suspend if using a samba share

I have several notebooks running Scientific Linux 6.3. The suspend function is working quite well, except for one problem: When a notebook mounts a Samba share, plays a few videos through this share then the suspend function stops working, and the notebook suddenly needs _5_ minutes to suspend. Again, this problem only occurs if they watched videos over the samba share. **QUESTION** : WHY? does samba keeps something open and need a timeout of 5 minutes, just after the suspend function has been involved or what? Any suggestions on where to look to find out what's going on would be appreciated. Or a way for I could write a bash script to check when is the suspend button pressed so that I could do xy* thing to the machine. (*xy=anything that corrects this problem)


Remove last comma from a bash for loop generated string

I am dealing with a situation where I need to create a comma separated list from an array into a heredoc and remove the last comma. I am using bash `for` piped into `sed` which is erasing all commas instead of the last one. A simplified example is as follows:               x=$(for i in a b c; do echo "${i}",; done| sed 's/,$//')     echo $x     a b c      Desired output:               a, b, c      Any suggestions appreciated.


Why can rm remove read-only files?

If I create a file and then change its permissions to `444` (read-only), how come `rm` can remove it? If I do this:               echo test > test.txt     chmod 444 test.txt     rm test.txt      ...`rm` will ask if I want to remove the write-protected file `test.txt`. I would have expected that `rm` can not remove such a file and that I would have to do a `chmod +w test.txt` first. If I do `rm -f test.txt` then `rm` will remove the file without even asking, even though it's read-only. Can anyone clarify? I'm using Ubuntu 12.04/bash.


Minimum file permissions to delete a file

To delete a file in Linux: What minimal permissions do we need to set on it? What minimal permissions do we need to set on its parent directory?


Missed get command of FTP

I am using AIX 7.1. I made some shell scripts8 and called /bin/bsh. Inside the script, I connect to a server via FTP and have many get commands because I would like to avoid the wildcard problem. I just declare every filename and get them one by one, for example:               get PDF_02378230_20110609.PDF     get PDF_02432482_20110609.PDF     get PDF_02432565_20110609.PDF     get PDF_02432573_20110609.PDF     get PDF_02432581_20110609.PDF     get PDF_02432599_20110609.PDF     get PDF_02432607_20110609.PDF     get PDF_02432615_20110609.PDF     get PDF_02432623_20110609.PDF     get PDF_02432649_20110609.PDF     get PDF_02432656_20110609.PDF     get PDF_02432672_20110609.PDF     get PDF_02432755_20110609.PDF     get PDF_02432763_20110609.PDF     get PDF_02432821_20110609.PDF     get PDF_02432920_20110609.PDF     get PDF_02433175_20110609.PDF     get PDF_02433266_20110609.PDF     get PDF_02433290_20110609.PDF     get PDF_02433308_20110609.PDF     get PDF_02433373_20110609.PDF     get PDF_02433399_20110609.PDF      There could be up to 100000 files to be transfer in 1 shell scripts. I would run these shell scripts and let them ftp the files down. But in some shell script there are 1 or 2 missing files not been "get". For example, when I count the number of files, there might be 1 or 2 less files than the number of "get" command in the shell script. I cannot found an exception or error inside the log. The truth is, I cannot go through the whole log line by line because it is too long. But I have found which file was missing, and I tried to search the log file with the missing filename, and I cannot found any trace of that filename.


Why is "Asking all remaining processes to terminate" failing during shutdown?

I installed Debian 7. Sometimes when I quick X and type `sudo shutdown -h now`, it says, `Asking all remaining processes to terminate`, then after a few seconds, it prints a long list of processes, then it says that it failed to stop them, then the computer powers off.   * The computer was only recently installed.   * I have had the same distribution on this computer and on other computers, installed in the same manner, but never encountered this before. Is this problem serious? If so, what could be causing it?


Concern about logging in as root overrated?

For personal linux on my personal notebooks, I've usually set my environment to **autologin as root** even under X or lower runlevels. I've found my workflow is very pleasant and fast, without any cumbersome need to type `su` or `sudo` or being asked by keyring or auth or something. So far I've never had any problem with it, so **why are most people freaking out about it?** Is the concern overrated? Of course this assumes the user knows what they are doing and doesn't really care about system reliability and security issues.


autofs with sshfs not working anymore

I just upgraded from Ubuntu 12.04 to 12.10. Before that I backed up my autofs config which worked fine. I appended the line from my old `/etc/auto.master` to the new one:               +dir:/etc/auto.master.d     +auto.master     /mnt /etc/auto.sshfs uid=1000,gid=1000,--timeout=30,--ghost,--verbose      my `/etc/auto.sshfs` looks like this:               mymount -fstype=fuse,rw,nodev,nonempty,noatime,allow_other,max_read=65536 :sshfs\#myuser@mydomain:/mnt/mymount      Trying this manually I got `Connetion reset by peer` so I added the option `IdentityFile=/home/myuser/.ssh/id_rsa`. Now this happens when I try to access `/mnt` (both with manual and autofs):               myuser@laptop /mnt % la     ls: cannot access mymount: No such file or directory     total 4     drwxr-xr-x  3 root root    0 Oct 19 10:34 ./     drwxr-xr-x 25 root root 4096 Oct 18 23:17 ../     d?????????  ? ?    ?       ?            ? mymount/      The relevant entries from my `/var/log/syslog` are this:               Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: lookup(program): lookup for mymount failed     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: attempting to mount entry /mnt/mymount     Oct 19 00:17:56 laptop automount[1250]: failed to mount /mnt/mymount     Oct 19 00:18:01 laptop automount[1250]: attempting to mount entry /mnt/.hidden     Oct 19 00:18:01 laptop automount[1250]: lookup(program): lookup for .hidden failed     Oct 19 00:18:01 laptop automount[1250]: failed to mount /mnt/.hidden     Oct 19 00:18:03 laptop automount[1250]: attempting to mount entry /mnt/.hidden     Oct 19 00:18:03 laptop automount[1250]: failed to mount /mnt/.hidden     Oct 19 00:18:03 laptop automount[1250]: attempting to mount entry /mnt/.hidden     Oct 19 00:18:03 laptop automount[1250]: failed to mount /mnt/.hidden     Oct 19 00:18:24 laptop automount[1250]: attempting to mount entry /mnt/.hidden     Oct 19 00:18:24 laptop automount[1250]: failed to mount /mnt/.hidden     Oct 19 00:21:57 laptop automount[1250]: umount_autofs_indirect: ask umount returned busy /mnt     Oct 19 00:21:59 laptop automount[1250]: shut down path /mnt     Oct 19 00:21:59 laptop automount[3436]: mounted indirect on /mnt with timeout 30, freq 8 seconds     Oct 19 00:21:59 laptop automount[3436]: ghosting enabled      I already checked the UID and GID and they match my user. SSH keys for my user are in place. I also tried to create `/mnt/mymount` manually but strangely it returns "permissions denied" even as root as long as autofs is running (guess it should be this way). Any ideas what might be wrong? There must by a configuration step I forgot which I did before.


Where does gnome-session/gnome-shell store its configuration?

Long story short; I have a debian system that's been running the `unstable` tree for over a decade straight (through fire, flames, and multiple hardware upgrades, but that aside). However, a while ago while Debian was transitioning to gnome3 and the `gnome-shell` desktop there were a couple of hitches in the process, and one or another of those left my regular user with an unusable configuration -- `gnome-shell` starts up and immediately crashes. I tried setting up a completely blank new user, and everything runs fine for that one, so it's definitely an issue with a setting local to my main user somewhere... It's just that I have no idea where to start looking, and I don't want to blanket erase all configuration files because I kind of need the vast majority of them. So instead I'm looking to surgically remove all the configuration files and/or options that pertain to `gnome-shell` and let it rebuild them from scratch when I start it, then work from there. **EDIT** : My bad, slight naming fail. The problem seems to be in `gnome- shell` rather than `gnome-session`.


Why do I get dropped into a GRUB rescue console?

I've been setting up my environment on a fedora 20 64bit, the last week. After a restart tonight I am unable to boot into my system. It boots into this terminal/prompt and it says:                [ Minimal bash-like editing is supported. For the first word, TAB lists possible completions of a device/filename. ]          grub>      I've tried to rescue the system, with the dvd, but no luck. I'm a noob, and could really need some help on this. I have installed a lot of software and I would rather not have to do it for the third time this week, last crash was because I installed grub2 and made some configurations, to include xen hypervisor support in the bootup forgetting to turn "Secure boot" off in the bios. Can anyone tell me what to do? What I can do. EDIT: This is not a duplicate, I installed the system some days ago, and had a working grub, mount of drives and so on. **It was after changes(installing software, configuring the system) that I got dropped into this prompt** I used the other answer to find the solution, I didn't follow it in it's entirety.


Does BitTorrent work in the background after quitting qBitTorrent?

Recently I installed qBitTorrent so I could download some episodes of a Creative Commons-licensed TV series. I simply used `apt-get install qbittorrent`, ran `qbittorrent`, then added the torrent files, and pressed "start". I noticed that the series would take too long to download, so I quit qBitTorrent when it was at 10%. The next day, I launched qBitTorrent again, and was surprised to find the downloads complete. Either the 2.5 GBs downloaded within 3 seconds or something else occurred. Does BitTorrent continue to exchange files after starting the download in qBitTorrent and then quitting qBitTorrent?


How do I make Iceweasel\Firefox only display images on specified sites?

Summary: In Iceweasel (it's effectively Firefox), I want to block all images, but allow images on websites I specify. But the standard method to do this is not working. The way you're supposed to be able to do this is as follows. In Iceweasel, select Edit/Preferences/Content and UNCHECK LoadImagesAutomatically. Select Exceptions, enter a website name, select "Allow". Now, Iceweasel should display images for websites with the "Allow" designaton, but not for any other site. But images are NOT displayed on the "Allowed" sites. NO images are shown on any sites. And I've got the NoScript extension disabled. I have no other extensions. Am I doing something wrong? If I have to use a workround, I don't want an extension that just toggles images on and off. I want to have images blocked by default, and only allow them on sites I choose. Many thanks if you have a solution. Full Details: I'm using Iceweasel 10.0.4. Is this an Iceweasel bug? Is there a workround? CHECKING LoadImagesAutomatically does display images on all sites as you'd expect.


Merge files using zipper method / late merge

I am searching for a nice method of merging two or more files line by line using the zipper method (also called late merge). Assuming we have three files, the result should look like this:               line1 file1     line1 file2     line1 file3     line2 file1     line2 file2     line2 file3     ...      **EDIT** I wrote a little python script capable of doing this:               #!/usr/bin/python          import sys, itertools          fileList = []     for file in sys.argv[1:]:         f = open(file, "r")         fileList.append(f.read().split("\n"))          for z in itertools.izip_longest(*fileList):         print "\n".join([i for i in z if i is not None])      I still wonder if there is any standard tool or a clever combination of them doing the same thing.


How to implement a horizontal cat?

Standard `cat` concatenates files line by line (row by row, if you will). I find myself needing a _horizontal_ `cat` command more and more often recently; i.e. a command that takes a list of files and concatenates them horizontally, column by column. So far I’ve used ad-hoc workarounds but I’d like to know if there exists a good solution for this. To clarify, consider the following comparison between `cat` and `hcat` of two files:               $ cat a.dat 1.dat     a b     c d     1 2     3 4     $ hcat -s ' ' a.dat 1.dat     a b 1 2     c d 3 4      (Unlike for `cat` we need to specify a separator since by convention UNIX files don’t have a column separator at the end.)


Editing a sequence of fields in vim

I have a file like this:               INSERT INTO `example`     (`name`, `location`, `height`)     VALUES     ('A', '', ''),     ('B', '', ''),     ('C', '', '');      I want to fill in the middle set of quote marks (the ones under `location`) so that I end up with               INSERT INTO `example`     (`name`, `location`, `height`)     VALUES     ('A', 'one',   ''),     ('B', 'two',   ''),     ('C', 'three', '');      What's a good way to do that? Aligning the third column of quotes isn't necessary, but preferred.


Why can't tar extract .zip files?

I tried a majority of the formats (gzip, etc.) to extract a zip file with `tar`, and when I became frustrated enough to Google for it, I found no way to extract a zip file with `tar` and only recommendations to use `zip` or `unzip`. As a matter of fact, my Linux system doesn't even have a `zip` utility, but only `unzip` (leaving me to wonder why this is the main recommended option). Of course `unzip` worked, solving my problem, but why can't `tar` extract zip files? Perhaps I should instead be asking, what is the difference between zip and the compression methods supported by `tar`?


The NTFS partition is in an unsafe state

I try to mount a NTFS partition in nautilus, and it refuse to mount it and suggests `resume and shutdown Windows fully (no hibernation or fast restarting)`, the problem is that I have already disabled fast restart and there is no options to hibernate in Windows 8.


How to get text of a page using wget without html?

If I try wget on a webpage, I am getting the page as html. Is it possible to retrieve only text of a file without associated html ? (This is required for me since some of the HTML pages contains c program is getting downloaded with html tags. I have to open it in browser and manually copy the text to make a .c file.)


What is the difference between DISPLAY :0 and :0.0? On RedHat 5.8, I can right click the desktop to start a shell and DISPLAY will be ":0". If I go to the Menu-System-Terminal to start a shell then DISPLAY will be ":0.0". Can I always assume that these are really the same display? For example, if I VNC in to a machine on DISPLAY 33, can I assume that ":33.0" and ":33" are the same display with the same permissions?


Linux Mint Wifi

I'm running Linux Mint 15 Xfce on a Compaq Presario desktop from 2009. I can't seem to get the wifi working. Rather than ask a general question, here's a simple question: If               $ iwlist wlan0 scanning      returns all the wireless networks available, that means that my wifi card is working? So, if that's true, then the problem is that I'm just not setting it up properly, isn't that so? I've tried to configure it using the tools that Mint provides -> Failure. I've tried to configure it the same way I configured my Slackware laptop -> Failure. ( My Slackware config parameters fail on Mint, even though it's the same network) Looking over 2 or 3 unanswered questions on this site, I can see that others have had similar problems. So, is it a mistake to try to set up a wireless connection on Mint by configuring files, rather than use their GUI wireless system (which seems not to work properly)? Does anyone know whether the Mint developers have set it up so that the usual Linux/Unix way of doing things is disabled (to make things easier for the user, no doubt).


Pulseaudio rapidly switches ouputs at high volumes

I'm using Pulseaudio. The image is of the Output Devices tab and shows the Port set to Analog Output. This is fine and works great. There's another option called Headphones but if you try and set the Port to Headphones it automatically switches back to Analog Output. This is also fine because I don't want to use that port The problem is that if the volume increases over 87% it automatically switches to Headphones port, which in turns auto switches back to Analog and back and forth quickly and forever making lots of clicking noises. Perhaps related to that "Base" marker on the volume control? No idea here, very strange behavior. ![enter image description here](http://i.stack.imgur.com/2LJHv.png)


How do I reduce the size of locale-archive?

I have a need to reduce the size of the `locale-archive` file on some of my RHEL6 systems. Here is that file on my system:               [root@-dev-007 locale]# ls -l     total 96800     -rw-r--r--. 1 root root 99158704 Sep  9 15:22 locale-archive     -rw-r--r--. 1 root root        0 Jun 20  2012 locale-archive.tmpl      So I did this ...               [root@-dev-007 locale]# localedef --list | grep zh_CN     zh_CN     zh_CN.gb18030     zh_CN.gb2312     zh_CN.gbk     zh_CN.utf8      ... so I figured I could get rid of `zh_CN` like so ...               [root@-dev-007 locale]# localedef --delete-from-archive zh_CN      ... and I can see `zh_CN` does not get listed anymore like so ...               [root@-dev-007 locale]# localedef --list | grep zh_CN     zh_CN.gb18030     zh_CN.gb2312     zh_CN.gbk     zh_CN.utf8      ... but the size of the `locale-archive` does not get smaller ...               [root@-dev-007 locale]# ls -l       total 96800     -rw-r--r--. 1 root root 99158704 Sep  9 17:16 locale-archive     -rw-r--r--. 1 root root        0 Jun 20  2012 locale-archive.tmpl      ... is there something else I need to do?


Create Null Modem Pair linux

I am looking to create virtual serial ports on Debian 6 squeeze. Basic requirements are:   1. be able to connect as if port was a real serial port( IE be able to set baud, stop bits etc)   2. com port pairs need to be persistent   3. com port pairs names must be static on reboot. I don't want to change code settings each time computer is rebooted I briefly tried socat today using `socat -d -d pty, raw, echo=1 pty, raw, echo=1` that successfully created `/dev/pts/5` and `/dev/pts/6` as a pair. However soon as I close the terminal running socat the pair is terminated. I am also wondering if tty0tty is an option? I have used com0com in the past with windows with great success. **My question is what is the best way to create a null modem pair so that I can simulate several com ports in Linux?**


The cursor to a match, edit, the cursor to the next match, edit -- like in a directory?

Algorithmic blackout:   1. problem: find the files that match   2. problem: stack/buffer the matches   3. move the cursor to the next file of the stack and thereby to the location of the match   4. repeat step 2 Things I have used earlier to tackle the issue. **Vi/m: (the below works in an ubuntu server, perhaps configured by sysadmin but cannot get it work locally)**               :grep -r "[^|]*|[^|]*|[^|]*|.*" *      <edit something>     :cn     <edit something>     :cn     <damn forgot it>     :bn     <forward and so on>      **emacs:** `M-x grep Enter` and then to have `grep -r "[^|]*|[^|]*|[^|]*|.*" *` but now in mystery. How can you do the fast hierarchial edits? **shellesque:** then I once created a wild one-liner with some grep-xargs- something-things-vi but I am starting to smell reinventing-the-wheel. Sorry about the vim/emacs juxtaposition but I don't care which tool you use, use the most convenient (xargs/emacs/vi/m just examples).


What are the kernel, the "GNU tools and utilities", the shell and the Window Manager?

Among the many components of a Linux system, I find myself confused (as a newbie) about what exactly is the kernel or what is GNU's part. I understand some basic concepts of this, but where is the line between a shell and the Window Manager?


Find out global zone Name once you logged into a NON global zone

I understand in Unix Oracle-Solaris OS the `zoneadm list` command will easily show all the available zones. But if I am logged into a non global zone there is no easy way to get information about the global zone. I see the `arp` command can be of some help because it will return the NIC mac address. Then with the NIC mac address I can `arp` again to get all the machine name associated with that (NIC) mac address. This process sounds kind of intricate to me.   Is there any better way to get that info?


Closing socket connection on running console application

I am testing a chat bot and want to gracefully handle for times when the chat server isn't running so it can come back up when the service is available again. I have the programming handled. My question is how to test this when the downtimes are not reliable. Someone suggested "Terminate the socket connection manually". How would I do this? This is a console node.js running on Mountain Lion. Can I sever a connection to a server from a single application?


Is it possible to make KDE 4 look like Win98?

I found settings which make windows look like in Win98, but cannot change taskbar colors and sizes. Default colors are breaking my eyes. Please, write instructions how to change taskbar and other components which significantly lower usability. Version of KDE is 4.8 and newer. EDIT: After applying Aya theme as xenoterracide suggested, taskbar looks as this: ![Aya taskbar](http://i.stack.imgur.com/k2ggx.jpg).   Is it a bug or colors indeed so crazy?


How can I prevent edited commands from overwriting the original? Or revert edits?

Often I'll execute a command in bash, press the up arrow to retrieve it from history, edit it, and execute the edit. However, sometimes I'll decide to discard the edit and run a different command or something. This poses a problem because the edited command, which I didn't run, gets saved over top of the original history entry so I can no longer run the original with ease. For example, here's the end of my current history:               2132* svn cleanup && svn up --set-de     2133  history      The first command was originally `svn cleanup && svn up --set-depth=infinity folder1 folder2`. Is there a way to disable overwrites or revert them to the original commands?


How to clear terminal completely?

When we use `clear` command or `Ctrl`+`L` in terminal, it clears terminal but we can still scroll back to view the last used commands. Is there a way to completely clear the terminal?


is it possible to run job in foreground after user logout

I have some job to run which need be attached to terminal (or in foreground). The job is run in remote servers, and needs keep running after the users logout. I am aware of vnc server, however, I want to know if there is any builtin tool in `redhat` that can work this out. (that is, I dont have sudo to install extra software).


Monitor mode wifi only seeing broadcast packets

I have pretty much exhausted every link I have found on google regarding this topic, and I'd like some of the most experienced eyes on the problem, because something obscure must be going on. # Systems tested on:   * VirtualBox 4.1.22 VM: Ubuntu 12.10 x64   * VirtualBox 4.1.22 VM: Ubuntu 10.04 x64   * VirtualBox 4.1.22 VM: Backtrack 5 r2   * VirtualBox 4.1.22 VM: Backtrack 5 r3   * Lenovo W530 laptop running Backtrack 5 r2 # Interface: Alfa AWUS036H - FCC ID UQ2AWUS036H (you can verify RTL8187L chipset at http://transition.fcc.gov/oet/ea/fccid/. Enter grantee code: UQ2, product code: AWUS036H, then clicking "detail" and then "internal photos"). # Problem description The problem is that while I'm running wlan0 in monitor mode, I only see broadcast packets (I see ARPs, DHCP transactions, beacons, and other random management and data packets that are being broadcast or multicast). This is the case in kismet, wireshark 1.2.x, 1.4.x, and 1.8.x, and my own packet reader program that uses libpcap. The clients that I have set up running pings and http traffic are connected to an open wireless g network. The computer I am sniffing from is not connected to any network. # Procedure I have tested more configurations than I can list, but I'll try to give a good idea of what I've done. The USB wireless card I listed (Alfa AWUS036H) is using the rtl8187 driver. Relevant commands and their outputs are listed below:               # lsusb     Bus 001 Device 009: ID 0bda:8187 Realtek Semiconductor Corp. RTL8187 Wireless Adapter     Bus 001 Device 007: ID 80ee:0021       Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub          # lsmod|grep 80211     mac80211              238928  1 rtl8187     cfg80211              148725  2 rtl8187,mac80211      I've made sure the wireless card is on channel 6, the same channel my open network is on. I have tried both putting wlan0 into monitor mode manually using:               # ifconfig wlan0 down     # iwconfig wlan0 mode monitor     # iwconfig wlan0 channel 6     # ifconfig wlan0 up      And also using airmon-ng to create a mon0 device:               # airmon-ng start wlan0 6     Interface   Chipset     Driver          wlan0       RTL8187     rtl8187 - [phy5]                     (monitor mode enabled on mon0)      When using iwconfig, I can verify wlan0 is in monitor mode:               wlan0     IEEE 802.11bg  Mode:Monitor  Frequency:2.437 GHz  Tx-Power=27 dBm                  Retry  long limit:7   RTS thr:off   Fragment thr:off               Power Management:off      When I use iwconfig to put the card into monitor mode manually, I use the interface wlan0 in wireshark and kismet. When using airmon-ng to create a mon0 interface that is in monitor mode, I use mon0. In both cases, I get the same result: kismet and wireshark will see all the broadcast packets from the APs around me, but never any ICMP or HTTP traffic I'm creating from other clients in order to test. I am not associated or authenticated to any AP. I did this a few months ago at a workshop and it worked great; we saw tons of HTTP traffic flying around. For most of the same type of questions I've seen asked elsewhere, the problem had to do with the person being associated to a network or that they were on an encrypted network and weren't entering the key properly. I cannot find any issue with the setup or the device. Any ideas? Thanks for any help.


Restricting an SSH/SCP/SFTP user to a directory

Is there a simple way to restrict an SCP/SFTP user to a directory? All methods that I've come across require me to set a chroot jail up by copying binaries, but I don't think that should be necessary.


Create user who can only access one directory

I would like to create a user that only has access to one folder and nothing else whatsoever. I have already created a user but he has access to other parts of the system according to corresponding file settings. I don't want him to have that, I want him only to have access to one folder and nothing else. Everything else should preferably be just invisible to him. Is it possible to create such a user,and if so, how do I go about doing that? p.s. Removing 'other' privileges of other users home directory goes a bit of the way towards this end. But this limited user still has access to all the base directories like /etc and such. And he can still see other users home directory, even though he cant access them.


How to allow user to only rsync/download only one directory through SSH

What I want to do is to give to user a simple script to run, that will sync some directory from my VPS to their machine, authentication would be done by using pubkey, and I would like to have control on what dirs what users can download. I know I can achieve that by using simply FTP, but it's not secure and I would rather rely on pubkey authentication rather than passwords, so I would like to use SSH. However I don't want to allow user to do anything more in shell than syncing that one specific directory. How to achieve that?


Install postgresql 9.2 on debian wheezy (on virtualbox)

I have virtualbox with Debian Wheezy. I'm trying to install Postgresql 9.2 on it. When I trying do it by this instruction i have next:               Reading package lists... Done     Building dependency tree     Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      postgresql-9.2 : Depends: postgresql-common (>= 135~) but it is not going to be installed                       Depends: ssl-cert but it is not installable     E: Unable to correct problems, you have held broken packages.      When I try to install postgresql-common:               apt-get install postgresql-common      I got next:               Reading package lists... Done     Building dependency tree     Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      postgresql-common : Depends: ssl-cert (>= 1.0.11) but it is not installable     E: Unable to correct problems, you have held broken packages      When I try to install ssl-cert:               apt-get install ssl-cert      I got next:               Reading package lists... Done     Building dependency tree     Reading state information... Done     Package ssl-cert 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 'ssl-cert' has no installation candidate      I'm novice in Linux, please help me install Postgresql 9.2 There is my `sources.list`               #          # deb cdrom:[Debian GNU/Linux 7.0.0 _Wheezy_ - Official i386 CD Binary-1 201305$          deb cdrom:[Debian GNU/Linux 7.0.0 _Wheezy_ - Official i386 CD Binary-1 20130504$          deb http://security.debian.org/ wheezy/updates main     deb-src http://security.debian.org/ wheezy/updates main          # wheezy-updates, previously known as 'volatile'     # A network mirror was not selected during install.  The following entries     # are provided as examples, but you should amend them as appropriate     # for your mirror of choice.     #     # deb http://ftp.debian.org/debian/ wheezy-updates main     # deb-src http://ftp.debian.org/debian/ wheezy-updates main


Script for ssh Agent Management: Is this adequate? Any bugs?

The following is something I use to manage my ssh agent settings.               #!/bin/echo "Must source this:"      ## Ensure that ~/.ssh/env contains valid values          unset SSH_AGENT_PID SSH_ENV_REFRESH          [ -r ~/.ssh/env ] && . ~/.ssh/env     [ -n "$SSH_AGENT_PID" ]  || {         # No env file (or it's badly corrupted:         eval $(ssh-agent &>/dev/null) &> /dev/null         SSH_ENV_REFRESH=1         }          # Ping the agent process:     kill -0 "$SSH_AGENT_PID" >& /dev/null || {         # No process, so start a new one:         eval $(ssh-agent &>/dev/null) &> /dev/null         SSH_ENV_REFRESH=1         }          ssh-add -l &> /dev/null     [ "$?" -gt 1 ] && {         # Process alive but unable to be contacted         # for some reason (wedged/defunct process,         # or damaged/corrupt UNIX domain socket node?)              # So kill it:         kill "$SSH_AGENT_PID" >& /dev/null         # ... with extreme prejudice if necessary:         kill -0 "$SSH_AGENT_PID" >& /dev/null \         || kill kill -9 "$SSH_AGENT_PID" >& /dev/null              # ... and start a new one         eval $(ssh-agent &>/dev/null) &> /dev/null         SSH_ENV_REFRESH=1         }          [ -z "$SSH_ENV_REFRESH" ] || {         # Over-write old env file:         printenv | grep "^SSH_A" > ~/.ssh/env         # Append export command:         echo "export SSH_AGENT_PID SSH_AUTH_SOCK" >> ~/.ssh/env              # Load the (null-passphrase) identites into the agent:         ssh-add  < /dev/null &> /dev/null         }      It's intended to be sourced (`. ~/lib/sshagent.sh`) from _~/.bashrc_ or other login or shell start-up files ... or even cron jobs. It works for me but I'm hoping folks here will review it and offer suggestions about any corner cases that I'm missing. I used to only run it from ~/.bash_login ... but then I'd find that, in some cases, my shells wouldn't pick up the settings (X display manager and I think remote ssh non-login sessions ... cases where ssh is called with a command). In some other cases the old settings would persist and not updated when an agent process was restarted (for whatever reason). So I run it in _~/.bashrc_ and try to avoid any stray output ... as is recommended for _~/.bashrc_ in general. So, are there any evident corner cases or bugs? Would this make sense for something like _/etc/bashrc_? Is it reasonably portable to other shells?


What does the term static variable mean in unix speak?

From the section 2.7 of the book - The Linux programing Interface named **Process memory layout** : _Data_ is defined as the               static variables used by the program.      What is the significance of the word static here ? I am aware of what static variables are in Java but I can not relate that meaning in this context .


Discover MTU between me and destination IP

In a case I can use only `UDP` and `ICMP` protocols, how can I discover, in bytes, the path MTU for packet transfer from my computer to a destination IP?


Hard drive writes freezing up Gnome

I'm currently running Debian 6.0.5 on my white Macbook 2008 (4,1) and have recently noticed that when I download, move, or decompress a file, Gnome freezes up completely for at least 20 seconds. These freezes happen off and on until the file is done downloading. Oddly enough I can still use Compiz to switch between workspaces and move windows, but the windows aren't being redrawn. I did a lot of googling to see if I could find a solution to the problem, but not much turned up for my specific problem. I thought the problem might be related to me using a Seagate Momentus XT, as there seemed to be a lot of problems with that drive and linux in the past. It turns out that I'm using the updated firmware that was supposed to fix the linux problems the drive was having. If anyone has any ideas as to why this is happening and a potential fix to this problem, please let me know. I get this error in the syslog:               Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330686] ata3.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6     Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330695] ata3.00: BMDMA stat 0x6     Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330703] ata3.00: failed command: READ DMA EXT     Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330717] ata3.00: cmd 25/00:00:80:64:b4/00:01:2c:00:00/e0 tag 0 dma 131072 in     Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330721]          res 51/84:60:20:65:b4/84:00:2c:00:00/e0 Emask 0x30 (host bus error)     Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330728] ata3.00: status: { DRDY ERR }     Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330734] ata3.00: error: { ICRC ABRT }     Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330757] ata3: soft resetting link     Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.510690] ata3.00: configured for UDMA/33     Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.510835] ata3: EH complete


How to disable systemd's "Time has been changed" message spam in /var/log/syslog on Debian jessie?

Due to combined use of Debian `jessie`, that uses `systemd` by default, and sdwdate (that uses Slow Clock Adjuster ( gh )), my system clock is frequently changed. As a result `/var/log/syslog` gets endlessly spammed by.               [...]     Aug 22 13:06:15 host systemd[1]: Time has been changed     Aug 22 13:06:16 host systemd[1]: Time has been changed     Aug 22 13:06:16 host systemd[852]: Time has been changed     Aug 22 13:06:17 host systemd[852]: Time has been changed     Aug 22 13:06:17 host systemd[1]: Time has been changed     Aug 22 13:06:18 host systemd[1]: Time has been changed     [...]      Running `sudo service rsyslog stop` stops the spam, but this is not a real solution. This was not an issue on Debian `wheezy` that used `sysvinit`. How can `systemd` be configured to not send the `Time has been changed` message to `/var/log/syslog`?


How to read the local DNS cache contents?

I know that on Windows I can issue `ipconfig /displaydns` and I see the local DNS's cache content. How can I list the DNS's cache content in Linux? I would like to get as much as cross-distro solution as possible.


extundelete does not finish its work

I need to restore a file on sda7 so I remounted ro und startet extundelete               manuel@P5KC:~/recovery/RECOVERED_FILES$ sudo extundelete --restore-all /dev/sda7     WARNING: Extended attributes are not restored.     Loading filesystem metadata ... 688 groups loaded.     Loading journal descriptors ... 18110 descriptors loaded.     Writing output to directory RECOVERED_FILES/     Searching for recoverable inodes in directory / ...      1554 recoverable inodes found.     Looking through the directory structure for deleted files ...      Unable to restore inode 2228446 (lost+found/latex): No data found.      But the directory `RECOVERED_FILES` is empty. Am I doing something wrong or is my data lost? Filesystem is ext4. At the end, logged in as su, I am even getting a segmentation fault. * * * Debian Wheezy 3.2.0-4-amd64


xmms2 cover art

Does xmms2 have bindings either a Python API or a command line tool to find the album cover art of an MP3? _Related toxmms2 notification with album art under Awesome._


How do I know what service is running on a particular port in linux?

I am trying to run weblogic server on my linux machine and I am getting the following error :               ERROR: transport error 202: bind failed: Address already in use     ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)     JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]     FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)      I think that the error means that the debugger port which by default is 8453 is already held by some other service . How can I find out what service is runnning in a partcular port number ? P.S: I used `netstat` command but that shows all the services occupying all ports ..here I am interested in a particular port only.


Git pull error libcurl.so.3 not found

I have a php script to `git pull` from my github repository set up in my webservice hook urls like so:               <?php       echo shell_exec('~/git/usr/bin/git pull 2>&1');     ?>       When I open this script on the browser, I get this error:               git-remote-https: error while loading shared libraries: libcurl.so.3: cannot open shared object file: No such file or directory      I am on a godaddy server running CentOS release 5.9 and `uname -mrs` yields:               Linux 2.6.18-348.3.1.el5PAE i686      When I tried doing :               yum install curl      I get an error that the command `yum` cannot be found. I seriously have no idea what's going on here because when I ssh into my server and do `git pull` from the terminal or run the script like `php myscript.php`, it works fine and all the changes are fetched. How are the dependencies changed when I run it in the browser? Any help is deeply appreciated.


Is there a way to view a list of timestamp history of a document/file via terminal/command line?

This seems like it's simple but for some reason, it's not: Problem: I've been writing a paper- not even a script...just an economics paper- over the last 3 months. I'm trying to determine how much time I've spent writing it, how many times I've saved the file and how much the document grew each change. Is there a command/script to view this info? I'm not looking for exact changes, I'm just looking for the general file information. The only thing I can find is the most recent time the file was modified, but I can't find the information for the modifications before the most recent. Example of expected output:                 $ (elusive and mysterious command that is similar to stat -x) <file>           File: "file"       Current Size: 1000        FileType: Regular File       Mode: (0600/-rw-------)         Uid: (  501/user)  Gid: (   20/   group)     Device: 14,2   Inode: number    Links: 1     Access: Wed Mar 14 19:50:00 2012     Modified: Fri Dec 23 01:22:40 2011     --Size: 1000     Modified: Wed Dec 21 11:42:21 2011     --Size: 920     Modified: Wed Dec 21 11:01:12 2011     --Size: 703     Modified: Wed Dec 21 10:11:01 2011     --Size: 100     Modified: Tue Dec 20 11:42:38 2011     --Size: 0     Change: Mon Feb 13 20:44:36 2012


File system compatible with all OSes?

I use Linux and Mac OS X on a regular basis, and sometimes I have to use Windows. I need to use a flash drive on all three, and I need a filesystem that will work well on all of them. None of the ext's work on Mac or Windows, HFS+ doesn't work on Windows (or well on Linux), NTFS is read-only on Mac, and FAT sucks on all OSes. Is there a file system that would work reasonably well on all operating systems? I'd like it to work without drivers or additional installations, so it can be used on any computer.


Getting Linux computer integrated with Windows domain

I've tried to figure it out for several months, with no success. I have a Windows 2008R2 domain, and one Linux server (first it was Fedora 15, then 16, and now it's Centos 6.2). I am trying to make it member of the domain to the extent possible. Ideally, I would like to login and get authenticated against domain (say, login 'DOMAIN+john'). If not - at least be able to map directories through Samba with Windows credentials (better, map drives without specifying credentials, and just passing Windows credentials). I followed several articles, most closely this one; but still can't map the drive (as soon as I switch security from USER to ADS, I can't expand the server)... let alone login. I know I am close (eg., I am getting `pam_get_item returned a password` from winbind when I log in) - but pointers to something definitive would be great!


Meaning of @0 in a shell script

I was looking at the script `/etc/init.d/sudo` in my Ubuntu 14.04 Linux system. While reading the script, I found this statement :               find /var/lib/sudo -exec touch -d @0 '{}' \;      What is the meaning of `@0` here? What does the above statement do?


iSCSI and runaway log file

I have a OpenVZ VPS running CentOS 5.7 that I've been using to get some sysadmin experience. I found a log file called brcm-iscsi.log in /var/log and it's getting big (140 MB).               INFO  [Sun Dec 18 20:15:42 2011]Initialize logger using log file: /var/log/brcm-iscsi.log     INFO  [Sun Dec 18 20:15:42 2011]Started BRCM iSCSI stack: Ver 0.6.2.13     INFO  [Sun Dec 18 20:15:42 2011]Build date: Fri Jul 22 01:19:02 EDT 2011     INFO  [Sun Dec 18 20:15:42 2011]Running on sysname: 'Linux', release: '2.6.18-274.7.1.el5.028stab095.1', version '#1 SMP Mon Oct 24 20:49:24 MSD 2011' machine: 'i686'     INFO  [Sun Dec 18 20:15:42 2011]Initialize logger using log file: /var/log/brcm-iscsi.log     INFO  [Sun Dec 18 20:15:42 2011]Started BRCM iSCSI stack: Ver 0.6.2.13     INFO  [Sun Dec 18 20:15:42 2011]Build date: Fri Jul 22 01:19:02 EDT 2011     INFO  [Sun Dec 18 20:15:42 2011]Running on sysname: 'Linux', release: '2.6.18-274.7.1.el5.028stab095.1', version '#1 SMP Mon Oct 24 20:49:24 MSD 2011' machine: 'i686'     WARN  [Sun Dec 18 20:15:42 2011]nic_utils Error when scanning path: /sys/class/iscsi_host/[No such file or directory]     INFO  [Sun Dec 18 20:15:42 2011]signal handling thread ready     ERR   [Sun Dec 18 20:15:42 2011]NIC_NL waiting binding to NETLINK_ISCSI socket     ERR   [Sun Dec 18 20:15:43 2011]NIC_NL waiting binding to NETLINK_ISCSI socket     ERR   [Sun Dec 18 20:15:44 2011]NIC_NL waiting binding to NETLINK_ISCSI socket      And every second since then I've had that line. I don't quite understand what is going on, so I'm hoping someone could tell me how to fix the underlying problem rather than just deleting the log file. I did Google this and found http://drup.org/brcm-iscsilog-filling-hard-drive which seems to just disable iSCSI and ignore any more errors. Is there a better/safer/preferable way of stopping this error logging? I don't know much about iSCSI - I get that it's a SAN protocol, but that's about it. I've certainly never setup any volumes outside of the disk space I got with my VPS. Could my VPS be relying on this in some way? I wouldn't want to trash it, although I'm getting quite practiced at reloading the VPS... I also wouldn't want to screw up anyone else's nodes. Thanks in advance for helping the n00b.


How to update the version of gcc-c++ on Fedora?

I have version 4.4.4 of `gcc` installed and would like to update to either a specific version or to the latest version. Here is what I have tried:               sudo yum install gcc-c++      this tells me that `Package gcc-c++-4.4.4-10.fc12.i686 already installed and latest version` (not true, there is at least a version 4.8 available). Next I tried a specific version:               sudo yum install gcc-c++-4.8.1      with the result of `No Package gcc-c++-4.8.1 available.`. At last I tried to update the package with               sudo yum update gcc-c++      with the result `No Packages marked for Update`. So how the heck do I update the version of `gcc` and/or `gcc-c++` to be able to compile projects with C++11?


How to disable SELinux without restart?

I need to disable SELinux but cannot restart the machine i followed this link where i get bellow command               setenforce 0      But agter running this command i checked for that               sestatus     SELinux status:                 enabled     SELinuxfs mount:                /selinux     Current mode:                   permissive     Mode from config file:          disabled     Policy version:                 24     Policy from config file:        targeted      Is there any other option?


`mv` has failed because of insufficient disk space, what now?

I have tried to move a folder `A` from partition a to partition b as folder `B` with `mv`. Now the target file system was not big enough for all the data (I know I should have checked this first). Anyway, I continued by using `rsync -av` (what I should have done in the first place), as in What does mv do in case of errors? Then I used `diff -r A B` to check for changes between the folders and diff indeed observed differences in the target directory. Now I wonder whether I should just delete the target folder and start the rsync process at once or whether there is a way to get `rsync` copy everything.


Slight change to command to compile C++ program causes error

This morning , I was trying to compile a C++ program using the following command on the command line               g++ -o foo.cpp foo      I spend about an hour trying t to resolve why I kept getting undefined reference & multiple definition error till I realised that my command to compile was wrong and **it should be**               g++ foo.cpp -o foo      I am just wondering what is the difference in process between `g++ -o foo.cpp foo` and `g++ foo.cpp -o foo` . Why does placing the `-o` infront cause compilation error


s3fs complains about SSH key or SSL cert - how to fix?

I downloaded and installed s3fs 1.73 on my Debian Wheezy system. The specific steps I took were, all as root:               apt-get -u install build-essential libfuse-dev fuse-utils libcurl4-openssl-dev libxml2-dev mime-support     ./configure --prefix=/usr/local     make     make install      The installation went well and I proceeded to create a file `/usr/local/etc/passwd-s3fs` with my credentials copied from past notes (I'm pretty sure those are correct). That file is mode 0600 owner 0:0. Piecing together from the example on the web page and the man page, I then try a simple mount as a proof of concept to make sure everything works:               $ sudo -i     # s3fs mybucketname /mnt -o url=https://s3.amazonaws.com -o passwd_file=/usr/local/etc/passwd-s3fs      In short: it doesn't. The mount point exists with reasonable permissions, and I get no error output from s3fs. However, nothing gets mounted on /mnt, `mount` has no idea about anything of the sort, and if I try `umount` it says about the directory "not mounted". The system logs say `s3fs: ###curlCode: 51 msg: SSL peer certificate or SSH remote key was not OK`, but **how do I find out which SSL certificate it is talking about or in what way was it not OK?** Firefox has no complaints when I connect to that URL but also redirects me to https://aws.amazon.com/s3/. **How do I get s3fs to actually work?**


cd to a directory and execute many commands

I have following script.               #!/bin/bash     mount /dev/sda6 /mnt/gentoo     set +e     cd /mnt/gentoo && mount -t proc none /mnt/gentoo/proc \      && mount --rbind /dev /mnt/gentoo/dev \      && mount --rbind /sys /mnt/gentoo/sys \      && chroot /mnt/gentoo /bin/bash \      && source /etc/profile  \      && export PS1="(chroot)$PS1"       What I am trying to accomplish here is to change to a directory `/mnt/gentoo` and execute few commands. This works ok first time when none of the path were mounted. But if I run it after mounting has been successfully performed on some paths, it does not continue and stops on first failure. I want all commands to be executed even if mount is failing due to 'already mounted' error. How can I do this? Also is there a better way than combining all these commands together in one line?