title: SLES find what repo provides a package

text: I need to find out what repo 'git-core' comes from.               $ zypper search git-core     Refreshing service 'nu_novell_com'.     Removing repository 'SLE11-WebYaST-SP1-Pool' [done]     Removing repository 'SLE11-WebYaST-SP1-Updates' [done]     Adding repository 'SLES11-SP2-Updates' [done]     Adding repository 'SLE11-WebYaST-SP2-Pool' [done]     Adding repository 'SLES11-SP2-Extension-Store' [done]     Adding repository 'SLES11-SP2-Core' [done]     Adding repository 'SLE11-WebYaST-SP2-Updates' [done]     Adding repository 'SLE11-SP2-Debuginfo-Core' [done]     Adding repository 'SLE11-SP2-Debuginfo-Updates' [done]     Retrieving repository 'SLES11-SP2-Core' metadata [done]     Building repository 'SLES11-SP2-Core' cache [done]     Retrieving repository 'SLES11-SP2-Extension-Store' metadata [done]     Building repository 'SLES11-SP2-Extension-Store' cache [done]     Retrieving repository 'SLES11-SP2-Updates' metadata [done]     Building repository 'SLES11-SP2-Updates' cache [done]     Loading repository data...     Reading installed packages...          S | Name     | Summary        | Type     --+----------+----------------+--------     i | git-core | Core git tools | package      Searching the man pages for zypper, it seems like 'what-provides' would provide this information. It just says "System Packages".               $zypper what-provides git-core     Refreshing service 'nu_novell_com'.     Loading repository data...     Reading installed packages...     S | Name     | Type    | Version        | Arch   | Repository     --+----------+---------+----------------+--------+------------------------------------------------------------------     v | git-core | package | 2.0.0-201.1    | x86_64 | Software configuration management (SLE_11_SP2)     v | git-core | package | 1.6.0.2-7.31.2 | x86_64 | SUSE-Linux-Enterprise-Software-Development-Kit-11-SP2 11.2.2-1.66     v | git-core | package | 2.0.0-201.1    | i586   | Software configuration management (SLE_11_SP2)     i | git-core | package | 1.8.4-165.1    | x86_64 | (System Packages)      These are the repos that exist.               ls /etc/zypp/repos.d/     nu_novell_com:SLE11-SP2-Debuginfo-Core.repo     nu_novell_com:SLES11-SP1-Pool.repo     nu_novell_com:SLE11-SP2-Debuginfo-Updates.repo  nu_novell_com:SLES11-SP1-Updates.repo     nu_novell_com:SLE11-WebYaST-SP2-Pool.repo       nu_novell_com:SLES11-SP2-Core.repo     nu_novell_com:SLE11-SP1-Debuginfo-Pool.repo     nu_novell_com:SLE11-WebYaST-SP2-Updates.repo    nu_novell_com:SLES11-SP2-Extension-Store.repo     nu_novell_com:SLE11-SP1-Debuginfo-Updates.repo  nu_novell_com:SLES11-Extras.repo                nu_novell_com:SLES11-SP2-Updates.repo      On CentOS I would run a `repoquery` or `yum info`. How can I tell which repo git 1.8.4 comes from on sles? **Update** I fixed this by using a SLES 11 SP2 image instead of SLES 11 SP1. Leaving question open if someone can still answer the question.


title: Creating a proFTPd user

text: I'm setting up a proFTPd server so I can upload files to my webserver, but I've never tried this before. I've installed `proftpd`, added a user with a home folder: `/home/FTP-shared` and added `/bin/false` shell to it as well. But what do I do configuration-wise now in `proftp` to be able to login with this user, and up and download, delete and so on? And my idea was to symlink to Apache `www` folder from the ftp user directory? Will that work?


title: Filesystem organization for software in HOME

text: When installing software in `$HOME`, how do the linux filesystem hierarchy directories map to subdirectories of `$HOME`? I am asking this question so that I can write a build system that picks reasonable default paths for a user install. The build system infrastructure is Haskell-specific (Cabal) but the installed files include C++ headers and libraries, for which Cabal doesn't have a default install path.


title: Writing both output and error stream to the same file

text: In Unix/Linux you can use pipes to write output and error streams to a file. One can even write them to the same file. Is there a way to write both to the file but maintaining the order. This statement:               swipl -s jobshop.chr < CHRInput > output 2> output      indeed produces a file called "output" with both the output and error stream (normally this was the console interaction with the user). But the output stream is written before the error stream (while working with an interactive console will produce error and output streams interleaved).


title: can you recover lvm metadata without access to /etc/lvm/?

text: I just installed Manjaro on to a externalized usb hard drive. After I was done, I tried to boot from my previously working **Mint** distro (no full-disk luks) on my internal hard drive. The lvm volume groups had disappeared!?                   [crow ~]$ sudo lvm vgscan         [sudo] password for crow:           Reading all physical volumes.  This may take a while...           Found volume group "ManjaroVG" using metadata type lvm2         [crow ~]$ sudo pvscan           PV /dev/mapper/cryptManjaro   VG ManjaroVG   lvm2 [465.51 GiB / 0    free]           Total: 1 [465.51 GiB] / in use: 1 [465.51 GiB] / in no VG: 0 [0   ]         [crow ~]$ sudo fdisk -l /dev/sdb              Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors         Units: sectors of 1 * 512 = 512 bytes         Sector size (logical/physical): 512 bytes / 512 bytes         I/O size (minimum/optimal): 512 bytes / 512 bytes         Disklabel type: dos         Disk identifier: 0x00079473              Device     Boot  Start       End   Sectors   Size Id Type         /dev/sdb1  *      2048    499711    497664   243M 83 Linux         /dev/sdb2       501758 976771071 976269314 465.5G  5 Extended         /dev/sdb5       501760 976771071 976269312 465.5G 8e Linux LVM              [crow ~]$ sudo pvs         [sudo] password for crow:           PV                       VG        Fmt  Attr PSize   PFree           /dev/mapper/cryptManjaro ManjaroVG lvm2 a--  465.51g    0         [crow ~]$ sudo pvdisplay           --- Physical volume ---           PV Name               /dev/mapper/cryptManjaro           VG Name               ManjaroVG           PV Size               465.51 GiB / not usable 2.00 MiB           Allocatable           yes (but full)           PE Size               4.00 MiB           Total PE              119170           Free PE               0           Allocated PE          119170           PV UUID               B8f73k-Najv-6hVM-XxHm-Wk9F-zeZ9-69MsxN              [crow ~]$ sudo pvdisplay /dev/sdb5           Failed to find physical volume "/dev/sdb5"               [crow ~]$ sudo file -s /dev/sdb5          /dev/sdb5: data      I have switched the disks around and now the non-working disk is `/dev/sdb`. I have read that there is meta data backup in `/etc/lvm` which is of course inside `/dev/sdb5` and not `/boot` at `/dev/sdb1`. I would like to see a better answer for this. * * * If there is not a way to restore the disks then what are my options? Are these among them?   * Are there any forensics tools that can give access to the data?   * Another thing is the partition scheme was the standard linux Mint. If I reinstalled Mint could the new meta-data be used to try to recover the old?


title: Show video files with its size

text: I need all the `.mp4` files' dimensions to be printed with the file name. For example:               1_VIDEO.mp4 1204x680


title: Can we switch desktop ( GNOME, KDE, etc ) within linux?

