title: mounting local network folder in Ubuntu

text: I add a folder in /etc/fstab:               //172.30.12.37/test/ /home/my/test cifs user=afs,pass=123456,auto,exec,umask=002,gid=1000,uid=1000,file_mode=0777,dir_mode=0777 0 0      Now test link can be seen in nautilus sidebar. But when I click on this icon, an error will be displayed:               mount: only root can mount //172.30.12.37/test/ on /home/my/test      How I can mount this folder from terminal with root user?


title: Sort one column only, keeping remaining columns untouched

text: How to (numerically) sort a specific column in a text file, without affecting other columns (irrespective of whether they are sorted or unsorted)? On other threads I found `-s` argument, but it does sort other columns. Observation               $ cat tmp.txt     1 1     2 3     5 4     1 3          $ sort -s -n -k1,1 tmp.txt     1 1     1 3     2 3     5 4


title: How to go back to original top panel in Debian Mint xfce?

text: Changes to the top panel in LMDE w/ xfce have corrupted the formatting; everything is flush left now. Unable to get the time, window switcher and other items to go flush right. How do I revert to the original panel layout so I can start over? PS: Do NOT use sudo prepended before Risto's steps below.


title: Bash variable in Awk script

text: I have this flat file database(ff_servers.db) with following contents:               192.168.154.2 Alaska   hp     192.168.157.3 Colorado dell     192.168.156.3 hawaii   hp      From command line, I could run:               awk "BEGIN{IGNORECASE=1;}/alaska/ {print $NF}" ff_servers.db`      and I would get               hp      However, from a bash script, I'm having problems with "$NF" Here's the dump of that script:               machine_type=`awk "BEGIN{IGNORECASE=1;}/${server_name}/ {print \$NF}" ff_servers.db`     awk "BEGIN{IGNORECASE=1;}/${server_name}/ {print $NF}" ff_servers.db     ++ awk 'BEGIN{IGNORECASE=1;}/colorado/ {print }' ff_servers.db     + target_arch='192.168.157.3   Colorado           dell'      So obviously, $NF is not being translated properly. Where am I doing wrong?


title: How to edit rpm's HEADER and NAME-VERSION-RELEASE

text: Is there's a way or a tool that can modify the `HEADER` and the `NAME-VERSION- RELEASE` for an existing `rpm` without installing/rebuilding it?


title: RHEL6 Install MySql-Python without internet connection?

text: Using RHEL 6 how can you install MySql-Python package without a internet connection? I can SCP files to the server but our current restrictions do not allow a direct or proxy connection to the internet from the RHEL server. It looks like it can be easily installed via YUM however YUM cannot update repositories without an internet connection.


title: Setting up a restricted NIS server

text: I'm currently trying to configure an NIS server with restricted access such that the `passwd` and `group` maps are exported to "trusted" hosts only. To this end, I have tried creating a netgroup (in the aptly-named file `/etc/netgroup`) containing the names of trusted hosts and I wanted to add a rule like               ALL:ALL EXCEPT @nis_netgroup      to `/etc/hosts.deny`. This has a double benefit for me: it restricts access to both the NIS maps and an NFS share. There are several issues with that approach, however, that I need help with:   * This is not very secure as host names can be easily spoofed   * The `yp` tools insist that the domain name for all my hosts is `.local`, regardless of the search domain I have set. So even if I had set up a domain like `.my.domain` and my NIS server was named `server` (so that its FQDN would be `server.my.domain`), after binding to that server, `ypwhich` would return `server.local`. So this requires me to set "strange" host names in the `netgroup` file.   * Even if I pass both of the above steps, _it doesn't work_ : the NIS server machine keeps trying to bind to itself and fails. The one clue I found in `/var/log/syslog` that could pertain to this problem:               named[<pid>]: bad zone transfer request 'local/IN'      What does this mean? I have administrated a similar setup in the past except that all clients were configured with static IPs so `/etc/hosts.allow` simply listed these IPs while `/etc/hosts.deny` would deny any other requests. The reason I can't use this approach in the current setup is that I'm using dynamic DNS with DHCP-assigned IPs for the clients. Is there a way to let host access be controlled via the dynamically assigned IPs (i.e. to do paranoid hostname-address lookups using the dynamic DNS)? The `hosts_access(5)` page says I can use a string starting with `/` to specify clients from a file so I thought I'd use that syntax in conjunction with my DNS zone file. No joy! The NIS server still fails to bind to itself under these circumstances. I'm not sure whether or not this is related to the `.local` domain issue (the DNS zone files obviously use the `.my.domain` domain not `.local`). Any help?


title: How to open and work with terminals using bash script?

text: I need to open four terminals each will then connect to four different remote pcs and open specific directory locations on those pcs. Each terminal will be opened in different locations on my pc's desktop screen. How this can be done using bash scripts? I am using Ubuntu-12.04. This would be a great help because everytime doing this is a overkill to me.


title: Attempt to fake a 2D multidimentional array in bash by storing the array name as string

text: I am trying to create a structure that will allow me to group data inside an array in bash Here is what I have tried:               indexes=()     first_element=( value='one' another_value='two' yet_another_value='three')     indexes+=('first_element')          second_element=( value='four' another_value='five' yet_another_value='six')     indexes+=('second_element')          for i in "${indexes[@]}"     do         # Here the i variable contains the name of the array I am supposed to loop through         # but I cannot fugure out how to access that array using the stored string...         for j in "${j[@]}"         do             #Here I am supposed to get the actually array             echo "$j"         done     done      Of course it doesn't work... Am I doing something wrong, or is it impossible to access variables that way?


title: How are the different kernel naming schemes relate?

text: I am running Ubuntu 13.10 with the Kernel 3.8.0-030800-generic downloaded from http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.8-raring/ When I want to run for example turbostat or cpupower commands, I get the following:               cpupower not found for kernel 3.8.0-030800     You may need to install linux-tools-3.8.0-030800-generic      Unfortunately there seems to be no package for linux-tools for this kernel available. I noticed that there are different naming schemes for the kernels, for example, the packages for linux-tools available here are following the naming: 3.8.0-{19-39} whereas the version of our kernel ends in 030800. How do these two naming schemes relate to each other? What is the correct way to install linux-tools for this kernel?


title: scan directories of .pdf and .ps files for keyword in title and author

text: I have got directories full of research papers. I would like to scan the files for keywords in the titles, the author lists, etc. Does a tool for that purpose exist?


title: Do IPTABLE rules apply to other devices on a network?

text: I have an embedded device that listens to a specific port to be programmed by vendor specific software. If I have a network that consists of a small linux computer and this industrial device would setting a rule that blocks access to the port block access to the industrial device as well?


title: What privileges are needed to delete a read-only btrfs subvolume?

text: I want to delegate non-root user to delete read-only subvolumes (snapshots). What exactly capabilities/rights I need to grant, so that he can remove his own read-only snapshots? I've already mounted the btrfs with `-o user_subvol_rm_allowed` so users can remove read/write snapshots. I need it to augment otherwise brillant SnapBtr.py, so non-root users can operate it.


title: Variable assignment outside of case statement

text: In many languages it is possible to assign the result of a case/switch statement to a variable, rather than repeating the variable assignment many times within the case statement. Is it possible to do something like this in the Bash shell?               color_code=$(case "$COLOR" in       (red)    1;;       (yellow) 2;;       (green)  3;;       (blue)   4;;     esac)      (Or, as an aside, in any other shells?)


title: Extracting a 2.7GB 7z file

text: I currently have a 2.7GB 7z file that backed up my computer (it extracts to about 6.2GB of data) I am running on a Chromebook with Crouton. The Chroot is running Kali with a Unity front end. I am trying to extract the 7z file using the p7zip package. I keep getting the following error.               (kali)austin@localhost:~/zip$ 7z x backup.7z          7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18     p7zip Version 9.20 (locale=C,Utf16=off,HugeFiles=on,2 CPUs)          Processing archive: backup.7z          Error: Can not open file as archive          (kali)austin@localhost:~/zip$       I figure I am either missing an argument or something and I realize this might be a localized problem, however I don't know where else to turn for help.


title: Run a script after lid is opened

text: I would like to run a script after my laptop lid is opened. is there anything like `rc.local` that is run after the laptop wakes up after suspending? I use Ubuntu 12 (I need it because some of the systems settings are reset after the lid is closed)


title: How does Grub boot off of a Windows partition?

text: I have a dual boot laptop that was built by Dell with Windows/Red Hat. The grub configuration says that it was made by Anaconda. The partitions are as follows:               /dev/hda1  Dell Utility     /dev/hda2  Windows 2000     /dev/hda3  extended (presumably Windows)     /dev/hda5  Linux [\]     /dev/hda6  Linux Swap     /dev/hda7  Linux [\home]      The bootable partition is /dev/hda2, the Windows partition. I get that the Dell Utility partition is booted by the BIOS, so I can ignore that. What I don't understand is how Grub (which is located, I assume, on hda5, which is where its configuration files are) is starting when the machine boots, since it must be booting /hda2, at least according to the BIOS.


title: Nice and child processes

text: Can someone tell me what the relationship between a specified `nice` level and child processes ? for example, if I have a default `nice` of `0`, and i start a script with `nice 5`, which in turn starts some child processes (in this case about 20 in parallel), what is the nice of the child processes ? Thanks,


title: Is the purpose of setting the version number of a file using chattr similar to optomistic locking in a database?

text: For instance if you record the version number before editing the file, and check it again before saving the file, you can be assured that nobody else wrote to the file while you were editing it. (although to be honest I don't see it changing the version number automatically when changing a file).


title: Script to extract selected entries from a bibtex file

text: I have a large bibtex file with many entries where each entry has the general structure               @ARTICLE{AuthorYear,     item = {...},     item = {...},     item = {...},     etc     }      (in some cases `ARTICLE` might be a different word e.g. `BOOK`) What I would like to do is write a simple script (preferably just a shell script) to extract entries with given AuthorYear and put those in a new .bib file. I can imagine that I can recognize the first sentence of an entry by AuthorYear and the last by the single closing `}` and perhaps use `sed` to extract the entry, but I don't really know how to do this exactly. Can someone tell me how I would achieve this? It should probably be something like               sed -n "/AuthorYear/,/\}/p" file.bib      But that stops due to the closing `}` in the first item of the entry thus giving this output:               @ARTICLE{AuthorYear,     item = {...},      So I need to recognize whether the `}` is the only character at a line and only have 'sed' stop reading when this is the case.


title: Finding all files containing a word and then counting the number of lines

text: I need to recursively find all files that contain a specific word and if the word exists in file I need to find out the number of lines in that file. I have been trying to use `grep` but I have been not successful so far.


title: Granting permission for all users in a group to write to a directory and all its subdirectories

text: Trying out Linode for the first time, running an Arch Linux image, I successfully installed nginx as root. This, however, made `/usr/share/nginx/html` inaccessible to non-root users. Intuitively, I thought this would work:   * `newgrp www` (create a new group)   * `chgrp -R www /usr/share/nginx/html` (associate directory recursively with new group)   * `chmod -R g=rw /usr/share/nginx/html` (give read-write permissions to new group)   * `usermod -a -G www john.doe` (add non-root user to new group) However, I still could not write files to `/usr/share/nginx/html` as john.doe. I also tried   * `chown -R :www /usr/share/nginx/html` to see if it had any effect—it didn't. Here's what the setup looks like currently:               [john.doe@hydrogen nginx]$ ls -l     total 4     drwxrw-r-x 4 root www 4096 Dec 19 08:10 html     [john.doe@hydrogen nginx]$ id     uid=1000(john.doe) gid=100(users) groups=100(users),10(wheel)     [john.doe@hydrogen nginx]$ groups john.doe     wheel www users      Could someone kindly identify what I'm misunderstanding / missing that I can't write to this directory?


title: How to install multiple packages via pacman in a single command?

text: Is it possible to install multiple packages via a single pacman command? E.g.               Pacman -S package_1,package_2


title: How to show specific lines from specific columns of a file

text: First off, I'm not allowed awk, sed or perl. For my assignment I was given a file of employee list:               Marketing  Ranjit Singh   FULLEagles       Dean Johnson        Marketing  Ken Whillans   FULLEagles       Karen Thompson      Sales      Peter RobertsonPARTGolden TigersRich Gardener       President  Sandeep Jain   CONTWimps        Ken Whillans        Operations John Thompson  PARTHawks        Cher                Operations Cher           CONTVegans       Karen Patel         Sales      John Jacobs    FULLHawks        Davinder Singh      Finance    Dean Johnson   FULLVegans       Sandeep Jain        EngineeringKaren Thompson PARTVegans       John Thompson       IT         Rich Gardener  FULLGolden TigersPeter Robertson     IT         Karen Patel    FULLWimps        Ranjit Singh         Long story short, the user is prompted to give a name or portion of a name and that word is searched for ONLY in the second 'column'. If it is found there then the user is then asked whether they want the person's team-name (third column, word next to "PART" or "FULL" etc.) or the person's partner (last column). The end result is then only to show the full name alongside the team name or partner. I can't figure out the last step... Cutting only the lines with the matches to the original search and displaying only the needed 'columns'.               while :     do         echo Enter the name of the player you want to search for:         read name         if (cut -c12-26 emplist | grep -n ${name} > namefile)         then             while :             do                 echo 'See partner (P/p) or team name (T/t)?'                 read answer                 if [ ${answer} = "T" -o ${answer} = "t" ]                 then                     **#Steps for showing only the full name and the team name**                      break                 elif [ ${answer} = "P" -o ${answer} = "p" ]                 then                     **#Steps for showing only the full name and the partner name**                     break                 else                     echo Please enter only T or M.                 fi                 done         elif [ ${name} = "ZZZ" ]         then             break         else             echo Name not found.         fi     done


title: Script running forever

text: could you please provide me insight on why the following script runs forever even after last echo statement ran successfully? Thank you for your help.               cd /app/pme/${property:DeployEnv}/ruleengine     ./stop.sh     unzip -o ruleengine.app.zip     unzip -o ruleengine.${property:DeployEnv}.zip     dos2unix *.sh     echo begin chmod     chmod ugo+rx *.sh     echo end chmod     echo begin run.sh     ./run.sh     echo end run.sh     cd /app/pme/${property:DeployEnv}/ruleengine     pwd     echo start rm commands     rm ruleengine.app.zip     rm ruleengine.${property:DeployEnv}.zip     echo end rm commands     exit


title: Symbolic link permissions

text: I have access to a remote Linux machine where everytime I create a symbolic link, it is created by default with the following permissions: `lrwxrwxrwx` If I try to change the permissions of the symbolic link (i.e. not the path that it points to) using for example:               chmod g-w my_symbolic_link      `chmod` runs correctly (no error message is printed) but when I check the permissions again, they are still the same (`lrwxrwxrwx`). I am waiting to hear from the machine administrator, but I was wondering if this is normal behavior, or if it is something specific to the box. Thanks


title: Hide top and bottom menus from Midnight Commander

text: Can I hide top ("File", "Options", etc) and bottom ("Help", "View", "Edit", etc) menus from Midnight Commander? If so, how can I do it?


title: listing package dependents

text: I stupidly did "yum remove python" which also ended up removing all the packages that required python as well. Luckily, I have access to another Linux machine that is a near clone of this machine, and it still has all those packages installed. The catch is that it belongs to someone else and I can, at most, poke around. I also don't know what to specifically re-install on my machine. The list (when I removed python) was humongous. I was wondering if there were any commands I could enter into this twin machine that could tell me: Of the currently installed packages, which ones depend on python? I could then use that list to manually re-install each one back on my own machine. So it's really more of the python dependents, not dependencies. From looking around, I came across such commands like "repoquery --whatrequires" & "rpm --whatrequires", but these don't seem to generate the same list as "yum remove python". The 2 machines run RHEL 6.


title: Is there a good way to poll in a real-time process which is kernel friendly?

text: I have an application which uses boost asio and I would like to use `poll()` to detect ready network events (packets) and process them as quickly as possible. Additionally, I would like to use SCHED_FIFO for this process (which is single threaded) try to control the jitter (main problem I'm trying to solve..) Now the limitation, the kernel is 2.6.32 (without real-time patch.) Which has the additional problem that there are some kernel processes which run on the core where my app is running which I cannot move out (i.e. the kernel doesn't appear to have true isolation - I know this comes in a later kernel - but I can't upgrade to that yet.) So, now if I'm unfriendly, and I do the following:               while(some_condition)       service.poll();      This process will spin the core, and because SCHED_FIFO is set, it will never relinquish to the other kernel processes that need to run on this core, and all sort of unpredictable bad stuff happens. Now my question is, how I can do this poll loop and ensure that I relinquish so that the other threads get to run for a little bit at least? I see two options,   1. Some sort of sleep   2. if no events were handled by `poll()`, I could call `run_one()` which blocks for one event only, but the problem here is that this event could be the packet I want, and now I have jitter again... Have I missed any other approaches?


title: How can I paste (overwriting) with vim?

text: In `vim` I use `yy` and `p` all the time to yank and paste lines. However, if I want to replace one line multiple places in the file, I can't use `yy` `p` `dd` `p` because the `dd` deletes the line to the clipboard / register. While I should probably know how to use registers better, i feel like there is probably a way to `p` that replaces the current line. Google wasn't much help in finding anything, and the VIM tutorials I found did not cover this. I just ordered a book from amazon but I hope someone can let me know before it gets here ;)


title: Worker MPM or Prefork?

text: I understand that there is a comparison topic between the two modules but this is different. I was contacting cPanel support in order to help me freeing up some memory usage on the VPS. They found Apache 2.4 'httpd' child processes are using approximately 80MB RSS, while on their test server, a similar Apache 2.4 build only uses approximately 3MB RSS per Apache child process. After discussing the issue for a while, they suggested switching to the Worker MPM in Apache 2.4 rather than using Prefork. I searched for what they said, and found that Worker MPM use a less memory but it is not thread safe. Some other topics on websites tell that Worker will not work with php applications or mod_php. I'm not sure if this is correct or not. I'm too confused what should I do? I have php scripts running on my accounts and don't want to interrupt any of them or get data corrupted. What are your suggestions guys? Does switching to Worker MPM will solve the problem of running out of memory without interrupting php applications? Is there any solution regarding the Apache usage? As 80MB RSS is too high comparing to the 3MB RSS.


title: to run script over several folders?

text: Currently I have a script that can run only in a single folder.               #!/bin/bash     for file in ls -1 *.jpg|sort -t . -n -k 3     do       echo "compute ./scripName $file"       ./scriptName $file     done       Question: I have a several folders containing `*.jpg` images. I need a script that can over all images of all folders.


title: Log in with specific shell at terminal login

text: If I log in to a system over ssh, I can use the default shell with a simple `ssh user@host`, or specify something like `ssh user@host 'bash --norc --noprofile'` or `ssh user@host ksh`. Is it possible to have similar behaviour when logging in on a local terminal, ie one where my terminal is connected directly to the system and I'm prompted for a username? The specific usage scenario is running `screen` at login time, where a duff config option will prevent screen starting, and thus prevent the login succeeding. If I have ssh access, I can log in and run specific commands to fix things, but if I only have terminal access, I can't see how I could fix things up.


title: How to install Debian from USB? (Using full size image not netinstall)

text: I learned of a way to install Debian from USB using the netinstall image, which is fine. However it means I have to spend hours and hours downloading packages to do the install. Is there a way I can simply download (for example) the CD1 with most of gnome and then use that? The netinstall method using this does not work because there is not enough space. (I have enough space, it is that the method has a limitation). I rarely have CDs on hand and some machines do not have CD/DVD drives anyway. I will research on this topic and answer my own question if need be, however any help in the meantime is appreciated.


title: Starting Darkice automatically via daemontools

text: I have installed and configured darkice in Raspbian and it works fine if I run it with "sudo darkice". I want to run darkice automatically so I tried to run it via daemontools with the following steps but it is not working. please help.   1. open a shell to your server, and type the following:              apt-get install daemontools     apt-get install daemontools-run     mkdir /etc/service/darkice     chmod 2775 /etc/service/darkice     touch /etc/service/darkice/run        2. `vi /etc/service/darkice/run` and add these lines:              #!/bin/sh     echo Running service     exec darkice


title: Cannot open shared folder under Debian (VirtualBox)

text: There is a virtual machine under Debian 7.1.0 Wheezy i386 (guest). Host is Linux Mint 12. The shared folder is set up with auto-mount, but it doesn't appear in `/media` directory, as said in the user manual. There are no analogous problems in Linux Mint 13 (another guest), the folder appears normally in `/media`. I have installed `build-essential` and `module- assistant` and ran `VBoxLinuxAdditions.run` from VBoxGuestAdditions but nothing is changed.


title: Restructuring directories into a hierarchy

text: I have the following type of folder structure containing thousands of folders. The folder names are as such with different names etc               .test     .test.subfolder     .test.subfolder.subsubfolder          .folder     .folder.one     .folder.two     .folder.one.one      What I need to achieve is the following: I want the folders to be renamed e.g. from `.test` to `test`, and then move `.test.subfolder` so that the folder `.subfolder` is within the folder `test` without the `.`, and then `.test.subfolder.subsubfolder` so that `subfolder` is within the folder `test` and `subsubfolder` is within `test/subfolder`. This needs to be recursive since there are many folders. Keep in mind that the files within the folders should still need to be intact. Is this at all possible?


title: Get all regex matches between two patterns and print them to file

text: I've got a file with a bunch of long lines. I'd like to grab every group between two patterns and print them to a new file, one match per line. I could manage to do this with Python, but I'd prefer using just command line tools for this task. If there is no end pattern, I'd like to grab everything 'till the end of the line. Something like:               input:      xxSTART relevanttext xxEND something else xxSTART even more relevant          output:     relevanttext     even more relevant


title: Deamon openvpn configuration file with .conf?

text: In the video connected to a Linux to another Linux via SSH, the second openvpn daemon already started and configured with user/password requested at the entrance. http://youtu.be/tSNCE6j2zxM How do I configure OpenVPN daemon to get it already started and configured with user / password automatically? What are the directories to move? Commands?


title: Kate editor: how to jump to modified lines?

text: Say I'm editing a long document and I have made a number of changes. I want to be able to jump to each changed line. Is there a way to do this? I know about line modification indicators and I have those turned on. But for a long document, it is not easy to find those line modification indicators. I want a way to jump directly there. I turned on scroll bar marks. I'm not sure what that feature is supposed to do, but it doesn't seem to do anything.


title: yum update version issue

text: I am using fedora 13 (2.6.33 ). Due to some reasons I cannot update the kernel nor can I upgrade fedora itself to 18 due to some legacy software I am using for business purpose. So my question is how do I update my applications to the latest versions using yum without actually updating the kernel/distro. For eg when I               yum update firefox      It shows me the firefox version 3.x. instead of 19.0. I have the option to download the binaries from website but for some applications I manually have to resolve the dependency issue. So how do I temporarily set my source to fedora 18 source for some specific application.


title: Where is the cron timer

text: Is there any way to access the `cron` timers and get the seconds left until the next execution of scripts in the `crontab` or maybe the seconds since the last?


title: How to specify the inbox for fetchmail?

text: I'm setting up a system calling `fetchmail` from the commandline and specifying that the mail be stored in a specific file which is not `/var/spool/mail/$USERNAME`.


title: Command line friendly spreadsheets

text: Does such a thing exist? Text-based spreadsheets that display well in a CLI environment. I'm aware that I could `cat foobar.csv`and do as I please, but it isn't particularly practical or attractive. I cannot imagine it would be hard to format a table, and maybe follow certain rules (math?) as well. Emacs has `org-mode` which handles text-based tables quite well, and allows exporting to multiple formats. However, one must use Emacs! Which as a Vim user I would prefer to avoid.


title: OPENVPN AS - Could not connect to the test server on the Internet

text: I have set up OpenVPN on my server and I can access it through Tunnelblick. I am however having issues to set up OpenVPN Access Sever. After Install I noticed that in the server name field there was my server internal lan address so I changed it to the public ip. After this I tried to connect but the connection drops. I tried to run the Connectivity Test but no luck and all I get is the following... Test Results for TCP               Result: Error     Explanation:    Could not connect to the test server on the Internet.     IP Address Tested:  (not found)     Reverse DNS result: (unknown)      Test Results for UDP               Result: Error     Explanation:    Could not connect to the test server on the Internet.     IP Address Tested:  (not found)     Reverse DNS result: (unknown)


title: Using regular expressions with cp

text: This is a simple question. I'm trying to copy all of the files in the current directory that start with "axis-2" and end with ".jar" into a target directory, let's say it's ~/MyDirectory. My first thought was to try               cp '^axis2.*jar$' ~/MyDirectory      But this isn't working. I'm not even sure I can use regular expressions with cp. I also haven't really used regular expressions in a while and my syntax could be totally off. When I try this cp just outputs a "No such file or directory" error message. Does anyone have any suggestions of how to go about this? Thanks!


title: Can Qt SDK be used for development on any Linux distro?

text: Fisrt of all I am a Windows developer guy but really like Linux. On Windows, Visual Studio provides an excellent IDE for C and C++ development. The only other IDE and toolkit I like is the Qt SDK and I've used it a bit on Windows. I currently run Linux in a VirtualBox VM on Windows 7 so that I can mess around with it fearlessly. I have a KDE-based Kubuntu 11, which is quite heavy. I also have an Xfce-based Xubuntu 11 VM (which I like) and Linux Mint 11. I want to delete the Kubuntu VM but KDE is based on Qt, and the other distros I have use gnome/GTK+. Would Qt on a Gnome-based distro be any different than using it on a KDE-based distro?


title: Enforce strict outbound ports (or ranges) for protocol

text: Is it possible to narrow the allowed range of outbound ports that can be used for a specific protocol (e.g. HTTP(S))? I understand that, by default, the system will randomly allocate any available port but is that configurable to use a specific one?


title: UNIX- Identify which processes are running more that 6hours

text: I need to know which processes are running more than 6 hours in UNIX. How can I find those out?


title: How do Apache2 VirtualHosts get resolved?

text: As I understand it, when you request a url from a website using your browser, it asks the DNS server that the OS is pointing at if it knows the ip address that relates to the dns-name of the server; then if the DNS server finds the server requested, it returns the ip so that the browser can request the url from the webserver. Considering at this point that the browser requests the URL using the ip address of the server and not the dns-name, how does the webserver (Apache2) know how to return correct VirtualHost, that is associated with the dns-name? My head tells me that it has something to do with the browser headers, but I'm not completely certain of this. **Note:** Here's a related solution


title: How to transparently monitor SSH access/network traffic in Gentoo/general linux?

text: What's the most effective way to monitor SSH access in Gentoo Linux? My Gentoo box is operating locally behind my broadband router. I have SSH port forwarding on the router and a DNS entry pointing to my router on the internet. Is there a way to silently record what external domain/IP the incoming connection to my Gentoo box comes from? Similarly what's the best method of recording all network traffic to and from this box, again without being noisy about it?


title: Navigate through a stack of locations in vim?

text: Typing ```` at location X brings you back to the last visited location in the text file. Hitting it again brings you back to X This switching is similar to `Ctrl+6` to open the last opened file. But how do can I hop several levels of locations backwards (and then forward)? I mean something like the `Ctrl+]` and `Ctrl+T` feature for navigate through the stack of visited tags.


title: Touchpad won't work after login

text: Everytime I start my computer, when it gets to the login part of GUI, my touchpad works except I cannot turn it off using `Fn``F3` (I'm using a Dell inspiron n4120). Soon after I log in, the touchpad fails to recognize any input. I have checked and my OS (Fedora 15) does recognize the touchpad using the command:               xinput --list


title: How do I install user theme extension in Gnome in Fedora 16?

text: Upon going to the user themes extension webpage, I get the following message:               This extension is incompatible with your version of GNOME. This extension supports the GNOME unstable release, 3.3.2      I have Gnome Version 3.2.1 according to System Info. So how would I go about installing the lastest unstable Gnome releases? **EDIT** : I am running Fedora 16 **EDIT 2** : I would like to know if there is a repository to be installed so that I can simply `yum update` to the latest Gnome development version (downloading and installing gnome-shell-3.3.3 from here or here gives me an error with a list of dependencies yet to be satisfied) **EDIT 3** : I remember successfully installing gnome-shell-extension-user- theme via yum a few months ago that worked just fine with Gnome, anybody know how to install an older version of the extension that is compatible with Gnome 3.2?


title: Starting syslog-ng

text: I've recently installed syslog-ng but am confused about how to start it (on Fedora). I do:               /etc/init.d/syslog-ng start       which reports that it's started ok. However, it doesn't actually do anything until I do:               /sbin/syslog-ng      at which point it starts behaving as I'd expect. Is this expected behaviour?


title: Nested virtualization: run RHEVH inside KVM

text: I have laptop with 16GB RAM, trying to install Red Hat Enterprise Virtualization Hypervizor 3.3 on Virtual Machine Manager (KVM) based Guest, but it gives error "Virtualization Hardware not found" ? What's possible solution for this error? ? Like in Oracle VM Box there is a option to enable support for Virtualization for Guest machine, is there anything like same in Virtual Machine Manager? Is it possible to test RHEV 3.3 on any of the virtualization like KVM, Oracle VM Box or VM Ware Workstation 10?


title: Access to the files beyond Wine's virtual disks

text: I'm totally new to Linux. I would like to know if the executables run through Wine have any access beyond the virtual drives provided by Wine (e.g. `C:/`, `D:/`)?


title: What commands should be run when retiring a remotely hosted server?

text: I have a dedicated server from a friendly host located a substantial distance away from me, so the only access to the machine is SSH. It's a month to month deal, so I don't own the hardware. I'm migrating everything to a new server, and I was thinking that it would be possible for the next tenant to get creative with data recovery utilities and recover my data that was previously stored on the same hard drive. What commands, if any, should I run on a dedicated server to "back out" of the server with a reasonable attempt at protecting any data that was on it? The server is your typical LAMP variety.


title: How to sign already built Debian package?

text: I have a project with a custom build-system, so the Debian package is just one of a targets: I do it with `dpkg-deb`. But now I want to upload my package to some enterprise repo - and I need some files like `.dsc` and `.changes`, also they should be signed with PGP. What is the easiest way to sign already built package and generate those files?


title: Fedora 16: keystroke only get beep sound and doesn't work

text: I'm using my laptop and suddenly the keystroke doesn't work anymore. When I press the keystrokes, it produces beep sound but doesn't work. Then I notice if I keep on pressing the same keystroke for several seconds, it will work. On command-line environment, it works fine, but in GNOME, it works as above. What is wrong with this? The version is Fedora 16 x86_64


title: Replace all the occurences of a term in the files contained in a folder

text: In a folder on my system, I have a `C++` project that I'm trying to compile. This process uses some `C++` idioms which are not supported by my compiler version. In particular, often inside the code it is used the data value `'nullptr'`. What I want to do is to replace all occurrences of `nullptr` with `NULL`. I can do this in `VIM` with the command:               :%s/nullptr/NULL/g       How can I do this for all the files in a directory once, without opening each file and executing the command?


title: What is kondemand?

text: I have searched the web for the answer of this question but couldn't find a clear answer. Best answer I found was as follows: > kondemand is a kernel thread that belongs to the ondemand governor of > cpufreq subsystem, which changes the p-states of the system, based on the > utilization statistics. Thus it’s something that helps in power management. But still there is uncertainty about the meaning **in what way kondemand helps power management** or **is it really a process/thread concerning with power management?** Can someone please explain it?


title: using tr -t command [comprehension question]

text: When using `tr -t` command, `string1` should be truncated to the length of `string2`, right?               tr -t abcdefghijklmn 123          # abc... = string1, 123 = string2     the cellar is the safest place    # actual input     the 3ell1r is the s1fest pl13e    # actual output      'to truncate' is another word for 'to shorten', right?`tr` translates, according to the pattern, completely ignoring the `-t` option. If I autocomplete to `--truncate-set1` [to assure that I use the correct option] produces the same output. **Question** : what am I doing wrong here? I work in BASH, on a Debian based Distro. **UPDATE** _Please note that this is a copy of a comment I made below_ I thought `tr -t` means: _shorten string1 to the length of string2_. I see that `a` is translated to `1`, that `b` would be translated to `2` and that `c` is translated to `3`. This has nothing to do with shortening. 'To truncate' seems to mean something different than I thought. [I'm no native speaker]


title: Deleting a pattern from a file and appending it to the end?

text: I have a log file which have contents like below:                #SOME MORE DATA      These switches don't have latest images :     SWEs-elmPCI-A-01#      #SOME MORE DATA          These switches don't have latest images :     SWEs-elmPCI-B-01#      #SOME MORE DATA         These switches don't have latest images :     SWEs-elmPCI-C-01#      #SOME MORE DATA          These switches don't have latest images :     SWEs-elmPCI-D-01#      #SOME MORE DATA         These switches don't have latest images :     SWEs-elmPCI-B-01#      #SOME MORE DATA       I want to delete all such lines from the file and append it to the end of the file in a way such that it becomes like :               #ALL the remaining data at top     These switches don't have latest images :     SWEs-elmPCI-A-01#     SWEs-elmPCI-B-01#     SWEs-elmPCI-C-01#     SWEs-elmPCI-D-01#     SWEs-elmPCI-B-01#      I am thinking of using `sed -n '/These*/{n;p}'` but still unable to achieve the result. NOTE : SOME MORE DATA means more content in the file and these types of lines could be any where in the file               These switches don't have latest images :     SWEs-elmPCI-B-01#


title: Ubuntu 11.04 and large external drives

text: I have a Hitachi USB external 3 terabyte drive attached to a Dell Precision T1500. When connected to the computer running Ubuntu 11.04 (2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:17:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux) the following appears in the logs:               [1636365.665558] usb 2-1.7: new high speed USB device using ehci_hcd and address 15      [1636365.813198] scsi18 : uas      [1636377.895182] scsi 18:0:0:0: Direct-Access     Hitachi  Hitachi HDS72303 A580 PQ: 0 ANSI: 4      [1636384.388480] scsi 18:0:0:0: uas_eh_abort_handler tag 0      [1636384.388485] scsi 18:0:0:0: uas_eh_device_reset_handler tag 0      [1636384.388487] scsi 18:0:0:0: uas_eh_target_reset_handler tag 0      [1636384.388489] scsi 18:0:0:0: uas_eh_bus_reset_handler tag 0      [1636384.468415] usb 2-1.7: reset high speed USB device using ehci_hcd and address 15      [1636384.609589] scsi 18:0:0:0: Device offlined - not ready after error recovery      [1636384.609649] scsi 18:0:0:0: rejecting I/O to offline device      [1636384.609663] scsi 18:0:0:0: rejecting I/O to offline device      [1636384.610978] scsi 18:0:0:1: Enclosure         Hitachi  SES              A580 PQ: 0 ANSI: 4      [1636384.611472] scsi 18:0:0:2: uas_eh_device_reset_handler tag -1      [1636384.611477] scsi 18:0:0:2: uas_eh_target_reset_handler tag -1      [1636384.611481] scsi 18:0:0:2: uas_eh_bus_reset_handler tag -1      [1636384.707808] usb 2-1.7: reset high speed USB device using ehci_hcd and address 15      [1636384.838735] scsi 18:0:0:2: Device offlined - not ready after error recovery      [1636384.838952] sd 18:0:0:0: Attached scsi generic sg4 type 0      [1636384.839029] ses 18:0:0:1: Attached Enclosure device      [1636384.839080] ses 18:0:0:1: Attached scsi generic sg5 type 13 [1636415.301027] sd 18:0:0:0: uas_eh_abort_handler tag 0      [1636415.301036] sd 18:0:0:0: uas_eh_device_reset_handler tag 0      [1636415.301042] sd 18:0:0:0: uas_eh_target_reset_handler tag 0      [1636415.301046] sd 18:0:0:0: uas_eh_bus_reset_handler tag 0      [1636415.381053] usb 2-1.7: reset high speed USB device using ehci_hcd and address 15      [1636415.522005] sd 18:0:0:0: Device offlined - not ready after error recovery      [1636415.522080] sd 18:0:0:0: rejecting I/O to offline device      [1636415.522093] sd 18:0:0:0: rejecting I/O to offline device      [1636415.522101] sd 18:0:0:0: rejecting I/O to offline device      [1636415.522107] sd 18:0:0:0: [sdc] READ CAPACITY failed      [1636415.522110] sd 18:0:0:0: [sdc]  Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK      [1636415.522116] sd 18:0:0:0: [sdc] Sense not available.      [1636415.522123] sd 18:0:0:0: rejecting I/O to offline device      [1636415.522129] sd 18:0:0:0: [sdc] Write Protect is off      [1636415.522133] sd 18:0:0:0: [sdc] Mode Sense: 00 00 00 00      [1636415.522139] sd 18:0:0:0: rejecting I/O to offline device      [1636415.522144] sd 18:0:0:0: [sdc] Asking for cache data failed      [1636415.522147] sd 18:0:0:0: [sdc] Assuming drive cache: write through      [1636415.522355] sd 18:0:0:0: [sdc] Attached SCSI disk      From what I've found in the Internet it may be tied to having a partition larger than 2 TB. I connected the drive to an Windows XP system and split the drive into two NTFS partitions, 1.5 TB each. It currently has a GUID partition table. I've tried using gdisk to see the drive but Linux isn't acknowledging that the drive is in any way usable. It seems to work under Windows and OS X, though (or at least it's seen by the utilities for formatting and partitioning under those OS's...) Am I missing something simple here to get it to work properly under Linux?


title: Centos/RHEL 5.5/5.6 supported SCSI adapters

text: We have a batch of SuperMicro 6014H-82 servers that have Adaptec 2015S SCSI controllers fitted. Unfortunately, according to the bug tracker (0002087: CentOS installer won't detect harddrives) it looks like in Centos 5.5 and 5.6 support for this is broken in some way. The issue is tagged with "To be fixed in 5.6" but it isn't (we were unable to get Centos 5.5 or 5.6 to install). There is a workaround described in this bug report involving Centos 5.4 but we tried and failed (with Centos 5.5 and 5.6). Also, even if it did work, I'm not comfortable with this because it is really just a hack. I happy enough to buy new controllers for these boxes but I'm having a tough time finding out which controllers actually work with Centos 5.5 or 5.6 that have U320 + RAID5 support. I've visited multiple vendor sites but in most cases their supported OS versions are a bit vague. **Does anyone know of a reliable HCL for Centos 5.5/5.6 or RHEL 5.5/5.6** or can tell me what U320 SCSI controllers with RAID 5 support can be used with Centos/RHEL 5.5/5.6? I've spent the last two days researching this and come up with nothing.


title: Home Directories and pam.d using LDAP

text: Background:   I'm not too familiar with the ins and outs of pam and LDAP authentication on a configuration side. I've used systems that use pam but I've only worked on applications, not systems themselves. Questions:   Using pam to control authentication via LDAP, does this mean that a home directory will not be created on the system? If not, would I create users on the server or somehow push users to the system from an LDAP source?


title: Delete a matching line in a file doesn't work

text: So, I have this piece of a code:               while read line              do                 if [ $line = $maddr ] ;                 then                     sed -i '/${maddr}/d' mailinglist                     found=true                     break                      fi             done < mailinglist      If the read line matches my variable (a string) then delete the whole line. When it didn't work, I tested it with the flag **-x** , the pattern is found and it enters the if cycle, it even does the sed command, but the line stays there. (I create the "mailinglist" file in the script, so I thought, maybe it didn't have write permission, but I checked it and as far as I can tell, I do have the permission - I basically don't change anything about permissions in the script). I believe the sed command there is right (I have to edit the file and save it right away). Can you help me?


title: ls, regexp and environment variable

text: I wanted to declare an environment variable that stocks all the extensions of video files so I can use it when using the shell. I tried several things but never got it to work: If in my .bash_profile I put:               export VIDEOS={mp4,wmv,avi,flv,mkv,m4u,mpg,mpeg}      it only takes the last element:               [nbarraille@nbarraille ~]echo $VIDEOS     mpeg      If in my .bash_profile I put:               export VIDEOS="{mp4,wmv,avi,flv,mkv,m4u,mpg,mpeg}"      or               export VIDEOS='{mp4,wmv,avi,flv,mkv,m4u,mpg,mpeg}'      Then, when I display it it looks OK, but it doesn't work when I use it in a ls for example:               [nbarraille@nbarraille ~] echo $VIDEOS     {mp4,wmv,avi,flv,mkv,m4u,mpg,mpeg}     [nbarraille@nbarraille ~] ll *.$VIDEOS     ls: cannot access *.{mp4,wmv,avi,flv,mkv,m4u,mpg,mpeg}: No such file or directory      And when I run the exact same command without using the variable, it works:               [nbarraille@nbarraille ~] echo *.{mp4,wmv,avi,flv,mkv,m4u,mpg,mpeg}     example.avi     example2.mpg      Also, when I reboot, it looks like my .bash_profile is not loading, and the $VIDEOS variable is empty. I have to do a `source ~/.bash_profile` in order to get it to work (and I have to redo so every time I open a new terminal. Any idea? Thanks!


title: What port range will ipfw nat use for aliasing?

text: I am using `ipfw nat` with the following config               ipfw -q nat 1 config if em0      Which TCP and UDP ranges will the NAT choose its alias ports from? I would like it to be always from the range 49152–65535, so that I can do:               add allow tcp from any to me 22     add allow tcp from any to me 80     add deny tcp from any to me 1-49151     add nat 1 tcp from any to me recv em0 established      Does `ipfw` support this easily? If not, is there some way I can enforce this behaviour?


title: How to manually manage grub.cfg for Grub2?

text: I am setting up my system. The features of it are:   * GPT partition table (not sure how important this is)   * Triple boot - Gentoo, Debian and Mint.   * Custom kernel (kernel git repo) shared amounst distros. Now I am wanting to write my own lines for grub and not have the distros place their own lines in grub. I also don't really want one distro to have the role of creating the grub.conf file. As **everybody** is advocating the scripts, there is no one mentioning about hand crafting one. I am fairly sure editing it by hand is safe, so long as I make sure no script touches it. Another solution that I might be forced into is to configure every distro the same way (no kernels in menu, keep the custom config synced between distros), or just use one distro to manage the boot. How should I implement this?


title: Looking for X terminal with correct window resize handling

text: Is there any X terminal program, which reflows the content when I'm resizing the window? Gnome-terminal and Sakura does it well _halfway_ : when I'm shrinking the window and re-expanding it, the stuff comes back to the right side of the screen as I want: _Opening a big window:_               line 1 abcdefghijklmnopqrstuvwxyz       | right margin     line 2 abcdefghijklmnopqrstuvwxyz       |       _Shrinking it:_               line 1 abcdefghijklm | right margin     line 2 abcdefghijklm |      _Resizing to original (gnome-terminal, sakura), that's what I want to see:_               line 1 abcdefghijklmnopqrstuvwxyz       | right margin     line 2 abcdefghijklmnopqrstuvwxyz       |      _Resize to original (xterm, lxterm, PuTTY/win32), I don't like this:_               line 1 abcdefghijklm                    | right margin     line 2 abcdefghijklm                    |       That's okay, some terminals works well, others not. But when I'm opening a small window and expand it, all terminals works the same way: the lines remain wrapped at the left side, instead of re-flowing and re-wrapping: _Small window (line 1 and 2 just ran out of window):_               line 3 abcdefghijklm | right margin     nopqrstuvwxyz        |     line 4 abcdefghijklm |     nopqrstuvwxyz        |      _Resize to larger:_               line 3 abcdefghijklm                    | right margin     nopqrstuvwxyz                           |     line 4 abcdefghijklm                    |     nopqrstuvwxyz                           |      **What I want to see instead:**               line 1 abcdefghijklmnopqrstuvwxyz       | right margin     line 2 abcdefghijklmnopqrstuvwxyz       |     line 3 abcdefghijklmnopqrstuvwxyz       |     line 4 abcdefghijklmnopqrstuvwxyz       |      Is there a chance to get this result? (I'm using Ubuntu with LXDE, if it matters).


title: A question about permissions of hierarchical directories

text: I have some directories, with following permissions:               drwxr-xr-x 18 user1 root 4096 Oct 27 11:25 /home/test1/test2     drwxr-xr-x 24 user1 root 4096 Oct 21 08:38 /home/test1     drwxr-xr-x 492 root root 12288 Nov 17 01:31 /home     drwxr-xr-x 23 root root 4096 Nov  6 18:46 /      My question: If I understand right, permission of `/home` says that only root can add/delete files (or directories) in this directory, but then there's the directory `test1` which has `user1` as its owner. That means that user `user1` can add/delete files (or directories) in `/home/test1`. Does this mean that directory permission of `/home` is only valid till its immediate children and not its all descendants (grandchildren and so on)? And it must be only root who let `user1` be the owner of its child `/home/test1` and from then on, `user1` can control owners of its children (and all descendants)?


title: How to timestamp a transcripted talk?

text: I'm trying to mark each paragraph of transcripted text with timestamps of when/where it occurs in the audio. `mplayer` and `emacs` are getting me close. `mplayer`, in the terminal, outputs a stream of suitable time info; eg. (command and sample log)               mplayer au-file 1>event.log 2>&1          A:   0.8 (00.7) of 3207.0 (53:27.0)  0.1% [J     A:   0.9 (00.9) of 3207.0 (53:27.0)  0.1% [J     A:   1.0 (01.0) of 3207.0 (53:27.0)  0.1% [J      Certain un-bound keys (eg, `F12`) can be used to flag an event in the log-- specifically for the start of a paragraph.               xdotool key --window $termID F12          A:   3.1 (03.0) of 3207.0 (53:27.0)  0.1% [J     No bind found for key 'F12'.                              A:   3.2 (03.2) of 3207.0 (53:27.0)  0.1% [J     A:   3.3 (03.3) of 3207.0 (53:27.0)  0.1% [J      The above works fine. The next thing it needs is line numbers to be injected into `event.log`. I will probably use `emacs` to trigger both these events from within `emacs`, by binding a key to read the current `point` position and appending it to the log. Yes, your guessed it, I have a problem. It seems that `mplayer` is keeping a stream pointer (or something?) because when it writes its next line it overwrites text I've appended. I don't know what is going on, but none of my added lines appar in the final log... I've used `echo $number >>events.log`. I've watched the log via `tail -f events.log` and it shows one of my lines occasionally, so they must be getting there... Is there some way around this?   Either by some `fu` to the log, or an entirely different method, eg. some tool which does exactly this, in real time.. I've looked at subtitling tools and audio-video editors, but they seem to be too clunky.. I'm open to any ideas.


title: certificate errors trying to create a virtualenv on old Ubuntu

text: On an old Ubuntu 8.04 (cannot upgrade yet) I need to create a Python virtualenv, install some packages and then my software. I do get certificate errors:               Could not fetch URL https://pypi.python.org/simple/xlrd/: connection error:         [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate   routines:X509_load_cert_crl_file:system lib          Will skip URL https://pypi.python.org/simple/xlrd/ when looking for     download links for xlrd      so I cannot upgrade `pip` or `setuptools`, and have no luck finding how to update just the certificate (the system is old and cannot be update using `apt`). The python installed is the latest `python-2.7` (I have to use `pip-2.7` and `virtualenv-2.7` in order not to get the old system versions that I don't want to touch). How can I install appropriate certificates, or work around this issue?


title: How to write any Unicode Key without Pre-programmed key for it in kbd?

text: I am trying to find some Unix tool to input any Unicode key. I am fine with X application or console but I use Vi/m and it may have this property. For example, suppose I want to input key `"U+0303"` or the key `"U+007E"` in Unicode. You should get something below, source, with the unicodes:               U+0303 ◌̃ combining tilde and U+007E ~       I am looking for a general tool, not be depended on certain kbd layouts. It is actually better if it is was some very basic tool without unnecessary bells- and-whistles. The simplest win.


title: Testing C++ code with bash commands

text: I've read a programming problem and then I wrote code for it. But I thought my algorithm was not working right, so I wrote another piece of code that it was not optimal but, I think, correct. Now I have about 100 input and output data sets and I want to give this input to the both C++ programs and compare outputs. If there are differences in the outputs, I will find out if my code is not correct. My problem is that there are too many test cases (about 100) and the outputs are big text files and I can't check them by myself. I wonder how I can do this with bash functions and commands? My input text files are `input1.txt`, `input2.txt`, etc. My outputs text files are similar to inputs. My programs are written in C++.


title: PECL memcached installation gets error

text: I installed Zend Server 6 (debian). Also installed several packages:               apt-get install gcc     apt-get install g++     apt-get install libncurses5-dev      apt-get install zlib1g     apt-get install zlib1g-dev     apt-get install libmemcached-dev      After that I tried to install pecl memcached:               /usr/local/zend/bin/pecl install memcached      I got some errors while pecl memcached installing: http://codepad.org/iWuKlgxb What is the reason of these errors?


title: Extract timestamp from a gzip file

text: How can I know the raw original timestamp of a file `foo` compressed with `gzip` without having to decompress `foo.gz`? `gzip --verbose --list foo.gz` and `file foo.gz` will print formatted date and time.


title: Why .Xauthority needs not to be owned by the root account in order to get past login?

text: I've just got the same problem from here, and solved it using what was stated in the first answer (akonsu's one). However, I would love to know why `~/.Xauthority` needs not to be owned by the root account in order to get past login with a regular user (in other words: why is that the reason for the login failure), and - do you have an assumption as to how akonsu found that as a solution?


title: Samba share permission denied user writing file but still shows

text: Very strange issue... Samba share on remote:               [javaerpm]         path = /u/abas/erpm/java         force user = erpm         guest ok = yes         read only = no         writeable = yes      Mount command on local using root:               root@crunchbang:/mnt/abas# mount -t cifs -o username=guest,rw,exec,auto //10.0.0.2/javaerpm ./javaerpm      Root can read/write/cd no problem at all:               root@crunchbang:/mnt/abas# cd javaerpm     root@crunchbang:/mnt/abas/javaerpm# touch test     root@crunchbang:/mnt/abas/javaerpm# ll     total 1     -rw-r--r--  1  501 users   0 Sep 24 09:55 test     root@crunchbang:/mnt/abas/javaerpm# rm test      But if I switch to a regular user and do the same thing I get this:               shawn@crunchbang:/mnt/abas/javaerpm$ touch test     touch: cannot touch `test': Permission denied      I can `ll` and I can see that it wrote the file anyways:               shawn@crunchbang:/mnt/abas/javaerpm$ ll     total 1     -rw-r--r--  1  501 users   0 Sep 24 09:55 test      I can even `rm` no problem:               shawn@crunchbang:/mnt/abas/javaerpm$ rm test     shawn@crunchbang:/mnt/abas/javaerpm$      I've tried different mounting options. `uid=501` doesn't change anything. Tried `nounix` but then it doesn't work at all and I see nothing using root or shawn user.


