title: Why does "cat ttyUSB0" not produce output?

text: I connected an infrared receiver to a USB port ... (the last line of dmesg tells device file)               $ dmesg     [10496.596063] usb 7-2: new full-speed USB device number 2 using uhci_hcd     [10496.751112] usb 7-2: New USB device found, idVendor=0df7, idProduct=0620     [10496.751117] usb 7-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0     [10496.751120] usb 7-2: Product: USB-Serial Controller     [10496.751124] usb 7-2: Manufacturer: Prolific Technology Inc.     [10496.787441] usbcore: registered new interface driver usbserial     [10496.787467] usbcore: registered new interface driver usbserial_generic     [10496.787483] usbserial: USB Serial support registered for generic     [10496.795104] usbcore: registered new interface driver pl2303     [10496.795129] usbserial: USB Serial support registered for pl2303     [10496.795160] pl2303 7-2:1.0: pl2303 converter detected     [10496.807238] usb 7-2: pl2303 converter now attached to ttyUSB0      Then I went on to try it ...               $ sudo cat /dev/ttyUSB0      but no output, simply hangs. Even though, as I press any button on my remote control, the infrared receiver device's LED flashes, so that does seem to work. Why could that be? * * * notes:   * the above command quits when I remove device from USB port and prints "cat: ttyUSB0: No such device", and dmesg prints 3 lines:               [13707.264086] usb 7-2: USB disconnect, device number 2       [13707.264894] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0      [13707.264915] pl2303 7-2:1.0: device disconnected)        * with the device files for keyboard this works, eg:                $ sudo cat /dev/input/by-id/usb-USB_USB_Keykoard-event-kbd       produces many weird characters on the console as I press any key the keyboard   * same happens on other USB ports too


title: A shell-like environment for binary processing

text: This question came to me a couple of times before, now in response to the question Loop through binary data chunks from stdin in Bash Answers given in http://stackoverflow.com/questions/993434/what-language-is-to-binary-as-perl- is-to-text were also not satisfactory. I'm looking for a scripting environment suited specifically to handle I/O with binary files. I know I can use one of the fully-fledged programming languages (c/Python/...) but they have an enormous initialization and coding overhead (allocation and fread/fwrite in c, bitstrings in Python...) not to mention they are less suited for scripting (calling other applications from it). Perl is no better with its `unpack` functions, string-oriented operation and goofy syntax. Something like `od`, but as a language. What I expect:   1. set or change endianness with a single switch/command.   2. simple specification of requested type (something like extending bash `read var` with `int32 var`, `float var` etc.).   3. handling of binary through pipes, skipping of specified number of bytes.   4. standard scripting flow control (for/if/...) that we are used to. I'd like to process raw data (photography, scientific data, unknown and poorly documented formats) with the same ease and insight that you get when inspecting ASCII files. I'm using `c` now, but it's not optimal for ad-hoc scripting, and can't be interactive. Does anyone know a tool like that? No clicky GUI software, please, it needs to work over ssh, from other scripts and so on. "Does not exist" is an acceptable, but depressing answer.


title: Different between `ulimit -e` and `renice`?

text: I would like to run a backup script in low CPU and disk I/O. Is there any different between this:               #!/bin/bash          ulimit -e 19     ionice -c3 -p $$      and this:               #!/bin/bash          ionice -c3 -p $$     renice -n 19 -p $$


title: present users a login prompt? /bin/login? getty?

text: I have a service that execs a command when a user connects to it through a socket, and redirects everything it receives to the executed program. It works ok with shells like bash, giving the user a remote shell. Instead of forking bash or sh, I'd like to run something that asks for user and password, like `/bin/login` Is that the correct command to run? Isn't there anything that a non-root service could use to do the same? I thinks `getty` calls `/bin/login`, but can I just run it as a user? I guess I could install telnetd and redirect to `telnet localhost` but I'd rather not run a telnet server.


title: How to install language support in TexLive on Debian Wheezy?

text: I'd like to use the babel-croatian package which is available for download on CTAN. But how do I install this package? Or perhaps there is a command-line way?


title: Multiple instances of Postfix throwing error fatal: unknown service: smtp/tcp

text: I am trying to configure multiple postfix-2.12 instances on FreeBSD 10.0-RELEASE following the README.               postmulti -e init     postmulti -I postfix-out -G mta -e create     ...      This all works I can start and stop instances everything seems good. When I test sending an email locally using telnet. Postfix logs the following `fatal: unknown service: smtp/tcp` error. The configuration files are vanilla no chroot in master.cf.                mynetworks = 127.0.0.1/8 192.168.5.0/24      If I run postfix as a single instance everything works fine. So postfix can read `/etc/services` when run as a single instance. The spool directory that is created with postmulti looks identical to postfix spool dir. I have been hammering at this for way too long. Has anyone implemented multiple instances of postfix on FreeBSD or can give some suggestions?


title: How to install libevent tmux?

text: I've been trying to install libevent / ncurses / tmux into '$HOME/local', but am having an issue running .configure for tmux. What I am trying to do is install it as follows:               TMUX_VERSION=1.8     ############     # libevent #     ############     tar xvzf libevent-2.0.19-stable.tar.gz     cd libevent-2.0.19-stable     ./configure --prefix=$HOME/local --disable-shared     make     make install     cd ..          ############     # ncurses  #     ############     tar xvzf ncurses-5.9.tar.gz     cd ncurses-5.9     ./configure --prefix=$HOME/local     make     make install     cd ..          ############     # tmux     #     ############     tar xvzf tmux-${TMUX_VERSION}.tar.gz     cd tmux-${TMUX_VERSION}     ./configure CFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses" LDFLAGS="-L$HOME/local/lib -L$HOME/local/include/ncurses -L$HOME/local/include"      I've managed to get this far, but keep getting an error with the line above saying it can't find libevent. Now I have checked $HOME/local/lib and it contains the following files:               libevent.a            libevent_core.la      libevent_pthreads.a   libform_g.a           libncurses++.a        libpanel.a            terminfo libevent.la           libevent_extra.a      libevent_pthreads.la  libmenu.a             libncurses.a          libpanel_g.a libevent_core.a       libevent_extra.la     libform.a   libmenu_g.a           libncurses_g.a        pkgconfig      So it looks like libevent is installed. The rest of the code is below, which I haven't got to just yet. CPPFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses" LDFLAGS="-static -L$HOME/local/include -L$HOME/local/include/ncurses -L$HOME/local/lib" make cp tmux $HOME/local/bin cd .. Anyone know what the issue could be? Thanks!


title: How to backup /etc/{,g}shadow files with 0000 permission?

text: I am trying to backup several servers' `/etc` by using `rsync` from another server. Here's a relevant snippet:               PRIVKEY=/path/to/private.key     RSYNC_OPTS="--archive --inplace --no-whole-file --quiet"     ssh -n -i $PRIVKEY root@${ip} "rsync $RSYNC_OPTS /etc 192.168.25.6::"'$(hostname)'      where `${ip}` is the IP Address of the server to be backed up, while `192.168.25.6` is the IP Address of the server holding the backup. Everything went well, except for `/etc/{,g}shadow` files on some servers. Since their permissions are `0000`, rsync seems to not want to read them ("Permission denied (13)" errors). A quick check using the following:               ssh -i $PRIVKEY root@${ip} "cat /etc/{,g}shadow"      successfully dumped the files. Is there a way to get round this rsync limitation? * * * **EDITs** The backup server is Ubuntu 12.04. The servers to be backed up are a smorgasbord of Ubuntu, RHEL, OEL, and CentOS servers. I've tried adding `-t` to the ssh options, and prefixed rsync with `sudo`, but still have the same errors.


what is the structure of a linux process? In linux there are processes executed on a address and which use system resources. Can anyone tell me the structure of a process and which parameter processes share during execution?


title: How to know if /dev/hda2 is Primary partition or Extended partition

text: If all four primary partitions exist on an IDE drive, they are numbered as follows:   * /dev/hda1   * /dev/hda2   * /dev/hda3   * /dev/hda4 We have also the partitions on a disk with one primary partition and the sole extended partition might be numbered as follows:   * /dev/hda1 (primary)    * /dev/hda2 (extended) This naming strategy leads to confusion :   How it is named : `/dev/hda2` in both of cases :   * Primary partition   * Extended Partition Another way to express the issue : How to distinct if it is primary or extended partition


title: How to create a Debian live USB with persistence?

text: I would like to use Debian wherever I go by installing it on a USB flash drive, but I'm not sure how to make it save the settings and be able to install/update packages without loosing them on reboots. So I downloaded a Hybrid ISO image from this link, and I followed the instructions in the FAQ:               dd if=image.iso of=/dev/sdb bs=4M; sync      This command copied the image to the flash drive by creating a partition which size is the same as the ISO image (1.3 GB out of 8GB), and the rest of the flash drive is unallocated. I searched on how to do this, but every tutorial uses a different approach and some of them are outdated and talk about the old usb-hdd image. So how should I install this hybrid image on the flash drive ? How should I partition my flash drive to be able to install packages and save settings ? and how can I install this image without using `dd` ?


title: Why are rules not combining in an ssh config file?

text: It seems like the following would work as expected, i.e., that the second rule, having a hostname that matches the first rule, would apply it.               Host *.hostname.com      User myuser      IdentityFile ~/.ssh/myidentity          Host blah      HostName complicated.hostname.com      However typing `ssh blah` only applies the second rule (and not the user or identity file of the first one). I have two questions:   1. Why is this happening?   2. Is it possible to (simply) do what I am trying to do?


title: Arguments, options and dashes

text: Why do console applications get the arguments started with either:               a) one dash (myapp -arg1 123; ls -al)     b) two dashes (myapp --arg1 123; git push origin master --force)     c) without dashes at all (myapp 123; man ls)     d) without dashes but with the equal sign (myapp arg1=123; dd if=/dev/zero)      Isn't there a standard convension? Even among the standard Linux applications all three cases a), b) and d) do exist at the same time. And it's tough to remember when I should use, for example, `-help` and when `\--help`.


title: user input not accepted in nested case statement

text: I am trying to create a nested case statement in which user input is expected (Y/N). However, the system never waits for the input and always goes to the third option, "Please answer yes or no". Can anyone tell me what I am missing? Here is the case statement                #!/bin/bash          SERVSTAT=/mnt/support/scripts/log/serverstatus.txt     FUSE_PATH=/home/jet/instances/     LOG=data/log/karaf.log     echo " " >  $SERVSTAT     STATUS=status          find /etc/init.d/* -name '*service' -print0 | while IFS= read -r -d '' FILE;     do     if [ "$FILE" != "." -o "$FILE" != ".." ]; then     APP_NAME=`echo ${FILE:12} | sed 's/-service//'`             OUTPUT=$($FILE $STATUS)     case "$OUTPUT" in         *not* )             echo "Do you wish to start $APP_NAME ?"             read  yn             case $yn in              [yY] | [yY][Ee][Ss] )                     $FILE start                     tail -f $FUSE_PATH/$APP_NAME/$LOG                     ;;              [nN] | [n|N][O|o] )                     ;;             * )             echo "Please answer yes or no.";;             esac             ;;            * )             echo "App $APP_NAME is running"     esac     fi     done      I'm Trying to execute this in RHEL 6


