title: Download tool needed -- with custom headers, resume, retry, custom filename output, and dynamic redirection

text: Simple problem -- I need a download manager, console, GUI, does not matter. The catch is in the features:   * custom header -- I have to pass a cookie in order to download (authorization)   * resume -- so if download stops for any reason, I could continue from 50% (for example), not from start   * retry -- so the program could automatically try establish connection and downloading again   * custom filename output -- so I could give specific filename, where the data go   * and dynamic redirection -- so if I ask server for file `X`, and server answers "OK, here is `X?token=767`" downloader will accept this with original name -- `X` (i.e. it will think it is the same I asked for) Since I prefer console, so far I tried wget, curl, aria2c. All of them fail. wget does not handle custom filename output (it is just a dump to a file) and it is "fooled" by redirection -- i.e. as with above example it will store the data in file `X?token=767` which in effect ruins both resume and retry, because with each reconnection the token changes. aria2c and curl do not even start downloading. My guess is, they don't accept redirection at all, aria2c retries again and again with 0 bytes download and no success, curl downloads the response from server the file was moved to `X?token=767`. For the record, below my commands for downloading: **wget**               wget -rc --no-cookies --header "Cookie: COOKIEKEY=COOKIEVALUE" \          "https://www.foo.bar/file.gz"      **aria2c**               aria2c -o f.gz --check-certificate=false -c -m0 \            --header="Cookie: COOKIEKEY=COOKIEVALUE" \            "https://www.foo.bar/file.gz"      **curl**               curl -o f.gz -C - --retry 1000 \          -H "Cookie: COOKIEKEY=COOKIEVALUE" \          "https://www.foo.bar/file.gz"


title: Samsung CLP-31x printer not working

text: So, my Samsung CLP-31x series printer stopped printing from Debian 6 applications. Closed source applications such as Chrome work, as does Foxit under Wine. Currently using the foo2qpdl CUPS driver. Tried Splix 2.0 from the website, nothing works, not even Foxit. Any ideas?


title: Missing separate debuginfo for - GDB

text: I have mentioned `-g` option along with `-Wall` in the `Makefile`. When I run `gdb onlineSunday`, I get:               Missing separate debuginfo for /usr/lib64/kde4/plugins/imageformats/kimg_dds.so     Try: zypper install -C "debuginfo(build-id)=a84a1969b9a69361b10f26814c0958717c48d671"     Missing separate debuginfo for /usr/lib64/kde4/plugins/imageformats/kimg_eps.so     Try: zypper install -C "debuginfo(build-id)=81e00b39aa9b3f7af23bad9d5bcef9f7cfe6333e"     Missing separate debuginfo for /usr/lib64/kde4/plugins/imageformats/kimg_exr.so     Try: zypper install -C "debuginfo(build-id)=0101355f5aa48dca9cf2723c94d1a4b7eb21e2ec"     Missing separate debuginfo for /usr/lib64/libIlmImf.so.6     Try: zypper install -C "debuginfo(build-id)=f26997841c2902a0db04726d4018640cf367101e"     Missing separate debuginfo for /usr/lib64/libIex.so.6     Try: zypper install -C "debuginfo(build-id)=2af205c15500875184d2b8519dbe01404bdfb3ae"     Missing separate debuginfo for /usr/lib64/libHalf.so.6     Try: zypper install -C "debuginfo(build-id)=5134d1c2dc3c6ea90b5eeabd518eb746c853b87c"     Missing separate debuginfo for /usr/lib64/libIlmThread.so.6     Try: zypper install -C "debuginfo(build-id)=ebb1d12661df5bbf0dd39c7c717cd197ada35d98"     Missing separate debuginfo for /usr/lib64/kde4/plugins/imageformats/kimg_jp2.so     Try: zypper install -C "debuginfo(build-id)=c1c25e24a14a9ec9163d623c699b6b53b7a1aabc"     Missing separate debuginfo for /usr/lib64/libjasper.so.1     Try: zypper install -C "debuginfo(build-id)=d521bb2892ccef13f28afaa82c0ef48433e46ca5"     Missing separate debuginfo for /usr/lib64/libjpeg.so.62     Try: zypper install -C "debuginfo(build-id)=c3638afbf013f8e33beaa3dc12f4d2dbdb3f8602"     Missing separate debuginfo for /usr/lib64/kde4/plugins/imageformats/kimg_pcx.so     Try: zypper install -C "debuginfo(build-id)=d1b443e7a29dd71a2519d852057c814bcfc9c30b"     Missing separate debuginfo for /usr/lib64/kde4/plugins/imageformats/kimg_pic.so     Try: zypper install -C "debuginfo(build-id)=4d533a04cab4426beaf2ae3c89eb2e026e5e1f81"     Missing separate debuginfo for /usr/lib64/kde4/plugins/imageformats/kimg_psd.so     Try: zypper install -C "debuginfo(build-id)=39ff79c31ae413ebac40eb8baef54ac524886e57"     Missing separate debuginfo for /usr/lib64/kde4/plugins/imageformats/kimg_ras.so     Try: zypper install -C "debuginfo(build-id)=7ecf3f8738c8cfacb14b6e54b53526346513dc8b"     Missing separate debuginfo for /usr/lib64/kde4/plugins/imageformats/kimg_rgb.so     Try: zypper install -C "debuginfo(build-id)=fc5d771438bc73014a4d551eb3b996043729c625"     Missing separate debuginfo for /usr/lib64/kde4/plugins/imageformats/kimg_tga.so     Try: zypper install -C "debuginfo(build-id)=9dd675ab0b9906bb234a90f8f4e9e65b7b6fbf63"     Missing separate debuginfo for /usr/lib64/kde4/plugins/imageformats/kimg_xcf.so     Try: zypper install -C "debuginfo(build-id)=2bfe0932ffdf6473010f792e1bde388881fdaff0"     Missing separate debuginfo for /usr/lib64/kde4/plugins/imageformats/kimg_xview.so     Try: zypper install -C "debuginfo(build-id)=6ba5f69301b600fe14553d99ef495df1d08ba379"     "ReferenceError: Can't find variable: displayMapAndClick on line:1 Source:undefined"      Missing separate debuginfo for /lib64/libnss_files.so.2      **GDB version:**               anisha@linux-trra:~> gdb -version     GNU gdb (GDB) SUSE (7.2-3.3)          anisha@linux-trra:~>      **The package:**               linux-trra:~ # cnf debuginfo-install          Program 'debuginfo-install' is present in package 'yum-utils', which is installed on your system.          Absolute path to 'debuginfo-install' is '/usr/bin/debuginfo-install'. Please check your $PATH variable to see whether it contains the mentioned path.          linux-trra:~ #      **The system:**               linux-trra:~ # cat /etc/issue && uname -a     Welcome to openSUSE 11.4 "Celadon" - Kernel \r (\l).          Linux linux-trra 2.6.37.1-1.2-desktop #1 SMP PREEMPT 2011-02-21 10:34:10 +0100 x86_64 x86_64 x86_64 GNU/Linux          linux-trra:~ #      **This is what I did:**               linux-trra: # zypper install -C "debuginfo(build-id)=a84a1969b9a69361b10f26814c0958717c48d671"     Retrieving repository 'Updates for openSUSE 11.4 11.4-0' metadata [done]     Building repository 'Updates for openSUSE 11.4 11.4-0' cache [done]     Retrieving repository 'devel:languages:R:patched' metadata [done]     Building repository 'devel:languages:R:patched' cache [done]     Loading repository data...     Reading installed packages...     No provider of 'debuginfo(build-id) = a84a1969b9a69361b10f26814c0958717c48d671' found.     Resolving package dependencies...          Nothing to do.          linux-trra: #      **What to do now?** * * *               linux-trra: # zypper ar -f -n "openSUSE-11.4-Debug" http://download.opensuse.org/debug/distribution/11.4/repo/oss/ repo-debug     Adding repository 'openSUSE-11.4-Debug' [done]     Repository named 'repo-debug' already exists. Please use another alias.          linux-trra: # zypper ar -f -n "openSUSE-11.4-Debug" http://download.opensuse.org/debug/distribution/11.4/repo/oss/ repo-debug-update     Adding repository 'openSUSE-11.4-Debug' [done]     Repository named 'repo-debug-update' already exists. Please use another alias.          linux-trra: #


title: Can GRUB2 share the EFI system partition with Windows?

text: I have an existing Windows 7 GPT installation, which already has a EFI System partition. I am now trying to install a Linux on a separate harddisk, which is also GPT formatted. I did not find any working way to get grub booting without EFI system partition, so my question is: Is it possible for grub2 to use the same EFI System partition as windows? How do I tell grub2 to use it? To clarify my setup:               gpt /dev/sda:         1 EFI System partition created by windows (100MB)         2 "Microsoft reserved partition" (200MB)         3 Windows root (rest of disk)          gpt /dev/sdb:         # After answering my own question: this partition is not needed         1 boot partition containing grub, kernels etc.(32MB)         2 crypto LVM partition (rest of disk)      I want grub2 to use the existing `/dev/sda1` EFI partition. PS: My mainboard is EFI capable.


title: Power saving enables touchpad

text: I've installed power saving packages (bumblebee, laptop-mode-tools, and cpufreq) to my laptop with Debian Wheezy. Thanks to that I decrease power usage from 32W to 10W. But now I faced the issue that I can't disable touchpad. I wrote simple script that inverts state of touch-pad:               #!/bin/sh     synclient TouchpadOff=`synclient | grep TouchpadOff | awk '{print !$3}'`      When I launch this script, it inverts state of touch-pad as expected, but in 5 seconds TouchpadOff is rewritten with value "2", and touch-pad becomes active again. I suppose that it's laptop-mode-tools who modifies TouchpadOff variable. I tried to find related settings in laptop-mode-tools, but didn't find anything. Any ideas how to determine who modifies TouchpadOff variable and how to disable such a modification?


title: The command to upgrade to a new kernel from Ubuntu repositories

text: In the distro I'm most familiar with -- ALTLinux, a command like `apt-get install kernel-image-std-def#3.0....` would install another kernel, and update the initramfs and the bootloader config accordingly; an even better command would be the specific `update-kernel`, which would also install the accompanying kernel modules for the new version of the kernel (the ones that are installed in the running system, so that the support for the hardware of this system is not lost in the case of the new kernel). (A short manual on this topic for ALT (in Russian).) Now I want to upgrade the kernel in my Ubuntu 12.04 system on a Toshiba AC100 (ARM). What would be the command in Ubuntu to install the new kernel, so that all the required things are done: initramfs is generated, the bootloader is updated, and no required module is lost? I'm especially interested in a command that would ensure that everything is done correctly, because I don't understand the peculiar boot process on this computer very well.


title: Why does e2fsck fail during boot, but not later?