text: I started using linux mint 13 mate yesterday. Although the words from their site is promising, I found it lack some ways for configuration. For example, I want to enlarge the scroll bar so that I can easily locate it ( I am using a trackball which doesn't come with a scroll wheel, so I need to drag the scroll bar in windows ). After looking up all the option in Control Center, I failed to found a solution. Can we switch to another desktop such as KDE?


title: Locked out of SSH on LAMP server but have SFTP access

text: I made a mistake in `/etc/sshd_config` so have locked myself out of my remotely hosted server running Centos 6. It's running Apache and I have FTP access to `/var/www` and I know the root password. To try to restore `sshd_config` I have tried creating a PHP page with a few `exec()` and `passthru()` commands - these run as user `apache`. I have tried:               echo "password" | su -c "cp -f sshd_config /etc/sshd/sshd_config"      but that didn't work. `expect` is not installed on the server. Does anyone know a way of resolving this?


title: Is VMWARE_BALLOON (Linux kernel option) intended for guests or hosts?

text: The kernel configuration option: > >     VMware Balloon Driver (VMWARE_BALLOON) [N/m/y/?] (NEW) ? >   >     CONFIG_VMWARE_BALLOON: >   > > This is VMware physical memory management driver which acts like a "balloon" > that can be inflated to reclaim physical pages by reserving them in the > guest and invalidating them in the monitor, freeing up the underlying > machine pages so they can be allocated to other guests. The balloon can also > be deflated to allow the guest to use more physical memory. > > If unsure, say N. > > To compile this driver as a module, choose M here: the module will be called > vmw_balloon. >   >   >     Symbol: VMWARE_BALLOON [=n] >     Type  : tristate >     Prompt: VMware Balloon Driver >       Defined at drivers/misc/Kconfig:428 >       Depends on: X86 [=y]   >       Location: >         -> Device Drivers >           -> Misc devices >   It's not fully clear, but it sounds like this should be set in the kernel of the guest OS, and not the host. Is this right?


title: SDcard support in Linux for ENE Flash UB6250 card reader (found on Acer Aspire One 522)

text: I have an Acer Aspire One 522 netbook for which I want to get the SDcard reader working, but I'm having trouble getting it to recognize the SDcard after it is inserted. I use Slackware and always compile my own kernels, so I have already enabled the `Device Drivers->MMC/SD/SDIO card support` option and respective kernel modules, compiled and properly installed the kernel and its modules (kernel version is 3.5.3). The card reader seems to get connected to the USB bus as soon as a SDcard is inserted, since `lsusb` only shows the reader after this event:               Bus 002 Device 005: ID 0cf2:6250 ENE Technology, Inc. SD card reader (UB6250)      I would normally expect to see a block device like `/dev/mmcblk0` and the card partitions (`/dev/mmcblk0p1`, `/dev/mmcblk0p2` and so on) after the card is inserted, but nothing shows up. Monitoring /var/log/messages while the card is inserted shows this:               Sep  8 14:43:41 aspire kernel: usb 2-2: USB disconnect, device number 5     Sep  8 14:43:44 aspire kernel: usb 2-2: new high-speed USB device number 6 using ehci_hcd     Sep  8 14:43:44 aspire kernel: usb 2-2: New USB device found, idVendor=0cf2, idProduct=6250     Sep  8 14:43:44 aspire kernel: usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=4     Sep  8 14:43:44 aspire kernel: usb 2-2: Product: UB6250            Sep  8 14:43:44 aspire kernel: usb 2-2: Manufacturer: ENE Flash       Sep  8 14:43:44 aspire kernel: usb 2-2: SerialNumber: 606569746801     Sep  8 14:43:44 aspire mtp-probe: checking bus 2, device 6: "/sys/devices/pci0000:00/0000:00:13.2/usb2/2-2"      Sep  8 14:43:44 aspire mtp-probe: bus: 2, device: 6 was not an MTP device      showing the reader being connected to the USB bus but with no block device being detected. Does anyone have any hints about this? Did I miss something or support for this reader is not completely functional yet? Thanks!


title: Can't install inkscape on Ubuntu?

text: I tried to install inkscape in my Ubuntu 14, but it doesn't exist. And when I install my ubuntu says that is already install, but when I put in the terminal $ inkscape it says that is necessary to install. It is confusion. See file below How can I fix this problem? ![enter image description here](http://i.stack.imgur.com/EqLXr.png)


title: Use convert or ghostscript to grab the odd-numbered pages of a PDF

text: I have a PDF that consists of several hundred pages of bilingual text. Since I need to use OCR on each language separately, I want to grab the even and odd pages and make two separate PDFs, using `convert` or `ghostscript`. The language I want to do first is on the odd-numbered pages. What `convert` or `ghostscript` command can I use to grab these and write them to a new file?


title: How to name network adapters created with virt-install?

text: In order to test preseeded installation, I want to create a virtual machine as close as possible to an actual server I use in production. The server has two network adapters: `p1p1` and `p2p1`. When creating a virtual machine with:               virt-install \         --connect=qemu:///system \         ...         --network=bridge:br0 \         --network=bridge:br0 \         ...      the network adapters are called `eth0` and `eth1`. Is there a way to name them `p1p1` and `p2p1` before installing an OS?


title: How to scp from server to server with different public keys?

text: What arguments would I use for the `scp` command on a server to server copy if the two servers need different ssh keys? I know how to scp files from a server to a server without having data flow on the PC (the one from which I issued the `scp` command). Based on this tutorial, my starting command looks something like this:               scp -r miguel@10.1.2.2:/home/miguel/ miguel@10.1.2.3:/home/miguel/


title: Are dropped packages in traffic control really dropped?

text: While having a slight timeout problem in my network (the router needed some rest, so that's solved) I found myself trying to decipher `tc -s` output, after noticing that the "dropped" values represented an important proportion of packages, of at least 10%:               qdisc cbq 1: root refcnt 2 rate 10Mbit (bounded,isolated) prio no-transmit      Sent 392050166 bytes **727491 pkt (dropped 27505** , overlimits 1201372 requeues 1)       backlog 0b 0p requeues 1        borrowed 0 overactions 0 avgidle 12500 undertime 0     qdisc sfq 10: parent 1:10 limit 127p quantum 1514b depth 127 divisor 1024 perturb 10sec       Sent 16125105 bytes 265435 pkt (dropped 0, overlimits 0 requeues 0)       backlog 0b 0p requeues 0      qdisc sfq 20: parent 1:20 limit 127p quantum 1514b depth 127 divisor 1024 perturb 10sec       Sent 375890855 bytes **461738 pkt (dropped 27505** , overlimits 0 requeues 0)       backlog 0b 0p requeues 0      qdisc sfq 30: parent 1:30 limit 127p quantum 1514b depth 127 divisor 1024 perturb 10sec       Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)       backlog 0b 0p requeues 0      qdisc ingress ffff: parent ffff:fff1 ----------------       Sent 342713979 bytes 716041 pkt (dropped 1308, overlimits 0 requeues 0)       backlog 0b 0p requeues 0 So, these counters represent really dropped package, _a la_ iptables? Or it's just a representation of something else? What represent this number? The manual says something about dropping, but it left me with the same doubt: > DESCRIPTION > > Tc is used to configure Traffic Control in the Linux kernel. Traffic Control > consists of the following: > > [...] > > DROPPING > > Traffic exceeding a set bandwidth may also be dropped forthwith, both on > ingress and on egress.


title: Formatting a floating point variable in a SED statement

text: As part of a makefile recipe, I want to repeatedly adjust a few lines in some text file `txt.in`. In particular, I want to update, among others, the third line which contains simply two numbers separated by a space. They should be formatted as `0.00 0.00`. As such, I've included the code below in my makefile to test whether I can do this.               # Makefile to test for-loop     SHELL=/bin/zsh          for:         for k in 1 2 3; do \             let n="$$k*0.25"; \             let m="$$n+0.25"; \             sed -i "3s/.*/$$n $$m/" txt.in; \         done      This yields `0.7500000000 1.0000000000` as the end result. There may be more efficient ways to do this and I'd be happy to find out about those, but the thing I'd really like to find out is if there's a way to get the format right.


title: How do I get just the user-manual for Vim

text: To get the vim user-manual I am doing               vi test      and then, once the file is opened, I do :help user-manual This opens up a split window, which makes reading manual inconvenient to read. How do I only open the user-manual in the full window ?


title: I changed my hostname, why is my bash PS1 prompt unchanged

text: I changed my hostname by editing /etc/hostname and can see the new hostname using the `hostname` and `hostname -F` commands. But the shell prompt is still showing the old hostname. This is Ubuntu 11.0.4 by the way. The prompt is set in my `.bashrc` which I have not edited. Logging out and even rebooting has no effect. Relevant section of the standard Ubuntu `.bashrc`:               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      ($debian_chroot is unset as I login...) I guess the hostname is picked up by the special character \h. Here's the PS1 setting as reported in the shell:               PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '      And here is what PS1 shows:               username@oldhostname:~$       I repeated the process using the exact command in Warren's answer. It turns out that the hostname works until reboot but then it is lost, even though `/etc/hostname` contains the new hostname.


title: local shutdown scripts (do's and don't's)

text: At work, I'm running linux, and use vagrant on a daily basis. What I find annoying is that the system often hangs when I reboot/shut down, if I forgot to `vagrant halt` any virtual boxes I may have fired up.   To counter this, I'd like to write a shutdown script, along the lines of:               #! /bin/sh     cd ~/vagrants/vagrant_1     vagrant halt     cd ../vagrant_2     vagrant halt     exit 0      However, for I'm not too sure if `~` will still be available to me, and even if it is, if the _home_ dir in question will always be the right one, and if the script will have access too it. So I thought I'd do:               #! /bin/sh     VAGRANT_HOME="~/vagrants/"    #or "/home/my_user/vagrants"     if [ -d "$VAGRANT_HOME" ]; then         cd $VAGRANT_HOMEvagrant_1         vagrant halt         cd $VAGRANT_HOMEvagrant_2         vagrant halt     fi      But even so, I can't help finding this silly, since I have added a couple of aliasses to my `.profile` file, including:               alias vagranthalt="cd ~/vagrants/vagrant_1 && vagrant halt && cd - && cd ~/vagrants/vagrant_2 && vagrant halt && cd -"      Which I'd like to use, but I'm not sure if these aliasses will still be available when my script is executed. I think I'll only need it @ runlevel 6, but might also need to symlink the script to run on runlevel 0, too. Basically, what I'd like to know is this:   * will existing aliasses be available to me, or not?   * Is there a _user_ executing this script (and will I therefore be able to use `~` for home?   * should I make sure I have, at least, read-rights on the vagrant dirs in the script   * Is there another way to ensure the vagrant boxes are shutdown, that is perhaps slightly easier?


title: listen a power-button event in Python (no ACPI)

text: I am using a Debian machine which does not include the acpid package. Is there a way that I can reboot the machine using Python language when the power- button is pressed, without installing that (or any other) package on the machine? Currently nothing is happening when the button is pressed.


title: How can I move files from my host system to Whonix-Workstation?

text: I'm not sure if using the guest additions is safe, but it seems to be the only way to transfer files. I cannot even get copy/paste to work between host and workstation.


title: Merging two different files with conditions

text: I have two different files as shown below. Content of `a.txt`:               HDR|1||||||||||                    DTL|@|||||||||||                  TLR|||||||||||||                   HDR|1||||||||||||                 DTL|||||||||||||                   TLR|||||||||||||           Content of `b.txt`:               HDR|2||||||||||       DTL|||||||||||||     TLR|||||||||||||     HDR|2||||||||||||      DTL|last||||||||||||     TLR|||||||||||||      Here I have to take out all the lines till 1st "TLR" in a.txt and b.txt and merge into 1.txt ,same way take out all the lines After 1st "TLR" in a.txt and b.txt and merge into 2.txt output should be: Content of `1.txt`:               HDR|1||||||||||      DTL|@|||||||||||      TLR|||||||||||||     HDR|2||||||||||      DTL||||||||||||      TLR|||||||||||||        Content of `2.txt`:               HDR|1||||||||||      DTL||||||||||||      TLR|||||||||||||     HDR|2||||||||||      DTL|last|||||||||||      TLR|||||||||||||        How can we accomplish this using UNIX Script?


title: Gedit Click Config plugin won't open

text: I'm using Gedit 3.4.2 with Click Config plugin 1.4.0. When I go to Edit->Click Config->Configure the window doesn't open, basically rendering this plugin useless. I've tried reinstalling the plugin. I've found a similar issue but I don't quite understand the fix: http://code.google.com/p/gedit-click- config/issues/detail?id=4


title: I want to find duplicates in a file and add a character to the end of the line on the 1st match

text: I am trying to find duplicates in a file and once a match is found mark the 1st match with a character or word on the end of the line. eg my file (test.html) contains the following entries               host= alpha-sfserver1     host= alphacrest3     host= alphacrest4     host= alphactn1      host= alphactn2     host= alphactn3      host= alphactn4     down alphacrest4      I can find the duplicate using the following:- (I use $2 as the duplicate will always be in column 2)               awk '{if (++dup[$2] == 1) print $0;}' test.html      It removed the last entry (down alphacrest4) but what I want is to also mark the duplicate entry with a word or character such as:-               host= alphacrest4 acked      Any help is most welcome.


title: How to let GDM shares monitor configure with GNOME?

text: I'm using gnome under Arch Linux in my laptop with a 1920*1080 monitor on the left of it, I set the monitor as my primary display in GNOME and everything works fine after I log in. However, GDM displays my log-in dialogue on my lap- top screen every time, and I noticed that my monitor was set defaultly on the right side of my laptop. I searched and found someone said mouse's position may have effect, which did not work on me. Can anybody help?


title: multithread handling in AM1808 using embedded Linux

text: I am using AM1808 ARM9 based board using GCC compiler (UBUNTU 10.04) . I am using Sqlite3 database management. I have some requirement regarding handling threads in background having access on database more then 3 or 4 times simultaneously. I found that I need to Cross compile the Sqlite3 with the Multithreading option(THREADSAFE = 1) enabled. I am not getting that How i can Cross Compile the Sqlite3.7.15 with the Serialized or Mutithread option enabled ? I stuck here and due to this i am getting uncertain errors. and my system gets stuck on Thread. I have already cross compiled my sqlite3.7.15 using following command. > sudo ./configure --exec- > prefix=/media/8CCC8E9BCC8E7F68/SQLIte3/sqliteinstall/ --host=arm > --target=arm CC=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-gcc > AR=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-ar > STRIP=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-strip > RANLIB=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-ranlib CFLAGS="-Os"


title: Configuring DNS resolver failover timeout

text: We have all of our systems set up to do internal DNS to a local name server and a secondary name server so that in the event the local DNS server is down they should go over the WAN to the secondary that is up in a remote location. During a recent maintenance window the primary name server locally was taken offline and our UNIX/Linux systems with Veritas Cluster (VCS) and Red hat cluster both experienced issues with cluster resources. Trying to determine how long resolution should be delayed when the servers have to go to the secondary (i.e. how long is the timeout to the primary) as it seems to hang for a while if the primary server is there but hung up? Is the length of time it waits before moving to the seconday tunable? This is for Solaris 10 and RHEL 6.


title: Using bzgrep recursively

text: I wanted to use `bzgrep` to find to text in bzip2 files. I expected `bzgrep` to work as `grep`, but on bz2 files. So I tried `bzgrep -r "mypattern" .` to find text in my bz2 files. Instead of the expected result I get the same result as `grep` : It found the text only in `.txt` files. Any idea how to use `bzgrep` recursively ? I am using `grep (GNU grep) 2.18`


title: What are the requierements to sniff UDP packets in a Wireless Ad-Hoc network?

text: In a wireless Ad-Hoc network, I have two computers which communicates in UDP together from 192.168.1.3 to 192.168.1.5 I have a third computer (192.168.1.6) which wants to listen to the packets which are not addressed to it. I can see the packets with `tcpdump` (which sets the wireless card in promiscuous mode). To redirect the packets, I am using :               iptables -t nat -I PREROUTING -s 192.168.1.3 -j DNAT --to-destination 192.168.1.5      Is it the only rule I need to use? Why isn't it working? Did I miss other requirements?


title: xsel not deleting selected text

text: I have been trying to get `xsel --delete` to work to ultimately implement a script to **move** selected material from one editor to another. According to the description:               Delete the contents of the selection     ------------------------------------                  xsel --delete          Will cause the program in which text is selected to delete that text. This     really works, you can try it on xedit to remotely delete text in the editor     window.      But this does not seem to work (`emacs`, `gedit` and also tried `xedit`). According to the man page:               -d, --delete            Request that the current selection be  deleted.  This  not  only            clears  the selection, but also requests to the program in which            the selection resides that the  selected  contents  be  deleted.            Overrides all input options.      But selected text is not even cleared. Clearing with `\--clear` worked in `gedit`, but not in `emacs`. In all cases I checked if the selected text was "known" with `xsel -p -o` first. How can I get `xsel --delete` to work? Does this depend on the application listening to `xsel`?


title: Passing multiple scripts to shell over ssh

text: I have a somewhat lengthy script which sources other scripts to include the functions there. I'd like to execute this script remotely via ssh. Now I thought to make one script file of it (without sourcing it) and then let it execute remotely via ssh. For example the idea was something like this, unfortunately it does not work:               $ ssh user@host < $(cat dep1.sh dep2.sh main.sh)      whereas when it is a single file (I merged it before) does work:               $ ssh user@host < complete_main_script.sh      Any ideas how I would overcome the issue, i.e. make one script file of the three above and send it as a whole via `ssh`?


title: How to upgrade mono on openSuse

text: I have a virtual machine running of openSuse 11.2 that has mono 2.6.4, I use this VM as a test server to test asp.net applications under Apache mod_mono. I wanted to upgrade (in the same virtual machine) to mono 2.8.2. I downloaded several rpm files from http://ftp.novell.com/pub/mono/download- stable/openSUSE_11.2/i586/ but I'm in a dependency "loop", don't know which package to install in the correct order... (Did I mention that I know very little of suse?) Edit: Is it possible to find a way to upgrade it without network connectivity? Thanks!


title: vim/emacs plugin to view recursive grep search search results?

text: Suppose I have a file formatted like this:               file1:123     file2:4444     some/other/file:2233      This represents the search results from a grep (i.e. file:line-number). I'd like to have a vim plugin which would allow me quickly browse through those hits. It would display a two-pane window (split horizontally) with the top pane showing the hits and the bottom pane showing currently selected hit. Changing the selection in the top pane displays the specified file at the indicated line number in the bottom pane. Anyone run across something like this? I'd even consider a non-vim solution (emacs/dedicated program, ...).


title: General Setup on remote programming

text: I have the following 3 units   * A laptop that runs both MAC/Ubuntu    * A home-based server with Ubuntu desktop version   * A wireless router which I got from the provider that does not have that much technical documentation (just general setup stuff). Also the router is connected with wire to the server. Ideally I want to use the terminal on my laptop and connect to the home server. What are the options? I just need to setup an SSH connection between these two machines?


title: Converting colored output into html

text: There are tools providing coloured output:               dwdiff -c File1 File2 # word level diff     grep --color=always # we all know this guy     ...      The question is: **How to convert their colored output of arbitrary program into coloured html file?** Other output formats might be suitable as well (LaTeX would be great). I think html is good starting point, as it's easy to convert it to other formats. (For curious how to keep terminal colour codes, please follow answer: http://unix.stackexchange.com/a/10832/9689 `... | unbuffer command_with_colours arg1 arg2 | ...` - tool unbuffer is part of expect )


title: How can I remove all symbolic links with a special target?

text: With the command:               ls -la *      I can list all my symbolic links. How can I remove all symbolic links which are linked to a special folder? For example: In my directory `usr/local/bin` I have the following entries:               lrwxrwxrwx 1 root root 50 Apr 22 14:52 allneeded -> /usr/local/texlive/2011/bin/x86_64-linux/allneeded     lrwxrwxrwx 1 root root 47 Apr 22 14:52 amstex -> /usr/local/texlive/2011/bin/x86_64-linux/amstex     lrwxrwxrwx 1 root root 24 Apr 23 19:09 arara -> /home/marco/.arara/arara      Now I want to remove all links with the path `/usr/local/texlive/`


title: libpangocairo-1.0.so.0: undefined symbol: cairo_has_show_text_glyphs error

text: I am using Debian Squeeze and I wanted to install Gimp 2.8. I installed a lot of packages dependencies for Gimp but I could not successfully complete the install of the Gimp package When installing the Gimp dependent packages, I think I broke a necessary package because now I am getting the following error when I try to start `thunar`, `gedit` and more.               symbol lookup error: /usr/local/lib/libpangocairo-1.0.so.0: undefined symbol: cairo_has_show_text_glyphs      How can I resolve this error?


title: How to tell the "last" command to read from STDIN?

text: SERVER:~ # zcat /var/log/wtmp-20130827.gz | last -f -     last: -: No such file or directory     SERVER:~ #       Without uncompressing the wtmp file, how can I see the output of if it with the last command?


title: Prevent wpa_supplicant from joining hidden networks

text: Is there any way to prevent wpa_supplicant from trying to join hidden networks? If SSID Foo is out of range, wpa_supplicant seems to broadcast "Is Foo available?"-queries. This is not particularly privacy-friendly, consdering lists of SSIDs can be uniquely identifiable.


title: What is sourcing my shell script?

text: I have a `.zshrc` and a `.zshenv` in my home directory. I added a new command to my `.zshenv` that I discovered was being run at least 3 times. I realized that I was accidentally `source`ing it from the `.zshrc`, so I removed that line, but it's still being run twice. I've tried echoing `$0` and `$_` in the script, and I get `(~/.zshenv) (~/.zshenv)` for the first pass, and `(30) (zsh)` for the second. What could that mean? Is there a better way to get a "stack trace" showing my caller?


title: Editing files in debian before installation

text: I am having problems installing debian on virtualbox. The installation step fails when trying to configure packet manager. The guy in the following post had them solved by editing a certain file during one of the installation phases. http://askubuntu.com/questions/146574/configuring-the-package-manage-failed- installation-on-11-10?newreg=3029c47198d34bb7be96025ffe0b3e32 I am completely new to Linux, command lines in general and have no idea how to: "Edit /usr/lib/apt-setup/generators/50mirror.ubuntu and comment out the two lines with db_metaget and db_subst statements after the comment "Text is variable for Debian"." could someone show some basic commands that would do it? :) I've already navigated to /usr/lib/apt-setup/generators/ and found the 50mirror file. How should I proceed? How do I close the shell and return to the installation afterwards? UPDATE: for anyone, trying to install linux on VirtualBox, install VirtualBox using administrator privileges. Then launch it with them as well. Worked for me :)


title: Copying files from one machine to another without asking for password

text: I am currently using this command. I am on another machine (ip1)               scp file.txt root@ip2:/home/praveen/test.c /home/praveen      The command will prompt for password. I use it in some shell scripts, and am calling these scripts from some crontab files. So, I can not enter the password every time. Is there any way to disable password asking or some another way to input password from somewhere, so that I don't need to enter it again. And I cannot use `ssh-keygen`, because I have to do the actions for these scripts only. When I use `ssh-keygen`, it will never prompt me for password again. I don't want this. Rest of the things should work as usual.


title: Courier-MTA not listening, how to increase debugging information?

text: i Follow tutorial from https://wiki.archlinux.org/index.php/Courier_MTA based on systemctl status command, the server is working fine               # systemctl status courier     courier.service - Courier Daemon        Loaded: loaded (/usr/lib/systemd/system/courier.service; disabled)        Active: active (running) since Tue 2013-08-27 15:40:16 WIT; 35s ago       Process: 509 ExecStop=/usr/sbin/courier stop (code=exited, status=0/SUCCESS)       Process: 511 ExecStart=/usr/sbin/courier start (code=exited, status=0/SUCCESS)      Main PID: 516 (courierd)        CGroup: name=systemd:/system/courier.service                ├─516 /usr/lib/courier/courierd                ├─517 /usr/lib/courier/courierd                ├─518 ./courieruucp                ├─519 ./courierlocal                ├─520 ./courierfax                ├─521 ./courieresmtp                └─522 ./courierdsn          Aug 27 15:40:16 gravity courierd[517]: Started ./courieruucp, pid=518, maxdels=4, maxhost=4, maxrcpt=16     Aug 27 15:40:16 gravity courierd[517]: Started ./courierlocal, pid=519, maxdels=10, maxhost=4, maxrcpt=1     Aug 27 15:40:16 gravity courierd[517]: Started ./courierfax, pid=520, maxdels=1, maxhost=1, maxrcpt=1     Aug 27 15:40:16 gravity courierd[517]: Started ./courieresmtp, pid=521, maxdels=40, maxhost=4, maxrcpt=100     Aug 27 15:40:16 gravity courierd[517]: Started ./courierdsn, pid=522, maxdels=4, maxhost=1, maxrcpt=1     Aug 27 15:40:16 gravity courierd[517]: queuelo=200, queuehi=400     Aug 27 15:40:16 gravity courierd[517]: Purging /var/spool/courier/msgq     Aug 27 15:40:16 gravity courierd[517]: Purging /var/spool/courier/msgs     Aug 27 15:40:16 gravity courierd[517]: Waiting.  shutdown time=Tue Aug 27 16:40:16 2013, wakeup time=Tue Aug 27 15:50:44 2013, queuedeliverin...rogress=0     Aug 27 15:40:16 gravity courieruucp[518]: ERROR: no uucp user found, outbound UUCP is DISABLED!      but the server was not listening at all               $ sudo netstat -ant | grep :25     $ sudo netstat -ant | grep :143      the start configuration               # grep START= /etc/courier/*     /etc/courier/esmtpd:ESMTPDSTART=YES     /etc/courier/esmtpd-msa:ESMTPDSTART=YES     /etc/courier/esmtpd-ssl:ESMTPDSSLSTART=NO     /etc/courier/imapd:IMAPDSTART=YES     /etc/courier/imapd-ssl:IMAPDSSLSTART=NO     /etc/courier/pop3d:POP3DSTART=YES     /etc/courier/pop3d-ssl:POP3DSSLSTART=NO      the log:               Aug 27 15:40:16 gravity courierd: Loading STATIC transport module libraries.     Aug 27 15:40:16 gravity courierd: Courier 0.71 Copyright 1999-2012 Double Precision, Inc.     Aug 27 15:40:16 gravity courierd: Installing [0/0]     Aug 27 15:40:16 gravity courierd: Installing uucp     Aug 27 15:40:16 gravity courierd: Installed: module.uucp - Courier 0.71 Copyright 1999-2012 Double Precision, Inc.     Aug 27 15:40:16 gravity courierd: Installing local     Aug 27 15:40:16 gravity courierd: Installed: module.local - Courier 0.71 Copyright 1999-2012 Double Precision, Inc.     Aug 27 15:40:16 gravity courierd: Installing fax     Aug 27 15:40:16 gravity courierd: Installed: module.fax - Courier 0.71 Copyright 1999-2012 Double Precision, Inc.     Aug 27 15:40:16 gravity courierd: Installing esmtp     Aug 27 15:40:16 gravity courierd: Installed: module.esmtp - Courier 0.71 Copyright 1999-2012 Double Precision, Inc.     Aug 27 15:40:16 gravity courierd: Installing dsn     Aug 27 15:40:16 gravity courierd: Installed: module.dsn - Courier 0.71 Copyright 1999-2012 Double Precision, Inc.     Aug 27 15:40:16 gravity courierd: Initializing uucp     Aug 27 15:40:16 gravity courierd: Initializing local     Aug 27 15:40:16 gravity courierd: Initializing fax     Aug 27 15:40:16 gravity courierd: Initializing esmtp     Aug 27 15:40:16 gravity courierd: Initializing dsn     Aug 27 15:40:16 gravity courierd: Started ./courieruucp, pid=518, maxdels=4, maxhost=4, maxrcpt=16     Aug 27 15:40:16 gravity courierd: Started ./courierlocal, pid=519, maxdels=10, maxhost=4, maxrcpt=1     Aug 27 15:40:16 gravity courierd: Started ./courierfax, pid=520, maxdels=1, maxhost=1, maxrcpt=1     Aug 27 15:40:16 gravity courierd: Started ./courieresmtp, pid=521, maxdels=40, maxhost=4, maxrcpt=100     Aug 27 15:40:16 gravity courierd: Started ./courierdsn, pid=522, maxdels=4, maxhost=1, maxrcpt=1     Aug 27 15:40:16 gravity courierd: queuelo=200, queuehi=400     Aug 27 15:40:16 gravity courierd: Purging /var/spool/courier/msgq     Aug 27 15:40:16 gravity courierd: Purging /var/spool/courier/msgs     Aug 27 15:40:16 gravity courierd: Waiting.  shutdown time=Tue Aug 27 16:40:16 2013, wakeup time=Tue Aug 27 15:50:44 2013, queuedelivering=1, inprogress=0     Aug 27 15:40:16 gravity courieruucp: ERROR: no uucp user found, outbound UUCP is DISABLED!      how to increase debugging information?


title: KVM can't access iso o raw images outside /var/lib/libvirt/images

text: I'm using Linux Mint Debian Edition (Up. 8) when tryng to start a virtual machine from libvirt (either from commandline or using virt-manager to local qemu-kvm) I get this error when I use an image that is not loaded in the default datastore: if I copy the same image (in this example an .iso file) to the /var/lib/libvirt/images folder it works. I've tried to chown and chmod it to every possible owner and mode but it just won't work. SELinux is not in place in this distro so I don't know where's the point, in logs I can see just permission denied and I'm quite stuck.               Impossibile completare l'installazione: 'internal error: process exited while connecting to monitor: qemu-system-x86_64: -drive file=/home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso,if=none,id=drive-ide0-1-0,readonly=on,format=raw: could not open disk image /home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso: Could not open '/home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso': Permission denied     '          Traceback (most recent call last):       File "/usr/share/virt-manager/virtManager/asyncjob.py", line 96, in cb_wrapper         callback(asyncjob, *args, **kwargs)       File "/usr/share/virt-manager/virtManager/create.py", line 1949, in do_install         guest.start_install(False, meter=meter)       File "/usr/lib/pymodules/python2.7/virtinst/Guest.py", line 1249, in start_install         noboot)       File "/usr/lib/pymodules/python2.7/virtinst/Guest.py", line 1317, in _create_guest         dom = self.conn.createLinux(start_xml or final_xml, 0)       File "/usr/lib/python2.7/dist-packages/libvirt.py", line 2897, in createLinux         if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)     libvirtError: internal error: process exited while connecting to monitor: qemu-system-x86_64: -drive file=/home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso,if=none,id=drive-ide0-1-0,readonly=on,format=raw: could not open disk image /home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso: Could not open '/home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso': Permission denied      any clues?


title: Due to a broken monitor, I need to setup only the right half of my screen

text: The left side of my full hd monitor is broken, in order to use only the good part the resolution needs to be `1274x1080`, aligned to the right. A simple `xrandr -s 1274x1080` will get the right resolution, but centered. Using `\--transform 1,0,-323,0,1,0,0,0,1` will move the screen but will not occupy the right side. I already tried to play with `modeline`, using the link given in this answer, but it does not move the screen no matter what I change.


title: Built new kernel, LVM won't mount from initrd

text: I need to upgrade my kernel on a RHEL 5 system to build with some experimental drivers. I have configured the kernel with module loading for LVM (`dm_*` modules). Once the initrd runs the `/init` script, the LVM mounting procedure is failing. The drives are configured with LVM (including the root device) so during init, it mounts them and performs `switchroot`. What can I do to understand why `lvmscan` is failing?


title: Incrontab does not execute command

text: When I use incrontab out of the box, I mean no changes, I get no result, as if the command was not executed. my incron line is : `/crrae IN_CREATE,IN_CLOSE_WRITE,IN_MOVED_TO /usr/bin/unix2dos $#` the log give information as if everything was ok but no actually the strace generated is: `incrontab_trace_0.txt`                0.000000 poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=8, events=POLLIN}], 3, -1) = 1 ([{fd=8, revents=POLLIN}])     17.616276 read(8, "\1\0\0\0\0\1\0\0\0\0\0\0000\0\0\0ExportSageJDE_CO"..., 32768) = 64      0.000145 stat64("/crrae", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0      0.000147 time(NULL)                = 1399228077      0.000056 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=156, ...}) = 0      0.000089 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=156, ...}) = 0      0.000082 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=156, ...}) = 0      0.000096 send(3, "<78>May  4 18:27:57 incrond[3183"..., 108, MSG_NOSIGNAL) = 108      0.000104 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7f60718) = 31838      0.000816 poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=8, events=POLLIN}], 3, -1) = -1 EINTR (Interrupted system call)      0.000834 --- SIGCHLD (Child exited) @ 0 (0) ---      0.000033 read(4, 0x8069c40, 32)    = -1 EAGAIN (Resource temporarily unavailable)      0.000057 write(5, "X", 1)          = 1      0.000056 sigreturn()               = ? (mask now [])      0.000072 poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=8, events=POLLIN}], 3, -1) = 1 ([{fd=4, revents=POLLIN}])      0.000068 read(4, "X", 1)           = 1      0.000054 read(4, 0xbfd22dd9, 1)    = -1 EAGAIN (Resource temporarily unavailable)      0.000057 waitpid(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], WNOHANG) = 31838      0.000060 waitpid(-1, 0xbfd22dd4, WNOHANG) = -1 ECHILD (No child processes)      0.000051 poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=8, events=POLLIN}], 3, -1) = 1 ([{fd=8, revents=POLLIN}])      0.009198 read(8, "\1\0\0\0\10\0\0\0\0\0\0\0000\0\0\0ExportSageJDE_CO"..., 32768) = 64      0.000074 stat64("/crrae", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0      0.000118 time(NULL)                = 1399228077      0.000057 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=156, ...}) = 0      0.000084 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=156, ...}) = 0      0.000082 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=156, ...}) = 0      0.000090 send(3, "<78>May  4 18:27:57 incrond[3183"..., 108, MSG_NOSIGNAL) = 108      0.000065 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7f60718) = 31839      0.000614 poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=8, events=POLLIN}], 3, -1) = -1 EINTR (Interrupted system call)      0.000832 --- SIGCHLD (Child exited) @ 0 (0) ---      0.000026 read(4, 0x8069c40, 32)    = -1 EAGAIN (Resource temporarily unavailable)      0.000055 write(5, "X", 1)          = 1      0.000054 sigreturn()               = ? (mask now [])      0.000071 poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=8, events=POLLIN}], 3, -1) = 1 ([{fd=4, revents=POLLIN}])      0.000067 read(4, "X", 1)           = 1      0.000053 read(4, 0xbfd22dd9, 1)    = -1 EAGAIN (Resource temporarily unavailable)      0.000051 waitpid(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], WNOHANG) = 31839      0.000058 waitpid(-1, 0xbfd22dd4, WNOHANG) = -1 ECHILD (No child processes)      0.000050 poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=8, events=POLLIN}], 3, -1 <unfinished ...>      When I change my incron to:               /crrae IN_CREATE,IN_CLOSE_WRITE,IN_MOVED_TO /usr/bin/unix2dos /crrae/$#       or               /crrae IN_CREATE,IN_CLOSE_WRITE,IN_MOVED_TO /usr/bin/unix2dos $@/$#      the log gives me this:               May  4 18:15:10 srvovs incrond[20859]: (root) CMD (/usr/bin/unix2dos /crrae/u2dtmpPbqoFd)     May  4 18:15:10 srvovs incrond[20859]: (root) CMD (/usr/bin/unix2dos /crrae/u2dtmpN2Odxf)     May  4 18:15:10 srvovs incrond[20859]: (root) CMD (/usr/bin/unix2dos /crrae/u2dtmpN2Odxf)      multiple times, the `incron.conf` has not been modified. Any ideas?


