title: harddisk not recognized / filesystem too large to mount safely on this system / hdparm shows garbage

text: I have a 4 TB Verbatim external hard disk with ext4. It can be successfully mounted at my Raspberry Pi. I am trying to plug it at my WD Mybook Live Duo device where I have SSH root access. When I plug in the device, I get following `dmesg` messages:               usb 1-1: new high speed USB device using dwc_otg and address 2     usb 1-1: New USB device found, idVendor=18a5, idProduct=0400     usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3     usb 1-1: Product: USB 3.0 Desktop HD     usb 1-1: Manufacturer: Verbatim     usb 1-1: SerialNumber: 306239230569     usb 1-1: configuration #1 chosen from 1 choice     usbcore: registered new interface driver libusual     Initializing USB Mass Storage driver...     scsi2 : SCSI emulation for USB Mass Storage devices     usbcore: registered new interface driver usb-storage     USB Mass Storage support registered.     usb-storage: device found at 2     usb-storage: waiting for device to settle before scanning     scsi 2:0:0:0: Direct-Access     ST4000DM 000-1F2168       CC52 PQ: 0 ANSI: 6     sd 2:0:0:0: Attached scsi generic sg2 type 0     sd 2:0:0:0: [sdc] Very big device. Trying to use READ CAPACITY(16).     usb-storage: device scan complete     sd 2:0:0:0: [sdc] 7814037168 512-byte logical blocks: (4.00 TB/3.63 TiB)     sd 2:0:0:0: [sdc] Write Protect is off     sd 2:0:0:0: [sdc] Mode Sense: 1f 00 00 08     sd 2:0:0:0: [sdc] Assuming drive cache: write through     sd 2:0:0:0: [sdc] Very big device. Trying to use READ CAPACITY(16).     sd 2:0:0:0: [sdc] Assuming drive cache: write through      sdc: sdc1     sd 2:0:0:0: [sdc] Very big device. Trying to use READ CAPACITY(16).     sd 2:0:0:0: [sdc] Assuming drive cache: write through     sd 2:0:0:0: [sdc] Attached SCSI disk      The size of 4 TB seems to be recognized correctly. Note that the message `Very big device. Trying to use READ CAPACITY(16).` does not seem to be an error, since it happens at my Raspberry too, but there everything works fine. The devices `/dev/sdc` and `/dev/sdc1` appear. So, at least it recognizes the partition table, I guess. (I cannot run `fdisk -l` since it is not installed at the device and I don't want to mess around too much on that device) When I run `mount /dev/sdc1 ./mymountpoint/` I get following error in `dmesg`: `EXT4-fs (sdc1): filesystem too large to mount safely on this system` `hdparm -I /dev/sdc` shows absolute garbage:               NAS:/DataVolume# hdparm -I /dev/sdc          /dev/sdc:     SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 00 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00          ATA device, with removable media             Serial Number:      abhs¦UU             Media Serial Num:   ¦U¦¦yYT¦UU                  Media Manufacturer:  H                  Transport:          Parallel, ATA8-APT     Standards:             Used: unknown (minor revision code 0x5555)             Supported: 9 7 6 5             Likely used: 9     Configuration:             Logical         max     current             cylinders       21845   0             heads           4352    0             sectors/track   61711   0             --             Logical  Sector size:                   512 bytes             Physical Sector size:                  4096 bytes             Logical Sector-0 offset:            2796032 bytes             device size with M = 1024*1024:  2864663189 MBytes             device size with M = 1000*1000:  3003817068 MBytes (3003817 GB)             cache/buffer size  = unknown             Nominal Media Rotation Rate: 11884     Capabilities:             IORDY(may be)(can be disabled)             Standby timer values: spec'd by Vendor             R/W multiple sector transfer: Max = 0   Current = ?             Recommended acoustic management value: 18, current value: 0             DMA: sdma15             PIO: unknown                *    READ BUFFER DMA command                *    Long physical sector diagnostics                *    CFast specification support     Security:             Master password revision code = 112                     supported                     enabled                     locked             not     frozen                     expired: security count                     supported: enhanced erase             Security level high     Logical Unit WWN Device Identifier: 776f000000000013             NAA             : 7             IEEE OUI        : 76f000             Unique ID       : 000000013     Integrity word not set (found 0x1400, expected 0xbaa5)      `NAS:/DataVolume# lsusb` shows:               Bus 001 Device 003: ID 18a5:0400 Verbatim, Ltd     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub      What can I do to have the hard disk running at this system? (I want to use it to create backups with `rsync` since my network is really slow) Linux at the Raspberry:               uname --all     Linux raspberrypi 3.12.22+ #691 PREEMPT Wed Jun 18 18:29:58 BST 2014 armv6l GNU/Linux      Linux at the NAS:               uname --all     Linux NAS 2.6.32.11-svn70860 #1 Thu May 17 13:32:51 PDT 2012 ppc GNU/Linux      * * * **UPDATE** Here are the correct `hdparm` which I get from a Raspberry Pi or a Ubuntu Live CD:               desinfect@desinfect:/dev$ sudo hdparm -I /dev/sdb          /dev/sdb:          ATA device, with non-removable media         Model Number:       ST4000DM000-1F2168                               Serial Number:      Z300ZT7T         Firmware Revision:  CC52             Transport:          Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0     Standards:         Used: unknown (minor revision code 0x0029)          Supported: 8 7 6 5          Likely used: 8     Configuration:         Logical     max current         cylinders   16383   16383         heads       16  16         sectors/track   63  63         --         CHS current addressable sectors:   16514064         LBA    user addressable sectors:  268435455         LBA48  user addressable sectors: 7814037168         Logical  Sector size:                   512 bytes         Physical Sector size:                  4096 bytes         Logical Sector-0 offset:                  0 bytes         device size with M = 1024*1024:     3815447 MBytes         device size with M = 1000*1000:     4000787 MBytes (4000 GB)         cache/buffer size  = unknown         Form Factor: 3.5 inch         Nominal Media Rotation Rate: 5900     Capabilities:         LBA, IORDY(can be disabled)         Queue depth: 32         Standby timer values: spec'd by Standard, no device specific minimum         R/W multiple sector transfer: Max = 16  Current = ?         Advanced power management level: 128         Recommended acoustic management value: 208, current value: 0         DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6               Cycle time: min=120ns recommended=120ns         PIO: pio0 pio1 pio2 pio3 pio4               Cycle time: no flow control=120ns  IORDY flow control=120ns     Commands/features:         Enabled Supported:            *    SMART feature set                 Security Mode feature set            *    Power Management feature set            *    Write cache            *    Look-ahead            *    Host Protected Area feature set            *    WRITE_BUFFER command            *    READ_BUFFER command            *    DOWNLOAD_MICROCODE            *    Advanced Power Management feature set                 Power-Up In Standby feature set            *    SET_FEATURES required to spinup after power up                 SET_MAX security extension            *    48-bit Address feature set            *    Device Configuration Overlay feature set            *    Mandatory FLUSH_CACHE            *    FLUSH_CACHE_EXT            *    SMART error logging            *    SMART self-test            *    General Purpose Logging feature set            *    WRITE_{DMA|MULTIPLE}_FUA_EXT            *    64-bit World wide name                 Write-Read-Verify feature set            *    WRITE_UNCORRECTABLE_EXT command            *    {READ,WRITE}_DMA_EXT_GPL commands            *    Segmented DOWNLOAD_MICROCODE            *    Gen1 signaling speed (1.5Gb/s)            *    Gen2 signaling speed (3.0Gb/s)            *    Gen3 signaling speed (6.0Gb/s)            *    Native Command Queueing (NCQ)            *    Phy event counters            *    unknown 76[15]                 DMA Setup Auto-Activate optimization                 Device-initiated interface power management            *    Software settings preservation            *    SMART Command Transport (SCT) feature set            *    SCT LBA Segment Access (AC2)                 unknown 206[7]                 unknown 206[12] (vendor specific)     Security:          Master password revision code = 65534             supported         not enabled         not locked         not frozen         not expired: security count             supported: enhanced erase         508min for SECURITY ERASE UNIT. 508min for ENHANCED SECURITY ERASE UNIT.     Logical Unit WWN Device Identifier: 5000c500651cc162         NAA     : 5         IEEE OUI    : 000c50         Unique ID   : 0651cc162     Checksum: correct               desinfect@desinfect:/dev$ sudo fdisk -l /dev/sdb          Warnung: GPT (GUID-Partitionstabelle) auf '/dev/sdb' erkannt! Das Hilfsprogramm Fdisk unterstützt GPT nicht. Verwenden Sie GNU Parted.               Disk /dev/sdb: 4000.8 GB, 4000787030016 bytes     255 Köpfe, 63 Sektoren/Spur, 486401 Zylinder, zusammen 7814037168 Sektoren     Einheiten = Sektoren von 1 × 512 = 512 Bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Festplattenidentifikation: 0x7453181c             Gerät  boot.     Anfang        Ende     Blöcke   Id  System     /dev/sdb1               1  4294967295  2147483647+  ee  GPT      The hard disk has GPT. gparted shows a 4 MB unpartitioned area and the rest of 3.6 TB are used for an ext4 partition. `parted` does show it as:               $ parted --list          Modell: ST4000DM 000-1F2168 (scsi)     Festplatte  /dev/sdb:  4001GB     Sektorgröße (logisch/physisch): 512B/512B     Partitionstabelle: gpt          Nummer  Anfang  Ende    Größe   Dateisystem  Name   Flags      1      4194kB  4001GB  4001GB  ext4         linux      The NAS does use 2x 4 TB hard disks which are mirrored using mdraid . I wonder why the NAS has no problem using them...


title: How do I stop thunar trying auto-mount a partition