title: How to use one variable's name to refer to another variable?

text: a=2     pt2=3     echo $a     2     echo $pt2     3      How can I use               echo $pt($a)      to print the contents of `pt2`? An alternative is               b=pt$a     echo $b     pt2     echo $[$b]     3


title: return the numeric value of a indexed variable rather than its name

text: The following piece of code illustrates my problem I'm afraid I oversimplified it way too much in the first round.               #!/bin/bash     dogLover=1     catLover=2     for ii in dog cat         do             petLover=${ii}Lover             echo (evaluate $petLover)         done      I want the code to return the numeric values 1 and 2 rather than dog and cat. Presumably this is easy to do, but I can't seem to see how on the web. What I really need is a bash equivalent of the "eval" command in matlab


title: Passing arguments with quotes and doublequotes to bash script

text: At this moment I have:               #!/bin/bash     screen -p 'ScreenName' -x eval 'stuff '"'"$@"'"'\015'     echo eval 'stuff '"'"$@"'"'\015'      But when I call my script as:               # script.sh asd "asd" 'asd'      my arguments passed as: **asd asd asd** and I get output:               eval stuff 'asd asd asd'\015      _I except a: **asd "asd" 'asd'_** How I can change my script to pass whole arguments line with all quotes?


title: Home folder structure in Ubuntu 12.04.1?

text: Long story short, i just accidentally deleted my entire home folder. Thankfully it seems like the hidden files are still there. I'm not sure, but aren't all of the folders within the home folder (Desktop, Downloads and whatever else is in there) empty by default? If that is the case, could some super nice person just name all of the files located in the home folder so that i can rebuild it? Thanks a bunch in advance


title: What value is stored in linux xtime variable?

text: Whenever I print the value of `/proc/interrupts` the value of `rtc0` in `IRQ8` which is for RTC shows only 1 interrupt on CPU0. I have read that when booting the value of the xtime variable is stored from the Real time Clock and whether this interrupt is 1 because of this? And also what would be the value of the xtime variable? Is it the number of seconds passed after epoch?


title: Change the HOME of a user during a graphical session

text: The other day I had the idea to create display manager independent guest session. My basic idea was to change the login shell to a custom program that creates a temporary home on the fly (f.e. `/tmp/guest-XXXXXX`) and assign this session that home. After the user logs out it would remove that directory again. The problem I ran into is the following, I need to set a home in `/etc/passwd` and I can overwrite the HOME environment variable without a problem, but applications still seem to use the home set in `passwd` instead of the environment variable, at least in a graphical environment. I can not set the home in `passwd` because I do not know about it until the session has started. The basic logic I came up with looks like this:   * login shell started   * temporary home created   * HOME is set to this temporary home   * a real shell is forked   * after that real shell terminates, the temporary home is removed This seems to work when I `su` into the user, but running a graphical session means that mot/all programs started use the home set in `passwd`. Is it possible to change a user home on the fly/while a graphical session is active? DId I overlook something in the architecture of how the graphical sessions work?


title: Return value of commands when using stdin?

text: Imaging I am executing the following command:               echo "root:mypass" | chpasswd      How can I get the return code / error code returned by chpasswd? Is that possible in this case at all? I tried               RET = `echo "root:mypass" | chpasswd`      but this gives me only "command not found"?


title: Persistent folder missing from home folder, despite correct password and no errors

text: Tails 1.0 on stick 1. Password entered correctly on login screen for persistent storage (otherwise it would complain.) Booting from another (older) Tails stick, stick 2, can unlock and mount stick 1's persistent storage just fine and see all files. So why when I boot from stick 1 and enter the password correctly, does the Persistent folder not appear in the home folder (not in file browser GUI nor `sudo ls -a ~/`)? There's no error or anything, so why might it be missing?


title: Fastest `uniq` tool in linux

text: I have large text file (1.5 G), I want to know what the fastest and more reliable tool in linux is. I usualy use:               awk '!x[$0]++' file.txt      But when I use `htop` command I see my memory usage is increasing... I want to know whats is the fastest and more reliable one...(for huge files)               uniq?     sort?     sed?     awk?      And why? Thank you


title: Upgrading Slackware 13.1 to Slackware-current, is it a big leap?

text: I have Slackware 13.1 installed on my computer, with some software that I installed via pkgtools, slackbuilds, and compiled. I want to upgrade it to Slackware-current (13.37). Can I safely upgrade this by following UPGRADE.txt? Is this a big leap that will come problem (dependency, version conflict, etc)? What about my additional application that I installed via slackbuilds or compiled, are there any chance that they don't compatible with the newer library version?


title: Turning off dual monitors with "xset dpms force off" does not work - why?

text: I would like to turn off my dual monitors by running: `xset dpms force off` but just the primary monitor is beeing turned off while the other just gets a "black screen" (like if it was turned off) but it is not off. The led is still gleaming green indicating the monitor is on.


title: Does the kernel delete entries in /dev on an initramfs?

text: I have a fully custom, minimal, embedded Linux (vanilla, 3.3.8, i486, Vortex86dx) system that boots from an initramfs image. No standard distribution scripts are used, just a single rcS file that does the initialisation. I have an IDE Flash disk with two partitions at /dev/hda1 and /dev/hda2. As this is a minimal embedded distribution for a fixed system, it has a static /dev directory that contains /dev/hda1 and /dev/hda2, and there is no UDEV. At the point that init calls rcS, the /dev/hda1 entry is no longer present. No other scripts, user applications or daemons have been run at this point. /dev/hda1 _appears_ to have been deleted by the kernel(?) I do not have this same problem if I boot my target via an NFS root filing system during my development process. I use Buildroot to create the /dev directory via the device_table_dev.txt file. e.g.               # IDE Devices     /dev/hda    b   640 0   0   3   0   0   0   -     /dev/hda    b   640 0   0   3   1   1   1   4      I inspected the rootfs.tar.gz from Buildroot output/images. The /dev directory contains /dev/hda1:               brw-r-----  1 root root  3,   0 Jul  2 13:44 hda     brw-r-----  1 root root  3,   1 Jul  2 13:44 hda1     brw-r-----  1 root root  3,   2 Jul  2 13:44 hda2     brw-r-----  1 root root  3,   3 Jul  2 13:44 hda3     brw-r-----  1 root root  3,   4 Jul  2 13:44 hda4      My post-boot directory listing (done from within rcS, at the top of the script) on the target looks like this:               brw-r-----   1 root   root    3,   0 Jul  2 12:44 hda     brw-r-----   1 root   root    3,   2 Jul  2 12:44 hda2     brw-r-----   1 root   root    3,   3 Jul  2 12:44 hda3     brw-r-----   1 root   root    3,   4 Jul  2 12:44 hda4      /dev/hda1 is missing. /dev/hda2 is a partition on the same disk yet it is still there. Strange. If I run the Busybox utility "mdev -s", it restores/dev/hda1 on the target and it works normally. e.g. I can mount it Has anyone ever seen this behaviour before? Does the kernel delete entries from /dev?


title: IGB-Falsely claims to have parameter note

text: Because of some circumstances I have to install SLES 9 SP4 on a nearly new hardware. After the installation there is just a problem my network card(Intel Ethernet Server Adapter I350-T2). After the installation of the igb modul they're detected in Yast. I can now configure them like it should be but after applying the configuration nothing works. And ifconfig shows nothing. When I go back to Yast to check the configuration nothing has changed and my configuration is still there. After a reboot I get the error that the igb modul falsely claims to have the parameter note. I don't know what to do now and google was useless.


title: Cant detach/ kill xm console on node server

text: please advice, why I cant attach console from xm command? > [root@vm ~]# xm console vm104   >  Another console has already been attached to guest


title: Transfer files from CentOS VM VirtualBox to Windows host machine

text: How can I transfer the scripts and text files I've created in my CentOS environment and put it in my host desktop (Windows 7)? I've tried using ftp but it needs to configure the routers to use vsftpd, which I do not have administrative privileges. Is there any way I can transfer these files in another approach? Thank you.


title: Similar software to SourceTree

text: Is there a similar piece of software to SourceTree, a GUI for git, for Linux? I know about Giggle, git cola, etc. I'm looking for a beautiful, easy to use GUI for git.


title: Can I safely delete old directories in my home directory?

text: I have several hidden directories in my home directory of which I don't know if I need them any more. How do I know if I can safely delete them? For instance, next to the directory `.gimp-2.8` there is also `.gimp-2.4` which dates from two years ago. And it contains more files than the recent one.   Now I could move the old one elsewhere, start up the Gimp and see if it behaves differently, but can I be sure that there are no other applications which make use of these older files? And there is a very old directory `.gnome2_private` and I don't even run Gnome, I run KDE. But a quick test shows that when I create a new user on my computer, this directory is created automatically, so it does serve a function, right? And so on. And there are directories that I don't recognise the name of, so I have no idea to which applications they belong. How can I find out about them?


title: 1GB huge page - Is writing occurring in 1GB chunks?

text: I'm trying to understand the relation between huge page size and how data is actually being written to RAM. What happens when a process uses a 1GB huge page - does writing occur in 1GB chunks? I guessing I'm completely wrong with this assumption?


title: Monitoring interface changes with udev, especially if a route is set

text: Is there a way to monitor interface up/downs, especially to check if a route is setup or removed, with udev?


title: How do I create a dialog with multiple text fields using zenity?

text: I want to crate a GUI for some command line programs and I need to get info from multiple text fields e.g. 'Username', 'Password' and a checkbox 'Sign automatically?'. I need to set particular variables in my script equal to the respective text fields' input by the user e.g. `user`, `pass`, `login`. Also it would have an OK button and a Quit button. How can I realise this this? I searched online and I was able to find only examples with one text field?


title: Is there an easier way to manipulate GRUB 2 entries?

text: Using GRUB 2 is harder than GRUB 1 for these use cases:   * It looks like if I want to reorder GRUB 2 menu entries appear in the selection window, I have to rename the files in " **/etc/grub.d/** " directory.   * If I have to change boot order, I first have to look in " **/boot/grub/grub.cfg** ", check when the entry I want to be default appears, then set the `GRUB_DEFAULT` parameter in " **/etc/default/grub** " to match it (counting from 0). The old GRUB used to allow me to do all of this by just moving text entries in " **/boot/grub/menu.lst** " around. This much-simpler way kept me using GRUB 1 for a while. This makes me wonder if there's a specialized tool to make all of this easier.


