title: Kernel hangs at "bootconsole [earlycon0] disabled"

text: Booting petalinux on Microzed board (ARM-Cortex A9). Compiled source code, DTS, and fpga.bin. Every thing is going fine till it hangs at > "bootconsole [earlycon0] disabled" I am using u-boot-SPL to boot linux as can be seen in the log messages. These are the log messages:               [Mon May 12 18:33:00.027 2014]      [Mon May 12 18:33:00.027 2014] U-Boot SPL 2014.01 (May 12 2014 - 16:08:58)     [Mon May 12 18:33:00.027 2014] mmc boot     [Mon May 12 18:33:00.074 2014] reading fpga.bin     [Mon May 12 18:33:00.308 2014] zynq_align_dma_buffer: Bitstream is not swapped(1) - swap it     [Mon May 12 18:33:00.573 2014] reading system.dtb     [Mon May 12 18:33:00.589 2014] spl: error reading image system.dtb, err - -1     [Mon May 12 18:33:00.589 2014] reading u-boot.img     [Mon May 12 18:33:00.589 2014] reading u-boot.img     [Mon May 12 18:33:00.651 2014]      [Mon May 12 18:33:00.651 2014]      [Mon May 12 18:33:00.651 2014] U-Boot 2014.01 (May 12 2014 - 16:08:58)     [Mon May 12 18:33:00.651 2014]      [Mon May 12 18:33:00.651 2014] I2C:   ready     [Mon May 12 18:33:00.651 2014] Memory: ECC disabled     [Mon May 12 18:33:00.651 2014] DRAM:  1 GiB     [Mon May 12 18:33:00.667 2014] MMC:   zynq_sdhci: 0     [Mon May 12 18:33:00.667 2014] Using default environment     [Mon May 12 18:33:00.667 2014]      [Mon May 12 18:33:00.667 2014] In:    serial     [Mon May 12 18:33:00.667 2014] Out:   serial     [Mon May 12 18:33:00.667 2014] Err:   serial     [Mon May 12 18:33:00.667 2014] Net:   Gem.e000b000     [Mon May 12 18:33:00.667 2014]      [Mon May 12 18:33:00.729 2014] Device: zynq_sdhci     [Mon May 12 18:33:00.729 2014] Manufacturer ID: 2     [Mon May 12 18:33:00.729 2014] OEM: 544d     [Mon May 12 18:33:00.729 2014] Name: SA02G      [Mon May 12 18:33:00.729 2014] Tran Speed: 50000000     [Mon May 12 18:33:00.729 2014] Rd Block Len: 512     [Mon May 12 18:33:00.729 2014] SD version 3.0     [Mon May 12 18:33:00.729 2014] High Capacity: No     [Mon May 12 18:33:00.729 2014] Capacity: 1.8 GiB     [Mon May 12 18:33:00.729 2014] Bus Width: 4-bit     [Mon May 12 18:33:00.729 2014] reading uEnv.txt     [Mon May 12 18:33:00.745 2014] ** Unable to read file uEnv.txt **     [Mon May 12 18:33:00.745 2014] Copying Linux from SD to RAM...     [Mon May 12 18:33:00.745 2014] reading uImage     [Mon May 12 18:33:01.073 2014] 3588280 bytes read in 322 ms (10.6 MiB/s)     [Mon May 12 18:33:01.073 2014] reading devicetree.dtb     [Mon May 12 18:33:01.088 2014] 6804 bytes read in 19 ms (349.6 KiB/s)     [Mon May 12 18:33:01.104 2014] reading uramdisk.image.gz     [Mon May 12 18:33:01.603 2014] 5310018 bytes read in 470 ms (10.8 MiB/s)     [Mon May 12 18:33:01.603 2014] ## Booting kernel from Legacy Image at 03000000 ...     [Mon May 12 18:33:01.603 2014]    Image Name:   Linux-3.13.0-xilinx-dirty     [Mon May 12 18:33:01.603 2014]    Image Type:   ARM Linux Kernel Image (uncompressed)     [Mon May 12 18:33:01.603 2014]    Data Size:    3588216 Bytes = 3.4 MiB     [Mon May 12 18:33:01.603 2014]    Load Address: 00008000     [Mon May 12 18:33:01.603 2014]    Entry Point:  00008000     [Mon May 12 18:33:01.603 2014]    Verifying Checksum ... OK     [Mon May 12 18:33:01.665 2014] ## Loading init Ramdisk from Legacy Image at 02000000 ...     [Mon May 12 18:33:01.665 2014]    Image Name:        [Mon May 12 18:33:01.665 2014]    Image Type:   ARM Linux RAMDisk Image (gzip compressed)     [Mon May 12 18:33:01.665 2014]    Data Size:    5309954 Bytes = 5.1 MiB     [Mon May 12 18:33:01.665 2014]    Load Address: 00000000     [Mon May 12 18:33:01.665 2014]    Entry Point:  00000000     [Mon May 12 18:33:01.665 2014]    Verifying Checksum ... OK     [Mon May 12 18:33:01.743 2014] ## Flattened Device Tree blob at 02a00000     [Mon May 12 18:33:01.743 2014]    Booting using the fdt blob at 0x2a00000     [Mon May 12 18:33:01.743 2014]    Loading Kernel Image ... OK     [Mon May 12 18:33:01.790 2014]    Loading Ramdisk to 1faef000, end 1ffff602 ... OK     [Mon May 12 18:33:01.821 2014]    Loading Device Tree to 1faea000, end 1faeea93 ... OK     [Mon May 12 18:33:01.821 2014]      [Mon May 12 18:33:01.821 2014] Starting kernel ...     [Mon May 12 18:33:01.821 2014]      [Mon May 12 18:33:01.837 2014] Uncompressing Linux... done, booting the kernel.     [Mon May 12 18:33:02.165 2014] [    0.000000] Booting Linux on physical CPU 0x0     [Mon May 12 18:33:02.165 2014] [    0.000000] Linux version 3.13.0-xilinx-dirty (root@zaidi) (gcc version 4.7.3 (Sourcery CodeBench Lite 2013.05-40) ) #1 SMP PREEMPT Mon May 12 16:37:39 IST 2014     [Mon May 12 18:33:02.165 2014] [    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d     [Mon May 12 18:33:02.165 2014] [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache     [Mon May 12 18:33:02.165 2014] [    0.000000] Machine model: Xilinx Zynq     [Mon May 12 18:33:02.165 2014] [    0.000000] bootconsole [earlycon0] enabled     [Mon May 12 18:33:02.165 2014] [    0.000000] Memory policy: Data cache writealloc     [Mon May 12 18:33:02.274 2014] [    0.000000] PERCPU: Embedded 8 pages/cpu @c143f000 s10688 r8192 d13888 u32768     [Mon May 12 18:33:02.274 2014] [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260624     [Mon May 12 18:33:02.274 2014] [    0.000000] Kernel command line: console=ttyPS0,115200n8 root=/dev/ram rw initrd=0x00800000,16M earlyprintk mtdparts=physmap-flash.0:512K(nor-fsbl),512K(nor-u-boot),5M(nor-linux),9M(nor-user),1M(nor-scratch),-(nor-rootfs)     [Mon May 12 18:33:02.274 2014] [    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)     [Mon May 12 18:33:02.289 2014] [    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)     [Mon May 12 18:33:02.289 2014] [    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)     [Mon May 12 18:33:02.508 2014] [    0.000000] Memory: 1021760K/1048576K available (4857K kernel code, 310K rwdata, 1708K rodata, 198K init, 5345K bss, 26816K reserved, 270336K highmem)     [Mon May 12 18:33:02.508 2014] [    0.000000] Virtual kernel memory layout:     [Mon May 12 18:33:02.508 2014] [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)     [Mon May 12 18:33:02.508 2014] [    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)     [Mon May 12 18:33:02.508 2014] [    0.000000]     vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)     [Mon May 12 18:33:02.508 2014] [    0.000000]     lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)     [Mon May 12 18:33:02.508 2014] [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)     [Mon May 12 18:33:02.523 2014] [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)     [Mon May 12 18:33:02.523 2014] [    0.000000]       .text : 0xc0008000 - 0xc0671828   (6567 kB)     [Mon May 12 18:33:02.523 2014] [    0.000000]       .init : 0xc0672000 - 0xc06a39c0   ( 199 kB)     [Mon May 12 18:33:02.523 2014] [    0.000000]       .data : 0xc06a4000 - 0xc06f1ad0   ( 311 kB)     [Mon May 12 18:33:02.523 2014] [    0.000000]        .bss : 0xc06f1adc - 0xc0c2a1b0   (5346 kB)     [Mon May 12 18:33:02.555 2014] [    0.000000] Preemptible hierarchical RCU implementation.     [Mon May 12 18:33:02.555 2014] [    0.000000]   RCU lockdep checking is enabled.     [Mon May 12 18:33:02.555 2014] [    0.000000]   Dump stacks of tasks blocking RCU-preempt GP.     [Mon May 12 18:33:02.555 2014] [    0.000000]   RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.     [Mon May 12 18:33:02.555 2014] [    0.000000] NR_IRQS:16 nr_irqs:16 16     [Mon May 12 18:33:02.570 2014] [    0.000000] ps7-slcr mapped to f0004000     [Mon May 12 18:33:02.570 2014] [    0.000000] zynq_clock_init: clkc starts at f0004100     [Mon May 12 18:33:02.570 2014] [    0.000000] Zynq clock init     [Mon May 12 18:33:02.586 2014] [    0.000000] sched_clock: 32 bits at 333MHz, resolution 3ns, wraps every 12884901885ns     [Mon May 12 18:33:02.586 2014] [    0.000000] ps7-ttc #0 at f0006000, irq=43     [Mon May 12 18:33:02.601 2014] [    0.000000] Console: colour dummy device 80x30     [Mon May 12 18:33:02.601 2014] [    0.000000] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar     [Mon May 12 18:33:02.648 2014] [    0.000000] ... MAX_LOCKDEP_SUBCLASSES:  8     [Mon May 12 18:33:02.648 2014] [    0.000000] ... MAX_LOCK_DEPTH:          48     [Mon May 12 18:33:02.648 2014] [    0.000000] ... MAX_LOCKDEP_KEYS:        8191     [Mon May 12 18:33:02.648 2014] [    0.000000] ... CLASSHASH_SIZE:          4096     [Mon May 12 18:33:02.648 2014] [    0.000000] ... MAX_LOCKDEP_ENTRIES:     16384     [Mon May 12 18:33:02.648 2014] [    0.000000] ... MAX_LOCKDEP_CHAINS:      32768     [Mon May 12 18:33:02.648 2014] [    0.000000] ... CHAINHASH_SIZE:          16384     [Mon May 12 18:33:02.648 2014] [    0.000000]  memory used by lock dependency info: 3695 kB     [Mon May 12 18:33:02.648 2014] [    0.000000]  per task-struct memory footprint: 1152 bytes     [Mon May 12 18:33:02.648 2014] [   12.877213] Calibrating delay loop... 1325.46 BogoMIPS (lpj=6627328)     [Mon May 12 18:33:02.679 2014] [   12.877220] pid_max: default: 32768 minimum: 301     [Mon May 12 18:33:02.695 2014] [   12.877221] Mount-cache hash table entries: 512     [Mon May 12 18:33:02.711 2014] [   12.877223] CPU: Testing write buffer coherency: ok     [Mon May 12 18:33:02.711 2014] [   12.877224] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000     [Mon May 12 18:33:02.711 2014] [   12.877225] Setting up static identity map for 0x49ad18 - 0x49ad70     [Mon May 12 18:33:02.726 2014] [   12.877226] L310 cache controller enabled     [Mon May 12 18:33:02.726 2014] [   12.877227] l2x0: 8 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x72460000, Cache size: 512 kB     [Mon May 12 18:33:02.929 2014] [   12.877242] CPU1: Booted secondary processor     [Mon May 12 18:33:02.929 2014] [   12.877256] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001     [Mon May 12 18:33:02.929 2014] [   12.877256] Brought up 2 CPUs     [Mon May 12 18:33:02.929 2014] [   12.877258] SMP: Total of 2 processors activated.     [Mon May 12 18:33:02.929 2014] [   12.877259] CPU: All CPU(s) started in SVC mode.     [Mon May 12 18:33:02.929 2014] [   12.877260] devtmpfs: initialized     [Mon May 12 18:33:02.945 2014] [   12.877262] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4     [Mon May 12 18:33:02.960 2014] [   12.877264] regulator-dummy: no parameters     [Mon May 12 18:33:02.960 2014] [   12.877265] NET: Registered protocol family 16     [Mon May 12 18:33:02.960 2014] [   12.877266] DMA: preallocated 256 KiB pool for atomic coherent allocations     [Mon May 12 18:33:02.976 2014] [   12.877268] cpuidle: using governor ladder     [Mon May 12 18:33:02.976 2014] [   12.877269] cpuidle: using governor menu     [Mon May 12 18:33:03.007 2014] [   12.877273] syscon f8000000.ps7-slcr: regmap [mem 0xf8000000-0xf8000fff] registered     [Mon May 12 18:33:03.023 2014] [   12.877274] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.     [Mon May 12 18:33:03.023 2014] [   12.877276] hw-breakpoint: maximum watchpoint size is 4 bytes.     [Mon May 12 18:33:03.038 2014] [   12.877277] zynq-ocm f800c000.ps7-ocmc: ZYNQ OCM pool: 256 KiB @ 0xf0080000     [Mon May 12 18:33:03.085 2014] [   12.877287] bio: create slab <bio-0> at 0     [Mon May 12 18:33:03.101 2014] [   12.877288] vgaarb: loaded     [Mon May 12 18:33:03.101 2014] [   12.877289] SCSI subsystem initialized     [Mon May 12 18:33:03.116 2014] [   12.877290] usbcore: registered new interface driver usbfs     [Mon May 12 18:33:03.116 2014] [   12.877291] usbcore: registered new interface driver hub     [Mon May 12 18:33:03.116 2014] [   12.877291] usbcore: registered new device driver usb     [Mon May 12 18:33:03.132 2014] [   12.877293] media: Linux media interface: v0.10     [Mon May 12 18:33:03.132 2014] [   12.877293] Linux video capture interface: v2.00     [Mon May 12 18:33:03.147 2014] [   12.877294] pps_core: LinuxPPS API ver. 1 registered     [Mon May 12 18:33:03.147 2014] [   12.877295] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>     [Mon May 12 18:33:03.147 2014] [   12.877297] PTP clock support registered     [Mon May 12 18:33:03.163 2014] [   12.877297] EDAC MC: Ver: 3.0.0     [Mon May 12 18:33:03.179 2014] [   12.877300] DMA-API: preallocated 4096 debug entries     [Mon May 12 18:33:03.179 2014] [   12.877301] DMA-API: debugging enabled by kernel config     [Mon May 12 18:33:03.179 2014] [   12.877301] Switched to clocksource arm_global_timer     [Mon May 12 18:33:03.241 2014] [   12.877310] NET: Registered protocol family 2     [Mon May 12 18:33:03.241 2014] [   12.877311] TCP established hash table entries: 8192 (order: 3, 32768 bytes)     [Mon May 12 18:33:03.257 2014] [   12.877313] TCP bind hash table entries: 8192 (order: 6, 294912 bytes)     [Mon May 12 18:33:03.257 2014] [   12.877314] TCP: Hash tables configured (established 8192 bind 8192)     [Mon May 12 18:33:03.272 2014] [   12.877315] TCP: reno registered     [Mon May 12 18:33:03.272 2014] [   12.877316] UDP hash table entries: 512 (order: 3, 40960 bytes)     [Mon May 12 18:33:03.288 2014] [   12.877317] UDP-Lite hash table entries: 512 (order: 3, 40960 bytes)     [Mon May 12 18:33:03.288 2014] [   12.877318] NET: Registered protocol family 1     [Mon May 12 18:33:03.319 2014] [   12.877319] RPC: Registered named UNIX socket transport module.     [Mon May 12 18:33:03.319 2014] [   12.877320] RPC: Registered udp transport module.     [Mon May 12 18:33:03.319 2014] [   12.877321] RPC: Registered tcp transport module.     [Mon May 12 18:33:03.319 2014] [   12.877322] RPC: Registered tcp NFSv4.1 backchannel transport module.     [Mon May 12 18:33:03.319 2014] [   12.877323] Trying to unpack rootfs image as initramfs...     [Mon May 12 18:33:03.319 2014] [   12.877324] rootfs image is not initramfs (no cpio magic); looks like an initrd     [Mon May 12 18:33:03.366 2014] [   12.877331] Freeing initrd memory: 5184K (dfaef000 - dffff000)     [Mon May 12 18:33:03.381 2014] [   12.877332] hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available     [Mon May 12 18:33:03.397 2014] [   12.877335] bounce pool size: 64 pages     [Mon May 12 18:33:03.397 2014] [   12.877336] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.     [Mon May 12 18:33:03.413 2014] [   12.877338] msgmni has been set to 1477     [Mon May 12 18:33:03.428 2014] [   12.877339] io scheduler noop registered     [Mon May 12 18:33:03.428 2014] [   12.877339] io scheduler deadline registered     [Mon May 12 18:33:03.428 2014] [   12.877340] io scheduler cfq registered (default)     [Mon May 12 18:33:03.459 2014] [   12.877343] dma-pl330 f8003000.ps7-dma: unable to set the seg size     [Mon May 12 18:33:03.459 2014] [   12.877344] dma-pl330 f8003000.ps7-dma: Loaded driver for PL330 DMAC-2364208     [Mon May 12 18:33:03.459 2014] [   12.877345] dma-pl330 f8003000.ps7-dma:   DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16     [Mon May 12 18:33:03.475 2014] [   12.877347] e0001000.serial: ttyPS1 at MMIO 0xe0001000 (irq = 82, base_baud = 3124999) is a xuartps     [Mon May 12 18:33:03.475 2014] [   12.877349] xdevcfg f8007000.ps7-dev-cfg: ioremap 0xf8007000 to f0068000     [Mon May 12 18:33:03.506 2014] [   12.877355] brd: module loaded     [Mon May 12 18:33:03.522 2014] [   12.877358] loop: module loaded     [Mon May 12 18:33:03.553 2014] [   12.877360] zynq-qspi e000d000.ps7-qspi: master is unqueued, this is deprecated     [Mon May 12 18:33:03.553 2014] [   12.877361] zynq-qspi e000d000.ps7-qspi: at 0xE000D000 mapped to 0xF006A000, irq=51     [Mon May 12 18:33:03.569 2014] [   12.877364] e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k     [Mon May 12 18:33:03.569 2014] [   12.877365] e1000e: Copyright(c) 1999 - 2013 Intel Corporation.     [Mon May 12 18:33:03.584 2014] [   12.877366] libphy: XEMACPS mii bus: probed     [Mon May 12 18:33:03.600 2014] [   12.877367] mdio_bus e000b000: cannot get PHY at address 7     [Mon May 12 18:33:03.600 2014] [   12.877368] xemacps e000b000.ps7-ethernet: pdev->id -1, baseaddr 0xe000b000, irq 54     [Mon May 12 18:33:03.600 2014] [   12.877370] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver     [Mon May 12 18:33:03.615 2014] [   12.877371] ehci-pci: EHCI PCI platform driver     [Mon May 12 18:33:03.615 2014] [   12.877372] zynq-dr e0002000.ps7-usb: Unable to init USB phy, missing?     [Mon May 12 18:33:03.631 2014] [   12.877373] usbcore: registered new interface driver usb-storage     [Mon May 12 18:33:03.631 2014] [   12.877375] mousedev: PS/2 mouse device common for all mice     [Mon May 12 18:33:03.631 2014] [   12.877376] i2c /dev entries driver     [Mon May 12 18:33:03.647 2014] [   12.877378] xadcps f8007100.ps7-xadc: enabled:    yes reference:  internal     [Mon May 12 18:33:03.662 2014] [   12.877379] zynq-edac f8006000.ps7-ddrc: ecc not enabled     [Mon May 12 18:33:03.678 2014] [   12.877380] cpu cpu0: dummy supplies not allowed     [Mon May 12 18:33:03.678 2014] [   12.877381] cpufreq_cpu0: failed to get cpu0 regulator: -19     [Mon May 12 18:33:03.678 2014] [   12.877382] Xilinx Zynq CpuIdle Driver started     [Mon May 12 18:33:03.693 2014] [   12.877383] sdhci: Secure Digital Host Controller Interface driver     [Mon May 12 18:33:03.693 2014] [   12.877384] sdhci: Copyright(c) Pierre Ossman     [Mon May 12 18:33:03.693 2014] [   12.877385] sdhci-pltfm: SDHCI platform and OF driver helper     [Mon May 12 18:33:03.725 2014] [   12.877386] sdhci-arasan e0100000.ps7-sdio: dummy supplies not allowed     [Mon May 12 18:33:03.725 2014] [   12.877387] mmc0: no vqmmc regulator found     [Mon May 12 18:33:03.725 2014] [   12.877387] sdhci-arasan e0100000.ps7-sdio: dummy supplies not allowed     [Mon May 12 18:33:03.725 2014] [   12.877388] mmc0: no vmmc regulator found     [Mon May 12 18:33:03.771 2014] [   12.877396] mmc0: SDHCI controller on e0100000.ps7-sdio [e0100000.ps7-sdio] using ADMA     [Mon May 12 18:33:03.787 2014] [   12.877399] usbcore: registered new interface driver usbhid     [Mon May 12 18:33:03.787 2014] [   12.877400] usbhid: USB HID core driver     [Mon May 12 18:33:03.803 2014] [   12.877205] TCP: cubic registered     [Mon May 12 18:33:03.803 2014] [   12.877206] NET: Registered protocol family 17     [Mon May 12 18:33:03.803 2014] [   12.877206] Registering SWP/SWPB emulation handler     [Mon May 12 18:33:03.818 2014] [   12.877207] bootconsole [earlycon0] disabled      .To generate the image I have taken help from these links: http://www.wiki.xilinx.com/Getting+Started http://www.wiki.xilinx.com/Fetch+Sources http://www.wiki.xilinx.com/Build+U-Boot http://www.wiki.xilinx.com/Build+and+Modify+a+Rootfs http://www.wiki.xilinx.com/Build+Device+Tree+Blob http://www.wiki.xilinx.com/Build+Kernel Any suggestions , how to reolve this issue?