title: Where does bash store the time commands were executed?

text: Enabling `history` to display time via `export HISTTIMEFORMAT='%F %T '` shows the times of the commands but `.bash_history` doesn't contain any times. Where does `bash` store the times the commands were executed? Are they always stored automatically?


title: rename hundreds of file by removing last few characters

text: I have hundreds of file andI want to remove last 7 characters from the filename but keeping its extension. Old name:               abc_xyz12_4567.txt          abcde_xyz12_4567.txt      New name:               abc_xyz.txt          abcde_xyz.txt


title: AWK: Nested Conditional Subset of Rows without Headers

text: I have a pretty specific question, and have been able to find lots on conditional subsetting using awk but none that lends enough explicit code for me to generalize to my situation. I have a file 'keys' and a file 'features' both **without headers**. The 'keys' table contains two variables, KEY and GROUP (1st and second columns, respectively), toy example below.                   1          GROUP0         2          GROUP0         3          GROUP1         4          GROUP1         5          GROUP2         6          GROUP2        The file 'features' contains a list of features of widgets like so (ID, FEATURE, VALUE 1st, 2nd and 3rd columns, respectively).                   A           num_user     10         A           KEY          4         B           num_user     2         B           KEY          2         B           battery      Large         C           num_user     10         C           KEY          15         D           num_user     2         D           KEY          2         D           battery      Small         E           num_user     2         E           KEY          7         E           battery      Small      I am trying to select all rows for an ID which has a value of 'KEY' that is in the 'KEY' column of 'keys' for a hardcoded list of 'GROUP' values. The desired result is                   A           num_user     10         A           KEY          4         B           num_user     2         B           KEY          2         B           battery      Large         D           num_user     2         D           KEY          2         D           battery      Small      Any ideas?