title: ssh: Read from socket failed: Connection reset by peer

text: When I try to ssh to a remote host, I get the following error messages:               root@cloudstack-server-1:~/.ssh# ssh ubuntu@172.17.4.17 -v     OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: /etc/ssh/ssh_config line 19: Applying options for *     debug1: Connecting to 172.17.4.17 [172.17.4.17] port 22.     debug1: Connection established.     debug1: permanently_set_uid: 0/0     debug1: identity file /root/.ssh/id_rsa type 1     debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-1024     debug1: Checking blacklist file /etc/ssh/blacklist.RSA-1024     debug1: identity file /root/.ssh/id_rsa-cert type -1     debug1: identity file /root/.ssh/id_dsa type 2     debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024     debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024     debug1: identity file /root/.ssh/id_dsa-cert type -1     debug1: identity file /root/.ssh/id_ecdsa type -1     debug1: identity file /root/.ssh/id_ecdsa-cert type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.1     debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1     debug1: SSH2_MSG_KEXINIT sent     Read from socket failed: Connection reset by peer      BTW, I generate a key-pair id_rsa/id_rsa.pub in my local host and paste the id_rsa.pub to the remote host's file `authorized_keys`. I also enable password login in remote host. Now, I have no idea about the error messages--`Read from socket failed: Connection reset by peer`. Please give me some advices.