title: Identify partition by mount point

text: How can we identify what partition a filesystem is mounted on in Linux when the partition is not directly referenced in `df` output? For example, our system's `fdisk` output is:                  Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *           1        2550    20478976   83  Linux     /dev/sda2            2550       60736   467378176   83  Linux     /dev/sda3           60736       60801      523264   82  Linux swap / Solaris      And the output from `df` is:               Filesystem      Size  Used Avail Use% Mounted on     rootfs           20G  881M   18G   5% /     /dev/root        20G  881M   18G   5% /     devtmpfs        989M  216K  989M   1% /dev     /dev/sda2       443G  199M  420G   1% /home     tmpfs           990M     0  990M   0% /dev/shm     /dev/root        20G  881M   18G   5% /var/named/chroot/etc/named     /dev/root        20G  881M   18G   5% /var/named/chroot/var/named     /dev/root        20G  881M   18G   5% /var/named/chroot/etc/named.conf     /dev/root        20G  881M   18G   5% /var/named/chroot/etc/named.rfc1912.zones     /dev/root        20G  881M   18G   5% /var/named/chroot/etc/rndc.key     /dev/root        20G  881M   18G   5% /var/named/chroot/usr/lib64/bind     /dev/root        20G  881M   18G   5% /var/named/chroot/etc/named.iscdlv.key     /dev/root        20G  881M   18G   5% /var/named/chroot/etc/named.root.key      From that list the only obvious partition is `/dev/sda2`; for the others we can't see which partition they reside on (we want to do this via a bash script). For example, we know that `/dev/root` is mounted on `/dev/sda1` as they both have the same 20GB size, but how can we identify this from a script? Output from `ls -l /dev/root /dev/sda1`:               [root@server etc]# ls -l /dev/root /dev/sda1     ls: cannot access /dev/root: No such file or directory     brw-rw---- 1 root disk 8, 1 May  7 14:16 /dev/sda1