title: How to know the types of windowing system, window manager and desktop environment of a Unix-like OS

text: I was wondering what commands/utilities can be used in terminal to know the types of windowing system (such as X window system), window manager (such as Metacity, KWin, Window Maker) and desktop environment (such as KDE, Gnome) of a Linux or other Unix-like operating systems? Thanks!


title: How do I migrate configuration between computers with different hardware?

text: I want to migrate the configuration of an Ubuntu desktop to a new box with different hardware. What is the easiest way to do this? /etc/ contains machine and hardware specific settings so I can't just copy it blindly. A similar problem exists for installed packages. edit: This is a move from x86 to x86-64.


title: Issue with degraded raid5 after power outage

text: I have a raid5 that consists of 8 disks. After a power outage mdadm tells me that the raid is degraded. Here is the output:               /dev/md0:             Version : 0.90       Creation Time : Sat Jul 10 09:08:28 2010          Raid Level : raid5          Array Size : 13674601472 (13041.12 GiB 14002.79 GB)       Used Dev Size : 1953514496 (1863.02 GiB 2000.40 GB)        Raid Devices : 8       Total Devices : 7     Preferred Minor : 0         Persistence : Superblock is persistent              Update Time : Thu Aug  2 18:42:05 2012               State : clean, degraded      Active Devices : 7     Working Devices : 7      Failed Devices : 0       Spare Devices : 0                   Layout : left-symmetric          Chunk Size : 64K                     UUID : 09dd4536:a6153f6b:f1f4aaa9:53aab85a              Events : 0.9189750              Number   Major   Minor   RaidDevice State            0       8        0        0      active sync   /dev/sda            1       8       16        1      active sync   /dev/sdb            2       8       96        2      active sync   /dev/sdg            3       8      112        3      active sync   /dev/sdh            4       8       32        4      active sync   /dev/sdc            5       8       48        5      active sync   /dev/sdd            6       8       64        6      active sync   /dev/sde            7       0        0        7      removed      So /dev/sdf is missing. So I tried to get some infos about this drive. smartctl does not report any issues and `fdisk -l` lists it as expected. Lastly I tried `mdadm -E /dev/sdf` and I get this output:               /dev/sdf:               Magic : a92b4efc             Version : 0.90.00                UUID : 09dd4536:a6153f6b:f1f4aaa9:53aab85a       Creation Time : Sat Jul 10 09:08:28 2010          Raid Level : raid5       Used Dev Size : 1953514496 (1863.02 GiB 2000.40 GB)          Array Size : 13674601472 (13041.12 GiB 14002.79 GB)        Raid Devices : 8       Total Devices : 8     Preferred Minor : 0              Update Time : Wed Mar 28 17:19:58 2012               State : clean      Active Devices : 8     Working Devices : 8      Failed Devices : 0       Spare Devices : 0            Checksum : afeeecc7 - correct              Events : 9081618                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     7       8      112        7      active sync   /dev/sdh             0     0       8        0        0      active sync   /dev/sda        1     1       8       16        1      active sync   /dev/sdb        2     2       8       32        2      active sync   /dev/sdc        3     3       8       48        3      active sync   /dev/sdd        4     4       8       64        4      active sync   /dev/sde        5     5       8       80        5      active sync   /dev/sdf        6     6       8       96        6      active sync   /dev/sdg        7     7       8      112        7      active sync   /dev/sdh      What is the issue here? Should I replace `sdf` or is this repairable? **Update** I also had look at `dmesg` and I get this:               [    9.289086] md: kicking non-fresh sdf from array!     [    9.289090] md: unbind<sdf>     [    9.296541] md: export_rdev(sdf)


title: Mono spits out too many errors after update, try to reinstall, more errors

text: I had errors with `apt-get update && apt-get dist-upgrade`, from mono mono, so I tried this instead: `sudo apt-get install --reinstall banshee banshee-extension-soundmenu banshee- extension-ubuntuonemusicstore giver libappindicator0.1-cil libart2.0-cil libavahi1.0-cil libgconf2.0-cil libgdata1.7-cil libgkeyfile1.0-cil libglade2.0-cil libglib2.0-cil libgmime2.4-cil libgnome-vfs2.0-cil libgnome2.24-cil libgtk-sharp-beans-cil libgtk2.0-cil libgudev1.0-cil liblaunchpad-integration1.0-cil libmono-addins-gui0.2-cil libmono- addins0.2-cil libmono-cairo2.0-cil libmono-corlib1.0-cil libmono-corlib2.0-cil libmono-data-tds1.0-cil libmono-data-tds2.0-cil libmono-i18n-west1.0-cil libmono-i18n-west2.0-cil libmono-management2.0-cil libmono-messaging2.0-cil libmono-posix2.0-cil libmono-security1.0-cil libmono-security2.0-cil libmono- sharpzip0.84-cil libmono-sharpzip2.84-cil libmono-sqlite2.0-cil libmono- system-data-linq2.0-cil libmono-system-data1.0-cil libmono-system-data2.0-cil libmono-system-messaging2.0-cil libmono-system-web1.0-cil libmono-system- web2.0-cil libmono-system1.0-cil libmono-system2.0-cil libmono-wcf3.0-cil libmono-zeroconf1.0-cil libmono1.0-cil libmono2.0-cil libndesk-dbus- glib1.0-cil libndesk-dbus1.0-cil libnotify0.4-cil libtaglib2.0-cil libubuntuone1.0-cil mint-meta-gnome-dvd mono-2.0-gac mono-csharp-shell mono- gac mono-gmcs mono-runtime tomboy > ./errors2.txt` http://pastebin.com/YJszy4q4               Reading package lists...     Building dependency tree...     Reading state information...     The following packages were automatically installed and are no longer required:       libcommons-pool-java libtomcat6-java libcommons-dbcp-java     Use 'apt-get autoremove' to remove them.     0 upgraded, 0 newly installed, 60 reinstalled, 0 to remove and 0 not upgraded.     56 not fully installed or removed.     Need to get 0 B/1,846 kB of archives.     After this operation, 0 B of additional disk space will be used.     (Reading database ... 334292 files and directories currently installed.)     Preparing to replace libmono-posix2.0-cil 2.6.7-5ubuntu3.1 (using .../libmono-posix2.0-cil_2.6.7-5ubuntu3.1_all.deb) ...     Unpacking replacement libmono-posix2.0-cil ...     Preparing to replace libmono-security2.0-cil 2.6.7-5ubuntu3.1 (using .../libmono-security2.0-cil_2.6.7-5ubuntu3.1_all.deb) ...     Unpacking replacement libmono-security2.0-cil ...     Preparing to replace libmono-system2.0-cil 2.6.7-5ubuntu3.1 (using .../libmono-system2.0-cil_2.6.7-5ubuntu3.1_all.deb) ...     Unpacking replacement libmono-system2.0-cil ...     Preparing to replace mono-2.0-gac 2.6.7-5ubuntu3.1 (using .../mono-2.0-gac_2.6.7-5ubuntu3.1_all.deb) ...     Unpacking replacement mono-2.0-gac ...     Processing triggers for man-db ...     Setting up libmono-posix2.0-cil (2.6.7-5ubuntu3.1) ...     Setting up libmono-system2.0-cil (2.6.7-5ubuntu3.1) ...     Setting up libmono-security2.0-cil (2.6.7-5ubuntu3.1) ...     Setting up mono-2.0-gac (2.6.7-5ubuntu3.1) ...     Setting up mono-gac (2.6.7-5ubuntu3.1) ...     * Installing 3 assemblies from libappindicator0.1-cil into Mono     E: installing Assembly /usr/lib/cli/appindicator-sharp-0.1/appindicator-sharp.dll failed     E: Installation of libappindicator0.1-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 6 assemblies from libart2.0-cil into Mono     E: installing Assembly /usr/lib/cli/art-sharp-2.0/art-sharp.dll failed     E: Installation of libart2.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libavahi1.0-cil into Mono     E: installing Assembly /usr/lib/cli/avahi-sharp-1.0/avahi-sharp.dll failed     E: Installation of libavahi1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 6 assemblies from libgconf2.0-cil into Mono     E: installing Assembly /usr/lib/cli/gconf-sharp-2.0/gconf-sharp.dll failed     E: Installation of libgconf2.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 14 assemblies from libgdata1.7-cil into Mono     E: installing Assembly /usr/lib/cli/Google.GData.AccessControl-1.7/Google.GData.AccessControl.dll failed     E: Installation of libgdata1.7-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libgkeyfile1.0-cil into Mono     E: installing Assembly /usr/lib/cli/gkeyfile-sharp-1.0/gkeyfile-sharp.dll failed     E: Installation of libgkeyfile1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libglade2.0-cil into Mono     E: installing Assembly /usr/lib/cli/glade-sharp-2.0/glade-sharp.dll failed     E: Installation of libglade2.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libglib2.0-cil into Mono     E: installing Assembly /usr/lib/cli/glib-sharp-2.0/glib-sharp.dll failed     E: Installation of libglib2.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libgmime2.4-cil into Mono     E: installing Assembly /usr/lib/cli/gmime-sharp-2.4/gmime-sharp.dll failed     E: Installation of libgmime2.4-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 2 assemblies from libgnome2.24-cil into Mono     E: installing Assembly /usr/lib/cli/gnome-sharp-2.24/gnome-sharp.dll failed     E: Installation of libgnome2.24-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 6 assemblies from libgnome-vfs2.0-cil into Mono     E: installing Assembly /usr/lib/cli/gnome-vfs-sharp-2.0/gnome-vfs-sharp.dll failed     E: Installation of libgnome-vfs2.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 5 assemblies from libgtk2.0-cil into Mono     E: installing Assembly /usr/lib/cli/gtk-sharp-2.0/gtk-sharp.dll failed     E: Installation of libgtk2.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libgudev1.0-cil into Mono     E: installing Assembly /usr/lib/cli/gudev-sharp-1.0/gudev-sharp.dll failed     E: Installation of libgudev1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from liblaunchpad-integration1.0-cil into Mono     E: installing Assembly /usr/lib/cli/launchpad-integration-sharp-1/launchpad-integration-sharp.dll failed     E: Installation of liblaunchpad-integration1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 7 assemblies from libmono-addins0.2-cil into Mono     E: installing Assembly /usr/lib/cli/Mono.Addins-0.2/Mono.Addins.dll failed     E: Installation of libmono-addins0.2-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 3 assemblies from libmono-addins-gui0.2-cil into Mono     E: installing Assembly /usr/lib/cli/Mono.Addins.Gui-0.2/Mono.Addins.Gui.dll failed     E: Installation of libmono-addins-gui0.2-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 5 assemblies from libmono-zeroconf1.0-cil into Mono     E: installing Assembly /usr/lib/cli/Mono.Zeroconf-1.0/Mono.Zeroconf.dll failed     E: Installation of libmono-zeroconf1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libndesk-dbus1.0-cil into Mono     E: installing Assembly /usr/lib/cli/NDesk.DBus-1.0/NDesk.DBus.dll failed     E: Installation of libndesk-dbus1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libndesk-dbus-glib1.0-cil into Mono     E: installing Assembly /usr/lib/cli/NDesk.DBus.GLib-1.0/NDesk.DBus.GLib.dll failed     E: Installation of libndesk-dbus-glib1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libnotify0.4-cil into Mono     E: installing Assembly /usr/lib/cli/notify-sharp-0.4/notify-sharp.dll failed     E: Installation of libnotify0.4-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 2 assemblies from libtaglib2.0-cil into Mono     E: installing Assembly /usr/lib/cli/taglib-sharp-2.0/taglib-sharp.dll failed     E: Installation of libtaglib2.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libubuntuone1.0-cil into Mono     E: installing Assembly /usr/lib/cli/ubuntuone-sharp-1.0/ubuntuone-sharp.dll failed     E: Installation of libubuntuone1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     dpkg: error processing mono-gac (--configure):      subprocess installed post-installation script returned error exit status 9     dpkg: dependency problems prevent configuration of mono-runtime:      mono-runtime depends on mono-gac (= 2.6.7-5ubuntu3.1); however:       Package mono-gac is not configured yet.     dpkg: error processing mono-runtime (--configure):      dependency problems - leaving unconfigured     (…)     dpkg: too many errors, stopping     Errors were encountered while processing:      mono-gac      mono-runtime      libmono-corlib2.0-cil     (…)      I have Linux Mint 11 x64.