text: When booting my Debian server, I'm presented with the following error concerning my external hard drive:               /dev/disk/by-label/elements:     The superblock could not be read or does not describe a correct ext2 filesystem.     ....     ....     fsck died with exit status 8.     ...     ...          A maintenance shell will now be started. CONTROL-D will terminate this shell and     resume system boot.      The thing is that if I type `Ctrl-d` or enter the maintenance shell the disk is correctly mounted and calls to `e2fsck /dev/disk/by-label/elements` report no errors. This is very annoying since I need to type `ctrl-d` every time the server is rebooted and I would rather not have a keyboard attached to the server at all.


title: Opensolaris snmp broadcast

text: A network sensor I'm evaluating is showing that my Opensolaris server is broadcasting on the snmp port 161, and I'm getting alerts about every 2 minutes. How can I turn off the snmp broadcast (i.e. traps?) on the Opensolaris machine? We have snmp enabled on the Opensolaris machine for Cacti, so it should really just be acting like a client in regards to snmp. Is there a configuration setting somewhere? I'm not familiar with snmp, but somehow got it up and running for Cacti. I see that /usr/sbin/snmpd is running. Any thoughts? Thanks.


title: Configuration for either detecting already running xsession or only auto-logging in once

text: My goal is an Arch based HTPC which on one tty runs XBMC and on another runs a minimalistic desktop (mainly for web browsing). I haven't yet started on the XBMC slice of the pie, but at the moment it automatically logs in to the desktop user's account via               c1:2345:respawn:/sbin/agetty -a USERNAME -8 -s 38400 tty1 linux      then via ~/.bash_profile it does a `startx` which does a `startxfce4`. This is fine until you switch to another tty, then back to tty1. Upon switching back it seems to reexecute the ~/.bash_profile which then has a tantrum because an xsession is already running. My questions are:   1. Is this a sensible way of implementing a desktop & XBMC configuration? It was the easiest thing I could think of (not being particularly pro on linux) for me and the end user.   2. Is there a way I can check for a correctly operating XFCE session running on tty1 and switch to it if there is, and run a new one if not?   3. Or is there a better way of performing an auto-start of XFCE on login which wouldn't get called every time you switch to the console? (Better ways of implementing this which don't directly answer these questions would be useful too; I'm aiming for light-weight & simple).


title: How to archive POP3 mailbox?

text: What programs are available to archive a mailbox (to mbox or maildir format) that I can only access via POP3? I'd like to be able to browse the mailbox locally afterwards, probably using mutt or the like. I'm on Debian stable, no problem to compile from source if needed, commandline preferred.


title: how to scp to host connected on a wifi?

text: I have my MAC on a wifi and am connected via `ssh` to a linux host. I want to copy some files from the linux host over to my MAC. I know, I can simply run `scp` on the mac to fetch each file via               mac> scp me@host.some.where:remote/folder/file local/folder      but I cannot do that with one command for many files (I could `tar` them first into an archive using the `ssh` connection and then ship the archive in one go, but I want to avoid this). So instead, I want to send all the files from the remote host (to which I'm connected by ssh) via (note the usage of a wildcard)               host> scp remote/folder/files* me@mac.some.where:local/folder      but what is the appropriate `mac.some.where` here, i.e. how can I obtain that, when my MAC is connected to some wireless? I tried the (numerical) IP address (obtained by `ifconfig`), but to no avail.


title: Can't get Kernel image

text: I am trying to write the kernel image in my ARM, I am using an ARMStone a9 here is the information about this board: http://www.fs- net.de/en/products/armstone/armstonea9/ The problem is that I am trying to write the kernel image, but when I finish it and everything it seems that is ok, I type boot for reboot the board, and I get this error: ERROR: can't get the Kernel image I have been investigating and I find out that could be for the Kernel image format but I get it from the official site web, then I do not think so that this is the problem. Also I read that maybe is problem of my variables enviroment here is my enviroment:               bootdelay=3     baudrate=115200     loadaddr=0x10800000     rd_loadaddr=0x11000000     netdev=eth0     ethprime=FEC0     uboot=u-boot.bin     kernel=uImage     nfsroot=/nfsroot     bootargs_nfs=setenv bootargs ${bootargs} fec_mac=${ethaddr} root=/dev/nfs     ip=${ipaddr} nfsroot=${serverip}:${nfsroot},v3,tcp     bootargs_nand=setenv bootargs ${bootargs} fec_mac=${ethaddr} ${mtdparts}     gpmi_debug_init enable_wait_mode=off ubi.mtd=TargetFS root=ubi0:rootfs     rootfstype=ubifs rootwait rw     bootargs_mmc=setenv bootargs ${bootargs} fec_mac=${ethaddr}     root=/dev/mmcblk0p1 rootfstype=ext4 rootwait rw     bootcmd_net=run bootargs_nfs;tftpboot ${loadaddr} ${kernel}; bootm     bootcmd_net_mmc=run bootargs_mmc;tftpboot ${loadaddr} ${kernel}; bootm     bootcmd_mmc= for disk in 0 1 ; do mmc dev ${disk} ;for fs in fat ext2 ; do     ${fs}load mmc ${disk}:1 ${loadaddr} /6q_bootscript && source ${loadaddr} ;     done ; done     bootcmd_nand=run bootargs_nand;nand read ${loadaddr} Kernel 0x600000;bootm     bootcmd_nand_mmc=run bootargs_mmc;nand read ${loadaddr} Kernel     0x600000;     bootm loadcmd_nfs=nfs ${loadaddr} ${serverip}:/nfsroot/uImage     clearenv=sf probe 1 && sf erase 0xc0000 0x2000 && echo restored     environment to factory default     upgradeu=for disk in 0 1 ; do mmc dev ${disk} ;for fs in fat ext2 ; do     ${fs}load mmc ${disk}:1 ${loadaddr} /6q_upgrade && source ${loadaddr} ;     done ; done     ethact=FEC0     ethaddr=00:05:51:07:B3:B8     mtdids=nand0=gpmi-nand     mtdparts=mtdparts=gpmi-nand:512k(NBoot)ro,2m(UBoot)ro,256k(UBootEnv),256k(UserDef),6m(Kernel)ro,-(TargetFS)     filesize=5D7C000     fileaddr=10A00000     bootcmd=run bootcmd_nand     serverip=192.168.1.44     netmask=255.255.255.0     ipaddr=192.168.1.131     stdin=serial     stdout=serial     stderr=serial     bootargs=console=ttymaxc1,115200     video=mxcfb0:dev=hdmi,1024x768M@60,if=RGB24 fec_mac=00:05:51:07:B3:B8     mtdparts=gpmi-  nand:512k(NBoot)ro,2m(UBoot)ro,256k(UBootEnv),256k(UserDef),6m(Kernel)ro,-(TargetFS)     gpmi_debug_init enable_wait_mode=off ubi.mtd=TargetFS root=ubi0:rootfs     rootfstype=ubifs rootwait rw     partition=nand0,0     mtddevnum=0     mtddevname=NBoot      So please if someone knows how can I solved this please help me!


title: Console won't power off on PowerPC with Debian

text: I installed Debian 6.0 on a Power Mac G5. First it would boot to a blank screen but I fixed that by blacklisting nouveau as described here. Now the monitor will never turn off. It's a server so I'll mostly ssh into it and I want the monitor to power down after a very short time. I have no xserver installed and just use the console. I've tried modifying `/etc/kbd/config` but that didn't work. I also tried installing `console- tools` and modifying `/etc/console-tools/config` but that didn't work. Then I tried using `setterm` and that didn't work. I even tried using console codes to blank the screen, but that didn't work either. Does anyone know how I get control of the power saving modes for this console?


title: How can I know what is the cause of linux to crash at start-up?

text: I'm using gentoo. Sometimes (not always), when the system starts (from power up), its crash (before I'm getting the GUI login window). I know Linux saves into log files the problem of the crash, but I'm so confuse and don't know from where to start ?               Do I Need to check the dmsg file ? (or other log file ?)     Do I need to grep with "errors" ? or there string pattern to search in the dmsg or other logging file ?)


title: How to have find only search for files in changed directories?

text: Currently I'm repeatedly doing a 'find' that's too slow. I'm searching for non-hidden executable files within "$root", excluding "$root/bin":               find "$root" -type f -perm -o+x -not -path "$root/bin/*" \( ! -regex '.*/\..*' \)      I'd like to restrict find to only look in directories with mtimes older than a certain time. I still want it to recurse into old directories' subdirectories, but I don't want it to check the regular files inside unless the directory passes my mtime check. Is it possible to do this with GNU find or do I need two invocations, one to find the directories and another to check the files inside?


title: How to determine what filesystem a directory exists on?

text: I have an NFS share which is shared across about two other machines. I recently realized that one of the servers isn't sharing the directory and is keeping files all for itself. Is there a way to see if the NFS share is mounted in the directory I think it is in?


title: Access memory via a flat file in Linux

text: I understand everything is a flat file in Linux. How hard is it to dump the contents of the main memory into a flat file? Does it already exist in Linux? If yes, what's the path to the file? What are the default permissions?


title: static ip to a freebsd server

text: I have `Comcast cable <====> modem <===> router <===> freebsd server` My `freebsd server` is connected to wireless router via a network cable. What I want to do is, to have a static ip for the server. How can I do it?


title: Custom action to open an program instance for each selected folder?

text: In Thunar, I want to be able to open folders with Ex Falso. I created a custom action with the command `/usr/bin/exfalso %f`. This works when I select a single folder. When I select several folders, I want Thunar to open an Ex Falso instance for each selected folder. I tried the parameters `%F` and `%N`, but then Ex Falso gets opened for the first folder only.


title: How can there be a directory named `~`?

text: I was trying to test out this buggy/new tool to see how it works, and it prompted me to choose a directory to use for stuff I am doing. From the directory `~/Code/indep`, I typed in `~/Code/indep/tarbell`. (Stupid, I could have just typed 'tarbell', but whatever.) It prompted me to create it because it didn't exist, I said yes. When I inspected the contents of this directory, here is what I see:               brian@navis:~/Code/indep$ ls     ~ project1 project2 project3 ...      I thought "oh, weird, it created a symlink to ~". However:               brian@navis:~/Code/indep$ file ./~     ./~: directory      `file` thinks it's a directory.               brian@navis:~/Code/indep$ ls -l     drwxr-xr-x 3 brian brian 4096 Nov  8 16:50 ~     drwxr-xr-x 8 brian brian 4096 Oct 14 18:42 project1     drwxr-xr-x 3 brian brian 4096 Sep 10 21:15 project2     drwxr-xr-x 5 brian brian 4096 Oct 14 19:33 project3     ...      And so does `ls -l`. I thought, "oh, ... is it a hard link? I've never really used those." But I tried to reproduce, and it's impossible to create a hard link to a directory. So... I guess I've narrowed this down to things I don't understand. Did I mount my home directory in this other directory somehow? My main goal at this point is to remove the reference to my home directory in this folder (`rm` doesn't seem like the answer), but I'm also curious to know what's going on. EDIT: In retrospect, I understand exactly what happened. As was answered below, the program created a directory called "`~`" inside my current directory. The only really obfuscating fact about this is that I wasn't consistent with how I was actually viewing what the directory was. Sometimes I referred to it as "`~`" and sometimes as "`./~`". It's only if you do the latter that you can actually see what's going on, but until I understood this, I was conflating what I was seeing from using the absolute path of "`~`" to to what was in fact a local directory.