title: How to turn verbose mode on and off using a case statement in UNIX

text: I'm trying to create a shell script file that uses getopts. The purpose of the program is to remove files that are in the project and place them in the deleted directory aka recycling bin. I have already been able to successfully complete this. I have also been able to use the getopt command -i (interactive) to pass into a case statement and then trigger off a question for the user asking if they are sure they would like to remove a file. This has been done by creating a variable "ision" and setting it to true when the case statement is activated. I have inserted my code down below. I've tried it out a couple of times and everything seems to be fine but I would like to add the verbose activity/mode. Is there anyone who could help me out?               #!/bin/bash          while getopts ":i:v" option ;     do     case "$option" in     i) echo "interactive mode set"     ision=true;     break;;     v) echo "verbose mode"     vison=true;     break;;     esac     done     echo "this is the proof we need"          echo $@          shift $(($OPTIND-2))          echo $@          echo "this is working too"          if [ ! -e ~/deleted ]     then     mkdir ~/deleted     fi          echo "the echo file was made or just created"          if [ $# -eq 0 ]     then     echo "safe_rm missing operand"     exit     fi          echo "all workking on the western front"          for i in $@     do          if [ "$ision" == "true" ]     then     echo "do you want to remobve the file"     echo "variable test $i"     echo "yes or no"     read -p "Enter " answer     if [ "$answer" == "no" ]     then     continue;     fi     fi          if [ ! -f $i ]     then     echo "no such file or directory"     exit     fi             if [ $i == safe_rm ]             then                  echo "cant remove safe_rm"             continue             fi                  if [ $i == safe_rm_restore ]             then             continue             echo "cant remove safe_rm_restore"                  fi          inode=$(ls -i $i | cut -c -6 )     echo "the inode is $inode "     pathname=$(dirname $i)     if [ $pathname == "." ]     then     pathname=$(pwd)     echo $pathname     fi     basename=$(basename $i)     path=$basename"_"$inode":"$pathname"/"$basename          echo $path          if [ ! -f .restoreinfo ]     then     touch .restoreinfo     fi               echo $path >> .restoreinfo     mv $i ~/deleted/          done


