title: Reusing a variable

text: I was breaking my head for a day still not successful. I have this script:               #!/bin/ksh          fname=$1          for batchname in $(grep -i "Processing batch" $fname | cut -d "'" -f2)     do     Batch_state=`grep -c -i "Batch '$batchname' was successful" $fname`     if [[ "$Batch_state"  -ge 1 ]];then     {     S_Time=`awk '/[0-9]_[0-9].*successful/{getline;getline;getline;print}' $fname | awk '{print $2}'`     E_Time=`awk '/[0-9]_[0-9].*successful/{getline;getline;getline;getline;print}' $fname | awk '{print $2}'`     echo -e $batchname"\t"$S_Time"\t"$E_Time     }     else     {     echo $batchname encountered an error     }     fi     done      Output this code is producing:               02_1231324      14:29:04 15:29:11   14:32:19 15:33:11     79_3097935      14:29:04 15:29:11   14:32:19 15:33:11      Desired Output:               02_1231324      14:29:04    14:32:19     79_3097935      15:29:11    15:33:11       Sample Input:               2013/06/11 14:29:04 <0999> (725102)     Creating batch '02_1231324.0'...     2013/06/11 14:29:04 <0999> (725102)     Batch '02_1231324' was successful     2013/06/11 14:29:04 <0999> (725102)     TMR:Child ZERO, 160 Docs 320 Pgs 3874 KByts Tot 0.42 WAL 0.10 WALIO 0.15 IO 0.03 secs     2013/06/11 14:29:04 <0999> (725102)  Processing batch '02_1231324'     2013/06/11 14:32:19 <0999> (725102)     Total in batch: 160 documents using 4 KBytes     2013/06/11 15:29:11 <0999> (725102)     Creating batch '79_3097935.0'...     2013/06/11 15:29:11 <0999> (725102)     Batch '79_3097935' was successful     2013/06/11 15:29:11 <0999> (725102)     TMR:Child ZERO, 160 Docs 320 Pgs 3874 KByts Tot 0.42 WAL 0.10 WALIO 0.15 IO 0.03 secs     2013/06/11 15:29:11 <0999> (725102)  Processing batch '79_3097935'     2013/06/11 15:33:11 <0999> (725102)     Total in batch: 160 documents using 4 KBytes     TMR:Child ZERO, 160 Docs 320 Pgs 3874 KByts Tot 0.42 WAL 0.10 WALIO 0.15 IO 0.03 secs     2013/06/11 13:26:57 <0999> (725102)  Processing batch '12_2013162201'     2013/06/11 13:26:57 <0999> (725102)     Total in batch: 160 documents using 4 KBytes      So, what is wrong with my script? How can I get the desired output?


title: How do I install Exim and Horde on Centos 7 with MariaDB 10?

text: I can't find a guide for this (they are old and don't work) and I can't seem to manage to install it. I can't install Postfix because of its dependencies, so I'm going with Exim, which I installed through `yum install exim` and it was the latest version. However, I have no idea where to go from here. I know that I need to install Dovecot or Cyrus and I want to install Horde (not Squirrelmail). Not to mention that I also want to keep MariaDB 10, which I installed from its repository, as well as PHP 5.5. I don't know where to go from here.


title: pysqlite install error on FreeBSD in virtualenv

text: I am trying to install pysqlite using pip under a virtualenv in FreeBSD 7.3, with Python version 2.6.2. I didn't have any issues for installing other packages like Django, PIL etc. All of them I installed after activating virtualenv only. But I get a huge error for `pip install sqlite`. Here's the tail of the error               src/module.c:426: warning: implicit declaration of function 'sqlite3_libversion'     src/module.c:426: warning: passing argument 1 of 'PyString_FromString' makes pointer from integer without a cast     error: command 'gcc' failed with exit status 1     Command /usr/home/myuser/python-sites/virtpython/bin/python -c "import setuptools;__file__='/usr/home/myuser/python-sites/virtpython/build/pysqlite/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /usr/tmp/pip-N3U6Px-record/install-record.txt --single-version-externally-managed --install-headers /usr/home/myuser/python-sites/virtpython/include/site/python2.6 failed with error code 1 in /usr/home/myuser/python-sites/virtpython/build/pysqlite     Exception information:     Traceback (most recent call last):       File "/usr/home/myuser/python-sites/virtpython/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/basecommand.py", line 107, in main         status = self.run(options, args)       File "/usr/home/myuser/python-sites/virtpython/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/commands/install.py", line 261, in run         requirement_set.install(install_options, global_options)       File "/usr/home/myuser/python-sites/virtpython/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/req.py", line 1166, in install         requirement.install(install_options, global_options)       File "/usr/home/myuser/python-sites/virtpython/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/req.py", line 589, in install         cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)       File "/usr/home/myuser/python-sites/virtpython/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/util.py", line 612, in call_subprocess         % (command_desc, proc.returncode, cwd))     InstallationError: Command /usr/home/myuser/python-sites/virtpython/bin/python -c "import setuptools;__file__='/usr/home/myuser/python-sites/virtpython/build/pysqlite/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /usr/tmp/pip-N3U6Px-record/install-record.txt --single-version-externally-managed --install-headers /usr/home/myuser/python-sites/virtpython/include/site/python2.6 failed with error code 1 in /usr/home/myuser/python-sites/virtpython/build/pysqlite      'virtpython' is my virtualenv               % pkg_info | grep sqlite     sqlite-2.8.17_1     An SQL database engine in a C library     sqlite3-3.6.11      An SQL database engine in a C library      If there is a sqlite devel package for FreeBSD, where can I find it? Or the issue is something else??


title: Installing centos server in a virtual machine

text: I have little Unix/Linux experience, so sorry if this sounds stupid. What I want to do is simple: I want to learn CentOs so that I can manage my own web server. I did so by buying a dedicated and setting up CentOs. It's good, but the latency (around 300ms with Putty) is killing me when typing. So I have decided to setup CentOS on my local machine. I have Windows XP and Virtual Box installed. Simply, I want to install CentOs (the Server, not the Desktop GUI) either on the Virtual Box or as a separate OS (neck to neck with Windows XP) whichever is best and easier. I'm looking for suggestions or possible solutions. I'm overwhelmed with the tons of articles/packages out there. Thank you!


title: Running 'Leafpad' on terminal opens Gedit

text: I am running leafpad on the terminal but it opens gedit instead. Any Ideas why this happens? I am using Openbox btw.


title: Extract UNIX dump file in Windows 7

text: I have a dump-file of the UFS partition created with FreeBSD's `dump`. How to view its content and extract some files from it on Windows 7? Cygwin's `restore` provides very limited functionality and doesn't have an interactive mode like BSD's `restore`. Installing virtual machine is not a option. **Needs to be right on Windows.** Please help.


title: How to restore the original Backtrack Taskbar

text: I accidentally removed the my taskbar on Backtrack 5 and am having trouble returning it. If I minimize anything it gets lost and I can't access it again. How do I go about restoring it?


title: CentOS 6.3 Device eth0 does not seem to be present (Minimal non-cloned setup)

text: I installed CentOS 6.3 on my hardrive partition (new install...minimal install). After successful installation, I see that eth0 was down looked for 70-persistent-net.rules file under /etc/udev .. did not find it Here are my ifcfg-eth0 settings: **Note I had to create this file manually**               DEVICE=eth0     HWADDR=*     BOOTPROTO=dhcp     ONBOOT=yes     TYPE=ETHERNET      This machine is connected to ethernet(I have Windows 7 on another partition and I am able to connect to Internet)               ifconfig -a | grep eth      returns no result               ethtool eth0       returns `Cannot get device settings : No such device...` What can I try to get CentOS to detect eth0?


title: Locate disk in SAS enclosure

text: I want to blink the failing device in my 24-disk SAS enclosure. I have found `sg_ses --index 7 --set=locate /dev/sg24` which is supposed to identify slot 7. But how do I figure out which slot/index `/dev/sdh` is? This is not obvious as Linux does not name /dev/sdX after the slot, but after the sequence it was detected. Think what happens if slot 1 is empty at boot, but is filled later. Edit: The controller is a SAS2008.


title: \uFFFD character in directory name

text: I have a lot of directories with a \uFFFD (65533) character in it. The problem is that I can't really access this directory because of this character. For example I got a directory with the name: `Foo�o` (� == `\uFFFD`)   1. `ls Foo�o` is not working (so `tab` is always showing the only possible file but it will never complete it 'cause it's not working)   2. `ls Foo*` is working The problem is that I can't use the 2. way because there might be other directories starting with the same characters. So the actual question is if there's a way to escape a character like this. So I'm searching for a working version of this: `ls Foo\uFFFDo` <= not working


title: Failed updating posts on wordpress when use linux, but succeed on windows

text: I'm using Wordpress for blogging. And I use Windows 7 accompanied with Linux Mint on my PC. Recently I find that I can't update my posts on Wordpress when using Linux Mint. However, when I switch to Windows 7, I can update my post again. And another issue is I can upload files through FileZilla or FireFTP to my server on Linux Mint with no error, but the files become zero bytes. However, the same problem DOES NOT occur on Windows 7. So, what's the real cause? Should any settings to be done on the Linux network? ## Addition I have Linux Mint and Windows 7 Pro on my PC, both **not** running in a virtual machine. I use both Chrome (31.0.1626.0 dev) and Firefox (23.0) on Mint               No LSB modules are available     Distributor ID: LinuxMint     Description:    Linux Mint 15 Olivia     Release:    15     Codename:   olivia      for updating my posts but both browsers can't update the posts. ## Update Not only "Update" failed, "Save Draft", "Preview" and "Publish" all failed, even after I deactivated all the plugins.   Another issue occurs. On Linux Mint, I'm not able to post **questions with long content** on Stackoverflow, while on Windows 7 I can.


title: Emacs alternate editor client server start

text: How can I get Emacs to start in server mode with the alternate editor? From this conversation, I was able to enable the server with the alternate editor. However, I just re-installed emacs and I am receiving the following error now:               emacsclient: can't find socket; have you started the server?     To start the server in Emacs, type "M-x server-start".          Warning: due to a long standing Gtk+ bug      I added this to my bashrc:               #  aliases     # Emacs from the terminal as a client     alias emacs='emacsclient -t --alternate-editor='      but it isn't working as it did last time. I am on Emacs-snapshot-gtk. I was told this may be due to reading a server from another version so here is my `readlink` info.               dustin@dustin:~$ readlink -f $(type -p emacs)     /usr/bin/emacs-snapshot-gtk     dustin@dustin:~$ readlink -f $(type -p emacsclient)     /usr/bin/emacsclient.emacs-snapshot     dustin@dustin:~$      Does anyone know what I can do to fix this? * * * **Edit:** I found this add on for emacs: https://github.com/ahyatt/emacs-websocket However, I don't know if it will help or how to implement it.


