title: How to delete files filtered out by awk

text: I have the following files in a directory:               -rw-r--r-- 1 smsc sys  46 Apr 22 12:09 bills.50.1.3G.MO.X.20120422120453.Z     -rw-r--r-- 1 smsc sys  28 Apr 22 12:15 bills.50.1.3G.MO.X.20120422120953.Z     -rw-r--r-- 1 smsc sys  46 Apr 22 12:20 bills.50.1.3G.MO.X.20120422121453.Z     -rw-r--r-- 1 smsc sys  46 Apr 22 12:25 bills.50.1.3G.MO.X.20120422121953.Z      Where the fifth column is the file's size. I wish to delete all files which size is 46. In order to filter out these files I used the following command:               ls -ltr | awk '$5 ~ /46/ {print $0}'      Which works fine. But now I want to delete all files which were filtered out, so I add the following to the above command:               ls -ltr | awk '$5 ~ /46/ {print $0}' | xargs rm      However it gives me the following error:               rm: invalid option -- w      It seems that I have to use `find` over `ls` so I will get the output in the below format:               ./bills.50.1.3G.MO.X.20120421050453.Z     ./bills.50.1.3G.MO.X.20120421154953.Z     ./bills.50.1.3G.MO.X.20120419133452.Z      But then I have no way to filter the files by its parameters. How this task could be done?


title: how do I set quotes around a variable so that the programs sees them as quote marks

text: I am trying to get quotes around a variable to make is just like I typed it in the terminal to get this script to work. it shows " quotes around the varibale " but still does not see it as quotes, as far as I can figure out because it does not work.                   hs='#'          echo ${hs}${hex}     echo  "\" #${hex} \""     echo  "\"#${hex}\""     #one way trying     hsetroot -solid "\"${hs}${hex}\""     #another way of trying     hsetroot -solid "\""${hs}${hex}"\""      either way I put the " qoutes " around the variable, as you can see they both come up with quotes on both sides, and it still does not work. Yet if I type the "#31064d" into the terminal putting it where it needs to be then it works. output:               #31064d     " #31064d "     "#31064d"     Bad color ("#31064d")      Bad color ("#31064d")      this works it is a good color code               userx@bw2-crunchbang:~/testscript$ hsetroot -solid "#31064d"      HOW do I format it in script so a program that needs the pram to be in quotes sees it in quotes? I tried writing it this way too.               echo "\""#${hex}"\""     hsetroot -solid "\"#${hex}\""      output:               Bad color ("#12eba5")      you see the " quotes " are still added around the numbers and letters like typing it into the terminal yet I get a nope, not working. I've tried the ' ' and the `` marks too, no go.


title: Debian jessie does not boot from external hdd

text: I have an external HDD I want to install debian to. So I downloaded. Iso, boot to flash drive, then runned installer and went through the installation steps. The problem is that after the installation when I select external HDD as bootable from BIOS nothing happens (just blinking cursor actually). The only thought I have is that I could make a mistake during installing grub boot loader - I've selected external drive to install loader to instead of master boot record of my first inernal drive (I have Windows on it actually). Is that right? I want it to be bootable on other PC too. Looks like I've missed something. Does someone know the solution?


title: How difficult will it be to determine, get and apply latest patches to Solaris 8

text: I have a Sun Ultra Enterprise 2 running Solaris 8 (Generic_108528-11). This hasn't had any patches applied for years. I just now got the configuration right for connecting to the internet through my Verizon router. I want to get an uptodate browser (it's currently running Netscape 4.76!) but I suspect that I'll need to have the latest (or perhaps the last) patches created for Solaris 8 applied in order to have a current browser work. How difficult will it be to determine what patches I need and the get and apply them? I've considered upgrading to a newer version of Solaris but I don't think any newer version that will run on this box is available on CD; everything is on DVD and I don't even know if I could replace the CD-ROM drive with a DVD drive. I'm pretty much a novice when it come to Solaris or Unix when it comes to administration.


title: Is it possible to install a linux desktop environment from a live cd?

text: My question is about Linux in general but lets suppose my ubuntu isn't working property, booting in tty or whatever. I have no internet connection but I have ubuntu live cd. Is it possible to reinstall the desktop environment from live cd?


title: Protected Execution Environment

text: I've been recently investigating for the best way to implement a Protected/Secured Execution Environment that would allow me to "upload" some code into that environment and block any kind of output (from the code execution) towards the Operating System - this way, if the code has buggs that would compromise the system, nothing would get "damaged". So far, I figured out that the most common solutions are:   * Sandboxing   * Virtual Machines   * File Versioning Systems (e.g. Partitioning) However, all of the above have following disadvantages, respectively:   * functionality is limited   * no support for reproduction or committing   * no mechanisms to check changes made by different processes So, I figured out by reading some articles that the best way to achieve this would be using a Virtual File System (VFS) and FUSE. Am I correct, or are there any better solutions? Concerning the VFS and FUSE: What is the best (supported) Python implementation for this? fusepy?


title: Converting .okular file to pdf

text: I am using a djvu file, and with okular I have annotations in it. Now, I wish to be able to use this file in Mendeley, which supports only pdf extensions. I know that I can save annotations in okular using Export As -> Document Archive. But that is saved with .okular extension. How do I convert it to .pdf?


title: What software or drivers do I need to shut off to use `flashrom`?

text: I have backed myself into a corner with a new system I'm building. The current BIOS is completely broken (it locks up after drawing half the screen if you enter settings during POST, locks up if any EUFI device is present in the system, etc). I am able to boot into a semi-functional linux environment using a GRUB cdrom. In researching alternative ways to flash this bios, one option I turned up was the Linux based utility flashrom. I am able to run the `flashrom` utility and it finds the chipset and memory space that I need to write. However when I try to either read or write (`-r`/`-w` args), I am greeted with a message saying the utility is unable to read from the chip > Found chipset "AMD SB7x0/SB8x9/SB9x0". Enabling flash write... OK.   >  Found Winbod flash chip "W25Q64.V (8192 kB, SPI) at physical address > 0xff800000.   >  Reading old flash chip contents... FIFIO pointer corruption! Pointer is 0, > wanted 3   >  Something else is accessing the flesh chip and causes random corruption.   >  Please stop all applications and drivers and IPMI which access the flash > chip.   >  FAILED. I have been unable to locate what software, drivers, kernel modules or other devilry has the device open. What do I need to shut down or how can I find the culprit?


title: Keep only first match from locate output

text: I need to `locate` a library on my system and it's name is expected to be found a couple of times. I want to keep only the first occurrence. So far I've tried some methods for splitting strings by newlines but neither seem to work with `locate`'s output. I'm not using `find` because I don't know where the lib may be in advance. Any other (better) way to handle this is also welcome.


title: bash - complex prompt

text: I want to have really complex prompt. It should contains login, computer name, date, time, working directory, result of last command and new line symbol. I want to color each item as well. So I inserted into my `.bashrc` some kind of monster like this one:               # login and computer name     PS1='[\e[1;37m\]\u\e[m\]@\e[1;32m\]\h\e[m\]] '     # date, time and working directory     PS1=$PS1'[\e[1;34m\]\D{%Y-%m-%d} \e[1;35m\]\t\e[m\]] \e[1;33m\]\w\e[m\] '     # result of last command and command prompt in new line     PS1=$PS1'\e[1;31m\]${?#0}\e[m\]\n \e[1;36m\]\$\e[m\] '      I do know it is terrible solution, but I have too little experience with bash to improve this. But this is not the only one problem.                $ aaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa     bash: bbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: command not found...      After the last `a` I pressed `Home` key, but visual caret didn't go to the beginning of the command. As you can see, actual caret went to the beginning. Why this occurred? How can I improve my command prompt in my `.bashrc`? * * * ## Update: After using @Groxxda advice, I've got one another problem. My `.bashrc` `PS1` definition looks like this one. Described issue doesn't occur now. But if in my command history I have `ls` and before this I have `cat script.sh`, and if I push arrow up twice, I have got command like `cat scls` and buffer has only two signs (only `ls`). Why this occurs? How can I manage this?


title: Searching for i686 UEFI distribution of Linux