title: vmlinuz file for Ubuntu

text: How do I look for the `vmlinuz` file for Ubuntu from SUSE. I try: `mount /dev/sda5 /mnt` then `cd /boot`, but I don't see the `vmlinuz` file for Ubuntu. Where is it? The `/boot` directory is empty.


title: RS232 chat. Simplest way?

text: I'm working in a project in which I will have to deal with serial communications. For testing, I want make to 2 computers speak to each other (with my interaction) via RS232. Will the next thing work? in computer A:               # cat /dev/ttyS0      in computer B:               # echo <something> >> /dev/ttyS0      Will computer A, receive data from B, or not? If I'm wrong, what would be the easiest way to send something to the other computer? Ideas are welcome!


title: Help with PKGBUILD

text: As I would expect, there are a lot of Arch Linux users in here, and I think one of you can help me before upload my first PKGBUILD. The package I want to build is from a git repo. I've read the wiki guidelines but the CVS page is not very complete... When I makepkg, the procces seem to go straight, but in some point, it gets stuck. I don't know how to proceed. Could you help me?               # Maintainer: Tomas Sironi <sironitomas at gmail dot com>          pkgname=mutter-meego-git     pkgver=20101015     pkgrel=1     pkgdesc=""     arch=('i686' 'x86_64')     url="http://http://git.gitorious.org/meego-netbook-ux/mutter-meego/"     license=('GPL')     groups=()     depends=()     makedepends=('git')     optdepends=()     provides=('mutter-meego')     conflicts=('mutter-meego')          _gitroot="git://gitorious.org/meego-netbook-ux/mutter-meego.git"     _gitname="mutter-meego-git"          replaces=()     backup=()     options=()     install=     #~ source=($pkgname-$pkgver.tar.gz)     noextract=()     md5sums=() #generate with 'makepkg -g'          build() {         export INCLUDE="/usr/include"              msg "Connecting to the GIT server..."         if [ -d ${_gitname}/.git ]; then             cd ${_gitname}             git pull         else             git clone ${_gitroot} ${_gitname}             cd ${_gitname}         fi              ./configure.ac -prefix /usr \                     -libdir /usr/lib         make || return 1         make INSTALL_ROOT=$pkgdir install || return 1     }          package() {       cd $srcdir/$pkgname-$pkgver       make DESTDIR=$pkgdir install     }


title: File protection in Unix

text: Is there a way to protect a file in such a way that even `root` cannot delete it or rewrite it after creating it? I have a file which is created by `root` under `/var/log/` and I want to restrict all users (including `root`) so that they can just read this particular file after it has been created.


title: Error when I try to init gentoo, Loading init ramdisk

text: I installed the gento acoording to the hanbook, but when I reboot my system I've a mistake, Just I can see the following               Loading init ramdisk...      and no more. I believe that my trouble is in the setup of my `/etc/fstab`, because I diden't one partition to /home , /boot I put all in the same partition, then I try to setup my `/etc/fstab` like:               /dev/sda6       /           ext4        noatime     0 1     /dev/SWAP       none        swap        sw          0 0     /dev/cdrom      /mnt/cdrom  auto        noauto,ro   0 0     /dev/sda5       /mnt/disco5 auto        noatime     0 0      **Update:** This is the setup of my grub2, `/boot/grub/grub.cfg`               menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-72d88d2d-9090-4aee-b18d-a02e09514a4d' {         load_video         set gfxpayload=keep         insmod gzio         insmod part_msdos         insmod ext2         set root='hd0,msdos6'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6  72d88d2d-9090-4aee-b18d-a02e09514a4d         else           search --no-floppy --fs-uuid --set=root 72d88d2d-9090-4aee-b18d-a02e09514a4d         fi         echo    'Loading Linux 3.14.14-gentoo ...'         linux   /boot/vmlinuz-3.14.14-gentoo root=UUID=72d88d2d-9090-4aee-b18d-a02e09514a4d ro           echo    'Loading initial ramdisk ...'         initrd  /boot/initramfs-genkernel-x86_64-3.14.14-gentoo     }     submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-72d88d2d-9090-4aee-b18d-a02e09514a4d' {         menuentry 'Gentoo GNU/Linux, with Linux 3.14.14-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.14-gentoo-advanced-72d88d2d-9090-4aee-b18d-a02e09514a4d' {             load_video             set gfxpayload=keep             insmod gzio             insmod part_msdos             insmod ext2             set root='hd0,msdos6'             if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6  72d88d2d-9090-4aee-b18d-a02e09514a4d             else               search --no-floppy --fs-uuid --set=root 72d88d2d-9090-4aee-b18d-a02e09514a4d             fi             echo    'Loading Linux 3.14.14-gentoo ...'             linux   /boot/vmlinuz-3.14.14-gentoo root=UUID=72d88d2d-9090-4aee-b18d-a02e09514a4d ro               echo    'Loading initial ramdisk ...'             initrd  /boot/initramfs-genkernel-x86_64-3.14.14-gentoo         }         menuentry 'Gentoo GNU/Linux, with Linux 3.14.14-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.14-gentoo-recovery-72d88d2d-9090-4aee-b18d-a02e09514a4d' {             load_video             set gfxpayload=keep             insmod gzio             insmod part_msdos             insmod ext2             set root='hd0,msdos6'             if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6  72d88d2d-9090-4aee-b18d-a02e09514a4d             else               search --no-floppy --fs-uuid --set=root 72d88d2d-9090-4aee-b18d-a02e09514a4d             fi             echo    'Loading Linux 3.14.14-gentoo ...'             linux   /boot/vmlinuz-3.14.14-gentoo root=UUID=72d88d2d-9090-4aee-b18d-a02e09514a4d ro single              echo    'Loading initial ramdisk ...'             initrd  /boot/initramfs-genkernel-x86_64-3.14.14-gentoo         }     }      So someone could tell me how to fix the problem to load the system and if my setup fstab is good?