title: Why `host` and `nslookup` on Solaris 10 resolves hostnames while `ping` and `telnet` does not?

text: * `/etc/resolv.conf` contains a nameserver that is alive (as reported by the `ping` command)   * `host` or `nslookup` is able to resolve `google.com`              $ host google.com     google.com has address 74.125.228.3     google.com has address 74.125.228.4     ...     $ nslookup google.com     ...     Non-authorative answer:     Name:   google.com     Address: 74.125.228.0     Name:   google.com     Address: 74.125.228.1     ..        * `ping` or `telnet` is not able to resolve `google.com`              $ ping google.com     ping: unknown host google.com     $ telnet google.com     google.com: node name or service name not known


title: "lsof: can't read namelist from /dev/ksyms" on Solaris

text: On Solaris, when I type the command               lsof -l      I encountered this error:               lsof: can't read namelist from /dev/ksyms      Anyone knows what this error means and how I can get open the list of open FD's using lsof in Solaris?


title: Periodicaly dropping packets

text: I'm here on an Ubuntu 12.10 Dell machine. Every 8.5 minutes packets get dropped, I don't lose the connection completely but for some seconds, no connections are successful. I had this problem before and it vanished but now it's back again. I started to monitor all packages with Wireshark and first suspected that an unusual high number of ARP requests somehow DDOS my connection but this does not seem to be the problem. I started to ping a host on the Internet and charted the ping requests and responses and it's absolutely periodic, so I suspect it must be something with my system. I can figure out if DNS resolution does not work, I don't get an address via DHCP or the routes are set up incorrectly but I have no idea where to start looking in this case. (I obviously tried Google) Where could I start looking for problems? Kernel log doesn't show anything. Is there a buffer for incoming data that could overflow? Any tables in the kernel that could be purged periodically? I forgot to add, the machine is connected to a switch under my desk. I also have a windows machine which is connected to the same switch and does not have any problems. Also I plugged the Linux box directly into the socket in the wall and I had the same problems. **Additional information** As far as I understand the dump, the connection are not reset, they just time out. I get a lot of tcp retransmission requests. The ARP requests come from network crawlers which try to discover devices. While they sometimes sent up to 1000 requests for an IP address that does not exist, I could not see a correlation between those bursts and my failing connections. Also the activity of the crawlers are not periodic while my connections always fail after exactly the same time (about 8.5 minutes) so I ruled them out. I could so far not detect other unusual traffic. As I said, I unplugged the linux box and plugged it directly into the network socket in the wall, without the IP phone and the switch in between and the behaviour is exactly the same. Therefore I don't think it's a problem with the equipment. **I gave up**   I reinstalled Ubuntu and now it works normally again.