title: Quoting within $(command substitution) in Bash

text: In my Bash environment I use variables containing spaces, and I use these variables within command substitution. Unfortunately I cannot find the answer on SE. What is the correct way to quote my variables? And how should I do it if these are nested?               DIRNAME=$(dirname "$FILE")      or do I quote outside the substitution?               DIRNAME="$(dirname $FILE)"      or both?               DIRNAME="$(dirname "$FILE")"      or do I use back-ticks?               DIRNAME=`dirname "$FILE"`      What is the right way to do this? And how can I easily check if the quotes are set right?


title: How to get only the unique results without having to sort data?

text: $ cat data.txt      aaaaaa     aaaaaa     cccccc     aaaaaa     aaaaaa     bbbbbb     $ cat data.txt | uniq     aaaaaa     cccccc     aaaaaa     bbbbbb     $ cat data.txt | sort | uniq     aaaaaa     bbbbbb     cccccc     $      The result that I need is to **display all the lines from the original file removing all the duplicates (not just the consecutive ones), while maintaining the original order of statements in the file**. Here, in this example, the result that I actually was looking for was               aaaaaa     cccccc     bbbbbb      How can I perform this generalized `uniq` operation in general?


title: I'm confused as to why "| true" in a makefile has the same effect as "|| true"

text: I have a makefile where I'm stopping a service before removing a file. When it couldn't stop the service, it would break on error. This is clearly unwanted so I thought I'd add `|| true` but missed a `|`. Making it:               stop service foo | true     rm /etc/init/foo.conf      I'm confused as to why this is working and what is happening. Does this mean that `true` is an application and not merely a keyword? Are they the same? Is there a good reason to use `| true`?


title: How can I program vncserver to automatically setup my shells for me?

text: I use VNC to connect to a hosted machine. Whenever I start a VNC server at some port and connect to it, I first need to setup my shells for me - 5 of them in a particular configuration that I like and then start my work. Is there a way to automate this task so that whenever a VNC server is started, my shells are already configured and ready for me to use?


title: Copy and set-mark in Bash as in Emacs?

text: I would like to be able to copy and paste text in the command line in Bash using the same keyboard bindings that Emacs uses by default (i.e. using `C-space` for `set-mark`, `M-w` to copy text, `C-y`, `M-y` to paste it, etc.). The GNU Bash documentation says that Bash comes with some of these key bindings set up by default. For example, yanking (`C-y`) works by default on my terminal. However, I can't get the `set-mark` and `copy` commands to work, and they don't seem to be bound to any keys by default. Usually, the way a user can define her own key bindings is to add them to `.inputrc`. So I looked and found the following bash functions in the documentation that I presume can help me define the Emacs-like behavior that I want (i.e. `set-mark` with `C-space` and `copy` with `M-w`).               copy-region-as-kill ()      > Copy the text in the region to the kill buffer, so it can be yanked right > away. By default, this command is unbound. and               set-mark (C-@)      > Set the mark to the point. If a numeric argument is supplied, the mark is > set to that position. If I understand correctly, the above means that `copy-region-as-kill` is not bound to any keyboard sequence by default, while `set-mark` is bound to `C-@` by default. I tried `C-@` on my terminal, but I don't think it runs `set-mark` because I don't see any text highlighted when I move my cursor. In any case, I tried adding keyboard bindings (`M-w` and `C-`) to the functions `copy-region-as- kill` and `set-mark` above in my `.inputrc` and then reloading it with `C-x C-r`, but this didn't work. I know that my other entries in `.inputrc` work because I have other user-defined keybindings defined in it. Is there anything I am doing wrong? Am I missing anything?


title: How can I create multiple files in the current directory in bash?

text: Is there a command to create multiple files in the current directory? i.e. if I would like to create `__init__.py`, `views.py`, `models.py` and `admin.py` as follows:               > COMMAND __init__.py views.py models.py admin.py      What would `COMMAND` be?


title: Backtrack mp3 problem