title: bash: colorize second column of output

text: let's say, I have following output from ls:               $ ls -lAhF /bin     -rwxr-xr-x 1 root root 905K Apr 10  2010 bash*     -rwxr-xr-x 3 root root  31K Dec 26  2011 bunzip2*     -rwxr-xr-x 1 root root 505K Nov 15  2010 busybox*     -rwxr-xr-x 3 root root  31K Dec 26  2011 bzcat*     lrwxrwxrwx 1 root root    6 Jun 24  2012 bzcmp -> bzdiff*     ...      I am looking for a way, how I could colorize the second column. I know how to use sed to colorize any pattern, but I don't know how to colorize specific column. Basically, I need to insert `'\033[0;31m'` after the first space and `'\033[0m'` infront of the the second space. Or perhaps there is much more elegant way ?


title: Dual boot Windows 7 and Arch Linux

text: I have a Vaio notebook with Windows 7 64 bit. I want to dual boot it with Arch Linux. I have three primary partitions: Recovery, System reserved (Active and Boot) and the Windows `C:` drive. I have resized the large partition with the the Windows `C:` drive. Now I have an empty space where I could create the Linux partition, but I am lost as concerns the boot loader. According to Arch documentation, using Windows 7/8 boot loader restricts me to a Fat32 Linux partition, really a no go. So I can use GRUB or SysLinux. As for Syslinux, I have read that using `chain.c32` can prevent Windows 7 hibernation. As for GRUB, the new version is very complex, do I really need it for such a simple task? Secondly, Arch Docs say that a post-MBR gap of about 1 to 2 MiB is recommended to provide sufficient room for embedding GRUB's `core.img`. How do I check if I have it and what to do if I don't have it? Before choosing and studying any strategy I'd like to hear from your expert advice.


title: Jailkit not working properly when connecting remotely from iPad via SFTP app

text: I used jailkit to add users and restrict them to a jail directory. It works for Linux and PC clients connecting to the ssh server but when I connect with iPad it gives them access to everything. I am using my iPad to connect to the SSH server on my linux PC using an SFTP app. I'm logging in with a username. When I log in using the username from a PC it works, restricting me to the jail root folder. But from my iPad it lets me access the entire file system. I used this tutorial: http://syiron.wordpress.com/2011/06/25/simple-jailkit-howto/


title: How to bind v4l2 USB cameras to the same device names even after reboot?