title: How can I get a static C compiler?

text: I'm playing around with chroot environments, and I'd like to have a portable C compiler so that I can easily set up some basic build-tools in each environment without having to move too many libraries around. Gcc seems pretty bloaty for what I want to do, but if it's reasonably easy to build a static gcc I wouldn't mind a few dozen megabytes. I am also looking at the Tiny C Compiler, which is smaller but still looks like it's got an impressive feature set. However, running ./configure --help in the source directory doesn't list any option for building tcc statically, and I'm not sure how it might be done otherwise.


title: CMake Error: The current directory is different than

text: I'm trying to compile the source code for Shrewsoft VPN. The instructions say to compile the source on step 4. However... I get this error:               user@ubuntu:~/Ubuntu One/Programs/ShrewSoft VPN$ sudo cmake –DQTGUI=YES –DETCDIR=/etc –DNATT=YES     CMake Error: The current CMakeCache.txt directory /home/user/Ubuntu One/Programs/ShrewSoft VPN/CMakeCache.txt is different than the directory /home/user/Programs/ShrewSoft VPN where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt     CMake Error: The source directory "/home/user/Ubuntu One/Programs/ShrewSoft VPN/–DNATT=YES" does not exist.     Specify --help for usage, or press the help button on the CMake GUI.      **Instructions:**               Compile the Source Code for the Shrew Soft VPN Client     1.  $> cd ~/Downloads          2.  $> tar –xzvf shrewsoft-client.tgz          Change to Download directory     $> cd ~/Downloads     Unpack the Source files.     $> tar –xzvf shrewsoft-client.tgz     3.   Change to the source directory.          $> cd ~/Downloads/ike     4.   Run cmake.          For GUI Installation (recommended):          $> cmake –DQTGUI=YES –DETCDIR=/etc –DNATT=YES          For non-GUI Installation:          $> cmake -DNATT=YES     5.   Run make.          $> make     6.   Run make install. NOTE: Run