title: Securely feeding a program with a password

text: After understanding the problem with using a password in the command line, I need to find a way of feeding a program with a password without it being a problem (without the password being recorded somewhere). I have a bash script that automatically installs an entire LAMP server from source: Apache, FastCGI, PHP & MySQL. These installations require a password, especially MySQL. How can I make the script fully automated without revealing the password? Edit (9 June, 3:55 UTC):   I'm invoking mysql with a password on the command line, via root:               root@dor-desktop:/home/dor# PASS=`cat /home/dor/tmpf/pass`     root@dor-desktop:/home/dor# mysql -u root -p"$PASS"     Welcome to the MySQL monitor.  Commands end with ; or \g.     Your MySQL connection id is 6      (PASS="p4ssw0rd" in our case)   And I execute `ps aux | grep mysql` via my regular user (dor), which **doesn't show me the password**!   (Some of) `ps` output is:               USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND     root      3562  0.0  0.0  34156  2864 pts/0    S+   05:53   0:00 mysql -u root -px xxxxxx      How's that possible?


title: Configure Spamassassin to use URIBL and Google Public DNS

text: I use Google Public DNS servers on my mail server. However, URIBL and other spam blocking sites (which work over DNS) block major DNS sites such as Google Public DNS. I think if I run my own DNS server on my mail server, then URIBL and others will work because my server IP won't be blacklisted. How do I accomplish this with an open source DNS server? **EDIT** : I _really_ want to avoid running BIND if possible. I want to use something lightweight such as dnsmasq or pdnsd, thinking that this is more secure.


title: Open multiple directories in different tabs in the same window in CentOS

text: How can I set my CentOS to be able to open multiple directories in different tabs in the same window? I have already enabled the feature to open the folders in the same window, but this is different: I would like to be able to open as many tabs I want for different folders. Unfortunately, I don't know my graphical environment, since:               [user@maxipub9 extractions]$ echo $DESKTOP_SESSION     default


title: Result from kernel returned to what process?

text: When a process requires actions that require kernel mode, it uses a system call. So, how are the results returned to the process?


title: What happens when I run the command cat /proc/cpuinfo?

text: What happens when I write `cat /proc/cpuinfo`. Is that a named pipe (or something else) to the OS which reads the CPU info on the fly and generate that text each time I call it?


title: Linux mail, attachement with uuencode works until I add headers

text: I have a command I have been using to send emails with an attachment and a message body               (cat msg_file.txt; uuencode file.csv file.csv) | mail -s "subject" user@mail.com      as soon as I add the `-a` option for sending headers in order to send an HTML file               (cat msg_file.html; uuencode file.csv file.csv) | mail \      -a "MIME-Version: 1.0" \      -a "Content-type: text/html; charset=iso-8859-1" \      -s "subject" user@mail.com      The HTML file will work but now the attachment does not. Instead I get a long string of text that is mostly not human readable and isn't any help, I have no idea what it means. I have tried variations on how I am reading the email body to stdin like               uuencode file.csv file.csv | mail \      -a "MIME-Version: 1.0" \      -a "Content-type: text/html; charset=iso-8859-1" \      -s "subject" user@mail.com < msg.html      But still no luck. I do not know a lot about headers so I may be over looking something to do with the headers? Does anyone know how to alter the above commands to send an attachment along with the HTML message body? Or will I have to use another method?


title: "which" with a little "grep"-like solution?

text: # which mkdir     /bin/mkdir     # which mkdi     #       How can I get the path of the e.g.: "mkdir"'s binary without knowing the name of the binary file? (command). So that which "mkdi" would output the "/bin/mkdir" too.


title: How to listen to a specific port and return 200 status

text: How can I listen on my server on specific port and just return HTTP 200 status if someone tries to connect ? Can `nc` be used to return HTTP status ?


title: CentOS 6.5 File system permission?

text: I am wondering, i have installed CentOS 6.5 Live-DVD in my company PC. After all the LAMP installation is done, am having a trouble with the File System permission settings. In the File system directory, all the directories under it is not permissible for me (as root) to create any folder / document / paste. I already set SELinux to disabled. Am I missing anything?               [root@localhost ~]# ls -l     total 71320     -rw-r--r--  1 root root       73 Mar 11 18:51 ACL.txt     -rw-------. 1 root root     1058 Mar  6 18:23 anaconda-ks.cfg     -rw-r--r--. 1 root root    43295 Mar 11 10:01 index.html     -rw-r--r--. 1 root root     2409 Apr 14  2011 index.html?url=354858     -rw-r--r--. 1 root root    11955 Nov 30 00:56 post-install     -rw-r--r--. 1 root root      552 Nov 30 00:57 post-install.log     -rw-r--r--. 1 root root     1363 Mar  7 15:47 scrm.pccws-essa.com.crt     -rw-r--r--. 1 root root     1704 Mar  7 15:47 scrm.pccws-essa.com.key     -rw-r--r--. 1 root root 14107104 Feb 18 23:10 skype-4.2.0.11-4.el6.i686.rpm     -rw-r--r--. 1 root root     1756 Jul  8  2013 SYRKIT-GPG-KEY.pub     -rw-r--r--. 1 root root 22305590 Nov 28 07:48 teamviewer_linux.rpm     -rwxr-xr-x. 1 root root    51892 Sep 19 00:09 tuning-primer.sh      * * *               [root@localhost ~]# cat /etc/fstab     ### /etc/fstab     ### Created by anaconda on Thu Mar  6 18:22:08 2014     ### Accessible filesystems, by reference, are maintained under '/dev/disk'     ### See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info /dev/mapper/vg_softsolvers-lv_root /                       ext4    defaults        1 1     UUID=1fb09c11-64e0-4623-9b3a-15bf4cbc4eb5 /boot            ext4    defaults        1 2     /dev/mapper/vg_softsolvers-lv_home /home                   ext4    defaults        1 2     /dev/mapper/vg_softsolvers-lv_swap swap                    swap    defaults        0 0     tmpfs                   /dev/shm                tmpfs   defaults        0 0     devpts                  /dev/pts                devpts  gid=5,mode=620  0 0     sysfs                   /sys                    sysfs   defaults        0 0     proc                    /proc                   proc    defaults        0 0      * * *               [root@localhost ~]# getfacl /root     getfacl: Removing leading '/' from absolute path names     file: root     owner: root     group: root     user::rwx     group::rwx     other::---      * * *               [root@localhost ~]# mount | grep root     /dev/mapper/vg_softsolvers-lv_root on / type ext4 (rw)      * * *               [root@localhost ~]# tune2fs -l /dev/mapper/vg_softsolvers-lv_root tune2fs 1.41.12 (17-May-2010)     Filesystem volume name:   _CentOS-6.5-x86_     Last mounted on:          /     Filesystem UUID:          f75a76dd-7c91-4575-8777-ec50e8a37353     Filesystem magic number:  0xEF53     Filesystem revision #:    1 (dynamic)     Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize     Filesystem flags:         signed_directory_hash      Default mount options:    user_xattr acl


title: Gnome-shell authentication dialogue fails, how to debug which app is using it?

text: I am using ubuntu 13.10 with gnome shell 3.8.4. I used to use gnome online accounts for empathy and other things, but then I stopped using them. And then gnome shell started to show authentication dialogue repeatedly, for the accounts I use in empathy it used to ask me to authenticate everytime as it says that it can't login using old token, or something similar message. But even after entering the correct password it used to show that password is wrong. I didn't care much and removed the online accounts as I was not using them anymore. Both from ubuntu online accounts and gnome online accounts. This is one of the many reasons I hate ubuntu, they breaks everything! Anyway, recently after recent updates, I started to see these authentication dialogues again! Two dialogue boxes instantly one after the other, everytime I press Meta key(windows key) or sometimes automatically, the problem is even after entering correct password, it says password is wrong. I smell ubuntu broke my system again and I tried to remove all the settings, I even reset my gnome settings to default stage deleted gnome keyring folder. I don't have any acocunts in both ubuntu online accounts and gnome online accounts. If someone could help me find out which application is trying to login to that specific account I would be glad to fire that application out of my system! PS: I don't want to re-install my system. Also this has become a serious concern as it began to irritate me a lot!


title: Finding unallocated disk space (partitioning)