text: I have 3 USB cameras on single PC, one camera will be unused and can be ignored. I need to force two identical cameras to be mapped to constant device names (like `/dev/video1` and `/dev/video2` ). The cameras should not change their order (say camera 1 mounted as `video1` and camera 2 as `video2` after disconnect they should be in same order not camera1 --> `/dev/video2`, camera2 --> `/dev/video1`. How to make this setup work? I will feed camera output to _Gstreamer_. Cameras are using _v4l2_ and _uvc_ driver interface. Linux distro in question is _Archlinux_ , cameras - some Logitech webcams.


title: Alsaequal volume gain, Pre-Amp like

text: I use alsaequal for equalize my audio, hitherto ok, but all know that after equalizer the volume is low, some equalizers have a control called "Pre-AMP" that solve this problem, but in Alsaequal haven't this control. I've tried using ALSA's softvol plugin but this plugin cause distortion, that isn't acceptable for me! So, someone have a solution for me ?


title: Change default file manager in Arch Linux with E17 to Dolphin

text: I am using Arch Linux with E17 as my DE. However, I am not happy with the file manager that E17 comes with, so I researched a bit and decided to go with the Dolphin file manager (the one KDE comes with). So I need the following info from the experts:   * What's the best place to get it from? Official packages? AUR? If yes, which, if no, where and how?   * And, of course, how to make it the default file manager so that it gets launched instead of E17's file manager.


title: Encrypting loopback images without using a loopback device

text: I'm trying to design a firmware update system for an embedded Linux system. My plan is to send an image that can be mounted on the target system, so I don't need to unpack the entire file. I also want to encrypt the image, and optionally compress it as well. Since the build system for creating this image is going to be deployed on several computers I also want the build system to require minimal amount of setup, i.e., avoid avoid requiring root privileges. I've created a working model where I mount an image file using `losetup` as such:               dd if=/dev/zero of=image_file bs=1M count=10     losetup -e aes loop0 image_file     mkfs.ext2 /dev/loop0     losetup -d loop0     mount -t ext2 -o loop,encryption=aes image_file some_working_folder/     # Add files to some_working_folder     umount some_working_folder     # Send encrypted image to the target system      Now, since this is a bit cumbersome to set up on some machines, and I want to avoid creating fixed sized images. So I want to replace the `losetup` commands with something else. I found the command `virt-make-fs`, which can create a mountable image with the `ext2` filesystem. So now I only need to encrypt the image file in a way that is decryptable by the linux kernel. I've tried to use OpenSSL, but I haven't been able to find the correct algorithm, or maybe I'm missing something. Does anybody know how to do this? Basically I want something like the script below.               tar -cf archive.tar some files     virt-make-fs archive.tar image.ext2     # the below command need to be fixed/replaced     openssl enc -aes192 -in image.ext2 -out image.ext2.aes      On the target system I want be able to use the following command, or at least something similar.               # The next command should be done on the target     mount -t ext2 -o loop,encryption=aes image.ext2.aes /mnt/upgrade     # work with files in /mnt/upgrade      So, just to clarify: How can I create an encrypted mountable image file without being root? Feel free to comment if I'm trying to reinvent the wheel, or if there is some other well established solution for this problem. Even though there are better solutions, I'm still interested in the command to solve the encryption problem. * * * Edit: As been pointed out cryptoloop is unsecure, see http://lwn.net/Articles/67216/. So I will probably look around for another solution as well. I've found to util `aespipe`, which I might be able to use. * * * Edit 2: I've dug into the source code in the AES module of the Linux kernel, and I've concluded that it is probably the hashing of the password that is causing the problem. Both `aespipe` and the AES module are using an AES-256-CBC encryption. As far as I can see the linux kernel uses the given password as key, and `aespipe` hashes the incoming password. Since the "no root" part is very important to me I've started looking for other solutions, and my current plan is to use something like the following on the development computer:               tar -cf - file0 file1 ... | gzip -c | aespipe -e aes256 > arhive_file      And then on the target system run               rm -rf /tmp/update ; mkdir -p /tmp/update     aespipe -d -e aes256 < archive.mbl | gzip -cd | tar -C /tmp/update -xf -


title: How to install Java Runtime Environment 7 update 5 for x64 arquitecture on Debian OS?

text: **The History:** Hey guys I want to install JRE7u5 and not OpenJRE7u5 because, while doing a research on the web I discovery that Minecraft runs better on JRE, than with OpenJRE. **The Failure:** But the here (instructions for Linux x64) and here (instructions for Linux x64 RPM) are not helpful, I already tried to download both and I used `alien` and `rpm` to try install the RPM package, but everything goes wrong. **The question:** Knowing that I would like to request a tutorial teaching me how to install JRE7u5 (Java Runtime Environment 7 update 5) for x64 architecture, and just for inclusion, I'm using Debian 6.


title: What does .??* mean in a shell command?

text: The following command will `tar` all "dot" files and folders:               tar -zcvf dotfiles.tar.gz .??*      I am familiar with regular expressions, but I don't understand how to interpret `.??*`. I executed `ls .??*` and `tree .??*` and looked at the files which were listed. Why does this regular expression include all files within folders starting with `.` for example?


title: How to allow a particular user to access the FTP?

text: Anonymous / FTP users are allowed to access the FTP. Suppose if there is a user named as JOE then how can I allow him to access the FTP?


title: How to log all my DNS queries?

text: How can I create logs of every DNS query that my computer makes along with the responses it gets?


title: How to list all styles in zsh

text: How an I list all of the styles defined in a zsh session using the `zstyle` command? I would like to know this so I know what configuration options are available to me.


title: If I SSH into a remote machine and my connection gets dropped, then is there a chance that the run I made will continue on?

text: Or will the run halt along with everything (though maybe partial progress could be made if I use a ">" to print progress so far to a file)


title: Testing if a process is running via if and -z

text: I'm have a process on my system which is notorious for crashing, and is kind of mission critical, my network manager. In any case, I need to write a loop which tests if it's running and starts it if it isn't. This is what I've come up with thus far:               #!/bin/bash          while [ true ]; do          if [ -z $(ps aux | grep "[n]m-applet") ]; then             echo "Bugger died, resurrecting..."             nm-applet >/dev/null 2>/dev/null &             disown $!         fi              sleep 3     done       Unfortunately, this isn't quite doing the trick, as it seems to be starting the process even when not necessary, and after the first run, I get the following error output:               line 4: [: too many arguments      What am I doing wrong here?


title: downloading files using wget

text: I am trying to download an http link from here. The URL is http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file When I use               wget http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file       I get only `index.html?acc=GSE48191` which is some kind of binary format. How can I download the files under this http link?


title: Motion command images are jibberish

text: It seems my motion command config will not take complete pictures. It used to take a few tiny ok images, and a garbled image, now after adjusting it to full resolution it takes a large image of garbled blocks: ![garbled image](http://i.stack.imgur.com/7Qg36.jpg) It used to give a message about the wrong pallette type in its log, but I adjusted that to 15 (YUYV) and it doesn't complain about that:               ------------------------     cap.driver: "uvcvideo"     cap.card: "UVC Camera (046d:0825)"     cap.bus_info: "usb-ehci-platform-1.1"     cap.capabilities=0x04000001     ------------------------     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_get_capability: - VIDEO_CAPTURE     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_get_capability: - STREAMING     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_select_input: name = "Camera 1", type 0x00000002, status 00000000     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_select_input: - CAMERA     [1] [WRN] [VID] [Sep 11 22:24:03] v4l2_select_input: Device doesn't support VIDIOC_G_STD     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_do_set_pix_format: Testing palette YUYV (1280x720)     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_do_set_pix_format: Using palette YUYV (1280x720) bytesperlines 2560 sizeimage 1843200 colorspace 00000008     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls: found control 0x00980900, "Brightness", range 0,255      [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls:   "Brightness", default 128, current 128     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls: found control 0x00980901, "Contrast", range 0,255      [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls:   "Contrast", default 32, current 32     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls: found control 0x00980902, "Saturation", range 0,255      [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls:   "Saturation", default 32, current 32     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls: found control 0x00980913, "Gain", range 0,255      [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls:   "Gain", default 64, current 64     [1] [NTC] [VID] [Sep 11 22:24:03] vid_v4lx_start: Using V4L2     [1] [NTC] [ALL] [Sep 11 22:24:03] image_ring_resize: Resizing pre_capture buffer to 1 items     [1] [NTC] [EVT] [Sep 11 22:24:32] event_new_video FPS 2     [1] [NTC] [ALL] [Sep 11 22:24:32] motion_detected: Motion detected - starting event 1     [1] [NTC] [EVT] [Sep 11 22:24:33] event_newfile: File of type 1 saved to: /mnt/sd/arduino/www/motion/01-20140911222431-01.jpg      Looking up that error, it seems there are two types of standards, VIDIOC_G_STD or VIDIOC_S_STD. Is there a way to switch it though?


title: To list out duplicate filenames in a listing?

text: bash-3.00$ cat f.txt     -rw-r--r--   1 mukesh   other        102 Nov  5 18:32 f1.txt     -rw-r--r--   1 mukesh   other         19 Nov  5 18:32 f2.txt     -rw-r--r--   1 mukesh   other        204 Nov  5 18:32 f3.txt //DUPLICATE     -rw-r--r--   1 mukesh   other        204 Nov  6 18:32 f3.txt  //DUPLICATE     -rw-r--r--   1 mukesh   other        204 Nov  6 18:32 f100.txt      Lets say i have the above file-names listed in a file called f.txt. I want to list out all the file-names which have a duplicate( **only file-name** ), display the duplicate file name and number of duplicates. Eg : In the above list f3.txt has a duplicate and there are a total of 2 f3.txt filenames found.


title: How do I remove all sub-directories from within a directory?

text: This question is kind of a phase II to the first question I posted at here I have a directory that contains a bunch of sub-directories, .zip files, and other random files not contained within a sub-directory. I'd like a command line script to remove all sub-directories from within the parent directory, but keep all zip files and loose files that don't belong to any sub-directories. All of the sub-directories have content, so I believe I'd need to force their deletion with the -f command. So basically, a command that looks inside the parent directory (or the current directory), deletes all folders from within it, but keeps all other content and files that are not a folder or contained within a folder. I understand that deleting items from the command line requires special care, but I have already taken all necessary precautions to back up remotely.


title: How to get "apt-get -y upgrade" within a PHP script to function as expected?

text: Yes, I'm aware of unattended-upgrade, but I don't like that package's limitations. I've got a PHP script that makes the following calls:               ...     system("/usr/bin/apt-get update");     system("/usr/bin/apt-get -y upgrade 2>&1 > /tmp/apt_get.txt");     system("/usr/bin/apt-get autoremove");     system("/usr/bin/apt-get autoclean");     ...      The script is set up via cron to run automatically on a schedule. It appears to execute all of the commands correctly as root. However, 'apt-get -y upgrade' doesn't actually perform the upgrade as evidenced here in the output of /tmp/apt_get.txt:               Reading package lists...     Building dependency tree...     Reading state information...     The following packages will be upgraded:       iproute     1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     Need to get 444 kB of archives.     After this operation, 1,024 B of additional disk space will be used.     Get:1 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main iproute amd64 20111117-1ubuntu2.3 [444 kB] Fetched 444 kB in 1s (374 kB/s)      Manually running 'apt-get upgrade' shows that the package was downloaded but not installed:               Reading package lists... Done     Building dependency tree     Reading state information... Done     The following packages will be upgraded:       iproute     1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     Need to get 0 B/444 kB of archives.     After this operation, 1,024 B of additional disk space will be used.     Do you want to continue [Y/n]? n     Abort.      So apt-get successfully downloads the package but doesn't actually perform the upgrade. What do I need to change to get this script to work as expected? It almost seems like a bug in "apt-get -y upgrade" itself. (Running Ubuntu 12.04.4 LTS here.)


title: What should every expert know?

text: What things should any self-professed UNIX expert have under their belt? I'm looking to fill any gaps in my knowledge. Some things I can think of off the bat:   * Shell (interactive and scripting)   * Common utilities (grep, ls, etc.)   * vi (possibly Emacs too)   * Some mix of sed / awk / Perl (preferably all)   * Knowledge of networking standards   * Ability to set up common programs: A mail server, file server and so on Probably forgetting a lot, obvious and not-so-obvious. What else?


title: How do I skip special buffers when killing the current buffer?

text: I have some code in my `.emacs` that prevents it from showing some pre-defined special buffers when I'm using `previous-buffer` and `next-buffer`:               (defadvice next-buffer (after avoid-messages-buffer-in-next-buffer)       (when (string= "*Messages*" (buffer-name)) (next-buffer))       (when (string= "*Completions*" (buffer-name)) (next-buffer))       (when (string-match "\*tramp.*\*" (buffer-name)) (previous-buffer))        ... and so on)      This works great, but I'd like to have the same functionality for `C-x` `k`. So far, I've tried writing the same kind of function `(defadvice (after kill- buffer) ...)`, but that doesn't seem to work. How do I go about doing this?


title: Why the inconsistency with using cat vs. echo piped to this sed command?

text: Inspired by this question: sed: N command does not read single line I wanted to understand why there appears to be an inconsistency between the following 2 commands: ### #1. echo This command produces no output               $ echo -en 'abc\n' | sed -n 'N;p'     $      A hex dump of the output from `echo`: _od - octal dump_               $ echo -en 'abc\n' | od -tx1     0000000 61 62 63 0a     0000004      _hexdump_               $ echo -en 'abc\n' | hexdump -C     00000000  61 62 63 0a                                       |abc.|     00000004      ### #2. cat If I put the string 'abc\n' in a file such as this:               1: abc     2:      That's a line with the string `abc` on it followed by a linefeed (`\n` aka. `0x0A`). Then pipe it to `sed` as before, I get this:               $ cat abc.txt | sed -n 'N;p'     abc          $      That's output that includes the string `abc` followed by 2 linefeeds. _od - octal dump_               $ cat abc.txt | od -tx1     0000000 61 62 63 0a 0a     0000005      _hexdump_               $ cat abc.txt | hexdump -C     00000000  61 62 63 0a 0a                                    |abc..|     00000005      I'm a little perplexed as to what's going on? ### UPDATE OK so my issue was with how I was creating the file `abc.txt` as @choroba pointed out. I was creating the file in `vim` and not realizing that it was adding 2 linefeeds. When I enabled visibility of special characters it became a little more obvious:               :set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<,     :set list      Now in `vim` file `abc.txt` looked like this:               abc$     $      If I created the file as @choroba suggested then the file `abc.txt` showed up as expected:               $ cat abc.txt | od -tx1     0000000 61 62 63 0a     0000004      And it behaved identical to the original `echo` example:               $ cat abc.txt | sed -n 'N;p'     $       ### Original issue My original issue with why `sed -n 'N;p'` wasn't displaying anything was answered thanks to @enzotib's answer. The bit from the POSIX standard is what I wasn't picking up on: > If no next line of input is available, the N command verb shall branch to > the end of the script and quit without starting a new cycle or copying the > pattern space to standard output


title: How to autostart a background program by a non-root user?

text: As a non-root user, I want to run a background job when the system boots. It's sort of a service which doesn't require root privilege. Is there a way to do it? One way is to put `sudo -u user command` in `rc.local`, but editing `rc.local` requires root privilege. Another way is to launch it from `cron` every minute and check for any running instance, but firstly it wakes up the system unnecessarily and secondly, there can be race condition in checking running instances. A third way is to run it in `~/.bash_profile`, but I want to start it without user login.


title: Under Mint 12 on an HP Pavillion DV7, my wireless stopped working

text: My wireless worked when I first installed. I needed to turn it off for a while, so I clicked "off" in the pulldown dialog. I used the wired network for awhile, but when I went to turn my wireless back on, it started connecting for half a second then dropping the connection. I can use the wired interface but my office doesnt have a wire so I have to go out into a common room to work. Very irritating. Can anyone help me? Note that this isn't the same problem as this, as he never had wireless afaict. Maybe it is and I don't understand something. UPDATE: The device is a Atheros AR5B91, and dmesg is reporting the following:               [  314.769728] wlan0: authenticate with 00:22:3f:80:10:fc     [  314.787528] wlan0: send auth to 00:22:3f:80:10:fc (try 1/3)     [  314.789526] wlan0: authenticated     [  314.804098] wlan0: associate with 00:22:3f:80:10:fc (try 1/3)     [  314.806466] wlan0: RX AssocResp from 00:22:3f:80:10:fc (capab=0x421 status=0 aid=3)     [  314.806470] wlan0: associated     [  316.024238] wlan0: deauthenticating from 00:22:3f:80:10:fc by local choice (reason=3)


title: How can I test the RAM for data corruption on an ARM-based system?

text: I have an embedded device. It is ARM based, with Linux 2.6.31 and has 256 MB RAM. I wanted to get some ideas/tips on what is the most effective way to test the device RAM for data corruptions. Is there a test/software that someone can suggest? Note: I have memtester now. I got it after suggestion from Ulrich Dangel (below). I also have `mtest` set up from the uboot now. Any other tests / approaches I could use?


title: Need to delete a directory with name '~' created accidentally

text: I don't remember exactly how this directory got created. It's name is `~`, the alternative we all use for `home diretory`. I also see a sticky bit attached with this directory. How shall I delete it? I fear running a normal rmdir would delete all the files from the home directory recursively. Here are the details :               mtk4@laptop:~/temp$ ls -l     total 4     drwxrwxr-t 2 mtk4 mtk4 4096 Oct 17 2011 ~      How shall I proceed? Another question : What does the `total` number specify on the first line of output of `ls -l` ? '4' in this case. There is just 1 directory as shown(other than `.` and `..`). I am using ubuntu 12.04. Also asked same question on askubuntu, as it seems to be relavant on both sites.


title: Please help diagnose very slow Remmina session for VirtualBox VM

text: I'm using Remmina 0.9.99.1 with CrunchBang VMs on a remote server (VirtualBox 4.3.4 on Debian 7.2.0 x64). I'm using RDP with TLS security, and connect through a UDP-mode VPN. With freshly-installed CrunchBang VMs, Remmina sessions are unusable, with high latency and retransmission artifacts. The VPN becomes saturated, and ping increases from 200-300 ms to 2-4 seconds. However, Remmina sessions become usable after setting "xset r off" in OpenBox autostart to disable keyboard repeat. What might be causing this? In addressing questions about similar problems, some have recommended the disabling of receive window auto-tuning. But I see nothing relevant in documentation for either VirtualBox or Remmina. Given that I'm using a UDP- mode OpenVPN connection, I don't believe that this is a classic TCP-via-TCP retransmission storm.


title: New to using serial console and trying to log into embedded system

text: I have two PC Engines Alix 2d2 which I've been given and I'm trying to install an (BSD or Linux based) OS on. Currently one has a version of openWRT (the other had openWRT until I formatted the CF card and put on a version of FreeDOS (I don't know if this works because no console)). Both boards were in working order before I began, allbeit working as openWRT systems. I did not test either of their serial ports before I started (although i have changed nothing about the second system so...) In addition to the alix boards I have:   1. a Windows desktop without a built in serial port   2. a USB to serial adapter which I have been using with the Windows desktop   3. a Linux box which has a serial port on the motherboard   4. one serial cable (Startech branded, described as straight through) I have connected each alix board to both computers 1 at a time trying to get, well, anything to come though the serial connection. I've read several articles and how-tos on the internet about the alix boards noting that the speeds mentioned either seem to be 9600 or 38400 so I've tried both. On Windows I was using PuTTY's serial mode to connect (I double checked which com port I was using) and on Linux I was using minicom with the `-D 9600/38400 -p /dev/ttyS0` (I also have ttyS1-3 but minicom would not connect to them). So far I've had nothing from the boards, the how-tos describe a brief memory check when they boot, but I've not seen a single character. Never having used a console over serial before I'm at a loss as to what I should try next so any suggestions (or reading material) would be very welcome.


title: Linux mint update error

text: I just got some updates for my **linux mint** and when I try to install them a message like this appears:               Failed to fetch cdrom://Linux Mint 16 _petra_ - Release amd64 20131126/dists/saucy/contrib/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs     Failed to fetch cdrom://Linux Mint 16 _petra_ - Release amd64 20131126/dists/saucy/main/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs     Failed to fetch cdrom://Linux Mint 16 _petra_ - Release amd64 20131126/dists/saucy/non-free/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs     Failed to fetch cdrom://Linux Mint 16 _petra_ - Release amd64 20131126/dists/saucy/contrib/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs     Failed to fetch cdrom://Linux Mint 16 _petra_ - Release amd64 20131126/dists/saucy/main/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs     Failed to fetch cdrom://Linux Mint 16 _petra_ - Release amd64 20131126/dists/saucy/non-free/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs     Some index files failed to download. They have been ignored, or old ones used instead.      Can somebody help me?


title: How can I check how much space I am allowed to use on a linux server?

text: I have some giant files I'd like to back up by putting them on a server I am allowed to use for such things. However, I am uncertain about how much space I am allowed to use. Is there any way of checking this after I have sshed to said server?


title: Why does LUKS need to generate hash values?

text: If you create a new LUKS device, you can specify the option `-hash` and `-iter-time`. For example like this:                sudo cryptsetup luksFormat --cipher aes-cbc-essiv:sha256 --key-size 256 --iter-time 2100 --hash sha512 /dev/loop0      From the manpage of cryptsetup: > --hash, -h > > For create action specifies hash to use for password hashing. > > For luksFormat action specifies hash used in LUKS key setup scheme and > volume key digest. Because of the first sentence I naively assumed that the hash is used in a similar way as in a standard linux system, where a hash value is created by a specified algorithm (for example `sha512`). To make it harder for an attacker which has the hash and wants to try a dictionary attack, the has is salted and the algorithm is iterated n-times to make computation time longer. In this case the has value is stored in `/etc/shadow`. If a user logs in, the hash is computed and compared to the value in the `/etc/shadows` file. If they are equal, the user is accepted to login. In a similar way an attacker which owns the file `/etc/shadow` (from where he also knows the salt value) can compute hashes from words in a dictionary and compare it to the value in the `/etc/shadow` file until some string matches. If the hash in LUKS were used in a similar way, I assumed it must be stored somewhere (for example in the partition header) and if the attacker had access to the partition header (or the file where it is stored) for some reasons, he could proceed in a similar way as above to find out the password. This lead me to the question about how to get the hash: How can I extract the hash value of a LUKS device? Thinking about how the LUKS system may work, I guess that it is not used in this way. Instead I think, that the password is just used to encrypt the key (and no hash is stored anywhere), which is stored encrypted in the header. But in the LUKS man-page I didn't find any hint, which encryption algorithm is used for key encryption and how to change it. (The options `\--cipher aes-cbc- essiv:sha256 --key-size 256` refer to the actual algorithm which is used to encrypt the partition but not the key). This indicates for me that this understanding my be also incorrect. So, how does this all really works and what is the role of the hash described above? Would be great if someone could clarify my misconceptions above (perhaps with some references).


title: How to keep ftp connection alive

text: Some ftp websites have a small time out value. When you do some other jobs, ftp connection dies and you should log in again. How can I keep my connection alive? **Edit:** It will be appreciated if somebody provide a method for `ftp` command as it is light and easy.


title: what is a Kernel?

text: I'm learning Unix from the Unix Architecture book by Maurice J Bach. So if my question seems too stupid, please do bear with it. I read a few related questions but I would like a more simple explanation, with an example. My confusion is with the concept of kernel. What is a kernel? I understand it's the operating system and it is a process. But when my teacher teaches he says a system call(), results in a process going from user mode to kernel mode. What actually happens in a system call? Does the user process go to sleep and the operating system execute it on behalf of user process and returns the value to the user process or does the user process execute in kernel mode? If the latter is correct, what does it mean?


title: udev does not see drm subsystem changes on laptop resume

text: I am using udev to manage setting up monitors on my ThinkPad T400. I use a docking station, and the desired behavior is that when I dock the laptop, the LVDS output is turned off, and the DVI-0 output is enabled. Likewise, when I remove the laptop from the dock, DVI-0 is turned off and LVDS is turned back on. This all works fine, _as long as the laptop is not suspended_. However, the way I normally work is to use the laptop during my commute, suspend it, dock it and _then_ switch it on. If I do things in this order, udev never observes changes to the drm subsystem. Which is weird, because a call to `xrandr` does indeed show that DVI-0 now exists. Does anyone have any ideas on why this might be occuring, and what I can to debug/solve this problem?


title: Efficiently remove file(s) from large .tgz

text: Assume i have an gzip compressed tar-ball compressedArchive.tgz (+100 files, totaling +5gb). What would be the fastest way to remove all entries matching a given filename pattern for example prefix*.jpg and then store the remains in a gzip:ed tar- ball again? Replacing the old archive or creating a new one is not important, whichever is fastest.


title: What is the difference between Halt and Shutdown commands?

text: What is the difference between the `halt` and `shutdown` commands?


title: photorec couldn't recover last saved file

text: Yesterday I deleted by mistake the content of current directory which had many c programs. Later I successfully recovered all the files **(using command photorec)** with one issue. The issue is: for 1 file I saw that the last saved matter wasn't recovered. I explain what I mean: I wrote a file, saved then edited again saved and edited.... For that file I see that many files are present in the recovered files. In 1 recovered file 5 lines of code (for that file) is present and in other 30 lines. But the matter that was present in the file when I last saved it couldn't be recovered. So what I mean is that intermediate matters are recovered of that file but the last saved one wasn't present in the recovered files. Does one has any idea why so!! Because it seems if previous matters are recovered then last saved should obviously be present in the recovered files. This Q is a result of this post.


title: Arg list too long error while using find

text: I have the `find` command as follows:               find /jobs/logs/* -prune -name '*.log' -type f -mtime +1 |         while read LOGFILE         do             echo $LOGFILE         done      This is failing due to the following error:               /usr/bin/find: arg list too long      Can anyone suggest a way to fix this? (This is a continuation of my previous question.)


title: Changing HFSPlus UUID from PartedMagic

text: I needed to make a clone of my hard drive recently (bad blocks FTW). I was using Clonezilla at the time. However, Clonezilla refused to copy the HFS+ partition, so I did it manually. The problem is that the UUIDs are out of sync. What is the command to set a specific UUID for HFS+?


title: Linux stack for a home network firewall/proxy?

text: I've got a generic home 'network' where my ISP supplied modem acts as router with a software firewall built-in. My PCs connect directly to this router to access the Internet. I want to place a box in between my home computers and the broadband modem. This would act as proxy passing all traffic back and forth, together with a firewall and intrusion detection system/packet sniffer.   * Is there a prebuilt Linux flavour that would do this out of the box so to speak?    * What software on top of the OS is required?    * Would installing a software packet sniffer here be a big performance hit? Would the proxy be a big performance hit? E.g. with multiple boxes active simultaneously, would the proxy need to be multi-core?    * Can I just use any average desktop PC for hardware just so long as there's two network adapters or are there any specific specs for this task?    * Also what is a known working linux/wireless card combo when the wifi adapter is operating in master mode i.e. a WiFi hotspot?


title: Can't ssh anywhere

text: I've tried about 4 hosts, everyone gives me the same result with `ssh -vvv`               OpenSSH_6.0p1, OpenSSL 1.0.1c 10 May 2012     debug1: Reading configuration data ~/.ssh/config     debug1: ~/.ssh/config line 6: Applying options for xmpp     debug1: Reading configuration data /etc/ssh/ssh_config     debug2: ssh_connect: needpriv 0     debug1: Connecting to ... [...] port 22.     debug1: Connection established.      and then it hangs, even to machines in the local network.               ssh -V: OpenSSH_6.0p1, OpenSSL 1.0.1c 10 May 2012      also tried with 5.9, no change. `localhost` fails as well:               OpenSSH_6.0p1, OpenSSL 1.0.1c 10 May 2012     debug1: Reading configuration data ~/.ssh/config     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: Connecting to localhost [::1] port 22.     debug1: Connection established.