title: How do I mount a shared VMWare folder on startup?

text: So I'm following this article on how to mount a shared vmware folder. I can successfully mount with the following command:               mount -t vmhgfs .host:/foo /home/user/Documents/foo      However, I can't seem to get it work with `/etc/fstab`. I added this line:               .host:/foo /home/user/Documents/foo vmhgfs defaults 0 0      When I start up my machine, it prompts me to press `S` to skip mount or `M` for manual recovery and it won't mount. I'm forced to press `S` to skip to get into the OS. How can I fix this? Edit: So I've found that VMware is already automatically mounting it to /mnt/hgfs/foo so my temporary workaround is a symlink to that directory. Is it possible to override this behavior so that I don't need a symlink?


title: How can I debug Apache, not starting upon boot

text: Apache is already set up as a service, since:               $ sudo update-rc.d apache2 defaults      System start/stop links for /etc/init.d/apache2 already exist.      But Apache isn't starting. How can I start debugging what is going wrong? I'm running Linux Mint, so a Debian flavour.


title: Why isn't /etc/rc.local executed when I log in?

text: I'm trying to run a script at login, and this is the way I've found to do it. I'ved edited `/etc/rc.local` with a line such as `bash /home/me/script.sh`. I've made that script executable. It doesn't seem that my command is being executed upon login. What steps could I take to debug this? My distro is Linux Mint 12 running Gnome.


