title: Where does zypper install the repository or package signing keys?

text: I've two almost identical openSuSE 12.3 virtual machines, `snip` and `snap`. While updating them today, one asked to confirm a new `repository or package signing key`, the other didn't. I want to make really sure I didn't do anything wrong (just in case one of them got compromised in one way or the other), especially since the system not asking for the key indicates all repositories are up to date. So:   1. Where does zypper install these keys?    2. How can I list the installed keys?    3. How can I verify these keys are indeed valid? System asking to trust the key:               snap:/home/jeroenp # zypper repos -d     #  | Alias                     | Name                               | Enabled | Refresh | Priority | Type   | URI                                                                                | Service     ---+---------------------------+------------------------------------+---------+---------+----------+--------+-------------------------------------------------------------------------------------------------+--------      1 | Security_-_openSUSE_12.3  | Security - openSUSE 12.3           | Yes     | Yes     |   99     | rpm-md | http://download.opensuse.org/repositories/security/openSUSE_12.3/                               |              2 | openSUSE-12.3-1.6         | openSUSE-12.3-1.6                  | Yes     | No      |   99     | yast2  | cd:///?devices=/dev/disk/by-id/ata-VMware_Virtual_IDE_CDROM_Drive_10000000000000000001,/dev/sr0 |              3 | repo-debug                | openSUSE-12.3-Debug                | No      | Yes     |   99     | NONE   | http://download.opensuse.org/debug/distribution/12.3/repo/oss/                                  |              4 | repo-debug-update         | openSUSE-12.3-Update-Debug         | No      | Yes     |   99     | NONE   | http://download.opensuse.org/debug/update/12.3/                                                 |              5 | repo-debug-update-non-oss | openSUSE-12.3-Update-Debug-Non-Oss | No      | Yes     |   99     | NONE   | http://download.opensuse.org/debug/update/12.3-non-oss/                                         |              6 | repo-non-oss              | openSUSE-12.3-Non-Oss              | Yes     | Yes     |   99     | yast2  | http://download.opensuse.org/distribution/12.3/repo/non-oss/                                    |              7 | repo-oss                  | openSUSE-12.3-Oss                  | Yes     | Yes     |   99     | yast2  | http://download.opensuse.org/distribution/12.3/repo/oss/                                        |              8 | repo-source               | openSUSE-12.3-Source               | No      | Yes     |   99     | NONE   | http://download.opensuse.org/source/distribution/12.3/repo/oss/                                 |              9 | repo-update               | openSUSE-12.3-Update               | Yes     | Yes     |   99     | rpm-md | http://download.opensuse.org/update/12.3/                                                       |             10 | repo-update-non-oss       | openSUSE-12.3-Update-Non-Oss       | Yes     | Yes     |   99     | rpm-md | http://download.opensuse.org/update/12.3-non-oss/                                               |             snap:/home/jeroenp # zypper update     Retrieving repository 'Security - openSUSE 12.3' metadata ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------[\]               New repository or package signing key received:     Key ID: 69D1B2AAEE3D166A     Key Name: security OBS Project <security@build.opensuse.org>     Key Fingerprint: AAF3EB044C49C402A9E7B9AE69D1B2AAEE3D166A     Key Created: Mon May 26 11:04:43 2014     Key Expires: Wed Aug  3 11:04:42 2016     Repository: Security - openSUSE 12.3               Do you want to reject the key, trust temporarily, or trust always? [r/t/a/? shows all options] (r): ^Csnap:/home/jeroenp # ^C     snap:/home/jeroenp #      System not asking to trust the key:               snip:/home/jeroenp # zypper repos -d     #  | Alias                     | Name                               | Enabled | Refresh | Priority | Type   | URI                                                                                | Service     ---+---------------------------+------------------------------------+---------+---------+----------+--------+-------------------------------------------------------------------------------------------------+--------      1 | Security_-_openSUSE_12.3  | Security - openSUSE 12.3           | Yes     | Yes     |   99     | rpm-md | http://download.opensuse.org/repositories/security/openSUSE_12.3/                               |              2 | openSUSE-12.3-1.6         | openSUSE-12.3-1.6                  | Yes     | No      |   99     | yast2  | cd:///?devices=/dev/disk/by-id/ata-VMware_Virtual_IDE_CDROM_Drive_10000000000000000001,/dev/sr0 |              3 | repo-debug                | openSUSE-12.3-Debug                | No      | Yes     |   99     | NONE   | http://download.opensuse.org/debug/distribution/12.3/repo/oss/                                  |              4 | repo-debug-update         | openSUSE-12.3-Update-Debug         | No      | Yes     |   99     | NONE   | http://download.opensuse.org/debug/update/12.3/                                                 |              5 | repo-debug-update-non-oss | openSUSE-12.3-Update-Debug-Non-Oss | No      | Yes     |   99     | NONE   | http://download.opensuse.org/debug/update/12.3-non-oss/                                         |              6 | repo-non-oss              | openSUSE-12.3-Non-Oss              | Yes     | Yes     |   99     | yast2  | http://download.opensuse.org/distribution/12.3/repo/non-oss/                                    |              7 | repo-oss                  | openSUSE-12.3-Oss                  | Yes     | Yes     |   99     | yast2  | http://download.opensuse.org/distribution/12.3/repo/oss/                                        |              8 | repo-source               | openSUSE-12.3-Source               | No      | Yes     |   99     | NONE   | http://download.opensuse.org/source/distribution/12.3/repo/oss/                                 |              9 | repo-update               | openSUSE-12.3-Update               | Yes     | Yes     |   99     | rpm-md | http://download.opensuse.org/update/12.3/                                                       |             10 | repo-update-non-oss       | openSUSE-12.3-Update-Non-Oss       | Yes     | Yes     |   99     | rpm-md | http://download.opensuse.org/update/12.3-non-oss/                                               |             snip:/home/jeroenp # zypper update     Loading repository data...     Reading installed packages...               The following package update will NOT be installed:       libudev0                Nothing to do.     snip:/home/jeroenp # snip:/home/jeroenp # zypper refreshRepository 'Security - openSUSE 12.3' is up to date.     Repository 'openSUSE-12.3-1.6' is up to date.     Repository 'openSUSE-12.3-Non-Oss' is up to date.     Repository 'openSUSE-12.3-Oss' is up to date.     Repository 'openSUSE-12.3-Update' is up to date.     Repository 'openSUSE-12.3-Update-Non-Oss' is up to date.     All repositories have been refreshed.          snip:/home/jeroenp #


title: What is fedmsg?

text: I would like, please, to read a simple explanation of what `fedmsg` is, what it does, why it is useful, and if it's not just something that runs quietly in the background, an introduction to how to start with it. I am asking this question because, although there is an enormous amount of information available, it is couched in such technical terms and so full of jargon, that I find it impenetrable. A confession; I have `fedmsg` installed on my Fedora 20 machine, but I can't remember why, or how.


title: Postfix header_checks

text: I want to forward a copy of the users email which has the specific subject. I have tried the below settings, able to Redirect that particular subject mail. But I want to forward a copy of that mail to another group id. Instead of REDIRECT is there any option to put a Cc: in /etc/postfix/main.cf:               header_checks = regexp:/etc/postfix/header_checks      Then, created /etc/postfix/header_checks and added the following:               /^Subject: Time*/     REDIRECT someotheruser@domain.com


title: delete a system user account if daemon is no longer needed?

text: In an unusual scenario, I have to get rid of a specific system user account called 'lp' (line printing deamon) on an openSUSE system. Can I just comment out the line for that account in `/etc/passwd` without running into an inconsistent system state? _Background_ : The account's user name conflicts with an account name I wish to use within SAMBA. I do not really need the line printing function as I do not know if that account is used by other essential processes. Has anybody else had experience with removing system accounts?


title: Forward port 80 to another port

text: I am running a webserver on a RedHat 6 box that I don't have root access to. Because I need ports 80 and 443, I require root access to start and stop the server. I am not allowed root access, but I am able to ask someone with root access to set something up to forward the ports for me. So is it possible to forward port 80 to 8080 and port 443 to 8443, so that I am able to start and stop my server without root access?


title: Is there any way to prevent deletion of certain files from user owned directory?

text: Let's say user has **Directory1** and it contains **_File1 File2 CantBeDeletedFile_** How to make so the user would never be allowed to delete the **_CantBeDeletedFile_**? If I change the ownership of **Directory1** and remove write permissions users wouldn't be able to delete any file. They also wouldn't be able to add new files etc. I just want to be able to set some files which would never be deleted. More specific description. I am creating user profiles. I am creating application launcher files in their **Desktop**. So I want to set some launcher files (.desktop) and make them so user can only launch them and they couldn't rename nor delete, just launch. Currently if user owns the directory which contain any file. He can delete. If there is no generic way for all *nix, it's a Linux and ext4 FS.


title: Run a sudo (or startup) python script from cron on a Raspberry Pi?