title: How do I print the process name next to the process ID number in a file?

text: I'm redirecting results for something into a file and I also need to find the process name and ID number and redirect it to the file as well. I'm guessing the process name is the command in which I'm directing the results to. As in if the command is `pgrep sshd` and I redirect the results to the file, `pgrep sshd` would be the process name. I'm just curious though how exactly I find the process ID number and what would be the simplest way to redirect it to a file if there is a command to find it. Here is the original objective I was given, I'm sorry if I seem really new at this, I am a student. > Man pages usually have a helpful section near the end called "SEE ALSO" that > you can use to find a list of commands and topics related to the command > that the current man page is about. Use this feature to locate a command > related to "ps" that will search for processes based on some criteria. Use > this command to locate all processes called sshd, directing the output to a > file named `processes.txt` in `~/sysadmin1`, making sure that the command > also prints out the process name next to the process ID number. You will > have to specify a flag with the command that you find in the man page for > the command in order to do this. When you have finished add the full command > used to the top of the `processes.txt` file.


title: RPMs and patching

text: I have 3 files (from here)that I have been given to install in an attempt to upgrade the compiler: > binutils-2.13.2.1-1.mipsel.rpm   >  binutils-2.13.2.1-1.src.rpm   >  binutils-2.13.2.1-r5900-7.diff.gz I'm kinda fumbling around with this. What I've done is:               rpm -i mipsel -vv     rpm -i src -vv      I have no idea what to do with the `.diff.gz` I understand its a patch but dont really know how to deal with it.


title: openSUSE not starting up after failed update

text: More than failed it was a partial update, when I was updating there was a power failure and my laptop shutdown (battery is broken). Now when I try switching my system on, it shows the chameleon and then it just shows a small cursor at the top left of the screen and stays there forever. Any help to recover?


title: How does the CentOS installation work from the inside?

text: I am trying to understand the content of a Linux distribution's ISO image file and how the installation process take place. Here I am specifically talking about CentOS 6.4 in its minimal version. So ISOLINUX is triggered, and I get the menu displayed. Then I hit install. It loads the kernel and the initrd filesystem. My questions are:   1. How does Anaconda get called?   2. What is the role of the images/install.img file ? (Who calls/mount it?)   3. Does Anaconda installs Packages/*.rpm? If I wanted to add one in there can I and would it be installed ? Any link / recommendation is welcome,


title: root password changed automatically

text: I have my system on dual boot (win7 and RHEL 6). I have 2 user account on RHEL 6. A normal user and a root user. I put passwords of both accounts same. It was working fine from 5 6 days. Yesterday I installed ntfs-3g to use NTFS drives in RHEL. It worked fine too. Now today's morning when I started my laptop, I login through the normal account, worked fine. Then I accessed NTFS drive, it asked for authentication, I gave root's password but it said that the password is wrong. I will change the root's password from single user mode. But I just want to know why did this happen? How it changed automatically? PS: No one else accessed my laptop.


title: Make BASH's Tab Completion Fill In First Match?

text: Is there any way to make BASH fill in the first match when I press TAB, kind of like the Windows command prompt? (It should still display the list of matches, but it should cycle through them when I keep on pressing tab.) i.e. the goal here is to be able to fill in **_any** match_ with **only** the TAB key, given enough presses -- like in Windows.


title: In awk, how to print a range of fields with the original $0 delimiters intact?

text: How to extract a substring of $0, in `awk`, when that substring's position and length is based on the positions of fields in the original $0? It effectively equates to removing the first _n.lead_ fields and the last _n.trail_ fields and all those fields' leading and trailing delimiters, from the original $0 Here is an example: It is only known that the range is $4 to $8 inclusive.   The delimiter is any number of spaces and/or a single comma, eg. `" , "` or just `","`... and the leading delimiter is to be ignored.                         Input: "   a  a  a   X marks   the   start,   Y   marks the  end  "     Expected Output: "X marks   the   start,     Y"


title: How to route specific adresses through a tunnel?

text: There are certain websites/services which I can only access from the subnet on which my server is located (think of the typical intranet scenario). Is there a way to transparently route traffic that go to these addresses through an SSH tunnel? Consider the following setup: My laptop is connected on the home network. It cannot access services on ips X and Y directly. I have an SSH tunnel to a server which is on a subnet that can actually access these services. Can I somehow automatically encapsulate all the traffic to the subnets of X and Y to go through this tunnel, without having to run the entire VPN solution that would send all my traffic through the server? In other words: all traffic that goes to any other subnet should still go directly from the laptop, without passing through the server (using the tunnel).


title: Command-line way to download youtube video in multi-threaded

text: On a fast internet connection, downloading Youtube videos is too slow compared to downloading files from other websites. Currently I'm using `get_flash_videos` to download the Youtube videos. How can I integrate `get_flash_videos` with multi-threaded download accelerators like `axel`, `MultiGet` or `Wxdownloadfast`?


title: Replace spaces and tabs at the end of the line in all files

text: I need to replace all unwanted spaces in all files from the current directory and from directories from the current directory (recursive search). I define the _unwanted spaces_ the spaces and tabs that are at the end of the line and are not followed by any other character than `\n` (the new line character). e.g.:               This is a line with unwanted spaces                 // this line is supposed to contain only spaces     Another line without unwanted spaces     Another line with unwanted spaces           This snippet will become:               This is a line with unwanted spaces          Another line without unwanted spaces     Another line with unwanted spaces      How can I remove all unwanted spaces from all files (recursive search) from the current directory?


title: parameter extraction from multiple parameter output in bash?

text: Here's the bash script I am working on: i/p: `ls *.py`   o/p: List of output files with `.py` extension 1.How do I know the number "n" of the `.py` files?   2.Then pump files one by one into the program to do further processing?


title: Input validation in a bash script

text: I've got the basics of bash scripting (I think anyways), and i'm trying to move on to more advanced stuff. I am trying to write a script that will perform input validation (the user must input either yes or no) and i'm trying to do this by combining a function and an if then else statement. This is what i'm working on so far.               #!/bin/bash     func ()     {          echo "Enter yes or no:"         read var1     }          if [ $var1 != yes ] || [ $var1 != no ]     then         func     else         echo "I'm glag you said $var1"     fi          exit 0      I know that i'm using the wrong if then else operator/syntax, but I can't find the correct syntax threw googling. I want it to run the function if var1 is either equal to yes or no, so the user can't input something else.


title: `hostname` - host name or FQDN?

text: What is the right thing to set a computer's hostname to? (`/bin/hostname`, `/etc/hostname`, `sethostname(2)`, etc.) I usually just use the "name" part, and it works perfectly (for me at least), but I've seen it implied in some places that I should use the entire "name.domain.tld" instead... which just doesn't feel "right" for me.


title: Batch File Rename Using Mapping File

text: I have a large collection of image files, for example:               a.png, b.png, c.png, etc      If I have a file with mappings of filenames to numbers, like so (ignore the format, it could be anything):               a=>1     b=>2     c=>3     ...      Is there any easy way to batch rename all the files using the mapping file to:               1.png, 2.png, 3.png, etc      I'm looking for unix/linux commands. I know I can write a very simple script, but just curious if there is any other technique. Thanks


title: Using Creative Sound Blaster on Ubuntu Server

text: I just got a Creative Sound Blaster for playing audio wirelessly. I connected it to a virtual version of Ubuntu desktop and just had to go into the sound settings and switch it to the USB and the device worked. Now I am trying to get it to work on Ubuntu Server 10.04. I plugged it in and restarted the computer, but when I go to /dev I don't see it listed (unless I'm missing it somehow). Does anyone know how to get the Sound Blaster to work on Ubuntu Server? (I haven't gotten any audio to play out of the server, so if you wanted to include that, I wouldn't mind. However, I feel confident that google will hold the answer to that question...the main question is the Sound Blaster).


title: How to kill a printing job on centOS

text: How does one kill a printing job on centOS?


title: Set GPIO permissions cleanly

text: Can the default permissions and ownership of /sys/class/gpio/ files be set, e.g. by configuring udev? The point would be to have a real gid for processes that can access GPIO pins on a board. Most "solutions" include suid wrappers, scripts with chown and trusted middleman binaries. Web searches turn up failed attempts to write udev rules. (related: Q1) (resources: avrfreaks, linux, udev)


title: Firewall config prevents hibernate connecting to postgres in CentOS6.3

text: I have an operating environment in CentOS 6.3 that has tomcat7 and postgres9.2 installed. There is just one web application deployed in tomcat that tries to establish a connection from localhost to postgres. The following is the contents of /etc/sysconfig/iptables               #Filter table     *filter     :INPUT DROP [9:2530]     :FORWARD DROP [0:0]     :OUTPUT ACCEPT [88:11968]     -A INPUT -i lo -j ACCEPT     -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT     -A INPUT -p tcp --dport 22 -j ACCEPT     -A INPUT -p tcp -m tcp --dport 8443 -j ACCEPT     -A OUTPUT -p icmp -j ACCEPT     COMMIT          #NAT TABLE          *nat     :PREROUTING ACCEPT [129:7557]     :POSTROUTING DROP [1:108]     :OUTPUT ACCEPT [1:108]     -A PREROUTING -i eth0 -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443     COMMIT      Tomcat only allows https and listens for requests at port 8443. Currently I forward requests from port 443 to 8443 so that users don't have to specify port numbers in the URL. Web pages are happily accessible from a browser, but web application fails to work. From tomcat logs, hibernate fails to establish a connection with postgres even though netstat output says postgres is at stage LISTEN for requests at 127.0.0.1:5432. All this started happening when I came up with the new firewall config. I was of the idea that the following line               -A INPUT -i lo -j ACCEPT      should take care of local connections from tomcat webapp to postgres, but looks like it doesn't. I need to know what is it in the firewall config that I need to change to allow the connections back again.


title: Setup PPTP VPN connection with no GUI

text: I want to configure a remote linux (Ubuntu Precise) to use a PPTP VPN. I can only access to it using `ssh`, so I don't have a graphical interface (neither do I want it). Some hours googling:   * Guides on where to click in the graphical interface (useless);   * pptp-linux:      * `getaddrinfo(): Name or service not known`   * nmcli      * `** (process:5244): WARNING **: Could not initialize NMClient /org/freedesktop/NetworkManager: The name org.freedesktop.NetworkManager was not provided by any .service files`     * `** (process:5244): WARNING **: Error enabling/disabling networking: The name org.freedesktop.NetworkManager was not provided by any .service files` Can anyone point me a tutorial, a command that actually works, or any other way to setup all network traffic to go through the PPTP VPN on that machine? ## Update My VPN service has expired and I will not renew it. I no longer have access to a PPTP VPN, so I can not replicate the problem, nor do I have the need to verify if any given answer solves the problem I described.