title: Does CentOS fall into System V family? How is it considered to be while comparing with Unix System V family?

text: CentOS is `"derived entirely from the Red Hat Enterprise Linux (RHEL) distribution"` (more here).   1. Does it fall into any UNIX System V family? Such as PDP-11 or etc?   2. If not, where does CentOS stands for comparing with System V family for zero downtime or performance etc?


title: How are the GPG usage flags defined in the key details listing?

text: When I list the details of a key I get output like this:               $ gpg --edit-key SOMEID     pub [..] created: [..] expires: [..]   usage:SC     [..]     sub [..] created: [..] expires: [..]   usage: E      Or even `usage: SCA` on another key (the master-key part). What does these abbreviation in the usage field mean? I can derive that:               S -> for signing     E -> for encrypting      But what about `C` and `A`? And are there more? And where to look stuff like this up?


title: Unable to start GNOME after hibernation

text: I'm using Debian 6 (Squeeze) and I happened to hibernate my laptop today. After hibernation everything was very slow (a lot of disk accesses... most likely page faults, I guess) but this is a usual behaviour in my case. My usual fix to this situation is rebooting. However, this time I rebooted and GNOME never came back. GRUB is loaded and a lot of stuff is output to the console however at some point, when the console is replaced by a black screen in which GNOME will be loaded the black screen stays there. I've been using `fglrx` driver for a year, however, I changed it in `xorg.conf` into `vesa`. This showed a little improvement as, although the situation repeated, instead of seeing a full black screen I could read:               lp: driver loaded but no devices found     ppdev: user-space parallel port driver      Those messages stayed on top of the screen blinking as if they were cleared and written in a loop. The fans went on so I guess there was some kind of loop doing something. Hitting the power button shut down the laptop properly (the usual shutdown messages appeared in the screen). I haven't seen any unusual output rather than that in `dmesg`, `/var/log/kern.log` `/var/log/messages`. Any ideas on what I can do? Maybe `dpgk-reconfigure` some packages?


title: Use `dd` to cut file end part

text: There is probably simple trick to do this, but I can't figure from man page. How do I cut last 1MB from file with undetermined size for example, by using `dd`?


title: I want my Ubuntu 9.04/9.10 back, is there any current similar distro?

text: I was switching to Linux in the optimal time, around Ubuntu 9.04/9.10. I am a programmer, so I don't want to be a "Linux guru", that's why Ubuntu **was** perfect for me - until Unity/Gnome3. In latest Ubuntu releases (11.04/11.10), several important things have just disappeared. There's no Compiz-Fusion support, no Gnome2 applets. The position of the panels is fixed. The Unity launcher is "for-dummies", but I'm not. Lots of customisation options are gone. On the computer I've performed distro- upgrade, I've installed LXDE now, it's like Gnome (I've replaced LXDE's file manager with Nautilus), but it does not support Compiz-Fusion. So, the question is: which Linux distro is like Ubuntu 9.04/9.10, which I can just install, set up Compiz-Fusion shortcuts, select panel's position, add applets, and it just works? Should I go back to Ubuntu 10.04 LTS? What about Mint? I don't wanna dig too deep into the soul of window managers and desktop environments.


title: need portable crontab host-checking/failover logic across Linux & Cygwin

text: A host-ping test that always works correctly from the interactive `bash` command line in **Cygwin** , is behaving incorrectly in its own crontab-- always selecting the second host--and I can't figure out why:               SHELL=/bin/bash          */29 7-23 * * *  [ -n "$(pidof unison)" ]  || (partner=5.174.63.120; ping -A -c5 $partner 6 7 |grep -w "ttl" || partner=5.3.172.247; time nice unison-sync  $partner &> /tmp/sync.master.dev.log )      which ping     /usr/bin/ping      This basically wants 5.174.63.120 to be the 1st choice sync host preference, however if it doesn't ping back at the moment then use 5.3.172.247 instead for this round. If `unison` is not already running, that is. Yet running from the command-line always works as expected, echoing the first IP address if available, else the second:               partner=5.174.63.120; ping -A -c5 $partner 6 7 |grep -w "ttl" || partner=5.3.172.247; echo  $partner      In Ubuntu this works both in `crontab` and cli. Is there a better way I can accomplish this, that is both compact and still portable on both my OSes (Linux Ubuntu 11.10 and Cygwin under Windows7,32bit)? Even better, I'd like to generalize my host-checking to more that two, but still code it into a concise crontab line: Use A if reachable, else use B if reachable, else use C if reachable, ... else just use Z.


title: Multi-machine tool in the spirit of moreutils' `parallel`?

text: `parallel` from moreutils is a great tool for, among other things, distributing `m` independent tasks evenly over `n` CPUs. Does anybody know of a tool that accomplishes the same thing for multiple machines? Such a tool of course wouldn't have to know about the concept of multiple machines or networking or anyhting like that -- I'm just talking about distributing `m` tasks into `N` _clusters_ , where in cluster `i` `N_i` tasks are run in parallel. Today I use my own BASH scripts to accomplish the same thing, but a more streamlined and clean tool would be great. Does anyobdy know of any?


title: How to start nvidia x server settings from command line?

text: I am using Ubuntu 10.04, I know I can start NVIDIA x server settings by choose : **System -> Preference -> Monitors** on the top bar. But how can I start the NVIDIA x server settings window by run a command from terminal? What is that command?


title: How to bypass flash version check in linux firefox and use Gnash

text: Is it possible, and how, for Gnash to present itself as Adobe Flash to avoid "install Adobe Flash" messages while viewing flash-based websites?


title: Adding spacing around text in Conky?