title: Space left on Linux RAM/TMP,FS

text: Recently I have come to believe a number of unusual occurrences that have happened while running a Parted Magic Live CD, are the result of running out of space on the RAM based filesystem, namely:   * Folder contents disappearing, only to reappear later   * `Mount-gtk` not showing single mounted drive/not allowing unmount (While bash `mount` commands function normally)   * Firefox freezing, then seemingly freezing the GUI.   * My Firefox session recovering as if the browser crashes at each clean close   * Loosing last x minutes of Firefox session history   * Sound/clipboard redirection intermittently not working in `rdesktop`   * `Conky` crashing periodically ...Not despite the SpaceFM warning of no space to store state data **AND** some of these problems disappearing only after moving some files off the filesystem. Problem being, I am not sure how to (at least) keep an eye on the "space" left of the filesystem (Note: There is no entry for the `/` partition in the output of `df`, `fdisk -l` or `mount`), let alone (assuming I am right that the filesystem space not being relative to the system memory, that I had been monitoring with `conky`) how to go about increasing the sizing ?at boot time? Help? P.S Thought it most appropriate to tag this question with parted-magic, ramfs (or tmpfs... Not sure how to identify which one is in use) and low-disk-space like tags, but alas there doesn't appear to be any of them. If the community doesn't want to create one/all, please feel free to suggest other tags that others feel are appropriate.


title: What is "Exit 2" from finished background job status?