text: I m trying to put a dual boot Windows 8 - Linux on a HP ENVY j069-sf (i686). Like all HP laptop, there is a lot of proprietary drivers (even when installing Windows, I had to take 2 hour to search, download and install all of them). So far, I tried Debian and Ubuntu, in legacy mode. Debian can install but can t boot. Ubuntu don t detect any partition and see my HDD as empty. Both needed me to download the 32bit (i386) version because AMD64 do not work. Is there other distribution which support i686 and UEFI? I ll add that I don t care about GUI for anything other but start Firefox/Iceweasel or VLC, the main use will be `nano` and `gcc`/`gpp`. EDIT: I have experience with Debian in command line (half-failed installation on old computer, couldn t install proprietary graphic-card driver, and Raspberry Pi's Raspbian), and used Ubuntu for some time. I ve touched other distribution, but either very old version (Fedora...) or for too few times to know them (CentOS...).


title: Update a Red Hat repo with no packages

text: I'm attempting to install a handful of packages on my RHEL 5.10 (Tikanga) server, however I'm prevented from doing this because of an installed repo with zero packages. When I do `yum repolist`, it shows up as this (other repos hidden):                repo id       repo name                     status       zabbix        RS Zabbix Repository          0      I came across the answer in this thread however, I'd rather update it or restore the packages that it should have rather than delete or disable it. How can I go about this? All searching points to systems that do not apply to me. Here is the output from `yum repolist -v zabbix`:               Loading "rhnplugin" plugin  Loading "security" plugin  Config time:     0.072 This system is receiving updates from RHN Classic or RHN Satellite. Looking for repo options for [main] Looking for repo options for [rhel-x86_64-server-5] Repo 'rhel-x86_64-server-5' setting option 'enabled' = '1' Repo 'rhel-x86_64-server-5' setting option 'gpgcheck' = '1' Looking for repo options for [rs-rhel-x86_64-server-5-common] Repo 'rs-rhel-x86_64-server-5-common' setting option 'enabled' = '1' Repo 'rs-rhel-x86_64-server-5-common' setting option 'gpgcheck'     = '1' Looking for repo options for [rhel-x86_64-server-vt-5] Repo 'rhel-x86_64-server-vt-5' setting option 'enabled' = '1' Repo 'rhel-x86_64-server-vt-5' setting option 'gpgcheck' = '1' Yum Version:     3.2.22 http://el5.racklabs.co.uk/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: zabbix. Please verify its path and try again


title: Single instance of script, but only with same arguments

text: I have this beautiful little code here that will exit from a script if there's another instance of it running:               single_instance(){         if pidof -x "${0##*/}" -o %PPID >/dev/null; then             exit 0         fi     }      But what I'm looking for is a function that will exit only if the script has been **called with the same arguments**. I know I could hack my way with a `cat | grep | awk | cut | sed | tac | sort | uniq` solution, but I wonder if there's a simple way of doing this with utilities like `pidof`, `ps`, etc. How would you go about doing this?


title: Command for finding open ports

text: On my linux servers I have this alias set:               alias ns="sudo lsof -Pi|grep -v ESTABL|grep -v CLOSED|grep -v -e '->' |      tr -s ' ' '\t' | awk '{print $3 "\t" $8 "\t" $5 "\t" $9 "\t" $1}'|     column -t|sort"      It gives me output like this:               Active Internet connections (only servers)     Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/Program name     tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      root       10459       2330/imap-login      tcp        0      0 0.0.0.0:22223           0.0.0.0:*               LISTEN      root       9646        4095/sshd            tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      root       10762       4724/master          tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      root       8576        362/apache2          tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      root       8574        362/apache2          tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      root       10460       2330/imap-login      tcp        0      0 127.0.0.1:2000          0.0.0.0:*               LISTEN      root       10461       4639/dovecot         tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      mysql      10967       3454/mysqld          tcp        0      0 127.0.0.1:783           0.0.0.0:*               LISTEN      root       9748        4371/spamd.pid        I want the same output for OSX, but `lsof` etc. are behaving differently. I think because it comes from BSD. The problems i'm having:   * When I just type the alias "ns" nothing is outputted.   * When I type the whole command I get the following output output:               USER            NODE    TYPE  NAME                        COMMAND     _locationd      UDP     IPv4  *:*                         locationd     _mdnsresponder  UDP     IPv4  *:5353                      mDNSRespo     _mdnsresponder  UDP     IPv4  *:54398                     mDNSRespo     _mdnsresponder  UDP     IPv6  *:5353                      mDNSRespo     _mdnsresponder  UDP     IPv6  *:54398                     mDNSRespo     _netbios        UDP     IPv4  *:137                       netbiosd     _netbios        UDP     IPv4  *:138                       netbiosd      I need:   * numeric ports and adresses   * the whole command and PID


title: Find out exact installation time of CentOS

text: I installed CentOS on my laptop about 8 month ago, and I want to know when **exactly** I installed it , how can I do that in CentOS 6.4 ?


title: How to lock users with PAM in Scientific Linux 5.5?

text: I need to lock the users that are trying to log in via SSHD after 5 unsuccessful login tries. I already googled for it, but I just can see it working:               root@server:~# faillog -u testuser     Login       Failures Maximum Latest                   On     testuser        0        0         The Maximum faillog is always 0 for a reason... **QUESTION** : What packages do I need to have installed? What settings do I have to make? I know that I must have "UsePAM yes" in the sshd_config, that's OK. Does it counts that where am I putting the PAM lines in ex.: system-auth?


title: Start and stop tomcat through ant script which is running in cygwin

text: I am trying to start and stop my tomcat through ant build.xml as follows, I am running the ant script in cygwin , i get the following error D:\build- cygwin-copy_converted.xml:53: Execute failed: java.io.IOException: Cannot run program "shutdown.sh" (in directory "D:\apache-tomcat-6.0.36\bin"): CreateProcess error=2, The system cannot find the file specified Could you please advise?


title: How do you stop NetworkManager in Gnome 3?

text: I'm trying to force my wifi card to connect over the G-band as per this question. However, when I run `iwconfig`, I am told the resource is busy:               [root@Eiger ~]# iwconfig wlan0 freq 2.422G     SET failed on device wlan0 ; Device or resource busy      I'm pretty sure this is because NetworkManager is running. However, when I try to stop it, it just respawns again. I've tried stopping it through `systemctl stop` and `kill`. How can I permanently turn off NetworkManager in Gnome 3?


title: How can I background a shell script during a Kickstart?

text: I have a Red Hat Kickstart process which reports its progress at key points via a POST request to a status server. This is fine during `%pre` and `%post`, but when the actual build is taking place between them, it's an informational black hole. I've written a simple shell snippet that reports on the number of packages installed to give a rough idea of progress. I've placed the following in `%pre`:               %pre          ## various other stuff here, all works fine ##          cat > /tmp/rpm_watcher.sh << EOF_RPM     PREV=-1     while true     do         COUNT="\$(rpm -qa | wc -l)"         if [ \${COUNT} -ne \${PREV} ] ; then             /bin/wget --post-data " ${Hostname} : Package count \${COUNT}" ${builddest}/log             PREV=\${COUNT}         fi         sleep 15     done     EOF_RPM     /bin/sh /tmp/rpm_watcher.sh &     disown -a     %end      However, when I launch this as a background task from `%pre` as above, it hangs waiting for the script to end -- `%pre` never completes (if I kill the spawned script `%pre` completes and the build proper starts). I can't use `nohup` as it isn't available in the pre-installation environment, the same goes for using `at now` and `screen`. I've attempted to use `disown -a`, which is available; this seems to successfully disown the process (such that it's owned by PID 1) but still it hangs waiting for the script to finish. Can anyone offer me an alternative?


title: Getting 401 error from Old-Release Ubuntu Server

text: I am running Lubuntu 10.10 for a server that I use at home. I keep getting errors from the old-releases.ubuntu.com repositories I have to use. They are 401 access denied errors, has anyone else ever seen this before?                   W: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/maverick-updates/restricted/binary-i386/Packages.gz  401  Unauthorized         W: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/maverick-updates/universe/binary-i386/Packages.gz  401  Unauthorized         W: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/maverick-updates/multiverse/binary-i386/Packages.gz  401  Unauthorized        W: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/maverick-backports/main/source/Sources.gz  401  Unauthorized         W: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/maverick-backports/restricted/source/Sources.gz  401  Unauthorized         W: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/maverick-backports/universe/source/Sources.gz  401  Unauthorized        W: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/maverick-backports/multiverse/source/Sources.gz  401  Unauthorized         W: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/maverick-backports/main/binary-i386/Packages.gz  401  Unauthorized         W: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/maverick-backports/restricted/binary-i386/Packages.gz  401  Unauthorized         W: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/maverick-backports/universe/binary-i386/Packages.gz  401  Unauthorized         W: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/maverick-backports/multiverse/binary-i386/Packages.gz  401  Unauthorized         E: Some index files failed to download, they have been ignored, or old ones used instead.      These are the last few lines of the console output.


title: Virtualbox: Mount a shared folder in Guest FreeBSD from Host Ubuntu

text: I have Ubuntu 12.10 as Host OS and FreeBSD 9 as Guest OS in Virtualbox 4.1.18. I have Samba installed in both Ubuntu and FreeBSD and shared a few folders from virtualbox, also ticking the `automount` option. I have also done `right click and share` in Ubuntu. But when I try to mount in FreeBSD using               mount -t vboxfs sharedfolder /home/user/shared`      it says `sharedfolder` operation not permitted. I also used               mount_smbfs //10.0.0.2/sharedfolder /home/user/shared      but I get `can't get server address` How to share folder/files between Host Ubuntu and Guest FreeBSD from virtualbox ?


title: How do you encrypt a USB drive partition with the Twofish cipher and SHA-512 hash without using TrueCrypt?

text: I've been trying to string together the right flags in cryptsetup:               cryptsetup -y -h sha512 -c twofish-xts-plain64 -s 512 luksFormat /dev/sdx      But it hasn't been working. When I enter the command listed above, nothing happens; it doesn't even prompt me for a password. Trying this command with aes-xts-plain64 doesn't work either. Perhaps I'm doing something wrong? Or maybe there's a different program I could try. At this point I'd be willing to try anything.


title: EDAC (Error Detection And Correction) infrastructure in linux kernel

text: I am wondering how I can make use of the `EDAC` infrastructure in linux kernel. I have a `i7-4600M` CPU and I have compiled EDAC as a module in my kernel:               --- EDAC (Error Detection And Correction) reporting     [ ]   EDAC legacy sysfs     [ ]   Debugging     <M>   Main Memory EDAC (Error Detection And Correction) reporting     < >     Intel e752x (e7520, e7525, e7320) and 3100     < >     Intel 82975x (D82975x)     < >     Intel 3000/3010     < >     Intel 3200     < >     Intel X38     < >     Intel 5400 (Seaburg) chipsets     <M>     Intel i7 Core (Nehalem) processors     < >     Intel Greencreek/Blackford chipset     < >     Intel San Clemente MCH     < >     Intel Clarksboro MCH      However, the module does not get loaded automatically and I am not sure whether if I load it manually with `modprobe`, it will start doing "its work". I don't understand how this `EDAC` thing is supposed to work. In what situation would I find this module useful?


title: How can I play Windows games on Linux?

text: I have Elementary OS (Luna) installed. I want to play some famous Windows games, for example GTA. I also can't find some programs I used to use on Windows 7. Is there a way to run Windows applications on Elementary OS?


title: Difference between ls -l and ll?

text: I'm relatively new to programming as a whole and some tutorials have been telling me to use `ls -l` to look at files in a directory and others have been saying `ll`. I know that `ls` is a short list, but is there a difference between the other two?


title: Problem connecting to L2TP VPN

text: I installed `l2tp-ipsec-vpn` from `ppa:werner-jaeger/ppa-werner-vpn`.   Yesterday I was able to connect to my L2TP vpn account successfully.   But after restart i'm getting this on `syslog`:               Mar 07 21:16:44.834 xl2tpd[7179]: death_handler: Fatal signal 15 received     Mar 07 21:16:44.835 Stopping xl2tpd: xl2tpd.     Mar 07 21:16:44.866 recvref[22]: Protocol not available     Mar 07 21:16:44.867 xl2tpd[7225]: This binary does not support kernel L2TP.     Mar 07 21:16:44.867 Starting xl2tpd: xl2tpd.     Mar 07 21:16:44.868 xl2tpd[7226]: xl2tpd version xl2tpd-1.2.8 started on my-laptop PID:7226     Mar 07 21:16:44.868 xl2tpd[7226]: Written by Mark Spencer, Copyright (C) 1998, Adtran, Inc.     Mar 07 21:16:44.868 xl2tpd[7226]: Forked by Scott Balmos and David Stipp, (C) 2001     Mar 07 21:16:44.868 xl2tpd[7226]: Inherited by Jeff McAdams, (C) 2002     Mar 07 21:16:44.868 xl2tpd[7226]: Forked again by Xelerance (www.xelerance.com) (C) 2006     Mar 07 21:16:44.869 xl2tpd[7226]: Listening on IP address 0.0.0.0, port 1701     Mar 07 21:16:45.898 xl2tpd[7226]: Connecting to host vp3.nasaserver.org, port 1701     Mar 07 21:16:50.903 xl2tpd[7226]: Maximum retries exceeded for tunnel 39372.  Closing.      I'm using Ubuntu Lucid Lynx.   What is the problem?


title: Running something in a cron environment?

text: Cron executes whatever program is sent to it in such a fashion that anything written to STDERR causes either the kernel (or cron I'm unsure) to receive SIGPIPE. How does this functionality work? Is cron sending SIGPIPE or is the kernel? How can I get that same effect, without running something in cron? Could someone tell me for instance how to run a Perl script such that               #!/usr/bin/env perl     warn 'foo';     print "bar;      Receives a SIGPIPE when it tries to write 'foo' to STDERR, and never writes 'bar'? I want to see Perl terminate and shell variable `$?` return `255`.


title: Building Emacs from trunk without admin access

text: I cloned the official `trunk` branch with:               bzr branch bzr://bzr.savannah.gnu.org/emacs/trunk      I then built `autoconf`, `automake` and `texinfo`. I also updated my `PERL5LIB` to make it include `/path/to/automake/share/automake-1.13` (otherwise I get the error: `can't locate Automake/Config.pm`). I then run:               > autogen.sh       I then run `./configure --without-gif --prefix=/some/path`. I then run `make` and get the following error: `collect2: error: ld returned exit status`. See the full trace below:               gcc -std=gnu99     -I. -I../src -I../lib -I/home/john/bin/emacs/rc/emacs-24.3/lib-src -I/home/john/opt/emacs/rc/emacs-24.3/lib-src/../src -I/home/     john/bin/emacs/rc/emacs-24.3/lib-src/../lib  -Wl,-znocombreloc   -g3 -O2 -DEMACS_NAME="\"GNU Emacs\"" \               -DVERSION="\"24.3\"" /home/john/bin/emacs/rc/emacs-24.3/lib-src/etags.c \               regex.o ../lib/libgnu.a  -o etags     regex.o: In function `stpncpy':     /usr/include/bits/string3.h:160: multiple definition of `stpncpy'     /tmp/ccntBfBN.o:/usr/include/bits/string3.h:160: first defined here     regex.o: In function `realpath':     /usr/include/bits/stdlib.h:37: multiple definition of `realpath'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:37: first defined here     regex.o: In function `ptsname_r':     /usr/include/bits/stdlib.h:53: multiple definition of `ptsname_r'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:53: first defined here     regex.o: In function `wctomb':     /usr/include/bits/stdlib.h:74: multiple definition of `wctomb'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:74: first defined here     regex.o: In function `mbstowcs':     /usr/include/bits/stdlib.h:95: multiple definition of `mbstowcs'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:95: first defined here     regex.o: In function `wcstombs':     /usr/include/bits/stdlib.h:114: multiple definition of `wcstombs'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:114: first defined here     regex.o: In function `read':     /usr/include/bits/unistd.h:35: multiple definition of `read'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:35: first defined here     regex.o: In function `pread':     /usr/include/bits/unistd.h:57: multiple definition of `pread'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:57: first defined here     regex.o: In function `pread64':     /usr/include/bits/unistd.h:77: multiple definition of `pread64'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:77: first defined here     regex.o: In function `readlink':     /usr/include/bits/unistd.h:99: multiple definition of `readlink'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:99: first defined here     regex.o: In function `readlinkat':     /usr/include/bits/unistd.h:121: multiple definition of `readlinkat'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:121: first defined here     regex.o: In function `getcwd':     /usr/include/bits/unistd.h:136: multiple definition of `getcwd'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:136: first defined here     regex.o: In function `getwd':     /usr/include/bits/unistd.h:150: multiple definition of `getwd'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:150: first defined here     regex.o: In function `confstr':     /usr/include/bits/unistd.h:165: multiple definition of `confstr'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:165: first defined here     regex.o: In function `getgroups':     /usr/include/bits/unistd.h:181: multiple definition of `getgroups'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:181: first defined here     regex.o: In function `ttyname_r':     /usr/include/bits/unistd.h:197: multiple definition of `ttyname_r'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:197: first defined here     regex.o: In function `getlogin_r':     /usr/include/bits/unistd.h:213: multiple definition of `getlogin_r'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:213: first defined here     regex.o: In function `gethostname':     /usr/include/bits/unistd.h:230: multiple definition of `gethostname'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:230: first defined here     regex.o: In function `getdomainname':     /usr/include/bits/unistd.h:248: multiple definition of `getdomainname'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:248: first defined here     ../lib/libgnu.a(c-strcasecmp.o): In function `stpncpy':     /usr/include/bits/string3.h:160: multiple definition of `stpncpy'     /tmp/ccntBfBN.o:/usr/include/bits/string3.h:160: first defined here     ../lib/libgnu.a(c-strcasecmp.o): In function `realpath':     /usr/include/bits/stdlib.h:37: multiple definition of `realpath'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:37: first defined here     ../lib/libgnu.a(c-strcasecmp.o): In function `ptsname_r':     /usr/include/bits/stdlib.h:53: multiple definition of `ptsname_r'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:53: first defined here     ../lib/libgnu.a(c-strcasecmp.o): In function `wctomb':     /usr/include/bits/stdlib.h:74: multiple definition of `wctomb'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:74: first defined here     ../lib/libgnu.a(c-strcasecmp.o): In function `mbstowcs':     /usr/include/bits/stdlib.h:95: multiple definition of `mbstowcs'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:95: first defined here     ../lib/libgnu.a(c-strcasecmp.o): In function `wcstombs':     /usr/include/bits/stdlib.h:114: multiple definition of `wcstombs'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:114: first defined here     ../lib/libgnu.a(c-strncasecmp.o): In function `stpncpy':     /usr/include/bits/string3.h:160: multiple definition of `stpncpy'     /tmp/ccntBfBN.o:/usr/include/bits/string3.h:160: first defined here     ../lib/libgnu.a(c-strncasecmp.o): In function `realpath':     /usr/include/bits/stdlib.h:37: multiple definition of `realpath'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:37: first defined here     ../lib/libgnu.a(c-strncasecmp.o): In function `ptsname_r':     /usr/include/bits/stdlib.h:53: multiple definition of `ptsname_r'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:53: first defined here     ../lib/libgnu.a(c-strncasecmp.o): In function `wctomb':     /usr/include/bits/stdlib.h:74: multiple definition of `wctomb'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:74: first defined here     ../lib/libgnu.a(c-strncasecmp.o): In function `mbstowcs':     /usr/include/bits/stdlib.h:95: multiple definition of `mbstowcs'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:95: first defined here     ../lib/libgnu.a(c-strncasecmp.o): In function `wcstombs':     /usr/include/bits/stdlib.h:114: multiple definition of `wcstombs'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:114: first defined here     ../lib/libgnu.a(getopt.o): In function `stpncpy':     /usr/include/bits/string3.h:160: multiple definition of `stpncpy'     /tmp/ccntBfBN.o:/usr/include/bits/string3.h:160: first defined here     ../lib/libgnu.a(getopt.o): In function `realpath':     /usr/include/bits/stdlib.h:37: multiple definition of `realpath'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:37: first defined here     ../lib/libgnu.a(getopt.o): In function `ptsname_r':     /usr/include/bits/stdlib.h:53: multiple definition of `ptsname_r'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:53: first defined here     ../lib/libgnu.a(getopt.o): In function `wctomb':     /usr/include/bits/stdlib.h:74: multiple definition of `wctomb'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:74: first defined here     ../lib/libgnu.a(getopt.o): In function `mbstowcs':     /usr/include/bits/stdlib.h:95: multiple definition of `mbstowcs'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:95: first defined here     ../lib/libgnu.a(getopt.o): In function `wcstombs':     /usr/include/bits/stdlib.h:114: multiple definition of `wcstombs'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:114: first defined here     ../lib/libgnu.a(getopt.o): In function `gets':     /usr/include/bits/stdio2.h:94: multiple definition of `gets'     /tmp/ccntBfBN.o:/usr/include/bits/stdio2.h:94: first defined here     ../lib/libgnu.a(getopt.o): In function `fgets':     /usr/include/bits/stdio2.h:109: multiple definition of `fgets'     /tmp/ccntBfBN.o:/usr/include/bits/stdio2.h:109: first defined here     ../lib/libgnu.a(getopt.o): In function `fgets_unlocked':     /usr/include/bits/stdio2.h:125: multiple definition of `fgets_unlocked'     /tmp/ccntBfBN.o:/usr/include/bits/stdio2.h:125: first defined here     ../lib/libgnu.a(getopt.o): In function `read':     /usr/include/bits/unistd.h:35: multiple definition of `read'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:35: first defined here     ../lib/libgnu.a(getopt.o): In function `pread':     /usr/include/bits/unistd.h:57: multiple definition of `pread'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:57: first defined here     ../lib/libgnu.a(getopt.o): In function `pread64':     /usr/include/bits/unistd.h:77: multiple definition of `pread64'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:77: first defined here     ../lib/libgnu.a(getopt.o): In function `readlink':     /usr/include/bits/unistd.h:99: multiple definition of `readlink'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:99: first defined here     ../lib/libgnu.a(getopt.o): In function `readlinkat':     /usr/include/bits/unistd.h:121: multiple definition of `readlinkat'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:121: first defined here     ../lib/libgnu.a(getopt.o): In function `getcwd':     /usr/include/bits/unistd.h:136: multiple definition of `getcwd'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:136: first defined here     ../lib/libgnu.a(getopt.o): In function `getwd':     /usr/include/bits/unistd.h:150: multiple definition of `getwd'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:150: first defined here     ../lib/libgnu.a(getopt.o): In function `confstr':     /usr/include/bits/unistd.h:165: multiple definition of `confstr'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:165: first defined here     ../lib/libgnu.a(getopt.o): In function `getgroups':     /usr/include/bits/unistd.h:181: multiple definition of `getgroups'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:181: first defined here     ../lib/libgnu.a(getopt.o): In function `ttyname_r':     /usr/include/bits/unistd.h:197: multiple definition of `ttyname_r'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:197: first defined here     ../lib/libgnu.a(getopt.o): In function `getlogin_r':     /usr/include/bits/unistd.h:213: multiple definition of `getlogin_r'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:213: first defined here     ../lib/libgnu.a(getopt.o): In function `gethostname':     /usr/include/bits/unistd.h:230: multiple definition of `gethostname'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:230: first defined here     ../lib/libgnu.a(getopt.o): In function `getdomainname':     /usr/include/bits/unistd.h:248: multiple definition of `getdomainname'     /tmp/ccntBfBN.o:/usr/include/bits/unistd.h:248: first defined here     ../lib/libgnu.a(getopt1.o): In function `stpncpy':     /usr/include/bits/string3.h:160: multiple definition of `stpncpy'     /tmp/ccntBfBN.o:/usr/include/bits/string3.h:160: first defined here     ../lib/libgnu.a(getopt1.o): In function `realpath':     /usr/include/bits/stdlib.h:37: multiple definition of `realpath'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:37: first defined here     ../lib/libgnu.a(getopt1.o): In function `ptsname_r':     /usr/include/bits/stdlib.h:53: multiple definition of `ptsname_r'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:53: first defined here     ../lib/libgnu.a(getopt1.o): In function `wctomb':     /usr/include/bits/stdlib.h:74: multiple definition of `wctomb'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:74: first defined here     ../lib/libgnu.a(getopt1.o): In function `mbstowcs':     /usr/include/bits/stdlib.h:95: multiple definition of `mbstowcs'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:95: first defined here     ../lib/libgnu.a(getopt1.o): In function `wcstombs':     /usr/include/bits/stdlib.h:114: multiple definition of `wcstombs'     /tmp/ccntBfBN.o:/usr/include/bits/stdlib.h:114: first defined here     ../lib/libgnu.a(getopt1.o): In function `gets':     /usr/include/bits/stdio2.h:94: multiple definition of `gets'     /tmp/ccntBfBN.o:/usr/include/bits/stdio2.h:94: first defined here     ../lib/libgnu.a(getopt1.o): In function `fgets':     /usr/include/bits/stdio2.h:109: multiple definition of `fgets'     /tmp/ccntBfBN.o:/usr/include/bits/stdio2.h:109: first defined here     ../lib/libgnu.a(getopt1.o): In function `fgets_unlocked':     /usr/include/bits/stdio2.h:125: multiple definition of `fgets_unlocked'     /tmp/ccntBfBN.o:/usr/include/bits/stdio2.h:125: first defined here     collect2: error: ld returned 1 exit status     make[1]: *** [etags] Error 1     make[1]: Leaving directory `/home/james/bin/emacs/rc/emacs-24.3/lib-src'     make: *** [lib-src] Error 2      Any thougths?


title: Cant install Linux Mint over Ubuntu , Help.....migrating from Windows 7...first time Linux

text: I have Ubuntu 12.10 installed on HDD. Over the last 2 days I have been using Linux Mint on LiveCD and decided that that is what I want. When I partition the hdd should it be in fat32? fat16? or one of the journaling file systems?


title: Downloading Debian packages (for a Crunchbang install) on a Ubuntu computer

text: I'm trying to get the ethernet drivers on a Lenovo T440s to work, more specifically I'm trying to get the intel e1000e ethernet installed. To do that I need the `build-essential` package first, but that alone will not compile unless it has it's dependencies installed. Is there an easy way to download all the dependencies for a package on a second Ubuntu computer for a Debian-based system (Crunchbang on a laptop lacking internet)?


title: Broadcom wireless card in with Fedora 16

text: I just installed Fedora as a dual-boot (other OS in Win7) on my Dell Inspiron 1750 and, of course, the wireless card is missing firmware. The wireless card is called Dell Wireless 1397 WLAN mini-card. When I run `lspci` on Fedora it says that the card is a BCM4312 802.11b/g LP-PHY (rev 01). Some internet searching shows that this card has had a lot of problems before. I don't have access to wired internet, but I do have a USB flash drive. I'm using the instructions for Linux drivers from Broadcom's own website. To quote, > Some of the major linux distros already supply a version of this driver, so > you don't have to compile your own. Most of the distros keep this driver > along with other proprietary or non-GPL drivers in a separate repository. > > For further information see the documentation for your specific distro. > > Fedora: ------ su -c 'rpm -Uvh > > http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release- > stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion- > nonfree-release-stable.noarch.rpm > > su - yum update yum install kmod-wl So I download the two `.rpm` files on Windows and copy them to Fedora, then use `rpm -ivh ...` on them. No idea what that does, but internet still doesn't work. Obviously I can't use `yum` because I don't have internet. Is there a way where I can just download whatever I need, put the stuff on USB, and just install it with `rpm` or whatever? Because the fact that every tutorial out there assumes that the user has access to wired internet is killing me.


title: Why use install rather cp and mkdir?

text: I've seen in many places used `install -d` to create directories and `install -c` to copy a file. Why not use `mkdir` and `cp`? Is there an advantage in using `install`?


title: How do you layout extra storage

text: When I was doing dual boot all my extra storage was simple in /win/d, /win//e, /win/f, ... and formated ntfs. Now the desktop only runs Windows in a VM, and I access all my partitions from samba ( except for the destop ). I'm totally confused how to organise things. So how do you layout your extra HD space that you want multiple users to access ( ps I use different accounts for different things... ie personnas )? Can't all be in /home if different people want to have access to it. Also how do you organize your different data: movies, books, music, scripts written on the computer, software projects, software created outside the package system ( I like to keep such separate ) etc.


title: Export content of screen daemon to file

text: I'd like to export the content of a detached screen under linux. I tried those command:               screen -x 2>&1 > temp     screen -x > temp 2>&1     screen -x > temp      But it's not working, It keeps reattaching to a session instead of exporting it in the "temp" file. Screen version: 4.00.03jw4 What do I do wrong?


title: Mount an iso without root access?

text: Is it possible for a user without root access to mount an arbitrary iso? If so how?


title: WLAN: get info about AP

text: I am troubleshooting WLAN connections from my laptop. I have several possible WLANs to connect to. When connection is established, I am unable to see to which AP I am connected. In my `/var/log/daemon.log` I only see the DHCP negotiation, but I don't see the AP info. I am using `Debian` and `dhclient`. Is there a way to get info about the AP I am currently connected to? Can I make the logging more verbose in `/var/log/daemon.log`


title: Dual boot Solaris and Linux

text: I have a laptop running Oracle Solaris and Gentoo Linux. First I installed Gentoo Linux. I used GPT partitioning scheme. In order to boot Gentoo Linux I have GRUB 2. Then I installed Solaris 11.1. Now GRUB from Solaris overwrote the GRUB from Gentoo Linux and it didn't detect it and so currently I have only Solaris in the boot menu. What I would like to do is to modify Solaris' GRUB configuration in order to do a dual boot by chainloading, since Solaris' GRUB does not support ext2 file system. Unfortunately Solaris documentation about GRUB, which is here, does not give an example about Linux - it's Windows only. So I created `/rpool/boot/grub/custom.cfg`:               root@solaris:/rpool/boot/grub# cat custom.cfg     menuitem "Gentoo" {         insmod gpt_part         insmod chain         set root=(hd0,ext2)         chainload --force +1     }      and then rebooted. When GRUB started, I saw only Solaris menu. Do I have to run some additional commands on Gentoo Linux, in order for the GRUB configuration to take effect? On Solaris, I didn't see anything like this in the docs. What am I missing? At least the menuitem "Gentoo" should be visible in the GRUB. GRUB configuration `/rpool/boot/grub/grub.cfg`:               igor@solaris:~/Broadcom$ cat /rpool/boot/grub/grub.cfg     #     # DO NOT EDIT THIS FILE     #     # It is automatically generated by grub-mkconfig using templates     # from /usr/lib/grub2/bios/etc/grub.d and settings from /usr/lib/grub2/bios/etc/default/grub     #          ### BEGIN /usr/lib/grub2/bios/etc/grub.d/00_header ###     if [ -s $prefix/grubenv ]; then       load_env     fi     set default="0"     if [ "${prev_saved_entry}" ]; then       set saved_entry="${prev_saved_entry}"       save_env saved_entry       set prev_saved_entry=       save_env prev_saved_entry       set boot_once=true     fi          function savedefault {       if [ -z "${boot_once}" ]; then         saved_entry="${chosen}"         save_env saved_entry       fi     }          function load_video {       insmod vbe     }          if loadfont "/@/boot/grub/unicode.pf2" ; then       set gfxmode="1024x768x32;1024x768x16;800x600x16;640x480x16;640x480x15;640x480x32"       load_video       insmod gfxterm       set locale_dir=($root)${prefix}/locale       set lang=en_US       insmod gettext     fi     terminal_output gfxterm     insmod part_gpt     insmod zfs     set root=''     if [ x$feature_platform_search_hint = xy ]; then       search --no-floppy --fs-uuid --set=root  e71191bc1127be5c     else       search --no-floppy --fs-uuid --set=root e71191bc1127be5c     fi     insmod gfxmenu     loadfont ($root)//@/boot/grub/themes/solaris/liber18.pf2     loadfont ($root)//@/boot/grub/themes/solaris/univers16.pf2     loadfont ($root)//@/boot/grub/themes/solaris/univers20.pf2     insmod jpeg     insmod png     set theme=($root)//@/boot/grub/themes/solaris/theme.txt     set timeout=30     ### END /usr/lib/grub2/bios/etc/grub.d/00_header ###          ### BEGIN /usr/lib/grub2/bios/etc/grub.d/10_solaris ###     menuentry "Oracle Solaris 11.1" {         insmod part_msdos         insmod part_sunpc         insmod part_gpt              insmod zfs              search --no-floppy --fs-uuid --set=root e71191bc1127be5c         zfs-bootfs /ROOT/solaris/@/ zfs_bootfs         set kern=/platform/i86pc/kernel/amd64/unix         echo -n "Loading ${root}/ROOT/solaris/@$kern: "         $multiboot /ROOT/solaris/@/$kern $kern -B console=graphics -B $zfs_bootfs         set gfxpayload="1024x768x32;1024x768x16;800x600x16;640x480x16;640x480x15;640x480x32"         insmod gzio         echo -n "Loading ${root}/ROOT/solaris/@/platform/i86pc/amd64/boot_archive: "         $module /ROOT/solaris/@/platform/i86pc/amd64/boot_archive     }          if [ "$target" = "i386_pc" ]; then         search --no-floppy --fs-uuid --set=root_rpool e71191bc1127be5c         if [ -s "($root_rpool)/@/boot/grub/menu.lst" ]; then             submenu "Legacy GRUB Menu (from root pool rpool)" "($root_rpool)/@/boot/grub/menu.lst" {                 extract_legacy_entries_source "$2"             }         fi     fi          ### END /usr/lib/grub2/bios/etc/grub.d/10_solaris ###          ### BEGIN /usr/lib/grub2/bios/etc/grub.d/41_custom ###     if [ -f  $prefix/custom.cfg ]; then       source $prefix/custom.cfg;     fi     ### END /usr/lib/grub2/bios/etc/grub.d/41_custom ###


title: sync files recursively between two folders where files are less than 24 hours old

text: I want to find all the files under a directory which are within 24 hours then rsync those files with another server. There are some old files that I do not want to transfer, however if those old files are updated then I do. I was thinking of writing a script with: find and the -ctime parameter and redirect that output to a file, but I don't know how to get rsync to effectively use that, or if there is a better way to transfer a set of files which have changed in the last 24 hours. This process needs to be run very frequently, so am not looking for something too inefficient. (such as using ftp and sending everything each time). Any ideas appreciated.


title: No 3D acceleration on Geforce GT220 with Nouveau on Debian Sid

text: I've been using Nouveau for a while and despite having working compositing I noticed some OpenGL stuff doesn't work. I ran `glxinfo` and it said: > direct rendering: No (If you want to find out why, try setting > LIBGL_DEBUG=verbose) so I set `GLXINFO=verbose` and ran `glxinfo` again and these error messages appeared:               libGL: OpenDriver: trying /usr/lib/dri/tls/nouveau_dri.so     libGL: OpenDriver: trying /usr/lib/dri/nouveau_dri.so     libGL error: dlopen /usr/lib/dri/nouveau_dri.so failed (/usr/lib/dri/nouveau_dri.so: cannot open shared object file: No such file or directory)     libGL error: unable to load driver: nouveau_dri.so     libGL error: driver pointer missing     libGL: OpenDriver: trying /usr/lib/dri/tls/swrast_dri.so     libGL: OpenDriver: trying /usr/lib/dri/swrast_dri.so     libGL error: dlopen /usr/lib/dri/swrast_dri.so failed (/usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory)     libGL error: unable to load driver: swrast_dri.so     libGL error: reverting to indirect rendering     display: :0  screen: 0     direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)      The file `nouveau_dri.so` is in `/usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so` and `/usr/lib/i386-linux-gnu/dri/nouveau_dri.so`. There's no `/usr/lib/dri`. I could try making a symbolic link but it might cause trouble and I want to make sure this isn't a bug or something else gone wrong. Doesn't Nouveau have some 3D acceleration already?


title: Looking for a good interactive pdf viewer

text: I like zathura for its simple UI, very nice for just reading. I like xournal for its rich annotation features. But what I still need is a reader that   * is interactive,   * has a "find" feature,   * is able to highlight an copy text to clipboard,   * is independant of any desktop environments (gnome, kde ...) and   * is able to display simple notes e.g. made with xournal (so no epdfview). Is there such a viewer?


title: Cygwin - Shell Scripting (eval and echo)

text: I have the following file f1.txt:               A=0         A=\`expr $A + 1\`      and the following script file s1.sh               for line in $(cat testfile.txt)     do        echo "$line"        # eval $line     done     echo $A      When I run the script using "sh s1.sh" I get the following output:               A=0         A=`expr           $A          +         1`            I was expecting the output of the echo to be:               "A=`expr $A + 1`"   1. I'd like to know why echo is putting newlines between the words?    2. As well, when I uncomment the `eval` line I get the following error:              s1.sh: eval: line 4: unexpected EOF while looking for matching ``'          s1.sh: eval: line 5: syntax error: unexpected end of file      I'd like to know what's wrong.


title: Best Linux Distribution for Scientific Computing?

text: I recently bought a new laptop to be used for scientific research when I'm at home. The machine has Intel i7 processor with 8 cores, 4 GB of RAM, and a graphic card from Nvidia (2 GB, Ivy Bridge). The programs I need most for computing are MATLAB and Python. I tried to installed Ubuntu (versions 12.10 and 13.04) and they were both slow. When MATLAB uses 1 core 100%, the entire OS just freezes. Cannot do anything at the same time. Also, the graphic card is clearly not used to its full potential (I either use optirun or give the DRI_PRIME flag when starting programs) and not used at all by Unity. Would some other OS be better than Ubuntu for my purposes? Also, how could I dedicate few cores to the OS, few to MATLAB/Python and a few for other programs (Chrome, Messaging, LaTeX etc.) (I asked this question before in http://serverfault.com/questions/508264/best- linux-distribution-for-scientific-computing, however, it was pointed out it was the wrong site).


title: Intel Turbo Boost apparently activated for no reason?

text: The other day, I reinstalled my operating system (Crunchbang, fork of Debian). For some reason my fan has been running at full speed (and blowing colder- than-room-temperature air) even though I'm using less than 2% of my CPU. I've been told to try `fancontrol`, but after running `sensors-detect`, the only kernel module I need is `coretemp`, and it's already loaded by default. Running `pwmconfig` says there are no available interfaces. I was also told to try CPU governors, but the only ones available (`/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors`) are performance and powersave, and powersave is already the default. But today, I ran screenfetch (a program that displays system info), and under CPU, it said `Intel Core i5-3230M CPU @ 3.2GHz`. The i5-3230 is normally a 2.6GHz processor, but it supports "turbo boost" up to 3.2GHz when the processor is being used heavily. I went back and looked at some screenshots of screenfetch from my previous installs of this OS on the same machine, when the fan was acting normal, and lo and behold, they said 2.6GHz just like they should. Does that mean that the processor is overclocking itself for no reason, and quite possibly causing the fan to stay on full speed all the time? How could I fix this? ![enter image description here](http://i.stack.imgur.com/34dy4.jpg)


title: How can I use rename to recursively rename everyting to uppercase

text: I'd like to recursively rename all files and folders (sub-folders) to uppercase. I found some scripts that will do it to lowercase, but I don't know how to change them so it will do it the other way around (lower to upper). The script that I found and works for lowercase, but I didn't knew how to modify is:               rename 'y/A-Z/a-z/' *      It's from `man rename`.


title: Single key audio capture in Linux (save on key release)

text: I'd like to run a program that records audio only when the Right Control key is held down. On keyboard release the result would write to disk as, e.g. `yy- mm-dd hh:mm.ogg`. How might I do that?               $ xmodmap -pke |grep -e Record     keycode 175 = XF86AudioRecord NoSymbol XF86AudioRecord      Right Control is captured as follows by xev for key down and key up events:               KeyPress event, serial 43, synthetic NO, window 0x1800001,         root 0x7f, subw 0x0, time 27689430, (-145,169), root:(476,366),         state 0x10, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          KeyRelease event, serial 46, synthetic NO, window 0x1800001,         root 0x7f, subw 0x0, time 27689540, (-145,169), root:(476,366),         state 0x14, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False          ClientMessage event, serial 46, synthetic YES, window 0x1800001,         message_type 0x112 (WM_PROTOCOLS), format 32, message 0x110 (WM_DELETE_WINDOW)      FWIW, my current desktop is `Xfce`. One lead I'm following: http://www.thinkwiki.org/wiki/How_to_get_special_keys_to_work#bypassing_Xorg


title: Print process ID (PID) of a Matlab instance

text: To run my Matlab scripts, I've created a shell script to which I give two parameters - the path to the matlab file (`$1`) and to the log file (`$2`): `nohup time matlab -some_parameters -r "run $1;exit" &>> "$2" &` When I need to kill one of the Matlab processes, it's sometimes difficult to tell which one is which. Would it be possible to somehow include the pid of the Matlab process in the log file (i.e. in `$2`)?


title: Why different presentation of client area?

text: I am using awesome with on ubuntu 12.04. I changed the theme with myunity Now my Gnome applications are presented white and all other in the dark theme. Why ?


title: Can't access select https sites on Linux over PPPoE

text: My internet connection used to be a direct LAN connection to my provider. Back then, everything would load fine on both Windows and Ubuntu (dual boot). However, a while ago they started needing me to dial (PPPoE) using a username and password. Gateway, subnet mask, IP, DNS servers all stayed the same. But since then, I haven't been able to browse certain websites on Ubuntu, even though there have been no such issues on Windows. Some example websites are - Ovi's sign in page (although share.ovi.com loads fine, and nokia.com loads fine), Live Mail (works on Chrome(ium) and Opera but not on Firefox (both 3.6 and 4)) Mozilla Addons website and other random websites. Some of the websites that don't load show timeout messages and for some websites (like the moz addons one), the browser will keep trying to load without an end (I've left it like that even for hours but not noticed anything different happen). I have tried changing the DNS servers to public ones. I have even tried booting from a Fedora LiveCD and _then_ changing the DNS to those (and even to the ones of OpenDNS), but the exact same thing happens. What could be inherently wrong with some config within Linux itself that is causing this problem? Does anyone know why this is happening and how it can be fixed? _Note: This question has beencross-posted on SU, but not gotten any responses._ **Update:** Just saw here http://ubuntuforums.org/showthread.php?t=1571086&highlight=pppoe that someone else was having similar problem and solved it by putting a NetworkManager.conf file in /etc/NetworkManager. What needs to be in that file?


title: Change directory without typing cd?

text: Is it possible to make bash change directory in command line simply by typing that directory without any commands like `cd`? For example is it possible instead of writing this:               $ cd /tmp      I just want to write only this:               $ /tmp      In other words if I call directory as an application then I want to set that directory as a working one.


title: Installed Ubuntu (on its own partition, Windos 8 machine) and lost both boot options in BIOS

text: ![enter image description here](http://i.stack.imgur.com/yUtDT.jpg)![enter image description here](http://i.stack.imgur.com/VA2qq.jpg)I partitioned the unit in Windows first, and after I disabled Windows in BIOS because it wasn't allowing the boot CD to load. After the installation, the option to enable Windows and the option to enable Ubuntu in BIOS were no longer there. How do I get them to function?


title: Creating a GIF animation from PNG files

text: Is there a tool to create a `gif` animation from a set of `png` files? I tried the `convert` command from the ImageMagick suite, but this doesn't always succeed. Also, I have several issues with this:   1. I can't tell what the progress is.   2. No matter what I try, the `-delay` flag doesn't change the frame rate of the gif animation.   3. `convert` determines the frame order based upon the alphabetical order of the files names. This means that `name500.png` will be placed right after `name50.png` and not after `name450.png` I can fix this by adding 0's but this is annoying.


title: How to ssh with private key from other linux system?

text: I log in to my server (server1) with user, password and private key: `key.ppk`. I want to ssh from server2 to server1. So I do the following:               ssh -i /srv/key.ppk root@XX.XX.XXX.XXX      When `XX.XX.XXX.XXX` is the IP of `server1`. It gives me the following statement:               Enter passphrase for key       where do I go wrong? Is it the right key should I put?


title: How to suspend with a keyboard shortcut?

text: I would like to suspend my **xubuntu** (14.04) system from a **keyboard shorcut** without entering my superuser password ( **sudo** ). I'm looking a command line which I can convert to a shortcut. So far, I tried two solutions: **Xfce command:**               xfce4-session-logout --suspend      **Problem:** The system doesn't lock the session. I don't need to enter my password for the wake-up and I want to do it. **Dbus** :               dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend      **Problem:** After wake-up, the Internet connection is down and I have to reboot the system to get it back. _Is there a third solution which 1. ask the password during the wake-up process, and 2. doesn't mess up with Internet connection?_ In fact, the graphical default shortcut (from the menu) works fine. I just don't know which command line is called.


title: Automating startup tasks

text: I have a "morning ritual" that occurs on every boot of my machine: starting up a few browser tabs, starting up skype, starting up terminator and subdividing some screens, etc. Is there any tool that helps me script that, including auth and input (in the case of terminator)? I'm on Linux Mint.


title: How can I find out if a relative symlink is internal to a certain subtree or not?

text: I want to test if a relative symlink points within the subtree of a certain directory. This example would yield `false` since it points outside the `foo` directory:   `/foo>readlink bar   ../fie.txt` While this example would yield `true`:   `/foo>readlink bar   fum/fie.txt` Is there an existing utility I can leverage or will I have to code it from scratch? I'm using `bash`.


title: Why do DNS queries fail if the first nameserver is not recursive?

text: I have a Linux box (Ubuntu server 11.10) inside a Windows Active Directory domain, and is joined the domain using likewise-open. The `resolv.conf` file looks like this:               domain mydomain.com     nameserver 192.168.1.1     nameserver 8.8.8.8     nameserver 8.8.4.4      where `192.168.1.1` is the Windows DNS server for the Windows domain. `8.8.8.8` and `8.8.4.4` are Google's public DNS servers that we preferred over our ISP servers. That setup was working properly, until we decided to disable recursion in the Windows DNS server due to some changes of our network design. I thought that will go well as we have configured it to use Google's servers next, but it seems not:               mydomain\myuser@linux-server:~$ dig google.com          ; <<>> DiG 9.7.3 <<>> google.com     ;; global options: +cmd     ;; Got answer:     ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55321     ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 13, ADDITIONAL: 4     ;; WARNING: recursion requested but not available          ;; QUESTION SECTION:     ;google.com.                    IN      A          ;; AUTHORITY SECTION:     .                       3600    IN      NS      c.root-servers.net.     .                       3600    IN      NS      d.root-servers.net.     .                       3600    IN      NS      e.root-servers.net.     .                       3600    IN      NS      f.root-servers.net.     .                       3600    IN      NS      g.root-servers.net.     .                       3600    IN      NS      h.root-servers.net.     .                       3600    IN      NS      i.root-servers.net.     .                       3600    IN      NS      j.root-servers.net.     .                       3600    IN      NS      k.root-servers.net.     .                       3600    IN      NS      l.root-servers.net.     .                       3600    IN      NS      m.root-servers.net.     .                       3600    IN      NS      a.root-servers.net.     .                       3600    IN      NS      b.root-servers.net.          ;; ADDITIONAL SECTION:     c.root-servers.net.     3600    IN      A       192.33.4.12     d.root-servers.net.     3600    IN      A       128.8.10.90     e.root-servers.net.     3600    IN      A       192.203.230.10     f.root-servers.net.     3600    IN      A       192.5.5.241          ;; Query time: 4 msec     ;; SERVER: 192.168.1.1#53(192.168.1.1)     ;; WHEN: Wed Jan  8 14:02:22 2014     ;; MSG SIZE  rcvd: 507      Also:               mydomain\myuser@linux-server:~$ ping google.com     ping: unknown host google.com      And also I have failed squid proxy connections (which I solved using the dns_nameservers option inside squid configuration and neglected the internal DNS server). Why DNS requests fails when recursion is declined by the first nameserver? Shouldn't the machine tries the next server? And what can I do if that was the expected (designed) behavior? **EDIT:** NSLOOKUP gave other (success) results:               mydomain\myuser@linux-server:~$ nslookup google.com     ;; Got recursion not available from 192.168.1.1, trying next server     Server:         8.8.8.8     Address:        8.8.8.8#53          Non-authoritative answer:     Name:   google.com     Address: 173.194.67.102     Name:   google.com     Address: 173.194.67.138     Name:   google.com     Address: 173.194.67.100     Name:   google.com     Address: 173.194.67.113     Name:   google.com     Address: 173.194.67.139     Name:   google.com     Address: 173.194.67.101      So is this application-dependent? Can I get that (trying next server if the first refuses recursion) to work transparently for all applications requesting name resolution, or name resolution is the responsibility of the program itself? (or am I missing something?!)... **EDIT:** Also worth noting, `mydomain.com` is a registered and public address on the internet and is not owned by us. It's like we've set up an internal domain named `apple.com`, and I assure you I don't work for Apple, at least not yet ;-).


I know that my machine hardware name is i686 and processor type is i686 due to my Linux output. But I have no idea why they are the same. I want to know what's the difference between machine hardware name and processor type.


title: Display what has been copied by `cp` (using `ksh`)

text: I'd like to get output showing what has been copied by `cp`. The only problem is how to do it when I `cp` many files at a time. For instance, `cp ./sourceDir/* $destinationPath/`.


title: Encrypted subversion checkout without root access

text: I would like to create an encrypted subversion checkout on a machine I don't have root access on. One thing I could do is checkout in a temporary directory, tar it, and subsequently encrypt with gpg, and do the reverse operations when I need to use the checkout, but I was wondering if there is a less tedious way. I have already tried encfs, but that seems not to work as I have no permissions to execute fusermount.


title: Why bzip2 --version behaves strange?

text: So if I enter the command               $ gzip --version | head -n1      everything goes as expected. But if I try the same with bzip2:               $ bzip2 --version | head -n1      I get a lot of lines and I have to press `Ctrl``c` to terminate. What is happening here? EDIT: The lines being printed by               $ bzip2 --version | head -n1          bzip2, a block-sorting file compressor.  Version 1.0.6, 6-Sept-2010.          Copyright (C) 1996-2010 by Julian Seward.          This program is free software; you can redistribute it and/or modify     it under the terms set out in the LICENSE file, which is included     in the bzip2-1.0.6 source distribution.          This program is distributed in the hope that it will be useful,     but WITHOUT ANY WARRANTY; without even the implied warranty of     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     LICENSE file for more details.      and i have to press `Ctrl``c` to continue. If I omit the pipe I get               $ bzip2 --version           bzip2, a block-sorting file compressor.  Version 1.0.6, 6-Sept-2010.          Copyright (C) 1996-2010 by Julian Seward.          This program is free software; you can redistribute it and/or modify     it under the terms set out in the LICENSE file, which is included     in the bzip2-1.0.6 source distribution.          This program is distributed in the hope that it will be useful,     but WITHOUT ANY WARRANTY; without even the implied warranty of     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     LICENSE file for more details.          bzip2: I won't write compressed data to a terminal.     bzip2: For help, type: `bzip2 --help'.      If I merge stdout with stderr as @devnull sais, it displays the lines well, but i need to press `Ctrl``c`. I tried               $ gcc 2>&1 | head -n1      and it works well, so I think there is something still missing in the bzip2 command. EDIT 2: I solved the issue with the following command:               $ bzip2 --version 2>&1 < /dev/null | head -n1       But I still don't understand the problem.


title: Discover windows in current KDE activity with d-bus

text: I want a hotkey to start a new konsole session, new chrome tab etc. I can just bind a global hotkey to a KDE command to do it. For example, here's a script that starts a new Konsole session:               #!/bin/bash     kon=$(qdbus org.kde.konsole*)     if [ -n "$kon" ]; then             qdbus "$kon" /Konsole newSession     else             konsole     fi      The problem is, when you're using a KDE activity this can be opening a new Konsole tab on another activity. I would like to detect this and create a new Konsole window in that case. Is this possible? The org.kde.kactivitymanagerd d-bus endpoint doesn't seem to have anything here.


title: OTRS installation error on openSuSE

text: I have a fresh, text-only installation of openSuSe 13.1 (physical server, old Samsung netbook), and I'm trying to get OTRS up and running. I've installed OTRS using the below commands. I don't think they're all necessary, but someone in the OtterHub forums had a successful installation with the software versions I'm targeting using this sequence, so I was trying to piggyback on that success.               zypper in otrs-3.3.4-01.noarch.rpm gcc make mysql-community-server perl-Crypt-SSLeay perl-JSON-XS perl-YAML-LibYAML     zypper in perl-Text-CSV_XS perl-PDF-API2 perl-GDGraph perl-Encode-HanExtra postfix perl-DBD-mysql     cd ~otrs && bin/otrs.SetPermissions.pl --otrs-user=otrs --web-user=wwwrun --otrs-group=www --web-group=www /opt/otrs     rcmysql start     systemctl start apache2.service     mysqladmin --user=root password password      All of that works fine. I'm able to get to the OTRS web installer, but that's where I get hung up. I get to the part of the web installer that creates the database, and it times out. The script successfully creates the database and updates `Config.pm` with the new password. I can't tell from `installer.pl` what it tries to do next. Here's the error from `/var/log/apache2/error_log`:               [Tue Jan 28 20:53:23.136306 2014] [cgi:warn] [pid 6856] [client 192.168.1.10:52732] AH01220: Timeout waiting for output from CGI script /opt/otrs/bin/cgi-bin/installer.pl, referer: http://svr-clptest/otrs/installer.pl     [Tue Jan 28 20:53:23.136470 2014] [cgi:error] [pid 6856] [client 192.168.1.10:52732] Script timed out before returning headers: installer.pl, referer: http://svr-clptest/otrs/installer.pl      The browser displays the following:               The gateway did not receive a timely response from the upstream server or application.      This is on a local network at home. I'm accessing the Linux server using PuTTY from a Windows 8 machine. I'm using a wireless connection from the Windows 8 machine, but the server has a hard line connection to the router, if that makes any difference. I don't have any trouble executing anything from PuTTY or accessing the index page through the browser (Firefox 26). I've tried connecting from a computer on my network, and one off of my network. In both cases, I'm able to get to my domain and the web installer. But I can't make a PuTTY connection to the server from outside my network. I've spent a couple of hours researching the error, and I can't figure out what the next step should be. Right now, a text-only version of openSUSE and OTRS are the only things running on the machine. I haven't done anything else with it. I'm open to starting the installation from scratch again--OS and all. I'm thinking that the timeout error has something to do with my firewall settings, but I'm not a network guy. Really have no idea how to diagnose this. **UPDATE** I tried reinstalling everything fresh tonight, but then added KDE so I could walk through the web installer on the host. I get exactly the same errors. It's not a problem between server and client. Something's wrong with OTRS... Or maybe with apache? **UPDATE 2** I may have found a catch-22 here. Following crythias' instructions (post here: http://forums.otterhub.org/viewtopic.php?f=63&t=23757), I noticed that the OTRS service wouldn't start. The error indicated that otrs couldn't connect to the database. Of course it can't, because the OTRS database hasn't been created yet. So the error also suggests using the web installer to set up the database. I run the web installer, get the same error in the same place. But now that the database is created, the OTRS service starts. The problem is, now I can't complete the installer because the database already exists. If I try to create a new database, it tells me 'otrs' already exists. If I try to use the existing database, it tells me 'Database already contains data - it should be empty!' If I use an empty database called 'otrs,' my OTRS error log spits out the following:               [Fri Jan 31 20:45:01 2014][Error][Kernel::System::PID::PIDGet][181] Table 'otrs.process_id' doesn't exist, SQL: ' SELECT process_name, process_id, process_host, process_create, process_change FROM process_id WHERE process_name = ? LIMIT 1'     [Fri Jan 31 20:45:32 2014][Error][/opt/otrs/bin/otrs.CheckDB.pl][57] Table 'otrs.valid' doesn't exist, SQL: 'SELECT * FROM valid'      If I start the service, then delete the database, the service immediately spits out an error               [Fri Jan 31 21:05:38 2014][Error][Kernel::System::PID::PIDGet][181] Table 'otrs.process_id' doesn't exist, SQL: ' SELECT process_name, process_id, process_host, process_create, process_change FROM process_id WHERE process_name = ? LIMIT 1'     [Fri Jan 31 21:05:38 2014][Error][Kernel::System::DB::new][223] Unknown database 'otrs'      If the OTRS service is supposed to be started before I run the web installer, but the service won't start until the database is created, I think I'm stuck.


title: How to initialize an array using awk and bash?

text: I am trying to store values of the first line of a text file into an array. Here is what I have so far:               arr_values=()          awk '         NR==1 {                 for (i=0; i<=NF; i++)                    'arr_values[i]'=$i            #error here               }' file.txt          for ((i=0; i<${#arr_values[@]}; i++))     do        echo ${arr_values[i]}     done      I am getting an error with initializing the array mainly because I don't know how to use `awk` to initialize an external array. Any suggestions (only with `awk`)? Thanks. Apologize for the cross post, I didn't get the answer I wanted.


title: OSX 10.9.1 unable to open .pkg file

text: I downloaded gfortran-4.8.2.pkg from http://coudert.name/software/gfortran-4.8.2-Mavericks.dmg but somehow I could not open it . I unpacked it, right clicked so, the menu was appeared, it said Open with and I said installer but did not work.


title: Possible to move boot files?

text: I just bought an external hard drive that's 1TB. I formatted my laptop and burned Linux to it. The thing is, I also use my hard drive for other things. Can I move these boot files into a custom folder? Or should I leave them alone?


title: How to relay packet in a wireless ad hoc network?

text: I am trying to connect several Linux computers in wireless ad-hoc multicast : -computer C1 (192.168.1.3) -computer C2 (192.168.1.5) -computer C3 (192.168.1.6) C1 can not reach C3 On computer C1, using Iperf, I am sending UDP multicast packet to 239.0.0.1 > iperf -c 239.0.0.1 -u -l 1316 On computer C3, using Iperf, I am seeking UDP multicast packet to 239.0.0.1 > iperf -s -u -l 1316 -B 239.0.0.1 --interface wlan0   >   >  This is a version of Iperf upgraded for multicast.   >  http://www.amazon.com/dp/0201746123/?tag=stackoverfl08-20   > How should I configure those three computers ? Should I change address ? Use route ? Use Iptables ? Set the card in Repeater Mode ? What is the simplest technique to do ?


title: Grep and sort several unsorted things in several lines (in one document)

text: I have a file with several unsorted things in one line which I want to put into a new file This is an example of part of the file I have:               X1314448: SaMi|SM_g2554.t1 SaMi|SM_g5072.t1 Des|Des_g3808.t1 Dul|Dul_comp50786_c0_seq1-1 Nig|Nig_comp88811_c0_seq2-1 AB|AB0003DMP400018076_AB0003DMT400026495 Phy|Phy_comp35647_c0_seq1-1 SWtf|SW_g27807.t1 Tom|Solyc02g077050.2.1     X1314810: Des|Des_g33587.t1 Nig|Nig_comp84357_c0_seq1-1 AB|AB0003DMP400020961_AB0003DMT400030857 Phy|Phy_comp33112_c0_seq1-1 SaMi|SM_g27352.t1 SWtf|SW_g21774.t1 TAIR|AT4G14930.1 Tom|Solyc06g054250.2.1 Dul|Dul_comp63657_c0_seq2-1     X1327159: AB|AB0003DMP400016823_AB0003DMT400024599 AB|AB0003DMP400017933_AB0003DMT400026257 Dul|Dul_comp58749_c0_seq2-1          X1330513: Des|Des_g36886.t1 AB|AB0003DMP400049952_AB0003DMT400073802 SWtf|SW_g16502.t1          X132738: Des|Des_g491.t1 Des|Des_g6171.t1 Dul|Dul_comp57659_c0_seq2-1 Dul|Dul_comp57659_c0_seq3-1 Dul|Dul_comp57659_c0_seq4-1 Ni                                                                       g|Nig_comp93106_c3_seq1-1 Nig|Nig_comp93106_c3_seq2-1 AB|AB0003DMP400005485_AB0003DMT400007895 AB|AB0003DMP400021388_PGS                                                                       C0003DMT400031553 Phy|Phy_comp61931_c0_seq1-1 Phy|Phy_comp61931_c0_seq2-1 Phy|Phy_comp61931_c0_seq3-1 Phy|Phy_comp61931_c0_seq4-1                                                                        RICE|LOC_Os08g43334.1 RICE|LOC_Os08g43334.2 RICE|LOC_Os09g35790.1 RICE|LOC_Os09g35790.2 SaMi|SM_g30888.t1 SaMi|SM_g5888.t1 SWtf|SW                                                                       _g17547.t1 SWtf|SW_g33717.t1 Des|Des_g47565.t1 SaMi|SM_g6027.t1 SWtf|SW_g42019.t1 TAIR|AT5G62020.1 Tom|Solyc03g026020.2.1 TAIR|AT4                                                                       G11660.1      What I want is to have the first part, "X1314448:" followed by by "Des|Des_g3808.t1”. And if there is another “Des_xxx” (in some cases there are more than one, like in the second to last line), I want that to be included as well, followed by the “AB|AB00…” in the output file, but since it is an unsorted list I am uncertain how to sort out the three different parts I want while still keeping them on the same line (keeping them linked to each other). I am also not sure how to get several matches on one line like this. So for the first line, the output should be:               X1314448: Des|Des_g3808.t1 AB|AB0003DMP400018076_AB0003DMT400026495       For the second to last last one:               X1330513: Des|Des_g36886.t1 AB|AB0003DMP400049952_AB0003DMT400073802      for the last one:               X132738: Des|Des_g491.t1 Des|Des_g6171.t1 Des|Des_g47565.t1 AB|AB0003DMP400005485_AB0003DMT400007895 AB|AB0003DMP400021388_PGSC0003DMT400031553      I think the main problem is the last line. I also want to be able to modify the file to have the "Dul|..." included as well. * * * # Solution: After working on it a bit I ended up with: 1 - Save this script as `FastaToTbl` and make it executable (`chmod 744 FastaToTbl`):               if (substr($1,1,1)==">")            if (NR>1)                  printf "\n%s\t", substr($0,2,length($0)-1)           else              printf "%s\t", substr($0,2,length($0)-1)            else               printf "%s", $0     }END{printf "\n"}'  "$@"      2 - make and a second file containing this script: Use `FastaToTbl` combined with this script to extract the IDs from `file1` and the sequences from `file2`:                ./mktbl file1[contains FASTA sequences] |       perl -ne 'chomp;@a=split(/\t/); $k{$a[0]}=$a[1]; ## Collect the sequences                                                    ## $k{ID}=SEQUENCE           END{open(A,"File02[contains my data that is missing FASTA sequences (ID file)]");   ## Open ID file              while(<A>){         ## and process it line by line                @a=split(/\s+/);  ## Gather the IDs in array @a                print shift(@a);  ## Print the first element (Jan123:)                print "$_ $k{$_}\n" for @a; ## Print each ID and its seq      }}'


title: Logging into an RDP/S session

text: **UPDATE 1:** I've now tried the following which gives me an error.               oshirowanen@desktop:~$ sudo xfreerdp /v:farm.company.com /d:company.com /u:username /g:gateway.company.com     transport_connect: getaddrinfo (Name or service not known)     Error: protocol security negotiation failure     oshirowanen@desktop:~$       Anyone know why I get this error? * * * **ORIGINAL QUESTION:** From a windows machine, I can log into an rdp session simply by starting mstsc, entering in the gateway details and then entering in the computer details               gateway = gateway.company.com     computer = farm.company.com     user = domain\username      Can I do this with Linux? I have downloaded and installed Gnome's Remote Desktop Viewer application, and I can't see a gateway option. I can only see a host option and a user option.


title: Strange combination of symbols UNIX

text: I was looking at one korn shell script examples and I saw this strange combination of symbols: `%?` So my question is what does it mean?


title: How to compute a thumbnail filename from the shell?

text: I started noticing some time ago in Xfce4 that when I sent some file to the Trash, tumbler (the Xfce4 thumbnailer) would cause very high I/O load for quite some time. Upon investigating the issue, I found that it was scanning the ~/.thumbnails directory, which was very large in size. So I decided to write a cron script that will periodically clean the ~/.thumbnails directory, but there is a certain directory of large video files that tumbler takes a bit of time, and sometimes even fails, to create thumbnails for. The idea is removing all thumbnails, except the ones for these videos. But in order to keep these thumbnails, I have to find what their names are. The problem is that thumbnails are stored named with a md5sum of the URI, plus the PNG extension. Upon looking at the tumbler source, I found the name for the thumbnail is generated in the following line:               md5_hash = g_compute_checksum_for_string (G_CHECKSUM_MD5, uri, -1);      The documentation for g-compute-checksum-for-string says:               g_compute_checksum_for_string(GChecksumType checksum_type,                                   const gchar *str,                                   gssize length);          checksum_type: a GChecksumType      str:           the string to compute the checksum of     length:        the length of the string, or -1 if the string is null-terminated.      To put it short, the thumbnail for a file named `/home/teresaejunior/File 01.png` will be stored in the .thumbnails/ directory as `a8502be3273541e618b840204479a7f9.png` According to the ThumbnailerSpec, URI is `file://filename`. I did some research on the "null character", and thought `\0` would do the trick. In order to achieve the result `a8502be3273541e618b840204479a7f9`, I believed the following should work:               printf "file:///home/teresaejunior/File 01.png\0" | md5sum      but that returns `f507285c45d293fa66bc0b813d17b6e6` instead. Can someone give me some advice? I believe my `printf` line is flawed. What is my command doing different from `g_compute_checksum_for_string`?


title: How to cut by tab character

text: I want to use cut command to break input into fields and get the second field. `cut -f2 -d' '` <--- How can I tell it to use tab instead of space


title: LUKS-encrypted text file is garbled

text: I have a USB disk encrypted with LUKS. Immediately after mounting the disk today, I find that a recently edited text file contains seemingly random characters. All other files that I have checked, and the directory hierarchy, appear to be normal. What can cause this, and can such a file be recovered? I do have a recent backup of the entire disk, and a recent version of the text file is committed to a Git archive. I am, however, interested in a fix -- as well as preventative guidance.


title: Adding an ip to a routing table

text: Is there any way I can add an ip to an interface , but interface route gets created on a routing table other than 'main' routing table in linux? For ex: If I add an IP 10.11.20.10/24 to eth0, it creates an interface route in the main table.                  ip route show        10.11.20.0/24 dev eth1  proto kernel  scope link  src 10.11.20.10      But I don't want this interface route to be created on 'main' table but a different routing table with table id 10. It seems 'ip addr' doesn't take table id as an option, only way I could think of is deleting the interface route from 'main' table and add it into other routing table.


title: How can I force a bash loop to end if it runs x times in x seconds?

text: I'm trying to grab batches of input from a remote pipe via ssh. My script below works ok, but I would like to add some sort of check into it so that if something were to go wrong or break the loop would end if the script started running away. How can I add in a component that would check if the loop ran, say 5 times in 3 seconds then the script would break the loop and auto terminate?               #!/bin/sh     if [ -z "$1" ]         then         echo " usage: user@host"         echo         exit     fi               while [ 1 ]         do         CB=`ssh $1 cat clipboardpipe`         if [ -n "$CB" ]             then             echo $CB | /usr/bin/pbcopy             echo $CB | /usr/local/bin/growlnotify         fi         sleep 1     done      ps: I had looked at using something like `tail -f` but it didn't seem to work when other programs expect input in batches. All advice is welcome. pss: `clipboardpipe` is a named pipe in the home directory on the remote system.


title: Creating recursively sorted RAR archive

text: For various reasons I decided to use RAR archive to store some data, instead compressed tar. Happy with decision, except for one thing: I can't find a way to store files sorted. Order of files is important as I plan to query archive and results should be ordered.   My file structure is like this:               2000/       001.txt       002.txt       ...     2001/       ...     2002/     ...     2011/      so folders represent years and files inside are numbered. Using `ls`, `tar` or any program lists files as expected. If I try to create non-recursive `rar` archive (i.e. compress files only in folder 2000), files are stored sorted, but if I try to add files recursively (`rar a -r`) then files are messed up. I can't find any switch except:               n@            Read file names to include from stdin      with which I had no luck to make it usable. I could call `rar` on every file like: `for f in */*.txt ; do rar a -r archive.rar $f ; done` but that's not very smart. Any ideas? * * * As I commented below answer, I though to update question: I managed to store sorted files similarly as in above not so clever line: `for d in */ ; do rar a -r archive.rar $d*.txt ; done` which works fine for above particular scenario, of course I haven't found how to use `n@` switch yet thou. I use `RAR 4.10 beta 5`


title: Error on launching game in Wine

text: > fixme:imm:ImmDisableTextFrameService Stub > > X Error of failed request: BadAlloc (insufficient resources for operation) > > Major opcode of failed request: 153 (GLX) > > Minor opcode of failed request: 3 (X_GLXCreateContext) > > Serial number of failed request: 239 > > Current serial number in output stream: 240 I have just installed new game to Wine, I have installed all the drivers. Why do I get that error?


title: Logrotate behaving unexpectedly

text: Find below the logrotate configuration that I'm using               /usr/local/nagios/var/nagios.log {         copytruncate         daily         rotate 7         compress         missingok         size 100M     }      And I could notice that the status file `/var/lib/logrotate.status` is getting updated with current date daily but the log file is not getting rotated and it's growing in GB's until the disk get filled. What would be the problem?


title: How to automatically accept epel gpg key

text: The very first time that I install a package from epel, I am prompted if I want to import a GPG key. Notice how there are 2 'Is this ok' prompts when installing redis?               [root@us-devops-build02 yum.repos.d]# yum install redis     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile     .. truncated for readability          Total download size: 213 k     Installed size: 668 k     Is this ok [y/N]: y     Downloading Packages:     redis-2.4.10-1.el6.x86_64.rpm                                                                                | 213 kB     00:00          warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY     Retrieving key from http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6     Importing GPG key 0x0608B895:      Userid: "EPEL (6) <epel@fedoraproject.org>"      From  : http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6     Is this ok [y/N]: y      This causes puppet to fail on freshly provisioned machines, unless I ssh in to the machine first and manually accept the installation of this key.   1. Why does epel need a key to be downloaded on the first installation of a package?    2. How can I automatically install this key on my images so puppet wont fail ?


title: How can I run growisofs via sudo?

text: Whenever I've attempted to run `growisofs` via `sudo` I've always gotten the following error message.               $ sudo -i growisofs     :-( growisofs is being executed under sudo, aborting!         See NOTES paragraph in growisofs manual page for further details.     $ sudo -s growisofs          :-( growisofs is being executed under sudo, aborting!         See NOTES paragraph in growisofs manual page for further details.      Which leads me to having to do a `sudo su -` followed by `growisofs`.               $ sudo su - -c growisofs     growisofs: previous "session" device is not specified, do use -M or -Z option          -or-          $ sudo su -     # growisofs ...      Is there a alternative way I can do this without having to do the `su -`? ### Background This behavior is built into the tool `growisofs` to thwart giving access to the filesystem with elevated privileges.   * http://fy.chalmers.se/~appro/linux/DVD+RW/growisofs.1m.html _excerpt_ > ### NOTES > > If executed under `sudo(8)` `growisofs` refuses to start. This is done for > the following reason. Naturally `growisofs` has to access the data set to be > recorded to DVD media, either indirectly by letting `mkisofs` generate > ISO9660 layout on-the-fly or directly if a pre-mastered image is to be > recorded. Being executed under `sudo(8)`, `growisofs` effectively grants > sudoers read access to any file in the file system. The situation is > intensified by the fact that growisofs parses `MKISOFS` environment variable > in order to determine alternative path to mkisofs executable image. This > means that being executed under `sudo(8)`, growisofs effectively grants > sudoers right to execute program of their choice with elevated privileges. > If you for any reason still find the above acceptable and are willing to > take the consequences, then consider running following wrapper script under > `sudo(8)` in place for real `growisofs` binary. >   >   >            #!/bin/ksh >            unset SUDO_COMMAND >            export MKISOFS=/path/to/trusted/mkisofs >            exec growisofs "$@" >   > > But note that the recommended alternative to the above "workaround" is > actually to install `growisofs` set-root-uid, in which case it will drop > privileges prior accessing data or executing `mkisofs` in order to preclude > unauthorized access to the data.


title: How to send keystrokes (F5) from terminal to a process?

text: I'm using an Raspberry Pi in combination with Chromium (kiosk mode) to show up some stats. The Pi doesn't have an connected keyboard so I searched for a solution to send keystrokes from the terminal to the Chromium (tab) process. Normal input does work but how do I send something like `F5` (special key; browser refresh) via this solution?               # pidof chromium     20809 20790 20788 20786 20783     # echo 'some text' > /proc/20809/fd/0


title: Map invalid file paths to valid file paths

text: I am running a program on linux which access an **invalid location** , say: `/home/area/file`. I know the **valid location** is `/home/area/something_else/file`. The problem is the input file for this program is in binary form and encrypted, so I cannot change it. Also, I do not have permissions to move it to the location the program is expecting. **Is it possible to map invalid file paths to known valid file paths?** Note: Neither symbolic links nor hard links do work.


title: What is "Charlie &" in the gecos field on OpenBSD for root?

text: ![enter image description here](http://i.stack.imgur.com/P0ljr.png) **Question** : what is "Charlie &" for the root user? I didn't gave "Charlie &" for gecos field, I think I didn't gave any at all. ps.: the "/sbin/nologin" doesn't matters, I just tested something


title: stout can not append to large files

text: I have Ubuntu 13.10. I have a keylogger to help me remember what I did. Running keylogger prints output to the terminal when I run it like this:               keylogger      I added it to startup like this:               keylogger >>/home/user/log      It records it well, but when the log file exceeds 1MB or 2MB it stops writing to the log file. Is there such a file size limit for output redirection? ### EDIT#1 I forgot to mention, my file was a hidden file like `/home/user/.log`, in case that matters. ### EDIT#2 output of `ulimit -a`:                $ ulimit -a      core file size          (blocks, -c) 0      data seg size           (kbytes, -d) unlimited      scheduling priority             (-e) 0      file size               (blocks, -f) unlimited      pending signals                 (-i) 23953      max locked memory       (kbytes, -l) 64      max memory size         (kbytes, -m) unlimited      open files                      (-n) 1024      pipe size            (512 bytes, -p) 8      POSIX message queues     (bytes, -q) 819200      real-time priority              (-r) 0      stack size              (kbytes, -s) 8192      cpu time               (seconds, -t) unlimited      max user processes              (-u) 23953      virtual memory          (kbytes, -v) unlimited      file locks                      (-x) unlimited


title: Why does sshd requires an absolute path?

text: Why does `sshd` require an absolute path when restarting, e.g `/usr/sbin/sshd` rather than `sshd` Are there any security implications? P.S the error message:               # sshd     sshd re-exec requires execution with an absolute path


title: why the "open" command runs under the home directory?

text: Under Mac OSX (Mountain Lion), I have a shell script "a":               #!/bin/bash     open -a Terminal b      which run another shell script "b" using Terminal:               echo `pwd`      Something interesting is that, no matter where my running scripts are located, the `pwd` command in "b" always returns the home directory. Questions:   1. Why does this happen?   2. How to set the running environment to be the working instead home directory (ie, return the working directory when arriving at `pwd`)


title: Pressing Ctrl-X or F10 does not boot Linux

text: I am new to Linux and trying out different distros. However, my laptop has `ATI GPU (Asus N56D)` due to which many distros didn't boot successfully. After having google'd I found that I need to set `"NOMODESET"` kernel parameter. I could edit the grub command line (by pressing 'e' at the grub) but unable to boot after pressing `Ctrl`+`X` or `F10`. Pressing `Ctrl`+`X` merely results in adding character `'x'` at the cursor position. (This happens irrespective of linux distro). Due to this I am unable to boot with the kernel parameter. Please suggest what is going wrong here.


title: Need IP for my Virtual Machine

text: I want to `scp` to my virtual machine (CentOS 6) from my Windows 8 machine. I have installed VMPlayer and installed CentOS 6 on my machine. I have enabled Bridged adapter setting, but I still can't see an IP address for the virtual machine.


title: Fedora 20: How to navigate to Windows partitions via commandline?

text: In Fedora 16, when accessing the Windows partitions via the Fedora GUI, it would get mounted on `/media/`. They were visible as `/media/Data` etc and I was able to navigate into those partitions via the terminal. But now I see the partitions mounted on the GUI, but they're not visible in `/media/`. Could you help with navigating to the partitions via the terminal? Or to put it in another way: Where do the Windows partitions get mounted to, when mounted via the GUI?


title: Where can I view a changelog for the sort command

text: I need to find `sort`'s version when the `-V` flag was introduced. But I am finding myself some hard time finding the changelog for this command. Where can I view it?


title: Webcam on Angström

text: I am running Angström on my BeagleBoard-xm. I want to use a webcam (I have Microsoft LifeCam Cinema and Logitech C310). I installed `v4l-utils`, `libv4l-dev` and `kernel-module-uvcvideo` with opkg. But the webcams don't appear in the `/dev` folder. `cheese` can't find them too. Here is the output of `dmesg`:               [ 8925.347137] usb 2-2.4.3: new high speed USB device using ehci-omap and address 8     [ 8925.489044] usb 2-2.4.3: New USB device found, idVendor=045e, idProduct=075d     [ 8925.496490] usb 2-2.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0     [ 8925.504333] usb 2-2.4.3: Product: Microsoft�� LifeCam Cinema(TM)     [ 8925.510528] usb 2-2.4.3: Manufacturer: Microsoft     [ 8926.635742] 8:3:1: cannot get freq at ep 0x82      and here is the output of `lsusb`:               # lsusb     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 002: ID 0424:9514 Standard Microsystems Corp.      Bus 002 Device 003: ID 0424:ec00 Standard Microsystems Corp.      Bus 002 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB     Bus 002 Device 005: ID 04d9:1603 Holtek Semiconductor, Inc.      Bus 002 Device 006: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical     Bus 002 Device 008: ID 045e:075d Microsoft Corp.      uvcvideo kernel module seems to be in the right folder:               # locate uvcvideo.ko     /lib/modules/2.6.32/kernel/drivers/media/video/uvc/uvcvideo.ko          # uname -a     Linux beagleboard 2.6.32 #3 PREEMPT Tue Jul 26 10:56:56 CEST 2011 armv7l unknown      `lsmod`output is:               # lsmod     Module                  Size  Used by     ipv6                  249063  10      But I don't see uvcvideo module in the `lsmod` output. Should I do something else to load the module? Or should I install a specific driver?