text: I'm helping out with an art project (http://stargateeggbeater.com/ for those interested) built on Raspberry Pi. The RPi controls an addressable LED strip through the GPIO, using the `spidev` device per these instructions. To start the display, we run:               sudo python lightpaint-FF.py      We plan to take this project to parties and festivals, so ideally we'd like to have it start running automatically on boot. (Our RPi doesn't have a monitor connected, so right now we have to log in with another laptop using SSH and run the code using `nohup` before logging out again). My first attempt at solving this problem was to write a simple bash script:               #!/bin/bash          if [ ! "$(pidof python)" ]       then        sudo python /home/pi/lightpaint-FF.py     fi      And to modify `/etc/crontab` to include               * * * * * root /home/pi/EggbeaterCronJob      The desired behavior is to check every minute to see if any Python instances are running and, if not, start the python script. I have verified that this script works when called from a terminal:               pidof python # returns nothing     sudo /home/pi/EggbeaterCronJob     pidof python # returns new process ID      But after updating my `crontab`, no python process ID ever appears on its own accord. Just to be sure, I also made sure I wasn't making a boneheaded mistake in my `crontab` configuration:               * * * * * root touch test-freaking-cron      This verified that `cron` was indeed responding to my edits.


title: Proper syntax for ansible symlink

text: _What is the proper syntax for creating symlinks using ansible?_ I'm creating a Vagrant virtual environment and running ansible as my provisioner. Everything works fine up until I try to symlink to my site nginx configuration file from sites-enabled. Here is what I've tried.               - name: Create symlink to example.com       file: path=/etc/nginx/sites-enabled/example.com dest=/etc/nginx/sites-available/example.com state=link       notify: nginx reload      When I do this I'm met with the following error.               ERROR: Syntax Error while loading YAML script,     /Users/username/project/ansible/roles/nginx/tasks/main.yml Note: The     error may actually appear before this position: line 24, column 1          - name: Symlink to example.dev.conf file: path=/etc/nginx/sites-enabled/example.dev.conf        state=link ^ Ansible failed to complete successfully. Any error output should be visible above.        Please fix these errors and try again.      I've also tried using `src=/etc/nginx/sites-enabled` instead of `path` but I can't seem to find a definitive example of this on the web. Specs:   * OSX Mavericks   * vagrant 1.6.3   * VirtualBox 4.3   * nginx 1.6.0   * ansible 1.6.2   * ubuntu 14.04


title: Pseudo-terminal message in script

text: This is my script               #!/bin/bash     exec < filelist.txt         while read updatedfile oldfile; do         #   echo updatedfile = "$updatedfile" #use for troubleshooting         #   echo oldfile = "$oldfile" #use for troubleshooting                    if [[ ! $updatedfile =~ [^[:space:]] ]] ; then  #empty  line exception                     continue # empty line exception                    fi                    if [[ ! $oldfile =~ [^[:space:]] ]] ; then  #empty line exception                     continue # empty line exception                    fi                  echo Comparing $updatedfile with $oldfile                 if diff "$updatedfile" "$oldfile" >/dev/null ; then                     echo The files compared are the same. No changes were made.                 else                     echo The files compared are different.                     cp -f -v $oldfile /infanass/dev/admin/backup/`uname -n`_${oldfile##*/}_$(date +%F-%T)                     cp -f -v $updatedfile $oldfile                  fi                   done     #go through rest of servers from list     while read server <&3; do   #read server names into the while loop         serverName=$(uname -n)      if [[ ! $server =~ [^[:space:]] ]] ; then  #empty line exception         continue      fi         echo server on list = "$server"      echo server signed on = "$serverName"      if [ $serverName == $server ] ; then #makes sure a server doesnt try to ssh to itself         continue      fi         echo "Connecting to - $server"         ssh "$server"  #SSH login         exec < filelist.txt         while read updatedfile oldfile; do         #   echo updatedfile = $updatedfile #use for troubleshooting         #   echo oldfile = $oldfile   #use for troubleshooting                    if [[ ! $updatedfile =~ [^[:space:]] ]] ; then  #empty line exception                     continue # empty line exception                    fi                    if [[ ! $oldfile =~ [^[:space:]] ]] ; then  #empty line exception                     continue # empty line exception                    fi                  echo Comparing $updatedfile with $oldfile                 if diff "$updatedfile" "$oldfile" >/dev/null ; then                     echo The files compared are the same. No changes were made.                 else                     echo The files compared are different.                     cp -f -v $oldfile /infanass/dev/admin/backup/`uname -n`_${oldfile##*/}_$(date +%F-%T)                     cp -f -v $updatedfile $oldfile                  fi                   done     done 3</infanass/dev/admin/servers.txt      I get the error when I try to ssh to my list of servers.               Pseudo-terminal will not be allocated because stdin is not a terminal.      Then my script doesn't correctly ssh and compare the files from the newly logged in server.. Does anybody know why this is?


title: executing if-statement from command prompt

text: In bash I can do the following:               if [ -f /tmp/test.txt ]; then echo "true"; fi      However, if I add `sudo` in front, it doesn't work anymore:               sudo if [ -f /tmp/test.txt ]; then echo "true"; fi     -bash: syntax error near unexpected token `then'      How can I make it work?


title: Taking Backup of files of particular limit in unix

text: Here is the scenario, I have 1000 files in a folder each ~3 MB. I want to zip all files into 50MB each zip and remove the original files. **NOTE:** 50MB may contain 20 files or 10 files but that zip package should be <=50MB. I want to transfer those files without data loss. File must be of format (tar/gzip/bzip). Please provide suggestions to me if we have any other way to overcome the data loss. Need to create a shell script.


title: How to know if a network interface is tap, tun, bridge or physical?

text: As far as i know, there are 4 main types of network interfaces in linux: tun, tap, bridge and physical. When i'm doing sys admin on machines running KVM, i usually come accross tap, bridge and physical interfaces on the same machine, without being able to tell them apart. I can't see any significant differences in `ifconfig` results, as in `ip` results. How can i know if an interface is tun/tap/bridge/physical ? _note: I don't claim there is no other types of network interfaces in linux, but i know only this 4 ones_


title: Obtain the "pretty" hostname in bash

text: On my Fedora 19 system, I am able to change the system hostname with `hostnamectl`. This allows me to set several things, such as the static (normal) hostname, as well as a "pretty" hostname. Is there a simple command that retrieves the pretty hostname, from a bash prompt? `hostname` returns the static hostname, and the man page shows no options to recover the pretty one.


title: Getting the source for something that doesn't seem to have an associated package?

text: I recently just wanted to look at the source code for `sha1sum`.               alec@ROOROO:~/tmp-source-study$ apt-get source sha1sum     Reading package lists... Done     Building dependency tree            Reading state information... Done     E: Unable to find a source package for sha1sum      The next thing I did was to read the manual. The manual mentioned coreutils. But I don't see anything like `sha1sum.c`, and there's no associated Debian package for sha1sum, as far as I can tell. What should I be doing to get the source code for this small, basic program without having to use a search engine, from the convenience of my shell?


title: How can I use unix tools with Cyrillic text?

text: I recently started processing Cyrillic text, and it's been really difficult. I couldn't get my Python scripts to work with it at all. And I tried. PHP worked well, but I don't know PHP. I just managed to hack a few things together, and I still don't feel comfortable in it. (It may become a bit of a mainstay, though, as it's proven unexpectedly useful.) Of course, `grep` is out of the question. Or is it? That's what this question is about. I wanted to do this:               alec@ROOROO:~/$ grep '\w\{4\}' cyrillicstuff      ...and came up empty handed. But is there a way I could have returned all words 4 characters or greater, given that they're all in Cyrillic, using good 'ol grep??


title: Running MPlayer through a PHP script

text: I'm trying to open an MPlayer instance on my server from a PHP script (using PHP's `system()` function). I've looked into making mplayer a slave ( http://www.mplayerhq.hu/DOCS/tech/slave.txt ) but when I open MPlayer it returns:               svgalib: Cannot get I/O permissions.      Do I need to change the permissions of the user running apache or can I change the permissions for just the script? Thanks


title: Difference between block size and cluster size

text: I've got a question concerning the block size and cluster size. Regarding to what I have read about that I assume the following:   * The block size is the physical size of a block, mostly 512 bytes. There is no way to change this.   * The cluster size is the minimal size of a block that is read and writable by the OS. If I create a new filesystem e.g. ext3, I can specify this minimal block size with the switch -b. Almost all programs like dumpe2fs, mke2fs use block size as an name for cluster size. If I have got the following output:               $ stat test     File: `test'     Size: 13            Blocks: 4          IO Block: 2048   regular file     Device: 700h/1792d  Inode: 15          Links: 1      Is it correct that the size is the actual space in bytes, blocks are the physically used blocks (512 bytes for each) and IO block relates to the block size specified when creating the FS?


title: Is there a way to create a directory structure and files inside a file on a 'base' filesystem'?

text: Current scripts create and delete multiple files over NFS. I have been told that this is the problem, so was thinking if the run directory the script ran in looked like a single file to NFS then I might alleviate the problem. I should add that we have hundreds of these scripts working in their own run directories but all over NFS at any one time, and we have a bottleneck due to the creation and deletion of many tens of files for each run directory. I have since found http://code.google.com/p/fuse-zip/ that I will investigate. Could someone share their experiences with this?


title: unable to open X server with ImageMagick Mac osx

text: I am trying to display an image using the following:               Display someimage.jpeg      It returns this:               display: unable to open X server `' @ error/display.c/DisplayImageCommand/426.      I have been looking at other posts and I have tried the following with no luck:               export DISPLAY="0.0"


title: Sharing window between workspaces in Xmonad

text: I sometimes need to share the same terminal window between two workspaces. Is it possible to set this in xmonad configuration? Currently I'm solving this with "move to workspace 2" and "move to workspace 1" for that window but this is cumbersome.


title: Download directory structure from a TFTP server

text: I need to download the complete directory structure from a TFTP server. Is there some simple way to do that? If that is not possible, than how could I download all files individually (provided I have a list of all files on the server)?


title: Reproduce the "--max-depth=" switch for disk-usage command on AIX

text: When I work on Linux/GNU distro environment I often use that wonderfull command               du --max-depth=1 /      That gives you the size of each folder in your `root` directory. Today I work with AIX and sysadmin does not want to heard about GNU.   Is there any tool or command line that allow to reproduce the switch `\--max- depth` on AIX for `du` command ?


title: Execute bash script using CygWin

text: How do you execute a bash script using CygWin? I am trying execute a bash script as part of a build.xml. This is the code snippet,               <property name="cygwinpath" value="C:/cygwin/bin/"/>     <property name="script" value="D:/tomcatserverxml"/>               <exec dir="${cygwinpath}" executable="bash.exe">         <arg value="${script}"/>         </exec>


title: Why isn't Gnus scoring emails based on the To: or Cc: headers?

text: I use Gnus v5.13 in GNU Emacs 24.1.1 to read my email, and I'm having a trouble getting a simple score file to work. Essentially, I want any mail that's sent to (or copies) a particular email address to be given a higher score. My example score file, in `~/Mail/all.SCORE` is:               (("from"       ("Mark Longair" 1000))      ("To"       ("mark-scoretesting@example.org" 1000)))      I'm making sure that that score file is being used by having added the following to my `~/.gnus` file:               (setq gnus-global-score-files            '("~/Mail/all.SCORE"))      And this does seem to work properly for the rule that matches the `From` line - matching messages are highlighted, and when I type `V``S` in the summary buffer, it shows a score of 1000 for those messages. However, the "To" rule doesn't match. The documentation here probably explains this when it says: > Scoring can only be performed on these eight headers: From, Subject, > References, Message-ID, Xref, Lines, Chars and Date. Other documentation, however, suggest that one can get around this limitation by the following steps: > Put the following in your ~/.gnus.el file. >   >   >      (setq gnus-extra-headers '(To Cc Newsgroups Keywords) >            nnmail-extra-headers gnus-extra-headers) >   > > Restart Gnus and rebuild your nnml overview files with the `M-x nnml- > generate-nov-databases` command. This will take a long time if you have much > mail. > > Now you can score on ‘To’ and ‘Cc’ as “extra headers” like so: I e s p To > RET RET. > > See? Simple. Unfortunately, it doesn't seem to be that simple. I've added the following to my `.gnus` file:               (setq gnus-extra-headers '(To Cc)           nnmail-extra-headers gnus-extra-headers)      ... restarted Emacs, and I've run `M-x nnml-generate-nov-databases`, but the rule in my score file for the "To" line, still isn't working, even if I type `V` `R` to rescore the articles in my summary buffer. Can any suggest why this isn't working?


title: Record screen in X

text: How can I record all activity on the screen for a certain amount of time? I know about tools like `xwd` that capture a still image; can they be extended to record video? I'd prefer not using any fancy debian tools or ImageMagick utilities


title: Can an arbitrary process read data coming to/from a network port? How?

text: For example, postgres does the following as shown with lsof -i:               COMMAND    PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME     postgres 29200 postgres    8u  IPv6 470362      0t0  UDP localhost.localdomain:53152->localhost.localdomain:53152      postgres 29202 postgres    8u  IPv6 470362      0t0  UDP localhost.localdomain:53152->localhost.localdomain:53152      postgres 29203 postgres    8u  IPv6 470362      0t0  UDP localhost.localdomain:53152->localhost.localdomain:53152      postgres 29204 postgres    8u  IPv6 470362      0t0  UDP localhost.localdomain:53152->localhost.localdomain:53152      postgres 29205 postgres    8u  IPv6 470362      0t0  UDP localhost.localdomain:53152->localhost.localdomain:53152      postgres 29206 postgres    8u  IPv6 470362      0t0  UDP localhost.localdomain:53152->localhost.localdomain:53152      ~~First of all, is this even multicast (how can I tell)? If so, can some other app also connect to the UDP port and subscribe to the data passing through the port?~~ I'm new to networking, and not entirely sure if this is even possible, but I'm just curious, with security on my mind. EDIT 8/30/13: Can some process anywhere on the network or same machine observe the data going in and out of a port (e.g. 53152 in the above case), and with which privileges? How?


title: Backupninja + Duplicity problem

text: I have recently installed on a Debian squeeze_64 server the **Backupninja** and **Duplicity** utilities. My goal is to backup `/foo/bar/*` to `/desti/nation/` with full backup once a week and differentially once a day (say, sunday 01:00 the full and 01:00 daily). `/desti/nation/` is a mounted nfs directory from `10.0.0.1:/qwe/rty`.               root@toor:/etc/backup.d# ls     10-full.dup  15-incr.dup     root@toor:/etc/backup.d# cat *     options = --no-encryption --dry-run --verbosity 9     testconnect=yes     [source]     include=/foo/bar/     [dest]     incremental=no     increments=0     keep=60     desturl = file:///desti/nation          options = --no-encryption --dry-run --verbosity 9     testconnect=yes     [source]     include=/foo/bar/     [dest]     incremental=yes     increments=7     keep=60     desturl = file:///desti/nation     root@toor:/etc/backup.d# backupninja --debug --test --now      The output is fulfilled with boring debug messages, but it contains the following: > Info: >>>> starting action /etc/backup.d/10-full.dup (because of --now)   >  Debug: yes   >  Fatal: The password option must be set.   >  Fatal: <<<< finished action /etc/backup.d/10-full.dup: FAILED And the same for 15-incr.dup, respectively. > Info: FINISHED: 2 actions run. 2 fatal. 0 error. 0 warning. is the final line. Well, I configured it to work _without_ gpg and any kind of authorization, but it still needs a password. What is my fault? **UPDATE** Added the following lines to the files:               [gpg]     sign=no     encryptkey=     signkey=     password=      but the problem is exactly the same. **SOLVED** I really don't know what happened, I set once the password to a random value in both of the files. Then suffered endlessly, changed almost everything, and now tried `password=\0` and `password=""`. **IT WORKS**. Well, the next step was like `password=dfsgdhn` and `password=dsfdghfd`. Works too. So I didn't find the solution, it repaired itself or what.


title: Date time in Linux bash

text: I am trying to display a date time in the form of 07/08/2013 16:52:13 by using command in bash script:               dt=`date '+%d/%m/%Y_%H:%M:%S'`      which variable is used to populate a CSV file. The only char accepted is "_" (underscore) or "-" between date and time, output is 07/08/2013_16:52:13 How can I get a space in between date and time? I tried almost (I hope) everything.


title: Get list of all files by mask in terminal

text: I want to find all `*.h`,`*.cpp` files in folders with defined mask, like `*/trunk/src*`. So, I can find separately `*.h` and `*.cpp` files:               find . -path "*/trunk/src/*.h"     find . -path "*/trunk/src/*.cpp"       What is the best way to get the file-list both of types (`*.h` and `*.cpp`)? PS I'd like to pipe the list to `grep`.


title: Is there a limit of hardlinks for one file?

text: Is there a limit of number of hardlinks for one file? Is it specified anywhere? What are safe limits for Linux? And what for other POSIX systems?


title: Chakra project or netinstall -- Arch Linux installation

text: My arch linux installation didn't go well (apparently I should have gone through netinstall instead of core). When I try again, should I use the Chakra project (which is supposedly easier), or should I use netinstall?


title: Wine and mime type association backup and restore

text: I'm going to replace Ubuntu with Arch Linux on my laptop and I want to reformat it.   But I want to save ma wine prefixes as I have installed some windows programs that I need.   I have gzipped my `.wine*` folders but I also want to save `mime type associations` (i.e. when I click on a `.docx` file in gnome shell I want it to be opened with MS Word via wine as currently happens in my Ubuntu box). I discovered that `~/.local/share/applications` folder seems to contain the "magic" `.desktop` files for that. So, is it enough to backup and then restore that `folder + the .wine*` folders on a new Linux installation to have my file associations back again?


title: installing ffmpeg-php on centos

text: With the help of this guide, I am trying to install ffmpeg using these commands:                # cd ffmpeg-php/branches/ffmpeg-php/ffmpeg-php-0.6.1/      # replace 'PIX_FMT_RGBA32' 'PIX_FMT_RGB32' -- *      # phpize       # ./configure --with-ffmpeg=/usr/local/cpffmpeg      # make       # make install      But when I run this `replace 'PIX_FMT_RGBA32' 'PIX_FMT_RGB32' -- *` I get this error: > replace: Error reading file 'autom4te.cache' (Errcode: 21) replace: Error > reading file 'build' (Errcode: 21) ffmpeg_frame.c converted replace: Error > reading file 'include' (Errcode: 21) replace: Error reading file 'modules' > (Errcode: 21) replace: Error reading file 'tests' (Errcode: 21) And when I run `make` and skip that line I get:               /root/ffmpeg-php/branches/ffmpeg-php/ffmpeg-php-0.6.1/ffmpeg-php.c:171: error: expected '{' at end of input     make: *** [ffmpeg-php.lo] Error 1      Any ideas?


title: How to uninstall GRUB

text: I just installed Arch Linux and it's not working well, and now I can't access Windows because of GRUB. How can I uninstall GRUB through the Arch Linux shell?


title: What happens when a USB drive is plugged in?

text: What is the flow of USB events from kernel space to user space? I get a popup on my desktop when I plug in a USB drive -- what is the sequence of events that leads from detecting the new USB drive to mounting it and showing that popup? (I know it's a very broad question, but please guide me with some pointers on how to understand the whole idea behind it. I have no problem in browsing large blocks of code if I can be guided correctly.)


title: How to configure polkit with KDE?

text: My system is Gentoo amd64, KDE 4.11, and lightDM. I updated my system recently, and found out my user account can't shutdown from KDE. The function is disappeared. I looked for a long time, and I think it is a permission issue. I checked some blogs/wikis talking about **polkit** configuration. But none works for me. So bascially, my question is, how to let a non-root user to have administrator permission in KDE with **polkit**?


title: How to save boot.log between reboots?

text: How do you save the `/var/log/boot.log` between reboots? Or, more specifically, how can you just have boots be appended to that file? I have an issue with a kernel that I am running and need to be able to preserve the boot.log when I boot up into a working kernel.


title: How to ensure File System is Mounted with ' atime ' enabled ?

text: Let's run `mount`               /dev/mapper/VolGroup-lv_root on / type ext4 (rw)     proc on /proc type proc (rw)     sysfs on /sys type sysfs (rw)     devpts on /dev/pts type devpts (rw,gid=5,mode=620)     tmpfs on /dev/shm type tmpfs (rw)     /dev/sdb1 on /boot type ext4 (rw)     none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)     sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)     gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)     /dev/sda1 on /media/1 type ext3 (rw,nosuid,nodev,uhelper=udisks)      there is nothing in these lines that show either                atime      or      noatime      the problem here is, i created folders `a` and `b` and then tried accessing them, but i can not get them to update `Access Time` so i can arrange them based on `access time`. how exactly does one ensure the "filesystem" of the "operating system" is mounted with "atime" enabled ?


title: Groups in the Samba configuration

text: I can't quite understand groups. For example, lets say if I add the following into my `samba` config:               valid users = @users      Must the group `users` exist on my system or is a samba group itself? And if the former, how can I create this group. via `groupadd -r users`? After that, only those valid users in that group can browse files, right? When I log in now as `root` to list all groups via `groups`, it just says `root`, nothing more, but I need to know all groups.


title: Slow Internet Speeds with Backtrack5 R2 in VMware Workstation

text: I have been trying to get Backtrack5 to run smoothly on my new laptop and have run into a few issues. I have installed a version of Backtrack5 onto another laptop previously as the primary OS, and everything seemed to work perfectly. Now I am trying to install it using VMware Workstation, and can't seem to get the internet working properly. When running the VM in NAT, the internet works but is painfully slow, to the point where installing Chrome was taking up to an hour. The internet on the host machine is working completely fine. I was wondering if anyone had some tweaks or suggestions as far as how to increase the speed? Since Backtrack5 is built off of Ubuntu, I'm not sure if anyone has had this same issue with that OS.


title: Why can't I run mysql?

text: I'm trying to import a database from Wamp to Xampp. I run Lampp first, then go to `/opt/lampp/bin` and run:               mysql (or mysqladmin ?) -u root -h localhost      but I get: > mysql: command line not found Why isn't it working?


title: scp command working in bash doesn't work in zsh

text: This command works fine in bash:               bash-3.2$ scp luna4:/u/paige/maye/src/diviner/notebooks/plots/hk_* .     hk_az.png                                                   100%  126KB 126.0KB/s   00:00     hk_baffle.png                                               100%  166KB 166.3KB/s   00:01     hk_bb.png                                                   100%  144KB 143.8KB/s   00:00     hk_el.png                                                   100%  115KB 115.3KB/s   00:00     hk_fpa.png                                                  100%  123KB 123.2KB/s   00:00     hk_fpb.png                                                  100%  126KB 125.7KB/s   00:00     hk_hybrid.png                                               100%   99KB  98.7KB/s   00:00     hk_oba.png                                                  100%  140KB 139.7KB/s   00:00     hk_solar.png                                                100%  206KB 205.6KB/s   00:00     hk_temp.png                                                 100%   62KB  61.8KB/s   00:00     hk_yoke.png                                                 100%  122KB 121.7KB/s   00:00     bash-3.2$ exit      but in zsh it fails, no files are found:               $ scp luna4:/u/paige/maye/src/diviner/notebooks/plots/hk_* .     zsh: no matches found: luna4:/u/paige/maye/src/diviner/notebooks/plots/hk_*      What is going wrong?


title: Install Mysql 5.6.4 or greater on web server with on CentOS / openSUSE with Plesk 10

text: I need to install MySQL 5.6.4 or greater on my web server because I'm using the full text innodb feature. I'm trying to move my local installation (WAMP server) to my dedicated server and I'm not able to find a version greater than 5.5 in the repository my system is configured to use (I'm not a Linux expert at all). I can install either CentOS 6 with Parallels Plesk Panel 10 (64-bit) or openSUSE 11.4 with Parallels Plesk Panel 10 (64-bit) on my server. Can anyone provide a guide to install MySQL 5.6.4?


title: Share Internet connection from a Debian laptop to a FreeBSD desktop

text: I have this situation: My Debian laptop is connected to the Internet via its wlan interface through my wireless router. Recently I decided to install FreeBSD on a very old machine (a celeron 300Mhz) which has only one ethernet interface. I can't connect this desktop (celeron) to the router (distance and cable concerns), so I was wondering how to make the Debian laptop share its Internet access with the FreeBSD desktop with a little cable. I've read about network bridging and think I can do that on the Debian side, but I still wonder how to proceed on the FreeBSD celeron desktop. How can I let this celeron access the Internet so I can upgrade/install stuff on it?


title: How can my script know when I'm in a virtual console vs. an xterm?

text: A few of my scripts (keymap changing, public key adding) need to act differently when in a virtual console vs. in an xterm. What's the real code for               #!/bin/ksh     if [[ in_a_virtual_console ]]; then     ...     else     ...     fi


title: Adding kill to a sudoers group

text: How can I give permissions in `sudoers` such that each member of a group is able to kill the process owned by another member of the group? Scenario: I have two users -- `bill` and `dev-cron` -- who are members of the group `tech`. I'd like `bill` to be able to kill processes started by `dev- cron`.


title: automatically load shell scripts from /usr/bin

text: Is there a way to have bash automatically load shell scripts I create and place into /usr/bin? Or is there a different place I should put custom shell scripts so that they are automatically loaded? For example suppose I create a script called `myscript` with contents:               #!/bin/bash     alias e=echo      and make it executable (`chmod a+x`), and put it into usr/bin. I am not able to call e from the commandline (when I try, it says the command wasn't found). What am I doing wrong?


title: How to turn off GNOME hint bubbles?

text: How can I disable the bubbles that pop up after ~1 sec? I don't want hint bubbles! :) ![Gnome pop-up help bubble](http://img130.imageshack.us/img130/4403/screenshotrj.png)


title: Why the double quotes and backquotes in a shell script?

text: I'm looking at this script mysql backup script and I don't understand what is the reason for using both backticks and double quotes around command names?               379 WHICH="`which which`"     380 AWK="`${WHICH} gawk`"     381 LOGGER="`${WHICH} logger`"     382 ECHO="`${WHICH} echo`"     383 CAT="`${WHICH} cat`"     384 BASENAME="`${WHICH} basename`"     385 DATEC="`${WHICH} date`"     386 DU="`${WHICH} du`"     387 EXPR="`${WHICH} expr`"     388 FIND="`${WHICH} find`"     389 RM="`${WHICH} rm`"     390 MYSQL="`${WHICH} mysql`"     391 MYSQLDUMP="`${WHICH} mysqldump`"     392 GZIP="`${WHICH} gzip`"     393 BZIP2="`${WHICH} bzip2`"     394 CP="`${WHICH} cp`"     395 HOSTNAMEC="`${WHICH} hostname`"     396 SED="`${WHICH} sed`"     397 GREP="`${WHICH} grep`"      **Update:** Is               "`${WHICH} gawk`"      pretty much the same as               "${${WHICH} gawk}"


title: Using device node of host bus adapter to send ioctl calls to monitor RAID status

text: I am interested in determining the status of a RAID array on my system (using Debian, and Intel ICH10R sata RAID controller = fakeRAID). What I have learned so far is that:   1. I can use CSMI I/O control codes in order to get the status (and a bunch of other info) about the RAID.    2. I need to open a device node for the host bus adapter in order to get a file descriptor so that I can use ioctl() and send the CSMI control codes. The constraint for my problem is that the solution must be done using C or C++, and not through a shell script. I have managed to solve this in Windows, so I know that at least it is possible. Right now, I'm stuck because I am not sure of the name of the device node for the hba, and I'm uncertain as to how I can find out. Also, I'm wondering if there's a better way... I have thought about libdevmapper, but I'm still unsure how I could use it. Does anyone know what concepts I still need to look into, and the direction that I need to look? Thanks for your help!


title: Setting the window dimensions of a running application

text: I'm trying to start an application within Ubuntu (xfce or gnome) and via the command line and was wondering if there's a generic way to set the dimensions of a given window of a given app that is currently running?


title: Kickstart: one network card with DHCP, one with static IP?

text: I am using Kickstart to automate a CentOS install. I wanted one of the interfaces to have static IP so I wrote -               network --onboot yes --bootproto static \             -ip="intended IP" -netmask="intended netmask" \             -gateway="intented gateway" --device eth0*      I also wanted the other ethernet to have dynamic ip so i also configured a DHCP server for my network and for the other interface card wrote               network --onboot yes --device eth1 --bootproto dhcp      But to my surprise the ethernet to be configured static was also provided with dynamic IP. What is wrong here?


title: Which is the best practice when replacing a system binary?

text: I'm working on Mac OS X which is shipped with several binaries mostly located in `/usr/bin/` and `/usr/sbin/`. Since it doesn't have a native package manager like some Linux distros, I got used to managing my own binaries, building and installing in `/usr/local/<package_name>/`. This way, I am able to fully remove a package from my system at the cost of manually update the `PATH` and the `MANPATH` variables in the `.bashrc` file. Here is a simple example: Mac OS X ships with ant 1.7.0, located in `/usr/bin`. I need to use the latest version, so I download it from Apache and then unzip (build) it to `/usr/local/apache-ant-1.8.2`. Then I update my `.bashrc` file with:               # Mac OS X original PATH     PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"     # Apache Ant 1.8.2     PATH="$PATH:/usr/local/apache-ant-1.8.2/bin"     export PATH      I make sure to export the `/usr/bin/` and `/usr/sbin/` before the `ant/bin/` because there are often other binaries besides the `ant` that I don't want to override. The problem is that when I type `which ant` I get `/usr/bin/`. So I rename the `/usr/bin/ant` to `/usr/bin/ant-old` in order to work with the latest build. While this works, I want to know if there are better approaches to replacing a system binary (mainly to avoid the last rename).


title: sending email to IP address via postfix

text: My friend and I have configured two Postfix mail servers on our laptops. We succeeded in sending mail to a real network (to some Gmail accounts) from our computers; that was the easy part. We now want to send an email from one laptop to the other; both laptops are on the same network (they're using the same WIFI) and they both have Postfix installed on them (OSes of laptops are Ubuntu). We tried to send email like this:               rcpt to: postmaster@[IP Address]      Yet, we have the same IP (when we check on sites like this), since we are on same network. We aren't network veterans, either. Here is the question: is it possible to send email from one laptop to the other, on the same network? If it is so, how could it be done? Moreover:   * my computer's local IP: 192.168.174.128   * friends local IP: 192.168.200.128 When I try to send an email via Postfix this command does it right:               rcpt to: username@[192.168.174.128]      But, it isn't working when I try to send email to my friend's Postfix:               rcpt to: username@[192.168.200.128]      He can't receive the mail that I've sent.


title: Is there an ARM repository for Arch Linux?

text: I'm trying to create a chroot for my rooted android phone. I want to do this with the `arch_bootstrap.sh` script found on the wiki but I can't find an ARM repository. My PC is x86_64 Arch Linux and my mobile is a HTC Desire running Cyanogenmod 7


title: Container lockdown

text: I was reading about LXC vs OpenVZ and was wondering if this issue has already been solved in more recent updates: > OpenVZ has done quite a good job at this, but LXC still has issues here. > Even with AppArmor enabled, in Ubuntu you still have access to dmesg from > the guests and /proc/kcore and /proc/sysrq-trigger are still accessible, so > a root user in a guest VM could easily restart the host machine. > Improvements are planned for Ubuntu version 13.04. source: http://www.janoszen.com/2013/01/22/lxc-vs-openvz/


title: How to install sudo package in Unix?

text: I'm new to this `sudo` command. I needed to do `sudo mount -o remount`. But it is giving me the following message               sudo: unable to stat /etc/sudoers: No such file or directory     sudo: no valid sudoers sources found, quitting     sudo: unable to initialize policy plugin      So I assume, it is not installed on my server. Could anyone give me instructions on how to properly install the `sudo` package on my server. I followed this tutorial [http://www.linuxfromscratch.org/blfs/view/svn/postlfs/sudo.html][1]. But I am not able to login as a `root` and run command `make install`. My actual problem is: I have phpseclib installed on `/usr/share/pear`. I want to send some file using `phpseclib` from one website to another one.(I'll generate pdf files on website1 and send pdf files to website2) I have a test.php outside of `wordpress`, it works perfectly (mean by I can see contents of website2 using ssh on website1). But then I have a wordpress page, it has exact same code, it said it failed to open library. I asked on other stackoverflow question and the member said because /usr/share/pear only allow root to access. As a wordpress user, I don't have a privilege. So that is why am I here and was trying to gain root access.


title: script to automate scp in network

text: I have a network full of Linux machines. In this network, I have a user as **user1** with the password as **password** in all the machines. I have the following script to put files in the home directory of **user1** in all the machines of the network.               #!/usr/bin/expect -f          # connect via scp     spawn cat /home/user1/Desktop/IPlistfile.txt | while read line do     spawn scp /home/user1/Desktop/filetobesent.txt user1@${line}:/home/user1/Desktop     #######################     expect {     -re ".*es.*o.*" {     exp_send "yes\r"     exp_continue     }     -re ".*sword.*" {     exp_send "password\r"     }     }     interact     done      The problem is I am getting an error message as "`can't read line. No such variable`". However, if I use a IP address directly instead of the line variable, I am able to transfer the file. **Edit** : The IPlistfile.txt contains the list of IP addresses in my network. Each line contains a single IP address.


title: Can't install PostgreSQL 9.2 on Linux Mint

text: I'm new with Linux systems. I tried to install PostgreSQL 9.2. I did the following:               sudo apt-get update     sudo apt-get -y install python-software-properties     sudo add-apt-repository ppa:pitti/postgresql     sudo apt-get update          sudo apt-get -y install postgresql-9.2 postgresql-client-9.2 postgresql-contrib-9.2      But it says that it can't find the packages. I read some tutorials and everywhere was written that I need to use the `ppa:pitti/postgresql` repository. What's wrong? **UPDATE1** I successfully installed packages from @slm's answer, but I can't start postgres. When I try `psql` I get:               Command psql can be found in packages:      * postgresql-client-common      * postgres-xc-client      Also I don't see file `/etc/init.d/postgresql`. **UPDATE2**               $ dpkg -L postgresql-contrib-9.2     /.     /usr     /usr/lib     /usr/lib/postgresql     /usr/lib/postgresql/9.2     /usr/lib/postgresql/9.2/lib     /usr/lib/postgresql/9.2/lib/test_parser.so     /usr/lib/postgresql/9.2/lib/btree_gist.so     /usr/lib/postgresql/9.2/lib/pgstattuple.so     /usr/lib/postgresql/9.2/lib/pg_buffercache.so     /usr/lib/postgresql/9.2/lib/cube.so     /usr/lib/postgresql/9.2/lib/unaccent.so     /usr/lib/postgresql/9.2/lib/earthdistance.so     /usr/lib/postgresql/9.2/lib/pgrowlocks.so     /usr/lib/postgresql/9.2/lib/insert_username.so     /usr/lib/postgresql/9.2/lib/moddatetime.so     /usr/lib/postgresql/9.2/lib/isn.so      /usr/lib/postgresql/9.2/lib/lo.so     /usr/lib/postgresql/9.2/lib/chkpass.so     /usr/lib/postgresql/9.2/lib/passwordcheck.so     /usr/lib/postgresql/9.2/lib/pg_freespacemap.so     /usr/lib/postgresql/9.2/lib/auth_delay.so     /usr/lib/postgresql/9.2/lib/pgcrypto.so     /usr/lib/postgresql/9.2/lib/pgxml.so     /usr/lib/postgresql/9.2/lib/btree_gin.so     /usr/lib/postgresql/9.2/lib/seg.so     /usr/lib/postgresql/9.2/lib/tcn.so     /usr/lib/postgresql/9.2/lib/auto_explain.so     /usr/lib/postgresql/9.2/lib/file_fdw.so     /usr/lib/postgresql/9.2/lib/uuid-ossp.so     /usr/lib/postgresql/9.2/lib/refint.so     /usr/lib/postgresql/9.2/lib/dict_int.so     /usr/lib/postgresql/9.2/lib/ltree.so     /usr/lib/postgresql/9.2/lib/tablefunc.so     /usr/lib/postgresql/9.2/lib/dummy_seclabel.so     /usr/lib/postgresql/9.2/lib/dict_xsyn.so     /usr/lib/postgresql/9.2/lib/adminpack.so     /usr/lib/postgresql/9.2/lib/fuzzystrmatch.so     /usr/lib/postgresql/9.2/lib/pg_trgm.so     /usr/lib/postgresql/9.2/lib/pg_stat_statements.so     /usr/lib/postgresql/9.2/lib/autoinc.so     /usr/lib/postgresql/9.2/lib/timetravel.so     /usr/lib/postgresql/9.2/lib/dblink.so     /usr/lib/postgresql/9.2/lib/sslinfo.so     /usr/lib/postgresql/9.2/lib/_int.so     /usr/lib/postgresql/9.2/lib/hstore.so     /usr/lib/postgresql/9.2/lib/pageinspect.so     /usr/lib/postgresql/9.2/lib/citext.so     /usr/lib/postgresql/9.2/bin     /usr/lib/postgresql/9.2/bin/pgbench     /usr/lib/postgresql/9.2/bin/pg_standby     /usr/lib/postgresql/9.2/bin/pg_archivecleanup     /usr/lib/postgresql/9.2/bin/vacuumlo     /usr/lib/postgresql/9.2/bin/pg_test_timing     /usr/lib/postgresql/9.2/bin/pg_test_fsync     /usr/lib/postgresql/9.2/bin/oid2name     /usr/share     /usr/share/doc     /usr/share/doc/postgresql-contrib-9.2     /usr/share/doc/postgresql-contrib-9.2/copyright     /usr/share/doc/postgresql-contrib-9.2/autoinc.example     /usr/share/doc/postgresql-contrib-9.2/changelog.gz      /usr/share/doc/postgresql-contrib-9.2/changelog.Debian.gz     /usr/share/doc/postgresql-contrib-9.2/moddatetime.example     /usr/share/doc/postgresql-contrib-9.2/refint.example     /usr/share/doc/postgresql-contrib-9.2/insert_username.example     /usr/share/doc/postgresql-contrib-9.2/timetravel.example      /usr/share/postgresql     /usr/share/postgresql/9.2     /usr/share/postgresql/9.2/extension     /usr/share/postgresql/9.2/extension/pgstattuple.control     /usr/share/postgresql/9.2/extension/uuid-ossp.control     /usr/share/postgresql/9.2/extension/dblink--1.0.sql     /usr/share/postgresql/9.2/extension/dblink.control     /usr/share/postgresql/9.2/extension/timetravel.control     /usr/share/postgresql/9.2/extension/citext.control     /usr/share/postgresql/9.2/extension/xml2--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/isn.control     /usr/share/postgresql/9.2/extension/pageinspect.control     /usr/share/postgresql/9.2/extension/intarray.control     /usr/share/postgresql/9.2/extension/insert_username--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/refint--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/seg--1.0.sql     /usr/share/postgresql/9.2/extension/pg_stat_statements.control     /usr/share/postgresql/9.2/extension/tcn--1.0.sql     /usr/share/postgresql/9.2/extension/refint.control     /usr/share/postgresql/9.2/extension/lo--1.0.sql     /usr/share/postgresql/9.2/extension/pageinspect--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/isn--1.0.sql     /usr/share/postgresql/9.2/extension/tablefunc--1.0.sql     /usr/share/postgresql/9.2/extension/test_parser--1.0.sql     /usr/share/postgresql/9.2/extension/sslinfo--unpackaged--1.0.sql      /usr/share/postgresql/9.2/extension/moddatetime.control     /usr/share/postgresql/9.2/extension/intagg.control     /usr/share/postgresql/9.2/extension/timetravel--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/insert_username.control     /usr/share/postgresql/9.2/extension/hstore--1.0--1.1.sql     /usr/share/postgresql/9.2/extension/moddatetime--1.0.sql     /usr/share/postgresql/9.2/extension/file_fdw--1.0.sql     /usr/share/postgresql/9.2/extension/tsearch2--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/pg_freespacemap--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/pg_stat_statements--1.0--1.1.sql     /usr/share/postgresql/9.2/extension/isn--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/pg_trgm--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/btree_gist--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/earthdistance--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/refint--1.0.sql     /usr/share/postgresql/9.2/extension/btree_gin--1.0.sql     /usr/share/postgresql/9.2/extension/autoinc.control     /usr/share/postgresql/9.2/extension/pgcrypto.control     /usr/share/postgresql/9.2/extension/pg_trgm.control     /usr/share/postgresql/9.2/extension/btree_gin.control     /usr/share/postgresql/9.2/extension/seg.control     /usr/share/postgresql/9.2/extension/pg_trgm--1.0.sql     /usr/share/postgresql/9.2/extension/hstore--1.1.sql     /usr/share/postgresql/9.2/extension/test_parser.control     /usr/share/postgresql/9.2/extension/dict_xsyn--1.0.sql     /usr/share/postgresql/9.2/extension/sslinfo--1.0.sql     /usr/share/postgresql/9.2/extension/tablefunc--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/tcn.control     /usr/share/postgresql/9.2/extension/lo.control     /usr/share/postgresql/9.2/extension/uuid-ossp--1.0.sql     /usr/share/postgresql/9.2/extension/chkpass.control     /usr/share/postgresql/9.2/extension/btree_gin--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/fuzzystrmatch.control     /usr/share/postgresql/9.2/extension/timetravel--1.0.sql     /usr/share/postgresql/9.2/extension/cube--1.0.sql     /usr/share/postgresql/9.2/extension/dblink--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/insert_username--1.0.sql     /usr/share/postgresql/9.2/extension/ltree--1.0.sql     /usr/share/postgresql/9.2/extension/citext--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/ltree--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/pgstattuple--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/btree_gist--1.0.sql     /usr/share/postgresql/9.2/extension/dict_xsyn.control     /usr/share/postgresql/9.2/extension/pgcrypto--1.0.sql     /usr/share/postgresql/9.2/extension/uuid-ossp--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/pg_buffercache--1.0.sql     /usr/share/postgresql/9.2/extension/unaccent--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/seg--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/file_fdw.control     /usr/share/postgresql/9.2/extension/tsearch2--1.0.sql     /usr/share/postgresql/9.2/extension/fuzzystrmatch--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/lo--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/unaccent--1.0.sql     /usr/share/postgresql/9.2/extension/fuzzystrmatch--1.0.sql     /usr/share/postgresql/9.2/extension/intarray--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/autoinc--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/ltree.control     /usr/share/postgresql/9.2/extension/pg_buffercache--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/cube.control     /usr/share/postgresql/9.2/extension/pgcrypto--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/chkpass--1.0.sql     /usr/share/postgresql/9.2/extension/earthdistance--1.0.sql     /usr/share/postgresql/9.2/extension/pg_stat_statements--1.1.sql     /usr/share/postgresql/9.2/extension/pgrowlocks--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/pgrowlocks--1.0.sql     /usr/share/postgresql/9.2/extension/moddatetime--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/unaccent.control     /usr/share/postgresql/9.2/extension/dict_int--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/intarray--1.0.sql     /usr/share/postgresql/9.2/extension/pgstattuple--1.0.sql     /usr/share/postgresql/9.2/extension/pg_freespacemap--1.0.sql     /usr/share/postgresql/9.2/extension/autoinc--1.0.sql     /usr/share/postgresql/9.2/extension/tsearch2.control     /usr/share/postgresql/9.2/extension/test_parser--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/pageinspect--1.0.sql     /usr/share/postgresql/9.2/extension/pg_freespacemap.control     /usr/share/postgresql/9.2/extension/xml2--1.0.sql     /usr/share/postgresql/9.2/extension/citext--1.0.sql     /usr/share/postgresql/9.2/extension/chkpass--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/hstore--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/dict_int--1.0.sql     /usr/share/postgresql/9.2/extension/hstore.control     /usr/share/postgresql/9.2/extension/intagg--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/xml2.control     /usr/share/postgresql/9.2/extension/pgrowlocks.control     /usr/share/postgresql/9.2/extension/sslinfo.control     /usr/share/postgresql/9.2/extension/cube--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/adminpack--1.0.sql     /usr/share/postgresql/9.2/extension/pg_buffercache.control      /usr/share/postgresql/9.2/extension/pg_stat_statements--unpackaged--1.0.sql     /usr/share/postgresql/9.2/extension/btree_gist.control     /usr/share/postgresql/9.2/extension/intagg--1.0.sql     /usr/share/postgresql/9.2/extension/adminpack.control     /usr/share/postgresql/9.2/extension/dict_int.control     /usr/share/postgresql/9.2/extension/tablefunc.control     /usr/share/postgresql/9.2/extension/earthdistance.control     /usr/share/postgresql/9.2/man     /usr/share/postgresql/9.2/man/man1     /usr/share/postgresql/9.2/man/man1/pg_test_timing.1.gz     /usr/share/postgresql/9.2/man/man1/pg_test_fsync.1.gz     /usr/share/postgresql/9.2/man/man1/pg_standby.1.gz     /usr/share/postgresql/9.2/man/man1/pgbench.1.gz     /usr/share/postgresql/9.2/man/man1/oid2name.1.gz     /usr/share/postgresql/9.2/man/man1/pg_archivecleanup.1.gz     /usr/share/postgresql/9.2/man/man1/vacuumlo.1.gz


title: Enable line breaks when assigning multi line outputs to var in bash

text: I'm using the following very basic shell script I copied off the net to list the contents of my database backup folder and mail them regularily:               MYSQLLIST=$(ls -lhG /var/backups/mysql/daily/)     SUBJECT="daily backup finished"     EMAIL="logging@localhost"     EMAILMESSAGE="/tmp/emailmessage.txt"     echo "dailybackup.sh ran successfully" > $EMAILMESSAGE     echo "MYSQL:" >> $EMAILMESSAGE     echo $MYSQLLIST >> $EMAILMESSAGE     mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE      However - regardless the mail reader - in the mail I receive there are no linebreaks between the rows of the `ls` output, which makes the message terribly hard to read. How could I produce linebreaks identical to those I get when executing `ls -lhG` on the shell?


title: How to download the latest file in a folder using a scp?

text: I'd like to run an scp transfer to download the latest (newest) file in a certain directory to my local directory. Something like this: `source: root@rimmer.sk:/home/rimmer/backups/` `destination: /home/rimmer/backups/` While getting the newest file only, not all of them, in `backups`.


title: /etc/hosts file syntax. Is it possible to set one IP for a zone?

text: I would like to set one IP for a zone (livejournal.com) currently I am having to directly type the subdomains like:               11.11.11.11 sub1.livejournal.com     11.11.11.11 sub2.livejournal.com     11.11.11.11 sub3.livejournal.com      etc. I tried               11.11.11.11 *.livejournal.com      and               11.11.11.11 .livejournal.com      didn't help. So I want to have only one line and resolve missing subdomains to IP like: `sub1000.livejournal.com` without explicitly specifying it


title: sed replace misplaces slashes

text: I have the following code in a LaTeX file:               for \emph{service} in \emph{host}.resources:         for \emph{file} in \emph{host}.resources:             \underline{service}.requires.add(\underline{file})         for \emph{package} in \emph{host}.resources:             \underline{service}.requires.add(\underline{package})      Because this is inside a listing enviroment and I still want the emph and underline commands I escape the LaTeX commands, which results in something like this:               for %*\emph{file}*) in %*\emph{host}*).resources:      I tried to automate this process using the following sed command:               sed "s_\(\\emph{[a-z]*}\)_%\*\1\*)_"      But this results into the following output:               for \%*emph{dir}*) in \emph{host}.resources:      There are two problems with this:   1. The '\' before emph is placed before the LaTeX escaping characters.    2. sed only seems to replace the first match. I know about the greedy matching in sed, which is why I used [a-z]* instead of .* inside the curly braces. But this doesn't seem to work. Any ideas on how to make sed do as I want?