title: How can I test for POSIX compliance for shell scripts?

text: Probably the main thing that this website has taught me so far is the importance of writing portable shell scripts. Considering that POSIX is the closest thing to a common standard between all unices, I'm interested in knowing if there's a shell that supports it exclusively. While most modern shells provide support for POSIX (and will run POSIX compliant scripts without any problem), they don't do a good job at pointing out non compliant features. Is there any shell that implements POSIX and POSIX only, in such a way that it'd throw an error for any non compliant feature? **EDIT** I want to clarify that I'm not asking for general tips for writing portable shell scripts. The related question mentionned in the comments already covered this. I thought of this question when I found out that `bash` has a `\--posix` option but only to discover that it only affects some intialization behaviors which is not exactly what I'm looking for.


title: Backing Up to a Compressed Archive on Linux

text: How would you go about backing up just some files and subdirectories of a given directory to a compressed archive so that the tree structure could then easily be recreated from that archive. Basically, rsync, with a little bit of scripting around (to select the files and folders I need) does the job, except I don't want to just copy. I need an additional layer that compresses the files being rsynced into some kind of compressed archive (which could then be restored with the paths being recreated). Rsync doesn't necessarily have to be part of the solution. E.g., can I mount an archive on so that everything that goes to that mount point gets compressed?


title: Why does reading from two connected pty's cause an infinite loop?

text: I want to fake a gsm modem for testing a program. I want the program to send AT-codes to me and that I can answer it back, kind of a VirtualSerialPort. But for some reason the data written from the program is written back to it directly. I would have expected that socat created two pipes; one that sends the output from the test program to whatever I've attached on the other side and another pipe that works in the other direction. But the data appears to "loop in one pipe", if you understand what I mean. Here's a picture from TTY demystified to illustrate my point: ![Pty handling in kernel](http://i.stack.imgur.com/2KLkn.png) A simplified reproduction script: I create the pty's with:               (xterm 1)$ socat -d -d -d PTY,link=foo PTY,link=bar     2012/01/18 14:45:01 starting loop with FDs [3,3] and [5,5]      And I listen to both sides:               (xterm 2)$ cat <bar     (xterm 3)$ cat <foo      If I write a few characters...               (xterm 4)$ echo "..." > foo      .. socat logs a _lot_ of traffic that goes forth and back infinitely.               (xterm 1)     2012/01/18 14:25:58 socat[7667] I transferred 4095 bytes from 5 to 3     2012/01/18 14:25:58 socat[7667] I transferred 4095 bytes from 3 to 5     2012/01/18 14:25:58 socat[7667] I transferred 4095 bytes from 5 to 3     2012/01/18 14:25:58 socat[7667] I transferred 4095 bytes from 3 to 5     2012/01/18 14:25:58 socat[7667] I transferred 4095 bytes from 5 to 3     2012/01/18 14:25:58 socat[7667] I transferred 4095 bytes from 5 to 3      There's nothing outputted from either of the cat commands. **EDIT:** @wnoise explained that socat creates two PTY masters. Here's an image to illustrate that: ![Two PTY masters connected by socat](http://i.stack.imgur.com/O2vkm.png)


title: Naming process in init scripts

text: I'm trying to write an init script that will start a service that needs to have started `postgresql` server before. Bellow is the `postgresql`'s init header:               #!/bin/sh     #     # postgresql    This is the init script for starting up the PostgreSQL     #               server.     #     # chkconfig: - 64 36     # description: PostgreSQL database server.     # processname: postmaster     # pidfile: /var/run/postmaster-9.1.pid      In the header from my init script, how should I refer to postgresql, through `postgresql-9.1` (the init script file name) or through `postmaster` (that's because of `processname` from `postgresql`'s init script)?


title: Pretty output in GHCI: no colours shown

text: Using this method to get a pretty GHCI colours, I am not getting any colours whatsoever. However, my terminal is a urxvt with 256 colours enabled and TERM is `xterm-256color`. Any idea what I could have missed? My ~/.ghci reads:               import qualified IPPrint     import qualified Language.Haskell.HsColour as HsColour     import qualified Language.Haskell.HsColour.Colourise as HsColour     import qualified Language.Haskell.HsColour.Output as HsColour          let myColourPrefs = HsColour.defaultColourPrefs { HsColour.conid = [HsColour.Foreground HsColour.Yellow, HsColour.Bold], HsColour.conop = [HsColour.Foreground HsColour.Yellow], HsColour.string = [HsColour.Foreground HsColour.Green], HsColour.char = [HsColour.Foreground HsColour.Cyan], HsColour.number = [HsColour.Foreground HsColour.Red, HsColour.Bold], HsColour.layout = [HsColour.Foreground HsColour.White], HsColour.keyglyph = [HsColour.Foreground HsColour.White] }          let myPrint = putStrLn . HsColour.hscolour (HsColour.TTYg HsColour.XTerm256Compatible) myColourPrefs False False "" False . IPPrint.pshow          :set -interactive-print=myPrint     :set -XNoMonomorphismRestriction     :set prompt "λ "      The prompt should look like this: ![haskell ghci colour prompt](http://i.stack.imgur.com/8ZAZu.png)


title: How to use Quicken Home Inventory on Linux (or Windows 7)

text: I have Quicken Home Inventory Manager and it seems that is no longer supported by Intuit, i.e. it does not run on newer Windows versions (like Windows 7 64-bit for example). Since I also use Linux, I'd like to try to use it on Linux if possible. Of course, I could install another inventory program, but there is no option to export data from QHIM and I have over 2 thousand items in the database, so I really have to keep using this proprietary software. I tried running it under Wine but it's very slow to the point when it's completely unusable. It was very slow on Windows as well when I got more than a couple of hundreds of items, but under Wine the screen flickers all the time and I really cannot use it. I'm looking for some way to either tweak Wine settings or find some way to export data from QHIM's database.


title: Set default Soundcard Centos

text: How do I set my default soundcard on Centos/Linux? I have two soundcards installed on my system and it always detects the wrong one, upon boot.


title: Copy files with deleting suffix in name

text: How can be done coping files that have some suffix at the end, into same dir with the smallest command possible: Example have directory containing files:   * cassandra.yml.example   * database.yml.example   * facebook.yml.example   * cache.yml.example   * system.yml.example need to copy them and have names like this:   * cassandra.yml   * database.yml   * facebook.yml   * cache.yml   * system.yml


title: tcpdump: "packets captured" vs "packets received by filter"

text: We have a script which calls               tcpdump -v src host <IP address> and port <port number> >>out.txt 2>>err.txt -w capture.cap      on multiple IP-s while the other parts of the script initiates some traffic in the background. We want check if packets are coming back to us, and examine manually only those cases when we receive packages. tcpdump's error output seemed fine for this at first, but. The question is, as the subject suggests, what's the difference between "packets captured" and "packets received by filter"? There are captures, which did not record any packets, but output "0 packets captured, 2 packets received by filter" which sounds like a contradiction, since if no packets were captures, how were 2 of them filtered? At first, we had been looking for "0 packets received by filter" but that isn't alway written to error output, when there were no packets received. So what do these numbers show? Please advise what to look for if we want to filter those cases when no reply packets were received.


title: Problems when using the framebuffer device directly

text: I am writing a program using the framebuffer device directly and I have three problems there. 1) The only way I can set the screen resolution correct is by passing the kernel option during boot: `video=800x600` when using others like: `video=vesafb:800x600-32,ywrap` , `video=uvesafb:800x600-32,ywrap` , `video=intelfb:800x600-32,ywrap` the framebuffer is 800x600 in the terminal, but as soon as i start the program the resolution goes back to its native resolution (1366x768). Is this an Intel (gma) issue or am I doing something wrong here? 2) With all four above variants I am not able to acquire offscreen buffers. In example doubling the y-resolution via `FBIOPUT_VSCREENINFO`. Is there another option to be set to be able to use offscreen framebuffer memory? May be related to the above issue? 3) Exiting the program I am stuck on the framebuffer, even though the program cleans up and resets the old configuration. I have to go to another terminal by `CTRL+ALT+F1` and back by `CTRL+ALT+F7` to get back into X. Why could this be, assuming the program does everything correct? I am on an Intel GMA 3150.


title: Meaning of the yum error "Package tuple (...) could not be found in rpmdb"

text: I just want to install two packages in my Fedora 15 but I am getting some weird error. **Command:**   `yum install @development-tools` **Error:** > Loaded plugins: langpacks, presto, refresh-packagekit Setting up Install > Process Package flex-2.5.35-13.fc15.x86_64 already installed and latest > version Error: Package tuple ('gcc', 'x86_64', '0', '4.6.0', '6.fc15') could > not be found in rpmdb **Command:**   `yum install fedora-packager` **Error:** > Loaded plugins: langpacks, presto, refresh-packagekit Setting up Install > Process Error: Package tuple ('fedora-packager', 'noarch', '0', '0.5.9.0', > '1.fc15') could not be found in rpmdb On first command it says package already installed and latest version but why I got that error line.How to fix this errors?


title: Gnome trouble on a DisplayLink device in a Linux virtual machine

text: I have a virtual machine running Ubuntu 10.04 32-bit. Using the tools provided with VirtualBox, I have added a DisplayLink device to the VM and created the following `xorg.conf` file:               Section "ServerLayout"             Identifier      "Server Layout"             Screen  0       "DisplayLinkScreen" 0 0             Option          "Xinerama" "off"     EndSection          Section "Files"             ModulePath      "/usr/lib/xorg/modules"             ModulePath      "/usr/local/lib/xorg/modules"             ModulePath      "/usr/local/lib/xorg/modules/drivers"     EndSection          ############### DisplayLink Stuff ###############          Section "Device"             Identifier      "DisplayLinkDevice"             driver          "displaylink"             Option  "fbdev" "/dev/fb1"     EndSection          Section "Monitor"             Identifier      "DisplayLinkMonitor"     EndSection          Section "Screen"             Identifier      "DisplayLinkScreen"             Device          "DisplayLinkDevice"             Monitor         "DisplayLinkMonitor"             SubSection "Display"                     Depth   16                     Modes   "800x480"             EndSubSection     EndSection      This works to a small degree - the DisplayLink device turns green, and eventually a purple desktop with my icons appear on it. The actual VBox window is blank. The problem is that:   * the Gnome panel does not load   * a right-click on the desktop has no effect I tried pressing `Alt+F1` and the console displays in the VBox window. Pressing `Alt+F7` after that does nothing. I have to press `Alt+F8` to get back to the GUI. This leads me to believe that there's an extra display in there somewhere. I _have_ installed Guest Additions if that helps. GDM is set to auto-login to a Gnome session. * * * **Edit:** It seems like the problem is with Gnome / GDM. Applications (e.g. gnome-terminal) display normally. `xev` is reporting that all input events are coming through okay. The panel seems to be partially running but invisible:               $ wmctrl -Gl | grep -i panel     0x01200003 -1 0      0     1     1   test-pc Top Expanded Edge Panel     0x01200042 -1 0      0     1     1   test-pc Top Expanded Edge Panel