text: I've installed Backtrack but I can't figure out how to play mp3files. I've installed ubuntu-restricted-extras,lame, libmp3lame but still won't work(I have Rhythmbox player, I've also tried Amarok). Any ideas?


title: Apply item replacement inside enumerate in Perl regex?

text: Data               7. Masi is the same as     \begin{enumerate}     A     B     ABC ha lorem     \end{enumerate}          1. ABC is     \begin{enumerate}     P     B     Lorem maam     \end{enumerate}      which I want to be               7. Masi is the same as     \begin{enumerate}     \item A     \item B     \item ABC ha lorem     \end{enumerate}          1. ABC is     \begin{enumerate}     \item P     \item B     \item Lorem maam     \end{enumerate}      My startup regex is based on this answer > >     perl -000pe >     s/\n/\n\\begin{enumerate}\n [A-Za-z1-9]* \end{enumerate}/ >     ... [problem here!] >     masi.tex >   where   * -000 : activate Perl's paragraph mode, this causes "lines" to be defined by two consecutive newlines (\n\n), so that each of your questions is treated as a single line.   * -pe : read each line of the input file and print it (-p) after applying the script passed as -e. I want to replace the beginning of each new line inside the match with `\item`. My pseudocode for **problem here code** > s/\n/\item /g to apply things inside enumerate environment. How


title: mount -t cifs: "Operation not supported", but can connect via smbclient

text: After sysadmin replaced the NAS, I can no longer mount the network share with               sudo mount -t cifs //netgear.local/public /media/mountY -o uid=1000,iocharset=utf8,username="adam",password="password"      Both NAS are linux-based, one with Samba 3.5.15 (the old one) and the other with Samba 3.5.16 (the new one) (information obtained from smbclient) I can, however, log in and use the share with the help of `smbclient`, like this:               smbclient  //NETGEARV2/public -U adam      What can I do? There is no `smbmount` on Linux Mint (nor on Ubuntu) anymore. When I check `dmesg` I get this info:               CIFS VFS: Send error in QFSUnixInfo = -95     CIFS VFS: cifs_read_super: get root inode failed


title: Have Sun keyboard moon key (116) not shut down my computer

text: On my Sun keyboard, the top-rightmost key (with a moon image, right above the keypad) shuts down my computer. I'd like it not to, as I hit it by mistake now and then. In `/etc/default/keyboard`, I only have               XKBMODEL="inspiron"     XKBLAYOUT="us"     XKBVARIANT=""     XKBOPTIONS="compose:lwin,terminate:ctrl_alt_bksp"      With `showkey`, for this key, I get               kb mode was UNICODE     [ if you are trying this under X, it might not work     since the X server is also reading /dev/console ]          press any key (program terminates 10s after last keypress)...     keycode  28 release     keycode 116 press     keycode 116 release     caught signal 1, cleaning up...      So the key is identified as 116 by showkey. **EDIT** (in response to Mr. Szabo below) So, there are **two** keys involved here: The key I describe above (on my Sun keyboard), **and** the power button on my laptop hull. However, the computer seems to interpret those keys equivalently. I'd like the button on my laptop to work as as power button, as then, I can turn off my computer without having to type the super user password after `shutdown`. However, I don't like the keyboard key to work this way, as it is next to the volume control, and above the numpad; it is easy to hit it by mistake. I **do** have `acpid` - but the empty files `power` and `powerbtn` in `/etc/acpid/events/` did not have any affect; as for the script you mention, I don't have it. But, by renaming `/etc/rc2.d/S15acpid` so it won't run (i.e., lowercasing the initial `S`), **neither** key will reboot the computer. And I guess that's a fall forward as I prefer typing the super user keyword to accidentally shutting down my computer.


title: Remote shell script Enter passphrase for

text: How can I run a script to log into a remote server and execute a remote ssh command without entering in my passphrase? **For example:** When I log onto a remote server and execute the `git pull` command I see `ssh` prompt me for my passphrase:               $ git pull origin master     Enter passphrase for /home/v3ed2/.ssh/id_rsa:      Once I enter my passphrase I continue with the command. I want to run a script that will log into the remote server and run the command for me. I already tried this script:               ssh ve "cd clients/ ; git pull"      However, when the script runs, it does not prompt me for my passphrase. The script just hangs while it waits for my passphrase, but when I try to enter a passphrase, I get the error:               bash: line 1: [REDACTED]: command not found


title: Why is cd not a program?

text: I've always wondered why `cd` isn't a program, but never managed to find the answer. Anyone know why this is the case?


title: where is `cd` located?

text: In a bash sub shell I get the following error when running cd               sudo: cd: command not found      This is expected because I don't have a path. Usually to work around this I just provide the full path like so: (/usr/local/bin/foo) Much to my surprise, `cd` does not appear to be in any of the normal places.               which cd     whereis cd     ls /bin | grep cd      By comparison, `ls` is right where I would expect.               which ls     /bin/ls      Where is the `cd` command located? And why is different from all the other commands? **Update** Another interesting tidbit, cd does not show up in `hash`               hash     0   /bin/ls     2   /usr/bin/find     2   /sbin/ip     1   /usr/bin/updatedb     1   /usr/bin/apt-get


title: What happens when we type a simple command on shell?

text: I have a simple doubt on execution of a simple command. As per my understanding, when we type a command such as `ls` on interactive shell,   1. Shell interpretes the command.   2. Shell creates a child process and excecutes the command on the child process.   3. Shell waits for the child process's completion. If my understanding is correct, a simple command we typed on shell prompt is executed on a child process and the command' result does not affect current shell's enviroment. If so, what about built-in commands like `cd`? If `cd` is executed on a child process and can not affect current shell's enviroment, how the current shell's working directory can be changed?


title: iptables will match the following ICMP request packet as ESTABLISHED state after the first reply packet is sent

text: Test environment: CentOS 6.3 - kernel 2.6.32-279.el6.i686, iptables v1.4.7 Win7 <---> CentOS Windows is constantly replaying ICMP echo request in 10pkt/sec rate to CentOS. In iptables, I added the rules as below to limit the incoming icmp request packet rate. But it didn't work. Because after the 1st incoming icmp request was accepted by the 1st rule and my host replied, all the following icmp request will accepted by the 2nd rule, which will accept the incoming icmp request as ESTABLISHED state packet. I think this doesn't make sense. ![enter image description here](http://i.stack.imgur.com/pZ4ey.jpg) I checked the "Iptables Tutorial 1.2.2" and I found the statement as below. http://www.frozentux.net/iptables-tutorial/iptables-tutorial.html#STATEMACHINE > The reply packet is considered as being ESTABLISHED, as we have already > explained. However, we can know for sure that after the ICMP reply, there > will be absolutely no more legal traffic in the same connection. For this > reason, the connection tracking entry is destroyed once the reply has > traveled all the way through the Netfilter structure. In each of the above > cases, the request is considered as NEW, while the reply is considered as > ESTABLISHED. However, I found the conntrack entry was always there in `/proc/net/nf_conntrack` after the 1st reply was sent.               ipv4     2 icmp     1 24 src=192.168.56.1 dst=192.168.56.101 type=8 code=0 id=1 src=192.168.56.101 dst=192.168.56.1 type=0 code=0 id=1 mark=0 secmark=0 use=2      I think each incoming ICMP request should be treated as NEW state not ESTABLISHED even a icmp connection has been establised. Correct me if I don't understand the state match in a proper way.


title: Allow non-root unmodifiable sofware to bind to ports 80 & 443

text: The company I'm in uses the Java Secure Application Manager to "secure" non- internal connections their webmail and electronic collaboration software. Aside from using expired certificates, and missing the permissions JAR File Manifest Attributes, the sofware runs fine, except it needs to bind to ports 80 and 443, which means to run it, i need to be running the Icedtea plugin in Firefox running as root. Is there anyway i can let this application access to those ports without needing to run it as root. (For security reasons).


title: Debian - How to find out if a package is multiarchified? Dependency changes as bug report

text: I'm using Debian Wheezy 64bit and wine is only existing in a 32bit version. So I added multiarch support. But when I want to install winetricks it's dependencies are `depends on wine | wine-unstable` and not `depends on wine | wine-unstable | wine:i386` So, aptitude suggests to install the dummy 64bit package or to not install winetricks... which doesn't make a lot of sense :) So, I wonder if I have to report a bug because winetricks' dependencies are wrong. For me it seems like that, but I would expect that bug report already to be written. How do I find out if a package has already been multiarchified? Will this issue be solved by only adding the `| wine:i386` in the package informations? Shall I write a bug report in such cases?


title: How do I stop Caja from closing when a drive is disconected?

text: Caja 1.6.2 on Mint 16. When the network goes down, the Caja manager connected to a remote server via SSHFS closes itself. I want to disable this behaviour. It should just turn gray or something until the network is back.


title: Specify a fallback file for a broken symbolic link

text: I want to create a symlink, `foo.txt`, needed at system startup, to another file, `bar.txt` on a different mount point. The mounted partitions are different physical drives as well.               ln -s /baz/bar.txt /foo.txt      **EDIT:** So far no problem. The Symlink is created and is valid. The question relates to what will happen when partition at `/bar` disappears. **/EDIT** My dilemma is this, the partition mounted at `/baz` may not be present at startup. My question -> To avoid obvious problems, can I specify a fall back file _at the filesystem level_ that the symlink will resolve to rather than simply breaking? Or am i stuck doing this at the application level? Using Debian linux on an ext4 (the default for the latest release of Debian) filesystem FWIW.


title: Is there a way to 'tee' input to a program or script?

text: I'm trying to find a way to use an input file for a program in such a way that I can also use stdin. For example, say I have a SQL script that creates a table. I invoke it like this:               mysql -p database < script.sql      This is great, but it exits out of mysql when the script is finished. Instead, I want to run other queries manually without being logged out of mysql. I know `tee` can fork output to the terminal (stdout) and to a file, is there a reverse function that can be used for input, or at least a method that can be applied to most Linux/Unix commands?


title: configure package in non-standard way and resolve library requirements

text: I am installing a package (dia-0.96.1) in non-standard way on opensuse-11 system which I don't have root access. When I start to configure the package with command:               ./configure --prefix=/home/myusername/dia      I get the error: No package 'libxml-2.0' found. However I've installed in the same way `libxml2-2.9.1` package in my home directory without any error. So now when I use:               ./configure --prefix=/home/myusername/dia --libdir=/home/myusername/libxmldir      I still get the same error. Is there any solution to install the package in this way?


Sort the files in the directory recursively based on last modified date I have modified a lot of files in my directory want to know what are those files by sorting them by the last modified date and in that I want some of the extensions to be excluded in the svn directory I have a lot of .svn files too which I dont want to show in the sort


title: How to remap the keys with xkeycaps?

text: I'm trying to remap different keys (for example, I want the "Y" to be "space"). XKeyCaps let me choose the keyboard, and shows correctly when one key is pressed. But the right click menu that allows to do the changes shows up but doesn't work (it stays up as long as the right mouse button is clicked, options are not grayed, but nothing can be selected). I'm using Fedora 20 with KDE.


title: How to install lsblk on CentOS 5

text: I'm more used to Debian so yum and CentOS is a little new to me. Apparently, lsblk is not available on this system. I'm trying to install it via yum with no luck. I just get "nothing to do". I updated the CentOS-Base.repo file and ran yum clean all. It still doesn't find the package. What should be my next step?


title: Merge 2 files based on all available values of the first column in both files

text: I need to merge below 2 files:   * **file1** :              viewer  23     test    27     remark  2        * **file2** :              viewer  2990     exam    200     remark  240      **merged file should be as shown below:**               type    value1  value2  difference     viewer  23      2990       -2967     test    27        0          27     remark  2        240        -238     exam    0        200        -200


title: How does inotify work?

text: According to Wikipedia, > inotify is a Linux kernel subsystem which notices changes to the file > system. It replaced the previous dnotify. Programs that sync files (such as crashplan, dropbox, git) recomend in user guides that the user increase `max_user_watches` (1, 2, 3). From what I understand about inotify, the OS is "told" that a file has been changed, instead of requiring the OS to "go looking" for changes. I assume that there is an "inotify" file created in every directory. Is this correct? Is there a way to interact with inotify from the command line? **Resources**   Why are inotify events different on an NFS mount?   Inotifywait for large number of files in a directory


title: LTSP - Automatic build package selection

text: After recently instaling and setting up an LTSP environment, to learn more about it, using a few older spare PC's I have, I noticed that there are packages missing on the clients. In specific festival and sox. At first thought, without knowing much about the `ltsp-build-client` mechanism, thought it was maybe the fact that the server is 64bit (So possibly had a 64 bit version of these packages installed), that was the reason for LTSP excluding it from the 32bit image. However, after building a 64bit image, and booting it, there was also no trace of these packages files. I ended up having success with `chroot`'ng into the directory that contained the image files, used `apt-get` to install a copy that worked on the client, and then `ltsp-update-image`. However, would really like to know more about the LTSP build mechansim - Anyone know how LTSP decides, out of server installed packages, what to include in a client image, and what not? (I don't suppose order of installation of the three packages in question, matters?)


title: Update Linux 10 Mint Julia to 13 Maya

text: Everytime I try to `apt-get update` it comes up with the following: > Err http://archive.ubuntu.com Precise/main amd64 Packages   >  404 Not Found [IP: 91.189.91.14 80]   >  Err http://archive.ubuntu.com Precise/restricted amd64 Packages   >  404 Not Found [IP: 91.189.91.14 80] What am I doing wrong?


title: Building from Source on CentOS 5 or newer

text: I've got a few applications of which I've got to build from source files in order to make it work on CentOS (the programs do not exist in the yum repos). I may be missing something, but unlike Debian and others, where the `make` command is readily available, this program does not exist in CentOS out of the box. What is needed to allow for me to build an application from source on CentOS 5 or newer? Or does this option even exist in the first place? (NOTE: This is a command-line accessible system only, so all solutions must utilize only the command line interface)


title: How can I mount a block device from one computer to another via the network as a block device?

text: Is it possible to export a block device such as a DVD or CDROM and make it so that it's mountable on another computer as a block device? **NOTE:** I'm not interested in doing this using NFS or Samba, I actually want the optical drive to show up as a optical drive on a remote computer.


title: Deleting commented lines in a text file using sed

text: I am a `sed` novice. I would like to use `sed` to delete commented lines in a text file. In my series of text files, commented lines **_begin_** with either the `#` symbol or the `@` symbol (i.e., they are files originally intended for plotting in `xmgrace`). Suppose I have the following sample file (called `sample.txt`): > >     # Comment 1 >     # Another comment >     # Yet another comment >     @ More comments >     @ Still more comments >     data1 >     data2 >   >     data3 >   I would like to use `sed` to modify `sample.txt`, in place, to obtain the following: > >     data1 >     data2 >   >     data3 >   where there is a blank line between "`data2`" and "`data3`" in both versions of `sample.txt`. With inspiration from this Stack Overflow question, I came up with this series of (consecutive) commands:               sed -i 's/#.*$//' sample.txt     sed -i 's/@.*$//' sample.txt      which give this resulting file: > >         <blank line> >         <blank line> >         <blank line> >         <blank line> >         <blank line> >     data1 >     data2 >   >     data3 >   where `<blank line>` is just a blank line. (I had to write it this way so that Stack Exchange would format the output correctly.) The problem with the above is that the commented lines are only replaced with blank lines, not deleted altogether. Another possibility of (consecutive) commands is:               sed -i 's/#.*$//' sample.txt     sed -i 's/@.*$//' sample.txt     sed -i '/^$/d' sample.txt      from which I obtain the following output: > >     data1 >     data2 >     data3 >   The above is, however, also wrong because the blank line between "`data2`" and "`data3`" has not been preserved (I am incorrectly deleting all blank lines, indiscriminately). How do I just delete the commented lines? I am running Ubuntu Linux. Thanks for your time!


title: How to find a Linux kernel that works ok on my PC?

text: I have an old laptop. The newer kernels that ship with the latest versions of the most popular Linux distributions crash from time to time. I want to use a new Linux distribution to get the latest packages and therefore I think that I need an old kernel. (correct me if there is some other solution please) How can I find the most suitable Linux kernel that doesn't break on my machine? Is there an alternative to try kernels one by one? Maybe some guidance or basic rules somewhere, a software that do this for you? I'm searching for a general answer if possible, not specific instructions. Anyway specific answers can be useful to somebody else so they are also welcomed.


title: Where do sound drivers live?

text: A little while ago I searched for a good driver for my sound card (with surround sound support) and didn't find any. So it seems there is none. I thought I could try (even though I think nothing useful will be produced) writing my own driver for it. Now I'm a little bit stuck, because I don't even know where sound drivers run. I could imagine that they run in kernel space and I have to write them as "regular" kernel drivers. But I could also imagine that they are build into ALSA and I have to look at the ALSA API. Where is a good starting point to search how to start doing this.


title: Debian 6: media keys in gnome-settings-daemon don't work

text: I am running a minimal Debian 6 x86_64 setup with `pulseaudio`, `alsa` and `gnome-settings-daemon`. Whenever I press a media key, `gnome-settings-daemon` spits the following out to `stderr`:               ** (gnome-settings-daemon:4205): CRITICAL **: acme_volume_get_volume: assertion             `acme_volume_open(self)' failed      How can I avoid this issue?


title: Create Ubuntu USB-Installer from Debian

text: I have Debian Squeeze and want to create USB flash drive for install Ubuntu 11.04. I've already tried many ways:   1. boot.img.gz + mini.iso at drive's root + syslinux = installer "couldn't found installer iso"   2. boot.img.gz + extract mini.iso to drive's root + syslinux + replace original syslinux.cfg by isolinux.cfg from mini.iso = "invalid keyword in syslinux.cfg" error   3. extract normal CD iso to drive's root + grub = black screen with blinking cursor   4. UnetBootIn from repos + normal CD iso = screen with many vertical color lines At the moment I'm waiting until usb-creator.exe (launched from Windows) finish. Could you explain the right way to create Ubuntu USB-installer from Debian?


title: Finding and reloading driver from kernel

text: I am using Crunchbang 64 bit O.S. with a ASUS N150 wireless adapter. Everytime I close my laptop and it enters sleep mode, when I "wake it up" I am unable to connect back using the wireless adapter, I have to restart. My questions are:   1. Is there a way to find the specific driver name? I know its an ASUS N150 adapter with a realtek chipset   2. How can I reload the driver for the adapter without resetting the system.    3. How can I find my current kernel version via terminal (sidenote)


title: Sorting by one column then the

text: Say i have a output file with following:               010513  08:04   ROUTER1   192.168.1.1   68.130.5.10  HIT(1)     010513  08:04   ROUTER1   172.168.1.1   28.130.5.10  HIT(1)     010513  08:04   ROUTER1   122.168.1.1   168.130.5.10  HIT(1)     010513  08:04   ROUTER1   192.168.1.1   18.130.5.10  HIT(1)     010513  08:04   ROUTER1   152.168.1.1   58.130.5.10  HIT(1)     010513  08:04   ROUTER1   142.168.1.1   10.130.5.10  HIT(1)      I'm trying to sort with the 4th column followed by 5th and having highlighted colors would work too as my true output file has about 20 columns. Tried using various grep | sort commands and having difficulty getting this to work without running my result file a few times. I dont script so I am sure there is one out there but thought I would ask if there are a combo command/variables I can try.


title: How to change cron shell (sh to bash)?

text: Is it possible to make commands in crontab run with bash instead of sh? I know you can pass commands to bash with `-c`, but that's annoying and I never use sh anyway.


title: Removing second colon

text: Trying to create a simple script that lists mass mailing by the queue number that appears in /var/log/maillog. I'm starting off with this:               [root@ditirdlns01 ~]# lsMails(){ grep -i "$1-bounces@xxx.edu" /var/log/maillog | cut -f1-2,4 -d: ;}     [root@ditirdlns01 ~]#      Which yields:               [root@ditirdlns01 ~]# lsMails systems     Jul  1 15:12: AF649479A     Jul  1 15:14: 024682F59     Jul  1 15:14: 067A447B9     Jul  1 15:14: 0A3EA479A     Jul  1 15:14: 0DCBE5010     Jul  1 15:21: 97DAB2F59     Jul  1 15:24: D1D9B2F59      Which is perfectly alright except I want to get rid of the second colon (which in the log is what separates the minute from second, obviously. I actually don't want the second to be visible to users so cropping it out works for me). I tried piping it through sed looking for a colon preceded by a number with a space afterwards but I get identical results as before:               [root@ditirdlns01 ~]# lsMails(){ grep -i "$1-bounces@xxx.edu" /var/log/maillog | cut -f1-2,4 -d: | sed 's/([0-9]):\s+/ /g';}     [root@ditirdlns01 ~]# lsMails systems     Jul  1 15:12: AF649479A     Jul  1 15:14: 024682F59     Jul  1 15:14: 067A447B9     Jul  1 15:14: 0A3EA479A     Jul  1 15:14: 0DCBE5010     Jul  1 15:21: 97DAB2F59     Jul  1 15:24: D1D9B2F59      My specific question is: Why is `([0-9])` not matching a digit without including it in the result?


title: How to check the cpu temperatures core by core?

text: I have a Phenom X3-8450e which has a total of 3 cores. But when i ran "sensors" on a terminal this is what i get. > **user@PC ~ $ sensors** > >> atk0110-acpi-0   >  Adapter: ACPI interface   >  Vcore Voltage: +0.99 V (min = +0.85 V, max = +1.60 V)   >  +3.3 Voltage: +3.38 V (min = +2.97 V, max = +3.63 V)   >  +5 Voltage: +5.02 V (min = +4.50 V, max = +5.50 V)   >  +12 Voltage: +11.98 V (min = +10.20 V, max = +13.80 V)   >  CPU FAN Speed: 1985 RPM (min = 600 RPM, max = 7200 RPM)   >  CHASSIS FAN Speed: 0 RPM (min = 600 RPM, max = 7200 RPM)   >  POWER FAN Speed: 0 RPM (min = 600 RPM, max = 7200 RPM)   >  CPU Temperature: +32.0°C (high = +60.0°C, crit = +95.0°C)   >  MB Temperature: +27.0°C (high = +45.0°C, crit = +95.0°C) As you can see it only displays "CPU Temperature: +32.0°C" but i would like to know the individual temperature or each core. How do i do that?   Thanks.


title: /etc/ld.so.conf doesn't contain /usr/lib

text: I am using `pkg-config` to help supply the correct libs during c++ compilation. As I understand it, it searches in directories supplied by `/etc/ld.so.conf`. My `ld.so.conf` references the following lib locations via an include directive pointing to `/etc/ld.so.conf.d/*.conf`:               /usr/local/lib     /lib/x86_64-linux-gnu     /usr/lib/x86_64-linux-gnu      Problem is the library I need is under `/usr/lib` by default. Can I just add in this path to `/etc/ld.so.conf` myself or move the library or what is the recommended practice?


title: How can I cat the contents of files found using find into a single file?

text: I managed to shoot myself where it hurts (really bad) by reformatting a partition that held valuable data. Of course it was not intentional, but it happened. However, I managed to use `testdisk` and `photorec` to recover most of the data. So now I have all that data distributed over almost 25,000 directories. Most of the files are .txt files, while the rest are image files. There are more than 300 .txt files in each directory. I can `grep` or use `find` to extract certain strings from the .txt files and output them to a file. For example, here's a line that I've used to verify that my data is in the recovered files:               find ./recup*/ -name '*.txt' -print | xargs grep -i "searchPattern"      I can output "searchPattern" to a file, but that just gives me that pattern. Here's what I really would like to accomplish: Go through all the files and look for a specific string. If that string is found in a file, cat ALL the contents of that file to an output file. If the pattern is found in more than one file, append the contents of subsequent files to that output file. Note that I just don't want to output the pattern I'm searching for, but ALL the contents of the file in which the patterns is found. I think this is doable, but I just don't know how to grab all the contents of a file after grepping a specific pattern from it.


title: Sendmail cannot write /var/spool/mail/root

text: I have a problem with sendmail (postfix is not installed) in my CentOS, the file **/var/spool/mail/root** is missing, I have tried to restart sendmail and send mail from shell with:               mail -s "test mail" root </dev/null      /var/log/mailllog:               Apr  1 10:30:14 ip-172-31-41-71 sendmail[20477]: s31AUEPJ020477: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=302     19, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (s31AUEN9020478 Message accepted for delivery      I also tried to create root file but nothing is written after test email is sent.


title: How to start XTerm with prompt at the bottom?

text: When starting XTerm the prompt starts at the first line of the terminal. When running commands the prompt moves down until it reaches the bottom, and from then on it stays there (not even `Shift`-`Page Down` or the mouse can change this). Rather than have the start of the terminal lifetime be "special" **the prompt should always be at the bottom of the terminal.** Please note that I have a multi-line prompt. Of course, it should otherwise work as before (resizeable, scrollable, no unnecessary newlines in the output, and no output mysteriously disappearing), so `PROMPT_COMMAND='echo;echo;...'` or similar is not an option. The solution ideally should not be shell-specific. **Edit:** The current solution, while working in simple cases, has a few issues:   * It's **Bash specific**. An ideal solution should be portable to other shells.   * It **fails if other processes modify`PS1`**. One example is virtualenv, which adds `(virtualenv)` at the _start_ of `PS1`, which then always disappears just above the fold.   * **`Ctrl` -`l` now _removes_ the last page of history.** Is there a way to avoid these issues, short of forking XTerm?


title: Forward Only Email Server

text: I have a custom domain (I'll use the real domains cause I'm desperate at this point :) ) www.grantorino.io, and I want to forward all email addresses sent to yehiasalam@grantorino.io to yehia.asalam@gmail.com. I followed the logical steps but I can't seem to get it right. This is what I did so far:   1. Map the MX record to the grantorino server, ![dig](http://i.stack.imgur.com/PeF5l.png) a dig command shows that the mx have no problems, and that mail.grantorino.io maps correctly to my server.   2. Next step is allowing port 25 on the firewall settings, so it's now open to accept TCP connections from port 25![Webmin Firewall Settings](http://i.stack.imgur.com/Jds1P.png)   3. Make Sendmail forward any mails from yehiasalam@grantorino.io to yehia.asalam@gmail.com. I started with allowing the virtuser feature, an excerpt from sendmail.mc FEATURE('virtusertable', 'hash -o /etc/mail/virtusertable.db')dnl   4. The virtusertable I added yehiasalam@grantorino.io yehia.asalam@gmail.com and compiled using `makemap hasg virtusertable.db < virtusertable`   1. Also in the access file I added  Connect:grantorino.io RELAY and compiled using `makemap hash access < access.db`   1. Finally in the sendmail.c I changed the DEAMON_OPTIONS line to  DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp')dnl Thats pretty much it. I'm not sure whether I should do something more. The problem right now is that I'm not getting any emails forwarded. This is the tail of maillog, after a couple of minutes of sending an email to yehiasalam@grantorino.io. As you can see I'm not getting any activity at all. Please advise.![enter image description here](http://i.stack.imgur.com/gcsVi.png)


title: Is Gnome being discontinued, in 2014?

text: I heard that Gnome was being or has been discontinued? What does this mean, in a distro? Do I have to switch to another environment? Is it recommended that I do? What exactly happens here? Can I stay?


title: Skype does not appear in panel (elementaryOS 0.2)

text: I had removed skype panel icon with this method : http://askubuntu.com/questions/7479/how-can-i-remove-the-skype-panel-icon-in- ubuntu-12-04-and-earlier/118979#118979 It worked fine, and I was using skype-wrapper to have skype in my messaging menu.. Then skype-wrapper has stopped working and I wanted to have my skype icon back.. I have reinstalled sni-qt (I never removed it but anyway I did reinstall it.) and I have reinstalled skype too (following this link :http://askubuntu.com/questions/68616/i-installed-sni-qt-and-there-is-no- indicator-for-skype-how-do-i-fix-this) but it didn't do anything.. (I will add that I don't need to whitelist it in dconf editor because I'm using elementaryOS Luna 2.0 and doesn't have a whitelist but a blacklist (which I have checked)) What package sould I add or update ? I tried to update QT libraries unsuccessfully.. Cheers! ElementaryOS 2.0 Luna, based on Ubuntu 12.04


title: bridge does not forwarding packets centos

text: I am using CentOS 6.5 64 and use xen to create a virtual machine (CentOS) **ifconfig**               [root@CentOS ~]# ifconfig     eth0      Link encap:Ethernet  HWaddr 08:00:27:54:B3:FA               inet6 addr: fe80::a00:27ff:fe54:b3fa/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:10087 errors:0 dropped:0 overruns:0 frame:0               TX packets:6094 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:763616 (745.7 KiB)  TX bytes:541789 (529.0 KiB)          lo        Link encap:Local Loopback               inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:65536  Metric:1               RX packets:5 errors:0 dropped:0 overruns:0 frame:0               TX packets:5 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)          vif2.0    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF               inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:32 errors:0 dropped:0 overruns:0 frame:0               TX packets:3969 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:32               RX bytes:2088 (2.0 KiB)  TX bytes:267825 (261.5 KiB)          xenbr0    Link encap:Ethernet  HWaddr 08:00:27:54:B3:FA               inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0               inet6 addr: fe80::a00:27ff:fe54:b3fa/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:9896 errors:0 dropped:0 overruns:0 frame:0               TX packets:1892 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:613149 (598.7 KiB)  TX bytes:284945 (278.2 KiB)      **brctl show**               [root@CentOS ~]# brctl show     bridge name     bridge id               STP enabled     interfaces     xenbr0          8000.08002754b3fa       yes             eth0                                                             vif2.0      **xl network-list**               [root@CentOS ~]# xl network-list xc     Idx BE Mac Addr.         handle state evt-ch   tx-/rx-ring-ref BE-path     0   0  00:16:3e:22:4f:4b     0     4     10   768/769         /local/domain/0/backend/vif/2/0      **brctl showmacs xenbr0**               [root@CentOS ~]# brctl showmacs xenbr0     port no mac addr                is local?       ageing timer       2     00:16:3e:22:4f:4b       no                89.35       1     00:1e:8c:19:62:67       no                 0.00       1     00:22:6b:fe:b9:36       no                 4.92       1     08:00:27:54:b3:fa       yes                0.00       1     90:c1:15:c4:89:6d       no                25.00       1     e0:2a:82:3d:c0:c5       no                 3.78       2     fe:ff:ff:ff:ff:ff       yes                0.00      **Ping** ping the virtual machine from same host               [root@CentOS ~]# ping 192.168.1.120     PING 192.168.1.120 (192.168.1.120) 56(84) bytes of data.     64 bytes from 192.168.1.120: icmp_seq=1 ttl=64 time=2.78 ms     64 bytes from 192.168.1.120: icmp_seq=2 ttl=64 time=0.916 ms     64 bytes from 192.168.1.120: icmp_seq=3 ttl=64 time=0.917 ms     ^C     --- 192.168.1.120 ping statistics ---     3 packets transmitted, 3 received, 0% packet loss, time 2370ms     rtt min/avg/max/mdev = 0.916/1.538/2.782/0.879 ms      ping the virtual machine from a device in local network               C:\Users\motaz>ping 192.168.1.120          Pinging 192.168.1.120 with 32 bytes of data:     Request timed out.     Request timed out.     Request timed out.      **iptables**               [root@CentOS ~]#  iptables -L -v     Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination        11   700 ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED         0     0 ACCEPT     icmp --  any    any     anywhere             anywhere         0     0 ACCEPT     all  --  lo     any     anywhere             anywhere         0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere            state NEW tcp dpt:ssh         0     0 REJECT     all  --  any    any     anywhere             anywhere            reject-with icmp-host-prohibited          Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination         0     0 ACCEPT     all  --  any    any     anywhere             anywhere            PHYSDEV match --physdev-is-bridged         0     0 REJECT     all  --  any    any     anywhere             anywhere            reject-with icmp-host-prohibited          Chain OUTPUT (policy ACCEPT 8 packets, 864 bytes)      pkts bytes target     prot opt in     out     source               destination      Any one who can give me an idea to solve this, i'll be grateful. **brctl showstp xenbr0**               [root@CentOS images]# brctl showstp xenbr0     xenbr0      bridge id              8000.080027798267      designated root        8000.080027798267      root port                 0                    path cost                  0      max age                  20.00                 bridge max age            20.00      hello time                2.00                 bridge hello time          2.00      forward delay             2.00                 bridge forward delay       2.00      ageing time             300.00      hello timer               0.65                 tcn timer                  0.00      topology change timer     0.00                 gc timer                 109.38      hash elasticity           4                    hash max                 512      mc last member count      2                    mc init query count        2      mc router                 1                    mc snooping                1      mc last member timer      1.00                 mc membership timer      260.00      mc querier timer        255.00                 mc query interval        125.00      mc response interval     10.00                 mc init query interval    31.25      flags               eth0 (0)      port id                0000                    state                forwarding      designated root        8000.080027798267       path cost                  4      designated bridge      8000.080027798267       message age timer          0.00      designated port        8001                    forward delay timer        0.00      designated cost           0                    hold timer                 0.00      mc router                 1      flags


title: Installing Elementary Isis beta

text: How can I install Elementary OS Isis Beta? I tried to made a bootable stick using the latest iso builds but for some reason I cannot login. Having elementary OS installed on my machine, how can I update every day to the latest build? I want to update to elementary OS Isis and to be up-to-date even it is unstable.


title: How do I delete a partial package in OpenBSD

text: While upgrading, I tried to add a package that was already there and due to some error, a partial package got created - partial-gnutls. When I try to delete this partial package, I get these errors:               File /usr/local/share/locale/cs/LC_MESSAGES/pkg.qX9SMkCPZb does not exist                                                                 File /usr/local/share/locale/de/LC_MESSAGES/pkg.Dfpr8PbT3X does not exist                                                                 File /usr/local/share/locale/en@boldquot/LC_MESSAGES/pkg.wIH7fQJbhK does not exist                                                        File /usr/local/share/locale/en@quot/LC_MESSAGES/pkg.c8llMmPSGl does not exist                                                            Read failed: Input/output error at /usr/libdata/perl5/OpenBSD/md5.pm line 59                I checked the source code. It is some coe that adds a file into some data structure (most probably, it is finding out which files to delete) and it fails to do so because the file is no longer there. How do I get rid of this partial package?


title: Change the number of rows and columns in the TTY

text: I want to resize the terminal which comes up when you press `Ctrl``Alt``F1` (or `F2`,`F3`,...). 25x80 is small for a 24" screen. Tried using stty, but the commands `stty columns 200` and `stty rows 50` does not work directly. Am I missing something OR is this a wrong approach. Ideally looking for a generalized solution, but would be content with something that works in RHEL5 and Ubuntu. It would be better if its possible using some commands which I can put in a script file rather than changing some boot-level stuff.


title: Setting up a family server

text: I'm very new to Unix, but after having become comfortable with bash over the past year and after having played with Ubuntu recently, I've decided to make my next computer run Ubuntu, and I think my wife is on board for her next computer as well. Is it easy to set up a central family server so that each computer acts as a client for the information that is stored only in a single place? What are the options? Are there any online how-to documents for this?


title: Running continuous jobs remotely

text: I'm new to Linux, and I'm probably asking a fairly basic question. How do I run a continuous program on Linux? Basically, I have a program that will continuously check for content on a website. This program will be executing for several days. I do not have administrative privileges on the computer I wish to run this program on, and I do not have exclusive access to this computer either, meaning that other users can log on physically. Moreover, barring some untold disaster, the computer will be running for the entire duration of my program. I know that I can SSH into the machine and run the program. However, this is not desirable as I would need a second machine to do it (which kind of defeats the point of what I'm doing), not to mention timeout issues. Is there a way I can run my program on the computer remotely without establishing a connection of some sort after I get it started?


title: Is there a way to set the size of the history list in bash to more than 5000 lines?

text: No matter how much I set the `HISTSIZE` environment variable to be larger than 5000, when printing the history list with the `history` builtin, it prints only the last 5000 commands. I need that because I often have a large `.bash_history` which exceeds 5000 lines, and sometimes one needs to address an early command by pressing `Ctrl-R`, but if that command is more than 5000 commands earlier, I can't access it using that mechanism. I know I can use `grep` on the `.bash_history`, but I think the `Ctrl-R` mechanism would be much more faster (and convenient). I use gnu bash version 4.1. That is the full content of my .bashrc file:                   #!/bin/bash         # ~/.bashrc: executed by bash(1) for non-login shells.         # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)         # for examples              # If not running interactively, don't do anything         [ -z "$PS1" ] && return              # don't put duplicate lines in the history. See bash(1) for more options         # ... or force ignoredups and ignorespace         #HISTCONTROL=ignoredups:ignorespace:erasedups              # append to the history file, don't overwrite it         shopt -s histappend              # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)         HISTSIZE=50000         HISTFILESIZE=500000              # check the window size after each command and, if necessary,         # update the values of LINES and COLUMNS.         shopt -s checkwinsize              # make less more friendly for non-text input files, see lesspipe(1)         [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"              # set variable identifying the chroot you work in (used in the prompt below)         if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then             debian_chroot=$(cat /etc/debian_chroot)         fi              # set a fancy prompt (non-color, unless we know we "want" color)         case "$TERM" in             xterm-color) color_prompt=yes;;         esac              # uncomment for a colored prompt, if the terminal has the capability; turned         # off by default to not distract the user: the focus in a terminal window         # should be on the output of commands, not on the prompt         #force_color_prompt=yes              if [ -n "$force_color_prompt" ]; then             if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then             # We have color support; assume it's compliant with Ecma-48             # (ISO/IEC-6429). (Lack of such support is extremely rare, and such             # a case would tend to support setf rather than setaf.)             color_prompt=yes                  else             color_prompt=                  fi         fi              if [ "$color_prompt" = yes ]; then             PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\         [\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '         else             PS1='${debian_chroot:+($debian_chroot)}\@-\u@\h:\w\$ '         fi         unset color_prompt force_color_prompt              # If this is an xterm set the title to user@host:dir         case "$TERM" in         xterm*|rxvt*)             PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"             ;;         *)             ;;         esac              # enable color support of ls and also add handy aliases         if [ -x /usr/bin/dircolors ]; then             test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval    "$(dircolors -b)"             alias ls='ls --color=auto'             #alias dir='dir --color=auto'             #alias vdir='vdir --color=auto'                  alias grep='grep --color=auto'             alias fgrep='fgrep --color=auto'             alias egrep='egrep --color=auto'         fi              # some more ls aliases         alias ll='ls -alF'         alias la='ls -A'         alias l='ls -CF'              # Alias definitions.         # You may want to put all your additions into a separate file like         # ~/.bash_aliases, instead of adding them here directly.         # See /usr/share/doc/bash-doc/examples in the bash-doc package.              if [ -f ~/.bash_aliases ]; then             . ~/.bash_aliases         fi              # enable programmable completion features (you don't need to enable         # this, if it's already enabled in /etc/bash.bashrc and /etc/profile         # sources /etc/bash.bashrc).         if [ -f /etc/bash_completion ] && ! shopt -oq posix; then             . /etc/bash_completion         fi


title: Not see file NetworkManager.conf in folder /etc/NetworkManager/

text: My network connectivity often gets interrupted when I use the local DNS server at the company, I wanted to change `dns=dnsmasq` to `#dns=dnsmasq` in `/etc/NetworkManager/NetworkManager.conf`. But I do not see a **NetworkManager.conf**. I'm using Ubuntu 12.04.


title: Difference between Gnome3 and Gnome-shell

text: What is the difference between gnome3 and gnome-shell, if any?


title: Becoming root from inside Vim

text: Sometimes I start editing configuration files in `/etc` using Vim, but forget to use `sudo` to start Vim. The inevitable result then is that after finishing my edits I encounter the dreaded notice that I don't have the permission to save the file. Mostly the edits are small enough that I just exit Vim and do the whole thing again as root. I could of course save to a location I can write to and then copy as root, but that is also somewhat annoying. But I'm sure there is an easier way to become root or use `sudo` from inside Vim, without having to discard the changes. If the method would not rely on `sudo` being set up for the user that would be even better.


title: Forcing Skype window resize (under Gnome)

text: Using Skype 2.2 on Linux, the video which is reproduced seems to be limited to 320x240; the default options to resize the window are disabled. Is there a way to force a resize of this window? Just integer scale would be acceptable (eg. 2x only)...


title: How do ${0##*/} and ${0%/*} work?

text: I'm quite confused about the following regular expressions I found in a shell script:               ${0##*/}     ${0%/*}      How do they work?


title: Expansion of *,#,% - What do they mean?

text: for j in * .* ; do          cp $j ../$name-S$i.gid/${j%%. * }$i.${j#*.}     done      Could someone tell me what this for loop does? What do `*`, `%` and `#` mean? (`$name` is a path of a directory in which there are `-S1.gid` ... `-Sn.gid` directory)


title: How does the syntax "${foo##*.}" work to get file extensions?

text: Why does this command work in successfully retrieving file extension name?               file_ext=${filename##*.}


title: What does this syntax mean "${i%.avi}.mp4"

text: > **Possible Duplicate:**   >  How do ${0##*/} and ${0%/*} work? I have encountered this type of syntax somewhere on the web :               for i in *.avi     do          ffmpeg -i "$i" "${i%.avi}.mp4"     done      how does this `"${i%.avi}.mp4"` and how can I use it ?


title: What can I know about this part of code?

text: What does this part of a script do? This is a part of a scrpt in bash               for j in *.* ; do          cp $j ../../$name-S$i.gid/data/${j%%.*}$i.${j#*.}         sed "s/$name-S/$name-S$i/" $j > ../../$name-S$i.gid/data/${j%%.*}$i.${j#*.}     done      I forgot to say that "i", is a parameter that goes from 1 to specific number and "$name" is a part of name of a folder.


title: Explain this bash script: echo "${1##*.}"

text: Consider the following bash script:               #!/bin/bash     echo "${1##*.}"       This script prints the extension of a file if the file name is supplied as the first command line argument, something like following:               $ ./script.sh ./file.pdf      In the above case `pdf` is printed. Please explain how the expression `${1##*.}` is able to extract the extension of the file. (I understand what $0, $1, $2, $# do in bash and also understand about regular expressions to some extent)


title: What does "${x%% *}" mean in sh?

text: I just saw "$${x%% *}" in a makefile, which means "${x%% *}" in sh. Why it is written in this way ? how can a makefile detect whether a command is available in the local machine?               determine_sum = \             sum=; \             for x in sha1sum sha1 shasum 'openssl dgst -sha1'; do \               if type "$${x%% *}" >/dev/null 2>/dev/null; then sum=$$x; break; fi; \             done; \             if [ -z "$$sum" ]; then echo 1>&2 "Unable to find a SHA1 utility"; exit 2; fi          checksums.dat: FORCE         $(determine_sum); \         $$sum *.org


title: Special Parameter query - multiple used to obtain command name?

text: In a uni text provided us to cover bash scripting, the following variable assignment has got be stumped and I've yet to get an answer back from anyone, hence hopefully someone on here can help.               name=${0##*/}        This should expand to provide the name of the command entered. I can see how this is taken from argument $0, as the first character in the braces is 0. However, according to the information on the previous page (of said uni doc) and to sources I've looked at on the web so far, # means the number of arguments the script was called with, and * contains the argument as a string. I just can't understand how these all of these special parameters are expanding only to argument $0. I'd expect the name to expand to: code/script2 3 3 code/script2 fred george allison. I'd really appreciate it if someone could explain what each of the special parameters between the braces is doing in order to expand to the name: code/script2 Thanks for your help in advance! Below is the entire script and output for context:               1  #!/bin/bash     2  # A simple script showing some of the special variables     3     4 echo "The full name of this script is $0"      5     6 name=${0##*/}     7     8 echo "The name of this script is $name"     9     10 echo "The process ID of this script is $$"     11     12 echo "This script was called with $# parameters" 13     14 echo "The parameters are \"$*\""     16  echo "Parameter 1 is - $1"     17  echo "Parameter 2 is - $2"     18  echo "Parameter 3 is - $3"          prompt: code/script2 fred george allison     The full name of this script is code/script2      The name of this script is script2     The process ID of this script is 3501     This script was called with 3 parameters The parameters are "fred george allison"     Parameter 1 is - fred     Parameter 2 is - george     Parameter 3 is - allison


title: Can I filter how often cron emails me?

text: I have a few cronjobs and one of them is run every minute. I had to take a website down for two hours and it caused an error on that one specific cronjob and I got almost 120 emails in those two hours until I was done upgrading the site. Now lets say I was asleep and something happened. I don't want hundreds to thousands of emails because one cron job ran every minute and failed. Is there something I can do to limit how often it emails me while allowing it to run every minute? PS: We dont have smtp servers, we use a 3rd party so I am glad nothing was marked as spam and disabled.


title: How to assign values to multiple variables in command line with bars

text: I am essentially trying to assing certain portions of the output of a shell command to mulitple variables, but I don't know how to do that. For simplicity's sake, assume that the command on the shell, when executes, prints               one two three four      which can be simulated with a               echo "one two three four"      (although the actual comannd is different) Now, I'd like to assign the second and fourth word of the output (in this case _two_ and _four_ ) to the variables _w1_ and _w2_. I thought I could use the _read_ command like so:               echo "one two three four" | awk '{print $2 " " $4}' | read w1 w2      but this doesn't work, probably because the _read_ command is executed in a sub-process. So, how would I go about to achieve what I am after?


title: IP rule for IPv6

text: When I try to add an IP rule for IPv6 on my Linux system, it errors out:               $ ip -6 rule add fwmark 0xfab lookup 0xf     RTNETLINK answers: Address family not supported by protocol      I checked out the IP rule code; it issues a netlink message to the kernel. Probably I need to load some module, but I don't know which. What do I need to do to fix this? I am using linux 2.6.37.3 built from kernel sources Solution: By default linux build doesn't support multiple routing tables for IPv6. You need to enable CONFIG_IPV6_MULTIPLE_TABLES for multiple IPv6 routing table support.


title: Is there a way to modify a file in-place?

text: I have a fairly large file (35Gb), and I would like to filter this file in situ (i.e. I don't have enough disk space for another file), specifically I want to grep and ignore some patterns — is there a way to do this without using another file? Let's say I want to filter out all the lines containing `foo:` for example...


title: How to kill a daemon with its name gracefully?

text: I usually kill a process with `killall`.               killall markdoc      But I can't sure this command terminates the process gracefully. Does this command graceful termination? If it's not, how can I kill a process with its name gracefully?


title: Selecting the right GRUB

text: I've just installed Backtrack on my harddrive (got one), i also got Fedora and Windows 7. However, now i get the Backtrack-GRUB instead of my Fedora GRUB. How do i change that? I got a sda5 containing my Fedora GRUB so it should be easy to 'rewire' - i don't know how tho.