title: How to check and set "rhash_entries" parameter?

text: I'm reading this article, and it says:               rhash_entries is the size of the hash table. If you don't specify it on the     kernel command line, it is computed dynamically based on the memory available     on your system. You can view its value by looking at something like IP route     cache hash table entries: 262144 (order: 9, 2097152 bytes) in the kernel logs.      But when I'm checking if there is the entry in kern.log or syslog, I can't find any. If I understood this well, if I wanted to change the default size of the table, I should add `rhash_entries=` to the kernel line in extlinux/grub , but after doing so, there's also no "route" communicates in the logs. I'm just trying to understand how the parameters in sysctl works (not only this one), but without knowing how to read and set `rhash_entries`, I won't understand how the route cache works. Does anyone know something about this `rhash_entries` kernel parameter?


title: My hbh-ds970 sony bluetooth headset no longer connects on ubuntu

text: I have a notebook with bluetooth 4.0 inbuilt. I am not able to connect hbh-ds970 sony erricson bluetooth headset on any of the latest ubuntu distros starting from 12.10. It used to work fine on earlier distros though. Can anyone help me debug or provide a solution?


title: WiFi fails in LXLE 12.04.4

text: Installed LXLE 32-bit 12.04.4 on a Dell Inspiron B130. Networking works, WiFi fails. Has a Broadcom 4401-B0. Network applet shows WiFi greyed out, just like it did in the LiveUSB boot. lspci reports:               02:00.0 Ethernet controller: Broadcom Corporation BCM4401-B0 100Base-TX (rev 02)      WiFi is enabled in BIOS, no mechanical switch to disable. Worked in XP. Updated system, rebooted, problem persists. Installed the three b43 packages, skipping lpphy and rebooted. WiFi still does not appear. Installed wicd and uninstalled network-manager, launched wicd. It still does not see WiFi. Rebooted. Opened Wicd. Found the tab at upper right for the pull down list and chose Preferences. Found WiFi box. Set WiFi card to wlan Clicked OK then Refresh - "No wireless interface found." Repeated for wlan0 through wlan7 - No wireless interface found.