title: What linux is best suited for people new to computers?

text: What would be the easiest linux for people who are new to computers? The computers here have 256Mb RAM with 40GB hard-disks. UPDATE: Most of them apparently have more than 265MB of RAM with some having 1GB. I've installed Linux Mint Debian Edition (LMDE), which the users could figure out after a bit of messing around and a little help from me. I picked it because it is a rolling distribution and all the great things I've read about Linux Mint. Also I had used Ubuntu before and Mint seemed like Ubuntu+ . I'm not sure if it is the easiest distro for them to use, since people who have tried to use the default Libre Office, found it confusing with all those menus. (The program they seem use the most is the web-browser and they found chromium to be fairly simple). As a side note, the installation wasn't very smooth and the printer (HP LaserJet 1020) took a bit of work to setup, but once it was done and the OS upgraded, it works very well.


title: I uninstalled vsftpd, but I can still connect with sftp

text: I installed vsftpd and was in the process of configuring it. When I sent the vsftpd server stop command:               sudo service vsftpd stop      I received:               stop: Unknown instance      So I went ahead and uninstalled it and rebooted the system               sudo apt-get remove --purge vsftpd      when I 'stop' vsftpd now it says:               vsftpd: unrecognized service      If I try 'uninstalling' vsftpd its says:               Package vsftpd is not installed, so not removed      _**Issue: But I can still connect to my server using FTP client_** I cannot somehow believe there is a zombie? process that is not getting killed even after reboot. Can someone please throw light on this? System Configuration: Ubuntu 12.04.1 Server LTS as Guest VM on Windows 7 Host VM TCP dump as requested: Command: `sudo tcpdump port 22 >tcpdump.log` Action taken: Used WinSCP to SFTP into the Guest OS Server tcpdumplog:               17:00:42.745423 IP Brown.home.54199 > ubuntu-12.home.ssh: Flags [P.], seq 4076673955:4076673991, ack 3552872727, win 17520, length 36     17:00:42.745442 IP Brown.home.54199 > ubuntu-12.home.ssh: Flags [F.], seq 36, ack 1, win 17520, length 0     17:00:42.746192 IP ubuntu-12.home.ssh > Brown.home.54199: Flags [F.], seq 1, ack 37, win 16616, length 0     17:00:42.746406 IP Brown.home.54199 > ubuntu-12.home.ssh: Flags [.], ack 2, win 17520, length 0     17:00:50.181085 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [S], seq 8389211, win 8192, options [mss 1460,nop,nop,sackOK], length 0     17:00:50.181112 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [S.], seq 1127786298, ack 8389212, win 14600, options [mss 1460,nop,nop,sackOK], length 0     17:00:50.181262 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [.], ack 1, win 17520, length 0     17:00:50.186862 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [P.], seq 1:40, ack 1, win 14600, length 39     17:00:50.187152 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 1:31, ack 40, win 17481, length 30     17:00:50.187282 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [.], ack 31, win 14600, length 0     17:00:50.187476 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 31:639, ack 40, win 17481, length 608     17:00:50.187485 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [.], ack 639, win 15808, length 0     17:00:50.188653 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [P.], seq 40:1024, ack 639, win 15808, length 984     17:00:50.188900 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 639:655, ack 1024, win 16497, length 16     17:00:50.190537 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [P.], seq 1024:1304, ack 655, win 15808, length 280     17:00:50.240004 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 655:927, ack 1304, win 16217, length 272     17:00:50.254190 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [P.], seq 1304:2152, ack 927, win 17024, length 848     17:00:50.312380 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 927:943, ack 2152, win 17520, length 16     17:00:50.351847 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [.], ack 943, win 17024, length 0     17:00:50.352298 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 943:995, ack 2152, win 17520, length 52     17:00:50.352316 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [.], ack 995, win 17024, length 0     17:00:50.352579 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [P.], seq 2152:2204, ack 995, win 17024, length 52     17:00:50.361499 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 995:1063, ack 2204, win 17468, length 68     17:00:50.388593 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [P.], seq 2204:2272, ack 1063, win 17024, length 68     17:00:50.590761 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [.], ack 2272, win 17400, length 0     17:00:52.960712 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 1063:1147, ack 2272, win 17400, length 84     17:00:52.999659 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [.], ack 1147, win 17024, length 0     17:00:53.037972 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [P.], seq 2272:2308, ack 1147, win 17024, length 36     17:00:53.038482 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 1147:1215, ack 2308, win 17364, length 68     17:00:53.038510 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [.], ack 1215, win 17024, length 0     17:00:53.271416 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [P.], seq 2308:2360, ack 1215, win 17024, length 52     17:00:53.271628 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 1215:1299, ack 2360, win 17312, length 84     17:00:53.271661 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [.], ack 1299, win 17024, length 0     17:00:53.271864 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 1299:1367, ack 2360, win 17312, length 68     17:00:53.271872 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [.], ack 1367, win 17024, length 0     17:00:53.272369 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [P.], seq 2360:2448, ack 1367, win 17024, length 88     17:00:53.275151 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 1367:1419, ack 2448, win 17224, length 52     17:00:53.275347 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [P.], seq 2448:2628, ack 1419, win 17024, length 180     17:00:53.279576 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 1419:1471, ack 2628, win 17044, length 52     17:00:53.279717 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [P.], seq 2628:2728, ack 1471, win 17024, length 100     17:00:53.280194 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 1471:1539, ack 2728, win 16944, length 68     17:00:53.280339 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [P.], seq 2728:2796, ack 1539, win 17024, length 68     17:00:53.280546 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 1539:1607, ack 2796, win 16876, length 68     17:00:53.280869 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [P.], seq 2796:3504, ack 1607, win 17024, length 708     17:00:53.281105 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 1607:1675, ack 3504, win 16168, length 68     17:00:53.281218 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [P.], seq 3504:3588, ack 1675, win 17024, length 84     17:00:53.281416 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 1675:1743, ack 3588, win 16084, length 68     17:00:53.281543 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [P.], seq 3588:3656, ack 1743, win 17024, length 68     17:00:53.480952 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [.], ack 3656, win 17520, length 0     17:00:56.881662 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [P.], seq 1743:1779, ack 3656, win 17520, length 36     17:00:56.881688 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [F.], seq 1779, ack 3656, win 17520, length 0     17:00:56.881908 IP ubuntu-12.home.ssh > Brown.home.54223: Flags [F.], seq 3656, ack 1780, win 17024, length 0     17:00:56.882061 IP Brown.home.54223 > ubuntu-12.home.ssh: Flags [.], ack 3657, win 17520, length 0      Please let me know in case you require any additional information


title: How to list prerequisites externally in GNU Make?

text: How can I query prerequisites of a target from a GNU Make makefile? E.g. if the targets specified like this:               fred: wilma barney betty      I want to print prerequisites of `fred` like this:               $ make some_action fred     wilma barney betty


title: Finding all storage devices attached to a Linux machine

text: I have a need to find all of the writable storage devices attached to a given machine, whether or not they are mounted. The dopey way to do this would be to try every entry in `/dev` that corresponds to a writable devices (hd* and sd*). Is there a better solution, or should I stick with this one?


title: How to check if apt proxy configuration is correct?

text: I have to use a proxy server which requires authentication. So, I need to update the **apt.conf** file to include my proxy settings. All fine. What I need is to check that the configuration is correct so that when I try _apt-get update_ , I'll connect to the relevant repositories, etc. Is there a way to check this without downloading anything to the PC (without _update_ , _install_ , _upgrade_ , etc.)? In short: I'm looking for a way to just **ping** the repositories without any actual download happening. Any other ways to validate the apt proxy settings is also welcome... **Edit:** I read the manual but I couldn't see the functionality to be available by a simple option/flag. Maybe there is a hack? **Update:** So, far the only solution I have is to **apt-get install** a tiny package and then remove it afterwards. But, I don't really like this approach. What if the package is already installed on the machine? Will apt-get still connect to the repositories (to check if the package is up-to-date)? **Update2:** Apparently there is no solution to all the requirements I put in the question. I'll pick the answer with the closest to what I want.


title: How to add multiple email adresses to an SSL certificate via the command line?

text: I know that by adding/modifying the `SubjectAltName` entry in `openssl.cnf` this can be achieved, but is there a way to do so without having to modify that file every time?


title: Audio stopped working in Xine in Debian

text: Recently sound stopped working in all the Xine-based applications. I get the error: `the audio device is unavailable`. I am using latest Debian Testing with KDE. I haven't been fiddling with the configuration recently, just doing the updates.


title: kgdb not returning control to gdb

text: I've compiled a kernel with kgdb support and I'm trying to debug it. I have two machines running, a debug machine (running the kgdb kernel) and the machine I'm using to debug it. They are connected via two serial cables. I can operate the debug machine's serial console through ttyS0 (on both machines) and I can connect to kgdb with gdb over ttyS1 (on both machines). This works fine up until a point: I boot the debug machine; it waits for gdb to connect; gdb connects; I can set breakpoints or whatever using gdb; I tell gdb to continue; and the kernel continues to boot. The problem is when I next hit a breakpoint gdb doesn't seem to realize that a breakpoint has been hit. The kernel stops when it's meant to, but gdb doesn't do anything. It just sits there as if nothing has happened. Does anyone know what might cause this?


title: Kernelpanic Fedora 18 with kernel 3.9.2-200