text: Another (hobbiest) sys admin on they same system as me, pointed out that there is 30Gb of unallocated space on the system. I have need of that space to create a new partition. (I'm going to make a fast scratch for HPC) Unfortunatly he never told me which of the many many devices on the system it was on. I think it might be on a pair of raided disks. How can I find what unpartioned space exists on a system, accross all of its disks? I can do it one dist at a time with `parted`. (by cycling though each device using `select /dev/sda` , then `print free`) but that will take a while with the many disks and is a inelegant solution.


title: Shell script too slow for output to Conky

text: I want the output of               stdbuf -i0 -o0 -e0 jack_cpu_load | sed -n 's/[A-Za-z]*//g;s/ //g;s/.\{4\}$//;9,$p'      to be displayed in Conky but, I suspect, Conky is starting the script with every refresh and the script is too slow producing an output for anything to show. Or, maybe it's something else entirely. I used `${execp /path/to/script.sh}` Is there a way to let the script run and for Conky to sample the output. Provided my theory is correct. _shrugs_ Edit: I'm working on sending the output to a file then having Conky read that, but I'm having a hard time getting it to overwrite the file. The closest I've gotten so far is, `stdbuf -i0 -o0 -e0 script.sh > file.log` but that just keeps appending the output to the file until I stop and start it again.


title: How to print only last column?

text: echo -e 'one two three\nfour five six\nseven eight nine'     one two three     four five six     seven eight nine      how can I do some "MAGIC" do get this output?:               three     six     nine      UPDATE: I don't need it in this specific way, I need a general solution so that no matter how many columns are in a row, e.g.: awk always displays the last column.


title: How to install Debian from an .iso on the filesystem?

text: I am running Ubuntu and I want to be able to boot into Debian Wheezy .iso which I just downloaded, how can I set this up? I don't want to use an external device like a usb or cd/dvd


CPU: ARM Cortex A-9 This is the kernel command line that I appears in configuration menu               root=mtd:jffs2 rw rootfstype=jffs2 console=ttyps0,115200      I have put three files in flash: BOOT.BIN in mtd0 image.ub in mtd2 jffs2 in mtd3 to program flash I used the following command:               flashcp -v jffs2 /dev/mtd3      from a running system (from SD). similarly I put Boot.bin (containing bootloader i.e uboot) and image.ub (kernel). I got rootfs.jffs2, but I renamed it to jffs2, since it was giving the errors. I checked both rootfs.jffs2 and jffs2, but while booting both are giving same errors.               [Tue Apr 08 14:42:38.904 2014] List of all partitions:         [Tue Apr 08 14:42:38.904 2014] No filesystem could mount root, tried:  jffs2         [Tue Apr 08 14:42:38.904 2014] Kernel panic - not syncing: VFS: Unable to mount root fs on mtd:      In fact whether I put jffs2 file or not this error is coming. Is it right to just copy jffs2 file in flash in mtd3 partition or do I need to change its type before copying? How do I solve the issue? I got this jffs2 file after compiling the kernel (selected jffs2 file system in config instad of initramfs). The complete the log message is given below:               [Tue Apr 08 14:42:30.650 2014]      [Tue Apr 08 14:42:30.650 2014]      [Tue Apr 08 14:42:30.650 2014] U-Boot 2013.07 (Apr 07 2014 - 13:23:59)     [Tue Apr 08 14:42:30.650 2014]      [Tue Apr 08 14:42:30.650 2014] Memory: ECC disabled     [Tue Apr 08 14:42:30.650 2014] DRAM:  1 GiB     [Tue Apr 08 14:42:30.662 2014] SF: Detected N25Q128A with page size 64 KiB, total 16 MiB     [Tue Apr 08 14:42:30.683 2014] In:    serial     [Tue Apr 08 14:42:30.683 2014] Out:   serial     [Tue Apr 08 14:42:30.683 2014] Err:   serial     [Tue Apr 08 14:42:30.683 2014] Hit any key to stop autoboot:  3  2  1  0      [Tue Apr 08 14:42:33.700 2014] boot Petalinux     [Tue Apr 08 14:42:33.700 2014] Unknown command 'mmcinfo' - try 'help'     [Tue Apr 08 14:42:33.700 2014] U-Boot-PetaLinux> run sfboot     [Tue Apr 08 14:42:37.437 2014] SF: Detected N25Q128A with page size 64 KiB, total 16 MiB     [Tue Apr 08 14:42:37.650 2014] SF: 1180352 bytes @ 0x520000 Read: OK     [Tue Apr 08 14:42:37.650 2014] ## Loading kernel from FIT Image at 01000000 ...     [Tue Apr 08 14:42:37.650 2014]    Using 'conf@1' configuration     [Tue Apr 08 14:42:37.650 2014]    Trying 'kernel@1' kernel subimage     [Tue Apr 08 14:42:37.650 2014]      Description:  PetaLinux Kernel     [Tue Apr 08 14:42:37.650 2014]      Type:         Kernel Image     [Tue Apr 08 14:42:37.650 2014]      Compression:  gzip compressed     [Tue Apr 08 14:42:37.650 2014]      Data Start:   0x010000f0     [Tue Apr 08 14:42:37.650 2014]      Data Size:    1167695 Bytes = 1.1 MiB     [Tue Apr 08 14:42:37.650 2014]      Architecture: ARM     [Tue Apr 08 14:42:37.650 2014]      OS:           Linux     [Tue Apr 08 14:42:37.650 2014]      Load Address: 0x00008000     [Tue Apr 08 14:42:37.650 2014]      Entry Point:  0x00008000     [Tue Apr 08 14:42:37.650 2014]    Verifying Hash Integrity ... OK     [Tue Apr 08 14:42:37.650 2014] ## Loading fdt from FIT Image at 01000000 ...     [Tue Apr 08 14:42:37.695 2014]    Using 'conf@1' configuration     [Tue Apr 08 14:42:37.695 2014]    Trying 'fdt@1' fdt subimage     [Tue Apr 08 14:42:37.695 2014]      Description:  Flattened Device Tree blob     [Tue Apr 08 14:42:37.695 2014]      Type:         Flat Device Tree     [Tue Apr 08 14:42:37.695 2014]      Compression:  uncompressed     [Tue Apr 08 14:42:37.695 2014]      Data Start:   0x0111d2f0     [Tue Apr 08 14:42:37.695 2014]      Data Size:    11179 Bytes = 10.9 KiB     [Tue Apr 08 14:42:37.695 2014]      Architecture: ARM     [Tue Apr 08 14:42:37.695 2014]      Hash algo:    crc32     [Tue Apr 08 14:42:37.695 2014]      Hash value:   a7a92b47     [Tue Apr 08 14:42:37.695 2014]      Hash algo:    sha1     [Tue Apr 08 14:42:37.696 2014]      Hash value:   cd303b74749b464a852b236214414effa1b98cdc     [Tue Apr 08 14:42:37.696 2014]    Verifying Hash Integrity ... crc32+ sha1+ OK     [Tue Apr 08 14:42:37.696 2014]    Booting using the fdt blob at 0x111d2f0     [Tue Apr 08 14:42:37.711 2014]    Uncompressing Kernel Image ... OK     [Tue Apr 08 14:42:37.787 2014]    Loading Device Tree to 07ffa000, end 07fffbaa ... OK     [Tue Apr 08 14:42:37.787 2014]      [Tue Apr 08 14:42:37.787 2014] Starting kernel ...     [Tue Apr 08 14:42:37.787 2014]      [Tue Apr 08 14:42:38.392 2014] Booting Linux on physical CPU 0x0     [Tue Apr 08 14:42:38.392 2014] Linux version 3.8.11 (root@xilinx) (gcc version 4.7.3 (Sourcery CodeBench Lite 2013.05-40) ) #15 SMP PREEMPT Mon Apr 7 15:07:38 IST 2014     [Tue Apr 08 14:42:38.392 2014] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c53c7d     [Tue Apr 08 14:42:38.392 2014] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache     [Tue Apr 08 14:42:38.392 2014] Machine: Xilinx Zynq Platform, model: Xilinx-ZC702-14.7     [Tue Apr 08 14:42:38.392 2014] Memory policy: ECC disabled, Data cache writealloc     [Tue Apr 08 14:42:38.392 2014] PERCPU: Embedded 7 pages/cpu @c0a7b000 s5568 r8192 d14912 u32768     [Tue Apr 08 14:42:38.392 2014] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096     [Tue Apr 08 14:42:38.437 2014] Kernel command line: root=mtd:jffs2 rw rootfstype=jffs2 console=ttyPS0,115200     [Tue Apr 08 14:42:38.437 2014] PID hash table entries: 4096 (order: 2, 16384 bytes)     [Tue Apr 08 14:42:38.437 2014] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)     [Tue Apr 08 14:42:38.437 2014] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)     [Tue Apr 08 14:42:38.437 2014] __ex_table already sorted, skipping sort     [Tue Apr 08 14:42:38.437 2014] Memory: 1024MB = 1024MB total     [Tue Apr 08 14:42:38.437 2014] Memory: 1036960k/1036960k available, 11616k reserved, 270336K highmem     [Tue Apr 08 14:42:38.437 2014] Virtual kernel memory layout:     [Tue Apr 08 14:42:38.437 2014]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)     [Tue Apr 08 14:42:38.481 2014]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)     [Tue Apr 08 14:42:38.481 2014]     vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)     [Tue Apr 08 14:42:38.481 2014]     lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)     [Tue Apr 08 14:42:38.481 2014]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)     [Tue Apr 08 14:42:38.481 2014]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)     [Tue Apr 08 14:42:38.481 2014]       .text : 0xc0008000 - 0xc0220d94   (2148 kB)     [Tue Apr 08 14:42:38.481 2014]       .init : 0xc0221000 - 0xc023c5c0   ( 110 kB)     [Tue Apr 08 14:42:38.481 2014]       .data : 0xc023e000 - 0xc025c060   ( 121 kB)     [Tue Apr 08 14:42:38.481 2014]        .bss : 0xc025c060 - 0xc026f3d8   (  77 kB)     [Tue Apr 08 14:42:38.481 2014] Preemptible hierarchical RCU implementation.     [Tue Apr 08 14:42:38.529 2014]  RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.     [Tue Apr 08 14:42:38.529 2014] NR_IRQS:16 nr_irqs:16 16     [Tue Apr 08 14:42:38.529 2014] MIO pin 47 not assigned(00001220)     [Tue Apr 08 14:42:38.529 2014] xslcr mapped to f0002000     [Tue Apr 08 14:42:38.529 2014] Zynq clock init     [Tue Apr 08 14:42:38.529 2014] sched_clock: 16 bits at 54kHz, resolution 18432ns, wraps every 1207ms     [Tue Apr 08 14:42:38.529 2014] ps7-ttc #0 at f0004000, irq=43     [Tue Apr 08 14:42:38.529 2014] Console: colour dummy device 80x30     [Tue Apr 08 14:42:38.529 2014] Calibrating delay loop... 1332.01 BogoMIPS (lpj=6660096)     [Tue Apr 08 14:42:38.529 2014] pid_max: default: 4096 minimum: 301     [Tue Apr 08 14:42:38.529 2014] Mount-cache hash table entries: 512     [Tue Apr 08 14:42:38.529 2014] CPU: Testing write buffer coherency: ok     [Tue Apr 08 14:42:38.529 2014] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000     [Tue Apr 08 14:42:38.566 2014] Setting up static identity map for 0x1cb148 - 0x1cb17c     [Tue Apr 08 14:42:38.566 2014] L310 cache controller enabled     [Tue Apr 08 14:42:38.566 2014] l2x0: 8 ways, CACHE_ID 0x000000c0, AUX_CTRL 0x72360000, Cache size: 524288 B     [Tue Apr 08 14:42:38.566 2014] CPU1: Booted secondary processor     [Tue Apr 08 14:42:38.566 2014] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001     [Tue Apr 08 14:42:38.566 2014] Brought up 2 CPUs     [Tue Apr 08 14:42:38.566 2014] SMP: Total of 2 processors activated (2664.03 BogoMIPS).     [Tue Apr 08 14:42:38.566 2014] devtmpfs: initialized     [Tue Apr 08 14:42:38.566 2014] NET: Registered protocol family 16     [Tue Apr 08 14:42:38.566 2014] DMA: preallocated 256 KiB pool for atomic coherent allocations     [Tue Apr 08 14:42:38.566 2014] xgpiops e000a000.ps7-gpio: gpio at 0xe000a000 mapped to 0xf004e000     [Tue Apr 08 14:42:38.611 2014] GPIO IRQ not connected     [Tue Apr 08 14:42:38.611 2014] XGpio: /amba@0/gpio@41220000: registered, base is 255     [Tue Apr 08 14:42:38.611 2014] GPIO IRQ not connected     [Tue Apr 08 14:42:38.611 2014] XGpio: /amba@0/gpio@41200000: registered, base is 251     [Tue Apr 08 14:42:38.611 2014] usbcore: registered new interface driver usbfs     [Tue Apr 08 14:42:38.611 2014] usbcore: registered new interface driver hub     [Tue Apr 08 14:42:38.611 2014] usbcore: registered new device driver usb     [Tue Apr 08 14:42:38.611 2014] Switching to clocksource xttcps_clocksource     [Tue Apr 08 14:42:38.611 2014] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.     [Tue Apr 08 14:42:38.611 2014] e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 82) is a xuartps     [Tue Apr 08 14:42:38.611 2014] console [ttyPS0] enabled     [Tue Apr 08 14:42:38.632 2014] xdevcfg f8007000.ps7-dev-cfg: ioremap f8007000 to f0074000 with size 100     [Tue Apr 08 14:42:38.647 2014] xqspips e000d000.ps7-qspi: master is unqueued, this is deprecated     [Tue Apr 08 14:42:38.647 2014] spi spi32766.0: setup: unsupported mode bits 3     [Tue Apr 08 14:42:38.647 2014] xqspips e000d000.ps7-qspi: can't setup spi32766.0, status -22     [Tue Apr 08 14:42:38.647 2014] spi_master spi32766: spi_device register error /amba@0/ps7-qspi@e000d000/ps7-qspi@0     [Tue Apr 08 14:42:38.647 2014] xqspips e000d000.ps7-qspi: at 0xE000D000 mapped to 0xF0076000, irq=51     [Tue Apr 08 14:42:38.655 2014] libphy: XEMACPS mii bus: probed     [Tue Apr 08 14:42:38.667 2014] xemacps e000b000.ps7-ethernet: invalid address, use assigned     [Tue Apr 08 14:42:38.667 2014] xemacps e000b000.ps7-ethernet: MAC updated 7e:e2:ec:c2:7d:ec     [Tue Apr 08 14:42:38.667 2014] xemacps e000b000.ps7-ethernet: pdev->id -1, baseaddr 0xe000b000, irq 54     [Tue Apr 08 14:42:38.677 2014] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver     [Tue Apr 08 14:42:38.689 2014] ULPI transceiver vendor/product ID 0x0424/0x0007     [Tue Apr 08 14:42:38.689 2014] Found SMSC USB3320 ULPI transceiver.     [Tue Apr 08 14:42:38.689 2014] ULPI integrity check: passed.     [Tue Apr 08 14:42:38.699 2014] xusbps-ehci xusbps-ehci.0: Xilinx PS USB EHCI Host Controller     [Tue Apr 08 14:42:38.699 2014] xusbps-ehci xusbps-ehci.0: new USB bus registered, assigned bus number 1     [Tue Apr 08 14:42:38.723 2014] xusbps-ehci xusbps-ehci.0: irq 53, io mem 0x00000000     [Tue Apr 08 14:42:38.743 2014] xusbps-ehci xusbps-ehci.0: USB 2.0 started, EHCI 1.00     [Tue Apr 08 14:42:38.753 2014] hub 1-0:1.0: USB hub found     [Tue Apr 08 14:42:38.753 2014] hub 1-0:1.0: 1 port detected     [Tue Apr 08 14:42:38.763 2014] xi2cps e0004000.ps7-i2c: 400 kHz mmio e0004000 irq 57     [Tue Apr 08 14:42:38.772 2014] xadcps f8007100.ps7-xadc: enabled:   yes reference:  external     [Tue Apr 08 14:42:38.788 2014] xwdtps f8005000.ps7-wdt: Xilinx Watchdog Timer at f00ea000 with timeout 10s     [Tue Apr 08 14:42:38.788 2014] sdhci: Secure Digital Host Controller Interface driver     [Tue Apr 08 14:42:38.788 2014] sdhci: Copyright(c) Pierre Ossman     [Tue Apr 08 14:42:38.788 2014] sdhci-pltfm: SDHCI platform and OF driver helper     [Tue Apr 08 14:42:38.798 2014] usbcore: registered new interface driver usbhid     [Tue Apr 08 14:42:38.798 2014] usbhid: USB HID core driver     [Tue Apr 08 14:42:38.798 2014] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4     [Tue Apr 08 14:42:38.843 2014] MTD: MTD device with name "jffs2" not found.     [Tue Apr 08 14:42:38.843 2014] List of all partitions:     [Tue Apr 08 14:42:38.843 2014] No filesystem could mount root, tried:  jffs2     [Tue Apr 08 14:42:38.843 2014] Kernel panic - not syncing: VFS: Unable to mount root fs on mtd:jffs2     [Tue Apr 08 14:42:38.843 2014] CPU1: stopping     [Tue Apr 08 14:42:38.843 2014] Backtrace:      [Tue Apr 08 14:42:38.843 2014] Function entered at [<c0011094>] from [<c01c63e8>]     [Tue Apr 08 14:42:38.843 2014]  r6:c0246418 r5:00000000 r4:00000001 r3:60000193     [Tue Apr 08 14:42:38.843 2014] Function entered at [<c01c63d0>] from [<c0011fbc>]     [Tue Apr 08 14:42:38.843 2014] Function entered at [<c0011f78>] from [<c0012270>]     [Tue Apr 08 14:42:38.843 2014]  r4:c0247ef4 r3:c0011f78     [Tue Apr 08 14:42:38.843 2014] Function entered at [<c001220c>] from [<c00084e4>]     [Tue Apr 08 14:42:38.843 2014]  r5:ef07bf68 r4:f8f00100     [Tue Apr 08 14:42:38.887 2014] Function entered at [<c0008484>] from [<c000da00>]     [Tue Apr 08 14:42:38.887 2014] Exception stack(0xef07bf68 to 0xef07bfb0)     [Tue Apr 08 14:42:38.887 2014] bf60:                   c0a838d0 00000000 00000003 00000000 ef07a000 c01cd528     [Tue Apr 08 14:42:38.887 2014] bf80: ef07a000 c025c418 0000406a 413fc090 00000000 ef07bfbc ef07bfc0 ef07bfb0     [Tue Apr 08 14:42:38.887 2014] bfa0: c000e94c c000e950 60000113 ffffffff     [Tue Apr 08 14:42:38.887 2014]  r6:ffffffff r5:60000113 r4:c000e950 r3:c000e94c     [Tue Apr 08 14:42:38.887 2014] Function entered at [<c000e924>] from [<c000eacc>]     [Tue Apr 08 14:42:38.887 2014] Function entered at [<c000ea40>] from [<c01c41e8>]     [Tue Apr 08 14:42:38.887 2014]  r5:00000001 r4:c024cf68     [Tue Apr 08 14:42:38.887 2014] Function entered at [<c01c40f8>] from [<001c37a8>]     [Tue Apr 08 14:42:38.904 2014]  r6:10c03c7d r5:00000015 r4:2f06406a r3:c01c3790     [Tue Apr 08 14:42:38.904 2014] List of all partitions:     [Tue Apr 08 14:42:38.904 2014] No filesystem could mount root, tried:  jffs2     [Tue Apr 08 14:42:38.904 2014] Kernel panic - not syncing: VFS: Unable to mount root fs on mtd:      Also here is my u-boot variables:               U-Boot-PetaLinux> printenv     autoload=no     baudrate=115200     bootcmd=setenv var "if test ${dtbsize} -le 0; then run sdboot; else run dtbboot; fi"; run var; setenv var     bootdelay=3     bootenvsize=0x00020000     bootenvstart=0x00500000     bootfile=image.ub     bootsize=0x00500000     bootstart=0x00000000     clobstart=0x1000000     console=console=ttyPS0,115200     cp_dtb2ram=sf probe 0; sf read ${clobstart} ${dtbstart} ${dtbsize}     dtbboot=sf probe 0; sf read ${netstart} ${kernstart} ${kernsize}; sf read ${dtbnetstart} ${dtbstart} ${dtbsize}; bootm ${netstart} - ${dtbnetstart}     dtbnetboot=tftp ${netstart} image.ub; tftp ${dtbnetstart} system.dtb; bootm ${netstart} - ${dtbnetstart}     dtbnetstart=0x11202c0     eraseconf=sf probe 0; sf erase ${confstart} ${confsize}     eraseenv=sf probe 0; sf erase ${bootenvstart} ${bootenvsize}     ethaddr=00:0a:35:00:75:11     fault=echo $img image size is greater than allocated place - $img is NOT UPDATED     get_dtb=run cp_dtb2ram; fdt addr ${clobstart}     hostname="Xilinx-ZC702-2013.3"     install_dtb=sf probe 0; sf erase ${dtbstart} ${dtbsize};sf write ${clobstart} ${dtbstart} ${filesize}     install_jffs2=sf probe 0; sf erase ${jffs2start} ${jffs2size};sf write ${clobstart} ${jffs2start} ${filesize}     install_kernel=sf probe 0; sf erase ${kernstart} ${kernsize};sf write ${fileaddr} ${kernstart} ${filesize}     install_uboot=sf probe 0; sf erase ${bootstart} ${bootsize};sf write ${clobstart} ${bootstart} ${filesize}     kernsize=0x001202c0     kernstart=0x00520000     load_boot=tftp ${clobstart} BOOT.BIN     load_dtb=tftp ${clobstart} system.dtb     load_jffs2=tftp ${clobstart} rootfs.jffs2     load_kernel=tftp ${clobstart} image.ub     loadaddr=0x1000000     mtdids=nor0=0     mtdparts=mtdparts=0:5M<boot>,128K<bootenv>,1216K<iamge>,5M<jffs2>     netboot=tftp ${netstart} image.ub && bootm     netstart=0x1000000     psserial0=setenv stdout ttyPS0;setenv stdin ttyPS0     sd_update_boot=echo Updating BOOT from SD;mmcinfo && fatload mmc 0:1 ${clobstart} BOOT.BIN && run install_uboot     sd_update_kernel=echo Updating Kernel from SD;mmcinfo && fatload mmc 0:1 ${clobstart} ${bootfile}&& set fileaddr ${clobstart}&&run install_kernel     sdboot=echo boot Petalinux; mmcinfo && fatload mmc 0 ${netstart} ${bootfile}&& bootm     serial=setenv stdout serial;setenv stdin serial     serverip=192.168.1.7     sfboot=sf probe 0; sf read ${netstart} ${kernstart} ${kernsize}; bootm ${netstart}     test_crc=if imi ${clobstart}; then run test_img; else echo $img Bad CRC - $img is NOT UPDATED; fi     test_img=setenv var "if test ${filesize} -gt ${psize}; then run fault; else run ${installcmd}; fi"; run var; setenv var     update_boot=setenv img BOOT.BIN; setenv psize ${bootsize}; setenv installcmd install_uboot; run load_boot test_img; setenv img; setenv psize; setenv installcmd     update_dtb=setenv img DTB; setenv psize ${dtbsize}; setenv installcmd install_dtb; run load_dtb test_img; setenv img     update_jffs2=setenv img JFFS2; setenv psize ${jffs2size}; setenv installcmd install_jffs2; run load_jffs2 test_img; setenv img; setenv psize; setenv installcmd     update_kernel=setenv img KERNEL; setenv psize ${kernsize}; setenv installcmd "install_kernel"; run load_kernel test_crc; setenv img; setenv psize; setenv installcmd          Environment size: 3195/131068 bytes     U-Boot-PetaLinux>      Another thing which is wrong and coming in log messages:               [Tue Apr 08 14:42:38.647 2014] xqspips e000d000.ps7-qspi: master is unqueued, this is deprecated     [Tue Apr 08 14:42:38.647 2014] spi spi32766.0: setup: unsupported mode bits 3     [Tue Apr 08 14:42:38.647 2014] xqspips e000d000.ps7-qspi: can't setup spi32766.0, status -22     [Tue Apr 08 14:42:38.647 2014] spi_master spi32766: spi_device register error /amba@0/ps7-qspi@e000d000/ps7-qspi@0      Just to remind you I am booting from qspi flash with mode 3.


title: Mount Realtek RTS5129 Card Reader Controller in CentOS 6.5

text: I have an in-built card reader that works fine under windows, but in Linux, I cannot mount the drive whatever I do. lspci doesn't show the device lsusb shows Bus 001 Device 004: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller lsblk didnt show anything, so i did modprobe mmc_block now lsblk shows               NAME                      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda                         8:0    0 931.5G  0 disk      ├─sda1                      8:1    0   200M  0 part      ├─sda2                      8:2    0   863G  0 part /media/Windows7_OS     ├─sda3                      8:3    0  19.5G  0 part      ├─sda4                      8:4    0     1K  0 part      ├─sda5                      8:5    0   500M  0 part /boot     └─sda6                      8:6    0  48.3G  0 part        ├─vg_the-lv_root (dm-0) 253:0    0  40.6G  0 lvm  /       └─vg_the-lv_swap (dm-1) 253:1    0   7.8G  0 lvm  [SWAP]     sr0                        11:0    1  1024M  0 rom        tried to mount:               mount -t vfat /dev/sr0 /media/sdcard/     mount: no medium found on /dev/sr0      dmesg shows:               usb 1-1.4: new high speed USB device number 4 using ehci_hcd     usb 1-1.4: New USB device found, idVendor=0bda, idProduct=0129     usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3     usb 1-1.4: Product: USB2.0-CRW     usb 1-1.4: Manufacturer: Generic     usb 1-1.4: SerialNumber: 20100201396000000     usb 1-1.4: configuration #1 chosen from 1 choice      but this doesn't change if i remove or insert a card If anyone has an idea, thanks,


title: Alt +Tab behaviour in Gnome

text: It may be a silly question but in Windows I used `Shift``Alt``Tab` to switch back between my open windows, that is go back to previous windows. Unfortunately, it is not working in Gnome. I have even used `Alt``Tab``Left` but with no success. So how can I do the same in Gnome on RHEL6?


title: 'echo' eats part of the message

text: I want to write a script that will dump all partitions of my android device through the android debug bridge and since this is a time intensive process I want to notify the user about the progress by echoing out messages after certain key events happen. To my surprise I have noticed that sometimes `echo` does not print all the characters that it should. The smallest sample that reproduces the error is:               #!/bin/bash          targets=$(adb shell "ls /dev/block/nand*")          for item in $targets; do         echo "Processing $item"         echo "dd if=$item bs=4M"     done      This produces the following output:               Processing /dev/block/nanda     dd if=/dev/block/nanda bs=4M     Processing /dev/block/nandd     dd if=/dev/block/nandd bs=4M     Processing /dev/block/nandg     dd if=/dev/block/nandg bs=4M     Processing /dev/block/nandj      bs=4M/dev/block/nandj     Processing /dev/block/nandb     dd if=/dev/block/nandb bs=4M     Processing /dev/block/nande     dd if=/dev/block/nande bs=4M     Processing /dev/block/nandh      bs=4M/dev/block/nandh     Processing /dev/block/nandc     dd if=/dev/block/nandc bs=4M     Processing /dev/block/nandf     dd if=/dev/block/nandf bs=4M     Processing /dev/block/nandi      bs=4M/dev/block/nandi      Why does this happen and how can I fix it?


title: ${#array} vs ${#array[@]}

text: As far as I can tell both `${#array[@]}` and `${#array}` evaluate to the number of elements in `$array`. Is there any reason for preferring the longer form (`${#array[@]}`)?


title: Shrink/reduce non-lvm disk file system

text: I have an vmware ext4 file system that non-lvm, non-partitioned file system that resides on a virtual 300GB disk. In other words, there is no partition and the file system was probably created by:               mkfs.ext4 /dev/sdd1      The disk is barely used (1%) but I would like to keep the data on it. Is there a safe way to shrink it? I was thinking of resizing the disk in Vmware from 300 to 100 and running resize2fs /dev/sdd1 but am not certain if I will not lose anything on it. Any pieces of advice would be highly appreciated. P.


title: How do I Fix Samba from breaking on Kali Linux?

text: Okay, so I am trying to get Samba to work so I can access files from my tablet. That said, I've installed the `samba` package and its dependencies along with `nautilus-share` package to let me share things directly from the file manager. When I try to share a folder via nautilus, I get the ff:               Samba's testparm returned error 1: Load smb config files from /etc/samba/smb.conf     rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)     Unknown parameter encountered: "server role"     Ignoring unknown parameter "server role"     Processing section "[homes]"     Processing section "[printers]"     Processing section "[print$]"     Loaded services file OK.     ERROR: cache directory /var/cache/samba does not exist      I also try to restart the service via `service samba restart` and get the ff:               [ ok ] Stopping Samba daemons: nmbd smbd.     [....] Starting Samba daemons: nmbd/usr/sbin/nmbd: error while loading shared libraries: libpopt_samba3.so: cannot open shared object file: No such file or directory     failed!      I've tried to understand what's going on with samba and look for the logs, but I don't see any. I think the Kali version of samba is a bit weird? Here is the list of files that `dpkg -L samba` gives me:               /.     /lib     /lib/systemd     /lib/systemd/system     /lib/systemd/system/smb.service     /lib/systemd/system/nmb.service     /var     /var/lib     /var/lib/samba     /var/lib/samba/printers     /var/lib/samba/printers/W32MIPS     /var/lib/samba/printers/W32ALPHA     /var/lib/samba/printers/COLOR     /var/lib/samba/printers/IA64     /var/lib/samba/printers/W32X86     /var/lib/samba/printers/x64     /var/lib/samba/printers/WIN40     /var/lib/samba/printers/W32PPC     /var/lib/samba/private     /var/spool     /var/spool/samba     /etc     /etc/logrotate.d     /etc/logrotate.d/samba     /etc/cron.daily     /etc/cron.daily/samba     /etc/init.d     /etc/init.d/samba     /usr     /usr/sbin     /usr/sbin/smbd     /usr/sbin/nmbd     /usr/sbin/mksmbpasswd     /usr/share     /usr/share/doc     /usr/share/doc/samba     /usr/share/doc/samba/TODO.Debian     /usr/share/doc/samba/copyright     /usr/share/doc/samba/NEWS.Debian.gz     /usr/share/doc/samba/changelog.Debian.gz     /usr/share/doc/samba/NEWS.gz     /usr/share/doc/samba/README.Debian     /usr/share/doc/samba/examples     /usr/share/doc/samba/examples/LDAP     /usr/share/doc/samba/examples/LDAP/samba-schema.IBMSecureWay     /usr/share/doc/samba/examples/LDAP/samba-schema-FDS.ldif.gz     /usr/share/doc/samba/examples/LDAP/convertSambaAccount.gz     /usr/share/doc/samba/examples/LDAP/README     /usr/share/doc/samba/examples/LDAP/samba-schema-netscapeds5.x.README     /usr/share/doc/samba/examples/LDAP/samba.schema.gz     /usr/share/doc/samba/examples/LDAP/samba.schema.at.IBM-DS.gz     /usr/share/doc/samba/examples/LDAP/samba.ldif.gz     /usr/share/doc/samba/examples/LDAP/samba-nds.schema.gz     /usr/share/doc/samba/examples/LDAP/get_next_oid     /usr/share/doc/samba/examples/LDAP/samba.schema.oc.IBM-DS     /usr/share/doc/samba/examples/LDAP/ol-schema-migrate.pl.gz     /usr/share/lintian     /usr/share/lintian/overrides     /usr/share/lintian/overrides/samba     /usr/share/man     /usr/share/man/man8     /usr/share/man/man8/smbta-util.8.gz     /usr/share/man/man8/eventlogadm.8.gz     /usr/share/man/man8/mksmbpasswd.8.gz     /usr/share/man/man8/smbd.8.gz     /usr/share/man/man8/nmbd.8.gz     /usr/share/man/man8/pdbedit.8.gz     /usr/share/man/man1     /usr/share/man/man1/smbcontrol.1.gz     /usr/share/man/man1/log2pcap.1.gz     /usr/share/man/man1/smbstatus.1.gz     /usr/share/man/man1/profiles.1.gz     /usr/share/man/man1/sharesec.1.gz     /usr/bin     /usr/bin/sharesec     /usr/bin/smbcontrol     /usr/bin/profiles     /usr/bin/smbstatus     /usr/bin/smbta-util     /usr/bin/eventlogadm     /usr/bin/pdbedit      I've even tried purging and reinstalling the package, but to no avail. Could someone please help me resolve all of this so I can get samba working properly?


title: "No modules available for kernel"

text: I have a CentoOS 5.10 clonezilla image I restored to a VM. I'm trying to run mkinitrd to fix the filesystem on it (According to this CentOS guide) but when I run this command:               mkinitrd -f -v /boot/initrd-$(uname -r) /boot/initrd-$(uname -r)      I then get this error return:               No modules available for kernel "initrd-2.6.18-371.el5"      I entered rescue mode using a Centos 5.10 install .img that might be different from the original one. But surely this should still work?


title: copy files from one path to another path in linux

text: I am new to linux. I am trying to copy files from one path to another path. I have a text file which has all names of files in the following pattern:               file-1.txt     file-2.pdf     file-3.ppt     ....      I created a `.sh` file with the following code:                #!/bin/bash     file=`cat filenames.txt`;     fromPath='/root/Backup/upload/';     toPath='/root/Desktop/custom/upload/';     for i in $file;     do      filePath=$fromPath$i      #echo $filePath      if [ -e $filePath ];      then        echo $filePath        yes | cp -rf $filePath $toPath      else        echo 'no files'      fi     done      The above code is copying only the last file name from the text instead of all to the destination path. Please help.


title: How to debug MPI timing problems

text: While running Gromacs benchmarks in different setups (intra-node vs 2, 3, and 4 nodes connected with Infiniband), we have noticed severe performance degradation. In order to investigate, we have created a test program that uses `MPI_Alltoall()` to transfer data packages of various sizes (4 bytes to 2 MB) among all nodes. Both the internal timings of the test program and statistics gathered from IntelMPI's `I_MPI_STATS` facility show the same pattern: for small amounts of data, the resulting bandwidth is acceptable, whereas for larger payloads, behaviour becomes erratic: some of the transfers take extremely long (about 2.15 seconds), so average performance collapses. These very long delays seem to be occurring stochastically, so they may be absent or small sample sizes (e.g. 100 transfers per payload size). Here is some sample data taken with 4 nodes at 1000 transfers per size:               #           Message size    Call count  Min time    Avr time    Max time    Total time          Alltoall     1           2097152         1000        5649.09     13420.98    2152225.97  13420980.69     2           1048576         1000        2874.85     13000.87    2151684.05  13000867.13     3           524288          1000        1404.05     8484.15     2149509.91  8484153.99     4           262144          1000        719.07      5308.87     2148617.98  5308866.74     5           131072          1000        364.78      9223.77     2148303.99  9223767.04     6           65536           1000        206.95      5124.41     2147943.97  5124409.44     7           32768           1000        120.88      12562.09    2147678.85  12562089.68     8           16384           1000        36.00       57.03       93.94       57034.25     9           8192            1000        22.89       34.80       103.00      34803.87      We are using QDR Infiniband via an unmanaged switch, and IntelMPI 4.0.3. I have tried to check with MPI out of the way by setting up a ring-like transfer (node1 -> node2 -> node3 -> node4 -> node1) with ib_send_bw, but did not observe any problematic behaviour:               #bytes     #iterations    BW peak[MB/sec]    BW average[MB/sec]     16384      10000           1202.93            1202.91     32768      10000           1408.94            1367.46     65536      10000           1196.71            1195.85     131072     10000           1195.68            1180.71     262144     10000           1197.27            1167.45     524288     10000           1162.94            1154.15     1048576    10000           1184.48            1151.31     2097152    10000           1163.39            1143.60     4194304    10000           1157.77            1141.84     8388608    10000           1141.23            1138.36      My question: is there any way to look deeper into this to find out what the root cause of the problem is? I have already looked through the IntelMPI reference manual, but not seen anything helpful except for `I_MPI_STATS`.


title: Virtualization solutions under OpenBSD

text: I use "OpenBSD as my Desktop OS". What are my choices to run a Linux Distribution, or a Windows (XP/7) in a Virtual Machine? I know that the following apps are not available for OBSD:   * VirtualBox     * XEN


title: problem with twm

text: I am having problem with a twm. I access this server via vnc. when I open the vnc-client it looks like the following picture![enter image description here](http://i.stack.imgur.com/gTabA.png) I tried to change both twmrc-system and .twmrc, but the screen stays the same (every time I change these files I open a new vnc-session on the server). Which other initializing files could be offending?


title: How safe is it to cat an arbitrary file?

text: Sometimes when I `cat` a binary file by mistake, my terminal gets garbled up. Nothing a quick `reset` can't fix, but couldn't an attacker theoretically create a file that, when displayed on a terminal, would execute some arbitrary code? Through an exploit in the terminal emulator or otherwise.


title: Fedora auto suspend

text: I am using Fedora 13 and for shutting down and rebooting automatically, we have the following commands:               # shutdown -h/-r now       Similarly, if I want to make my system go into suspend mode after sometime, what command should I use?


title: bash PS1 setup

text: I'm trying to make PS1 configured as follows.               Green="\[\e[32;1m\]"     Red="\e[0;31m"     Purple="\e[0;35m"     STARTCOLOR="\[\e[40m\]"     ENDCOLOR="\[\e[0m\]"     export PS1="$STARTCOLOR$Green\u@$Purple\h $Red\w$Green>$ENDCOLOR "      And I have some questions.   * What's the difference between "[\e[32;1m]" and \e[32;1m"? Are they the same?   * After running the 'export PS1' command, it works well, but when I give the input around 20 characters, the characters are overwritten as I attached. What's wrong with this?   * What's the meaning of STARTCOLOR(\e[40m)/ENDCOLOR(\e[0m)? ![](http://a.imageshack.us/img8/606/resultqm.jpg) ## ADDED After some tests, I got the following change could solve the problem. That is, the "\e" format should be replaced by "\[\e" format.               Red="\\e[1;31m" -- not working     Red="\[\e[1;31m\]" -- working


title: Debian Lenny: Want Splashy to start directly after Grub2

text: I'm running a GNU/Linux Debian Lenny with an 2.6.26-2-686 kernel. I installed splashy for a bootsplash an updated grub to version 2. Now I want splashy to start directly after the user has selected a startoption in grub. At the moment, when the user selects a start option a black screen with bootmessages occurs. I want it so that these messages are displayed in splashy. Or as an alternative, I want to define a background image which is displayed at this phase. Do you know a solution?


title: Rsync won't Give Up Writing to an Unmounted Remote Drive

text: I've been having issues with a external hard drive staying mounted to a mount point. That's not the topic of this question, but background info. The issue is with rsync. It doesn't seem to recognize when it is trying to sync to an immutable destination. You see, when this drive is not properly mounted, all that is left is it's mount-point folder, which I've made immutable. Instead of rsync realizing that it cannot transfer to this mount-point, it proceeds transferring several gigs to this remote destination. Instead of failing, it looks at the situation as though "hey, this destination doesn't have any of the files I've been told to sync here, so I better move all files as though it was a new first time transfer". I wish rsync would error out, but instead it tries to write 100,000 files to this mount point, failing on each file.


title: Installing Subversion 1.6 on Linux SUSE 11 SP2

text: if you go to the homepage from Subversion (subversion.apache.org/packages.html) in order to get the package for SUSE 11 SP2 you will get either the package 1.8 (the newest version). Question: Is it possible, without so much effort to install Subversion 1.6 on SUSE 11 SP2? Since 1.6 is no more supported and I can find nothing which approves the compatibility of Subversion 1.6 to SUSE 11 SP2, I thougt to ask you would be my last opportunity. I have just downloaded the package, but I have to compile a lot of stuff and I wonder whether it actually works. The actual version of my company regarding Subversion is the 1.6 version, and I have to migrate the stuff from Solaris 9 onto SUSE Enterprise 11 SP2.


title: Compile OS with gcc and ld on Linux

text: I'm practicing operating system development and am having trouble getting `gcc` and `ld` to produce pure binary without any metadata or section labels. For example:               int function(){ return 100;}      would compile only this code and would not add code or metadata. So when I disassemble the code there is no extra code produced by the compiler and linker. I am following the instructions out of this book, I'm supposed to compile and link the C code using the following instructions:               $ gcc -ffreestanding -c test.c -o test.o     $ ld -o test.bin -Ttext 0x0 --oformat binary test.o      This is supposed to produce the following disassembled code:               push ebp     mov ebp, esp     mov eax, 0xbaba     pop ebp     ret       However these instructions instead produced this code and a LOT of other random code, probably just the disassembler interpreting meta data as binary code.


title: play mp3 file as soon as its downloaded

text: How do you combine these two different commands into one script:               $ wget http://mymusic.store.com/musicfoo.mp3     #file gets saved as musicfoo.mp3     $ mplayer musicfoo.mp3      wget attempts to save the file to disk with the file's default name/extension (as on the internet)...in my case mp3 file...mplayer uses this file as argument to play it. Any idea how i can combine this to one script?


title: How to install ipkg in CentOS 6.5

text: I have started using CentOS recently. I have some packages which end with .ipk. I need to install a cross compiler and the steps in the compiler's manual says I should do the following:               ipkg install libstdc++6_4.1.2-r10_armv5te.ipk      I have tried to install ipkg or opkg, but it didn't work. Can anyone tell how to install any of them or if there is an alternative to install .ipk file?


title: Reusing user input in a script

text: I have the following script which works:               #!/bin/bash          xfreerdp /cert-ignore /f /v:farm.company.com /d:company.com /g:rds.company.com /u:$(zenity --entry --title="Username" --text="Username") /gd:company.com /gu:$(zenity --entry --title="Username" --text="Username") /gp:$(zenity --password --title="Password" --text="Password") /p:$(zenity --password --title="Password" --text="Password")      However, it means I get prompted twice for the username and twice for the password. How can this be changed so I only have to enter the username and password once and use those credentials in both places? The above commands needs both usernames and both password flags to be filled in. Without both sets, it does not work.


title: Configure add-to-tranmission-daemon-action in firefox?

text: How do I configure firefox such that a clicked bittorent link is automatically added to a transmission daemon that runs on a remote machine? The transmission daemon is available via ssh/transmission-remote-control port. I can easily instruct firefox to open a torrent file with a shell script of my choice but then firefox downloads the torrent file to `/var/tmp` and supplies the temporary file path to the script. This is not exactly what I want - I need firefox to just call the shell script and supply the (original) URL as parameter. Bonus points for a setup where firefox even gives feedback in case the shell script's exit status is unequal 0. (I am mentioning shell scripts here, but don't hesitate other scripting solutions if they are more convenient for that purpose)


title: meaning of capital S in long ls output

text: What does this long listing mean?               $> ls -l developer.haml      -rw-rwSr-- 1 humon apache ...... I know what a usual listing means and I know all about what it means to be read 'r', write 'w', and executable 'x'. But what is 'S'?


title: Search only in files that match a pattern with ack

text: Can ack search only through files that match a specific pattern (eg: search for foo in all files named "bar*.c"). The command               ack foo "bar*.c"      only works in the current directory. Note: I know it's possible with find and grep:               find . -name "bar*.c" -exec grep foo {} /dev/null \;       But I would like a small and simple ack command, because find doesn't skip version control directories.


title: Access times for different partitions on same hard disk

text: I have partitions, `/dev/sda1` and `/dev/sda2`. `/` is mounted on `/dev/sda1`, while all other data is on `sda2` which has more size allocated to it. I want to save the virtual machine images (`VirtualBox Disk Image`) on `sda2`. My question is, should I expect any difference in performance if I access data from the second partition? `tl;dr` -- is there is any difference in performance if I have to access data located on a different partition? If yes, does it make sense to decrease seek times by moving data to `/dev/sda1`? Please note that this may be one of those micro-optimization issues but I want to squeeze every possible inch of performance I can for the VMs.


title: nm-applet not showing until NetworkManager restart in GNOME 3

text: I have recently installed Arch Linux and GNOME 3 on my new laptop and have a problem whereby **`nm-applet`** is not showing in **`gnome-panel`** , unless I manually restart the NetworkManager daemon.


title: What does the -f parameter do in the tar command

text: When using `tar` I always include `-f` in the parameters but I have no idea why. I looked up the man and it said;               -f, --file [HOSTNAME:]F          use archive file or device F (default     "-", meaning stdin/stdout)      But to be honest I have no idea what that means. Can anyone shed any light on it?


title: How to block the Google Analytics Script using Privoxy

text: _**Related subject:** Privoxy: blocking twitter, facebook and google outside of their domains + HTTPS_ Never mind what rule I am adding to the default.filter file, I don't make it to block these scripts.               <!--Google Analytics Script Start -->     <script type="text/javascript">            var _gaq = _gaq || [];       _gaq.push(['_setAccount', 'UA-649033-1']);       _gaq.push(['_trackPageview']);            (function() {         var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;         ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';         (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);       })();          </script>     <!--Google Analytics Script End -->      So far I have tried these rules:               s|<script [^>]*(google-analytics.com/ga.js).*>(.*</script>)|<!-- utma Cookies-->|gis     s|<script [^>]*(google-analytics).*>(.*</script>)|<!-- utma Cookies-->|gis     s|<script [^>]*(google-analytics*).*>(.*</script>)|<!-- utma Cookies-->|gis     s|<script [^>]*(google-analytics*).*</script>)|<!-- utma Cookies-->|gis     s|<script [^>]*(analytics*).*</script>)|<!-- utma Cookies-->|gis      What is needed to be done to erase the code? _P.S I am also using this in my user.action file_               {+block{No Bull!}}     .google-analytics./*


title: Gnu Parallel: more than one per CPU?

text: If I only have two cores, does `parallel` only run two processes at a time? I guess I'm still confused about processes, threads, and cores....


title: How do I browse for available gsettings options?

text: There are certain gsettings keys that can have multiple values (e.g. a key like **verbosity** could be assigned to one `error`, `info`, or `debug`). I want to be able to list them, but my `dconf-editor` ( **0.7.3** ) can't view them. Is there an existing alternative?


title: Login via ssh without password, getting authorized_keys file removed after first login attempt

text: I'm trying to configure passwordless login via ssh. I have Centos 6.5 This what I did:   * copied content of id_rsa.pub from my client machine to `~/.ssh/authorized_keys`   * set permissions 700 to `~/.ssh` and 600 to `~/.ssh/authorized_keys`   * added the following lines to `/etc/ssh/sshd_config`: > >     RSAAuthentication yes >     PubkeyAuthentication yes >     AuthorizedKeysFile      .ssh/authorized_keys >     * restarted sshd service But still it asks a password and it deletes `.ssh/authorized_keys` from the server after first login attempt. Could anyone please help me to solve the problem? ## sshd_config               #   $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $          # This is the sshd server system-wide configuration file.  See     # sshd_config(5) for more information.          # This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin          # The strategy used for options in the default sshd_config shipped with     # OpenSSH is to specify options with their default value where     # possible, but leave them commented.  Uncommented options change a     # default value.          #Port 22     AddressFamily inet     #ListenAddress 0.0.0.0     #ListenAddress ::          # Disable legacy (protocol version 1) support in the server for new     # installations. In future the default will change to require explicit     # activation of protocol 1     Protocol 2          # HostKey for protocol version 1     #HostKey /etc/ssh/ssh_host_key     # HostKeys for protocol version 2     #HostKey /etc/ssh/ssh_host_rsa_key     #HostKey /etc/ssh/ssh_host_dsa_key          # Lifetime and size of ephemeral version 1 server key     #KeyRegenerationInterval 1h     #ServerKeyBits 1024          # Logging     # obsoletes QuietMode and FascistLogging     #SyslogFacility AUTH     SyslogFacility AUTHPRIV     #LogLevel INFO          # Authentication:          #LoginGraceTime 2m     #PermitRootLogin yes     #StrictModes yes     #MaxAuthTries 6     #MaxSessions 10          RSAAuthentication yes     PubkeyAuthentication yes     AuthorizedKeysFile  .ssh/authorized_keys          # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts     #RhostsRSAAuthentication no     # similar for protocol version 2     #HostbasedAuthentication no     # Change to yes if you don't trust ~/.ssh/known_hosts for     # RhostsRSAAuthentication and HostbasedAuthentication     #IgnoreUserKnownHosts no     # Don't read the user's ~/.rhosts and ~/.shosts files     #IgnoreRhosts yes          # To disable tunneled clear text passwords, change to no here!     #PasswordAuthentication yes     #PermitEmptyPasswords no     PasswordAuthentication yes          # Change to no to disable s/key passwords     #ChallengeResponseAuthentication yes     ChallengeResponseAuthentication no          # Kerberos options     #KerberosAuthentication no     #KerberosOrLocalPasswd yes     #KerberosTicketCleanup yes     #KerberosGetAFSToken no     #KerberosUseKuserok yes          # GSSAPI options     GSSAPIAuthentication no     #GSSAPICleanupCredentials yes     GSSAPICleanupCredentials yes     #GSSAPIStrictAcceptorCheck yes     #GSSAPIKeyExchange no          # Set this to 'yes' to enable PAM authentication, account processing,      # and session processing. If this is enabled, PAM authentication will      # be allowed through the ChallengeResponseAuthentication and     # PasswordAuthentication.  Depending on your PAM configuration,     # PAM authentication via ChallengeResponseAuthentication may bypass     # the setting of "PermitRootLogin without-password".     # If you just want the PAM account and session checks to run without     # PAM authentication, then enable this but set PasswordAuthentication     # and ChallengeResponseAuthentication to 'no'.     #UsePAM no     UsePAM yes          # Accept locale-related environment variables     AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES     AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT     AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE     AcceptEnv XMODIFIERS          #GatewayPorts no     #X11DisplayOffset 10     #X11UseLocalhost yes     #PrintLastLog yes     #TCPKeepAlive yes     #UseLogin no     #UsePrivilegeSeparation yes     #PermitUserEnvironment no     #Compression delayed     #ClientAliveInterval 0     #ClientAliveCountMax 3     #ShowPatchLevel no     #PidFile /var/run/sshd.pid     #MaxStartups 10:30:100     #PermitTunnel no     #ChrootDirectory none          # no default banner path     #Banner none          # override default of no subsystems     Subsystem   sftp    /usr/libexec/openssh/sftp-server          # Example of overriding settings on a per-user basis     #Match User anoncvs     #   ForceCommand cvs server     AllowAgentForwarding yes     AllowTcpForwarding yes     X11Forwarding yes     UseDNS no     PrintMotd no     AuthorizedKeysCommand /usr/local/scripts/ssh_ldap_auth.sh     #AuthorizedKeysCommandRunAs nobody


title: weird bug with xfce4: menu panel font very small

text: I am using debian wheezy with xfce4. With some applications I am experiencing a weird phenomena: The menu panel sometimes has a very tiny font (see Picture). This doesn't happen every time and only with some applications. I noticed it with `git gui` and `ocular`. Why is this happening and what can I do about it? ![Note the tiny font of the menu compared with the window title \(arrows\)](http://i.stack.imgur.com/bKMJV.jpg)


title: Linux from scratch's bash problem: $() syntax error

text: When I try to build the glibc following the Linux from scratch instruction Chapter 6.9. Glibc-2.14.1, I get a syntax error about `$(command)`. The simplified problem is that I can type               echo `ls`       and get the expected result.   However when I type               echo $(ls)      which should do the same thing, but I get               **bash: command substitution: line 78: syntax error near unexpected token `)'     bash: command substitution: line 78: `ls)'**      I don't know why the bash program that I created following the instruction of Linux from scratch cannot handle `$()` correctly. The glibc problem is here. Any idea?


title: weird output when typing letter c in shell (non english input)

text: I had keyboard set to Georgian language input. Forgot to switch it back to English and typed letter c in shell. c = ც english c key is mapped to georgian letter ც - if this makes any difference. Output baffles me... What is this?![enter image description here](http://i.stack.imgur.com/Yo9Zo.png) high res image: http://s27.postimg.org/4uv9crivn/Screen_Shot_2014_04_24_at_12_30_13.png Target server is ubuntu server 12.04lts. UPDATE AS suggested I tried to run `type ც` but when I hit c or copy paste letter ც I get "type .bash_history .bash_logout .bashrc .cache .config .mysql_history .profile .rnd .selected_editor .ssh .subversion .vim .viminfo" This is how it looks: ![enter image description here](http://i.stack.imgur.com/QnS8t.png) locale produces:               sandro@vps:~$ locale     LANG=     LANGUAGE=     LC_CTYPE="POSIX"     LC_NUMERIC="POSIX"     LC_TIME="POSIX"     LC_COLLATE="POSIX"     LC_MONETARY="POSIX"     LC_MESSAGES="POSIX"     LC_PAPER="POSIX"     LC_NAME="POSIX"     LC_ADDRESS="POSIX"     LC_TELEPHONE="POSIX"     LC_MEASUREMENT="POSIX"     LC_IDENTIFICATION="POSIX"     LC_ALL=


title: How do I set GNOME 3 (fallback) icon theme to Tango?

text: I tried setting it using `dconf-editor` and failed. ![enter image description here](http://i.stack.imgur.com/nTtGh.png)


title: rsync not using --files-from option?

text: I'm trying to run `rsync -a --files-from=~/.rsync_file_list ~/destination` and it tells me: `rsync error: syntax or usage error (code 1) at options.c(1652) [client=3.0.7]`. Can anyone enlighten me as to what I'm doing wrong? The file `~/.rsync_file_list` just contains a list of file names prefaced with `~/`, separated by newlines (though I've also tried listing them all on the same line, with the same result). If I run `rsync -a ~/file ~/file2 ~/file3 ~/destination` it works just fine. So what am I missing about the `\--files-from` option?


title: Filtering paths to a specific depth

text: I'm using rsync and the flags `-nPaAXz ~/` to check which files are going to be copied. This is far too verbose to make any sense of. How could I filter the output so I view the list of files/folders that are going to be copied to a certain depth, eg: _**1 folder deep_**               /home/afile     /home/afolder/     /home/anotherfolder/      _**2 folders deep_**               /home/afile     /home/afolder/afile     /home/afolder/anotherfile     /home/afolder/afolder/     /home/anotherfolder/afile


title: Looking at logs from bottom upwards

text: Is there a linux command or some way to look at logs from bottom up rather than from top towards bottom. I know about `tail -n <number of lines>`, but is there something that I can actually scroll and go from bottom up?


title: Lexmark S305 scanner / printer

text: I have bought a Lexmar Impact S305 scanner / printer. There was the small penguin and the word "Linux" among supported systems on the box. The problem is the official drivers are only for Debian based and RPM based distros. I haven't found unofficial drivers. There is graphic installer. It fails win my distro (Arch Linux), however I've installed it on virtual machine with Mint Debian and the printer works there. I've extracted some files (so, ppd, bin) from installer too. My question. **What do I need to set up my printer? It looks ppd alone is not enough.** * * * **Update 08-03-2011** I've extracted scripts from deb file. There are 3 files: control, postinst (17k) and prerm (4,2k).               # ./postinst      Executing postin scripts ...     ./postinst: line 73: [: ==: unary operator expected     sudo: unknown user: /usr/local/lexmark/legacy/bin/.scripts/demon     sudo: unable to initialize policy plugin      I enter a new shell.               sh-4.2# exit     exit     cp: cannot stat `/usr/local/lexmark/legacy/etc/lxS800.ppd': No such file or directory     cp: cannot stat `/usr/local/lexmark/legacy/etc/lxS800.ppd': No such file or directory      And it is the end. **Update 13-03-2011** The content of line 70-82:               #run device monitor     #TODO: investigate other ways to run daemon     #/bin/sh ${script}     if [ $username == "root" ]; then         #/bin/sh /usr/local/lexmark/legacy/bin/.scripts/demon         /bin/sh $script     else         sudo -u $username /usr/local/lexmark/legacy/bin/.scripts/demon         if [ $? -ne 0 ]; then             #/bin/sh /usr/local/lexmark/legacy/bin/.scripts/demon             /bin/sh $script         fi     fi;


title: SSH via PuTTY: launch gnome-session and gnome-panel in one Window

text: I'm connecting to a Linux machine from my Windows desktop via PuTTY. I'm running Xming on my Windows PC so that I can remote display X windows applications. Loading individual graphical programs works fine. I can run `gedit` for example and it pops right up. I want to load a desktop session, exactly how it would be viewed as if I were in front of the Linux computer. I found I can use `gnome-session` to do this, the problem is it doesn't load the upper and lower panels. I have to run `gnome-panel` separately. This is cumbersome because the panels occlude the Windows task bar. Is there a way to have `gnome-session` and `gnome-panel` all in one Xming window?


title: User needs dedicated external hard drive mounted to their home folder

text: One of the users on our Ubuntu server has given us an external hard drive as a means of increasing the amount of storage space for their account. They'd like us to auto-mount this external hard drive in their own /home/user folder to a location such at /home/user/usbDrive Additionally, they want to be sure that no other users on the system can access this external hard drive. Typically, on systems where there are not multiple users, I've been mounting external hard drives to locations like /media/usbDrive and I've never really taken the time to see if such mounts are available for other users (being that there weren't any other users). I know how to add entries to the fstab table so that mounts are mounted automatically, but what I'm really asking for guidance on is these concerns:   1. Where's the best place to mount an external hard drive that will be used only by one user in a multi-user environment?   2. If I mount this external hard drive somewhere in their own /home/user folder, will they automatically be the only user (besides root) who can access it? Or, are additional permission-modifications needed in order to ensure this.   3. I'm worried that if I mount to /home/user/usbDrive, that if the mount ever fails, large amounts of data will instead fill up the internal hard drive (at that mount location) instead of going to the external hard drive (as intended). Is this a valid concern?


title: Are there any well known and well used shell scripting IDEs for Un*x?

text: Are there any IDEs targeted at shell scripting, specifically bash and zsh scripts? This means having syntax-highlighting for shell scripts and more importantly debugging environments with features like breakpoints, variable inspection and modification, etc., just like those available for regular programming languages like Python, Java, and C. For instance Microsft Windows Powershell has IDEs like Powershell Plus and PowerGui. Googling brought up a combination of ShellEd, an Eclipse plugin for editing shell scripts, and BashEclipse, a Bash debugger that works with ShellEd; I haven't tried it yet. Are there any other shell scripting IDEs for Un*x similar to this combo? Does anyone have some experience with them?