title: How do I call an executable as if it were called from another folder?

text: Let's say I have a program `food` in `/bin/` that creates the file `dinner.txt` like so:               #!/bin/bash     touch dinner.txt      I want to use my `food` program to create `dinner.txt` in my `/home/` folder without calling `cd /home/` first. In other words, I want to call `food` as if it were called from `/home/`. How would I do this? **Edit:** Assume I can't edit the actual `food` program.


title: Why I cannot move to trash from /var/tmp?

text: I just found out on Fedora 20, that neither with Thunar nor Nautilus (I'm using Xfce4 here), I can't move file from /var/tmp to Trash. More precisely, in Nautilus the menu option is not available, while in Thunar it behaves as "Permanently delete". In either case, this is special-cased. Why is that? Is Trash supposed to work only from home folder?


title: How do I route a spare network interface through an SSH tunnel?

text: I just bought a Raspberry Pi and I am wanting to route an ad hoc wireless network interface fully through an SSH tunnel that was created using another wireless interface. I want to do this so that I can have a secured and private connection to the internet at places with public WiFi. I know this would be easier to do all on one computer, but I would like to have it on the RPi too since I use it for other network related things when I am using the internet, and then just simply connect to the ad hoc network from my laptop/phone. This will really help me with my iPhone because it does not support an SSH tunnel locally. How should I go about doing this? Thanks in advance for all of your help.


title: Find or create kernel configuration of kernel binary

text: I've downloaded a kernel binary which I am using now. In order to use the watchdog on my system I must recompile the kernel with watchdog support. Is it possible to obtain the current kernel configuration of the binary? The binary is obtained from this page. I've used version R5.


title: start up Java GUI app on start up after login Linux mint

text: I want to start Java GUI app on start up. Java app is server and is GUI and I want to start GUI on start up after login how to do this? Any ideas?


title: Repackaging proprietary software

text: I was thinking about trying to package Matlab (a proprietary piece of software) for Arch Linux by creating a PKGBUILD to handle installation, dependencies, and conflicts. With the standard Matlab Linux installer it places everything in a local directory and does not require many external packages. That said, it provides a number of standard library files (e.g., libgcc_s.so and libstdc++.so) as well as a complete JRE. Can these types of files be removed (possibly replaced by links) and supplied by additional package dependencies?


title: Using sed to delete everything between two words?

text: This doesn't seem to work               The next example would delete everything between "ONE" and "TWO:"           #!/bin/sh     sed '     /ONE/ {     # append a line         N     # search for TWO on the second line          /\n.*TWO/ {     # found it - now edit making one line             s/ONE.*\n.*TWO/ONE TWO/         }     }' file      i was expecting to delete everything between ONE and TWO.i tried with file where file contains.               [user5@mailserver ~]$ cat file     ONE     hello     TWO      but the output come like               [user5@mailserver ~]$ ./test     ONE     hello     TWO      I was expecting `ONE TWO` I am trying to make it correct but not able to do.


title: What program reads and executes /usr/share/alsa/alsa.conf and related scripts?

text: I can't find any kind of daemon application for modern ALSA. I wonder, what process or kernel thread reads `/usr/share/alsa/alsa.conf` and other configuration files under `/usr/share/alsa`, when it reads them and what kernel structures it updates (I suppose, it updates configuration spaces of kernel modules-drivers of audio hardware)?


title: What's the difference between SSH and Squid when using them as proxies?

text: I've been using Squid on one of my server as a transparent proxy for a very long time (years). Basically from the client I was creating an SSH tunnel between my client and the ssh + Squid server doing this:               ssh -T -N -x -C -L3128:127.0.0.1:3128 cedric@xxx      and then I'd launch my web browser (chromium) giving it a proxy-server at 127.0.0.1 on port 3128. This worked fine for a very long time but then I started having logging issues on many websites (forums, stackexchange using Google as the login authority, etc.). Some kept working fine (like GMail and all the GMail services). I don't know what caused the login problems: I think it's due to some Squid configuration problem when I upgraded the server's OS and software. So I considered setting up a VPN but then by reading an article called "SSH as a poor man's VPN", I realized that I could use SSH and simply do this, from the client:               ssh -D 5222 cedric@xxx -N      And then configure my browser to use 127.0.0.1 as a SOCKS host on port 5222. And now everything works fine: all the login problems seem to be solved and I don't even need Squid anymore on the server. However I don't understand how it works. From the various "what is my ip" websites, I see the address of my server (which is what I want). Also these sites do not seem to detect that there's a SSH "tunnel" going on. Basically my question is: what is, technically, the difference between using Squid as a transparent proxy and using "SSH -D ... -N" and using a VPN? And from the viewpoint of the websites that I'm visiting, is there any difference? Also I'd like to know if there's any way that a website I'm visiting would be able to detect my real IP when using "SSH -D ... -N"? Is this technically feasible or is that information simply not available to the browser?


I go to use the updatedb command to update the index and I get               updatedb: can not open a temporary file for `/var/lib/mlocate/mlocate.db'      fyi The locate command is working, e.g.               $ locate Index.xml     /usr/share/mysql/charsets/Index.xml     durrantm.../durrantm$       How can I overcome this issue when trying to run updatedb?


title: How can I create a .deb package with my compiled OpenCV build?

text: OpenCV 2.4.2 took 6 hours to compile on the Raspberry Pi and I'd love to package everything up as a deb but I have never done that before. How can I package the compiled files so that they download or include the necessary other libraries?


title: File sharing between RHEL 5 and Windows 7

text: I am trying to setup the **SAMBA** service to share file between _RHEL 5_ and _Windows 7_. I have both the operating systems in the same machine. I tried to setup as discussed in this link. I checked the workgroup name and it was **WORKGROUP** in _Windows 7_. I had setup the server preference as in the below screenshot. ![enter image description here](http://i.stack.imgur.com/GKkkE.png) I clicked on " **Add share** " button and am trying to share a small PDF file to the _Windows 7_. However, when I go to _Windows 7_ and check the network and sharing center, I do not see the shared file present there. Is there any other step that I am missing?


title: Cisco-like command Line Interface

text: I'm looking for a way to implement a fairly basic Cisco like command line interface on my Ubuntu server appliance (12.04 in particular). I've come across the following project: CLISH however, documentation is sketch and it seems to be quite stale. Does anyone have any experience with this sort of thing and might you know of any similar projects / approaches?


title: Run a script after some command were executed

text: I have a list of scripts   * `./myscript <param> | grep "asd"`   * `./myotherscript <param> <param> > file`   * ... How can I automaticaly run another script when one of these command in the list is executed and finished?


title: Partition not mounting from fstab

text: I have mounted a partition and add it to `fstab` file and then rebooted but I see that the partition is not mounted although it was added to `fstab`. What is wrong, and how can I solve it?   `fstab` line: `/dev/xvdf /dev/xvdb1 ext3 defaults 0 0`


title: How to ensure that a custom emacs macro operates on region?

text: Suppose I define a custom macro in emacs in my `.emacs` file. Is there a way to ensure that it works only on the region I marked in a buffer before executing my command, without going into details of the macro definiton?


title: yum and openssl disagree on currently installed version in Centos 6.5

text: I'm attempting to ensure that we are using the most recent openssl version on Centos 6.5, and yum reports that we are, but openssl continues to report that its version is an older one:               [vagrant@centos-65-developer ~]$ sudo yum list openssl     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile      * base: mirror.trouble-free.net      * extras: mirrors.gigenet.com      * rpmforge: fr2.rpmfind.net      * updates: centos.sonn.com     Installed Packages     openssl.x86_64                      1.0.1e-16.6_5.7                   @updates          Available Packages     openssl.i686                        1.0.1e-16.el6_5.7                 updates          [vagrant@centos-65-developer ~]$ openssl version -a     OpenSSL 1.0.1e-fips 11 Feb 2013     built on: Tue Apr  8 02:39:29 UTC 2014     platform: linux-x86_64     options:  bn(64,64) md2(int) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx)     compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -m64 -DL_ENDIAN -DTERMIO -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wa,--noexecstack -DPURIFY -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM     OPENSSLDIR: "/etc/pki/tls"     engines:  dynamic      Does Centos' openssl always report incorrectly, or is this machine truly running the old version (1.0.1e-fips)?


title: disable console-kit logging

text: My X login manager (slim) has brought with it a dependency on a package `consolekit` I don't know what `consolekit` is good for, other login managers such as `wdm` do not need it. But anyway, the problem I am having is that `consolekit` is logging lots of garbage in `/var/log/ConsoleKit/history`. I am not interested in those logs. Is it possible to disable logging? I have tried removing the log file and creating a symlink to `/dev/null`               ln -s /dev/null /var/log/ConsoleKit/history      But that does not work, because `consolekit` now complains that there are too many levels of symbolic links.


title: Is there any way to undo a bash history modification?

text: By pressing up, I can go through previously entered commands. I've noticed though that if I modify one of them, that alters the history. For instance, if I type:               echo a     echo b     echo c     [up][up][backspace]d[ctrl+c]      the history now shows that the second command was `echo d`, not `echo b`. How do I keep the first `echo b` in the history? For instance, say I run a really long command, with a lot of options. then I want to run it again, with a minor change, so I go back through the history to find it, make the change, but then realize that actually I don't need to re- run it, having just thought of another option to do instead. then later, I want to go back and remind myself what the command I ran was - but wait, the history is now showing the wrong thing! This comes up very rarely, but when it does I find it really irritating. Is there some way to automatically preserve the original history?


title: How to burn mp3 files to an audio CD under Scientific-Linux 6.1?

text: It should be an easy thing.. but a strange thing happened when I tried in Brasero: "XXX.mpg is not suitable for audio or video media" ![enter image description here](http://i.stack.imgur.com/us91n.png) I had the same problem with K3B. What package did I forget to install? What should I do to burn MP3 files to an audio CD?


title: Setting mmc0 in Beaglebone Black for Wireless Connectivity

text: I got a new device that will allow my Beaglebone Black (BBB) to have WiFi capabilities and features. BBB is running Debian (3.8.3-bone47) This device uses SDIO for communication purposes. I am using the on board flash, and therefore the SD card slot is not been used. Thus, I thought about using mmc0 through the card slot since doing that I will not interfere with any other subsystem in the BBB. I have already installed the driver, and it seems to be set correctly. The problem is that the device is not been recognized through the SD card slot. Is there some configuration in Debian that I am missing in order to accomplished this task? Also, how to enable WiFi features in Linux? I have not been able to find that configuration file anywhere. Appreciate any help you could provide. Thanks in advance.


title: Merging text files based on their filename

text: I have hundred of files with the following format:               2013_01_19_xyxyxyx.txt     2013_01_19_xyxyxyx.txt     2014_03_21_xyxyxyx.txt     2014_03_21_zxzxzxz.txt     2014_03_22_abababa.txt     2014_03_22_cbcbcbc.txt     etc.      I would like to merge files into:               2013_01_19.txt     2014_03_21.txt     2014_03_22.txt      How could I achieve this ?


title: Vocabulary trainer for Unix

text: I am looking for a Linux (Ubuntu) software that allows me to take note of new words that I learn online. I manually add new words, their meaning and usage. The software then displays each item in a nice format and allows me to review them in a variety of ways, e.g., randomly, or just alphabetically. It is also good to have the ability to export the list to a file, for use in other software. It's something like a box of vocabulary cards, but hopefully with some additional useful capabilities.


title: Recommend a reading for learning Linux firewalls configuration for beginner?

text: I am using Linux at home and want to be able to configure firewall. I would like to understand what I am doing not just copy paste some rules from internet :).


title: How to install wireless driver in Fedora 15?

text: I have tried ndiswrapper 1.56 for fc15... it gives the following error :               $ make       make -C driver       make[1]: Entering directory `/home/dhinesh/sware/ndiswrapper-1.56/driver'       make -C /usr/src/kernels/2.6.38.6-26.rc1.fc15.i686.PAE M=/home/dhinesh/sware/ndiswrapper-1.56/driver       make[2]: Entering directory `/usr/src/kernels/2.6.38.6-26.rc1.fc15.i686.PAE'        CC [M]  /home/dhinesh/sware/ndiswrapper-1.56/driver/loader.o       /home/dhinesh/sware/ndiswrapper-1.56/driver/loader.c:834:2: error: unknown field ‘ioctl’ specified in initializer       /home/dhinesh/sware/ndiswrapper-1.56/driver/loader.c:834:2: warning: initialization from incompatible pointer type [enabled by default]       /home/dhinesh/sware/ndiswrapper-1.56/driver/loader.c:834:2: warning: (near initialization for ‘wrapper_fops.llseek’) [enabled by default]       make[3]: ** [/home/dhinesh/sware/ndiswrapper-1.56/driver/loader.o] Error 1      make[2]: ** [_module_/home/dhinesh/sware/ndiswrapper-1.56/driver] Error 2       make[2]: Leaving directory `/usr/src/kernels/2.6.38.6-26.rc1.fc15.i686.PAE'       make[1]: ** [modules] Error 2       make[1]: Leaving directory `/home/dhinesh/sware/ndiswrapper-1.56/driver'       make: ***[all] Error 2      How can I get out of this? Or any other distro to install wireless driver?


title: How to disable graphical shell?

text: I have a Linux system (Ubuntu) running in a VM, but now I want to disable the graphical shell. Where in the startup process are the graphical components launched? Is it some run-level dependent config? Which config files must I edit to stop it?


title: Getting vim to be silent when using -s {scriptin}

text: The vim man page describes `-s {scriptin}` option which allows for automation of file edits. This works fine, but I'd like for vim not to grab the console in this case (and flash the file with edits), but to rather do its stuff silently and invisibly ... similar to a `vim -e -s` invocation. Actually, my real need is to automate a file edit with vim in a silent way, so I guess use of `vim -e` would suffice if it weren't for the fact that I'm not familiar with ex mode (at least not when it comes to bread-and-butter editing commands), and creation of a `{scriptin}-format` file is just so easy (`vim -W`). So ... I guess a `{scriptin}-format-to-ex-command-format` converter would be just as good. Any ideas?


title: Pulse Audio and Roaming Profiles on CentOS 6

text: We've been testing many Red Hat based distributions recently at work to replace Windows as our main operating system. We choosed CentOS 6 since all our software were fully compatible. The biggest bug I got so far comes from Pulse Audio. When I log as a local user (root and non-root), I've no problem at all. But when it comes to a network user (roaming profiles) through NFS, it seems that Pulse Audio can't start. I've been looking at the system logs, and it was complaining about the fact that it couldn't create a socket, so we changed the config file to create it locally. The daemon stopped complaining and started, but still can't get the audio working. Going to System/../Audio pops the window to configure, but I get this message: Waiting for Audio [...] and never show up like on a local user session. I don't have any logs at the moment, I'll post them tomorrow. I was just wondering if this is a known issue and if it's possible to fix it? I've been searching for a while but never found an answer. The solution I found so far was to uninstall pulse audio (and all related ALSA plugins) and use Alsa directly. It works, but I think having pulse audio would be more convenient for our users (So they can configure their usb or other audio component more easily than with ALSA, and some software works better with Pulse Audio). Thanks Edit: Here are some logs: After a Fresh install of pulse audio [...]               Sep  2 09:42:06 localhost pulseaudio[20545]: main.c: Module load failed.     Sep  2 09:42:06 localhost pulseaudio[20545]: main.c: Failed to initialize daemon.     Sep  2 09:42:06 localhost pulseaudio[20539]: main.c: Daemon startup failed.     Sep  2 09:42:06 localhost rtkit-daemon[20011]: Warning: Reached burst limit for user '1090', denying request.     Sep  2 09:42:06 localhost rtkit-daemon[20011]: Warning: Reached burst limit for user '1090', denying request.     Sep  2 09:42:07 localhost rtkit-daemon[20011]: Warning: Reached burst limit for user '1090', denying request.     Sep  2 09:42:07 localhost rtkit-daemon[20011]: Warning: Reached burst limit for user '1090', denying request.     Sep  2 09:42:07 localhost rtkit-daemon[20011]: Warning: Reached burst limit for user '1090', denying request.     Sep  2 09:42:07 localhost rtkit-daemon[20011]: Warning: Reached burst limit for user '1090', denying request.     Sep  2 09:42:07 localhost rtkit-daemon[20011]: Warning: Reached burst limit for user '1090', denying request.     Sep  2 09:42:07 localhost pulseaudio[20551]: module-protocol-stub.c: Failed to remove stale UNIX socket '/Network/Servers/[some path]/Volumes/Home/Users/xavier/.pulse/0a9e231ce3558be2c6df990d00000013-runtime/native': No such file or directory     Sep  2 09:42:07 localhost pulseaudio[20551]: module.c: Failed to load  module "module-native-protocol-unix" (argument: ""): initialization failed.     Sep  2 09:42:07 localhost pulseaudio[20551]: main.c: Module load failed.     Sep  2 09:42:07 localhost pulseaudio[20551]: main.c: Failed to initialize daemon.     Sep  2 09:42:07 localhost pulseaudio[20542]: main.c: Daemon startup failed.      [... Keeps looping.] Then I modify system.ps and default.pa in /etc/pulse with this:               load-module module-native-protocol-unix socket=/tmp/pulse.socket      Now the logs are different:               Sep  2 09:46:13 localhost pulseaudio[22179]: pid.c: Daemon already running.     Sep  2 09:47:10 localhost rtkit-daemon[20011]: Sucessfully made thread 22187 of process 22187 (/usr/bin/pulseaudio) owned by '1090' high priority at nice level -11.     Sep  2 09:47:10 localhost pulseaudio[22187]: pid.c: Daemon already running.      Still have no sound. Then I try:               [xavier@theatre ~]$ pulseaudio -k     [xavier@theatre ~]$ pulseaudio --start -D      Which results in:               Sep  2 09:49:11 localhost rtkit-daemon[20011]: Sucessfully made thread 22238 of process 22233 (/usr/bin/pulseaudio) owned by '1090' RT at priority 5.      ... but I'm out of luck.


title: How to get file descriptor other than stdin stdout and stderr (to do something like $ program 1>file_1 3>file_2)?

text: When an executable produces an output I prefer to let the executable print the output to `stdout` in order to redirect them in a file as well to pipe them to another command. Let suppose that an executable has to write two distinct outputs, usually redirected to two distinct files. I would like to avoid passing the filenames to the executable and writing directly to files, instead I would like to write something like               $ program 1>file_1 3>file_2      Is possible to do something like that?


title: maximum of column with matching id

text: I have a file with the following fields               NM001 rp1 210     NM003 rp1 220     NM005 rag 200     NM004 rag 100      I would like to have an output that for every change in column2, find maximum in column4 but also report corresponding column1. So far I found a solution that report column2 and 3 but not column1 because the number in column1 is different. I like to use awk please. The output should be               NM003 rp1 220     NM005 rag 200


title: How to kill a stuck print job under AIX?

text: 0:root@SERVER:/ # uname     AIX     0:root@SERVER:/ # oslevel     6.1.0.0     0:root@SERVER:/ # switch.prt -d     #printsubsystem     AIX     0:root@SERVER:/ # lpstat -oQUEUENAME      Queue   Dev   Status    Job Files              User         PP %   Blks  Cp Rnk     ------- ----- --------- --- ------------------ ---------- ---- -- ----- --- ---     QUEUENA QUEUE READY         QUEUENAME:      QUEUENAME:                          Windows LPD Server     QUEUENAME:                               Printer \\192.168.2.34\QUEUENAME     QUEUENAME:      QUEUENAME: Owner       Status         Jobname          Job-Id    Size   Pages  Priority     QUEUENAME: ----------------------------------------------------------------------------     QUEUENAME: A22adm (10. Waiting   02bT7zBL.A22          1703      3374      0      1     0:root@SERVER:/ # cancel 1703 QUEUENAME                0:root@SERVER:/ #                             0:root@SERVER:/ # lpstat -oQUEUENAME        Queue   Dev   Status    Job Files              User         PP %   Blks  Cp Rnk     ------- ----- --------- --- ------------------ ---------- ---- -- ----- --- ---     QUEUENA QUEUE READY         QUEUENAME:      QUEUENAME:                          Windows LPD Server     QUEUENAME:                               Printer \\192.168.2.34\QUEUENAME     QUEUENAME:      QUEUENAME: Owner       Status         Jobname          Job-Id    Size   Pages  Priority     QUEUENAME: ----------------------------------------------------------------------------     QUEUENAME: A22adm (10. Waiting   02bT7zBL.A22          1703      3374      0      1     0:root@SERVER:/ #       I also tried to:               stopsrc -g spooler     startsrc -g spooler      and               disable QUEUENAME     enable QUEUENAME      and               /usr/bin/enq -P 'QUEUENAME' -x '1703'      and tried removing the print job with smitty, but with no luck.. any help?


title: Print Matching line and nth line from the matched line

text: I am trying to print the matched line and the 4th line from the matched line (line containing the expression I am searching for). I have been using the following code: `sed -n 's/^[ \t]*//; /img class=\"devil_icon/,4p' input.txt` But this only prints the matched line. This prints only the 4th line. `awk 'c&&!--c;/img class=\"devil_icon/{c=4}' input.txt` I need to print both the matched line and the 4th line only.


title: how to verify if root password changed correctly

text: I have an OpsWare task, that changes root passwords on a massive number of servers, by replacing the root's password hash in `/etc/shadow` file. I need a script of some sort, which preferably runs using, again, OpsWare but I do not want to compare the hashes. I want it to run some sort of an `su` (or `login`) command and input the actual password string. The reason I want to do it this way is, in the past, I have had hashes created by someone else, which did not encrypt correctly and denied root login on a large number of servers. I am looking for ideas that I can implement. `expect` comes to mind but since it is not a standard utility in our enterprise, it needs to be installed and removed right after testing, which is not a "fast" solution. Idea suggestions are appreciated.


title: Set up firwall with iptables to only allow VPN

text: Im using IPredator VPN with openVPN and I want to make sure that if the connection is dropped, i wont submit data from the internet without the VPN. I heard that I could do that with iptables and a range. How can I do that? And how can I find out the ranges of IP's my VPN is assigning me?


title: Use awk to find first occurrence

text: I have a log file that gets updated when my script runs. The script will insert "Start of script" text when it starts and "End of script" text when it finishes running. I am trying to capture the text between the "Start of script" and "End of script". The most recent entries are at the bottom of the log. Using the following is close, but it is giving me all the occurrences in the log as shown below.               tac /opt/novell/JDBCFanout/activemqstatus.log |awk '/End of script/,/Start of script/'|tac          2014-09-09 12:30:42 - Start of script     2014-09-09 12:30:42 - Monitoring Reset script for the ActiveMQ.     2014-09-09 12:30:42 - The ActiveMQ value is not 1, the ActiveMQ services will not be restarted. The current value is 0.     2014-09-09 12:31:35 - The Fanout driver state is:  0     2014-09-09 12:33:32 - Sleeping for 10 seconds before checking the status of the Fanout driver.     2014-09-09 12:35:05 - The Fanout driver state is:  1     2014-09-09 12:35:05 - ERROR: The Fanout driver failed to start. The Fanout driver needs to be manually restarted.     2014-09-09 12:35:05 - End of script     2014-09-09 13:17:17 - Start of script     2014-09-09 13:17:17 - Reset script for the ActiveMQ.     2014-09-09 13:17:17 - The ActiveMQ flag is 1, shutting down the ActiveMQ services and the Fanout driver.     2014-09-09 13:17:17 - The ActiveMQ flag is now set to 0.     2014-09-09 13:17:17 - Stopping the Fanout driver.     2014-09-09 13:17:27 - The script is now cleaning up the pid's.     2014-09-09 13:17:37 - The script is now archiving the ActiveMQ Logs.     2014-09-09 13:17:37 - No files older than 60 days.     2014-09-09 13:17:47 - The script is now starting the ActiveMQ services.     2014-09-09 13:19:57 - The ActiveMQ service is running,     2014-09-09 13:19:57 - The ActiveMQ Oracle service is running.     2014-09-09 13:19:57 - The ActiveMQ MSSQL service is running.     2014-09-09 13:19:57 - The ActiveMQ Queue Manager service is running.     2014-09-09 13:19:58 - Sleeping for 10 seconds before checking the status of the Fanout driver.     2014-09-09 13:20:09 - The Fanout driver successfully restarted.     2014-09-09 13:20:09 - End of script      Specifically I would like for the output to look like this, and not the all occurences as shown above.               2014-09-09 13:17:17 - Start of script     2014-09-09 13:17:17 - Reset script for the ActiveMQ.     2014-09-09 13:17:17 - The ActiveMQ flag is 1, shutting down the ActiveMQ services and the Fanout driver.     2014-09-09 13:17:17 - The ActiveMQ flag is now set to 0.     2014-09-09 13:17:17 - Stopping the Fanout driver.     2014-09-09 13:17:27 - The script is now cleaning up the pid's.     2014-09-09 13:17:37 - The script is now archiving the ActiveMQ Logs.     2014-09-09 13:17:37 - No files older than 60 days.     2014-09-09 13:17:47 - The script is now starting the ActiveMQ services.     2014-09-09 13:19:57 - The ActiveMQ service is running,     2014-09-09 13:19:57 - The ActiveMQ Oracle service is running.     2014-09-09 13:19:57 - The ActiveMQ MSSQL service is running.     2014-09-09 13:19:57 - The ActiveMQ Queue Manager service is running.     2014-09-09 13:19:58 - Sleeping for 10 seconds before checking the status of the Fanout driver.     2014-09-09 13:20:09 - The Fanout driver successfully restarted.     2014-09-09 13:20:09 - End of script      Thank you in advance for any help you can share!


What is the effect of setting immutable bit on /boot partition with perspective of security. is it **advisable** to set the immutable bit (`-i`) to everything under /boot? Will it enhance or degrade the system security? I would like to go further and do the same for other "precious" files like `/etc/bind/named.conf`, etc.


title: How to use Linux kernel driver bind/unbind interface for USB-HID devices?

text: First background. I am developing a driver for Logitech game-panel devices. It's a keyboard with a screen on it. The driver is working nicely but by default the device is handled by HID. In order to prevent HID taking over the device before my driver, I can blacklist it in hid-core.c. This works but is not the best solution as I am working with several people and we all have to keep patching our HID module which is becoming a chore, especially as it often involves rebuilding initramfs and such. I did some research on this problem and I found this mailing list post, which eventually took me to this article on LWN. This describes a mechanism for binding devices to specific drivers at runtime. This seems like exactly what I need. So, I tried it. I was able to unbind the keyboard from HID. This worked and as expected I could no longer type on it. But when I tried to bind it to our driver I get "error: no such device" and the operation fails. So my question is: How do I use kernel bind/unbind operations to replicate what happens when you blacklist a HID device in hid-core and supply your own driver? - that is - to replace the need to patch hid-core.c all the time? The source of our driver is here: https://github.com/ali1234/lg4l


title: FTPing to a remote directory

text: I need to connect to this ftp http://cdiac.ornl.gov/ftp/ndp026b/ and download the files. I did ftp http://cdiac.ornl.gov/ftp/ndp026b/ and it took the ftp prompt but once I entering commands for example `pwd`, it says `not connected`. How can I connect to this directory?


title: Automatic Startup of Oracle 11gR2 on CentOS 6.3

text: I've setup a handful of CentOS 5.6 servers with Oracle 11gR2 and not run into this particular problem, but I have hit a wall with CentOS 6.3 and auto- starting Oracle. Not sure if this is related to the newer release of CentOS or me having a PEBKAC moment, but I need a hand. I've got a working install of Oracle 11gR2 on CentOS 6.3. It runs and is functional. Now I just want it to start with the server. To that end, I've done the following things I usually do: Created /etc/init.d/oracle:               #!/bin/bash     #     # oracle Init file for starting and stopping     # Oracle Database. Script is valid for 10g and 11g versions.     # chkconfig: 35 80 30     # description: Oracle Database startup script          # Source function library.          . /etc/init.d/functions          ORACLE_OWNER="oracle"     ORACLE_HOME="/opt/app/oracle/product/11.2.0/db_1"          case "$1" in             start)                     su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"                     ;;             stop)                     su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"                     ;;             *)                     echo $"Usage: $0 {start|stop}"     esac      Than ran the following two commands:                 chmod 750 /etc/init.d/oracle       chkconfig --add oracle --level 0356      When I try a `service oracle start`, (as root) however, I get this error:               env: /etc/init.d/oracle: No such file or directory      Not sure how to figure out what file we're looking for. If I run that script's actual start command with the variables expanded the database starts with no errors.               su - oracle -c "/opt/app/oracle/product/11.2.0/db_1/bin/dbstart /opt/app/oracle/product/11.2.0/db_1"      So... what am I missing here? Some casual web searching makes me feel like this approach should still work.