text: I have an exercise to put in a file some data (*conf from some directories) and need to do this in background. I did it and I am wondering what is the meaning of output messages:               [A@localhost tests]$ ls -ld /etc/*conf /usr/*conf > test1_6_conf.txt 2>&1 &      Enter rises this row:               [1] 2533      what does it mean? After other Enter, another messages appear               [A@localhost tests]$     [1]+  Exit 2                  ls --color=auto -ld /etc/*conf /usr/*conf > test1_6_conf.txt 2>&1      What does it mean? What is "Exit 2"? Enter an check results - seems to be all OK.               [A@localhost tests]$     [A@localhost tests]$ ls -l test1_6_conf.txt     -rw-rw-r--. 1 A A 2641 Nov 22 14:19 test1_6_conf.txt     [A@localhost tests]$       I am using CentOS 6.4, Gnome Terminal Emulator.


title: Is it possible to strace the builtin commands to Bash?

text: Inspired by this question, titled: When are the built-in commands loaded to memory, while attempting to answer this I tried the following command and was a bit surprised that I couldn't run it:               $ strace cd $HOME      Is there a method I can make use of to run strace for the builtin commands to Bash?


title: Fedora 18 in VM locks the CD drive

text: I have windows 7 and I installed VMware (VMware-player-5.0,2-1031769) and want to put fedora 18 in it but after complete installation is done I'm getting the below error: > The guest operating system has locked the cd-rom door and is probably using > the cd-rom which can prevent the guest from recognition media changes. If > possible eject the CD-ROM from inside the guest before the disconnection. Disconnect anyway and override the lock? Can anyone help me to come out of this problem...


title: Why does dd change the filesystem on the external disk?

text: I took out a 250 GB SATA disk from my netbook, filled it with zeroes with dd and connected it to my laptop via the usb adapter. It's correctly detected by fdisk:               Disk /dev/sdb: 250.1 GB, 250059350016 bytes     255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x475fa272             Device Boot      Start         End      Blocks   Id  System      I created a primary partition and used the following command to create a ext4 filesystem:               mkfs.ext4 /dev/sdb1      Now fidsk shows:               Disk /dev/sdb: 250.1 GB, 250059350016 bytes     81 heads, 63 sectors/track, 95707 cylinders, total 488397168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x475fa272             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1            2048   488397167   244197560   83  Linux      Ok, no surprise so far. Next, I wanted to extract Ubuntu ISO image with the following command:               dd if=~/ubuntu-12.10-desktop-i386.iso of=/dev/sdb      To my surprise, filesystem changed to 'Hidden HPFS/NTFS':               Disk /dev/sdb: 250.1 GB, 250059350016 bytes     19 heads, 24 sectors/track, 1071046 cylinders, total 488397168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x475fa272             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1   *          64     1542743      771340   17  Hidden HPFS/NTFS      What's the CORRECT way to extract ISO image to the external drive using dd with preserving the current filesystem?


title: FreeBSD 9 KDE4 No Mouse or keyboard at KDE login screen

text: Fresh Install of FreeBSD 9 and KDE 4. System boots to KDE log in screen, but no mouse or keyboard when I get there. I can `Ctrl``Alt``F1` out of the KDE. I Have the following lines in rc.conf:               moused_port="/dev/psm0"     moused_type="auto"     moused_enable"YES"     Option "AutoAddDevices" "false"     local_startup="$(local_start_up) /usr/local/kde4/etc/rc.d"     hald_enable="YES"     dbus_enable="YES"     kdm_enable="YES"


title: Automatically printing images with added captions

text: I have a lot of scanned images and images/photos I'm working on with multiple versions. When I print them (using various programs), all I get is the image and, often, it's difficult to tell which image came from which file. This is particularly frustrating with my (27K) photos when I have a print and want another copy and can't find it. (The photos are in KPhotoAlbum, so I can find the minority that I have actually tagged correctly.) What I would like is a utility that would print a bunch of images (e.g. doit *.jpg) and include an automatic (program generated) caption (hopefully configurable) with something like the full path of the file in it. gnome- photo-printer would be perfect if it had an option to print the full paths of the images with them. I need this while projects are in progress and for cleaning up afterwards. This is not for "final" images. It would be cool (and economical) if I could also specify the print size of the image because, often, smaller "thumbnail" images may be enough for organizing/cleaning up and they would save a bunch of time, paper, and ink/toner. I know I could manually create a document with an embedded picture in something like LO writer, but that would be totally manual (at least with my level of expertise) and thus very slow. It would be particularly nice to have the caption "outside" the picture so it would not interfere with the content and so I could control the background and font colors for readability. * * * I figured out (in principle) how to build something like this in bash using convert a couple of times along with composite (both from ImageMagick), but it's fairly convoluted and I'm hoping for something simpler.


title: Problems installing Arch Linux: cannot mount the installation media

text: > **Possible Duplicate:**   >  mounting problem during installation of archlinux on dell xps one I am trying to install Arch Linux on my Acer Aspire 4830tg, but I keep running into problems. I am trying to install Arch off a USB stick and I got the iso image using Bittorrent. I am also trying to install it alongside of Windows 8 (which is already installed). When I boot into Arch linux I get this error               :: Mounting '/dev/disk/by-label/ARCH_201212' to 'run/archiso/bootmnt'     Waiting 30 seconds for device /dev/disk/by-label/ARCH_201212 ...     ERROR: '/dev/disk/by-label/ARCH_201212' device did not show up after 30 seconds...     Falling back to interactive prompt     You can try to fix the problem manually, log out when you are finished     sh: can't access tty; job control turned off      So I know that it will work if I run it on a virtual machine but whenever I try to install it on my laptop I keep getting this error.


title: Why can't a normal user `chown` a file?

text: Why is the `chown` command root-only? Why can't non-root users use chown to give away files they own?


title: file owner not able to renounce the ownership to root? But root can!

text: I logged in as username 'ravbholua' I created a file `bb` as below:               ravbholua@ravi:~/Pictures$ echo>bb     ravbholua@ravi:~/Pictures$ ll     total 12     drwxr-xr-x  2 ravbholua sudo 4096 Oct 13 11:18 ./     drwxr-xr-x 23 root      sudo 4096 Oct 13 11:03 ../     -rw-r--r--  1 ravbholua sudo    1 Oct 13 11:18 bb     ravbholua@ravi:~/Pictures$      Please note the owner of `bb` is me (ravbholua). But I am not able to renounce the ownership to root.               ravbholua@ravi:~/Pictures$ chown root bb     chown: changing ownership of 'bb': Operation not permitted     ravbholua@ravi:~/Pictures$       But root can change the ownership of my file.               ravbholua@ravi:~/Pictures$ ll     total 12     drwxr-xr-x  2 ravbholua sudo 4096 Oct 13 11:18 ./     drwxr-xr-x 23 root      sudo 4096 Oct 13 11:03 ../     -rw-r--r--  1 root      sudo    1 Oct 13 11:18 bb     ravbholua@ravi:~/Pictures$      I am working on Ubuntu13.04 Earlier when I had worked on Fedora9, there the file owner was able to change the ownership. I think linux Operating System allows the file owner to do so.


title: can not chown a file from my $user to another $user

text: I am on slackware64 v14.0 and I have file that belongs to me:               -rwxrwxr-x+   1 nass  shares    137934 Mar  7 00:06 myfile.csv*      I am a member of the "shares" group. The folder that contains `myfile` looks like this               drwxrwsr-x+  12 nass shares 4096 Mar 12 04:54 winmx/      I now want to give ownership of this file to another user of this pc. The other user is also a member of the shares group. However,               chown otheruser myfile.csv         does not do the trick. I get a               chown: changing ownership of 'myfile.csv': Operation not permitted      I had recently asked a similar question about `gid`, but this is not the same problem. How can I solve this ?


title: Find all folders in a directory with the same content

text: In Ubuntu, is there any to find duplicate folders in a directory (i. e., folders with the same content)? I think there are already some command-line tools available for finding duplicate files (such as fdupes), but I want to find duplicate folders instead. That is, find folders which match in terms of the contents of the files they contain (though the filenames and other metadata might differ).


title: Printing connected users in bash script

text: I have a script file like this:               #!/bin/bash     clear           echo "The script starts now."     echo "Hi, user!"     echo           echo "I will now fetch you a list of connected users:"     echo      w          echo "I'm setting two variables now."     COLOUR="black"     VALUE="9"          echo "This is a string: $COLOUR"     echo "And this is a number: $VALUE"     echo       I observed that the effect of w is that it prints the following:                18:06:36 up  7:43,  3 users,  load average: 0.40, 0.56, 0.64     USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT     hes      tty7                      10:23    7:43m 12:31   0.96s gnome-session -     hes      pts/0    :0               15:41    4.00s  1.38s 11.46s gnome-terminal     hes       pts/2    :0               17:20   44:52   0.79s 11.46s gnome-terminal      when I typed echo " statement" in terminal , it prints the statement. But I could not understand w here. in terminal echo w , prints w not as above. I am a beginner in scripting, so can someone help me in understanding how this work?


title: APF IPTABLES automaticly removing allow hosts

text: I'm using apf for configure iptables. From last 5 days, apf automaticly removing IP from `/etc/apf/allow_hosts.rules` Please help me to clear this issue.


title: Configure Postfix to Relay and Login From External Machine

text: I hope someone can offer me some assistance with this, its driving me bonkers. There maybe a hole in my understanding on how this should work, so be gentle with me. I have a Crunchbang Debian LAMP server which I use to host some Mailing list applications. I also use it at a mail server running Dovecot and Postfix. Postfix is configured to relay to my Pro SMTP server account. Any email sent via application internally is sent perfectly via relay and any email sent to a user on my machine is received and Dovecot functions well as an IMAP Server. I can log into my machine from outside the LAN and read IMAP mails for any user. However, when I try to use Postfix from outside my network to send email via my relay the application trying to authenticate to Postfix as an SMTP just stalls or fails .. I am presuming that Postfix requires the same authentication as in via a Unix User and their associated password .. and have tried several different configs to now avail. Do I have to use another Port to relay via my Postfix config? My main.cf reads :-               # See /usr/share/postfix/main.cf.dist for a commented, more complete version               # Debian specific:  Specifying a file name will cause the first     # line of that file to be used as the name.  The Debian default     # is /etc/mailname.     #myorigin = /etc/mailname          smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)     biff = no          # appending .domain is the MUA's job.     append_dot_mydomain = no          # Uncomment the next line to generate "delayed mail" warnings     #delay_warning_time = 4h          readme_directory = no          # TLS parameters     smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem     smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key     smtpd_use_tls=yes     smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache     smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache          # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for     # information on enabling SSL in the smtp client.          myhostname = italchemists.twilightparadox.com     alias_maps = hash:/etc/aliases     alias_database = hash:/etc/aliases     myorigin = /etc/mailname     mydestination = italchemists.twilightparadox.com, italchemists-server, localhost.localdomain, localhost     relayhost = [pro.turbo-smtp.com]:587     smtp_sasl_auth_enable = yes     smtp_sasl_password_maps = hash:/etc/postfix/smtp_sasl_password_map     smtp_sasl_security_options = noanonymous     smtp_use_tls = yes     mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128     mailbox_size_limit = 0     recipient_delimiter = +     inet_interfaces = all     home_mailbox = Maildir/     smtpd_recipient_restrictions = permit_sasl_authenticated          smtpd_tls_security_level = may     smtpd_delay_reject = no


title: Find a file in the path without "which"?

text: I am (somehow) able to run a script:               $ assemble.sh file     ... [output]      But `which` can't find it:               $ which assemble.sh     which: no assemble.sh in (/s/std/bin:/usr/afsws/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/ucb:/bin:/usr/bin:/usr/stat/bin:/usr/X11R6/bin:.        1. How is this possible?   2. How can I find where this file is? I'm using bash.


title: Reconfiguring GNOME keyring daemon

text: I have a really strange problem when using GNOME keyring daemon. I had an old SSH key which I've now retired and started using a new, stronger keyfile. However, every time I attempt to SSH into one of my servers, SSH tells me               Agent admitted failure to sign using the key.     Permission denied (publickey).     fatal: The remote end hung up unexpectedly      I'm pretty sure that the keyring daemon is trying to use my old key for some strange reason. How can I reconfigure the keyring daemon to delete any knowledge of my old key?


title: Issue when setting a default path in BASH

text: I have a BASH scripting question. I'd like the mention that I am new to BASH scripting; however, I am not new to programming. I am developing a simple BASH script to watch a given compass project. My script is shown below. I would like to allow a user to optionally enter a custom path or use the default `http_path` value. I'm not sure how to set the `path` variable equal to the `http_path` variable where my default Apache directory is located using my current script. If any one has better suggestions and/or resources for learning how to write BASH scripts, please share! **Note:** I have searched this site, Google, and stackoverflow for an answer. If you find one with a solution to my issue, please let me know!               #!/bin/bash     # This script will watch a given compass project     http_path=/var/www/          echo -n "Enter in a new path and press. To use the default path $http_path press [ENTER] twice"          while read path; do         if [ -z "${path}" ]; then             clear               # these two lines enable the script to work if I do not             # I do not prompt for default path. It's been tested and works             # echo "That was empty, do it again!"             # echo -n "Enter in a compass project directory and press [ENTER]"             echo "Are you sure you would like to use the default path? Press [ENTER] to continue..."             $path=$http_path         else             echo "Checking now..."             break         fi     done          echo -n "Enter in a project to watch and prss [ENTER]"          while read project; do         if [ -z "${project}" ]; then             clear               echo "That was empty, do it again!"             echo -n "Enter in a compass project name and press [ENTER]"         else             echo "Checking now..."             break         fi     done          echo "Watching" $project "project in directory" $path     echo "To exit project press Command/Control + C"          cd $path     compass watch $project      See problem solution here


title: Is it possible to have a bashrc for a usergroup?

text: Is it possible to execute some bashrc file for all users in a group? If you can do that system-wide in /etc/profile then why not for a usergroup?


title: Error : .onLoad failed in loadNamespace() for 'cairoDevice' on a Linux Machine

text: After spending 1 hour searching for the solution I am posting this here. Does any one know how to install cairoDevice,package on R, Linux Server.               R CMD INSTALL cairoDevice_2.19.tar.gz      * installing to library 'software/R/R-2.15.2/library'     * installing *source* package 'cairoDevice' ...     ** package 'cairoDevice' successfully unpacked and MD5 sums checked     checking for pkg-config... pkg-config     configure: creating ./config.status     config.status: creating src/Makevars     ** libs     gcc -std=gnu99 -I/software/R/R-2.15.2/include -DNDEBUG -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12   -g -I/usr/local/include    -fpic  -g -O2  -c cairoDevice.c -o cairoDevice.o     gcc -std=gnu99 -I/users/GR/mb/gbogu/software/R/R-2.15.2/include -DNDEBUG -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12   -g -I/usr/local/include    -fpic  -g -O2  -c gtk.c -o gtk.o     gcc -std=gnu99 -shared -L/usr/local/lib64 -o cairoDevice.so cairoDevice.o gtk.o -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0     installing to software/R/R-2.15.2/library/cairoDevice/libs     ** R     ** demo     ** preparing package for lazy loading     ** help     *** installing help indices     ** building package indices     ** testing if installed package can be loaded     Error : .onLoad failed in loadNamespace() for 'cairoDevice', details:       call: fun(libname, pkgname)       error: GDK display not found - please make sure X11 is running     Error: loading failed     Execution halted     ERROR: loading failed     * removing 'software/R/R-2.15.2/library/cairoDevice'     * restoring previous 'software/R/R-2.15.2/library/cairoDevice'


title: History in the Almquist shell in the NetBSD

text: In NetBSD `/bin/sh` is a modified version of the Almquist shell. With the command `fc -l` it is possible to view the last 16 commands typed in the prompt in the **current** session and **not the older ones**. The environment variable `HISTSIZE` is set at 1000 and in `bash` this means that the last 1000 commands ( **whether or not** they were typed in the current session) are saved in a file named `.bash_history` in the home directory. But here it seems to mean just that the last 1000 commands in this session are keeped in the history, and the history does not seem to be saved in a file. I am looking for a history which allows not only to read the last commands of the current session, but also **the commands of the previous sessions** (for example, the previous time I started the system, not the actual time). Does `/bin/sh` in NetBSD have by default **such an history**? If not, is it possible to create such an history in that shell?


title: Prompt "-bash-3.2$" vs. "bash-3.2$" in SunOS 5.10

text: When I log into a server running SunOS 5.10, my prompt initially is "-bash-3.2$" Then when I run the following commands, I can see that the prompt is slightly different after typing `bash` (it no longer begins with a dash), yet echo $SHELL gives the same result.               -bash-3.2$ echo $SHELL     /bin/bash     -bash-3.2$ bash     bash-3.2$ echo $SHELL     /bin/bash      What does this mean, and what implications does it have?


title: Emulating a file

text: I have certain application that opens a file with given path (presumably with `fopen` or derivative), reads the file, possibly writes to it and closes it. I have no control over this application other than specifying the path. What I am trying to do is 'emulate' a file within the local filesystem to pass it to the application. That is, I want the file to appear as an ordinary file in the filesystem, however the streams are redirected to another application that handles them correctly and outputs appropriate data. Essentially, I want to create a pseudo-device, except that it is not a device at all. Is this doable at all? How would I approach this problem?


title: Why does dig take much longer than DNS query time?

text: I'm investigating slow DNS responses on Ubuntu, I have installed `bind9` to improve times from local cache, but still something is odd. What could make `dig` wait for 10 seconds and say that query time took 0?               time dig google.ro +all          ; <<>> DiG 9.9.3-rpz2+rl.13214.22-P2-Ubuntu-1:9.9.3.dfsg.P2-4ubuntu1.1 <<>> google.ro +all     ;; global options: +cmd     ;; Got answer:     ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 9665     ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1          ;; OPT PSEUDOSECTION:     ; EDNS: version: 0, flags:; udp: 4096     ;; QUESTION SECTION:     ;google.ro.                     IN      A          ;; Query time: 0 msec     ;; SERVER: 127.0.0.1#53(127.0.0.1)     ;; WHEN: Mon Feb 17 20:15:19 CET 2014     ;; MSG SIZE  rcvd: 38          dig google.ro +all  0.01s user 0.00s system 0% cpu 10.012 total


title: RNDIS Server to make a computer as a peripheral

text: First of all my goal is this, have a computer as a peripheral device to connect it to anyone's computer with ssh protocol or web. The idea is doing this by using a plug and play USB cable . Facts that I know:   * USB is designed as Master/Slave Architecture, so simple connection doesn't work beacuse both computer are acting as a host.    * Ethernet is the simplest solutions, I know but I don't want to loose that interface.   * There is a cable that makes a connection as USB PC to PC cable link. But I am not sure if we can get ssh work with this. Searching I found the RNDIS protocol, I think this maybe has a solution to my problem but I don't what is this for exactly. Here it says: > RNDIS support allows a PC to talk to a Linux-based embedded system over USB > by making the embedded system look like a USB attached Ethernet adapter. This is pretty much what I need. Could somebody guide me on what I want? Maybe I am missing the point, I do not know. **I have compile a new kernel with the USB GADGET DRIVERS options and setup g_ether.ko module. When I tried to load the module**               sudo modprobe g_ether     FATAL: Error inserting g_ether (/lib/modules/3.13.2/kernel/drivers/usb/gadget/g_ether.ko): No such device`      and               ls /lib/modules/3.13.2/kernel/drivers/usb/gadget/     -rw-r--r--  1 root root 25072 feb 14 15:04 gadgetfs.ko     -rw-r--r--  1 root root  9660 feb 14 15:04 g_cdc.ko     -rw-r--r--  1 root root  5888 feb 14 15:04 g_dbgp.ko     -rw-r--r--  1 root root 11676 feb 14 15:04 g_ether.ko     -rw-r--r--  1 root root 12072 feb 14 15:04 g_mass_storage.ko     -rw-r--r--  1 root root 22548 feb 14 15:04 g_printer.ko     -rw-r--r--  1 root root  9604 feb 14 15:04 g_serial.ko     -rw-r--r--  1 root root 29748 feb 14 15:04 g_webcam.ko     -rw-r--r--  1 root root 13576 feb 14 15:04 g_zero.ko


title: how to install arch linux on 32 bit system

text: I would like to install arch Linux on my netbook, which is not 64 bit compatible. I searched through the downloads on the arch Linux download page and everything there pertains to 64 bit architecture. All of their documentation reflects this as well. Is arch Linux today only for 64 bit systems?


title: awk + print awk output in one line

text: When I run the following **hasys** command with **awk** , I get output with machines names as the following:               hasys -display|grep Shutdown | awk '{print $1}'       machine1a       machine1b      please advice how to print the machines names in one line as the following: example               hasys -display|grep Shutdown | awk '{print $1}'              machine1a machine1b      what I need to add in my awk syntax so I will able to print the names in one line?


title: Joining two files

text: I have a 2 files with the following:               File1.txt      A 1     B 2     C 5     Z 3          File2.txt     A 4     B 7      C 10     D 11      What I would like to do is create something like               A 1 4      B 2 7     C 5 10     D - 11     Z 3 -      Is there a utility that does this? If not how Can this be done? Using a `find` and `awk` or something?


title: Whisker menu remove keyboard shortcut

text: Using Linux mint 16, with XFCE as desktop environment. I have a problem removing the default keyboard shortcut (Super_L), for opening the Whisker menu. The shortcut shows up in Application shortcuts, in the keyboard settings.Though, as shown in the image below, I am not able to remove it by clicking remove - nothing happens. ![shortcut](http://i.stack.imgur.com/BeWon.png) I have also tried modifying ~/.config/xfce4/xfconf/xfce-perchannel- xml/xfce4-keyboard-shortcuts.xml to no avail. I can not seem to find an entry for the xfce4-whiskermenu-plugin. Even uninstalling the Whisker menu does not work. So my question is, how do I stop the Whisker menu from hijacking my Windows/Super_L key? I want to bind this key to another application launcher.


title: Monitor all login attempts

text: Few weeks ago I thought it would be a good idea to write a script to send me an email whenever some user logs in into my server. So I came with a perfectly working script `notifyLogin.sh`, then I decided to call it from each user's `.bash_login` script. But I discovered that someone could log in in my server using `ssh` `-t` switch to select an available shell. For example:               ssh user@myserver -t sh      This way, `.bash_login` does not execute, neither does `/etc/profile`. Is there any way to call `notifyLogin.sh` independent of shell type at log in? (It should always work)


title: How to enable both built-in audio output and HDMI audio output with PulseAudio?

text: I've been searching for this issue for days now and tried various solutions suggested, without any success. Basically, I have a laptop with built-in audio (the output goes either to the headphone jack or to the built-in speaker) and HDMI. I'm running Debian 7.5 with KDE. Previously, I was running ALSA only and I was able to configure Skype to ring on the HDMI, but use the headphones for the calls themselves. I'd like to achieve something similar using Pulse. I'm not sure if Skype still separates ringing and call audio when it sends them to PulseAudio, but as the Linux version of Skype can run arbitrary scripts on events, I would be happy if I could use e.g. `aplay` to play something on the HDMI port. However, whatever I do, I always see (and can use) a single output device only. `aplay -l`:               **** List of PLAYBACK Hardware Devices ****     card 0: PCH [HDA Intel PCH], device 0: ALC269VB Analog [ALC269VB Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0      `aplay -L`:               default         Playback/recording through the PulseAudio sound server     sysdefault:CARD=PCH         HDA Intel PCH, ALC269VB Analog         Default Audio Device     front:CARD=PCH,DEV=0         HDA Intel PCH, ALC269VB Analog         Front speakers     surround40:CARD=PCH,DEV=0         HDA Intel PCH, ALC269VB Analog         4.0 Surround output to Front and Rear speakers     surround41:CARD=PCH,DEV=0         HDA Intel PCH, ALC269VB Analog         4.1 Surround output to Front, Rear and Subwoofer speakers     surround50:CARD=PCH,DEV=0         HDA Intel PCH, ALC269VB Analog         5.0 Surround output to Front, Center and Rear speakers     surround51:CARD=PCH,DEV=0         HDA Intel PCH, ALC269VB Analog         5.1 Surround output to Front, Center, Rear and Subwoofer speakers     surround71:CARD=PCH,DEV=0         HDA Intel PCH, ALC269VB Analog         7.1 Surround output to Front, Center, Side, Rear and Woofer speakers     hdmi:CARD=PCH,DEV=0         HDA Intel PCH, HDMI 0         HDMI Audio Output      When I try to use the hdmi device directly, I get the following error:               $ aplay -D hdmi alert.wav     Playing WAVE 'alert.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono     aplay: set_params:1087: Channels count non available      In `pavucontrol`, under the Configuration tab, I see a `Profile` drop-down with the following options:               Analog Stereo Duplex     Analog Stereo Output     Analog Stereo (HDMI) Output + Analog Stereo Input     Analog Stereo (HDMI) Output     Analog Stereo Input     Off      As far as I can tell, all of these work as (probably) expected: the ones that say HDMI will direct audio output to the HDMI port; the others to the built-in audio card. No matter which one I select, I always see a single output device only under the Output Devices tab. I've tried adding either the built-in or the HDMI device to `/etc/pulse/default.pa` using `load-module module-alsa-sink device=hw:0,0` and `load-module module-alsa-sink device=hw:0,3` - these either seemed to have no effect, or made pulseaudio not display any profiles at all.


title: How do I resolve an error when booting, "Couldn't find device with UUID...."

text: I have a RHEL 6 system, running on a VMWare machine. The admin of the VM server added a second RAID volume to the server, which my RHEL system does not use. Now, when I boot the RHEL system, I get a kernel fault. If reboot without the graphical boot screen, I see these errors:               dracut Warning: LVM vg_mdxinfalf02/lv_swap not found      I'm not sure if this is tied to the added RAID volume or if the reboot somehow caused the issue. How do I resolve this? I ran the lvm command and when I do `pvscan`, I see:               Couldn't find device with uuid a30bfw-...     PV /dev/sda2       VG vg_mdxinfalf02   lvm2 [19.51 GiB / 0    free]     PV unknown device  VG vg_mdxinfalf02   lvm2 [80.00 GiB / 0    free]      `fstab`:               /dev/mapper/vg_mdxinfalf02-lv_root / ext4 defaults 1 1     UUID=48075904-965f-4aad-8cad-369469dcf0f2 /boot ext4 defaults 1 2     /dev/vg_mdxinfalf02/lv_data /var/jenkins ext3 defaults 0 0     tempfs /dev/shm tmpfs defaults 0 0     devpts /dev/pts devpts gid=5,mode=620 0 0     sysfs /sys sysfs defaults 0 0     proc /proc proc defaults 0 0      `blkid`:               dracut:/# blkid     /dev/sda1: UUID="48075904-965f-4aad-8cad-369649dcf0f2" TYPE="ext4"     /dev/sda2: UUID="LJ9wLe-cZZQ-TO8R-tRXl-lJK4-NWoI-mLYfyC" TYPE="LVM2_member"     /dev/mapper/vg_mdxinfalf02-lv_root: UUID="50f12dee-1cd8-4a1f-a110-87f246b01cfa" TYPE="ext4"


title: WiFi not working after restoring from hibernation (authentication times out)

text: My Intel 6205 wireless network card does not work after hibernating. It sometimes also does not work on boot, failing in the same way. Occasionally, it also stops working after ~10 minutes of continuous use. I have experimented with combinations of: `modprobe -r iwlwifi` before and after hibernating (or when the problem otherwise occurs), followed by `modprobe iwlwifi`; and then `systemctl restart network-manager` and `systemctl restart NetworkManager`. These solutions are what all search results for the symptoms focuses on. What else should I try? Configuration:   * Debian Jessie   * kernel 3.14.4-1    * networkmanager 0.9.8.10   * Intel 6205 rev 96 (iwlwifi)   * Lenovo ThinkPad X1 Carbon > >     $ dmesg >     wlan0: authenticate with 47:f2:2f:91:db:7b >     wlan0: Wrong control channel: center-freq: 5500 ht-cfreq: 5180 > ht->primary_chan: 36 band: 1 - Disabling HT >     wlan0: direct probe to 47:f2:2f:91:db:7b (try 1/3) >     wlan0: direct probe to 47:f2:2f:91:db:7b (try 2/3) >     wlan0: direct probe to 47:f2:2f:91:db:7b (try 3/3) >     wlan0: authentication with 47:f2:2f:91:db:7b timed out >     wlan0: authenticate with 47:f2:2f:91:db:7b >     wlan0: send auth to 47:f2:2f:91:db:7b (try 1/3) >     wlan0: send auth to 47:f2:2f:91:db:7b (try 2/3) >     wlan0: send auth to 47:f2:2f:91:db:7b (try 3/3) >     wlan0: authentication with 47:f2:2f:91:db:7b timed out >     # the last 5 messages repeat indefinitely as connection is reattempted >


title: Looping the listing files in UNIX

text: I've given the command:               ls -lrt      and the listed files and directories are:               drwxr-xr-x   4 root root    4096 Feb  2  2014 abc     drwxr-xr-x   4 root root    4096 Feb  2  2014 cde     drwxr-xr-x   4 root root    4096 Feb  2  20014 efg     -rwxr-xr-x   4 root root    4096 Feb  2  20014 aaa.txt      Now I want to find whether the listed output files are directory or not by using for loop or while loop.


title: Using a command's output in printf in ksh

text: I am trying to perform the following :               printf "Are you sure you want to copy %s (y/n) ? (file bigger than 10 MB) " "$0"      It works fine, nevertheless, I would like to display the actual size of my file, by doing something like :               printf "Are you sure you want to copy %s (y/n) ? (file bigger than 10 MB : %s) " "$0" "ls -l $0 | awk {'print $5'}"      However, I have a failure by doing so. I guess it is not the right way to do it.


title: Why is my Systemd unit loaded, but inactive (dead)?

text: I'm trying to set up Graphite on my server. I can start the Carbon Cache daemon no problem with `sudo /opt/graphite/bin/carbon-cache.py start`, but I'm struggling to run it as a Systemd unit. Here's what I have in my service file, `graphite.service`:               [Unit]     Description=Carbon for Graphite          [Service]     ExecStart=/opt/graphite/bin/carbon-cache.py start          [Install]     WantedBy=multi-user.target      But when I start the unit I get the following status:               $ systemctl status graphite.service                 * graphite.service - Carbon for Graphite        Loaded: loaded (/etc/systemd/system/graphite.service; enabled)        Active: inactive (dead) since Fri 2014-06-13 18:44:11 UTC; 2s ago       Process: 4525 ExecStart=/opt/graphite/bin/carbon-cache.py start (code=exited, status=0/SUCCESS)      Main PID: 4525 (code=exited, status=0/SUCCESS)          Jun 13 18:44:11 MEADOW systemd[1]: Started Carbon for Graphite.      Journalctl yields no more information. **How should I interpret and debug units with a status of "inactive (dead)...(code=exited, status=0/SUCCESS)"?** I've seen failed units before, but this one is successfully loaded yet not running and I don't know what that means.


title: Mount iso9660 sd card

text: I'd like to mount my sd-card manually, but that doesn't work.               [linus@linus_linux-notebook ~]$ lsblk     NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT     sda           8:0    0 55,9G  0 disk      ├─sda1        8:1    0 47,7G  0 part /     └─sda2        8:2    0  8,2G  0 part [SWAP]     sr0          11:0    1 80,2M  0 rom       mmcblk0     179:0    0  3,8G  0 disk      └─mmcblk0p1 179:1    0  3,8G  0 part           [linus@linus_linux-notebook ~]$ sudo mount /dev/mmcblk0p1 /media/sdarch     [sudo] password for linus:      mount: Falscher Dateisystemtyp, ungültige Optionen, der     Superblock von /dev/mmcblk0p1 ist beschädigt, fehlende     Kodierungsseite oder ein anderer Fehler          In some cases useful info is found in syslog - try     dmesg | tail or so.          [linus@linus_linux-notebook ~]$ lsblk -f     NAME        FSTYPE  LABEL          UUID                                         MOUNTPOINT     sda                                                                       ├─sda1      ext4    arch        2f47d944-a40c-4edb-bf81-aa4b978b1a6b /     └─sda2      swap    swap        cb6c3da9-b65a-451b-96a3-2f3697d7afd0 [SWAP]     sr0                                                                       mmcblk0     iso9660 ARCH_201305 2013-05-01-07-12-33-00                    └─mmcblk0p1 iso9660 ARCH_201305 2013-05-01-07-12-33-00                         [linus@linus_linux-notebook ~]$ dmesg | tail     [  230.435448] usb 3-5: GSM modem (1-port) converter now attached to ttyUSB1     [  231.379997] scsi 7:0:0:0: Direct-Access     HUAWEI   SD Storage       2.31 PQ: 0 ANSI: 2     [  231.381986] scsi 6:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2     [  231.389964] sd 7:0:0:0: [sdb] Attached SCSI removable disk     [  231.392957] sr0: scsi-1 drive     [  231.393164] sr 6:0:0:0: Attached scsi CD-ROM sr0     [  243.294429] PPP generic driver version 2.4.2     [  249.799115] PPP BSD Compression module registered     [  249.805593] PPP Deflate Compression module registered     [ 1165.652241] perf samples too long (2502 > 2500), lowering kernel.perf_event_max_sample_rate to 50100


title: starting vim with command substitution

text: I am working on a project on two different machines - one running Mac OSX 10.8.3, and one running Red Hat Enterprise Linux. On my Mac, I can do this:               vim $(ls -R */*.@(h|cpp) */*/*.@(h|cpp))      and everything works fine. On the Linux box, it fails. All of these work exactly as I expect:               ls -R */*.@(h|cpp) */*/*.@(h|cpp)     echo $(ls -R */*.@(h|cpp) */*/*.@(h|cpp))     export myfilelist=$(ls -R */*.@(h|cpp) */*/*.@(h|cpp))     echo $myfilelist      But               vim $(ls -R */*.@(h|cpp) */*/*.@(h|cpp))      produces a set of mangled filenames, e.g.               ^[[00m^[[00mevent_builder/include/eb_service.h^[[00m" [New DIRECTORY]      or               :ls       1 %a   "^[[00m^[[00mevent_builder/include/eb_service.h^[[00m" line 1       2      "^[[00mevent_builder/include/EventBuilder.h^[[00m" line 0      Does anyone know why?


title: How does having /dev/fd make running shell scripts under sudo safe?

text: At the end of the man page for `sudo`, there's the following remark:                  Running shell scripts via sudo can expose the same kernel bugs that        make setuid shell scripts unsafe on some operating systems (if your OS        has a /dev/fd/ directory, setuid shell scripts are generally safe).      Pretty much everything in that paragraph is obscure to me. In particular, I'd like to learn what the allusion to `/dev/fd` is all about. I tried to guess some possible man pages where I may find this information, but I came up empty. Any suggestions? (Ultimately I'd like to run a few scripts under sudo via cron, if that's possible, but of course I'm concerned about possible security holes in such an unsupervised arrangement.)


title: Could not allocate requested partitions while instaling Scientific Linux

text: I am installing Scientific Linux, and I must choose a drive to install it. I have a deleted partition with the size of 150 GB. ![enter image description here](http://i.stack.imgur.com/3Ucfu.jpg) When I select the deleted partition and try to create a partition this happens: ![enter image description here](http://i.stack.imgur.com/evPRO.jpg) > Could not allocate requested partitions: not enough free space on disks. I cannot resolve the problem. Does anybody know what the problem is?


title: Automate input procedure to a binary file

text: I have a binary file on Unix, which when executed asks the user for inputs. The inputs to this binary file are given manually. I want to automate the procedure, since I know the inputs already. I can't modify the binary file. How can I do this ? Is this possible via shell script or even with `ant` targets ?


title: Red Hat Enterprise Linux desktop: constant crashing, unusable, what to do

text: I'm having constant problems with RHEL recently. My desktop crashes during the day occasionally (once a day roughly) and is hung (black screen) every morning requiring a button-hitting restart. Clicking the "kernel crash dumps" menu item does nothing. I'm wondering if it's to do with the latest round of redhat updates but I don't want to just unwind updates on mere suspicion. Anybody else hating Red Hat this week? How can I view the crash dumps? 2.6.32-358.2.1.el6.x86_64 #1 SMP Wed Feb 20 12:17:37 EST 2013 x86_64 x86_64 x86_64 GNU/Linux cat /etc/redhat-release Red Hat Enterprise Linux Workstation release 6.4 (Santiago) Already have this installed too:               yum install kexec-tools crash kernel-debuginfo kernel-debuginfo-common system-config-kdump     Loaded plugins: product-id, refresh-packagekit, rhnplugin, security     This system is receiving updates from RHN Classic or RHN Satellite.     rhel-x86_64-workstation-6                                                                                | 1.8 kB     00:00          Setting up Install Process     Package kexec-tools-2.0.0-258.el6.x86_64 already installed and latest version     Package crash-6.1.0-1.el6.x86_64 already installed and latest version     No package kernel-debuginfo available.     No package kernel-debuginfo-common available.     Package system-config-kdump-2.0.5-15.el6.noarch already installed and latest version     Nothing to do      And:               grep -v "#" /etc/kdump.conf           path /var/crash     core_collector makedumpfile -c --message-level 1 -d 31


title: How does SSH display the message "The authenticity of host .. can't be established"?

text: I wanted to trace down the system call used by ssh to output this warning message:               > ssh root@abcde     The authenticity of host .. can't be established.      If the message were sent to stderr or stdout, there would definitely be a system call trace showing ssh `write()` to stderr/stdout. However, there is none. So how does SSH show the warning message on terminal? Does SSH directly manipulate terminal device to display the message, without interacting with stderr/stdout?


title: Bash loop new user

text: I have to create 20 users on 10 servers. I want to create a script that will create 20 users for me on the server (that's easy with `useradd`) and encrypt the password. I have my variable `$crypt=perl -e 'print crypt...'` Now I want to create a loop that will create the new users and the password will be set by `$crypt`. How I can do this ?


title: Linux shows one partition but windows shows 4

text: I have installed Windows 8 on my laptop and now I want to install Linux Mint 14. I want to use both of them. My disk management in Windows shows as follows:    ![picture](http://i.stack.imgur.com/VqVud.jpg). mint4win in linuxmint-14.1-cinnamon-dvd-64bit is used to do the install. Then I shut down Windows and open Linux Mint. However, during the install process a wizard shows the whole hard disk as one partition. I used a DVD an a USB other than mint4win. But it gives the same result. How can I get rid of this?


title: Is there anyway to get the hardware information on a hardware RAID 1 while inside of the OS?

text: Is there any way to see the information on a hardware raid while still being in the OS? Things to note:   * I am remotely connected to this machine (so I cannot physically see the information of both drives, but I do know that two drives are in this machine)   * I cannot reboot this machine as it is in production   * This unit was handed off to me, but I can gather more information as needed   * GUI: Gnome Version 2.30.0   * OS: Ubuntu 10.04


title: Find word in sentence with Bourne Shell (sh)

text: I'm trying to determine if a particular word appears in a sentence using Bourne Shell (sh). For example:               #!/bin/bash     INPUT='Lorem ipsum dolor sit amet.'          if [[ "$INPUT" == *dolor* ]]     then         echo "So true"     else         echo "Not true"     fi      This works in `bash`, but I can't use `bash`, I need something that works in `sh`


title: IP of localhost

text: How does a Linux instance determine its IP address? That is, not the 127.0.0.1. Is this stored in file or does ifconfig somehow calculate it at every invocation? I managed to solve it just to show I made an effort, but it is not anything I'd put in a serious application:               sudo ifconfig | head -n 2 | tail -n 1 | tr -s " " | tr " " ":" | cut -d":" -f 4


title: How to force google/youtube searches using the bash?

text: I'd like to know how to force the bash to do a Google or Youtube searches (in mozilla) of a given phrase. I'm also interested in a scripts that enters a Youtube video and recognizes if there is an advertisement in the beginning.


title: How to make a Torrent client keep the same torrent data for multiple users?

text: I'm running Linux Mint with two user accounts. One account has admin priviliges while another is a normal account. If I start a torrent download in admin account I want that to continue even in the other account and vice-versa. So, basically I want a torrent client to have the same app data for both accounts. I'm currently using Ktorrent.


title: why updatedb command takes too much time?

text: I have read that to run **locate** command on **CYGWIN** first I need to run the following command.               updatedb --localpaths=c:/      what this command exactly do as I run this on CYGWIN and it is taking too much time.


title: How to store pipe ( | ) in a variable?

text: The idea would be to use it as... a pipe in a command. For instance: say there's some kind of long path which has to be retyped again and again, followed by a pipe and a second program, i.e.               "directory1/directory2/direcotry3/file.dat | less -I "      Now i'd like that part to be stored in a variable, so it could be used like this:               r="directory1/directory2/direcotry3 \| less -I -p "     $ cat path1/path2/$r <searchterm>      Instead, I get               cat: invalid option -- I     Try `cat --help' for more information.      meaning pipe clearly didn't work.


title: Remove a particular line no from a text file

text: I have .csv file having several lines of data. I have to search for a particular value in the string/record and delete that line itself. eg ; abc.csv               col1_id,col2,col3,col4,col5     1000541,aaaa,bbbb,cccc,dddd     1000542,eeee,ffff,gggg,hhhh     1000543,iiii,jjjj,kkkk,llll     1000544,mmmm,nnnn,oooo,pppp      i need to search for 1000542 and remove the whole record of that particular line;               col1_id,col2,col3,col4,col5     1000541,aaaa,bbbb,cccc,dddd     1000543,iiii,jjjj,kkkk,llll     1000544,mmmm,nnnn,oooo,pppp


title: Running system bash command in PHP script - syntax error: unexpected T_LNUMBER

text: If anyone can shed some light on my issue that'd be great. Please don't down- vote me; I'm new to the language and the OS itself and I'm trying my best to research before asking questions, so any positivity is appreciated. Below is an extract from a script that I've written in PHP, but contains a system command that executes in bash. Now, the reason for this is because it allows me to use the awk function which is ideal in the scenario I've been presented with. I'm trying to get the fourth or fifth element of a string (stored in $line), which I then plan to work with. However whenever I execute it with the code below I am presented with the following error:               PHP Parse error:  syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/hugh/HughScripts/ParseOutputForFieldsV2.php on line 16      Line 16 is my first system command:               system("echo \"$line\" | awk '{$1=$2=$3=$4=""; print $0}'");      However I'm unsure due to my lack of expertise with both PHP and the system function, what exactly is causing my issue. Can anyone possibly shed some light on it? I've tried researching the problem, however the error is quite generic and my situation is quite unique, as a lot of the 'awk' problems on the web are part of scenario where the person is executing it from the CLI rather than a PHP script. Here's an example of what data would be in the $line variable:               Gi1/1                          down           down     Neustar : NX/IB49912 : 1Mbps - Offshore SLA      Code below:               $skipFirstLine = 1;               foreach($outputFile as &$line)     {         if($skipFirstLine == 0)         {                 if(strpos($line, 'admin down'))                 {                         //$fieldamount=system("echo \"$line\" | awk '{ print NF}'");                         //echo $fieldamount;                         system("echo \"$line\" | awk '{$1=$2=$3=$4=""; print $0}'");                 }                 else                 {                         system("echo \"$line\" | awk '{$1=$2=$3=""; print $0}'");                 }         }         else         {                 $skipFirstLine = 0;         }     }


title: Closing lid on Crunchbang

text: I'm running Crunchbang on a laptop. I can't seem to find an option to toggle if the laptop goes to sleep when the lid closes. There are certain times where I want to put the laptop away or close it but still have it do some crunching on some long running task. Is there a place to toggle this option?


title: Awk that I am stuck on

text: I have a project I am working on for work. The script I am building initially takes two arguments: one is an unique Identifier and the other is for a log file (both strings). Now I have the first part of it done which is parsing for the unique Identifier. But the second part, is parsing for a specific piece of string which is a randomly generated string of numbers and letters. I am using a `awk` statement to get this random string and I have verified that my expression is correct in Rubular. But when I attempt to test the code with more, nothing prints out. Here is what I typed in the command line:               awk '/\s=\s[a-zA-Z0-9-]+/ {print }' ~/jlog/server.log | more      Here is what I have in my script:               for j in $(cat ~/jlog/"$2"); do awk '/'"$1"'/\s=\s[a-zA-Z0-9-]+/ {print}'      And here a piece of the log I am parsing through:               2014-06-17 15:34:52,406 INFO  [random.random.xxx.message.Random] Processed instance (1.2.840.113619.2.284.3.2013961368.890.1402186239.15     5/1.2.840.113619.2.80.1944071037.22604.1402323463.136) from random@email.com to Random_AE.  AssociationID = 9eddb1b0-368e-4fb9-a684-44cc14be389c      I am looking specifically for the random code after the Association ID. Is there any suggestions on how to display the results? I am fresh out of ideas.


title: less or more - which to use when?

text: `less` and `more` seem to have very similar functionality in that they both page through text a screen at a time. What reasons are there to use one over the other?


title: Good distro for a VM?

text: I want a lightweight Linux VM that I can run with VirtualBox on Windows so I can test how to deploy PHP apps, Mono apps, etc. I don't need the UI and was thinking of going with the Ubuntu server ISO. Is that a good choice? I know I can also download a ready-made VM and it's tempting. What does the community think?


title: Monitoring an under attack Server thorugh a remote endpoint

text: I have this Debian server that is constantly under attack as shown in its `/var/log/auth.log` file. I was wondering if there is a best practices of monitoring it through sending all important log files to a remote endpoint via `rsync` or something of the same family. I am pretty sure that there are out there far more experienced *nix admins who probably reached better ideas for doing this hence I am open to all sorts of ideas.


title: Moving folders used wrong syntax and lost them

text: I thought I was being smart trying to move a folder to one level up by going:               mv folder .newfolder and neglecting to even put:               mv folder .newfolder/folder and anyway it didn't put up an error but the folders have vanished. Where could they be I wonder?


title: Fedora, CentOS, Ubuntu Linux all are open source linux, but what about when i want to make my own brand from that?

text: I have used Fedora/Ubuntu/CentOS all of them, and they are open source linux, free to all users and free to do almost anything. But i do not get this correctly yet. They are open source, and they are free to use, but what happen if i copy there version and make my own brand linux called "Zyx.", will i be able to that? I was asked by someone, and i was confused to give correct answer on this, so my question is: "Is it legal to tell someone, you can use Fedora/Ubuntu/CentOS, if you want to make your own OS, simply build on it and copy it? with your brand name?"


title: Limit process to one cpu core

text: How to limit process to one cpu core ? Something similar to `ulimit` or `cpulimit` would be nice. (Just to ensure: I do NOT want to limit percentage usage or time of execution. I want to force app (with all it's children, processes (threads)) to use one cpu core (or 'n' cpu cores)).


title: Can't run certain fullscreen applications

text: I have a dual screen setup which I've configured by running this command at startup:               xrandr --output VGA-0 --auto --right-of DVI-0      I'm running `OpenSuse 11.4` with `dwm` as my window manager. I can post the output of any command or dump any file if you think it will help. The problem happens when I try and run a fullscreen game. My right screen goes black and loses the signal. On the other screen, my resolution goes down and I see a magnified version of the upper left corner of my desktop (the dwm tag bar). I can hear the game audio but I can't see anything other than what I described above. Another important thing is when this happens I need to reboot (or at least restart X) because I get no input and can't close anything. **EDIT 1**               02:00.0 VGA compatible controller: ATI Technologies Inc Juniper [Radeon HD 5750 Series]      I'm not sure how I can find what driver I'm using, but I expect it's opensuse's stock driver. When the issue happens, I can't see my mouse at all -- even if I try and move it to the upper left. Pressing `Ctrl+Alt+F1` drops me to a command line login. Once I enter my information I can hear the audio again but I am in still the CLI. `Alt+SysReq+S` does nothing at all. **EDIT 2** After running the game and getting "locked up", I hit `Ctrl+Alt+F1` and was brought to a shell. I logged in and ran my display command and received the following error message:               X Error of failed request BadMatch (invalid parameter attributes)       Major opcode of failed request: 150 (RANDR)       Minor opcode of failed request: 7 (RRSetScreenSize)       Serial number of failed request: 40       Current serial number in output stream: 41      It looks like it's saying I've mistyped it or something, however I tried a couple times and I'm fairly certain my syntax was correct. I still tried going back to X with `Ctrl+Alt+F7` and I was stuck in the same situation. I then went back to the console and killed the game's process, and went back to X to see what happened. The resolutions and screens were still messed up, however I had mouse and keyboard support and could use my browser.


title: why does sudo work on Linux but not Android?

text: I have not had the chance to read enough about Android, Linux, or UNIX to answer this myself. `sudo` works on a Linux machine but doesn't work on Android unless you root the mobile device (e.g. Samsung GT-N8013). Why does the mobile device require to be rooted, but not the typical Linux install? * * * The context of my question is related to http://stackoverflow.com/questions/14019698/adb-shell-sudo-on- windows-7/14019726#14019726 (Also, is there any way for a program to ask to run as `root` on Android, the same way you have escalation of privileges to "run as administrator" on Windows? If you think this question should be on its own thread, I can create one)


title: awk separate columns of 3

text: I have a file that looks like the following (the columns are separated by tabs and might contain spaces):                   0637    apple    8528    1392    orange    1390    8528    unknown fruit    7537    1039    banana    1892    0989    pineapple    7537    8528    melon    7537    8528    grape    7537    8528    (null)    (null)      And I need to split it each 3 columns, grepping the ones that will result in `[0-9]$` (I'm using `awk` because is much faster than grep on large files):               0637    apple    8528     1392    orange    1390     8528    unknown fruit    7537     1039    banana    1892     0989    pineapple    7537     8528    melon    7537     8528    grape    7537      Now, I have this _beautiful_ command that does it:               awk -F\\t '{print $2 "\t" $3 "\t" $4 "\n" $5 "\t" $6 "\t" $7 "\n" $8 "\t" $9 "\t" $10 "\n" $11 "\t" $12 "\t" $13 "\n" $14 "\t" $15 "\t" $16 "\n" $17 "\t" $18 "\t" $19 "\n" $20 "\t" $21 "\t" $22 "\n" $23 "\t" $24 "\t" $25}' filename | awk '/[0-9]$/'      I have also an ugly `cut` command that does the same. I'm still learning awk, so I believe there is a much wiser way to do this. Also, I might **get into trouble if there is more than`$25`**. Can you help me?


title: Arch Linux makepkg failed on compressing package

text: I just reinstalled Arch Linux 2010.05 on VPS, and               sudo pacman -Syu       But when I try to install anything from AUR, makepkg failed on               ==> Tidying install...       -> Purging unwanted files...       -> Compressing man and info pages...       -> Stripping unneeded symbols from binaries and libraries...     ==> Creating package...       -> Generating .PKGINFO file...       -> Compressing package...     bsdtar: FIEMAP failed: Invalid argument     bsdtar: FIEMAP failed: Invalid argument     bsdtar: FIEMAP failed: Invalid argument     ==> Leaving fakeroot environment.


title: Why FOSS 3d performs so badly, compared to proprietary. Trying to understand

text: I know this is not the best question, I'm just trying to understand what needs improvement. I just read a Phoronix article, which compared the FOSS radeon drivers a 5 years old FGLRX catalyst. As you would expect FGLRX was multiple times faster, even the feature set was not completely implemented. The big question, not answered in the article, was why? I noticed FGLRX brings its own libGL, does Nvidia do this also? I know hardware registers are not always completely known, and yadda yadda... I still suspect that mesa is not a strong performer. What needs to be done to reach remotely close to catalyst speed? What projects need help? Which ones need to be completely ditched?


title: Can I automate y/N responses while installing?

text: When I run installs in Fedora with say `yum groupinstall "Development Tools"`, I am sometimes prompted to hit y/N. Can I tell the OS to automatically chose y when such prompts occur? That would let me leave my computer for a while and come back.


title: Trying to run oprofile on ubuntu kernel but cannot find vmlinux file

text: I am trying to run oprofile on my ubuntu host but cannot find the vmlinux file. The set up sfor oprofile needs this file: As given here : http://oprofile.sourceforge.net/doc/overview.html#getting- started               opcontrol --vmlinux=/boot/vmlinux-`uname -r`      What should I do so that I can profile the ubuntu kernel. I am using 2.6.32-34-generic-pae (uname -r)


title: Which data should be excluded from log files , error messages etc. if posted online?

text: What data should one erase from log files, error messages etc., if posting them as a screenshot so as not to expose sensitive information? As I have little knowledge about this topic, I can vividly imagine somebody exposing oneself in a bad way. My guess, as a newbie, would be the computer's and the user's name. **To narrow down my question** : What should a Linux User be extra aware of hiding if posting screenshots of logfiles, error messages, settings, etc.?


title: lsof and listening ports

text: I am trying to get all the processes listening for a network connection on Mac OS X. `netstat` does not have the `-p` option and I am trying with lsof               lsof -i -sTCP:LISTEN      gives me a fair list of listening processes but not all. I can for example telnet to port 10080 where I have a process listening for a connection but this is not shown in the output of `lsof`. What am I missing?               $ telnet localhost 10080     Trying ::1...     Connected to localhost.     Escape character is '^]'.     ^]     telnet> Connection closed.      but               $ sudo lsof -n -i | grep 10080     $


title: libstdc++.so.3 => not found on CloudLinux, no SuperUser permissions, seemingly in chroot.

text: I am trying to install the Linux x64 BOINC command-line interface client on a CloudLinux machine with x86_64 Architecture. When I try to run the executable I get an error: > ./boinc: error while loading shared libraries: libstdc++.so.3: cannot open > shared object file: No such file or directory When I do ldd of the boinc executable I find: > >         libstdc++.so.3 => not found >   When I do yum install compat-libstdc++-33 I get > CRITICAL:yum.cli:Config Error: Error accessing file for config > file:///etc/yum.conf I don't have access to any form of superuser permissions, My account is very likely to be in a chroot. How can I get my client running?


title: Where to put generated certicate for user

text: I was following this tutorial and I want to implement mutual authentication between server and client, where server and CA (certificate authority) is the same thing. I reached the last step and I don't know where to put the device certificate. > The process for creating your own certificate authority is pretty straight > forward > >   1. Create a private key >   2. Self-sign >   3. Install root CA on your various workstations > > > Once you do that, every device that you manage via HTTPS just needs to have > its own certificate created with the following steps: > >   1. Create CSR for device >   2. Sign CSR with root CA key > I can't access server now with https, I have to do something that is not written in the article. Please help.


title: can someone fix my PS1 for bash

text: I seem to have too many colour escapes so it only works in some prompts - can someone please correct for me ?               PS1='\[\e[0:35m[\u@\e[0:33m\h\e[m \e[0:35m\w]\e[m \e[0:33m`git branch 2> /dev/null | grep -e ^* | sed -E  s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`\e[m\] \n$ '


title: How can I convert a  .cue / .bin ( with cdr tracks) image into a single .iso file?

text: The title is descriptive as is: How can I convert a .cue / .bin (cdr track) image into a single .iso file? I have Fedora 16 (x86-64)               Linux 3.1.9-1.fc16.x86_64 #1 SMP Fri Jan 13 16:37:42 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux


title: Akonadi floods my .xsession-errors

text: I am seeing tons of these error in my .xsession-errors:               krunner(8135)/libakonadi Akonadi::SessionPrivate::socketError: Socket error occurred: "QLocalSocket::connectToServer: Connection refused"       This akonadi/nepomuk thingy has always been a mystery to me. I never asked for it and yet it is on my computer, meesing up my logfiles. Ideally I would like to get rid of it. My questions are   * What do I have to do in order to get rid of akonadi and nepomuk   * what are these guy supposed to do anyways?   * what would I loose when I got rid of them   * in case they do something useful, do have any ideas how I can avaoid the error message above


title: `cp` permission denied when copy a file owned by `root`

text: I have a folder `udp_folder2`               d------r-T 41 root           root     4096 Apr 26 21:17 udp_folder2      when I'm with user other than `root`, I can't `cp -r` it into a new folder it says: Permission denied why? and how can I copy it with a user other than `root`


title: Applying an IO redirection&audio device example in Fedora

text: Here is an example I saw in a webpage which uses IO redirection to make the audio device make sound.               less sound.wav > /dev/audio      But I cannot do it in Fedora. It outputs the input data format is wrong. Any hint?


title: How to find Nautilus wastebasket in the file system

text: It looks like I can get to the waste-basket through nautilus, but when I look at the location given by properties, I see "trash:///". But I can't "cd trash:///". Where is the waste-basket? And in general, if I can find a file in nautilus, how do I get there from terminal? I've had some similar issues in the past with mounted media as well, so a general answer would be greatly appreciated. In case it is relevant, I'm using PinguyOS.


title: btrfs change after system upgrade broke apt-btrfs-snapshot

text: After upgrading (via `apt-get dist-upgrade`) a Mint 14 Linux box to Mint 15, `apt-btrfs-snapshot` seems to have stopped working:               18:25:48 [root@galaxy ~]$ apt-btrfs-snapshot list     Sorry, your system lacks support for the snapshot feature      Interestingly, the `btrfs` command-line tool doesn't list the snapshots by default either: (it used to before the upgrade)               18:25:50 [root@galaxy ~]$ btrfs subvolume list /     ID 270 gen 26538 top level 256 path stuff      but with the `-a` flag, it shows all the `apt-btrfs-snapshot` snapshots as well:               18:26:29 [root@galaxy ~]$ btrfs subvolume list -a /     ID 256 gen 26613 top level 5 path <FS_TREE>/@     ID 259 gen 26375 top level 5 path <FS_TREE>/@home     ID 270 gen 26538 top level 256 path stuff     ID 271 gen 348 top level 5 path <FS_TREE>/@apt-snapshot-2013-04-17_21:44:30     ID 272 gen 352 top level 5 path <FS_TREE>/@apt-snapshot-2013-04-17_21:46:25     ...     ID 458 gen 26322 top level 5 path <FS_TREE>/@apt-snapshot-2013-06-09_15:55:09      So I guess my two questions would be:   * What's up with this `<FS_TREE>` stuff?   * Why did `apt-btrfs-snapshot` stop working? Relevant package versions:               ii  btrfs-tools        0.19+2013011     ii  apt-btrfs-snap     0.3.4.1          ii  linux-image-3.8.0- 3.8.0-23.34


title: X high CPU when using Java applications

text: Only recently, my Freemind program has become extremely sluggish and unresponsive (big lag) when moving my mind map around. I use Arch Linux with xfce4. Freemind is made with Java. If I move the mind map around, the X process shoots to 20% CPU, doesn't seem a lot but something between X and Java programs are really bringing their performance down. I can barely use Freemind now. Freeplane is also affected. I noticed if I keep the Freemind window really small, it's responsive. If I maximise it, everything slows down within the application. Adding new notes, or move the map around, shoots X to a high CPU and there is a 5+ second lag in anything I do in the app. Is there anything I can do to improve performance? It's only started recently, everything is up-to-date.


title: Characters encodings supported by more, cat and less

text: I have a text file encoded as following according to `file`: > ISO-8859 text, with CRLF line terminators This file contains French's text with accents. My shell is able to display accent and `emacs` in console mode is capable of correctly displaying these accents. My problem is that `more`, `cat` and `less` tools don't display this file correctly. I guess that it means that these tools don't support this characters encoding set. Is this true? What are the characters encodings supported by these tools?


title: Install Elementary OS on an iMac from 2008

text: I'm trying to install Elementary OS Luna (based on Ubuntu 12.04 LTS) on my iMac from 2008. At first I tried the straightforward combination of `hdutil` and `dd` to a USB drive, which failed to even show up using rEFInd or holding option. There is a bug report that requests a Mac ISO, but the conclusion is > This is no longer necessary to install elementary/Ubuntu on a Mac My second attempt was with https://github.com/SevenBits/Mac-Linux-USB-Loader This makes the USB bootable. But only when holding option. rEFInd doesn't see it. So I boot the Live USB and open the Ubuntu installer and proceed to partition a swap and ext4 partition. The installer almost finishes, but crashes on installing grub. I tried several times on sda, sda1(EFI) and sda6(ext4), all fail. Then I tried manually installing with               sudo grub-install --root-directory /media/the-mount-point /dev/sda6      This completed after I marked sda6 as a bios partition in gparted. Now when I boot it shows up in both rEFInd and when holding option, but when selected displays just a cursor.               _      I'm out of ideas. I don't care if I do legacy or EFI booting, as long as I do any booting at all...


title: Dual Monitor with integrated and discrete GPU on Debian

text: I've got an Asrock Extreme 3 motherboard and a Nvidia 660ti GPU. I was trying to configure dual monitor on debian 7 connecting one monitor to the mb and the other to the GPU. This configuration works perfectly on Windows 7 without installing any drivers. With debian only the GPU monitor is working. When I try to connect the second to the motherboard it shows the following:               Decompressing Linux... Parsing ELF... done.     [    0.0000000] tsc: Fast TSC calibration failed     Loading, please wait...     [    3.222458] sd 8:0:0:0: [sdc] No Caching mode page found     [    3.222518] sd 8:0:0:0: [sdc] Assuming drive cache: write through     INIT: version 2.88 booting     [info] Using makefile-style concurrent boot in runlevel S.     [ ok ] Starting the hotplug events dispatcher: udevd.     [ ok ] Synthesizing the initial hotplug events...done.     [....] Waiting for /dev to be fully populated...      After a few minutes it turns off. This only occurs when I hotplug it. If I start the system with the monitor connected it doesn't turn on. How can I configure it?


title: What are alternative tools for searching files in full content?

text: I realized that most of the text related tools I use, grep/egrep/awk/sed are line-oriented.   I guess that is a simplified approach to search in files but I was wondering if there is another set of tools operating on file level that I am not aware. So are there other tools that search over the full contents of a file without using the line mode?


title: Is there a more elegant way to count words and assign that count to variables?

text: I have a script:               #!/bin/bash          /root/xiotech status > xiostatus.tmp     SyncCount=$(grep -c Sync xiostatus.tmp)     PauseCount=$(grep -c paused xiostatus.tmp)     CopyingCount=$(grep -c Copying xiostatus.tmp)          if [ "$SyncCount" -eq "11" ]     then echo All 11 mirrors are in sync.          else echo $PauseCount mirrors are paused and $CopyingCount mirrors are syncing.     fi          rm -f xiostatus.tmp      Is there a more elegant way to count and "variable-ize" those counts using something like awk? In this case the file is tiny so it's not a big deal, but if the file were 900mb, it would take a lot of extra cycles to go through it 3 times...


title: Changing suEXEC Path / CentOS 6

text: I have recently installed httpd on a Centos 6 server. From what I see suEXEC was compiled with the values below;                -D AP_DOC_ROOT="/var/www"      -D AP_GID_MIN=100      -D AP_HTTPD_USER="apache"      -D AP_LOG_EXEC="/var/log/httpd/suexec.log"      -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"      -D AP_UID_MIN=500      -D AP_USERDIR_SUFFIX="public_html"      I was wondering if there's a way to change these values without compiling Apache from scratch?


title: is it secure /not dangerous to ssh with keys through public transparent proxy?

text: I use pub key for ssh. Is it normal practice to connect to own server through public proxy? I think with plain pass it is surely dangerous but how about RSA keys?


title: Comparing files line by line in awk with delimiter

text: file1:               abc|123|check     def|456|map     ijk|789|globe     lmn|101112|equator      file2:               abc|123|check     def|456|map     ijk|789|equator     lmn|101112|globe      **EXPECTED OUTPUT:**               ijk|789|equator     lmn|101112|globe      Current awk script: `awk 'BEGIN{OFS=FS="|"} NR==FNR{a[$3]=$3;next}!($3 in a)' file1 file2` This does comparison based on array content. How to compare line by line and printing only that results.


title: Yum update error: Could not retrieve mirrorlist

text: I'm trying to do yum update. This is the error I'm getting.               sudo yum update     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile     Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was     12: Timeout on http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os: (28,'connect() timed out!')     Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again      I did `wget http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os`. It never goes through. So I know I've to change this somehow. Can anyone tell suggest me how to fix this. I found many posts related to this problem over here; but couldn't find a proper solution for this. My `/etc/resolve.conf` is:               nameserver 130.102.115.238     nameserver 130.102.128.53     nameserver 130.102.2.53      I tried adding `nameserver 8.8.8.8`. It didn't work. My `/etc/yum.repos.d/Centos-Base.repo` is:               [base]     name=CentOS-$releasever - Base     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os     #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6          #released updates     [updates]     name=CentOS-$releasever - Updates     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates     #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6          #additional packages that may be useful     [extras]     name=CentOS-$releasever - Extras     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras     #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6          #additional packages that extend functionality of existing packages     [centosplus]     name=CentOS-$releasever - Plus     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus     #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/     gpgcheck=1     enabled=0     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6          #contrib - packages by Centos Users     [contrib]     name=CentOS-$releasever - Contrib     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib     #baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/     gpgcheck=1     enabled=0     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6      I tried commenting the mirrorlists and uncommenting the baseurls. Didn't work. I really need some help with this. Stuck on this for sometime now. PS I am trying to set a Hadoop node using Cloudera. That's when I encountered this problem. So I tried doing a yum update individually to figure out what's wrong.


title: What's the right value of $TERM for emacs' ansi-term, especially if 'eterm-color' isn't available after SSH?

text: I'm currently setting `$TERM` to `xterm-256color`:               if [[ -n "$EMACS" ]]; then         export TERM=xterm-256color         alias emacs="emacsclient --no-wait"         export EDITOR="emacsclient --no-wait"         export VISUAL="emacsclient"     fi      I used to have it set to `eterm-color`, but the problem is that this terminal type is not available on most of the machines I log into via SSH. The default `.bashrc` in Ubuntu checks if the `TERM` variable starts with `xterm-`, in which case it tries to set the window title:               PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"      The problem is the `\\[\e]0;` bit. It should be parsed by xterm-compatible terminal emulators, but emacs (ansi-term) doesn't do that. The result of which is a terminal like this:               0;user@host: ~user@host:~$       It also breaks some applications using `readline`, when the typed text is larger than the width of the terminal. Because `eterm-color` isn't available on some remote hosts (and I can't install it either), setting it to that value messes up things like `less`. Is there any trick I can use, such as another terminal type that ships with most distributions or a hack that makes ansi-term recognize the relevant escape codes and set the title, or just discard them?


title: How to run a fresh version of AIX in a Virtual Machine with a Linux host?

text: I need to learn about AIX, and I only have a laptop with Fedora 14/VirtualBox on it. Is there any chance that I could run an AIX guest in my VirtualBox? My laptop has an Intel(R) Core(TM)2 Duo CPU T7100 @ 1.80GHz, and I read that it only runs on RISC architecture. So there's no way I can run it on my laptop?


title: Difference between AIX and other Unix flavours

text: I am learning AIX 6-7 for practice, is there any alternative unix flavour which could be quite similar to AIX which could be run on a VMWare or Virtualbox for practice? Also, if there is any possibility of running AIX on your laptop, please let me know. I was also looking fot options through using Qemu for simulating Power systems.


title: Using source routing (LSRR) - any ideas?

text: What I want to do is conceptually very simple, but I can't find any information or help about how to go about doing this. Basically, I want to configure my networking to use source routing (LSRR). Now I know there are "security concerns" with this and hence it is generally blocked in the public Internet and so the tutorials reach dead ends. However I have a totally private network, and need to do this for some engineering reasons. [Basically, I'm doing some experiments where I want to "simulate" a hop by hop routing protocol] So, I want to send traffic from (machine with IP address) A to (machine with IP address) X. But I want the traffic to follow a specific route via intermediate nodes B, C, then D i.e A -> B -> C -> D -> X. These are all private IP addresses and I have configured the proper ip_forwarding etc . Ping actually allows you to use a LSRR, so I can ping from A to X via these intermediate nodes (using that route I specified) and can verify that it is actually happening with wireshack traces, and it works fine. The question then is how can I use some features of iptables, or tun interfaces (or other - VPN?) etc to redirect all my normal traffic along this route using loose source routing? Basically, I would like to implement something at A, so that when I try to send traffic from A to X it intercepts those IP packets and adds the LSRR to them so that it forwards on via the specified intermediate points. If anyone can help me, I would be extremely grateful as I can't seem to work out how to do this? Thank you very much, Triponi


title: How to send multiple commands to sftp using one line

text: The following command sends one command to `sftp` using one line:               sftp -o PasswordAuthentication=no user@host" <<<"lcd /home"      How to send multiple lines to `sftp` using one line. Is there a way to insert carriage returns or something to achieve this, for example:               sftp -o PasswordAuthentication=no user@host" <<<"lcd /home\n cd /myhome\n get file"      The idea is to NOT use the `sftp -b` option where an external file listing commands is loaded.


title: Are there any deduplication scripts that use btrfs CoW as dedup?

text: Looking for deduplication tools on Linux there are plenty, see e.g. this wiki page. Allmost all scripts do either only detection, printing the duplicate file names or removing duplicate files by hardlinking them to a single copy. With the rise of btrfs there would be another option: creating a CoW (copy-on- write) copy of a file (like `cp reflink=always`). I have not found any tool that does this, is anyone aware of tool that does this?


title: What if 'kill -9' does not work?

text: I have a process I can't kill with `kill -9 <pid>`. What's the problem in such a case, especially since I am the owner of that process. I thought nothing could evade that `kill` option.


title: kill pid is not working?

text: This is pretty weird now. I am trying to kill a process by using its `pid` but it is not working at all.               root@machineA:/home/david# ps aux | grep modelling     david  5075  0.0  0.0 1285420 29404 ?       Dl   21:05   0:01 /opt/modelling/bin/http     root   8730  0.0  0.0   8096   936 pts/4    S+   22:43   0:00 grep --color=auto modelling      Below is the way I am kiiling the process.               root@machineA:/home/david# kill -9 5075      And then if I do the `ps` again. I can see the same result back again.               root@machineA:/home/david# ps aux | grep modelling     david  5075  0.0  0.0 1285420 29404 ?       Dl   21:05   0:01 /opt/modelling/bin/http     root   9062  0.0  0.0   8100   936 pts/4    S+   22:44   0:00 grep --color=auto modelling         Does anyone know what is happening? This was working fine earlier and it has started happening few hours back and I am not sure what's wrong? **Update:-** I did top and it is showing as `D` instead of `Z` which is `uninterruptible sleep`               5075 david  20   0 1255m  28m  13m D    0  0.0   0:01.09 http


title: Analyzing network traffic

text: I want to get a good overview what kind of network communication is going on on my computer. One way would be starting `wireshark`, which is fine for very low-level problems but is quite cumbersome to get a more high level overview. Usually most packages belong to some TCP stream. And many TCP streams contain some kind of HTTP traffic. I am looking for some tool like `wireshark` which shows TCP streams just as one line per TCP stream, potentially allowing me to get details about the stream. Showing HTTP request in a more friendly way would be nice and additionally showing non-TCP traffic, would be nice, too. Are you aware of some tool like that?


title: Key binding of the Menu Key

text: I have the `Menu` key that I don't use. It's right under my thumb when I use the arrows... So I wanted to map it to the `Insert` key. _(mostly because of its important use in vim)_ I've been looking into the fluxbox wiki for key bindings, but I have not found what I'm searching. I have tried to add in my `.fluxbox/keys`               135 :118      or               135 :Insert      But both doesn't seem to work. Is it possible with fluxbox ? I am also wondering if the `BindKey <key><value>: <action> #creates an "on the fly" keycommand` can do the job... but I don't really understand what it does... The answer to How to remap the Context Menu key to the Super key indicates to modify .xmodmaprc Maybe that's what should I do, but I don't know how to convert `keycode 135 = Super_R` so at it works like Insert instead of Super_R


title: Search for a Value only in one column w.o using awk, sed, or perl

text: I have a file that looks like this :               Marketing  Ranjit Singh   FULLEagles       Dean Johnson        Marketing  Ken Whillans   FULLEagles       Karen Thompson      Sales      Peter RobertsonPARTGolden TigersRich Gardener       President  Sandeep Jain   CONTWimps        Ken Whillans        Operations John Thompson  PARTHawks        Cher                Operations Cher           CONTVegans       Karen Patel         Sales      John Jacobs    FULLHawks        Davinder Singh      Finance    Dean Johnson   FULLVegans       Sandeep Jain        EngineeringKaren Thompson PARTVegans       John Thompson       IT         Rich Gardener  FULLGolden TigersPeter Robertson     IT         Karen Patel    FULLWimps        Ranjit Singh         I want to use a grep command to search for "John" in the 2nd column w.o searching the last column, but for every "John" in the 2nd column, I want the output of the last column. The end result should look like this :                      John Thompson                   Cher                       John Jacobs                     Davinder Singh             Dean Johnson                    Sandeep Jain