text: I've created a pretty awesome layout in Conky for my desktop machine. ![case in point](http://i.imgur.com/NXoSA8y.png) I'm unfortunately having a hard time trying to add padding to the text on the right to separate the right side of the text from the right border. Here's my configuration:               background yes     use_xft yes     xftfont 123:size=8     xftalpha 0.1     update_interval 0.5     total_run_times 0     own_window yes     own_window_type panel     own_window_transparent yes     own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager     double_buffer yes     minimum_size 270 1080     #maximum_width 450     draw_shades no     draw_outline no     draw_borders no     draw_graph_borders no     default_color white     default_shade_color red     default_outline_color black      alignment top_left     gap_x 0     gap_y 0      no_buffers yes     uppercase no     cpu_avg_samples 2     net_avg_samples 1     use_spacer left     override_utf8_locale yes          lua_load ~/.config/conky/scripts/conky_lua_scripts.lua          TEXT     ${image .conky/mightymoose-sidebar-background.png}${image .conky/mightymoose-logo.png -p 10,10 -s 255x100}${voffset 110}     ${offset 10}${font Monospace:bold:size=8}PROCESSORS ${hr 2}     ${font Monospace:size=8}${cpugraph cpu0 30,255 333333 FFFFFF}     ${offset 10}${cpubar cpu1 6,135}$alignr ${execi 1 get-i7z-value freq -c 0}  ${execi 1 get-i7z-value temp -c 0} ${lua_parse format %3.0f ${cpu cpu1}}%     ${offset 10}${cpubar cpu2 6,135}$alignr ${lua_parse format %3.0f ${cpu cpu2}}%     ${offset 10}${voffset -5}${hr 0.1}     ${offset 10}${cpubar cpu3 6,135}$alignr ${execi 1 get-i7z-value freq -c 1}  ${execi 1 get-i7z-value temp -c 1} ${lua_parse format %3.0f ${cpu cpu3}}%     ${offset 10}${cpubar cpu4 6,135}$alignr ${lua_parse format %3.0f ${cpu cpu4}}%     ${offset 10}${voffset -5}${hr 0.1}     ${offset 10}${cpubar cpu5 6,135}$alignr ${execi 1 get-i7z-value freq -c 2}  ${execi 1 get-i7z-value temp -c 2} ${lua_parse format %3.0f ${cpu cpu5}}%     ${offset 10}${cpubar cpu6 6,135}$alignr ${lua_parse format %3.0f ${cpu cpu6}}%     ${offset 10}${voffset -5}${hr 0.1}     ${offset 10}${cpubar cpu7 6,135}$alignr ${execi 1 get-i7z-value freq -c 3}  ${execi 1get-i7z-value temp -c 3} ${lua_parse format %3.0f ${cpu cpu7}}%     ${offset 10}${cpubar cpu8 6,135}$alignr ${lua_parse format %3.0f ${cpu cpu8}}%          ${offset 10}${font Monospace:bold:size=8}MEMORY ${hr 2}     ${offset 10}${font Monospace:size=8}${membar}     ${offset 10}$alignc${mem} of ${memmax}: ${lua_parse format %3.0f $memperc}%          ${offset 10}${font Monospace:bold:size=8}GPU ${hr 2}     ${offset 10}${font Monospace:size=8}Temperature:$alignr${nvidia temp}°C     ${offset 10}GPU Frequency:$alignr${nvidia gpufreq} MHz     ${offset 10}Memory Frequency:$alignr${nvidia memfreq} MHz          ${offset 10}${font Monospace:bold:size=8}NETWORK ${hr 2}     ${offset 10}${font Monospace:size=8}eth0:  ${addr eth0}$alignr${font :size=8}↑${font Monospace:size=6}${upspeedf eth0}${font :size=8}↓${font Monospace:size=6}${downspeedf eth0}${font :size=8}     ${offset 10}${font Monospace:size=8}wlan0: ${addr eth2}$alignr${font :size=8}↑${font Monospace:size=6}${upspeedf eth2}${font :size=8}↓${font Monospace:size=6}${downspeedf eth2}${font :size=8}     ${offset 10}${font :size=20}↓${downspeedgraph eth2 25,105 333333 FFFFFF -l}↑${upspeedgraph eth2 25,105 333333 FFFFFF -l}      It seems pretty silly to have to specify an offset on each line to move everything to the right 10px, but if it's the only solution, that's okay. The main goal here is to add 10px of spacing to the right side to pull the text away from the right border. Is there a way to do this?


title: Changing user and group ID system wide (including file system attributes)?