text: Since upgrading to kernel 3.9 I now get this error every time at start up:               BUG: unable to handle kernel NULL pointer dereferences at       (null)     IP[<ffff8800ca93bfcd>] 0xffff8800ca93bfcc     PGD 0     Oops: 0002 [#1] SMP     Modules linked in:     CPU 3     Pid: 1, comm:swapper/0 Not tainted 3.9.2-200.fc18.x86_64 #1 LENOVO 2191/INVALID      The 3.8 version of the kernel worked well for me. So my question is what can I do to start the 3.9 kernel?


title: How to associate device to sata port disk

text: I have 2 hard disks connected to 2 sata ports. The disks are associated to /dev/sda and /dev/sdb. These hard disks are in software raid so it happens that the system can go for some time with only one disk and then the second disk is added again to the array. I need to be able somehow to display the information:               /dev/sda -> is sata port 0 or 1     /dev/sdb -> is sata port 0 or 1      but I cannot understand how to do it, can anybody help me out? I'm running ubuntu server 12.04.2.


title: How to keep track of which files are currently growing in directory

text: I have a local filesystem which is exported rw with nfs (very big xfs partition). Somewhere (I cannot determine who or what remote process) files are being written, created new or updated appending more data; and the free disk space is quickly running low. To identify what files I could move somewhere else safely, I though about command like:               find . -type f -mtime +15 -size +100M     find . -type f -mmin -2       but is there a general way to call find or any other system utility to track which file is currently growing/being written (remotely)?


title: Installing from source - do I need to keep the extracted tarball directory

text: If I'm installing from source, do I need to keep the extracted tarball directory? So if I download the git tarball. I then do:               tar -xvzf git.tar.gz      This will create a `git.x.x`. directory, into which I `cd`, then run `./configure` etc. Once I'm done with this process, and `git`, or whatever is installed, do I need to keep the original `git.x.x` extracted directory, or is that just used for compiling the program? I'm somewhat confused by all the directories, and folders used for programs.


title: Cleaning after installation

text: Is it safe to remove the downloaded tar once the program is installed (once I run ./configure, make, make install)?


title: system lock up when storage go offline when using nfs mount options bg,hard,nointr

text: I had the following mount option defined on my system. In the event of any storage outage would these `(bg,hard,nointr)` causes to lock the console access?                       storage:/vol/myvol on /test type nfs (rw,bg,hard,nointr,rsize=65536,wsize=65536,tcp,nfsvers=3,timeo=600)      What combination of nfs options are consider right practice?


title: Join 2 files on 2 columns returning 0s

text: I have 2 files, that are sorted, with 3 columns each. I need to merge them based on the first 2 columsn and return 4 columns, being the 2 that are matching and then the 3rd column from each file. I have tried to do in awk using               awk 'NR==FNR{a[$1FS$2]=$3;NEXT}    {k=$1FS$2;print k,(a[k]?a[k]:a[k]*1),$3;delete a[k]}         END{for(k in a)print k,a[k],"0"}'       but it is not working how I hoped. my input files look like this: File 1:               Chr BPPos Chip_1     1 1234 1     1 1765 2     1 2043 3     2 1231 4      File 2:               Chr BPPos Chip_2     1 1765 1     1 2074 2     2 1231 3     2 2141 4      Desired Output:               Chr BPPos Chip_1 Chip_2     1 1234 1 0     1 1765 2 1     1 2043 3 0     1 2073 0 2     2 1231 4 3     2 2141 0 4


title: ssh public key copying

text: This question is repeating from Stack Overflow because i don't get answer from there. I'm trying to make a simple script that will import the public key to other servers. I have made 2 options you can choose. One is using ssh-copy-id, and the other is simple copy the pub key to the file on the other server. The second one works ok but I cant make this to work wiht ssh-copy-id. This is what I have for now:               ssh-copy-id -i $var1 $i      Where $var1 is "/path/to/the/public_key.pub" and $i is the servers where they are written in a txt file. The whole idea is I have my pub keys everywhere and I like to enter the pub key of a new admin guy everywhere. And it works ok but when I execute I have to enter my password. Any solution to do this with one time entering the password. And also I like to enter new line before adding the key. But I can't find solution how to do this with ssh-copy-id


title: How to decrease the time the processes would wait (blocked) for disk reads (only to discover an error)?

text: Waiting too long when encountering an unreadable sector on a disk is really very annoying. (Especially if you are trying to read as much data as can be read from a disk with bad sectors, and do it quickly, for backup and restoration.) The disk reports read errors (sense errors). Can the disk (ATA) be setup so that a failing read doesn't take too long, so that it can be dropped, and the reading process and the disk wouldn't be blocked, and the next read could be attempted? Or perhaps the linux disk driver can be set up to achieve this? Or the reading process in linux can do something to avoid long reading?


title: Recover files after moving directory names?

text: During the course of some testing, I ran the bast script               for file in *; do         mv -v "$file" "$file#_*"     done      or something along those lines. The plan was to remove a prefix from directory names but I accidentally ran it in my home directory rather than in the test directory I had created... My understanding is that all of the files inside directories should be "safe" (as in, not deleted), but that I now have no way to access them via a directory structure. Is there a way to recover these files? Thanks in advance. **UPDATE** It appears my memory was incorrect: the command in the `for` loop was actually `echo mv ...`. Somehow, all the directories and file in ~ were moved to my Videos directory, but appear to be intact.


title: How to catch optioned and non optioned arguments correctly?

text: I want to write a shell script which will take some arguments with some options and print that arguments. Suppose the name of that script is `abc.ksh`. Usage of that script is -   `./abc.ksh -[a <arg>|b <arg>|c|d] <some_string>`   Now I write a shell script which will take options and arguments               #!/bin/ksh          # Default Values     vara=","     varb=false     varbname=""     varc=false          # Scanning inputs     while getopts :a:b:cd option     do             case $option in                     a) vara=$OPTARG;;                        #shift $((OPTIND-1));;                     b) varb=true                        varbname=$OPTARG;;                        #shift $((OPTIND-1));;                     c) varc=true;;                        #shift $((OPTIND-1));;                     d) echo "Usage $0 \-[a|b|c|d] <filename>"                        exit 0;;                     \?) echo "Invalid option -$OPTARG. Please run '$0 -h' for help"                         exit 1;;                     :) echo "Option -$OPTARG requires an argument. Please run '$0 -d' for help"                        exit 1;;     esac     done          print "Args: $* \nvara: $vara \noptfile: $varb \nvarbname: $varbname \nvarc: $varc"      **Examples of Correct Inputs:**   * `./abc.ksh -a "sample text" "some_string"`   * `./abc.ksh "some_string" -a "sample text"`   * `./abc.ksh -asample\ text some_string`   * etc...  `some_string` input is not catch in my script. How can I catch that?


title: Adding wallpapers in GNOME Shell

text: When executing `Activities → Settings → Background`, you can find three background tabs:   * [Wallpapers]   * [Pictures]   * [Colors] In [Wallpapers] you can find backgrounds under `/usr/share/backgrounds/`, but which have been previously added to an XML configuration file in `/usr/share/gnome-background-properties/`. If you put new backgrounds in `/usr/share/backgrounds/`, but you don't add them to an XML file, they won't be displayed. On the other hand, in [Pictures] you can find backgrounds under `~/Pictures/` and any new addition will automatically be detected and displayed by the application (this folder is "reloaded" or "refreshed" every time). Is there any way I could set the [Wallpapers] tab to automatically find new pictures under `/usr/share/backgrounds/` as well? If not, is there a way I could change the configuration, so that, when clicking on the [Pictures] tab, it will look under `/whatever/i/want/` instead of `~/Pictures/`? I know I could just edit the XML configuration file (myself, with a script, or even with existing GUIs), but I am not looking for that. I just feel curious about the customization level of GNOME Shell. I am using Fedora 20 with GNOME Shell 3.10.


title: Does exists a Linux distro that run on an AllWinner A10S cpu?

text: I've just bought a mini pc (a T004 Auxtek) but I would like to run a Linux distro on it so I can use as mini server Linux. Do you know if exists an AllWinner A10s distro for this type of mini PC?


title: Are writes to eventfd counted as io?

text: I am trying to reduce hard-disk activity on my system. Running `iotop` shows that Eclipse (the IDE, latest version (Luna)) is writing kilobytes of data every few seconds. So I ran `strace` on the eclipse process and the only `write`s that I can see are to a file-descriptor that points to `eventfd`. I am not familiar with `eventfd`, but it seems like an event bus of some sort. Does `write` to it get accounted as a disk write?


title: telinit 1 and run a command there

text: I need to do some maintenance on a bunch of Debian (Wheezy) systems, and it has to happen at run level 1. But not all machines have a keyboard and a screen; some are even located somewhere else. So I can't just go there and type in the root password to trigger the job. So my question is how can I tell Debian to run a command right before the "Type root password or ^D" prompt? I've tried to make a init script that only runs on run level 1, but still it was triggered before all processes where killed. Is there a way to do this?


title: What is the problem with the output of plink?

text: On my Windows7 machine, I'm traversing to the installed path of PuTTy Application and running:               plink <hostname>      to connect to my remote Linux host. I see some unrecognized characters in the output as:               -bash-3.2$ ls -lrt     ←[00mtotal 96     drwx------ 5 lg262728 lg262728  4096 Jun 10 15:32 ←[00;34mmyScripts←[00m     drwx------ 2 lg262728 lg262728  4096 Jun 12 13:19 ←[00;34mmyLangs←[00m     drwxr-xr-x 4 lg262728 lg262728  4096 Jul  1 07:43 ←[00;34mmyWorkSpace←[00m     ←[m-bash-3.2$      What is wrong here? Is it something about encoding?


title: Slow DNS resolve from curl/lynx etc

text: I have a strange issue with DNS resolving: Root of the problem is that I get curl errors: "Error executing HTTP request: name lookup timed out". Tried to ping some sites, all resolved fine (and fast). When trying Lynx with the same sites, some resolve really, really slow. Using Debian Wheezy. Now tried `gethostbyname()` in a PHP script, and that worked without problems. Why is the resolve fast with ping/php but extremely slow with Lynx/curl (curl ran from php). I had this issue some months ago but since then it was working, until now.


title: Manipulate color in VIM

text: In `hlsearch` mode, seems that you can set only one color. Now I want to use a script to get multiple colors for multiple keywords, is that possible?


title: How to silently get an empty string from a glob pattern with no matches

text: Say I have a folder with three files:               foo1     foo2     bar      **1.** If I run               list_of_files=$(print foo*)     echo $list_of_files      I get: `foo1 foo2` **2.** If I run               list_of_files=$(print bar*)     echo $list_of_files      I get: `bar` **3.** However, if I run               list_of_files=$(print other*)     echo $list_of_files      I get: `zsh: no matches found: other*` (the variable `$list_of_files` is empty though) * * * Is there a way to ask zsh to not complain if it can't match a glob expansion? My goal is to use the mechanism above to **silently** collect a list of files that match a given glob pattern. Any alternative suggestions to do this would be greatly appreciated.


title: Missing IPsec package in Solaris 10

text: I'm running Solaris 10 v5/08. Running `svcs -a | grep ipsec` returns nothing, so I have reason to believe IPsec isn't installed (or isn't showing up for some other reason). How can I make sure it is installed and set up correctly?


title: How do I get svlogd to write data more often within a runit job

text: I currently have this log/run script as part of a runit service:               #!/bin/sh     set -e          exec svlogd -tt ./main      If I "`tail -f log/main/current`", I don't see the service output written in "real time." It seems to only dump the stdout in 4K increments. So if the service is used lightly, I can't see the most recent log data, unless I actually do an 'sv restart' on the service, in which case all data is written to the logs before the service is restarted. I've played around with the "-l" and "-b" arguments, but these did not have any effect (and I'm not even sure it matters at this point).


title: "Bookmarks" for bash

text: Navigating several layers of nested directories is often a pain. On Firefox, it is easy because they have bookmarks. So what I'd like to do to bookmarks a file is to type:               $ go --add classes "repo/www/public/util/classes"      Then, to go to this directory, I'd type:               $ go classes      Previously I've used symbolic links, to achieve something similar, but I don't want to clutter up my home directory. There are lots of other features that could prove useful. For example, I would like to able to start typing `go cl` and then hit tab to autocomplete. Sometimes I have multiple copies of a repository checked out and so it would be useful for the program to allow me to create multiple contexts and to set the bookmark relative to the context base directory. So, before I set off on cobbling my own set of scripts together, is there already something like this?


title: Awk - how to compare two numbers?

text: This example works fine:               awk -v num1=5999 -v num2=5999  'BEGIN{ print (num2==num1) ? "equal" : "not equal" }'     equal      This example does not work well:               awk -v num1=59558711052462309110012 -v num2=59558711052462309110011 'BEGIN{ print (num2==num1) ? "equal" : "not equal" }'     equal      In the second example compared numbers are different. Why not print "not equal"?


title: Search for "not newline" in vim?

text: To search for `A T\n` in vim I can just do               /A T\n      What would be the equivalent for not newline at the end?               /A T[^\n]      did not work.


title: Using KDE services/apps without running plasma workspace

text: How can I use KDE services without actually running the whole plasma workspace ? I want to use awesomewm but I couldn't manage to run KDE services without actually running `plasma-desktop`. My point is I don't want to run everything under xterm(or other terminals) and want to use KDE's GUI tools and services(like network manager, device mounter etc.) Any help will be appreciated.


title: `mount -o loop` changes mounted ISO image file

text: It looks like `mount -o loop` changes the mounted image file. I downloaded the ISO image file and checked its SHA-1 checksum. Then I mounted that ISO file and the checksum changed. Here are the exact steps I made, a copy-paste from my console, CentOS 7 x64 (note, that ISO file is read-only):               [mbartnicki@89-78-33-81 Downloads]$ ls -lh     total 3.1G     -r--r--r--. 1 mbartnicki mbartnicki 3.1G Mar 31 18:28 X17-58997.iso     [mbartnicki@89-78-33-81 Downloads]$ sha1sum X17-58997.iso      6c9058389c1e2e5122b7c933275f963edf1c07b9  X17-58997.iso     [mbartnicki@89-78-33-81 Downloads]$ sudo mount -o loop X17-58997.iso /mnt/iso/     mount: /dev/loop0 is write-protected, mounting read-only     [mbartnicki@89-78-33-81 Downloads]$ sha1sum X17-58997.iso      994944df320e9e03c032263d7b9e36157a0a587c  X17-58997.iso      I was so surprised, that I repeated above steps on another machine (Ubuntu 14.04 x64), just to get the same result: file checksum changed after `mount -o loop`. Unmounting ISO image doesn't return its checksum to original value; file change is persistent. Moreover, next mount change the checksum again to some new value. How can it be explained? **PS** Mounting explicitly read-only by adding `ro` mount option prevents file from being changed, so that if I use: `sudo mount -o ro,loop X17-58997.iso /mnt/iso` then everything is OK, and ISO image file lasts unchanged after mount. The wrong behaviour occurs only when `ro` option is not specified, even if the ISO image file is read-only on the file system level. I tried on three different ISO images: Windows 7 installation DVD (official), SystemRescueCD (small rescue Linux) and hand-made ISO created by `genisoimage` tool. I checked all that ISO files with `file` utility, and `file` said that all of them are _ISO 9660 CD-ROM filesystem data_. Files inside ISO images are not changed - I also checked it - it looks like the faulty mount scenario adds some meta-data or just garbage.


title: install and run new version of R

text: an old version of R is already installed on the server I am working with, but it is not really useful for my work. I have tried to install R 3.1.1 on my own directory (/local/data/project/behi) on the server using this command : $ wget http://cran.rstudio.com/src/base/R-3/R-3.1.1.tar.gz $ tar xvf R-3.1.1.tar.gz $ cd R-3.1.1 $ ./configure --prefix=$HOME/R $ make && make install when I tried to run R (by just typing R in my directory) again it showed me the old version of R. would somebody please let me know what the problem is and how I can **install** and **run** the new version of R? thanks in advance, Behi


title: Java location from /usr/bin/java

text: I'm trying to find my java location within my Linux system and got this               [980@b449 ~]$ which java     /usr/bin/java               [980@b449 ~]$ readlink -f $(which java)     /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java      what is the difference between the 2 commands?


title: Why is systemd-coredump storing the dump in memory itself?

text: I just noticed that most of my memory was hogged by coredump of a few processes that I had killed recently. I had a systemd-coredump process running for each crashed process (usually the processes were google-chrome, which I had force quit, which explains the large memory consumption). What I would like to know is why instead of dumping the core of the crashed process to the disk, a new process that holds the entire core in the ram is being started. Is my configuration buggy or is it supposed to be this way? If so how do I change the behavior? For now I have disabled the storing of core dump by linking `/dev/null` to `/etc/sysctl.d/coredump.conf`, though I do not see core dumps, but still would like to keep it enabled. Any ideas/hints would be appreciated. (The issue is also posted at: https://bbs.archlinux.org/viewtopic.php?pid=1246237)


title: Function of owning group versus ACL group permissions

text: Given the fact that we can give any number of groups rwx via POSIX ACL's is there any special privileges given to the owning group? For example, we can set any number of users with ACL's but only the owning user (and root) can manipulate permissions. Is it just traditionally how elevated permissions were given to a group of people or does the owning group have additional rights?


title: Run entire OS from flash drive

text: I am looking for a distribution that can run the entire OS from a flash drive. This question is NOT about being simply able to boot and/or run OS from a USB stick: what I am looking for is a distribution that specifically targets flash disk as a boot media. One example of such a distribution that comes to my mind is Android; however, I would prefer something that I could use on a server. **edit** : I feel I must explain myself, why I wrote this post. I am aware it is possible, and quite easy as a matter of fact to install many distributions onto a USB flash drive. What flash drive is missing (if you compare it to SSD) is the wear-leveling smarts built into SSD firmware. But my logic was, that this should be possible to emulate wear-levelling logic using software, this is why JFFS, YAFFS, LogFS systems came about. What I am looking for is a distribution, which is made to run from one of those systems.


title: How to create a VirtualBox HDD?

text: I need to have a file on a VirtualBox guest's HDD. What are the solutions for this? How can I put a file on a Virtualbox guest's HDD? Version: virtualbox-4.1 4.1.8-75467~Ubuntu~lucid I mean I need a solution that doesn't require to have a VirtualBox guest (when putting the file to a vbox hdd). I just need to prepare Vbox disks that contain the given files for later use. UPDATE: or it would be enough to create a vbox hdd from a physical disk! But If I:               VBoxManage internalcommands createrawvmdk -filename /home/USERNAME/Desktop/vboxhdd.vmdk -rawdisk /dev/sdb1      I get this error message after I configure a vbox guest to use the newly created disk: http://i.imgur.com/IYVKr.png


title: Running Plasmoid under NOTKDE (e.g. Fluxbox) - Plasma/DeviceNotifier

text: Is there way to run Plasma/DeviceNotifier under another WM to KWin/KDE (e.g. Fluxbox). To be more specific, I have currently configured KDE, but I work remotely thorough SSH -Y + X-forwarding. So running `plasma-desktop` might run all other Plasmoids/Widgets. I'd like to run only one : DeviceNotifier. As I see it runs thought libs, no standalone executable there:               ~$ pacman -Ql | grep devicenoti     kdebase-workspace /usr/lib/kde4/plasma_applet_devicenotifier.so     kdebase-workspace /usr/lib/kde4/plasma_engine_devicenotifications.so     kdebase-workspace /usr/share/kde4/services/plasma-applet-devicenotifier.desktop     kdebase-workspace /usr/share/kde4/services/plasma-dataengine-devicenotifications.desktop     kdebindings-python /usr/share/sip/PyKDE4/solid/devicenotifier.sip     kde-l10n-pl /usr/share/locale/pl/LC_MESSAGES/plasma_applet_devicenotifier.mo     kdelibs /usr/include/solid/devicenotifier.h      So... how to run it ? ## Update: Running `plasma-desktop` **does not work**. I run on my laptop:               laptop$ xinit;     laptop$ ssh -Y desktop;     desktop$ fluxbox #X forwarding      So I run fluxbox on remote machine ("Desktop"). When I run in such situation `plasma-desktop` I end-up with whole screen messed up with all widgets I normally use on remote machine when I work on it locally. There are few problems there : (1) On desktop I have six times more screen space, (2) when I work remotely I do not need most of stuff I need when I work locally (3) I'm afraid of running another instance remotely of all those widgets and stuff, when it's already running on desktop. That's why I am asking about running only one widget. It can be `plasma-desktop`, but running only one widget, but not whole stuff I have setup and running on desktop locally.


title: How does one remove items from the menu plugin on LXPanel?

text: How does one remove items from the menu plugin on the panel? I am using lubuntu 11.10, LXPanel 0.5.8.


title: virtual network interface for ShrewSoft VPN Client

text: I use ShrewSoft VPN Client 2.1.7 under Arch Linux (i686) to connect to the company network using IPSec. It is configured by a .vpn file. How can I make it create a virtual network interface?


title: Make tmux tabs arrange more like traditional tabs

text: Tmux is a great piece of software, which almost replaced me my terminal "terminator", especially with it's `<bindkey>-z` in recent versions. The main annoyance I have with tmux is that whenever I close a window(tab), say #2, all other tabs like #3 keep being there. And when I create a new window(tab), it stores it on place of #2. What I'd like to get is more traditional behavior, like web-browsers and other tab-based software does: when you close tab, fill free cells by moving everything from right to left. When you create tab, create it on right. Then, if I'll want to place window(tab) somewhere, I can ask tmux to do that explicitly.


title: Backing NTFS in linux

text: Is partimage ready for NTFS volumes? It said that support for NTFS is experimental, is that safe for production ?


title: Is using xargs faster than not using it?

text: Is this faster:               find /tmp -name core -type f | xargs /bin/rm -f      than doing this:               find /tmp -name core -type f -exec /bin/rm -f {} \;      So would using `xargs` increase overall speed? (I got the example from the man page of `xargs`.)


title: Linux network troubleshooting and debugging

text: From time to time Linux and Unix users faced with various network problems. Many of these problems are presented here and at some others troubleshooting forums, but the are very concrete and contains a lot of additional technical information, and sometimes it's rather difficult to understand the main point and the real reason of buggy system behavior. By asking this question, my intention is _to start a community wiki_ page which allows to generalize our network troubleshooting and debugging experience. I hope the Linux and Unix users could easier recognize and solve("divide and conquer") their network problems using this page. The parent of this page should be Best practise to diagnose problems. But here we should focus on troubleshooting **the network problems** from _user- and kernel-space._ I suppose, if you:   1. Share the information about using some great network diagnostic tool with concrete usage examples and examples of network bugs, which they help to catch.   2. Share the link to the great network tutorial connected with this subject   3. Tell about a general method or recipe which allows to tackle some class of network problems   4. Share information about your tool-set for network debugging and troubleshooting it would perfectly fits for this topic. * * * I'll begin from sharing the link to varios diagnostic tools and 12-years old simple tutorial. Also archlinux tutorial seem to have actual information about our subject. And for diving into linux networking we definetely need to visit Linux Networking-HOWTO.


title: Where to find and how to install Ubuntu GUI themes?

text: I tried Ubuntu several times, but I didn't stay with it for very long. One reason was I felt the interface was boring. Today I saw some nice themes here: the #6 in http://www.gentoo.org/main/en/shots.old-2010.xml or #2 in http://www.gentoo.org/main/en/shots.old-2011.xml But I don't know where to find these resource and install these themes? Is this available to install just as we install some official packages from terminal or package Manager? Or do I have to contact the author personally?


title: How to prevent ssh-agent from starting in CentOS?

text: How do I stop ssh-agent from starting when logging into CentOS via openssh? There are no references to ssh-agent in my bash startup scripts (.bashrc) or /etc/bashrc.


title: Ctrl-C does not work with pppd non-detached session

text: I have a Mini2440 ARM Board, and I have put a base Debian 6.0 system on it using `multistrap`. I have used `tmux` to run several processes in defferent windows from `/etc/rc.local`. I connect to the board using its serial port and an inittab entry to run `getty` on that port. I use `picocom` as serial communicator. When root logs in, `~/.bashrc` attaches him to the already running tmux server, and processes can be easily monitored. the actual command is `exec tmux attach-session -t "main"`. tmux runs with default config. Everything works, except one of the processes (a shell script around `pppd`) does not receive `Ctrl``c` from terminal, while other processes do. Also `Ctrl``\` works. **also`kill -INT <pppd_pid>` works, but `kill -INT <shellscript_pid>` does not.** I really need `Ctrl``c` to work. What is wrong with this setup? Edit: here is the output of `stty -a` in the shell script, right before `pppd`:               speed 38400 baud; rows 23; columns 80; line = 0;     intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;     eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;     werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;     -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts     -ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff     -iuclc -ixany imaxbel -iutf8     opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0     isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt     echoctl echoke      since it's just `pppd` process that has this issue, I think it has something to do with it or its configuration, but when I run `pppd` outside of tmux, Ctrl-C works. `pppd` runs with `nodetach` option, so it stays in terminal foreground. I also tested it on my dev machine (debian 6.0 on amd64) with the same results.


title: Most common encoding for strings in C++ in Linux (and Unix?)

text: For creating a C++ program that is source code level portable between Windows and Linux and handles internationalization well, there are IMHO three main encodings to consider:   * The encoding of the C++ source code.   * The encoding of external data.   * The encoding(s) of strings and literals. For the C++ source code there is not really any alternative to UTF-8 with BOM, at least if standard input and wide string literals should work on the Windows platform. UTF-8 without BOM causes Microsoft's Visual C++ compiler to assume Windows ANSI encoding for the source code, which is nice for UTF-8 output via `std::cout`, to the limited degree that that works (Windows console windows has lots of bugs here). However, then input via `std::cin` does not work. And for the external data UTF-8 seems to be _the_ de facto standard. However, what about the internal literals and strings? Here I had the _impression_ that narrow strings encoded as UTF-8 was the common convention in Linux. But recently two different persons have claimed otherwise, one claiming that the common convention for internal strings in international applications in Linux is UTF-32, and the other just claiming that there is some unspecified difference between Unix and Linux in this area. As one who fiddles a little, on a hobby basis, with a micro-library intended to abstract away the Windows/Linux differences in this area, I … have to _ask concretely_   * what is the common Linux convention for representing strings in a program? I am pretty sure that there is a common convention that is so overwhelmingly common that this question has a Real Answer™. An example showing e.g. how to Linux-conventionally reverse a string (which is complex to do directly with UTF-8, but which presumably is done by functions that are de facto standard in Linux?), would also be nice, i.e., as a question, what is a Linux-conventional version of this C++ program (the code as given works for Latin-1 as the C++ narrow text execution character set):               #include <iostream>     #include <algorithm>     #include <string>     using namespace std;          #define STATIC_ASSERT( cond )   static_assert( cond, #cond )          int main()     {         string line;         if( getline( cin, line ) )         {             static char const aSingleChar[] = "æ";             STATIC_ASSERT( sizeof( aSingleChar ) - 1 == 1 );             reverse( line.begin(), line.end() );                  cout << line << endl;         }     }


title: GTK 3 apps text backdrop looks wrong, on any theme

text: I am having a problem with GTK 3 applications (GTK 2 apps work correctly): no matter which theme I choose, there are many places where colors are off. E.g. in the screenshot you can see that the background color of the tab doesn't match the background color of the text within that tab. ![enter image description here](http://i.stack.imgur.com/gKXbW.png) How can I fix this? I am using Arch Linux with KDE 4.


title: SafeCopy worked but I have a few problems

text: I had a 60G NTFS drive that had 28 physically bad blocks as reported by GParted. I used SafeCopy to recover to the root of an empty 500G drive using SafeCopy defaults. Everything worked as expected and I can access the data fine, but now the 500G drive has a couple of issues.   1. The bad blocks, which I guess SafeCopy filled with zeroes or whatever, are apparently still marked as bad on the 500G drive that I copied to, preventing GParted and numerous other programs from being able to work with it.   2. The 500G drive now shows the remaining free space to be the same as the 60G drive that I copied from instead of the 400G+ that it should show. I can't get access through GParted to see if I can fix this because GParted says that the drive has 28 physical errors and it won't mount it. I thought I might be able to make a backup image and restore it back to the drive but the backup software that I use, Acronis, shows that the image file would be 500G instead of the less than 60G of actual data. This drive is being used as a Windows non-system drive. Windows Explorer shows the drive as 60G but when you go into Disk Management the top pane shows 60G while the bottom pane shows a graphical image of a 500G primary partition. Since this is a non-system disk I realize that I could simply just transfer all the files over to another properly partitioned and formatted disk but for future reference I would like to know how to avoid or fix this. Is this normal behavior for a SafeCopy transfer? Did I make a mistake in using the SafeCopy defaults?


title: Huawei E303 internet key with Linux CentOS?

text: Are there any programmes, downloads, patches, drivers available to use a Huawei E303 Internet Key in CentOS?


title: Trouble getting VLC to record from the webcam via command line

text: my ~/.bashrc contains the following function               webcamrecord () {     vlc v4l2:// :v4l-vdev="/dev/video0" :v4l-adev="/dev/audio2" :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma="" :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=640 :v4l-height=480 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 --sout="#transcode{vfilter=adjust{gamma=1.5},vcodec=theo,vb=2000,scale=0.67,acodec=vorb,ab=128,channels=2}:standard{access=file,mux=ogg,dst="output_file.ogg"}"      }      The command works beautifully to record directly from my webcam, with one or two flaws. First, the video produced moves too quickly, between twice and three times the normal rate. Also, there is no audio. This is less of an issue, but I would still like to fix this. Can someone help me debug this command, so as to fix these issues?


title: globbing, sed, or awk html files

text: I wanted to create a script that I could check `.xhtml` files for images and add alt tags if needed. While searching I found regular expressions and did man on `glob` but I'm unsure on where or what to search within `awk` and `sed`. What would be the best option to do the following:                               I wanted the desired script to detect if an `alt=""` is present if not alt the file name. End desired format:                               I know it can be done but Im not sure where to read about it.   * Find `<img` with the ending `/>`   * Within `img` tag detect `alt=""`   * if `alt=""` is not present record name before file type and insert into `""`


title: Write a shell script that takes in a variable from the terminal? (~$ command variable)

text: I am writing a shell script that takes in a time (in minutes) and opens an online egg timer set for that amount.               #!/bin/bash     #Opens http://e.ggtimer.com/TIMEmin where TIME = number of minutes     TIME=5     xdg-open http://e.ggtimer.com/"$TIME"min      When I run the above script it opens the web page http://e.ggtimer.com/5min I would like to set the time from the terminal. For example:               eggtimer 10      Would open http://e.ggtimer.com/10min Thank you!


title: Perl CPAN module download fails

text: The download for the 'App-xml_grep2-0.14.tar.gz' `perl` module continually fails for me. `cpan http://search.cpan.org/CPAN/authors/id/M/MI/MIROD/App- xml_grep2-0.14.tar.gz`               Please login with USER and PASS          Passive mode off.     Please login with USER and PASS.     ftp: bind: Address already in use


title: Why Nmap fragmented scan on Linux is only working from virtual environment?

text: OLD QUESTION AND TITLE (Look further down for the updated question): _**Why Nmap fragmented scan is only working on Backtrack?_** _I spent quite a few hours today trying to capture and study some fragmented IPv4 packets using Wireshark and Nmap security scanner._ _I tried a couple of different OS' (Ubuntu and Debian) but to my surprise, Wireshark would only capture normal packets._ _After launching the same Nmap scan from a Backtrack live CD it worked!_ _So to my understanding if it works on Backtrack which is tweaked for security purposes, there must be something (a setting maybe) preventing fragmented packets to the other Operating Systems._ _After lots of Googling I did not manage to find the reason why this might be happening. Any ideas what this must be and if it is possible to perform an IP fragmented scan from an Ubuntu or a Debian OS?_ UPDATED QUESTION: When I initially asked this question I was thinking that it might be an operating system related problem, but it turns out it might be a hardware related question because I managed to make a fragmented scan using an Ubuntu virtual machine. So I can run nmap fragmented scans from virtual machines running on my physical machine, but not from my physical machine itself. Is there any kernel setting (under /proc ?) preventing this, or it is hardware restriction and I cannot do anything about it?


title: How to reverse-match a string in the Vim programming language?

text: I want to find the last index of any character in the `[abc]` set in the `abcabc` string but the search should start from the end of the string:               " Returns the 0th index but I want the 5th.     let a=match('abcabc', '[abc]')      I skimmed through Vim's "4. Builtin Functions" (`:h functions`) but the only method that looked promising,the `reverse` method, only operates on lists. A limitation I don't understand because functions like `len` were designed to work even with strings, numbers, and lists. To solve the problem I came up with my following function:               function! s:Rvrs(str)       let a=len(a:str)             let b=a - 1       let c=''       while b >= 0         let c.=a:str[b]         let b-=1       endwhile       return c     endfunction      So I can say `let a=match(s:Rvrs('abcabc'), '[abc]')`.