What are your best practices and future plans for deploying unixoid desktops?

I have been setting up Linux desktops for a non-profit radio observatory. For me, this was the first time I had to think about "deploying" several identical machines, centralizing login, home directories and so on. It quickly became clear to me that, perhaps contrary to intuition, the "everything is textual" philosophy does not necessarily make that an easy task, and I wondered what seasoned admins do about this. In my case, I was installing Ubuntu 10.04 LTS on each machine. After installation, I ran a custom script that alters config files, removes and installs software and copies some files, like background images or browser bookmarks, from the server. I think, however, that my questions are distro- independent. ## Problems I was mainly encountering two problems: Firstly, inconsistent tools and config files, both across distributions and across versions, and secondly some crucial software not exposing settings to config files in an easy and intuitive manner. Let me give two short examples for what I mean: The `ifconfig` tool is being replaced by `ip`. All scripts relying on the presence of the former will break if, for example, run on a current ArchLinux box. So, I would need to check which tools in which versions are present on a machine I run a script on... this somehow feels like reinventing autoconf on a small scale. For the second problem, consider that I wanted to give the desktops some sort of "common identity". In my post-install-config-script, I use the following lines to achieve this:               scp user@server:/export/admin/*.jpg /usr/share/backgrounds/     scp user@server:/export/admin/ubuntu-wallpapers.xml /usr/share/gnome-background-properties/     sed 's/warty-final-ubuntu\.png/MyBackground\.jpg/' -i /usr/share/gconf/defaults/10_libgnome2-common     sed 's/warty\-final\-ubuntu\.png/MyBackground\.jpg/' -i /usr/share/gconf/defaults/16_ubuntu-wallpapers     sed 's/ubuntu-mono-dark/ubuntu-mono-light/' -i /usr/share/gconf/defaults/16_ubuntu-artwork     sed 's/Ambiance/Clearlooks/' -i /usr/share/gconf/defaults/16_ubuntu-artwork      I suppose that creating a CI is a common task for organizational admins. So, how come there is no central config facility, perhaps even cross-desktop? Having to set two (identical!) undocumented values in two distinct config files strikes me as odd. ## Questions In an organizational environment, how do you handle central, unified configuration across multiple clients? Do systems like Debian's FAI offer significant advantages (aside from not having to change CDs) over my method of "install first, run script afterwards"? What are good practices for the transition between major versions of your distribution? And, apart from the technical stuff: Is there a desktop environment that promises long-term stability as far as the user experience is concerned? I don't think I can migrate my users to KDE 4 or GNOME 3, but XFCE still has some functional drawbacks... Is there a *nix system that adresses this type of configuration issues? For example, I'd assume there are systems that ask you for some imagery of your organization (logos, background images, colour and font sets etc) and apply them to the login manager, users' desktops, web apps (!) and so on. Note: In our case, I have to work with fat clients, so a purely thin-client solution won't help.


How to print several files at the same time using lpr?

I am trying to print a number of files from shell using lpr. I enter something like:               lpr -P PRINTERNAME ./*/dir/file.pdf      but I get "lpr: No file in print request.". When I use ls as               ls ./*/dir/file.pdf      it correctly lists the files I want to print. Can someone help me understand what is going on?


how to invoke fonts dir in ghostscript

I am trying to create a PDF out of a text file with Courier as font and trying to use gswin32c.exe on Windows, but unnable to pass parameters correctly, I think. The gswin32c.exe is the Windows exe of Ghostscript. Here is my command:               gswin32c.exe -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sFONTPATH="C:\Temp\Fonts2\" -sOUTPUTFILE="C:\Temp\Outputfile.pdf" A1401227.TXT      I don't get a output file, why? How can I trigger the Font, pass the fonts dir?


Why date +3 equals 3?

Yes, this is a minor issue, but I wonder why               date +3      outputs               3       Other options like:               date -3      raise an error.


Longest common substring using grep

I have a huge text file called dictionary.txt with entries like                   ABC_SEQ_NUM This represents....         ABC_RANK This represents....         ABC_BSC_ID This represents...         PQR_TA_DATE_AF This represents...         XYZ_C_ID This represents...      In another file, I have the source for a program that is using some of these abbreviations as part of its variable names. The variable names often use the above entries as follows                    Facilitator.TMP_ABC_SEQ_NUM       So I am not able to simply search for TMP_ABC_SEQ_NUM using grep, because it would return no match. However, the last part of the variable name ("ABC_SEQ_NUM") is actually present in the text file. So I would like to say something like                     grep (longest match for) TMP_ABC_SEQ_NUM in dictionary.txt      So that it would return the match for                     ABC_SEQ_NUM      How to write such a command?


xl2tpd redial doesn't work

`/etc/xl2tpd/xl2tpd.conf`:               redial = yes     redial timeout = 1     autodial = yes      Version of `xl2tpd` default, latest Ubuntu 14.04 ( Trusty ):               xl2tpd  1.3.6+dfsg-1 amd64  layer 2 tunneling protocol implementation      I'm always pinging some host like Google, default DNS - 8.8.8.8. From time to time I'm losing the connection, ping is silent and `xl2tpd` doesn't reconnect. Seems like `xl2tpd` doesn't know that the connection is broken. Is there any option to keep an internet connection alive, to keep `xl2tpd` redial automatically? Now, I use a raw and dirty bash script wrapper around ping and also `service xl2tpd restart` to redial `xl2tpd`. Is there a more program (`xl2tpd`) friendly way?


How to invoke root privileges from a password prompt of "Software Update" window?

When I try to install software updates using the "Software Update" GUI, I am asked for the root password. Although, I can 'su' in a terminal, the password is not recognized as correct in the GUI prompt. I believe this is due to the user account name being different from the root account name. How can I still use the GUI then?


Giving OVZ containers their own IP

Is it possible to give an OVZ container its own external IPv4 address? Say I hire a dedicated server and purchase extra IP addresses. Can I assign those extra IPs to the containers? If so how would I do this?


Combining multiple process substitution