text: ( _this question possibly related toLinux: simulating/masking user ownership upon mount of 'external' partitions? - Stack Overflow_) I typically use Ubuntu (currently 11.04) as my desktop OS; let's say there, I'm the user **`myself`** with uid=1000, part of the group **`myself`** with gid=1000; so basically the home directory permissions look like this:               > stat ~       File: `/home/myself'     ...     Access: (0755/drwxr-xr-x)  Uid: ( 1000/   myself)   Gid: (  1000/   myself)      Now, on the same machine I sometimes need to boot OpenSuse (currently 11.2) through a LiveUSB (Live-CD). All of that works fine for me, except that the default user in a Live-CD environment is **`linux`** with uid=999, part of the group **`users`** with gid=100; so there the home directory permissions look like this:               > stat ~       File: `/home/linux'     ...     Access: (0755/drwxr-xr-x)  Uid: ( 999/   linux)   Gid: (  100/   myself)      So, basically, when I mount my Ubuntu drives (which are owned by 1000:1000) under the live OpenSUSE (whose default user is 999:100), I fail to access them as usual, i.e.:               linux@linux:~> touch /media/extdrive/xxx     touch: cannot touch `/media/extdrive/xxx': Permission denied      So, I thought I should try to change the default uid/gud for `linux:users` on the OpenSUSE machine, so I tried this:               > sudo /usr/sbin/usermod -u 1000 linux     usermod: Account `linux' is currently in use.          > id linux     uid=999(linux) gid=100(users) groups=100(users),33(video)          # so if that fails.... change directly from /etc/passwd?      > sudo nano /etc/passwd          > id linux     uid=1000(linux) gid=100(users) groups=100(users),33(video)      ... and just having the uid changed, makes me access the Ubuntu drives fine - however, now I cannot access the OpenSUSE stuff previously owned by `linux:users`:               > sudo nano /etc/fstab     sudo: unknown uid: 999      ... so, it turns out, **bad** idea to change /etc/passwd directly :) The solution here seems to have been to drop to root shell first, do the `usermod` command, reboot - and now I have on from the OpenSUSE environment:               linux@linux:~> stat ~     Access: (0755/drwxr-xr-x)  Uid: ( 1000/   linux)   Gid: (  100/   users)      This makes me - for the most part - have access to the Ubuntu filesystems/drives as usual; while also having usual access to whatever is owned by the default user in OpenSUSE. However, to be on the safe side, I'd also like to change the group ID. What would be the recommended way of doing this ( and what would the recommended way be to change the uid, if I didn't do it right in the discussion above )? Many thanks in advance for any answers,   Cheers!


title: Need more disk space for root

text: Several months ago I bought a new computer and installed/configured dual boot with Arch/Ubuntu Studio. I wanted to try Arch (because it was suggested as a great distro for audio production [since it is comparatively lean]), but I wanted to get going with Ubuntu Studio right away in case I had bitten off more than I could chew with Arch. Hence, the dual boot scenario. I'm not an experienced Linux system administrator; I found this to be very difficult. I read a lot of information from a massive amount of online sources and eventually figured it out. I never ended up using Ubuntu much at all, so it's just been taking up 128G on my 256G disk. When I followed the tutorials from the Arch Wiki, the sample suggested 15G for the root partition. At the time, I should've thought harder about this, because it did seem like a low number for the kinds of work I was planning to do (a lot of varied things = a lot of applications). I'm using i3 as my window manager, and I noticed right away that the drive space was going fast. I've got 1G left. **Long story short** , I didn't make enough space for the root (`/`) partition, and I don't know how to correct it. My initial reaction was to just copy `/` over to where Ubuntu is. So I deleted the Ubuntu partition and repartitioned it with cgdisk. Then I booted with a live USB Ubuntu and mounted `/dev/sda3` (my current `/`) to `/oldroot` and mounted `/dev/sda2` (where Ubuntu used to be) to `/newroot` and `cp -R /oldroot/* /newroot`. I'm not sure what to do from here, though. I have a separate boot partition that looks like this:               /     /EFI     /EFI/ubuntu     /EFI/ubuntu/shimx64.efi     /EFI/ubuntu/grubx64.efi     /EFI/ubuntu/grub.cfg     /EFI/arch_grub     /EFI/arch_grub/grubx64.efi      I don't remember what I did to create these `.efi` files, but I would imagine that their purpose is to direct the process to the current `/boot/grub/grub.cfg` script (it looks like a bash script). I'm not sure. I think I remember this being done as part of running `grub-mkconfig` or something like that, but I don't know where I was when I did that or at what stage in the process, so now I've hit a wall. Maybe I shouldn't even be trying to switch partitions--maybe I should be trying to simply increase the size of the root partition as it is, but I don't know how to do that. What should I do from here?


title: Can I have conditional statements, based on server, in .htaccess file?

text: I have a dev server and live server, both running my site on Apache. In my .htaccess file, in addition to lots of mod_rewrite commands and other important things, I also have Auth access control for the live server. (The dev server is on my local Mac, so I don't need it there...) Right now it's hard to sync .htaccess up to the live server since I can't just copy my dev .htaccess file (that would overwrite the Auth commands), so I have to manually edit the live one. Is there a way to have a conditional in the .htaccess file? I'm imagining something like:               <On Live_Server>       AuthName "Restricted Area"       AuthType Basic       AuthUserFile /home/lmiv/.htpasswds/.htpasswd        Require valid-user     </on>


title: Unwanted console text

text: For some reason, every time I plug in a USB device, a whole bunch of messages get dumped onto the terminal. (Saying something about device IDs, buffering modes, etc.) How to I prevent this from happening? * * * **Update:** Several people have asked me things, so let me summarise the potentially- relevant information I have collected so far:   * The stray text appears on whichever virtual terminal I'm currently looking at. Each line is prefixed with what looks like the system uptime.   * The `quiet` parameter is already on the kernel command line.   * The current setting for `printk` is `6 4 1 7`.   * As best as I can tell, the `syslog` package isn't even installed. (Nor `rsyslog`.) Certainly there are no configuration files for it in `/etc`.   * Init is definitely `systemd`.   * `/etc/sysctl.d` is empty. `/etc/sysctl.conf` contains only comments.


title: Why a long delay after command not found?

text: Often when I mistype a command such as ls (e.g. I hit ENTER before I type 's') there is a long (~2s) delay after the terminal displays: bash: l: command not found... I can understand the reasons for a similar delay after an incorrect password is entered, per Why a wrong password gives a big delay. But why delay after an unrecognized command? Does FAIL_DELAY in /etc/login.defs affect this also?


title: Can't dualboot Fedora

text: I have Windows XP installed on partition `C`, and then I installed Fedora on `ext3` partition. Now at computer startup I should see two options to select from; either launch XP or Fedora. However, my computer automatically starts Windows XP: I do not have two options at computer startup. I have a Fedora still installed on `ext3`, but I can’t boot it. Why?


title: Error when running X11 application as root

text: I get this wierd error when I run applications as root.               **(gedit:630): WARNING **: could not open X display     No protocol specified     Unable to init server          (gedit:630): Gtk-WARNING **: Cannot open display: :0.0      I'm using Arch Linux. I use `su -` to login as root. And this error comes when im running the X server. Also if i copy `.Xauthority` into the `/root/` it works without error.


How to display line number while doing grep on a file. For example:               grep CONFIG_PM_ADVANCED_DEBUG /boot/config-`uname -r


title: How do I start service in systemd right after cryptsetup?

text: I have an ArchLinux installation with systemd. I am trying to run a hook immediately after my encrypted data device is mounted in order to put flashcache on top of it. I have scripts that work, however I cannot make them load in right order. Here's what I did: file: `/usr/lib/systemd/system/flashcache.service`               [Unit]     Description=FlashCache     Requires=systemd-cryptsetup@cdata.service          [Service]     Type=oneshot     RemainAfterExit=no     ExecStart=/usr/local/bin/flashcache_startup_script          [Install]     WantedBy=dev-mapper-data_cached.device      After creating file, I ran `systemctl enable flashcache.service`. However, on boot it does not start, the dev-mapper-data_cached times out, after which I can get into a root shell and run `flashcache_startup_script` manually. I examined output of `journalctl -b`, and determined that FlashCache service does not load before timeout occurs. Another option I tried without success is `Requires=dev-mapper- vg1-data.device` What am I doing wrong?


title: Find a string (like grep -q) within only a section of a file

text: I want to write some Bash that can verify that a string exists in a configuration file. I can't change the file format, it belongs to a different application. The file is subdivided into groups named by strings in square brackets. This should be a success:               [group1]     MyParameter     junk1     junk2          [group2]     junk3     junk4      This should be an error:               [group1]     junk1     junk2          [group2]     MyParameter     junk3     junk4      I can do a `grep -q` to verify that `MyParameter` exists in the file, but if it's located in some other group and not `group1`, then I'm still busted. If `MyParameter` existed in both groups, I wouldn't care enough to flag an error, as long as it existed in `group1`. I can't depend on line numbers (head, tail, etc). Also, I'd be happier if it was generic enough that it doesn't depend on the name of `group2` (the script would just know that if it found another line beginning and ending with square brackets, that terminates the previous group).


title: Using SSH to connect to a new server without storing the host keys in the $HOME/.ssh/known_host file

text: I get the following output if I run the following command:               -bash-3.2$ ssh -o "StrictHostKeyChecking no" 192.168.1.77     Warning: Permanently added '192.168.1.77' (RSA) to the list of known hosts.     Last login: Fri Jul  4 10:49:11 2014 from chlorine.example.com     Sun Microsystems Inc.   SunOS 5.10      Generic January 2005     -bash-3.2$      I would like to run this command, without 192.168.1.77 being added to the list of known hosts, but still permitting a successful login. Is there an SSH option that allows this? I have gone through the `man` page for `ssh_config` and I've tried all the likely options such as setting `"CheckHostIP no"` with no success. Both the local and remote systems are running Solaris 10. If necessary, I could back up my `$HOME/.ssh/known_hosts` file prior to making a connection, and restore it after making the connection, but if there is an SSH option that allows me to avoid doing this, then I would prefer to use that.


title: Playing sound in a user X session

text: I am running Linux Mint 14 and can play sound when I start my x session through `mdm`. however, when I start my X session using `startx` in user space, I am unable to get any sound play. What could be wrong? how do I go about playing sound in an X session when running X in userspace? Is this even possible?


title: Init Script initializing daemonized process, but won't return [ok]

text: I'm new to init scripts, but the one I'm using I've copied almost verbatim (I did have to change a few things around from the source I found to work with Fedora). The daemon initializes fastcgi just fine, which was a great victory. However, the init script itself never finishes running, and never returns [ok], even though the program is initialized. It just hangs at "Starting PHP FastCGI" with a blinking cursor. I can't ^C out of it, either. The init script is below. This is a Fedora14 server.               #!/bin/sh     #chkconfig 3 85 15     #processname: php-fcgi      . /etc/rc.d/init.d/functions          php_cgi="/usr/bin/php-cgi"     prog=$(basename $php_cgi)     bind=/tmp/php.socket          php_fcgi_children=15     php_fcgi_max_requests=1000          user=root     php_cgi_args="- USER=$user PATH=/usr/bin PHP_FCGI_CHILDREN=$php_fcgi_children PHP_FCGI_MAX_REQUESTS=$php_fcgi_max_requests $php_cgi -b $bind"     RETVAL=0     start() {         echo -n "Starting PHP FastCGI: "         daemon /usr/bin/env $php_cgi_args         RETVAL=$?         echo "$prog."     }          stop() {         echo -n "Stopping PHP FastCGI: "         killall -q -w -u $user $php_cgi         RETVAL=$?         echo "$prog."     }          case "$1" in         start)             start         ;;         stop)             stop         ;;         restart)             stop             start         ;;         *)         echo "Usage: php-fcgi {start|stop|restart}"         exit 1         ;;     esac     exit $RETVAL


title: Finding duplicate files

text: I need to write a bash script that finds duplicate files, but in addition to `md5sum` it needs to use `cmp` to do the final check. I tried the command below in my shell. How can I add a loop and put it into a bash script?               find . -type f | xargs -I%  md5sum % | sort | uniq -w32 -D| cut  -f3 -d' '


title: XML text file with `^@` characters in it?

text: I have an XML file that I need to parse. When I open it in nano, nano give me the message `(converted from Mac format)`. However between each character, there is a `^@` sequence, like so:               ^@t^@h^@e^@ ^@q^@u^@i^@c^@k^@ ...      What format is this, and how do I get it to display properly? How do I convert it?


title: Alienware M14x - No sound in linux Mint 14 (Nadia)

text: I have done a fresh install of Linux Mint 14.1 x64 on my Alienware M14x. Everything was working fine after installed. Unfortunately the sound is lost after sometime. Theres no sound when playing video via vlc, on youtube, etc... I have to reboot my pc each time to be able to have the sound back. Please help... Here's some information: Command: lspci -v | grep -A7 -i "audio"               00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)         Subsystem: Dell Device 0491         Flags: bus master, fast devsel, latency 0, IRQ 54         Memory at da800000 (64-bit, non-prefetchable) [size=16K]         Capabilities: <access denied>         Kernel driver in use: snd_hda_intel         Kernel modules: snd-hda-intel      Command: cat /proc/asound/card0/codec* | grep Codec               Codec: Realtek ALC665     Codec: Intel CougarPoint HDMI      Command: inxi -F               System:    Host: xxxxxxxxxx Kernel: 3.5.0-17-generic x86_64 (64 bit)     Desktop: Gnome Distro: Linux Mint 14 Nadia     Machine:   Mobo: Alienware model: M14xR1 version: A08 Bios: Alienware version: A08  date: 12/24/2011     CPU:       Quad core Intel Core i7-2670QM CPU (-HT-MCP-) cache: 6144 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx)             Clock Speeds: 1: 800.00 MHz 2: 800.00 MHz 3: 800.00 MHz 4: 800.00 MHz 5: 800.00 MHz 6: 800.00 MHz 7: 800.00 MHz 8: 800.00 MHz     Graphics:  Card-1: Intel 2nd Generation Core Processor Family Integrated Graphics Controller             Card-2: NVIDIA Device 124d             X.Org: 1.13.0 drivers: intel (unloaded: fbdev,vesa) Resolution: 1366x768@60.0hz             GLX Renderer: Mesa DRI Intel Sandybridge Mobile GLX Version: 3.0 Mesa 9.0     Audio:     Card: Intel 6 Series/C200 Series Chipset Family High Definition Audio Controller driver: snd_hda_intel            Sound: Advanced Linux Sound Architecture ver: 1.0.25     Network:   Card-1: Atheros AR8151 v2.0 Gigabit Ethernet driver: atl1c             IF: eth0 state: down mac: d4:be:d9:1b:76:5c            Card-2: Intel Centrino Wireless-N 1000 driver: iwlwifi             IF: wlan0 state: up mac: 74:e5:0b:b0:04:36     Drives:    HDD Total Size: 750.2GB (6.4% used) 1: id: /dev/sda model: ST9750420AS size: 750.2GB      Partition: ID: / size: 434G used: 26G (7%) fs: ext4 ID: swap-1 size: 8.19GB used: 0.00GB (0%) fs: swap      RAID:      No RAID devices detected - /proc/mdstat and md_mod kernel raid module present     Sensors:   System Temperatures: cpu: 51.0C mobo: N/A             Fan Speeds (in rpm): cpu: N/A      Info:      Processes: 190 Uptime: 4:06 Memory: 862.4/7934.4MB Client: Shell    inxi: 1.8.4


title: ALT+F2 doesnt work in Linux Mint Mate

text: I am trying to install Sublime Text 2 on Linux MINT (Mate) from this tutorial. http://community.linuxmint.com/tutorial/view/907 and I'm stuck on:               Next , to create a menu icon press Alt+F2 and type:     gksu gedit /usr/share/applications/sublime.desktop      When I press `Alt`+`F2` nothing happens, is there another way I can run this command?


title: Some basic questions about dd

text: I'm working on a system of how to back up partitions using `dd` and have been reading a lot about it. I have a few questions and assumptions that I would like to ask. These may seem a little noob-ish, but that's exactly what I am as far as System/Server administration goes. I'm a young programmer who is starting to learn Linux system admin stuff (because it's fun!). Assumptions that I would like verified or discredited:   1. I cannot back up an entire partition to a DVD unless that partition is smaller than the available DVD space. AKA the outfile argument must have enough space. E.g. if I wanted to back up an LVM partition that is a terabyte, I must have a location/partition with at least a terabyte of free space (give or take a little if I gzip it).   2. I cannot use `dd` to create a bootable version of a partition to a DVD or USB.   3. I can use `dd` to create a bootable partition on a second disk drive.   4. If I wanted to back up a live system, is the best way to boot from a live cd or second partition? (Then unmount the partition I want to back up, or mount it as read only). Questions:   1. If I use `dd` to copy `sda` to `sdb` and `sda` has 1TB of disk space and `sdb` has 2TB, will the extra space be unusable until I reformat/partition it?   2. If a partition will fit on DVD and I write to it by using              dd if=/dev/sda1 of=/dev/dvd      (will this even work?) Or is it better to write `sda1` to an image file, and then burn a data DVD with the image file on it?


title: Why does bash show 'Terminated' after killing a process?

text: Here is the behaviour I want to understand:               $ ps       PID TTY           TIME CMD       392 ttys000    0:00.20 -bash      4268 ttys000    0:00.00 xargs     $ kill 4268     $ ps       PID TTY           TIME CMD       392 ttys000    0:00.20 -bash     [1]+  Terminated: 15          xargs     $ ps       PID TTY           TIME CMD       392 ttys000    0:00.21 -bash      Why does it show the `[1]+ Terminated: 15 xargs` after I kill a process, instead of just not showing it as it was just killed? I'm using bash on Mac OS X 10.7.5.


title: Kernel and QEMU : Unable to mount root fs error

text: I am trying to run a distro in the virtual disk image with a custom kernel,so that I can experiment and debug the kernel. I followed this to make a disk image and then install Debian to it. Now I tried running distro with the following command:-               qemu-system-i386 -hda debian.img -kernel ../linux-3.6.11/arch/i386/boot/bzImage -append "root=/dev/sda1"      To my dissappointment it simply gives a **Kernel panic-not syncing:VFS:unable to mount root fs on unknown-block(8,1)**. How can I fix the problem?Am I on the right path as far as kernel debugging is concerned?


title: yum install in user home for non-admins

text: I am a non-admin user on a large computer system. I need some up to date packages that are not installed on the system. I want to use yum to install them. As a user without sudo, admin, or root access, can I use package management to install packages in my home directory? I can always use make from the sources, but being able to use yum will make life easier.