text: When I plug in **SIPOD** , _my pet ipod_ , thunar tries to auto-mount **two** partitions instead of **one**. This annoying pop-up is starting to kill me: ![alt text](http://i.stack.imgur.com/yKf4N.png) This is what `/dev/sde` looks like:               $ sudo file -s /dev/sde*     /dev/sde:  x86 boot sector, code offset 0x58, OEM-ID "MSDOS5.0", Bytes/sector 2048, sectors/cluster 8, reserved sectors 512, Media descriptor 0xf8, heads 255, sectors 39075371 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 0, infoSector 0, Backup boot sector 0, reserved3 0x50000, physical drive 0x5, serial number 0xa88b3652, label: "       iPod"     /dev/sde1: data     /dev/sde2: x86 boot sector, code offset 0x3c, OEM-ID "*UOKJIHC" cached by Windows 9M, Bytes/sector 2048, sectors/cluster 8, Media descriptor 0xf8, heads 255, hidden sectors 64260, sectors 39011108 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 9522, reserved3 0x1000000, reserved 0x1, serial number 0x58dd9832, label: "SIPOD      "      Is there a way to tell thunar to completely ignore `/dev/sde1`?


title: mutt responsive way to refresh inbox

text: Using `mutt` with Gmail I "check for e-mail updates" sometimes through the `$` binding (sync-mailbox), sometimes just by using `c` (change folder) and just supplying `=` (defaults to MAILBOX) as the IMAP folder path to change to. Is there a better (in particular: faster) way of doing the same? A solution would be something that is more direct than "pretending to switch folders", as I do, for example. Also something that does not "miss" some updates, as `$` seems to do at times (perhaps `$` is not meant to check for e-mails at all but just to expunge messages marked as deleted, etc?)


title: Reseting USB for scanner

text: This is a question on:superuser, since one reply suggested I ask here... My distro does not yet have a backend for my scanner, but the last release of SANE does. So I downloaded the source and installed. Scanning goes fairly well except that for some reason at the end of a scan I get an error message: "reset high speed USB device using ehci_hcd and address xx" After that I can't scan anything until I unplug and replug the ( USB ) scanner. Since I expect my distro to pick up the latest sane version within a few months, for now all I would like to do is reset the scanner so it can do the next page. Any suggestions on how to do this? PS: The kernel version is: 2.6.31-22


title: Unitary testing: emulating hardware connection or disconnection

text: I'm writing a program using libudev. And I want to write some tests. But, one of the functionalities of the program has to do with an usb drive being connected or disconnected. I've read plenty of documentation about `qemu` and its many many applications. But I'm still without find the way for correctly write unitary tests that have to do with connection or disconnection of hardware to the pc. Which the best (or easiest) way of accomplish this?


title: Delay in playing(recording?) real time raw audio. [OpenWrt, Debian]

text: I'm developing OpenWrt device which sends audio data to network but I have issues in the early beginning. I'm trying to find which cause delay in playing (or maybe recording, but more probably playing) real time record from microphone. For example I run `arecord | aplay` on my Debian machine and the delay in playing is somewhere between **500-1000 ms.** When I run the same command on my OpenWrt box (TP LINK wr703n) I get almost the same delay (Same to `cat /dev/dsp > /dev/dsp`) When I stream sound using netcat(with UDP) from OpenWrt box to Debian PC (on LAN) I get almost the same delay. I think It does not depend on sound card - on OpenWrt I use usb sound card connected via hub and on Debian machine I use integrated notebook sound card. > _Which could cause this delay? Or do you know possible solutions?_ Thank you and sorry my english :)


title: Assigning a value with echo piped together with the bc command and using a variable as an argument

text: Basically i'd like to assign to variable $finalbyte a value (which consists of a binary representation of a byte e.g 11100000). So trying to do that i put the following as part of some script:               field4=224     ##224 for example, it could be any number.                    ##Depends on the script          finalbyte=$(echo 'obase=2; ibase=10; ${field4}' | bc)   ##<-------error here      I get the following error which is kinda like obvious to interpret but my problem is that i don't know or imagine the way that $field4 could nestle down there in between the other arguments . The error is:               (standard_in) 1: illegal character: $


title: Need to trim the names of file names