Suppose you tried something like this:               $ paste ../data/file-{A,B,C}.dat      and realize that you want to sort each file (numerically, let's suppose) before pasting. Then, using process substitution, you need to write something like this:               $ paste <(sort -n ../data/file-A.dat) \             <(sort -n ../data/file-B.dat) \             <(sort -n ../data/file-C.dat)      Here you see a lot of duplication, which is not a good thing. Because each process substitution is isolated from one another, you cannot use any brace expansion or pathname expansion (wildcards) that spans multiple process substitution. Is there a tool that allows you to write this in a compact way (e.g. by giving `sort -n` and `../data/file-{A,B,C}.dat` separately) and composes the entire command line for you?


Is there a drawback when using a chroot in high performance computing?

My (small) company uses an out-of-date linux (centos) software stack to run a proprietary software on a small cluster. Understandingly, IT is reluctant to upgrade since everything works now. I'd like to do some performance tests on these machines and plan to install a lot of software that shouldn't interfere with the production root. It also includes compiling scientific packages and therefor I need up-to-date libraries. One possiblity is to install an entire up-to-date root in a different location and `chroot` into it. **My question is:** How will this impact the performance of the tools running inside the chroot? Are there any benchmark references available? Is this technique widespread/disadvantegous/dangerous? Other ideas? See also my related question.


The disk cache takes too much memory in my OpenVZ VPS. How can I disable or limit disk cache memory usage globally? I am using CentOS 6.4.


How to use ' in alias?

I have one-line that I want to call using alias. `while printf '%s ' "$(df -P / | awk 'NR==2 { print $(NF-1) }')"; do sleep 30; done` I tried to escape `'` like `\'` but it didn't work. What is the correct syntax to use above one-liner in alias?


Why there are only two user defined signals?

In the list of signals defined in a linux system, there are two signals stated as User Defined signals (`SIGUSR1` and `SIGUSR2`). Other signals will be raised or caught in specific situations, but SIGUSRs are left for user application's use. So why only two signals?


How to get a list of applications associated with a file using command line

File associations usually are made in the desktop environment, but how to get a list of applications associated with a file using command line? Something like:               $ getassoc foo.pdf <CR>     $ acroread, okular      Does not need to be a command, can a `cat` \+ `grep` on any Gnome file I'm using Gnome 2.28.2. A response with other environments would help but not solve.


Tab completion of "../" in zsh

One noob question from a new zsh user: In bash, I can use tab-completion to move one directory up and descend down again another path. For example, suppose I'm in `$HOME/folder1`, and I want to `cd` to `$HOME/folder2`. `$HOME` only has the two child directories `folder1` and `folder2`. In bash, I could just type               cd ..[TAB]f[TAB]2      and would end up in `$HOME/folder2`. In my fresh zsh installation, pressing `cd ..[TAB]` produces a list of those child directories of `$HOME/folder1` which have two `.` in their name. Is there a simple way to get the behaviour I'm used to? Or is there something even easier to achieve what I want in zsh?


Can't print to PDF using cups-pdf; used to work, now "failed to set file mode" printing as non-root

Here's something really odd: something that used to work fine in Debian, and then broke, even without a dist-upgrade. I used to be able to use the CUPS PDF virtual printer to print anything to a PDF file. Now, it doesn't work: nothing shows up in ~/PDF when I print as an ordinary user. If I log into the CUPS administration interface and use that to print a test page to the printer, though, it works; the PDF shows up nicely in ~root/PDF. **But I want to be able to print to PDF as a non-root user...** /var/log/cups/cups-pdf_log has this to say:               Fri Feb  7 18:31:57 2014  [STATUS] ***Experimental Option: DecodeHexStrings     Fri Feb  7 18:31:57 2014  [ERROR] failed to set file mode for PDF file (non fatal) (/michael/home/PDF/PDF_-_CUPS_1_5.pdf)     Fri Feb  7 18:31:57 2014  [STATUS] PDF creation successfully finished (michael)      OK, so there's `failed to set file mode for PDF file`. Googling for that, however, doesn't help much. I did find one web page that suggested changing the `Out` directory in /etc/cups/cups-pdf.conf, so I did (`Out /tmp/${USER}.cups-pdf`) and restarted CUPS, and when I try to print to PDF it picks up that change because it created such a directory, but then complained about the same error in the new location. Despite seemingly being at the latest version (CUPS 1.5.3-5+deb7u1, CUPS-PDF 2.6.1-6, Debian Wheezy), I decided to reinstall CUPS just in case it had broken somehow.               sudo apt-get --reinstall -u install cups cups-pdf cups-bsd cups-client cups-common cups-driver-gutenprint cups-filters cups-pk-helper cups-ppdc      However, I am still getting the same error. Setting `LogType 7` in /etc/cups/cups-pdf.conf produces this:               Fri Feb  7 19:01:29 2014  [DEBUG] switching to new gid (lpadmin)     Fri Feb  7 19:01:29 2014  [DEBUG] initialization finished (v2.6.1)     Fri Feb  7 19:01:29 2014  [DEBUG] user identified (michael)     Fri Feb  7 19:01:29 2014  [DEBUG] output directory name generated (/tmp/michael.cups-pdf)     Fri Feb  7 19:01:29 2014  [DEBUG] user information prepared     Fri Feb  7 19:01:29 2014  [DEBUG] spoolfile name created (/var/spool/cups-pdf/SPOOL/cups2pdf-18015)     Fri Feb  7 19:01:29 2014  [DEBUG] source stream ready     Fri Feb  7 19:01:29 2014  [DEBUG] destination stream ready (/var/spool/cups-pdf/SPOOL/cups2pdf-18015)     Fri Feb  7 19:01:29 2014  [DEBUG] owner set for spoolfile (/var/spool/cups-pdf/SPOOL/cups2pdf-18015)     Fri Feb  7 19:01:29 2014  [DEBUG] using traditional fgets     Fri Feb  7 19:01:30 2014  [DEBUG] found beginning of postscript code (%!PS-Adobe-3.0)     Fri Feb  7 19:01:30 2014  [DEBUG] now extracting postscript code     Fri Feb  7 19:01:30 2014  [DEBUG] found title in ps code ((What does the CUPS PDF printer need to be able to set file mode? - Unix & Linux Stack Exchange))     Fri Feb  7 19:01:30 2014  [DEBUG] found end of postscript code (%%EOF)     Fri Feb  7 19:01:30 2014  [DEBUG] all data written to spoolfile (/var/spool/cups-pdf/SPOOL/cups2pdf-18015)     Fri Feb  7 19:01:30 2014  [DEBUG] trying to use PS title ((What does the CUPS PDF printer need to be able to set file mode? - Unix & Linux Stack Exchange))     Fri Feb  7 19:01:30 2014  [DEBUG] removing trailing newlines from title ((What does the CUPS PDF printer need to be able to set file mode? - Unix & Linux Stack Exchange))     Fri Feb  7 19:01:30 2014  [STATUS] ***Experimental Option: DecodeHexStrings     Fri Feb  7 19:01:30 2014  [DEBUG] checking for hex strings ((What does the CUPS PDF printer need to be able to set file mode? - Unix & Linux Stack Exchange))     Fri Feb  7 19:01:30 2014  [DEBUG] not a hex string, has no start marker ((What does the CUPS PDF printer need to be able to set file mode? - Unix & Linux Stack Exchange))     Fri Feb  7 19:01:30 2014  [DEBUG] removing enclosing parentheses () from full title ((What does the CUPS PDF printer need to be able to set file mode? - Unix & Linux Stack Exchange))     Fri Feb  7 19:01:30 2014  [DEBUG] calling alternate_replace_string     Fri Feb  7 19:01:30 2014  [DEBUG] removing alternate special characters from title (What does the CUPS PDF printer need to be able to set file mode? - Unix & Linux Stack Exchange)     Fri Feb  7 19:01:30 2014  [DEBUG] truncating title (What_does_the_CUPS_PDF_printer_need_to_be_able_to_set_file_mode_)     Fri Feb  7 19:01:30 2014  [DEBUG] title successfully retrieved (What_does_the_CUPS_PDF_printer_need_to_be_able_to_set_file_mode_)     Fri Feb  7 19:01:30 2014  [DEBUG] input data read from stdin     Fri Feb  7 19:01:30 2014  [DEBUG] output filename created (/tmp/michael.cups-pdf/What_does_the_CUPS_PDF_printer_need_to_be_able_to_set_file_mode_.pdf)     Fri Feb  7 19:01:30 2014  [DEBUG] ghostscript commandline built (/usr/bin/gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="/tmp/michael.cups-pdf/What_does_the_CUPS_PDF_printer_need_to_be_able_to_set_file_mode_.pdf" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f /var/spool/cups-pdf/SPOOL/cups2pdf-18015)     Fri Feb  7 19:01:30 2014  [DEBUG] output file unlinked (/tmp/michael.cups-pdf/What_does_the_CUPS_PDF_printer_need_to_be_able_to_set_file_mode_.pdf)     Fri Feb  7 19:01:30 2014  [DEBUG] TMPDIR set for GhostScript (/var/tmp)     Fri Feb  7 19:01:30 2014  [DEBUG] waiting for child to exit     Fri Feb  7 19:01:30 2014  [DEBUG] entering child process     Fri Feb  7 19:01:30 2014  [DEBUG] GID set for current user     Fri Feb  7 19:01:30 2014  [DEBUG] supplementary groups set for current user     Fri Feb  7 19:01:30 2014  [DEBUG] UID set for current user (michael)     Fri Feb  7 19:01:30 2014  [DEBUG] ghostscript has finished (256)     Fri Feb  7 19:01:30 2014  [ERROR] failed to set file mode for PDF file (non fatal) (/tmp/michael.cups-pdf/What_does_the_CUPS_PDF_printer_need_to_be_able_to_set_file_mode_.pdf)     Fri Feb  7 19:01:30 2014  [DEBUG] ERRNO: 2     Fri Feb  7 19:01:30 2014  [DEBUG] no postprocessing     Fri Feb  7 19:01:30 2014  [DEBUG] spoolfile unlinked (/var/spool/cups-pdf/SPOOL/cups2pdf-18015)     Fri Feb  7 19:01:30 2014  [DEBUG] all memory has been freed     Fri Feb  7 19:01:30 2014  [STATUS] PDF creation successfully finished (michael)      I do notice that it looks like Ghostscript is exiting with status 256 (`[DEBUG] ghostscript has finished (256)`), but I can't find anything that tells me why exactly it would exit with that error code. My user account is not a member of the `lp` or `lpadmin` groups, but that hasn't changed. Printing to the physical printer on my desk works fine; I did that just recently, long after printing to PDF started acting up like this. What might be my problem?


Debian Squeeze not detecting any hardware after Gnome 3.8 upgrade

So, somehow I accidentally upgraded to Gnome 3.8 (Don't ask me how, I have no idea). And after a reboot, none of my peripheral devices or interfaces are working. The built in mouse and keyboard do not respond and I have to unplug and replug them before I get any response. Additionally, my realtek ethernet controller is not visible in the network settings window, even though it is listed in /etc/network/interfaces. Also, when using the debian install disk for recovery, all hardware is detected without a problem. I've searched for an answer for days but I've come up short, and I unfortunately don't know enough about Linux to do much more than examine things. Any help you could provide with be extremely appreciated.


How can I create a clean shell environment for temporary use?

I am a frequent answerer on a Unix-focused popular Q&A site, and in many of my answers I provide examples using the `bash` shell. However, each time I do this I have to manually go through the process of creating a clean environment to make sure that every step is accounted for and documented. How can I make this process more straightforward? I am ideally looking to type a single command and get a clean environment, and have all traces of that temporary environment removed after I am done.


Who can use cron? I can't help myself. Who is using cron?

I want to run cron every minute OR hour xclock. It's not that simple as I guessed:( I'll wait for your answer, sir. Maybe It'll be too late, before the right answer as 1 2 3...


Extract binaries from pcap using command line (script)

As the title says, I'm looking for a way to extract binaries from PCAP's using the command line. I realize it is possible using Wireshark -> File -> Export -> http objects etc. But `tshark` doesn't seem to support this. Is there a way to do this or code around this, preferably using `python` or `bash`. Or does anyone know of tools that can do this that I am not aware of. I'd prefer if the method is automatable / scriptable.


Output multiple files from a single grep?

I'm not very experienced in shell scripting, but I'm trying to understand how to grep for a pattern and for each file where there is a match write a file to disk that contains the matched line from grep. For example:               $ grep -E "MY PATTERN" myfile{1,3}      Then write out new files that contain the matching lines:               matches-myfile1     matches-myfile2     matches-myfile3      Is this possible? How can I do this? I'm looking for an answer is bash or zsh.


Fedora19 -- Mouse pointer suddenly disappears

I'm running a desktop machine with Fedora19, Gnome3, dual monitors (30" left, 27" right). Once in a while my mouse pointer disappears from the primary screen. If I move the mouse to the secondary screen, it appears and moves normally but as a garbled icon that looks like this: ![garbled mouse pointer](http://i.stack.imgur.com/mHNf7.png) This happens at random times right in the middle of me working. Although it seems to happen usually when I move the mouse around (e.g. to change focus to another window) rather than when I'm typing on the keyboard. In any case, it isn't due to the system going on suspend or hibernate like in other similar questions. When that happens, so far I haven't found any way to restore the mouse pointer. I found in this answer an idea on how to set the pointer to some other icon and I'll be sure to try that next time it happens. But up until now, even switching user, or logging out and re-logging in doesn't change the situation: invisible mouse on the 30" screen and garbled one on the 27". Not knowing any better solution, I have to reboot. Any ideas? Links:   * output of lsmod   * excerpt of /var/log/messages around the time the pointer gets nuked and up to reboot   * /var/log/Xorg.0.log   * output of dmesg after reboot Other info:               # uname -a     Linux evian 3.14.7-100.fc19.x86_64 #1 SMP Wed Jun 11 22:34:02 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux     # lspci     00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)     00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)     00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)     00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)     00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)     00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)     00:1c.2 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 3 (rev b5)     00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5)     00:1c.4 PCI bridge: Intel Corporation 82801 PCI Bridge (rev b5)     00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b5)     00:1c.6 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 7 (rev b5)     00:1c.7 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 8 (rev b5)     00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)     00:1f.0 ISA bridge: Intel Corporation P67 Express Chipset Family LPC Controller (rev 05)     00:1f.2 RAID bus controller: Intel Corporation 82801 SATA Controller [RAID mode] (rev 05)     00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)     01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV730 GL [FirePro V3750]     01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] RV710/730 HDMI Audio [Radeon HD 4000 series]     03:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9123 PCIe SATA 6.0 Gb/s controller (rev 11)     04:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)     05:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 01)     06:02.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6306/7/8 [Fire II(M)] IEEE 1394 OHCI Controller (rev c0)     07:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)     08:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)     09:00.0 SATA controller: JMicron Technology Corp. JMB362 SATA Controller (rev 10)


How to set the default gcc version for only one user

I share a server (Ubuntu 11.04) with other people and I am the only one who has to use gcc 4-4 for my code, the rest is using 4.5. I already installed gcc 4.4 but how do I make it the default for me, without disturbing the others? **Clarification** The solution needs to work for Makefiles and such. **Update** I tried jw013 idea, but I think I screwed up. I created the symlink with `ln -s /usr/bin/gcc-4.4 ~/bin/gcc` and now my `.bashrc` wont load again. Here are the error messages:               Command 'lesspipe' is available in the following places      * /bin/lesspipe     * /usr/bin/lesspipe     The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.     lesspipe: command not found     Command 'dircolors' is available in '/usr/bin/dircolors'     The command could not be located because '/usr/bin' is not included in the PATH environment variable.     dircolors: command not found     Command 'uname' is available in '/bin/uname'     The command could not be located because '/bin' is not included in the PATH environment variable.     uname: command not found     -bash: [: =: unary operator expected     Command 'sed' is available in '/bin/sed'     The command could not be located because '/bin' is not included in the PATH environment variable.     sed: command not found     Command 'ls' is available in '/bin/ls'     The command could not be located because '/bin' is not included in the PATH environment variable.     ls: command not found


How to configure permissions to allow gedit, apache, and an IDE play together?

I'm using plain Ubuntu Desktop 11.04 and installed my lamp stack using lamp- server. I am trying to use Netbeans as my IDE. Currently, all virtual hosts are being run from `/var/www/vhostname` \-- but as I have not configured any groups or permissions, if I try to open any of the files through Netbeans it does not have write permission. How can I properly set up permissions (or configure Apache or Netbeans) so that:   * Files created by a php script can be `rw` by Netbeans   * Files created by Netbeans can be `rw` by Apache I attempted to `chown` everything to my user/group which gave Netbeans write permission, but then Apache did not have write permission. _Note: This is purely for a development machine -- not used in production, and I am the only user on this box._


The reverse of `tree` - reconstruct file and directory structure from text file contents?

We all know we can use `tree` to get a nicely formatted text "visualization" of the structure of a directory; say:               $ tree -spugD /usr/include/boost/accumulators/numeric/     /usr/include/boost/accumulators/numeric/     ├── [drwxr-xr-x root     root            4096 Dec 19  2011]  detail     │   ├── [-rw-r--r-- root     root            2681 Oct 21  2010]  function1.hpp     │   ├── [-rw-r--r-- root     root             406 Oct 21  2010]  function2.hpp     │   ├── [-rw-r--r-- root     root             409 Oct 21  2010]  function3.hpp     │   ├── [-rw-r--r-- root     root             409 Oct 21  2010]  function4.hpp     │   ├── [-rw-r--r-- root     root            6725 Oct 21  2010]  function_n.hpp     │   └── [-rw-r--r-- root     root             530 Oct 21  2010]  pod_singleton.hpp     ├── [drwxr-xr-x root     root            4096 Dec 19  2011]  functional     │   ├── [-rw-r--r-- root     root            2316 Oct 21  2010]  complex.hpp     │   ├── [-rw-r--r-- root     root           16627 Oct 21  2010]  valarray.hpp     │   └── [-rw-r--r-- root     root           12219 Oct 21  2010]  vector.hpp     ├── [-rw-r--r-- root     root            9473 Oct 21  2010]  functional_fwd.hpp     └── [-rw-r--r-- root     root           21312 Oct 21  2010]  functional.hpp          2 directories, 11 files      What I would want, is the reverse of this - given a text file with the contents as above save in `dirstruct.txt`, I could write something like this (pseudo):               $ reverse-tree dirstruct.txt -o /media/destpath      ... and so, `/media/destpath` directory would be created if it doesn't exist, and inside I would get `detail` subfolder with files `function1.hpp`, etc; as per the tree above. Of course, I can always do a copy `cp -a` and get the same; the idea here would be, that I could change filenames, directory names, sizes, permissions and timestamps in the textfile - and have _that_ reconstructed in the output structure. For files, I first thought I'd be happy with them just being `touch`ed (that is, 0 bytes in size) - but it's probably better that the size is reconstructed too - by filling either 0x00 or random bytes, up to the requested size. Primary use of this would be actually to post questions `:)` \- some of those rely on a directory structure, say from a program I have installed; but the program in itself is irrelevant to the question; then instead of targetting answerers that may happen to have the program installed, I could simply ask a question in respect to an "anonymized" directory tree, which they themselves could quickly reconstruct on their machines, simply by pasting the tree text description in the post. So - is there a straightforward way to achieve this?


I'm looking to experiment with Jython and the default Jython shell leaves a lot to be desired. Is there a way to run Jython in IPython?


What commands can I use to enable / disable Apache2 modules?

What are the terminal commands used to enable and disable Apache2 modules? **Update:** Since the commands appear to differ based on distribution, I have made this question a community wiki where hopefully each poster can indicate the commands they use along with the pertinent distributions in which they work.


Issue in Asterisk Performance

I am running FreePBX on DigitalOcean VM. I am facing some call dropping issue in Asterisk. When looking at "htop", "top" and FreePBX GUI, I see different results of CPU utilization and can't understand if my VM is OK or needs attention w.r.t CPU. Load average shows nearly idle system while CPU utilization of Asterisk process is pretty high. ![enter image description here](http://i.stack.imgur.com/s02K8.jpg) ![enter image description here](http://i.stack.imgur.com/3fBWi.jpg) ![enter image description here](http://i.stack.imgur.com/IAbkj.jpg) Could someone please advise me on this? 74% CPU on a process yet idle system on load average. Can this be an issue causing call dropping on Asterisk?


mounting mmcblk0p1 failed with Invalid argument

When I am running linux from sd card and try to mount sd card -no problem, works fine. But when I am running linux from flash memory I am unable to mount my SD card:               # mount /dev/mmcblk0p1 /mnt/      mount: mounting /dev/mmcblk0p1 on /mnt/ failed: Invalid argument      What could be the basic reason for this error ? **Additional Info**               root@Xilinx-ZC702-14_7:/# mount -t /dev/mmcblk0p1 /mnt     mount: can't find /mnt in /etc/fstab           root@Xilinx-ZC702-14_7:/var/volatile/log# ls     wtmp          root@Xilinx-ZC702-14_7:/var/volatile/log# dmesg     dmesg: klogctl: Function not implemented


Pad a number with a zero

I'm trying to pad zero to a number               a=010     printf "%04d" $a     0008      I need the "output" as "0010" it's converting the value..can any one help on this ?? and even tried with typeset               a=010     typeset -RZ2 a     echo $a      when I use the same in my script I got the following error:               Invalid -R option


exec cp failes from script, yet works when issued directly

I have a script that copies SQL backups to a windows server. Here's the line from /etc/fstab:               //my.win.box/share$ /winshare   cifs    credentials=/etc/credfile,dom=mydomain,uid=0,gid=0,file_mode=0600,dir_mode=0700 0 0      Here's the backup script: backup.sh:               # copy zipped sql exports to /winshare/db     find /backups/sql/*sql.gz -mtime +1 -exec cp {} /winshare/db \;      Logged in with root privileges (in this case, as root)               $ ./backup.sh     cp: cannot create regular file `/winshare/db/mydb_20130301.sql.gz': Permission denied      Yet if I issue the command from a prompt, rather than through the script:               $ find /backups/sql/*sql.gz -mtime +1 -exec cp {} /winshare/db \;      The file(s) are copied as expected. Again, logged in as root here. What could be causing the in-script command to fail, yet the identical command to work from console?


Installing Linux Mint on Windows-Ubuntu Dual Boot

I currently have an Ubuntu-Windows Dual boot. However, I would like to try out a new OS so I burned Linux Mint to a USB stick. I would like to install Linux Mint and remove Ubuntu while still keeping my windows dual boot. I've already backed up my Ubuntu setup so I can wipe it out. In the Linux Mint installer, should I choosing the "install alongside windows" option do this?


How to measure traffic on OpenWRT 12.04

Since just doing a cronjob every morning, before the router reboots:               ifconfig > "`date`.ifconfig.txt"      isn't very effective, since after ~4 GByte's the counter in the ifconfig will go to zero. So if there was ~5 GByte traffic, only 1 GByte will be in the txt file. **My question:** How can I measure daily traffic with OpenWRT 12.04?


What's the difference between print and head?

I know `head` gives you the beginning section of a file. But in this case, I'm trying to go through my source control and find every file that has a shebang line. And I'm failing to get results when I use `head`. What am I doing wrong? When I say doesn't work, i mean it returns nothing. But I know it should've returned something. **Works, but slow!**               find . | awk '!/((\.jpeg)|(\.jpg)|(\.html)|(\.png))$/ {print $0; }' | xargs grep "#!"      **Doesn't Work**               find . | awk '!/((\.jpeg)|(\.jpg)|(\.html)|(\.png))$/ {head $0; }' | xargs grep "#!"      **Update** As @devnull pointed out, and easily verified by googling. I'll list here for reference: Awk Commands               if ( conditional ) statement [ else statement ]     while ( conditional ) statement     for ( expression ; conditional ; expression ) statement     for ( variable in array ) statement     break     continue     { [ statement ] ...}     variable=expression     print [ expression-list ] [ > expression ]     printf format [ , expression-list ] [ > expression ]     next     exit


How can I measure and prevent clock drift?

On several production platforms we have observed symptoms which appear to suggest that the time of day clock is periodically jumping forward or backward. The jumps are typically around 1 second, typically cancel out (jump forward then backward very shortly thereafter) and happen around 50 times per day. This drift is most noticeable during times of peak application usage, and during periods of high disk I/O operations such as daily backups. These drifts are affecting our soft real-time sensitive application. Systems are Oracle Netra X4250 and Netra X4270 servers running SLES 11SP2 with 3.0.58-0.6.6-default kernel.               $ cat /sys/devices/system/clocksource/clocksource0/available_clocksource     tsc hpet acpi_pm          $ cat /sys/devices/system/clocksource/clocksource0/current_clocksource     tsc      We have disabled NTP, but that has not had any effect on the drifts. Are there tools which measure time of day clock drift? How can we avoid this? These are production platforms, and we cannot recreate the issue in our labs, so my ability to experiment is limited. If left to my own devices, I'll write a tool to measure drift, and perhaps experiment with an HPET clocksource.


Installing GRUB2 in a GPT disk on a partition

I'm using a MacBook Air 2013 and I'm trying to install Gentoo. I already did it several times but I always used other "workarounds" to this problem such as using directly a EFI-stub kernel image. What I'm trying to achieve is installing GRUB on a PARTITION so I won't scramble the original disk layout of my Macbook. This is my partition table:                   GPT fdisk (gdisk) version 0.8.8          Partition table scan:       MBR: protective       BSD: not present       APM: not present       GPT: present          Found valid GPT with protective MBR; using GPT.     Disk /dev/sda: 236978176 sectors, 113.0 GiB     Logical sector size: 512 bytes     Disk identifier (GUID): 9DF6BE23-87E0-4602-B71F-7DAD445D5614     Partition table holds up to 128 entries     First usable sector is 34, last usable sector is 236978142     Partitions will be aligned on 8-sector boundaries     Total free space is 6 sectors (3.0 KiB)          Number  Start (sector)    End (sector)  Size       Code  Name        1              40          409639   200.0 MiB   EF00  EFI System Partition        2          409640       176582599   84.0 GiB    AF00  Customer        3       176582600       177852135   619.9 MiB   AB00  Recovery HD        4       177852136       178114279   128.0 MiB   EF00  EFI System        5       178114280       236978142   28.1 GiB    8300  Linux filesystem      The **1st** partition is the original ESP of my Mac (where I installed Refind) and I would like to keep it as it is. I tried to place GRUB on the **4th** partition (which is **vfat** ) but when I try to install it there I get:               # > grub2-install /dev/sda4         /usr/sbin/grub2-bios-setup: warning: File system 'fat' doesnt' support embedding.     /usr/sbin/grub2-bios-setup: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..     /usr/sbin/grub2-bios-setup: error: will not proceed with blocklists.      I also tried using               grub2-install --force /dev/sda4      but that did nothing. How can I solve this thing? Thanks!


counting chars using bash

I'm quite new to bash, and I'm trying to count the number of chars in a file. I wrote the following function:               function chars(){         m=$(cat $1)         m=${#m}         echo $m     }      calling it with `echo $(chars $2)` results on a file the number 524, while calling `wc -c` on the same file results 525. What causes the difference? How can I get the same result? (and as a side question - can I combine the two first lines of my function into one?)


Does bash recognize a variable declaration as string if you do not put the quotation marks?

name=Jackson     echo $name      This will display Jackson.               name="Jackson"     echo $name      This will also display Jackson. So I assume by putting quotation marks around a variable it is making it a string. What would name=Jackson technically be? Would it also be recognized as a string?


Can I list the filesystems a running kernel can support?

I'm trying to detect what filesystems a kernel can support. Ideally in a little list of their names but I'll take anything you've got. Note that I don't mean the current filesystems in use, just ones that the current kernel could, theoretically support directly (obviously, fuse _could_ support infinite numbers more).


Inserting favorites into shell console

Is there any tool/terminal emulator which supports that I can insert my 'favourites' like '2>/dev/null' or 'date +%Y%m%d%H%M' and so forth .. everywhere into the command line ? I could not find any terminal emulator, or clipboard tool which has favorites ... :( Thanks in advance. Using aliases and bash functions are not enough flexible inserting these anywhere into the command line.


privoxy show client ip when sending mail

Is it possible for `privoxy` to show original client ip when sending mail ( example: this mail header should show the client's ip not the proxy ip:               Received: from [xx.xx.xx.xx] by web142501.mail.bf1.yahoo.com via HTTP;      I found that this               { +change-x-forwarded-for{add} }      will detect the proxy ip and also the client's ip but does not seem to work with mail headers.


run a php script in centos and time and timeout

I want to run a php script in centos ( `/usr/bin/php file.php` ), and it takes long time to execute,and in the middle of executing , it stops running , and does not give me any errors. and I'm sure that there is absolutely no error in my php code (I tested it in many way) , I think it's the matter of time of executing.   my question is :   * is it possible that it's timeout error from my server that stops the script from executing ?   * if yes, how can I set the server to gives timeout error in a longer time? Thanks.


Yast2 is downgrading external packages

I've downloaded and installed the latest packages of mono from their page.(version 3.2) But after installing some other packages using Yast2, Yast2 downgraded all the mono packages to the version that is aviable in Yast2 repository. (version 3.0). Is there a way to tell Yast2 to stop doing it ?


Can anyone decipher this kernel stack trace? I think it's hardware, but

May 14 02:40:59 cerberus kernel: [480872.848991] BUG: unable to handle kernel NULL pointer dereference at           (null)     May 14 02:40:59 cerberus kernel: [480872.849015] IP: [] osi_TryEvictVCache+0xcd/0x2b0 [libafs]     May 14 02:40:59 cerberus kernel: [480872.849047] PGD cb056067 PUD cb057067 PMD 0      May 14 02:40:59 cerberus kernel: [480872.849056] Oops: 0000 [#1] SMP      May 14 02:40:59 cerberus kernel: [480872.849064] Modules linked in: fuse nfsv4 nfs dns_resolver fscache libafs(POF) hwmon_vid coretemp iTCO_wdt snd_hda_codec_via iTCO_vendor_support snd_hda_intel snd_hda_codec kvm_intel atl1e snd_hwdep snd_seq snd_seq_device snd_pcm kvm snd_page_alloc snd_timer snd soundcore lpc_ich mfd_core i2c_i801 ppdev asus_atk0110 microcode parport_pc parport nfsd auth_rpcgss nfs_acl lockd sunrpc nouveau mxm_wmi wmi video i2c_algo_bit drm_kms_helper ttm drm i2c_core     May 14 02:40:59 cerberus kernel: [480872.849147] CPU 0      May 14 02:40:59 cerberus kernel: [480872.849152] Pid: 772, comm: afsd Tainted: PF          O 3.8.11-200.fc18.x86_64 #1 System manufacturer System Product Name/P5KPL-AM EPU     May 14 02:40:59 cerberus kernel: [480872.849160] RIP: 0010:[]  [] osi_TryEvictVCache+0xcd/0x2b0 [libafs]     May 14 02:40:59 cerberus kernel: [480872.849178] RSP: 0018:ffff88010455dd38  EFLAGS: 00010246     May 14 02:40:59 cerberus kernel: [480872.849182] RAX: 0000000000001515 RBX: ffff88007db79e00 RCX: ffff8800afd01860     May 14 02:40:59 cerberus kernel: [480872.849187] RDX: 0000000000000000 RSI: 0000000000000282 RDI: ffff88007db79e88     May 14 02:40:59 cerberus kernel: [480872.849192] RBP: ffff88010455dd78 R08: ffff88011fc13d80 R09: 0000000000000001     May 14 02:40:59 cerberus kernel: [480872.849197] R10: 0000000000000000 R11: 0000000000000001 R12: ffff88007db79e88     May 14 02:40:59 cerberus kernel: [480872.849203] R13: 0000000000000001 R14: 0000000000000000 R15: ffff88007db79e00     May 14 02:40:59 cerberus kernel: [480872.849208] FS:  0000000000000000(0000) GS:ffff88011fc00000(0000) knlGS:0000000000000000     May 14 02:40:59 cerberus kernel: [480872.849214] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b     May 14 02:40:59 cerberus kernel: [480872.849218] CR2: 0000000000000000 CR3: 00000000cb055000 CR4: 00000000000407f0     May 14 02:40:59 cerberus kernel: [480872.849223] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000     May 14 02:40:59 cerberus kernel: [480872.849227] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400     May 14 02:40:59 cerberus kernel: [480872.849233] Process afsd (pid: 772, threadinfo ffff88010455c000, task ffff880115649760)     May 14 02:40:59 cerberus kernel: [480872.849237] Stack:     May 14 02:40:59 cerberus kernel: [480872.849240]  ffff88010455ddb4 0000000000000000 ffff88006ce88b40 ffff880051f498a0     May 14 02:40:59 cerberus kernel: [480872.849249]  0000000000082d3b 0000000000000001 0000000000000000 ffff88007db79e00     May 14 02:40:59 cerberus kernel: [480872.849258]  ffff88010455dde8 ffffffffa0406aab 0000000000000000 0000000000000000     May 14 02:40:59 cerberus kernel: [480872.849267] Call Trace:     May 14 02:40:59 cerberus kernel: [480872.849282]  [] afs_ShakeLooseVCaches+0x8b/0x220 [libafs]     May 14 02:40:59 cerberus kernel: [480872.849298]  [] afs_Daemon+0x263/0x660 [libafs]     May 14 02:40:59 cerberus kernel: [480872.849314]  [] ? afsd_launcher+0x50/0x50 [libafs]     May 14 02:40:59 cerberus kernel: [480872.849329]  [] afsd_thread+0x2fb/0x740 [libafs]     May 14 02:40:59 cerberus kernel: [480872.849344]  [] ? afsd_launcher+0x50/0x50 [libafs]     May 14 02:40:59 cerberus kernel: [480872.849352]  [] kthread+0xc0/0xd0     May 14 02:40:59 cerberus kernel: [480872.849358]  [] ? perf_trace_xen_cpu_write_gdt_entry+0xa0/0x100     May 14 02:40:59 cerberus kernel: [480872.849364]  [] ? kthread_create_on_node+0x120/0x120     May 14 02:40:59 cerberus kernel: [480872.849372]  [] ret_from_fork+0x7c/0xb0     May 14 02:40:59 cerberus kernel: [480872.849377]  [] ? kthread_create_on_node+0x120/0x120     May 14 02:40:59 cerberus kernel: [480872.849382] Code: c7 c7 60 5c 45 a0 c7 05 96 89 03 00 00 00 00 00 e8 09 ef 21 e1 4c 89 e7 e8 71 14 22 e1 48 8b 93 08 01 00 00 48 89 55 c8 49 89 d6  8b 36 4d 85 f6 74 6a 4d 8d 7e ac 4c 89 ff e8 4f 14 22 e1 49      May 14 02:40:59 cerberus kernel: [480872.849458] RIP  [] osi_TryEvictVCache+0xcd/0x2b0 [libafs]     May 14 02:40:59 cerberus kernel: [480872.849473]  RSP      May 14 02:40:59 cerberus kernel: [480872.849479] CR2: 0000000000000000     May 14 02:40:59 cerberus kernel: [480872.856504] ---[ end trace d58385207fb6dcb9 ]---


Understanding Perf tool output

I recently installed Perf tool On my platform and wanted to use it for profiling my platform. I started profiling a standalone application.Below command I used                  perf start ./helloworld            Performance counter stats for './helloworld':                4.555957 task-clock                #    0.000 CPUs utilized                  1 context-switches          #    0.219 K/sec                  0 cpu-migrations            #    0.000 K/sec                124 page-faults               #    0.027 M/sec                <not supported> cycles                <not supported> stalled-cycles-frontend                <not supported> stalled-cycles-backend                <not supported> instructions                <not supported> branches                <not supported> branch-misses                     60.005519331 seconds time elapsed      Now I am not sure how should I interpretate this output.is it as expected? Also,what should I make of < not supported > filed here,Is there anything I need to enable to support this fied before run the command?


How to search and replace multiple needles by one word via one expression?

Assume you have a text file:               foo fnord bar     bizz foo poit      And now I would want to replace both "foo" and "bar" into "narf". I know I could use:                sed -e 's/foo/narf/g' -e 's/bar/narf/g' fileName      Yet I would like to work with an OR-operator that tells the regex to match both needles via one expression. Hitting some manuals I suppose the pipe should fit my needs but I tried               sed -e 's/foo|bar/narf/g' -i fileName      and it didn't work and it's not even throwing an error. What am I doing wrong here?


Clean up concatenated XML files

I'm trying to fix my Delicious export script to work with the new "trick" of only serving 1000 bookmarks at a time. The script concatenates results (XML) from multiple calls in a single file, and now I have to get rid of the header and footer text from the resulting file. Example:               <?xml ...     <posts ...       <post ...       ...          # 998 other posts       <post ...     </posts>     # Line 1003     # The above lines are repeated N times before the final line:     </posts>      In other words, I want to remove any lines not starting with `<post` between (excluding) the third and the last line, and each chunk of XML is 1003 lines exactly, except for possibly the last one. I'm guessing `sed` or `awk` should be perfect for this.


Trouble getting awk output in for loop

I'm trying to create a script that will check a website for a word. I have a few to check so I'm trying to input them via another file. The file is called "testurls". In the file I list the keyword then the URL. They are separated with a semicolon.               Example Domains;www.example.com     Google;www.google.com      Here is the script:               #!/bin/bash     clear          # Call list of keywords and urls     DATA=`cat testurls`          for keyurl in $DATA     do         keyword=`awk -F ";" '{print $1}' $keyurl`         url=`awk -F ";" '{print $2}' $keyurl`         curl -silent $url | grep '$keyword' > /dev/null      if [ $? != 0 ]; then         # Fail             echo "Did not find $keyword on $url"         else         # Pass             echo $url "Okay"     fi     done      The output is:               awk: cannot open Example (No such file or directory)     awk: cannot open Example (No such file or directory)     curl: no URL specified!     curl: try 'curl --help' or 'curl --manual' for more information     Did not find  on     awk: cannot open Domains;www.example.com (No such file or directory)     awk: cannot open Domains;www.example.com (No such file or directory)     curl: no URL specified!     curl: try 'curl --help' or 'curl --manual' for more information     Did not find  on     awk: cannot open Google;www.google.com (No such file or directory)     awk: cannot open Google;www.google.com (No such file or directory)     curl: no URL specified!     curl: try 'curl --help' or 'curl --manual' for more information     Did not find  on      I've hacked away at this for ages now. Any help is very welcome.


no root shell freely available sudoers policies

I want to prevent users who need escalated privileges from obtaining any kind of a root shell. However since there are many ways to attain this, and many non root commands ( like those found in coreutils ) I'm wondering if there are any downloadable sudoers policies that provide restrictive access.


How to write simple if condition in ash?

I would like to write a small script that would check every once in a while if I have the internet connection. I would like to run it in `crontab` on my router where I have `ash`. I am having a hard time using `ash` with if conditionals So far I have gotten to something like this :               #!/bin/ash          echo $i     if [ $(ping -c 1 google.com) -eq 0 ]     then       echo "IT WORKS :)"     else       echo "no internet :( "     fi      But it gets me this error :               # ./restart_on_no_connection.sh      ash: google.com: unknown operand     no internet      Any ideas ?


Get current versions of applications via apt-get

I am new to debian. What bothers me is that apt-get install shows just really old versions of everything. E. g. "Eclipse Galileo" but currently it's "Juno" and imho there was "Helios" and "Indigo" in between. And gcc is 4.2 but I need at least 4.6 for c++11 features. My question ist how can I get apt-get to show me new versions of the programs?


VMwarePlayer on debian. Missing kernel modules

Today I changed my workstation to Debian. As Ubuntu is not nearly stable. Now I installed VMware player. I started it and got a message "Before you can run VMware, several modules must be compiled and and loaded into the running kernel. Kernel headers for version2.6.32-5-amd64 were not found" , below a field were I can give a file location. What should I do now? I never faced such a situation.


Autocompletion for Makefile rules in tcsh

I'm using `tcsh` in a SUSE 11 box and I realized that when typing `make``Tab` it allows me to auto-complete the rules available within the Makefile, not the files that are inside the current directory. I've tested this with RedHat and Ubuntu at work and Debian at home (all with `tcsh`), and none of them supports this (IMO) nice behavior. How can this be achieved with the other distributions as well?   This is something I've wanted to have since many years ago.


Apache cannot fork: cannot allocate memory

I am running `apache` on Fedora with `mod_perl`. The server forks a process to send an email frequently - and the fork exits. Suddenly, I got: `Cannot fork: Cannot allocate memory`. There was plenty of free memory (I did not look too closely, but there was more memory free than in use), not too many `apache` processes running - 10?, low cpu usage, close to 0. Restarting the server httpd graceful resolved the issue. What would cause something like this? Is it possible that I got into some kind of a state where the problem was allocating too many processes in the system - and with dropping load failed to recover? Unfortunately I do not have too much info as I was panicking and trying to get the site up instead of running diagnostics. :-) So my question is very general: is there anything that's not obvious that would create this behavior when too many processes are allocated? Anything specific to forking from within apache? etc Thank you!


"select" vs "depends" in kernel Kconfig

What are the differences in dependencies between `select` and `depends on` in the kernels Kconfig files?               config FB_CIRRUS     tristate "Cirrus Logic support"     depends on FB && (ZORRO || PCI)     select FB_CFB_FILLRECT     select FB_CFB_COPYAREA     select FB_CFB_IMAGEBLIT     ---help---     This enables support for Cirrus Logic GD542x/543x based boards on     Amiga: SD64, Piccolo, Picasso II/II+, Picasso IV, or EGS Spectrum.      In the example above, how is `FB_CIRRUS` diffrently related to `FB && (ZORRO || PCI)` than it is to `FB_CFB_FILLRECT`, `FB_CFB_COPYAREA` and `FB_CFB_IMAGEBLIT`?


grep and escaping a dollar sign

I want to know which files have the string `$Id$`.               grep \$Id\$  my_dir/mylist_of_files      returns 0 occurrences. I discovered that I have to use `grep \$Id$ my_dir/mylist_of_files` Then I see that the `$Id` is colored in the output, i.e. it has been matched. How could I match the second `$` and why doesn't `\$Id\$` work. It doesn't matter if the second `$` is the last character or not. I use `grep` 2.9. * * * Before posting my question, I used google... I found an answer > To search for a $ (dollar sign) in the file named test2, enter: > > grep \\\$ test2 > > The \\\ (double backslash) characters are necessary in order to force the > shell to pass a \$ (single backslash, dollar sign) to the grep command. The > \ (single backslash) character tells the grep command to treat the following > character (in this example the $) as a literal character rather than an > expression character. Use the fgrep command to avoid the necessity of using > escape characters such as the backslash. but I don't understand why `grep \$Id` works and why `grep \\$Id\\$` doesn't. I'm a little bit confused...


Directory/files owned by a non-existent user

A user has created a directory with files, but the user does not exist in `/etc/passwd` or `/etc/group`. The system is a Fedora server with an FTP server and proxy which redirects to a CentOS server with Apache where the directory was created. Where could the user have come from? Is this a security problem?


What to use when burning footage

I'm running Zorin OS 9 and filmed some things on my camera and am about to edit them. What can I use to burn them to my blank DVD-R disks?


hostapd, ath5k, nl80211 - how to get it working?

I have this network adapter in an Asus notebook running Manjaro Linux (based on Arch), everything up to date (Kernel: 3.10.11):               > lspci -k | grep -A 3 -i "network"     lspci: Unable to load libkmod resources: error -12     07:00.0 Ethernet controller: Qualcomm Atheros AR242x / AR542x Wireless Network Adapter (PCI-Express) (rev 01)         Subsystem: AzureWave AW-GE780 802.11bg Wireless Mini PCIe Card         Kernel driver in use: ath5k      `iwconfig` gives:               > iwconfig     wlp7s0    IEEE 802.11bg  ESSID:off/any                 Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm                  Retry  long limit:7   RTS thr:off   Fragment thr:off               Power Management:off      I have `hostapd` 2.0 installed. My minimal config is:               interface=wlp7s0     driver=nl80211     hw_mode=g     ssid=test     channel=6      Running it gives               > hostapd test.conf     Configuration file: test.conf     Could not set interface wlp7s0 flags (UP): Operation not permitted     nl80211 driver initialization failed.      Running with `sudo`:               sudo hostapd test.conf     Configuration file: test.conf     nl80211: Failed to set interface wlp7s0 into AP mode     nl80211 driver initialization failed.      What is wrong here? How do I get my notebook to work as an AP?


When and how was the double-dash (--) introduced as an end of options delimiter in Unix/Linux?

I don't think the shell/utilities in historical Unix nor in something as "recent" as _4.4BSD_ supported using a double-dash(or two consecutive hyphens) as an _end of options delimiter_. With _FreeBSD_ , you can see for instance a note introduced in the `rm` manpages with the _2.2.1 release_ (1997). But this is just the documentation for one command. Looking at the oldest _GNU fileutils_ changelog I can find, I see this1(slightly altered):               Tue Aug 28 18:05:24 1990  David J. MacKenzie  (djm at albert.ai.mit.edu)          * touch.c (main): Don't interpret first non-option arg as a   <---       time if `--' is given (POSIX-required kludge).       * touch.c: Add long-named options.     * Many files: Include <getopt.h> instead of "getopt.h" since       getopt.h will be in the GNU /usr/include.     * install.c: Declare some functions.     * touch.c, getdate.y, posixtime.y, mktime.c: New files, from bin-src.     * posixtime.y: Move year from before time to after it (but       before the seconds), for 1003.2 draft 10.      This predates _Linux_. It's clearly to account for the fact that you might want to create a file with a name containing the same number of digits as a time specification(eight or ten-digit decimal number) - rather than specifying a timestamp for an existing file... * * *   * So is it _posix.1_ which introduced the double-dash (`--`) as an _end of options delimiter_ in Unix shells?   * Did this all start because some people wanted to use digits in filenames with `touch` in the early '90s and then this went on in a piecemeal fashion one utility at a time for a decade??   * What is the spirited comment in the changelog about?   * When was _Guideline 10_ ( _The argument -- should be accepted as a delimiter indicating the end of options.[...]_ ) introduced to the POSIX Utility Syntax? * * * 1\. As opposed to this i.e. documenting the long options in all commands usage globally, which is unrelated. On the other hand, you can see reference to the delimiter appear in something like _GNU_ _rm.c_ in 2000 as a comment, before being exposed to the end user in 2005(the _diagnose_leading_hyphen_ function). But this is all much later and is about a very specific use case.


Calendaring daemon

I'm looking for a calendaring application that runs as a daemon, engages with the system eg starting applications or interacting with the desktop environment ( KDE ,Gnome ,E17, Lxde etc. ). I would like it to be able to sync with common calendaring applications probably via iCal but not being well versed in calendaring I'm not certain.


Why access file is being ignored by Postfix?

I have installed Postfix, I can send mails between local users as expected, but I would try to limit the access of a particular user to the server. I edited the `/etc/postfix/access` file in this way:               diego@example.com REJECT      where example.com is `$mydomain`. I did also a `postmap access` to generate the validate file. Strangely, I can still send mail from the diego account using mutt. Here the maillog:               Jan 22 15:46:36 server postfix/pickup[6637]: 62117BF647: uid=500 from=<diego>     Jan 22 15:46:36 server postfix/cleanup[6737]: 62117BF647: message-id=<20140122144636.GA6732@server.example.com>     Jan 22 15:46:36 server postfix/qmgr[6638]: 62117BF647: from=<diego@example.com>, size=422, nrcpt=1 (queue active)     Jan 22 15:46:36 server postfix/local[6739]: 62117BF647: to=<localuser@server.example.com>, relay=local, delay=0.07, delays=0.06/0.02/0/0, dsn=2.0.0, status=sent (delivered to mailbox)     Jan 22 15:46:36 server postfix/qmgr[6638]: 62117BF647: removed


Why is apache2 showing up a defunct in the process list?

When I run `top` I see one line that doesn't look too good:                2475 www-data  20   0     0    0    0 Z    1  0.0   0:00.19 apache2 <defunct>       Why is this process `<defunct>` and what should I do about it? (sorry, I'm new to this)


Strategy to extract movies's name from this ununiform dataset?

I am working on a movie database problem to improve regular expressions, this is the problem I'm running into. My dataset looks like this: > Movie Name (variable space and tabs) year   >  **Movie1** (can have spaces or multiple spaces between them)(variable > spaces and tabs could be \t+ or multiple space or single space> **Year1**   >  **Movie2** (can have spaces or multiple spaces between them)(variable > spaces and tabs could be \t+ or multiple space or single space> **Year2**   >  **Movie3** (can have spaces or multiple spaces between them)(variable > spaces and tabs could be \t+ or multiple space or single space> **Year3**   >  **Movie4** (can have spaces or multiple spaces between them)(variable > spaces and tabs could be \t+ or multiple space or single space> **Year4**   > I want to extract names of all of the movies. These are the challenges I'm facing while doing it: > 1: The delimiter is variable. If it was colon or something unique, I would > have used an awk command to extract them like this awk -F 'separator' > '{print $1}'   >  In this case, it can be single space, two or more spaces or combination of > \t or spaces. > > 2: For those rows where delimiter is \t, I can use a \t to extract it, > because that does not come in movie names. But what if the delimiter is one > space or two spaces. They can very easily appear in the movie's name. In > those cases, I don't know what to do. I know the question is very rigid and specific. But as I described earlier, I'm very much blocked here. I can't think of any way around this problem. Is there any combination of grep/sed/awk with reg-ex that can be used to achieve the objective?


Configure Cent OS 6.4 so that desktop persists after closing VNC session?

I want to configure my newly bought VPS to be able to automatically boot into the Xfce window manager and let users connect to it via VNC and still keep the window manager running after the user closes the VNC session. How can I do this?


How to modprobe radeon and turn off card at start with systemd?

ArchLinux has completly replaced `rc.conf` with `systemd`. I used `/etc/rc.local` to modprobe `radeon` module and turn it off using vgaswitcheroo.               modprobe radeon && echo OFF > /sys/kernel/debug/vgaswitcheroo/switch      But, there is no `rc.conf` in ArchLinux anymore. How can I do it with `systemd` ?


How do I load modules at startup in a certain order?

I have a group of modules that I need to be loaded at startup. I've followed the documentation for loading a module however I need load these modules in a certain order. I've tried creating a bash script that uses a for loop and loads each module in the order I need.               mods=(mod1 mod2 mod3 ... modN)     for mod in $(mods); do         if [ ! -c /dev/input/$mod ] ; then             exec /sbin/modprobe $mod > /dev/null 2>&1         fi     done      I've also tried creating a bash script that loads each module individually without at looping.               if [ ! -c /dev/input/mod1] ; then             exec /sbin/modprobe mod1 > /dev/null 2>&1     fi          if [ ! -c /dev/input/mod2 ] ; then             exec /sbin/modprobe mod2 > /dev/null 2>&1     fi          ...          if [ ! -c /dev/input/modN ] ; then             exec /sbin/modprobe modN > /dev/null 2>&1     fi      In both cases, only the first module is loaded, and none of the others. Enabling more debugging out of the script (`#!/bin/sh -ex`) in both cases stops exactly at:               + exec /sbin/modprobe mod1      I'm assuming that the system see that the first modules is correctly loaded and then terminates (but I'm not for sure on this). How do I then load modules at startup in a specified order?


MySQL 3.23 on Centos 6?

Don't ask why, just is it possible to install old mysql 3.23 on new CentOS 6.4 i386 or x64 version (same to me)?


New Tmux Panes go to the same directory as the current pane; new tmux windows go to home directory?

Can anyone help me set up this configuration? If I create a new pane, the new pane should start out in the same working directory as the pane I was just in. If I create a new window, the new window should start out in the home directory (or any other global default path). Is this possible with tmux 1.8?


convert /dev/md0 to /dev/sda1

I used a Software-RAID I and want to access the data without RAID now. After               mdadm --fail /dev/md0 /dev/sda1     mdadm --remove /dev/md0 /dev/sda1      I tried               mount -t ext4 /dev/sda1 /mnt      but dmesg says               [ 5620.788838] EXT4-fs (sdb1): ext4_check_descriptors: Block bitmap for group 1 not in group (block 0)!     [ 5620.788841] EXT4-fs (sdb1): group descriptors corrupted!      Isn't it possible to convert a RAID-partition to non-RAID? Do I have to copy all files to another partition, delete the RAID partition and create a new file system?


Undo iptables modification

I ran the following `iptables` commands to create a blacklist rule but used the wrong port:               iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --set --name SSH     iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j SSH_WHITELIST     iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 --rttl --name SSH -j ULOG --ulog-prefix SSH_brute_force     iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 --rttl --name SSH -j DROP      How can I undo the above and then redo it for a different port?


Canot remove symlinks: after reboot, symlinks re-appear

Using `ssh` from BusyBox, I cannot remove symlinks: after rebooting the device, symlinks re-appear. `ls -la` shows that symlinks have been removed, but after rebooting device they re-appear again. Those symlinks already existed beforehand, created at installing the firmware.               $ rm uw_cert.cer      I tried to remove _uw_cert.cer_ and _uw_key_prv.bin_ , but it reappears after reboot. The other files can be removed without problem.               <root@fwre:/nvram/1/security> ls -la     total 5     drwxr-xr-x    3 root     0                0 Jan  1 00:00 .     drwxr-xr-x    5 root     0                0 Jan  1 00:05 ..     -rwxrwxrwx    1 root     0              905 Jan  1 00:06 cm_cert.cer     drwxr-xr-x    2 root     0                0 Jan  1 00:00 download     lrwxrwxrwx    1 root     0               25 Jan  1 00:00 uw_cert.cer -> /nvram/fw/bpi/uw_cert.cer     lrwxrwxrwx    1 root     0               28 Jan  1 00:00 uw_key_prv.bin -> /nvram/fw/bpi/uw_key_prv.bin     -rwxrwxrwx    1 root     0             1052 Jan  1 00:06 mfg_cert.cer     -rwxrwxrwx    1 root     0              140 Jan  1 00:02 mfg_key_pub.bin     lrwxrwxrwx    1 root     0               37 Jan  1 00:00 root_pub_key.bin -> /etc/docsis/security/root_pub_key.bin      `mount` output:               <root@fware:/var/tmp> mount     rootfs on / type rootfs (rw)     /dev/root on / type squashfs (ro)     proc on /proc type proc (rw)     ramfs on /var type ramfs (rw)     sysfs on /sys type sysfs (rw)     tmpfs on /dev type tmpfs (rw)     devpts on /dev/pts type devpts (rw)     /dev/mtdblock4 on /nvram type jffs2 (rw)      **EDIT** :               df /nvram/1/security     Filesystem           1K-blocks      Used Available Use% Mounted on     /dev/mtdblock4             320       256        64  80% /nvram          cat /proc/mounts     rootfs / rootfs rw 0 0     /dev/root / squashfs ro 0 0     proc /proc proc rw 0 0     ramfs /var ramfs rw 0 0     sysfs /sys sysfs rw 0 0     tmpfs /dev tmpfs rw 0 0     devpts /dev/pts devpts rw 0 0     /dev/mtdblock4 /nvram jffs2 rw 0 0


Vim shared copy register

When working with Vim I often work from multiple monitors and multiple split terminals so I have multiple instances of VIM running at all time. Is there a way to have a persistent shared register that allows me to share the copy paste buffer(Buffer maybe the wrong term here) Is there a setting in VIM or a plugin that would allow me to do this.   And example of the work flow I want is to open VIM and yank text close vim Go to another terminal open VIM and paste that yoinked text.


New files and folders created, automatically inherit same permissions as parent folder

Does it exist? I create a folder with, let's say, all permissions set, and some services (i.e. Apache web server) create subfolders and put files there (uploaded media files from website users). Such subfolders have permissions set so that only www-data (Apache user) can write to them. My problem arises because I have a script which has to be able to create subfolders and files, the same way as Apache does. But **when it tries to write a new file to an existing folder** created by Apache, **it can't because of the permissions**. Is there any way in Linux (Ubuntu distro) to set so that a newly created subfolder inherits same permissions as parent folder? I have been reading a while about guid, sticky bits and so, but I am not very savvy in sysadmin, and, in the middle of a rush of work, this whole thing overwhelmes me... I am using python and mod-wsgi, if this information is useful in any way. Thanks!


Tell pkg-config to look *.pc files also in /usr/local/lib/pkgconfig, system-wide

Right now `pkg-config` looks only in `/usr/lib/pkgconfig`. I can adjust it for a user by exporting the `PKG_CONFIG_PATH` environment variable, but once again I forgot to do it for root and wasted time wondering, why my plugin is not installed properly (the makefile used `pkg-config`). So how can set it system wide, so it would always look in to both `/usr/lib` and `/usr/local/lib`?


How to get a click-able link for a shared file, when sending an e-mail with the file-name in it

I've got a local network with a shared drive mounted to it, all machines running Fedora (and some Windows). When we want to share a file, there is no easy way of just getting a link for the file like in windows, but rather I need to get the directory first, and then append the filename at the end i.e smb://server/share/files/Documentation.odt That in itself is cumbersome, but the problem occurs when a filename has spaces in it, then the link that is sent by e-mail is rendered totally useless and looks something like this: smb://server/share/files/Set Up Documentation.odt Is there anything that I could do in order to have a simple maybe right-click solution which gives me the link of the file to send in an e-mail (preferably a non-terminal solution).


Automating a disk move & extension?

I have an ancient 128GB SSD, with two non-LVM ext4 partitions, I would like to copy these to a 256GB SSD and roughly doubling the partitions while doing so. Problem is, I don't want to sit at the laptop twiddling my thumbs for who knows how long. I really would like to put in a USB stick and go to sleep :). Is there something I could configure / script doing this?


What do I need to add a virtual IPsec adapter?

I'm trying to set up an IPsec connection manually from the console with iproute2. What I need is a virtual interface (at best, a virtual IP address could also be sufficient) that IPsec-transforms everthing ingressing (ESP/TUNNEL MODE) and hands it over to eth0 (on my system called em1). On the other set a peer takes the packet from its own eth deciphers it and hands it over to a virtual interface a the other side. So I want do establish a "normal" IPsec tunnel. I've got no problem with the policy and SA, and configuring that was easy using the normal ethernet addresses of the systems in transport mode, i.e.               ip xfrm policy add src 198.51.100.1 dst 198.51.100.2 dir out tmpl proto esp     ip xfrm state  add src 198.51.100.1 dst 198.51.100.2 spi 24501 proto esp enc des 0xAABBCCDDEEFF0011     ip xfrm state  add src 198.51.100.2 dst 198.51.100.1 spi 24501 proto esp enc des 0xAABBCCDDEEFF0022      and an adversary configuration on the peer works quite well. Now I tried to set up a virtual IP and a route to the other system with               ip address add 10.0.0.0 dev em1     ip route add to 10.0.0.2 via 10.0.0.1      and again vice versa on the other side. This again works well. Then I altered the IPsec policy and SA to               ip xfrm policy add src 10.0.0.1 dst 10.0.0.2 dir out tmpl src 198.51.100.1 dst 198.51.100.2 proto esp mode tunnel     ip xfrm state  add src 10.0.0.1 dst 10.0.0.2 spi 24501 proto esp enc des 0xAABBCCDDEEFF0011     ip xfrm state  add src 10.0.0.2 dst 10.0.0.1 spi 24501 proto esp enc des 0xAABBCCDDEEFF0022      When I now try to `tcping` the peer I get no answer and `setkey -PD` tells me, that the security policy was never triggered. Now I'm trying to fabricate a working virtual interface to handle the IPsec tunnel, but I don't know how to bind it to the physical interface and how I get the kernel to apply the security policy. It is vital for me that I can solve this with iproute2, as I ultimately want to do this out of a C++ program and I have already the appropriate classes that drop Netlink commands the same style the `ip` command does (what I can do with `ip`, I also can do within my code). In fact, the first part already works out of my program and I want to use the same Netlink API functions for the rest. _Update_ I figured out that the state needed to be set up with the tunnel addresses so the working SAs are               ip xfrm state  add src 10.0.0.1 dst 10.0.0.2 spi 24501 proto esp enc des 0xAABBCCDDEEFF0011     ip xfrm state  add src 10.0.0.2 dst 10.0.0.1 spi 24501 proto esp enc des 0xAABBCCDDEEFF0022      while the policy remains the same. Now the policy is triggered and I see a transformed packet on a sniffing port. Also iptables on the other machine blocked the packet and I disabled it for testing. So, the one direction seems to work now, but I still get no answer. I also don't know if the problem is _yet_ somehow the transform, the routing or the interface part. My prefered solution would still be one including a virtual interface, but I don't have any idea how to bind it to a physical one, let alone if the transform would work that way.


continuous testing of a C++ project on github with different Linux distros

Is there any framework to automatically try to compile a C++ project on github.com on every commit made, similar to what http://jenkins-ci.org or http://travis-ci.org do for different compilers on an Ubuntu VM, but for different Linux distros and versions?   EDIT: Ideally this would be a service where one doesn't need to maintain the different distros as VMs, but does that on the cloud, like travis-ci does for Ubuntu VMs.


Does TMUX have unit tests or a test suite?

I am going through my configuration shell scripts and I have found the `make` commands to run test suites for pretty much every "big" open source project that I use (`vim`, `zsh`...) except for tmux. I can't find anything documented that says I can run `make test` or something of the sort to ensure everything is in order before I `sudo make install`. Does anybody know?


Missing iptables file on directory /etc/init.d/ (Fedora 17)

Is the iptables file in Fedora 17 moved from `/etc/init.d/` to `/etc/sysconfig/`? I need do some patching to the iptables file to solve the firewall problem (Setting chains to policy ACCEPT: security raw nat mangle filter [FAILED]).


Automount external storage as user readable and writable in Debian XFCE?

I have Debian Wheezy installed with the latest XFCE desktop environment. In the XFCE settings, I specified that external media be automounted upon insertion. However, when I plug in my USB stick, it appears on my desktop, but is not mounted because there is no permission. In fact I have to use sudo to mount, access, read, and write from the USB drive. I don't want to use the fstab method because you need an entry for each unique device and it is simply very inefficient. How can I setup my system so that whenever I plug in an external storage device, it will automount and be fully user accessible? It seems a little silly that this functionality does not come "out of the box" and "just work" (or at least easily enabled) in the 21st century... :) Thanks for your help!


What is a good strategy to generate and copy files atomically

I have a file `myfile` that must be re-generated periodically. Re-generation takes some seconds. On the other hand, I have to periodically read the last (or next to last) file generated. What is the best way to guarantee that I am reading a completely generated file and that, once I begin reading it, I will be able to read it completely? One possible solution is   1. `myfile` is actually a soft link to the last generated file, say `myfile.last`.   2. regeneration is done on a new file, say `myfile.new`   3. after regeneration, `myfile.new` is moved onto `myfile.last` The problem I see (and I don't know the answer to) is: if another script is copying `myfile` while the mv takes place, does `cp` finish correctly? Another possible solution would be to generate files with a timestamp on its name, say `myfile-2014-09-03_12:34` and `myfile` is again a soft link to the last created file. This link should be changed after creation to point to the new file. Again: what are the odds that something like `cp myfile anotherfile` copies a corrupted file?


Peculiar lack of RHEL 5.8 service management documentation

I am needing to see the status of some services on some of our RHEL 5.8 hosts on which I am not an admin. Much to my surprise, I am not able to get any info how to do it (such as `chkconfig` or `systemctl` on Fedora) from Google. Neither `chkconfig` nor `systemctl` are accessible to me, not sure if it is because of permissions or they are just not available on the system but there are no man pages for either. Why is it that there is such a mysterious lack of service management documentation online for RHEL 5.8 and which commands can I use for simple service listings?


what is the best study guide for the LPIC2 exam

Can anyone recommend a good study guide/book for the LPIC2 exam besides the Sybex/Roderick Smith book?


From Windows 7 + Ubuntu to Crunchbang (First) + Windows 8 (second?)

I'm dual booting a Windows 7 + Ubuntu machine. I went ahead and replaced Ubuntu with Crunchbang, and now want to replace (not in place upgrade) Windows 7 with Windows 8. However, I've always done a dual boot with Windows first. I know that if I now try to install Win8 it will override the boot record. How can I make it so that I can install Win8 without loosing my already customized Crunchbang install?


File size conflict

I am new to UNIX and have a doubt about file size in UNIX (AIX). `ls -ltr` shows me `fileA` size as 59096. As per my knowledge this is in bytes ,so it is nearly = 0.06 MB However, a script which should `zip` files greater than 1MB, also zips this file:               find [dir] -type f -size +1M -exec gzip {} \;      Based on my testing it evaluates the same `fileA` size to be 115 MB and hence compresses the file. Can some one please help. My aim is to zip all files above 1 MB.


What is the status of HiDPI support in Xfce?

I'm looking for a new work laptop for development work on linux, and after testing way too many distros, I pretty much does not want to ever use anything other than Xubuntu or possibly some other Debian/Ubuntu based Xfce setup. What worries me is that most of the recent laptops with Haswell processors I have looked at also supports extremely high resolution, which would require the desktop to use higher DPI settings (HiDPI) in order to be usable. Thus I was wondering, what is the status for HiDPI support in Xfce? (I have found some sources claiming the support is not good at the moment, but I didn't find any info on whether it is being worked on or not!)


Copy files and directory tree for filesize in specified range

Hi I would like to make a small script copying files from different directories example `/pp/01` `/pp/02/` etc... to another destination with the same directory design. But only those files within the directory with a size larger than 88MB but smaller than 93MB... I would use a for loop and the find function. Are there more efficient ways? And how can I implement the find function exactly. Could somebody help me with it? I am new to Unix.


Find out which command is running within a screen session

I often leave tasks running within screen so that I can check on them later, but I sometimes need to check which command is running within the screen. It's usually a php script of sorts, such as               screen -d -m nice -n -10 php -f convertThread.php start=10000      I don't record which screens are running which command, but I'd like to be able to get a feel for the progress made by checking what command was run within it, without killing the process. I don't see any option for this within the screen help pages.


how to stretch mplayer to both monitors (fullscreen) in a xinerama setup

I am using the window manager Xmonad and have two monitors in a Xinerama setup. I want to display videos with mplayer fullscreen across the two monitors. But, by default, I want mplayer to be a tiled window. Until now I have done this manually:   * by pressing the ModMask key and the right mouse button on the lower right corner of the mplayer window to resize it   * and then by pressing the ModMask key and the left mouse button in the middle of the mplayer window, moving it to fit into the two screens. How can I achive this semiautomatically?


Removing Gnome GUI and Booting From CLI

I'm running an ARM version of Ubuntu provided by Linaro. I'm not 100% sure on current version as I'm re-installing using the manufacturing tools (I want to say its Linaro 11.10). However, I was wondering if anyone could help me with an issue? I did a `sudo apt-get remove gnome*`, to get rid of all the GNOME packages since I do not want a GUI. I restarted the system and I did not get a CLI. The screen was just black. Is there a way to get to CLI or where/how would I change the files to boot to CLI?


Here is the following info: > Do I need more swap? > > No, disk caching only borrows the ram that applications don't currently > want. It will not use swap. If applications want more memory, they just take > it back from the disk cache. They will not start swapping. But I conducted an experiment that show something different. Just take a look:               # free -m                  total       used       free     shared    buffers     cached     Mem:          1001        941         59          0          2        127     -/+ buffers/cache:        811        189     Swap:         2347        693       1654      There's 811MiB in RAM and 693MiB in SWAP. Now is the time to close some apps, and I got something like this:               root:~# free -m                  total       used       free     shared    buffers     cached     Mem:          1001        531        469          0          4        126     -/+ buffers/cache:        400        600     Swap:         2347        361       1986      So, now it's 400MiB in RAM, and 361 in SWAP. If I run `swapoff`, there should be 400+361=761 MiB in RAM, but that's not going to happen:               root:~# swapoff -a     root:~# free -m                  total       used       free     shared    buffers     cached     Mem:          1001        860        140          0          6        251     -/+ buffers/cache:        602        398     Swap:            0          0          0      There's only 602MiB in RAM, and the question is where the hell is the other 159MiB ? I thought it's because of the ZRAM feature. The following are statistics of SWAP devices before running `swapoff`:               root:~# swapon -s     Filename                                Type            Size    Used    Priority     /dev/mapper/debian_crypt-swap           partition       2097148 99620   10     /dev/zram0                              partition       153596  135072  70     /dev/zram1                              partition       153596  135092  70      But I also checked the normal SWAP partition, and the effect was more or less the same, just the amount of cached data was smaller (60MiB). Is there a way to prevent SWAP from collecting cached data?


How do I get the creation date of a file on an NTFS logical volume?

I created an NTFS logical volume on my Linux system for Windows file storage because I want to retain the creation date of my files (I would probably zip them into an archive and then unzip them, though I have no idea if that would work). Does NTFS-3G save the creation date of files on Linux? If so, how do I access it? Reading this thread, the OP links documentation on NTFS that provides a shell script for finding the creation date. I modified it in an attempt to get the seconds from the hex value, but I believe that I am doing something wrong:               #!/bin/sh     CRTIME=`getfattr -h -e hex -n system.ntfs_times $1 | \         grep '=' | sed -e 's/^.*=\(0x................\).*$/\1/'`     SECONDS=$(($CRTIME / 10000000))     echo `date --date=$SECONDS`


tftp transfer painfully slow

I am using `HPA's tftp server` for `PXE` boot. When I try downloading an image from my tftp server using `curl`, the transfer rate is less than `3 MB/s`, even on my 1Gb network.               curl -o initrd.gz tftp://192.168.0.4:69/boot/debian/initrd.gz      Is this an inherent limitation of the `tftp` protocol, or can this be configured?


limitation on count of records returned by ls -lrt

Is there any limitation on count of records returned by `ls -lrt`? I am seeing problem of crash in OEL 4.7 environment where my `ls -lrt` command may return more than 100K records.


How can I add a signature .png to a PDF in Linux?

I have a scanned copy of my written signature and I need to apply it to some documents in the signature block. I used to do this on Windows all the time but I now have only Linux. Is this possible? How can I add a signature image to a PDF file in Linux (Gnome 3)?


Is a page with "PROT_NONE bit set" eligible for swapping?

From the following link: Page Table Management - kernel.org, I understood that the bits `PROT_NONE` and `PRESENT` can be used to let the OS know that a page is protected but is resident in memory. I am using these 2 bits to track the pages that are accessed by a process. Here is what I am doing,   1. I clear the `PRESENT` bit and set the `PROT_NONE` bit of pages of a process I want to track so that a page fault occurs when that process tries to access the tracked pages.   2. On page fault, inside __handle_mm_fault before calling handle_pte_fault (x86), I clear `PROT_NONE` and set `PRESENT` if the page is tracked by me. This way, the execution proceeds normally. But there will be an issue if the page is swapped out meanwhile by the OS. So, I would like to know:   1. If a page with `PROT_NONE` bit set can be swapped out?   2. What happens to the bits `PROT_NONE`, when such a protected page is swapped out? I mean how to distinguish if the page is swapped out or not? Because `PRESENT` bit is cleared already. Please point out in case any of my understanding is wrong.


Simple Script to setenv tcsh or export bash

I am having problems with simple scripting, my Box is CentOS so bash is the default shell, now I wanted to send a line via setenv (tcsh) and would like to make a script that will ask me to input a string to setenv every time I login. By the way I am using teraterm logging in.


Segmentation fault in libGL.so.1

A while back I posted a question about running a 32 bit app in Debian Wheezy 64 bit Thanks to @JosephR I was able to run it without the nasty `could not find libGL.so.1` error. Now, however, the app crashes out in the middle of the execution. In the terminal appeared this message after the crashdown:               Aug  2 10:04:16 acs-laptop kernel: [  213.472753] aquaria[7006]: segfault at 8 ip 00000000f41238fb sp 00000000ffceabc0 error 4 in libGL.so.1.2[f4107000+54000]      Reinstalling the driver did not solved the problem and I'm not sure what it's causing it. Is there a bug in running the 32 bit version of `libGL.so` in a 64 bit system?


Renaming multiple files with rename

I need help renaming files in batch--the other questions I browsed don't exactly address my problem. The names of my files are generated non- deterministically, so I can't predict what they will be named. I do know that they will start with `NORMAL` and end with `-lib*`. I'd like to replace everything in between with some string `X`. For example,               |   |   |-- NORMAL_H_LS-A7-A0CE-10A-01D-A017-09-lib1.concordant     |   |   |-- NORMAL_H_LS-A7-A0CE-10A-01D-A017-09-lib1.deletion     |   |   |-- NORMAL_H_LS-A7-A0CE-10A-01D-A017-09-lib1.divergent     |   |   |-- NORMAL_H_LS-A7-A0CE-10A-01D-A017-09-lib1.inversion     |   |   |-- NORMAL_H_LS-A7-A0CE-10A-01D-A017-09-lib1.translocation     |   |   |-- NORMAL_H_LS-A7-A0CE-10A-01D-A017-09-lib4.concordant     |   |   |-- NORMAL_H_LS-A7-A0CE-10A-01D-A017-09-lib4.deletion     |   |   |-- NORMAL_H_LS-A7-A0CE-10A-01D-A017-09-lib4.divergent     |   |   |-- NORMAL_H_LS-A7-A0CE-10A-01D-A017-09-lib4.insertion     |   |   |-- NORMAL_H_LS-A7-A0CE-10A-01D-A017-09-lib4.inversion     |   |   |-- NORMAL_H_LS-A7-A0CE-10A-01D-A017-09-lib4.translocation      So it will probably be of the form `rename "s/something/X/"`, but I don't know what that something should be, as I don't know how to use regex.


What is a simple way to schedule a single event to happen at some time in the future?

There are often times that I want my computer to do a single task, but not right now. For example, I could have it notify me in 30 minutes that it is time to leave work. Or maybe I want it to run a complicated test 2 hours from now when I'm sure most everyone else will be gone from the office. I know I could create a cron job to run at a specific time of day, but that seems like a lot of work when all I want is something simple like "Run this script in 10 minutes", besides I'd have to figure out what time it will actually be X minutes/hours/days from now, and then delete the cron job once it finished. Of course I could just write this script and run it in the background:               sleep X     do_task      But that just seems so clunky: I either need a new script for each task, or I need to write and maintain a script generic enough to do what I want, not to mention I have to figure out how many seconds are in the minutes, hours, or days I want. Is there not an already established solution to this problem?


How do I delete the first n lines of an ascii file using shell commands?

I have multiple files that contain ascii text information in the first 5-10 lines, followed by well-tabulated matrix information. In a shell script, I want to remove these first few lines of text so that I can use the pure matrix information in another program. How can I use bash shell commands to do this? If it's any help, I'm using RedHat and an Ubuntu linux systems.


How can I first download KDE files and then install them offline on Ubuntu?

How can I first download **KDE** files and then install them offline on Ubuntu?


How to prevent certain memory location to be accessed

I have 2 corrupted RAM module, on offset: 46xx MB and 13xxx MB (from `memtest` on boot) How to prevent Linux to access/alloc/read/write into those offset? Here's the result of `memtester` on ~1000 MB to ~1400 MB: http://pastie.org/9433211


mutt: automatically show new mesages

When I have mutt opened, I don't see new emails until I press a key, for example arrow down. Then new emails appear. Is there a way for mutt do recognize that new email has arrived, and display the email automatically, without me having to press a key every few minutes? I am using maildir format (locally stored emails). What would be the best way? Should mutt check every n seconds, or should it be notified by the OS, perhaps using inotify ?


GNU/Linux: "device mapper: create ioctl failed" "device or resource busy"

I can't mount my encrypted devices anymore. The error is:               device mapper: create ioctl failed      device or resource busy      This error arises both with two different programs to access TrueCrypt encrypted devices: TrueCrypt and Tc-play. In this case, the recommendation is to remove /dev/mapper/truecrypt* directories, or look for processes that are blocking the device. However, there is no /dev/mapper/truecrypt* directory, and "lsof" returns nothing. One TrueCrypt device takes a whole HDD. According to "fdisk", this partition is formatted with HPFS/NTFS. Another TrueCrypt device is on a partition on /dev/sda. According to "fdisk", this partition is "Linux" (ext3 or ext4, if I remember correctly). What could be causing the error? Thank you. Software:   * Debian GNU/Linux 6


Tracing the workings of a function in Emacs

I am learning emacs lisp. One of the things I was playing with was setting variables. So I go and set fill-column to 50 (setq fill-column 60). After this evaluating fill-column does give me 60, but the function fill-paragraph ignores this. How would I go about figuring out why this happens? Thanks. Best, Bart


Does verifying packages enhance security and/or stability of a system?

RedHat/CentOS and Ubuntu both provide packages to verify the contents of a package. CentOS uses rpm -V. Ubuntu uses debsums. I've spoken to admins who run these tools to verify the packages on their systems. Do these tools enhance the security of a system, or do they provide a false sense of security? Likewise, do these tools increase the stability of a system, since they can help detect problems after filesystem corruption?


/proc/meminfo MemTotal =?

**What elements of`/proc/meminfo` sum up to `MemTotal`?** Example of `tee /tmp/proc/meminfo < /proc/meminfo`               MemTotal:        1279296 kB     MemFree:          164092 kB     Buffers:           62392 kB     Cached:           378116 kB     SwapCached:            0 kB     Active:           715176 kB     Inactive:         307800 kB     Active(anon):     583268 kB     Inactive(anon):     3384 kB     Active(file):     131908 kB     Inactive(file):   304416 kB     Unevictable:           0 kB     Mlocked:               0 kB     SwapTotal:             0 kB     SwapFree:              0 kB     Dirty:                44 kB     Writeback:             0 kB     AnonPages:        582480 kB     Mapped:           112904 kB     Shmem:              4192 kB     Slab:              47524 kB     SReclaimable:      33588 kB     SUnreclaim:        13936 kB     KernelStack:        1568 kB     PageTables:        12092 kB     NFS_Unstable:          0 kB     Bounce:                0 kB     WritebackTmp:          0 kB     CommitLimit:      639648 kB     Committed_AS:    1298132 kB     VmallocTotal:   34359738367 kB     VmallocUsed:       24012 kB     VmallocChunk:   34359696868 kB     HardwareCorrupted:     0 kB     AnonHugePages:     77824 kB     HugePages_Total:       0     HugePages_Free:        0     HugePages_Rsvd:        0     HugePages_Surp:        0     Hugepagesize:       2048 kB     DirectMap4k:        8832 kB     DirectMap2M:     1300480 kB      Here are snippets that helps me in checking different configurations:               # Let's load them into CLI variables     all=$(sed 's!:[^0-9]\+!=!;s! kB!!;s![()]!_!g' /tmp/proc/meminfo) ; eval $all     # Let's make overview sorted by values (helps in tracking missing one)     echo $all | sed 's! !\n!g' | sort -n -k 2 -t '='      # Let's try Memtotal=MemFree+Active+Cached+Buffers ? (should be zero)     echo $[ $MemTotal - $MemFree - $Active - $Cached - $Buffers ]     # But gives -40480      What am I missing? Which elements of `/proc/meminfo` should I sum to get `MemTotal`?


Why Debian CD has 52 CD

> **Possible Duplicate:**   >  31 Debian CDs -- Why? and which do I need for a vanilla desktop install? I am about to install Debian. But Debian has 52 CD Images \- how can Debian be so large? 52 CDs will equate to almost 36 GB! Am I mistaking something or what?


How to grep standard error stream (stderr)?

I am using ffmpeg to get the meta info of an audio clip. But I am unable to grep it.                   $ ffmpeg -i 01-Daemon.mp3  |grep -i Duration         FFmpeg version SVN-r15261, Copyright (c) 2000-2008 Fabrice Bellard, et al.           configuration: --prefix=/usr --bindir=/usr/bin            --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib           --mandir=/usr/share/man --arch=i386 --extra-cflags=-O2            ...      I checked, this ffmpeg output is directed to stderr.               $ ffmpeg -i 01-Daemon.mp3 2> /dev/null      So I think that grep is unable to read error stream to catch matching lines. How can we enable grep to read error stream? Using nixCraft link, I redirected standard error stream to standard output stream, then grep worked.               $ ffmpeg -i 01-Daemon.mp3 2>&1 | grep -i Duration       Duration: 01:15:12.33, start: 0.000000, bitrate: 64 kb/s      But what if we do not want to redirect stderr to stdout?


how to stop adding unused module to loadable kernel module?

Is there any way how to stop unused module to loadable kernel module other than putting them in the mod probe blacklist.


CD Ripping Without Temporary Files

I would like to be able to rip a CD through the command line (using **cdparanoia** and **lame** , preferably) _without having to use temporary files_. I'm thinking that this would save some time with the encoding process, but if this isn't the case, please let me know. So far, I've tried `cdparanoia 1 - | lame -f --silent - track.mp3`, and it worked well on that first track. However, I can't figure out how I can pipe all of the tracks from the CD in this way without doing some slightly messy parsing of the CD track table. Is this kind of thing feasable in a one-liner, or will I have to grab the number of tracks and iterate? EDIT: I'd appreciate input on whether or not ripping the full CD in this way and splitting tracks post-encoding would be any better or more feasable.