text: ![enter image description here](http://i.stack.imgur.com/2K4Ys.jpg)I have files in UNIX directory which have a unique number starting with, i have to remove the unique id followed by '-' from the file name and need to have regular file. Any help is appreciated. Example: 32456113-report.pdf Required File name in the database: report.pdf I have file names of all kind of extensions .pdf, .doc, .xls, .txt but have the same number in the front. I am using winscp to test or view the data and i am running a shell script by registering it as a host concurrent program in oracle apps.


title: How costly is case insensitive search as compared to case sensitive search?

text: I dont think grep -i is exponentially (wrt to the number of characters to be grepped) more costly (time wise) than a normal grep because the run times are not too different. But theoretically it should be. For example               egrep -i abc *      is equivalent to               egrep "abc|abC|aBc|aBC|Abc|AbC|ABc|ABC" *      How do utilities like grep avoid the exponential time in case insensitive queries? Is there a case insensitive comparison operator that Unix inherently supports that such utilities can use?


title: Copying man pages from tmux copy mode

text: I am in `xterm` on Pangolin, inside a `tmux` session, in `copy mode`. I am trying to copy the text of a `man` page but what I yank into the clipboard by using the simple `vi` bindings of spacebar/enter is text full full of whitespace which I can't just paste into `vim`.   * How can I view a `man` page as "plain text", perhaps even outside of the `man` program?    * Alternatively, how can I use the `tmux` copy mode to properly copy the text as it appears on the screen so that `CTRL+]` pasting it elsewhere will be faithful to the formatting I intended to reproduce? EDIT: I should mention that the command `capture-pane`, followed by `save- buffer`, _works_ to save an _entire_ buffer to a file. I am looking for something less of an overkill: simple copy mode, select and yank, paste somewhere else; for example: inside `vim`.


title: How can I find the cause of clock drift on a custom embedded system?

text: We have custom hardware running 3.2 Angstrom on a SAM9G45 processor. Everything works fine. Recently we designed similar hardware that uses the SAM9G25 processor. We found the 2.6 kernel works fine on the SAM9G25, but we needed to port the 3.2 kernel to the platform to take advatage of some wireless drivers. We completed the port, but we have just discovered the time of day clock is not reliable. It runs fine for about 20 minutes - then the time (reported by "date") will jump ahead a few hours or days. The 2.6 kernel still works fine, so we think it's something we did not port correctly. We have looked over everything, but no luck so far. I'm not sure where to look next. **Final Answer** : Atmel supplies a patch for the 2.6 kernel, to the file tcb_clksrc.c. We missed that in our port to the 3.2 kernel. Thanks for the insight!


title: Why is yum's tab completion slow?

text: Why is yum's tab completion slow? Is it because it needs to connect to the internet? If yes, how can I disable that?


title: Change a driver's source code and compile

text: I have made some little change to `if_igb` in `/usr/src/sys/dev/e1000/if_igb.c`. How can I compile only this file and load it to kernel dynamically? I'm using FreeBSD 8.2 Release.


title: Enable ACL on ArchLinux

text: Hi i'm trying to enable ACL on my filesystem. this are the steps   * install acl with `# pacman -S acl`   * edit `/home` entry on `/etc/fstab` * * *               /dev/sdb4    /home       ext4        defaults,acl,noatime        0 2      * * *   * remount partition `# mount -o remount /home` even after reboot the acl is not displayed for the `mount` command               /dev/sda4 on /home type ext4 (rw,noatime,data=ordered)


title: How to find human-readable information about file types recognized by `file`?

text: Searching, googling, I could not find any information about file types recognized by `file`. For example, an *.mp4 file is identified as "ISO Media" (while being able to play with VLC normally). This is not 100% clear, it somehow leaves me to wonder whether it's a correct detection or the file is confused for ISO image. (Either because e.g. the sample is somehow corrupted, or, just that the algorithm is not 100% accurate for all types.) My problem is that I need to set up some rules for switching based on file type. I have set created a sample file set, but I cannot collect enough samples of all types which I need to be recognized by my code. And the real set will probably be really huge. It would be enough for me if I could read some comments to use as a reference to those types which are not so obvious. But to my surprise, I could not find any useful information. Most of my searches ended on magic file format specification, which is not really helpful to me. I'm interested in _the_ magic file which is distributed with, say, Debian.


title: How can I split a text file into multiple text files?

text: I have a text file called `entry.txt` that contains the following:               [ entry1 ]     1239 1240 1242 1391 1392 1394 1486 1487 1489 1600     1601 1603 1657 1658 1660 2075 2076 2078 2322 2323     2325 2740 2741 2743 3082 3083 3085 3291 3292 3294     3481 3482 3484 3633 3634 3636 3690 3691 3693 3766     3767 3769 4526 4527 4529 4583 4584 4586 4773 4774     4776 5153 5154 5156 5628 5629 5631     [ entry2 ]     1239 1240 1242 1391 1392 1394 1486 1487 1489 1600     1601 1603 1657 1658 1660 2075 2076 2078 2322 2323     2325 2740 2741 2743 3082 3083 3085 3291 3292 3294     3481 3482 3484 3690 3691 3693 3766 3767 3769 4526     4527 4529 4583 4584 4586 4773 4774 4776 5153 5154     5156 5628 5629 5631     [ entry3 ]     1239 1240 1242 1391 1392 1394 1486 1487 1489 1600     1601 1603 1657 1658 1660 2075 2076 2078 2322 2323     2325 2740 2741 2743 3082 3083 3085 3291 3292 3294     3481 3482 3484 3690 3691 3693 3766 3767 3769 4241     4242 4244 4526 4527 4529 4583 4584 4586 4773 4774     4776 5153 5154 5156 5495 5496 5498 5628 5629 5631      I would like to split it into three text files: `entry1.txt`, `entry2.txt`, `entry3.txt`. Their contents are as follows. **entry1.txt** :               [ entry1 ]     1239 1240 1242 1391 1392 1394 1486 1487 1489 1600     1601 1603 1657 1658 1660 2075 2076 2078 2322 2323     2325 2740 2741 2743 3082 3083 3085 3291 3292 3294     3481 3482 3484 3633 3634 3636 3690 3691 3693 3766     3767 3769 4526 4527 4529 4583 4584 4586 4773 4774     4776 5153 5154 5156 5628 5629 5631      **entry2.txt** :               [ entry2 ]     1239 1240 1242 1391 1392 1394 1486 1487 1489 1600     1601 1603 1657 1658 1660 2075 2076 2078 2322 2323     2325 2740 2741 2743 3082 3083 3085 3291 3292 3294     3481 3482 3484 3690 3691 3693 3766 3767 3769 4526     4527 4529 4583 4584 4586 4773 4774 4776 5153 5154     5156 5628 5629 5631      **entry3.txt** :               [ entry3 ]     1239 1240 1242 1391 1392 1394 1486 1487 1489 1600     1601 1603 1657 1658 1660 2075 2076 2078 2322 2323     2325 2740 2741 2743 3082 3083 3085 3291 3292 3294     3481 3482 3484 3690 3691 3693 3766 3767 3769 4241     4242 4244 4526 4527 4529 4583 4584 4586 4773 4774     4776 5153 5154 5156 5495 5496 5498 5628 5629 5631      In other words, the `[` character indicates a new file should begin. The entries (`[ entry*]`, where `*` is an integer) are always in numerical order and are consecutive integers starting from 1 to N (in my actual input file, N = 200001). Is there any way I can accomplish automatic text file splitting in bash? My actual input `entry.txt` actually contains 200,001 entries.


title: How to escape < or > in a parameter in shell?

text: I'd like to use `grep` with a PCRE expression that contains the `<` character. Bash thinks I want to redirect, but I don't want to. How can I escape `<`?


title: Linux Mint 15 Olivia source list

text: I am facing a problem downloading anything using apt-get tool. I have played with my source list and I think something went wrong. Synaptic also doesn't work. I've searched for the original source list online and I found this:               deb http://packages.linuxmint.com/ olivia main upstream import     deb http://archive.ubuntu.com/ubuntu/ raring main restricted universe multiverse     deb http://archive.ubuntu.com/ubuntu/ raring-updates main restricted universe multiverse     deb http://security.ubuntu.com/ubuntu/ raring-security main restricted universe multiverse     deb http://archive.canonical.com/ubuntu/ raring partner          # deb http://archive.getdeb.net/ubuntu raring-getdeb apps     # deb http://archive.getdeb.net/ubuntu raring-getdeb games      So I have changed my /etc/apt/source.list and typed `sudo apt-get update` This is the output of the update                   Ign http://archive.ubuntu.com raring Release.gpg                                    Ign http://security.ubuntu.com raring-security Release.gpg                          Get:1 http://archive.canonical.com raring Release.gpg [933 B]                       Ign http://archive.ubuntu.com raring-updates Release.gpg                            Ign http://archive.ubuntu.com raring Release                                        Ign http://archive.ubuntu.com raring-updates Release                                Get:2 http://ppa.launchpad.net raring Release.gpg [316 B]                           Ign http://archive.ubuntu.com raring/main amd64 Packages/DiffIndex                  Get:3 http://packages.linuxmint.com olivia Release.gpg [198 B]                      Get:4 http://ppa.launchpad.net raring Release.gpg [316 B]                           Ign http://archive.ubuntu.com raring/restricted amd64 Packages/DiffIndex            Get:5 http://packages.linuxmint.com olivia Release [18.5 kB]                        Ign http://security.ubuntu.com raring-security Release                              Ign http://security.ubuntu.com raring-security/main amd64 Packages/DiffIndex        Ign http://security.ubuntu.com raring-security/restricted amd64 Packages/DiffIndex     Get:6 http://packages.linuxmint.com olivia/main amd64 Packages [23.5 kB]            Ign http://security.ubuntu.com raring-security/universe amd64 Packages/DiffIndex     Hit http://archive.canonical.com raring Release                                     Ign http://archive.canonical.com raring Release                                     Ign http://security.ubuntu.com raring-security/multiverse amd64 Packages/DiffIndex     Ign http://archive.ubuntu.com raring/universe amd64 Packages/DiffIndex              Get:7 http://packages.linuxmint.com olivia/upstream amd64 Packages [9,249 B]        Ign http://archive.canonical.com raring/partner amd64 Packages/DiffIndex            Ign http://security.ubuntu.com raring-security/main i386 Packages/DiffIndex         Ign http://archive.ubuntu.com raring/multiverse amd64 Packages/DiffIndex            Ign http://archive.canonical.com raring/partner i386 Packages/DiffIndex             Ign http://security.ubuntu.com raring-security/restricted i386 Packages/DiffIndex     Ign http://archive.ubuntu.com raring/main i386 Packages/DiffIndex                   Get:8 http://packages.linuxmint.com olivia/import amd64 Packages [39.2 kB]          Hit http://ppa.launchpad.net raring Release                                         Ign http://ppa.launchpad.net raring Release                                         Ign http://security.ubuntu.com raring-security/universe i386 Packages/DiffIndex     Ign http://archive.ubuntu.com raring/restricted i386 Packages/DiffIndex             Hit http://ppa.launchpad.net raring Release                                         Ign http://security.ubuntu.com raring-security/multiverse i386 Packages/DiffIndex     Ign http://ppa.launchpad.net raring Release                                         Ign http://archive.ubuntu.com raring/universe i386 Packages/DiffIndex               Hit http://archive.canonical.com raring/partner amd64 Packages                      Ign http://ppa.launchpad.net raring/main Sources/DiffIndex                          Ign http://archive.ubuntu.com raring/multiverse i386 Packages/DiffIndex             Hit http://archive.canonical.com raring/partner i386 Packages                       Ign http://ppa.launchpad.net raring/main amd64 Packages/DiffIndex                   Get:9 http://packages.linuxmint.com olivia/main i386 Packages [23.5 kB]             Ign http://ppa.launchpad.net raring/main i386 Packages/DiffIndex                    Ign http://ppa.launchpad.net raring/main Sources/DiffIndex                          Get:10 http://packages.linuxmint.com olivia/upstream i386 Packages [9,237 B]        Ign http://ppa.launchpad.net raring/main amd64 Packages/DiffIndex                   Ign http://ppa.launchpad.net raring/main i386 Packages/DiffIndex                    Get:11 http://packages.linuxmint.com olivia/import i386 Packages [40.1 kB]          Ign http://archive.canonical.com raring/partner Translation-en_US                   Ign http://archive.canonical.com raring/partner Translation-en                      Ign http://archive.ubuntu.com raring-updates/main amd64 Packages/DiffIndex          Hit http://ppa.launchpad.net raring/main Sources                                    Ign http://archive.ubuntu.com raring-updates/restricted amd64 Packages/DiffIndex     Hit http://ppa.launchpad.net raring/main amd64 Packages                             Ign http://archive.ubuntu.com raring-updates/universe amd64 Packages/DiffIndex      Hit http://ppa.launchpad.net raring/main i386 Packages                              Ign http://archive.ubuntu.com raring-updates/multiverse amd64 Packages/DiffIndex     Ign http://archive.ubuntu.com raring-updates/main i386 Packages/DiffIndex     Ign http://archive.ubuntu.com raring-updates/restricted i386 Packages/DiffIndex     Ign http://archive.ubuntu.com raring-updates/universe i386 Packages/DiffIndex     Hit http://ppa.launchpad.net raring/main Sources                           Ign http://archive.ubuntu.com raring-updates/multiverse i386 Packages/DiffIndex     Hit http://ppa.launchpad.net raring/main amd64 Packages                    Hit http://ppa.launchpad.net raring/main i386 Packages                     Ign http://ppa.launchpad.net raring/main Translation-en_US                          Ign http://ppa.launchpad.net raring/main Translation-en                             Ign http://ppa.launchpad.net raring/main Translation-en_US                 Ign http://ppa.launchpad.net raring/main Translation-en                    Ign http://security.ubuntu.com raring-security/main Translation-en_US               Ign http://security.ubuntu.com raring-security/main Translation-en         Ign http://security.ubuntu.com raring-security/multiverse Translation-en_US     Ign http://security.ubuntu.com raring-security/multiverse Translation-en     Ign http://packages.linuxmint.com olivia/import Translation-en_US     Ign http://security.ubuntu.com raring-security/restricted Translation-en_US     Ign http://security.ubuntu.com raring-security/restricted Translation-en     Ign http://packages.linuxmint.com olivia/import Translation-en     Ign http://security.ubuntu.com raring-security/universe Translation-en_US     Ign http://security.ubuntu.com raring-security/universe Translation-en     Ign http://packages.linuxmint.com olivia/main Translation-en_US     Err http://security.ubuntu.com raring-security/main amd64 Packages       404  Not Found [IP: 91.189.92.200 80]     Ign http://packages.linuxmint.com olivia/main Translation-en     Err http://security.ubuntu.com raring-security/restricted amd64 Packages       404  Not Found [IP: 91.189.92.200 80]     Err http://security.ubuntu.com raring-security/universe amd64 Packages                404  Not Found [IP: 91.189.92.200 80]     Ign http://packages.linuxmint.com olivia/upstream Translation-en_US        Err http://security.ubuntu.com raring-security/multiverse amd64 Packages       404  Not Found [IP: 91.189.92.200 80]     Err http://security.ubuntu.com raring-security/main i386 Packages       404  Not Found [IP: 91.189.92.200 80]     Err http://security.ubuntu.com raring-security/restricted i386 Packages       404  Not Found [IP: 91.189.92.200 80]     Ign http://packages.linuxmint.com olivia/upstream Translation-en     Err http://security.ubuntu.com raring-security/universe i386 Packages       404  Not Found [IP: 91.189.92.200 80]     Err http://security.ubuntu.com raring-security/multiverse i386 Packages       404  Not Found [IP: 91.189.92.200 80]     Ign http://archive.ubuntu.com raring/main Translation-en_US     Ign http://archive.ubuntu.com raring/main Translation-en     Ign http://archive.ubuntu.com raring/multiverse Translation-en_US     Ign http://archive.ubuntu.com raring/multiverse Translation-en     Ign http://archive.ubuntu.com raring/restricted Translation-en_US     Ign http://archive.ubuntu.com raring/restricted Translation-en     Ign http://archive.ubuntu.com raring/universe Translation-en_US     Ign http://archive.ubuntu.com raring/universe Translation-en     Ign http://archive.ubuntu.com raring-updates/main Translation-en_US     Ign http://archive.ubuntu.com raring-updates/main Translation-en     Ign http://archive.ubuntu.com raring-updates/multiverse Translation-en_US     Ign http://archive.ubuntu.com raring-updates/multiverse Translation-en     Ign http://archive.ubuntu.com raring-updates/restricted Translation-en_US     Ign http://archive.ubuntu.com raring-updates/restricted Translation-en     Ign http://archive.ubuntu.com raring-updates/universe Translation-en_US     Ign http://archive.ubuntu.com raring-updates/universe Translation-en     Err http://archive.ubuntu.com raring/main amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring/restricted amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring/universe amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring/multiverse amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring/main i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring/restricted i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring/universe i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring/multiverse i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/main amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/restricted amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/universe amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/multiverse amd64 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/main i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/restricted i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/universe i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Err http://archive.ubuntu.com raring-updates/multiverse i386 Packages       404  Not Found [IP: 91.189.88.149 80]     Fetched 165 kB in 35s (4,642 B/s)     W: GPG error: http://archive.canonical.com raring Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>     W: GPG error: http://ppa.launchpad.net raring Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D45DF2E8FC91AE7E     W: GPG error: http://ppa.launchpad.net raring Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4DF9B28CA252A784     W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/main/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/restricted/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/main/binary-amd64/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/restricted/binary-amd64/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/universe/binary-amd64/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/multiverse/binary-amd64/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/universe/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/main/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/multiverse/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/restricted/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/main/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/universe/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/restricted/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/multiverse/binary-i386/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/universe/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring/multiverse/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/main/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/restricted/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/universe/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/multiverse/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/main/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/restricted/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/universe/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/raring-updates/multiverse/binary-i386/Packages  404  Not Found [IP: 91.189.88.149 80]          E: Some index files failed to download. They have been ignored, or old ones used instead.      I've tried to upgrade after that, I've got this with many other lines:               Reading package lists... Error!      For `sudo apt-get check` , this is the output               Reading package lists... Error!     W: Duplicate sources.list entry http://packages.linuxmint.com/ olivia/main amd64 Packages (/var/lib/apt/lists/packages.linuxmint.com_dists_olivia_main_binary-amd64_Packages)     W: Duplicate sources.list entry http://packages.linuxmint.com/ olivia/upstream amd64 Packages (/var/lib/apt/lists/packages.linuxmint.com_dists_olivia_upstream_binary-amd64_Packages)     W: Duplicate sources.list entry http://packages.linuxmint.com/ olivia/import amd64 Packages (/var/lib/apt/lists/packages.linuxmint.com_dists_olivia_import_binary-amd64_Packages)     W: Duplicate sources.list entry http://packages.linuxmint.com/ olivia/main i386 Packages (/var/lib/apt/lists/packages.linuxmint.com_dists_olivia_main_binary-i386_Packages)     W: Duplicate sources.list entry http://packages.linuxmint.com/ olivia/upstream i386 Packages (/var/lib/apt/lists/packages.linuxmint.com_dists_olivia_upstream_binary-i386_Packages)     W: Duplicate sources.list entry http://packages.linuxmint.com/ olivia/import i386 Packages (/var/lib/apt/lists/packages.linuxmint.com_dists_olivia_import_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/main amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_main_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/restricted amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_restricted_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/universe amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_universe_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/multiverse amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_multiverse_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/main i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_main_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/restricted i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_restricted_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/universe i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_universe_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring/multiverse i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring_multiverse_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/main amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_main_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/restricted amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_restricted_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/universe amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_universe_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/multiverse amd64 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_multiverse_binary-amd64_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/main i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_main_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/restricted i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_restricted_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/universe i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_universe_binary-i386_Packages)     W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ raring-updates/multiverse i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_raring-updates_multiverse_binary-i386_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/main amd64 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_main_binary-amd64_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/restricted amd64 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_restricted_binary-amd64_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/universe amd64 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_universe_binary-amd64_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/multiverse amd64 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_multiverse_binary-amd64_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/main i386 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_main_binary-i386_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/restricted i386 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_restricted_binary-i386_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/universe i386 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_universe_binary-i386_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ raring-security/multiverse i386 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_multiverse_binary-i386_Packages)     E: Encountered a section with no Package: header     E: Problem with MergeList /var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_raring-security_main_i18n_Translation-en     E: The package lists or status file could not be parsed or opened.      This is the output of `cat /etc/apt/sources.list{,.d/*}`               deb http://packages.linuxmint.com/ olivia main upstream import     deb http://archive.ubuntu.com/ubuntu/ raring main restricted universe multiverse     deb http://archive.ubuntu.com/ubuntu/ raring-updates main restricted universe multiverse     deb http://security.ubuntu.com/ubuntu/ raring-security main restricted universe multiverse     deb http://archive.canonical.com/ubuntu/ raring partner          # deb http://archive.getdeb.net/ubuntu raring-getdeb apps     # deb http://archive.getdeb.net/ubuntu raring-getdeb games               deb http://ppa.launchpad.net/gezakovacs/ppa/ubuntu raring main     deb-src http://ppa.launchpad.net/gezakovacs/ppa/ubuntu raring main     #deb file:///usr/share/local-repository binary/          # Do not edit this file manually, use Software Sources instead.          deb http://packages.linuxmint.com olivia main upstream import  #id:linuxmint_main          deb http://archive.ubuntu.com/ubuntu raring main restricted universe multiverse     deb http://archive.ubuntu.com/ubuntu raring-updates main restricted universe multiverse          deb http://security.ubuntu.com/ubuntu/ raring-security main restricted universe multiverse     deb http://archive.canonical.com/ubuntu/ raring partner     deb http://ppa.launchpad.net/relan/exfat/ubuntu raring main     deb-src http://ppa.launchpad.net/relan/exfat/ubuntu raring main      Any idea how can this be solved? I am sorry if this seems to be silly but I am not an expert.


title: Program to test CPU load and process priority

text: I am running some test on Amazon EC2 instances and we want to make the CPU always busy at above 80%. What I have is a program `main` that needs to run in high priority and I want to launch another program, preferably some math C code or a bash script that loads the CPU to over 80%. What programs are there to use for such a task, and how to make my program run with the highest priority. PS: Running Fedora.


title: Is there a way to automatically run a script after grub-install?

text: I would like to automatically run a script after `grub-install` (using Grub2) if it's possible? Some context. The script will simply run `grub-install /dev/sda1`, `grub- install /dev/sdb1`, `grub-install /dev/sdc1` as I want all three EFI boot partitions in sync.


title: Console port problems on Fedora 15

text: I've looked under every search term on google I can think of and can't seem to find anything that works. I just switched from Windows 7 to Fedora 15 on my PC. I need use of the console port to interact with Cisco switches and other devices. However, I cannot seem to get it to work. I've tried putty, and it says : > Unable to open connection to:   >  Unable to open serial port I've tried minicom as well. Both putty and minicom I set up to `/dev/ttyS0`. I did have it working, once, connected with `cat /dev/ttyS0`, and it outputted the info from the switch, but when it got to the point where the switch expected input, it looped the input request message dozens of times a second. I thought it might be a driver issue, but I cannot find any info for getting drivers for serial ports. I'm thinking I probably need to know the adapter model # or something. The port is built into the motherboard though, so I don't know if it has one. I also tried `setserial /dev/ttyS0`, but it gives the message: > /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4 Is there a command to get info about the serial port/adapter? Is there something that I am doing wrong that I am not seeing?


title: Install winetricks application to ~/.wine prefix

text: How can I tell winetricks to install an app to `~/.wine` instead of `~/.local/share/wineprefixes/<app-name>`? I have already tried `WINEPREFIX=~/.wine winetricks <app-name>` without any success.


title: A terminal emulator for CygWin?

text: I have:   * Windows 7   * CygWin   * A development board connected to COM1 port. I need:   * Connect to its serial port from CygWin. If I used Linux I would run a program like _picocom_ or _minicom_. Also in Windows 7 I could install _HyperTerminal_ and open COM1 port or use Putty for that. But I would like to do it from CygWin's mintty because I like its fonts and some other small joys. It seems mintty itself is not able to work with serial ports, so I wonder if there is a program like _picocom_ or _minicom_ in CygWin's repository.


title: Missing float function in awk on RHEL 5.8

text: Why is `float` missing in `awk` on my RHEL 5.8? Was it replaced by some other function? On Solaris:               echo "Foampile=123" | awk -F"=" '{ print float($2) "<->" $1 }'      returns               123<->Foampile      on RHEL 5.8               awk: (FILENAME=- FNR=1) fatal: function `float' not defined


title: FFMPEG Conversion Fails

text: Bad file? I'm very new to FFMPEG so how can I better debug and trace these issues?                ffmpeg -i /home/videospace/public_html/labo/lion.3gp new_video.flv     ffmpeg version N-57647-g1880294 Copyright (c) 2000-2013 the FFmpeg developers       built on Oct 30 2013 19:25:44 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-3)       configuration: --prefix=/usr/local --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libvo-aacenc --enable-libxvid --disable-ffplay --enable-shared --enable-gpl --enable-postproc --enable-nonfree --enable-avfilter --enable-pthreads --extra-cflags=-fPIC --arch=x86_64       libavutil      52. 48.100 / 52. 48.100       libavcodec     55. 39.100 / 55. 39.100       libavformat    55. 19.104 / 55. 19.104       libavdevice    55.  5.100 / 55.  5.100       libavfilter     3. 90.100 /  3. 90.100       libswscale      2.  5.101 /  2.  5.101       libswresample   0. 17.104 /  0. 17.104       libpostproc    52.  3.100 / 52.  3.100     Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/videospace/public_html/labo/lion.3gp':       Metadata:         major_brand     : 3gp6         minor_version   : 256         compatible_brands: isom3gp6         creation_time   : 2013-04-11 07:48:16       Duration: 00:02:43.98, start: 0.000000, bitrate: 206 kb/s         Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 194 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc (default)         Metadata:           creation_time   : 2013-04-11 07:48:16           handler_name    : IsoMedia File Produced by Google, 5-11-2011         Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 31 kb/s (default)         Metadata:           creation_time   : 2013-04-11 07:48:17           handler_name    : IsoMedia File Produced by Google, 5-11-2011     Output #0, flv, to 'new_video.flv':       Metadata:         major_brand     : 3gp6         minor_version   : 256         compatible_brands: isom3gp6         encoder         : Lavf55.19.104         Stream #0:0(und): Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 1k tbn, 30 tbc (default)         Metadata:           creation_time   : 2013-04-11 07:48:16           handler_name    : IsoMedia File Produced by Google, 5-11-2011         Stream #0:1(und): Audio: mp3 (libmp3lame) ([2][0][0][0] / 0x0002), 22050 Hz, mono, fltp (default)         Metadata:           creation_time   : 2013-04-11 07:48:17           handler_name    : IsoMedia File Produced by Google, 5-11-2011     Stream mapping:       Stream #0:0 -> #0:0 (mpeg4 -> flv)       Stream #0:1 -> #0:1 (aac -> libmp3lame)     Press [q] to stop, [?] for help     [mpeg4 @ 0x2659cc0] Error at MB: 1864337kB time=00:02:18.83 bitrate= 255.9kbits/s     [mpeg4 @ 0x2659cc0] concealing 263 DC, 263 AC, 263 MV errors in P frame     [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2563900] stream 0, offset 0x40b8fc: partial file     /home/videospace/public_html/labo/lion.3gp: Invalid data found when processing input     frame= 4345 fps=1045 q=4.2 Lsize=    4503kB time=00:02:24.83 bitrate= 254.7kbits/s     video:3783kB audio:565kB subtitle:0 global headers:0kB muxing overhead 3.558660%


title: What is BS"D in Mac OS X and iOS Internals?

text: I just received my copy of Mac OS X and iOS Internals, and there is something a little strange: `Chapter 13: BS"D: The BSD Layer` Is there an explanation for the extra quote ?


title: When was this vulnerability fixed in Debian? (CVE-2012-2088 affecting libtiff4)

text: I have Debian Squeeze installed on my one of my workstation. On my Ubuntu 10.04 workstation there have been two security updates to the libtiff4 package in the last couple of weeks, addressing the CVE-2012-2088 vulnerability, but none to libtiff4 on the Debian installation. Is the libtiff4 package installed on my Debian system [3.9.4-5+squeeze4] vulnerable? What update fixes it? More generally, how can I find out whether and when a vulnerability is fixed in Debian?


title: Get network under Network-Manager's management

text: Initially, when I had installed Debian 'Wheezy' on my old trusty laptop, it's network was managed by Network-Manager. However, at some point, I think I did something, which lead to the network connectivity, no longer being managed by Network-Manager, though the NM-applet continues to show-up on my GNOME classic desktop. Question is, how can I get the configuration back to a state where network is again managed by Network-Manager ?


title: Why is variable interpolation not working for variable assignment (for bash)?

text: I have this script:               ROOT=/tmp     LOG=$ROOT/blah.log     echo $LOG      The output is:               /blah.log      obviously the `ROOT` variable is not being interpolated which is very unexpected. If I echo `$ROOT`, it correctly shows `/tmp`. Hence something fishy is going on here.


title: How to manually install linux on a USB?

text: I have been using `unetbootin` to create bootable Linux USBs. I want to do this manually using command line. What is the procedure that unetbootin uses to prepare a bootable USB? **How would you go about manually converting an Ubuntu ISO to a USB?**


title: Directly convert Archbang live on a USB drive to one such with persistent file-system

text: I have installed Archbang 2012.12.03 from ISO image on my USB drive, now I have a USB drive with a live Linux installed on it but at end of every session and rebooting system I faced with a fresh Archbang installation and nothing will be saved. I'm looking for a solution to convert my live system to an Archbang installed on my USB drive with persistent file-system which save every changes during sessions. I have to mention I would not to install it to a new USB drive, just converting.


title: Blank Screen on Mint 15 LiveCD

text: I own a Lenovo Yoga 11s (i5 processor, Intel integrated graphics) and I'm trying to install Linux Mint on to it. However, after I boot from the live cd, the screen goes blank and stops responding. I've looked into the problem online, and I see that it might be an issue with the graphics card.   However, any fix I find online has been useless in alleviating the problem. What can I do next to solve this problem?


title: Why is a echo-request ping packet 84 bytes in the log of iptables?

text: When I log the length of a echo-request packet, `iptables -A OUTPUT -p icmp -m icmp --icmp-type 8 -j LOG` I saw the length was `LEN=84`, but in wireshark, the captured packet size was `0x60`, why does it differ?


title: Monitor servers

text: I want to monitor three server pages. These three pages contain a simple text (for example it says it's "working fine"). I want to be notified when anything other than this message is displayed, e.g. via email. I want shell scripting code for displaying the status of the three pages in an html file.


title: Recompile Kernel to Change Stack Size

text: I need to recompile my kernel on RHEL WS5 with only two changes.   1. Change stack size from 4k to 8k   2. Limit usable memory to 4096. How do I recompile the kernel without changing anything else but these two items?


title: Why email clients prepend `Re:` to subject line?

text: I wonder why most email clients prepend `Re:` to the subject if the mail is a response. When responding, the mail client generates an `In-Reply-To:` header which clearly states that this message is a response. This enables mail user agents to display the mails in the correct thread (together with the `References:` header). So technically the `Re:` does not add any information. The disadvantages are:   * The `Re:` string needs to be adjusted to the language (`Sv:`, `Odp:`, `Vs:`, etc.) which makes it very hard to configure the mail client properly.   * It adds visual clutter to the subject line.   * It can lead to subject lines like this: `Re: Re: Sv: Odp: Re: This is the subject` Why is this common practice and what are the advantages?


title: Pseudo files for temporary data

text: I often want to feed relatively short string data (could be several lines though) to commandline programs which accept only input from files (e.g. wdiff) in a repeated fashion. Sure I can create one or more temporary files, save the string there and run the command with the file name as parameter. But it looks to me as if this procedure would be highly inefficient if data is actually written to the disk and also it could harm the disk more than necessary if I repeat this procedure many times, e.g. if I want to feed single lines of long text files to wdiff. Is there a recommended way to circumvent this, say by using pseudo files such as pipes to store the data temporarily without actually writing it to the disk (or writing it only if it exceeds a critical length). Note that wdiff takes two arguments and, as far as I understand it will not be possible to feed the data doing something like `wdiff <"text"`.


title: python3 traceback error

text: Whenever I mistype any command in terminal instead of getting `Error:Command not found` I get this python message error                   Traceback (most recent call last):       File "/usr/lib/python3.3/site.py", line 631, in <module>         main()       File "/usr/lib/python3.3/site.py", line 616, in main         known_paths = addusersitepackages(known_paths)       File "/usr/lib/python3.3/site.py", line 284, in addusersitepackages         user_site = getusersitepackages()       File "/usr/lib/python3.3/site.py", line 260, in getusersitepackages         user_base = getuserbase() # this will also set USER_BASE       File "/usr/lib/python3.3/site.py", line 250, in getuserbase         USER_BASE = get_config_var('userbase')       File "/usr/lib/python3.3/sysconfig.py", line 580, in get_config_var         return get_config_vars().get(name)       File "/usr/lib/python3.3/sysconfig.py", line 530, in get_config_vars         _init_posix(_CONFIG_VARS)       File "/usr/lib/python3.3/sysconfig.py", line 403, in _init_posix         from _sysconfigdata import build_time_vars       File "/usr/lib/python3.3/_sysconfigdata.py", line 6, in <module>         from _sysconfigdata_m import *     ImportError: No module named '_sysconfigdata_m'      I know that after installing python3.x and trying to make it my default interpreter this error has gone this way.               $ lsb_release -rd     Description:    Linux Mint 14 Nadia     Release:    14      `/usr/lib/command-not-found` is working well also.   Can I get back to my default python version ? simply I did               sudo ln -sf /usr/bin/python2.7 /usr/local/bin/python      is it enough to get 2.7 as default interpreter ?   Any idea how to get rid off this hell message error ?


title: Apache boot without asking for passwd

text: So I'm maintaining a server which has a verified SSL certificate setup, however there is a password on the private key and so whenever apache is reboot, we get a message asking for the password. This isn't a major issue, but becomes one when you reboot the machine! When this happens, it will hang at apache startup (I can tell by viewing the syslog through AWS) and then the machine doesn't run sshd and so I cannot access the server any more! Is there a way to setup apache to use this key without asking for the password? I think one option would be to reissue the SSL certificate but this time not using a password, but then is that unsafe?


title: zsh and xfce4-terminal

text: I've changed my login shell to zsh from bash on an installation of Debian Squeeze with XFCE. When I launch xfce4-terminal, zsh starts but does not load my configuration. I have searched high and low, but have come to SO to extend beyond my regular limits and see if someone can assist in diagnosing this.


title: Can I create a software RAID 1 with one device

text: I have a single disk that I want to create a Mirror of, Lets call this disk `sda` I have just bought another identicle size disk, which we can call `sdb`. `sda` and `sdb` have one partition called `sda1` and `sdb1` respectively. When creating a raid I dont want to wipe my `sda` clean and start again, I just want it to start mirroring with `sdb`. My train of thought was to do:               mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=1 /dev/sda1      ..to create the array without `sdb` disk, then run something like (Im thinking the following command out loud, because I am not sure how to achieve this step)               mdadm /dev/md0 --add /dev/sdb1      Note `sdb1` is assumed to be formated similar to `sda1` Is this posible?


title: Equivalent of newusers for groups

text: The newusers command is useful for adding or modifying users in bulk. Is there an equivalent command for managing groups?


title: Using for loop to brute-force a password

text: I just wanted to brute-force my old router but the for-loop was really amateur style. How to write a nice for-loop, if I only know the charaters included? Found already that page but it does not include my case. I though of something like the following, but obviously it does not work:               for word in $(cat charList)$(cat charlist); do echo ${word}; done


title: Is there any PF log parser for FreeBSD

text: I am runing FreeBSD 8 stable with PF as firewall, I am looking for any tool for parsing PF log's.


title: Repairing CentOS 6.5 permissions after file migration

text: I'm running CentOS 6.5 in a VirtualBox VM. Recently, I ran out of space for my virtual hard disk. To remedy this, I decided to create a second hard disk for the `/usr` directory. I mounted that and copied over files as root with `rsync -a /usr.bak /usr`. This seemed to have preserved all file ownership and permissions. However, now I'm getting weird permission issues. While I can boot the system just fine, various things don't work, like:   1. The network adapter doesn't work `sudo service network restart` fails while "Determining IP information for eth0."   2. Doing an ACPI shutdown no-longer pops up the same dialog in Gnome.   3. I see some "/usr/bin/logger: Permission denied" errors. I had disabled SELinux earlier, so I don't think this is interfering. I also tried to fix permissions by running this as root, but the problem persists:               for i in `rpm -qa`;do rpm --setperms $i;done      What could have been messed up in my copying files using `rsync` to this new mount point? Anything I can do to repair things? Note that this is a development sandbox, so I'm not super concerned if a fix would involve a non- ideal security setup.


title: How to set the resolution in text consoles (troubleshoot when any `vga=...` fails)

text: It is a common way to set the resolution of a text consoles (that are usually available by Ctrl-Alt-F1 thru Ctrl-Alt-F6) by using a `vga=...` kernel parameter. I'm using Ubuntu 10.04 Lucid, output of `uname -a` is: > Linux 2.6.32-33-generic #70-Ubuntu SMP Thu Jul 7 21:13:52 UTC 2011 x86_64 > GNU/Linux To identify modes available i use the `sudo hwinfo --framebuffer` which reports: > 02: None 00.0: 11001 VESA Framebuffer   >  [Created at bios.464]   >  Unique ID: rdCR.R1b4duaxSqA   >  Hardware Class: framebuffer   >  Model: "NVIDIA G73 Board - p456h1 "   >  Vendor: "NVIDIA Corporation"   >  Device: "G73 Board - p456h1 "   >  SubVendor: "NVIDIA"   >  SubDevice:   >  Revision: "Chip Rev"   >  Memory Size: 256 MB   >  Memory Range: 0xc0000000-0xcfffffff (rw)   >  Mode 0x0300: 640x400 (+640), 8 bits   >  Mode 0x0301: 640x480 (+640), 8 bits   >  Mode 0x0303: 800x600 (+800), 8 bits   >  Mode 0x0305: 1024x768 (+1024), 8 bits   >  Mode 0x0307: 1280x1024 (+1280), 8 bits   >  Mode 0x030e: 320x200 (+640), 16 bits   >  Mode 0x030f: 320x200 (+1280), 24 bits   >  Mode 0x0311: 640x480 (+1280), 16 bits   >  Mode 0x0312: 640x480 (+2560), 24 bits   >  Mode 0x0314: 800x600 (+1600), 16 bits   >  Mode 0x0315: 800x600 (+3200), 24 bits   >  Mode 0x0317: 1024x768 (+2048), 16 bits   >  Mode 0x0318: 1024x768 (+4096), 24 bits   >  Mode 0x031a: 1280x1024 (+2560), 16 bits   >  Mode 0x031b: 1280x1024 (+5120), 24 bits   >  Mode 0x0330: 320x200 (+320), 8 bits   >  Mode 0x0331: 320x400 (+320), 8 bits   >  Mode 0x0332: 320x400 (+640), 16 bits   >  Mode 0x0333: 320x400 (+1280), 24 bits   >  Mode 0x0334: 320x240 (+320), 8 bits   >  Mode 0x0335: 320x240 (+640), 16 bits   >  Mode 0x0336: 320x240 (+1280), 24 bits   >  Mode 0x033d: 640x400 (+1280), 16 bits   >  Mode 0x033e: 640x400 (+2560), 24 bits   >  Config Status: cfg=new, avail=yes, need=no, active=unknown It looks like many hi-res modes are available, like 0x305, 0x307, 0x317, 0x318, 0x31a, 0x31b (by the way, what does the plus-number means in the list of modes?). However, setting any of these modes in kernel option string, line `vga=0x305`, results in either pitch black text console, or screen filled by blinking color/bw dots. What is the 'modern', 'robust' way to set up high resolution in text consoles?


title: Grub dual boot without countdown

text: Is it possible to configure grub to have a dual boot setup behaving like described below?   * When turning on PC and doing nothing, the default system should start as soon as possible without waiting for a countdown.   * When wanting to boot another system, a key must be pressed to get to the normal grub menu to select a system. Furthermore, I recently switched from grub legacy to grub and discovered that it takes notably longer to load before the menu shows up... Is it possible to reduce this time and get a fast boot? My current `/boot/grub/grub.cfg`: grub.cfg


title: Standard and/or common directories on Unix/Linux OSes

text: Coming from the Windows world, I have found the majority of the ~~folder~~ directory names to be quite intuitive:   * `\Program Files` contains files used by programs (surprise!)   * `\Program Files (x86)` contains files used by 32-bit programs on 64-bit OSes   * `\Users` (formerly `Documents and Settings`) contains users' files, i.e. documents and settings     * `\Users\USER\Application Data` contains application-specific data     * `\Users\USER\Documents` contains documents belonging to the user   * `\Windows` contains files that belong to the operation of Windows itself     * `\Windows\Fonts` stores font files (surprise!)     * `\Windows\Temp` is a global temporary directory et cetera. Even if I had no idea what these folders did, I could guess with good accuracy from their names. Now I'm taking a good look at Linux, and getting quite confused about how to find my way around the file system. For example:   * `/bin` contains binaries. But so do `/sbin`, `/usr/bin`, `/usr/sbin`, and probably more that I don't know about. Which is which?? What is the difference between them? If I want to make a binary and put it somewhere system-wide, where do I put it?   * `/media` contains external media file systems. But so does `/mnt`. And neither of them contain anything on my system at the moment; everything seems to be in `/dev`. What's the difference? Where are the other partitions on my hard disk, like the `C:` and `D:` that were in Windows?   * `/home` contains the user files and settings. That much is intuitive, but then, what is supposed to go into `/usr`? And how come `/root` is still separate, even though it's a user with files and settings?   * `/lib` contains shared libraries, like DLLs. But so does `/usr/lib`. What's the difference?   * What **_is_** `/etc`? Does it really stand for "et cetera", or something else? What kinds of files should go in there -- global or local? Is it a catch-all for things no one knew where to put, or is there a particular use case for it?   * What are `/opt`, `/proc`, and `/var`? What do they stand for and what are they used for? I haven't seen anything like them in Windows*, and I just can't figure out what they might be for. If anyone can think of other standard places that might be good to know about, feel free to add it to the question; hopefully this can be a good reference for people like me, who are starting to get familiar with *nix systems. *OK, that's a lie. I've seen similar things in WinObj, but obviously not on a regular basis. I still don't know what these do on Linux, though.


title: The second monitor displays with a resolution of 640x480

text: The system does not detect my second monitor connected the DVI. Appears in the settings of the words "digital device" and adjustment increase that I can set the resolution to 640x480. At D_SUB see each correctly. What do I need to do to properly operate the space of two monitors? system - Linux Mint 13,   Graphics Card - GeFroce GT520,   monitor 1 - ViewSonic VA1903wb (plugged into D_SUB),   monitor 2 - LG Flatron L1919S ( plugged into DVI using an adapter DVI--> D_SUB,   the nvidia drivers - version 304.60 Result of `xrandr -q` command.               xrandr -q          Screen 0: minimum 8 x 8, current 2080 x 900, maximum 16384 x 16384     DVI-I-0 connected 640x480+1440+0 (normal left inverted right x axis y axis) 0mm x 0mm        640x480        59.9*+        320x240       120.1       VGA-0 connected 1440x900+0+0 (normal left inverted right x axis y axis) 410mm x 256mm        1440x900       59.9*+   75.0          1280x1024      75.0     60.0          1280x960       60.0          1152x864       75.0          1024x768       75.0     70.1     60.0          800x600        75.0     72.2     60.3     56.2          640x480        75.0     72.8     59.9       DVI-I-1 disconnected (normal left inverted right x axis y axis)     HDMI-0 disconnected (normal left inverted right x axis y axis)      My xorg.conf               # nvidia-settings: X configuration file generated by nvidia-settings     # nvidia-settings:  version 304.60  (buildmeister@swio-display-x86-rhel47-13)  Sun Oct 14 21:19:07 PDT 2012          # nvidia-xconfig: X configuration file generated by nvidia-xconfig     # nvidia-xconfig:  version 304.60  (buildmeister@swio-display-x86-rhel47-13)  Sun Oct 14 21:19:18 PDT 2012          Section "ServerLayout"         Identifier     "Layout0"         Screen      0  "Screen0" 0 0         InputDevice    "Keyboard0" "CoreKeyboard"         InputDevice    "Mouse0" "CorePointer"         Option         "Xinerama" "0"     EndSection          Section "Files"     EndSection          Section "InputDevice"              # generated from default         Identifier     "Mouse0"         Driver         "mouse"         Option         "Protocol" "auto"         Option         "Device" "/dev/psaux"         Option         "Emulate3Buttons" "no"         Option         "ZAxisMapping" "4 5"     EndSection          Section "InputDevice"              # generated from default         Identifier     "Keyboard0"         Driver         "kbd"     EndSection          Section "Monitor"         Identifier     "Monitor0"         VendorName     "Unknown"         ModelName      "CRT-0"         HorizSync       28.0 - 33.0         VertRefresh     43.0 - 72.0         Option         "DPMS"     EndSection          Section "Device"         Identifier     "Device0"         Driver         "nvidia"         VendorName     "NVIDIA Corporation"         BoardName      "GeForce GT 520"     EndSection          Section "Screen"         Identifier     "Screen0"         Device         "Device0"         Monitor        "Monitor0"         DefaultDepth    24         Option         "Stereo" "0"         Option         "nvidiaXineramaInfoOrder" "CRT-1"         Option         "metamodes" "CRT-0: nvidia-auto-select +1440+0, CRT-1: nvidia-auto-select +0+0"         SubSection     "Display"             Depth       24         EndSubSection     EndSection      I tried to add the code below, but it did not help.               Identifier     "Monitor0"     VendorName     "Unknown"     ModelName      "LG Flatron L1919S"     HorizSync       28.0 - 33.0     VertRefresh     43.0 - 72.0     Modeline       "1280x960_60.00"  102.10  1280 1360 1496 1712  960 961 964 994  -HSync +Vsync     Option         "DPMS"      This may be due to the adapter?


title: ftp server log to include more information

text: I am implementing the ftp server on linux box (fedora 11, `vsftpd`). Everything works good so far but i need Ftp server log files to contain transfer rate information. At the moment when I use "get " or " put" command from client end , I got following message on ftp client example               ftp: 18 bytes received in 0.00seconds 18000.00kbytes/sec.      Is there is any way , I can get same message on ftp server side? Below is the sample of my xferlog file               Tue Oct 23 01:28:52 2012 1 10.65.112.55 1 /home/test/testfile b _ o r test ftp 0 * c      Tue Oct 23 01:32:46 2012 1 10.65.112.55 18 /home/test/uploadServer b _ i r test ftp 0 * c      Tue Oct 23 01:50:23 2012 1 192.168.10.27 1 /home/test/testfile a _ o r test ftp 0 * c      Tue Oct 23 01:50:36 2012 1 192.168.10.27 19 /home/test/test a _ i r test ftp 0 * c


title: Arithmetic operations in regex

text: I am using gedit regex plugin (Python style regex). I would like to do some arithmetic operation on a backreference to a group. For example:               PART 1 DATA MODELS Chapter       2 Entity-Relationship Model 27      I would like to change it to be               PART 1 DATA MODELS Chapter  25     2 Entity-Relationship Model 27      My regex is `^(PART.*)\n(.*\s(\d+))\n`, and I would like to replace it with `\1 \3-2\n\2\n`. But the replacing regex is not right.


title: Copy of full swap file is empty

text: I use a swap file (/mnt/swap). The swap works right. I need to get an access to the data stored in. When it's full of data in some part (which I can see typing "free" in terminal), I copy the file to another location and then open it in hex editor. The swap is full of "00" like it were empty (or it actually is?). I'm not advanced user of Linux and probably I'm doing something wrong, but all works when I do the same with /proc/kcore - I can see the data in the copy which was stored in ram during copying. Moreover, can I try to open my swap file in hex editor when the swap is working (only for read)? Isn't it dangerous?


title: How can I list LS_COLORS in colour?

text: I recall that `eval "dircolors -b"` used to display the colours that `LS_COLORS` was using, based on the file types or extensions. It was not simply the colour values that were displayed _but the colours themselves._ I could see the colour in which a `.png` or `.ogg` file would be displayed and change it if needed through a custom file. I find that the output of `eval "dircolors -b"` is no more in colour. Can someone kindly explain how I might get it back? Perhaps some environment variable is not getting set. Otherwise, is there a workaround?


title: Can I create a new partition from the free space inside my reiserfs-formatted /home partition?

text: Ok, I have Ubuntu installed but I want to install Windows also (dual-boot). Problem is, I don't have a free partition. I have my root partition (15 GB), and my /home partition (300 GB). The home partition has about 50 GB free space, and it's formatted reiserfs. I've heard about tools like resize_reiserfs, and I even tried it yesterday - I shrunk my /home partition (it's on /dev/sda6) with the command:               resize_reiserfs -s -20G /dev/sda6      After that gparted showed that the partition itself was 280 GB, but there was no way to create a new partition from the 20 GB. I ended up running               resize_reiserfs -s +20G /dev/sda6      to restore my /home partition to its previous size.


title: How to start several jobs in different screen sessions in a Bash-script?

text: The programm I want use can be started via               ./myprogram < input_part1.txt > output_part1.txt      How can I start four jobs of `myporgram` in a `BASH`-script where each job runs in a separate `SCREEN`-session? The sessions do not exist before I start the script. I tried:               #!/bin/bash     screen -mdS test1 ./myporgram < input_part1.txt > output_part1.txt     screen -mdS test2 ./myporgram < input_part2.txt > output_part2.txt     screen -mdS test3 ./myporgram < input_part3.txt > output_part3.txt     screen -mdS test4 ./myporgram < input_part4.txt > output_part4.txt      but this does not work. Why not?


title: How to write a very simple wrapper that provides default parameters?

text: Given a program that requires some parameters, e.g. `program -in file.in -out file.out`, what would be the simple-most approach to write a bash script that could be called with or without any of these parameters and use default values for each? `script -in otherfile` would run `program -in otherfile -out file.out`,   `script -out otherout -furtherswitch` would run `program -in file.in -out otherout -furtherswitch` etc.


title: Which processes swaps memory

text: I can see swap's total, used, free etc. sizes from `top` command.   But I can't figure out which process uses swap, is it possible to find out swap memory by process? I'm running CentOS 6.3.


title: SSD Crash Randomly on Linux Mint 17

text: I'm running Mint (17 Qiana 64bit) on a fresh install on a new laptop (Dell N5110) with a new Crucial MX100 SSD and twice now the whole system has frozen up. If I switch to a text terminal (as in ctrl-alt-f1) and attempt to login I get the message `end_request:I/O error, dev sda, sector XXXXXXXXX` I've run both the Short offline and Extended offline tests from `gsmartcontrol`, and both have come back Completed without error. The firmware on my SSD is MU01, I can't find anything on Crucial which says whether or not there's a firmware update available. Any ideas what I should look at next? Is the SSD faulty? Driver issue? Laptop issue? Firmware issue? Don't really know where to start....


title: Create directory if zip archive contains several files

text: If an archive contains several files in the root directory, I'd like to create a directory named after the file name (without extension). If an archive contains just a directory, then I'd like to simply extract it. Assume I have the following archive:               # file: withdir.zip     somedir/alpha     somedir/beta     somedir/gamma      If I extract it in the current directory I'd like to have it simply extracted (`unzip withdir.zip`):               somedir/alpha     somedir/beta     somedir/gamma      Now assume the following archive:               # file: nodir.zip     alpha     beta     gamma      When I run `unzip nodir.zip` I end up cluttering the current directory with the three files:               alpha     beta     gamma      I'd rather run `unzip -d nodir nodir.zip`:               nodir/alpha     nodir/beta     nodir/gamma      If I use nautilus and right click on “Extract Here”. It behaves exactly as it should. But unfortunately I haven't found a command line switch for `unzip` or `7z` which yield the same behaviour. How to achieve that? Are there other tools I can use instead (no GUI)?


title: How to print pcl or esc/p code on host-driven printer?

text: I have a host-based printer (HP Deskjet D2460) and have some printer language files (pcl codes) that I would like to print out. I saw that in cups there are some filters like rastertopcl, etc. which converts a raster format, for cups that is postscript into pcl... How to do the inverse? If it is not possible, how to convert pcl to ps or pdf? A good little executable or python/perl script (interested in free solutions)


title: Bad sector on a directory

text: I've a bad sector on my `/home/xyz` which make a folder with 10 GB data unreadable. As far as I can see in syslog there's only one badsector with may destruct 4K of data while I have no access to 10 GB of it's inner data, Any suggestion on how to recover the data inside it?


title: Is it possible for sudo to read password from gnome-keyring or similar

text: I'm currently using sudo a lot in a bunch of scripts, which is turning into a bit of a hassle, as some scripts does not allow interactive input (e.g., Makefiles). Instead of disabling sudo passwords altogether I'm thinking it would be nice if gnome-keyring or some similar keyring software could be used to rememeber the password. Is this a good idea? Is it possible? Any better solution?


title: Linux, Debugger program development

text: We are trying to implement the debugger program which will takes either PID or Program name as input and Invoke the gdb by using PID. Below is two small programs are written, Not able to figure out what is the exact problem here... after passing PID, it shows 5000+ instructions are executed as a result. Debug.c               #include <stdio.h>     #include <stdarg.h>     #include <stdlib.h>     #include <signal.h>     #include <syscall.h>     #include <sys/ptrace.h>     #include <sys/types.h>     #include <sys/wait.h>     #include <sys/reg.h>     #include <sys/user.h>     #include <unistd.h>     #include <errno.h>               /* Print a message to stdout, prefixed by the process ID     */     void procmsg(const char* format, ...)     {         va_list ap;         fprintf(stdout, "[%d] ", getpid());         va_start(ap, format);         vfprintf(stdout, format, ap);         va_end(ap);     }               void run_target(const char* programname)     {         procmsg("target started. will run '%s'\n", programname);              /* Allow tracing of this process */         if (ptrace(PTRACE_TRACEME, 0, 0, 0) < 0) {             perror("ptrace");             return;         }              /* Replace this process's image with the given program */         execl(programname, programname, 0);     }               void run_debugger(pid_t child_pid)     {         int wait_status;         unsigned icounter = 0;         procmsg("debugger started\n");              /* Wait for child to stop on its first instruction */         wait(&wait_status);              while (WIFSTOPPED(wait_status)) {             icounter++;             struct user_regs_struct regs;             ptrace(PTRACE_GETREGS, child_pid, 0, &regs);             unsigned instr = ptrace(PTRACE_PEEKTEXT, child_pid, regs.eip, 0);                  procmsg("icounter = %u.  EIP = 0x%08x.  instr = 0x%08x\n",                         icounter, regs.eip, instr);                  /* Make the child execute another instruction */             if (ptrace(PTRACE_SINGLESTEP, child_pid, 0, 0) < 0) {                 perror("ptrace");                 return;             }                  /* Wait for child to stop on its next instruction */             wait(&wait_status);         }              procmsg("the child executed %u instructions\n", icounter);     }               int main(int argc, char** argv)     {         pid_t child_pid_attach;              if (argc < 2) {             fprintf(stderr, "Expected a program name as argument\n");             return -1;         }     sscanf(argv[1],"%d",&child_pid_attach);          //Attaching to running process     if(ptrace(PTRACE_ATTACH,child_pid_attach,0,0)<)     {     perror("ptrace");     return;     }     else     {     printf("%d",child_pid_attach);     }         if (child_pid_attach== 0)             run_target(argv[1]);         else if (child_pid_attach > 0)             run_debugger(child_pid_attach);         else {             perror("fork");             return -1;         }          ptrace(PTRACE_DETACH,child_pid_attach,0,0);         return 0;     }      The above program has been used to debug the process that is created by the following program (i.e sum of two numbers). test.c               #include<stdio.h>     void main()     {     int a, b, c;     scanf("%d", &a);     scanf("%d", &b);     printf("\n Sum of Two Numbers is:");     c=a+b;     printf("%d",c);     }      First, we are running ./test and then checking its pid. As a next step we are running ./Debug [pid]. As a result of the above execution, it is displaying that Child process has executed 5000+ instructions and it is printing the same instructions all the time. Please do let me know if there is any other way to do it and do let me know how to read the data of another process. In this case "How can I read the data (values of variables) of process that is created by ./test?".


title: What is the best linux distro for Google Apps development?

text: As there are just far too many distro's for an old RedHat user (in the 1990's,) to keep track of... I need to setup a few secure/reliable work stations to develop some basic google apps type programs. I'm new to the whole andriod/chromebook type OS, but I do enjoy how amazing the ~3.6v Gnome-shell is. I was thinking something like Solaris or Fedora, maybe? It will be running on a new Xenon server, so it doesn't need to be light at all! And I use a lot of Oracle VM's. Any advice would be appreciated.


title: Decrypt file using gpg in batch mode when passphrase includes a "!"?

text: I am trying to decrypt a file in a script with gpg batch mode, but command is not executed because the passphrase contains a "!"               echo "m!pass"|gpg --batch --passphrase-fd 0 --decrypt-file plain.gpg     bash: !pass": event not found      or               gpg --batch --passphrase "m!pass" -d plain.gpg      bash: !pass": event not found      I guess bash is interpreting the exclamation mark as a reference to the command execution history. Which would be the right way to do it in GPG batch mode?


title: How to splice sections of a video with avconv?

text: I have figured out so far that you can cut a section from a video with avconv with a command like this (cuts from 1:00-3:00):               avconv -ss 00:01:00 -i "input.avi" -t 00:02:00 -c:v libx264 -crf 23 "output.mp4"      But how would I cut two (or more) sections from the video and combine them into one video? For example, taking 1:00-3:00 as above, plus 8:00-10:00, making a final 4 minute video. I guess I can do them separately _then_ concatenate them, but is there a simpler way?


title: ifconfig -a in a shell script

text: I am writing a shell script to start my network in my virtual machine on boot, since it does not do this right away for some reason with a snapshot of a virtual machine. Since the `eth` device starts as being down, I have to get that device name with the following script and then start the device as well:               gateway=ifconfig -a | awk '/eth/ {print $1}'     dhclient $gateway      However I keep getting the following error, `line 1: -a: command not found`. `ifconfig -a` works however from the command line. Is there a way to get `ifconfig -a` to work in my shell script?


title: Pulseaudio over network - change output on-the-fly

text: I successfully configured PulseAudio server and client to send audio over network. It uses direct connection: http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Network/#index1h2 I'd like to have a possibility to switch between client and server sound card i.e. temporarily disable network stream and go back to internal sound device. Using module-tunnel-sink I could simply move sink-input to desired device but is not an option since it doesn't work well with Flash: > they lead me to believe that Flash is somehow sending the sound to > PulseAudio in such a way that it creates a lot of network traffic (think > lots of tiny packets, not bandwidth); this overwhelms the network "tunnel" > PulseAudio With direct connection I have to restart the application every time I want to switch the output. Any idea how can I solve this?


title: RPM skipping files on install

text: I am installing an rpm package and it appears to be skipping certain files without giving me any notice as to what the issue is. When I execute               rpm -ivh package_name.rpm      the rpm provides me with no indication that the installation failed. After executing this, I verify the installation:               rpm -V package_name      And I see that some files are reported as missing missing `/path/to/some/crucial/file` When I look into my / directory, I see that a few files were created which start with `u2dtmp*`. These are the files which do not get created. I have attempted to remove old locks from my rpm installation and cleaned the database `rpm --rebuilddb`, but nothing seems to allow these files to be installed successfully. This issue only appears on a single machine. It installs successfully on other linux machines which have the same os.


title: How interpret kworker threads names?

text: On a Linux kernel 3.11.0-13-generic running on top of a dual socket Xeon X5650 hexa core board running htop show different kworker threads. Sorted by names (I tweaked the result I am showing here a little bit to have the threads on core 2 before the ones on core 10) , the result is the following one:               kworker/0:0H     kworker/0:1     kworker/0:2     kworker/1:0     kworker/1:0H     kworker/1:1     kworker/2:0     kworker/2:0H     kworker/2:1     .....     kworker/11:0     kworker/11:0H     kworker/11:1     kworker/u48:0     kworker/u49:4     kworker/u49:5     kworker/u50:1     kworker/u50:2     .......      The threads which name start with a number are pinned to the core with the same number. So the first number is the core running the thread and I am wondering what the symbol after the `:` symbol (`0` or `0H` or `1`) is for these threads ? I am also wondering what is the meaning of the `uXX:Y` symbols ? I have only a vague knowledge of what kworker threads do: they are responsible to handle asynchronous events caused by system calls performing I/O. I couldn't find any documentation on them, is there such a document somewhere ?


title: How to interact with program from command line

text: Is there any method to interact with a program directly from the commmand line? For example, I've a program, `data.o`, which produces a file `mydata.out` and then I want to plot it with `gnuplot`. I can open the plotting program with `gnuplot &` and then I would like the shell to write somehow in this job/background shell I just opened `plot mydata.out`. (`gnuplot` is just an example, the question would be similar for executing some Macros or Hotkeys in every program I can open from the command line without leaving it).


title: Dmenu Processes Forked by Bash?

text: I was looking at the output of `pstree`, and realised that processes that I started using `dmenu` seem to fork from `bash`. What is the reasoning behind this? And is there any way I can make `dmenu` behave like `gmrun` and other application launchers and only launch the process? * * * **EDIT:** The `dmenu` manpage says that the shell execution behavior is correct for `dmenu_run`. Figuring out how to not make the shell persist after launching the program is what I am still looking for.


title: Sed find and replace with slashes

text: I am having trouble using sed find/replace with slashes in the find parameter. Sample contents of test.sh               str=$(sed -n '/^user:/p' /tmp/shadowtest) # find "user:" line in /etc/shadowtest     arr=(${str//:/ }) # explode str with : as delimeter     arr=${arr[1]} # grab the 2nd element     sed -i 's|$arr|XXXXX|g' /tmp/shadowtest # Nothing gets replaced in shadowtest      Sample contents of /tmp/shadowtest               # junk here     user:$6$hcwp49Lr$BjcJYc/nwaufmsOIw4Tw/POaXO4j.0HDLU0:16310:0:99999:7:::     # junk here      When I run the script as is, nothing gets replaced in the shadowtest file. But if I change the sed command to something like               sed -i 's|99999|XXXXX|g' /tmp/shadowtest      it works fine.


title: Can't ping gateway after bridge

text: I am running CentOS 6.3 with NetworkManager disabled. I was trying to set up a network bridge to try out setting up guests w/ kvm. I was creating a bridge before setting up stuff with kvm, just since I wasn't too familiar with it. Something didn't go right and I couldn't ping the gateway ip or anything past it with the bridge in place. The ip, netmask, and gateway are all correct. Before this bridging, the network worked fine. I created the bridge (ifcfg-br0)               DEVICE=br0     BOOTPROTO=none     IPADDR=xx.xx.xx.xx     NETMASK=255.255.255.248     GATEWAY=xx.xx.xx.xx     ONBOOT=yes     TYPE=Bridge     STP=on     DELAY=0      then I edited the ifcfg-eth0 and removed the ip, netmask, gateway, from there and set it to bridge br0. I restarted network, then used `brctl show` to see that the bridge was made. It showed up in there. This is the point in which I couldn't ping my gateway or anything past. Since that didn't work, I figured I would just remove the bridge and not mess around with that anymore. I used `brctl delif br0 eth0` and `brctl delbr br0` to remove the bridge. Then I deleted the ifcfg-br0 file and added the ip, netmask, and gateway back into the ifcfg-eth0 file. Now, I still can't ping the gateway or anything past it from this machine. `route -n` shows the same route that was in place before I started adding a bridge. Currently, I am accessing the server console through ipmi. Any help with what to look for that could cause this hiccup?


title: mv deleted my directory. Why?

text: I was trying to correct the spelling on a directory, issued a _mv_ command, and the directory is now gone. I'd like to understand--specifically--what happened. Here's the command I ran:               mv micheal_franti_theme/ michael_franti_theme/      ~~I understand there the slashes shouldn't be included: I was moving fast and used auto-complete.~~ The command ran without any errors or warnings. I tried using _find_ for both the old and new spellings, but neither returned any results. So, what happened? What did _mv_ actually do? Any chance of recovering the directory and its contents? ext4 on CentOS 6.5; mv version 8.4 ## Additional Info Not sure why this is getting down votes. There was a directory named "micheal_franti_theme". I ran the above command, then ran _ls_. No more directory. No directory named "michael_franti_theme" existed anywhere on the file system when I ran that command. As you can see from the command, the context is within the same sub-directory, so _mv_ would have just updated the inode table (vs copying between file systems). I ran the following:               sudo find / -name micheal_franti_theme      No results. The directory is gone All commands posted in this question were copied directly from the command prompt. I've been using Linux regularly for over a decade. I've never seen this happen before, so I'm bringing it to serverfault. actual results are long gone from the scrollback buffer, but here are the relevant lines from _history_ :               1097  ls     1098  mv micheal_franti_theme/ michael_franti_theme/     1099  ls     1100  find / -name michael_franti_theme 2>/dev/null     1101  find / -name micheal_franti_theme 2>/dev/null     1102  sudo find / -name michael_franti_theme     1103  sudo find / -name micheal_franti_theme


title: Using pushd and popd

text: Say I do the following:               cd ~     pushd .     cd /bin/     pushd .     dirs     "/bin/ ~/     cd ~/Downloads/     pushd .     dirs     ~/Downloads /bin/ ~"      How would I `popd` back to something a while ago, say from downloads to the home directory`~`?


title: Find directories with a certain name

text: How can I loop through each directory recursively and whenever it finds a folder called VIDEO_TS, let Genisoimage convert that folder's content to an dvd-video iso image, the name of the iso would be the parent folder's name. The command that I use for a single directory:               genisoimage -o movie_1.iso -dvd-video /shares/media/movies/Movie 1      And this is the script I got:               #!/bin/bash     parent_path=""     full_path=""          for file in $(find /shares/media/ -type d -name 'VIDEO_TS')     do          parent_path="$(dirname -- "$file")"     full_path="$file"          done      So I got the parent path and the full path to the VIDEO_TS directory.               parent_path="/shares/media/Movie One/"     full_path="/shares/media/Movie One/VIDEO_TS/"      How can I get only the Movie One from parent_path? And when I use sprintf to echo both variables, either spaces get removed or replaced with a line break. Is it safe to use those variables with the command?


title: Kde: how to bind permanently an application to a desktop/activity?

text: Im pretty new to Kde 4.8 and i can not figure out how to get this behaviour that i used to have in Gnome:   1. Desktop 1: developer/misc (browser, editor/ide, diff, etc..)   2. Desktop 2: virtual machines (vbox)   3. Desktop 3: graphic (gimp, inkscape, phatch)   4. Desktop 4: file management (ftp, ssh, etc..) In gnome is possible to configure the windows to **always** appear in a specific desktop, and this is what i want to achieve in Kde. I googled around so much, and looks like activities cant do that (yet), becose using the window's menu only works for the current session, and get lost after reboot. By the way, I suppose that activities _can_ do that, becose in the default activities that come with Kde 4.8 Gimp used to show only in the _photo_ activity (I gave a look to the activity configuration but I didnt find anything about this behavior)... Onestly, my goal is to obtain this scenario, if is not possible with activities but with desktops, for me is ok. So, any idea on how to obtain this behavior in Kde 4.8? I already read this similar question, but im looking for a _permanent_ solution...