title: How to get near-perfect screen recording quality?

text: Someone suggested I direct a copy of the unmodified X display to a file and afterwards convert that file to a general purpose video file. What commands would I use to do this on a Kubuntu system? (Edit: He said something about attaching a display port to a file.) If not possible, what is my best option for an excellent quality screen recording that does not depend on fast hardware? _Background:_ I tried using avconv with -f x11grab and some GUI programs. However, no matter what I try, the resulting video either has artifacts/ blurriness or is choppy (missing frames). This is probably due to CPU/ memory constraints. _Goals:_   * Video quality must not be noticeably different from seeing the session directly on a screen, because the purpose is to demonstrate an animated application.    * The final video must be in a common format that can be sent to Windows users and used on the web. I think H.264 MP4 should work.    * The solution should not presume much prior knowledge. I am familiar with the command line and basic Linux commands, but I am still learning Linux and do not know much about video codecs. _What I already tried:_   * Best command so far: `ffmpeg -f x11grab -s xga -r 30 -i :0.0 -qscale 0.1 -vcodec huffyuv grab.avi`, then convert to mp4 with `ffmpeg -i grab.avi -sameq -vcodec mpeg4 grab.mp4`.      * The picture quality is great, but on my test sytem it lags the computer. On a faster target system it does not lag, but frames are obviously skipped, making the video not very _smooth_.     * I am still trying to figure out how to save the grab.avi file to SHM to see if that helps.   * Using Istanbul and RecordMyDesktop GUI recorders   * Simple command: `avconv -f x11grab -s xga -r 25 -i :0.0 simple.mpg` using avconv version 0.8.3-4:0.8.3-0ubuntu0.12.04.1   * Adding `-codec:copy` (fails with: `Requested output format 'x11grab' is not a suitable output format`)   * Adding `-same_quant` (results in great quality, but is very choppy/ missing many frames)   * Adding `-vpre lossless_ultrafast` (fails with: `Unrecognized option 'vpre'`, `Failed to set value 'lossless_ultrafast' for option 'vpre'`)   * Adding various values of `-qscale`   * Adding various values of `-b`   * Adding `-vcodec h264` (outputs repeatedly: `Error while decoding stream #0:0`, `[h264 @ 0x8300980] no frame!`)      * Note: h264 is listed in `avconv -formats` output as `DE h264 raw H.264 video format`


I'm trying to install an 32_bit_application on CentOS (64-bit), while running the `setup.bin` file it return the following error               Invocation of this Java Application has caused an InvocationTargetException. This application will now exit. (LAX)          Stack Trace:     java.lang.UnsatisfiedLinkError: /tmp/install.dir.28410/Linux/resource/jre/lib/i386/xawt/libmawt.so: Can't load IA 32-bit .so on a IA 32-bit platform             at java.lang.ClassLoader$NativeLibrary.load(Native Method)             at java.lang.ClassLoader.loadLibrary0(Unknown Source)             at java.lang.ClassLoader.loadLibrary(Unknown Source)             at java.lang.Runtime.load0(Unknown Source)             at java.lang.System.load(Unknown Source)             at java.lang.ClassLoader$NativeLibrary.load(Native Method)             at java.lang.ClassLoader.loadLibrary0(Unknown Source)             at java.lang.ClassLoader.loadLibrary(Unknown Source)             at java.lang.Runtime.loadLibrary0(Unknown Source)             at java.lang.System.loadLibrary(Unknown Source)             at sun.security.action.LoadLibraryAction.run(Unknown Source)             at java.security.AccessController.doPrivileged(Native Method)             at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)             at sun.awt.DebugHelper.<clinit>(Unknown Source)             at java.awt.Component.<clinit>(Unknown Source)             at com.zerog.ia.installer.util.BidiUtilImpl.setDefaultLocale(DashoA10*..)             at ZeroGbb.a(DashoA10*..)             at com.zerog.ia.installer.LifeCycleManager.q(DashoA10*..)             at com.zerog.ia.installer.LifeCycleManager.b(DashoA10*..)             at com.zerog.ia.installer.LifeCycleManager.a(DashoA10*..)             at com.zerog.ia.installer.Main.main(DashoA10*..)             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)             at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)             at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)             at java.lang.reflect.Method.invoke(Unknown Source)             at com.zerog.lax.LAX.launch(DashoA10*..)             at com.zerog.lax.LAX.main(DashoA10*..)     This Application has Unexpectedly Quit: Invocation of this Java Application has caused an InvocationTargetException. This application will now exit. (LAX)      please help me to resolve this.


title: cgroups analogue in Darwin

text: Is there an analogue to cgroups in Darwin for preventing processes from escaping from the control / monitoring of its parent process by means of `fork()`? If yes, what is it? For some background, consider a process, P, a direct descendant, Q, and the descendants of Q, R: cgroups allows P to control and monitor Q and R. If P launches Q, but Q spawns a process (r in R), without something akin to cgroups, P is unable to monitor r. A real world example of this would be systemd (P) spawning openssh's sshd (Q) as a daemon, which then spawns other instances of sshd (R) to handle each opened session. Without cgroups, systemd would not be able to interact with the per-session sshd's. (In the NT environment, cgroups are analogous to Job objects.)


title: Fedora won't boot after installing Nvidia drivers

text: I followed this tutorial about Nvidia drivers installation and I accidentally forget to do 5th point (disabling nouveau drivers), so now I can't boot my system. I know I am idiot but is there anything I can do to fix this? **EDIT** My boot options are (I don't if this is correct or not)               Fedora (3.8.9-200.fc18.x86_64)     other two with different version      When I press `e` to any of these I get lines setparams, then indenticated load_video, setgfxpayload, insmod 3x, set root, then if-else, linux, initrd. There is no line starting with kernel unfortunately. Ok, I was able to unistall the drivers so I could boot with nouveau again.


title: HISTTIMEFORMAT modification. In /etc/bash.rc or /etc/profile?

text: I'd like to add the date/time to the output of the `history` command in CentOS/RHEL 6. I would like this to apply to all users on the machine by default. This itself is easy. It seems to just be a case of adding:               export HISTTIMEFORMAT="%Y%m%d %T  "      Where should that be added? I've seen some conflicting info on whether to add this to `/etc/profile` or `/etc/bashrc`. I believe both would work equally well. Does anyone have any advice as to which file I should use for this specific modification?


title: Custom key bindings for vi shell mode, ie, "set -o vi"?

text: I just discovered the wonders of `set -o vi`, and am curious if it is possible to customize this vi shell mode in some of the same ways you can customized vi or vim? For example, create a custom key binding to map a more convenient key or key combo to `esc`? If it's not currently supported, how difficult would it be to alter the source code of the program and hardcode in some customizations, or would that be a bad idea?


title: Replacing Multiple Debian Packages from Compiled Source

text: I've had to download and install a version of a library from its source code repository. The problem is is that other packages from the Kubuntu package manager require this library to be installed. Right now I'm working with ffmpeg, but I've had to do it before (e.g. OpenCV) and I'm looking into the best way of doing this for the future... So what I'm trying to do is create a debian package that I can install with dpkg using checkinstall. I've since decompressed the deb file to modify it trying to get it working correctly The problem is, ffmpeg is split into multiple packages in the package manager and I don't want to have to write the 5/6 packages to replace each and every one if I don't have to. I have made sure it is properly compiled with everything that is required for all these packages. I've been trying to use the "Requires" and "Replaces" but it just doesn't seem to work correctly. When I try to install VLC afterwards, it asks to install all the ones from the package manager. I've also made sure the version number is later than the ones in the package manager. ![VLC Pre-Requisites](http://i.stack.imgur.com/yd5CL.png) Here's what's written in my deb control file. As far as I can see, this is all recognised in the muon package manager.               Package: ffmpeg     Priority: extra     Section: checkinstall     Installed-Size: 172216     Maintainer: root@skund     Architecture: amd64     Version: 8:1.2.1-git-2     Provides: ffmpeg,libav-tools,libpostproc52,libavdevice53,libavutil51,libavformat53,libavcodec53,libswscale2     Replaces: ffmpeg,libav-tools,libpostproc52,libavdevice53,libavutil51,libavformat53,libavcodec53,libswscale2     Description: Package created with checkinstall 1.6.2      And here it is installed in the package manager: ![ffmpeg package manager](http://i.stack.imgur.com/M6vQ5.png) ![ffmpeg package manager 2](http://i.stack.imgur.com/YW9Wn.png) Does anyone have any ideas on getting this working?


title: Linux Mint on laptop fails, gives grub error

text: I am trying to install the latest Linux Mint onto my laptop via a USB stick. The laptop previously had Ubuntu, and it had a separate `/home` partition. I'm overriding and reformatting the `/` partition, and leaving the `/home` partition in place. I'm replacing Ubuntu with Mint, but trying to keep my personal data. The install process seems to go just fine, right up until I reboot. Then I get this error:               error: file `/boot/grub/x86_64-efi/normal.mod' not found.     grub rescue>      I thought maybe I hadn't specified which partition to boot from when installing, so I went back twice and re-installed to make sure, but I can't determine anything about the install process that I am not setting correctly. Not that I can tell, anyway. How do I resolve this error so that I can get my Mint up and running?


title: Nohup process not running into ssh

text: I have a question on the use of `nohup` in an `ssh` session. During more than three years my java software executed the following command daily using a remote ssh session:               cd some_path; chmod 777 script.sh; ./script.sh      the content of script is:               nohup java java_command parameters &      It's simple and working perfectly all the time in red hat machines. In a new software installation using the same environment the command is not working. It is also not working if I execute it manually from any remote ssh session. However, if I change the content of `script.sh`, removing the `nohup` and `&`, then the command works properly. What can be the problem? The ssh settings are the same. The only difference that I found is that `umask` is `0012` in the new installation and in the original installation it was `0022`. Additional info: The original installation is a RHEL 5.4 and the new installation is a RHEL 6.3. Is the 6.3 version more restrictive by default?


title: Are there any good Embedded Linux image builder?

text: I'm looking for an image builder to create several Embedded Linux images for different ARM boards. I know the following image builder: linaro, buildroot, openEmbedded, yocto If I've missed one, please tell me. And can you tell me which one you would use and why?


title: How to force a file location in equivs-build

text: I have some files that I would like to install using `.deb` files created using `equivs-build`. What I cannot understand is the syntax required in the `.equivs` file. This is my file layout:               myapp.equivs     myapp/       files/         script.sh      What I want to tell `equivs-build` is to install the `script.sh` file at `/usr/share/myapp/script.sh`. I did some tests, but none of the following syntaxes for `Files` seems to work as intended. **Test 1**               Files: ./myapp/files/script.sh /usr/share/myapp/script.sh      Result: file installed in `/usr/share/myapp/script.sh/myapp/files/script.sh`. **Test 2**               Files: ./demo/files/script.sh /usr/share/myapp/      Result: file installed in `/usr/share/myapp/myapp/files/script.sh`. **Test 3**               Files: ./demo/files/script.sh /usr/share/myapp      Result: file installed in `/usr/share/myapp/myapp/files/script.sh`. How can I instruct equivs-build to install a file at an arbitrary location?


title: Slackware 14.0 upgrade OpenGL

text: I wanted to run a tutorial program for OpenGL in my Slackware 14.0. It compiled well, but when I try to run it, it quits with an error: error: GLSL 3.30 is not supported. Supported versions are: 1.00 ES, 1.10, and 1.20 I am using radeon driver. How to upgrade OpenGL?


title: Configuring Pulse Audio for easy use with multiple USB DACs?

text: I have 3 Behringer UCA-202 DACs going into a mixer. I want something similar to this setup:   1. 1 DAC: Misc Audio to be mixed: output to go to the mixer.   2. 1 DAC: Audio In: Record/Broadcast: input to come from the mixer.   3. 1 DAC: Input to come from `AUX send 1` on the mixer, and Output to go to the mixer on another channel. This will be used for Skype. I have one laptop, I want it to handle all of this. I can get all of this working properly however it takes _way_ to much time for my liking. Is there anyway I can ease this process. All of these DAC's have the same USB ID, 08bb:2902. They're all plugged into the same USB hub though (which I keep on my desk). Further, I'll plug that USB hub into the same input on my computer. This yields static `device.bus_paths` in Pulse,               "pci-0000:00:1d.7-usb-0:2.1:1.0"     "pci-0000:00:1d.7-usb-0:2.2:1.0"     "pci-0000:00:1d.7-usb-0:2.3:1.0"      Can I always associate a sink with a specific bus_path? Every time I plug or unplug the USB hub I get new sink addresses? This would permit me to script the rest of what I need to do with easy `PULSE_SINK=`, commands.


title: Auto-detect headphone jack

text: I am using ALSA on Arch Linux on a MacBook Air 5,2 (mid 2012). This is my first time using alsa by itself (without any tools that come with gnome), so I may have not configured something in order to make the jack work. I would like to be able to have it auto-detect when I plug headphones into the jack. Can anyone help me do this? The relevant kernel module for this setup is `snd_hda_intel` but I'm not sure if I have to configure the kernel module or ALSA in order to get this to work.


title: Executing bash shell scripts

text: I am reading an article on executing bash shell scripts. Method 1: Create a directory for your shell scripts and add the directory to the contents of the PATH variable, so that you can execute the script as shown below. When this executes, the variables, functions and aliases created in this subshell are only known to the particular bash session of that subshell. When that shell exits and the parent regains control, everything is cleaned up and all changes to the state of the shell made by the script, are forgotten.               $ hello_world.sh      Method 2: A script can also explicitly be executed by a given shell. The specified shell will start as a subshell of your current shell and execute the script.               $ sh script_name.sh      Method 3: If you don't want to start a new shell but execute the script in the current shell, you source it:               source script_name.sh      I really don't understand the benefits and disadvantages of each of these methods. Can anyone clarify?


title: Eject CD on shutdown

text: OK, so I have a simple problem: I have a live CD, and I want the CD to eject when the computer is rebooted or halted. Executing `/usr/bin/eject -m` makes the CD eject just fine... trouble is, as you might expect, this then crashes the OS because it now can't read any files. So the reboot never happens, because `/sbin/reboot` is inaccessible. (I tried executing `reboot --help > /dev/null` right before the reboot, but there are still other files which still can't be read...) In summary, it appears that I need to make the eject be _the very last thing_ that happens. So it seems that `systemd` is the puppy I need to play with... But I have wasted literally _hours_ of my life poking and prodding it, and no matter what I do, it never, ever, under any circumstances, actually ejects the CD. And I have no idea why. I've tried a dozen different ways of invoking `eject`, but nothing ever happens. Can anybody tell me the simplest way to run `eject`? (I imagine just after `umount.target` would be sensible...)


title: Error when calling mv with wildcards

text: #! /bin/bash          error_text=$(tail -n +1 /path/dir/folder/exc/a/update/Abd/ER/* | \         grep 'Warning\|Loaded\|Event')     echo $error_text          nc 10.10.99.45 25 << EOF     ehlo mail.abc.pvt     mail from: robot@abc.com     rcpt to: asa@abc.com     data     subject: errors     $error_text     .     quit     EOF     mv Abc*.err /path/dir/folder/exc/a/update/Abd/ER/BkError/      The error I get is               mv: cannot stat `ACQ*.err': No such file or directory


title: How to repair Ubuntu after upgrade? (from recovery mode)

text: I have gone through countless threads on the following error and none have helped.                Your screen, graphics card, and input device settings could not be detected      correctly. You will need to configure these yourself.      I have tried countless things but nothing works. This pops up every time I reboot. The computer was running fine then all of a sudden it crashed and I got this error. I can enter recovery mode, mount the system read/write, go to the root shell, connect to the internet and run apt-get. As said above, I have **already tried lots of solution from other forums** , what I decided now is to reinstall all packages related to this. How can I make a list of thing to reinstall with apt-get? Like everything related to the "screen, graphics card, and input device settings" part. Or could I even re-install completely all system files (preserving my programs) from this command line? As alternative, I'd install a different Ubuntu version (also from recovery mode). I have space in the HDD.


title: User profiles in yum Repository Definition Files

text: I have a host where the `yum.repos.d` directory contains a yum repository definition file that has a password protected repository and so has a plain text username and password. This is not a big deal since this host does not have user accounts other than the administrator with sudo privileges. However, I had the urge to make this file readable to root only, and I realized right away I couldn't do that:               Error: Error accessing file for config file://///etc/yum.repos.d/myrepo.repo      Which makes sense, but now I am curious if yum was designed to allow something like user profiles. How can I have a repository configuration file which is only loaded under a certain user? If this is not possible, does that mean that all users of a system must share all the repository definitions? If I had a private repository for which I did not want to share the password, am I forced to delete that repository definition file after using the repository?


title: Arch time zone: Wrong time due to local-time hardware clock

text: My hardware clock is set to local time (GMT +2) and my fresh Arch installation apparently thinks that it is not, so it adds 3 hours to it. I've fiddled with `hwclock` and `timedatectl` without hope. I'm hesitant to touch time settings in BIOS. How can I fix this? Below is the output from `timedatectl`:                     Local time: Sun 2013-06-23 06:44:12 EEST       Universal time: Sun 2013-06-23 03:44:12 UTC             Timezone: Europe/Istanbul (EEST, +0300)          NTP enabled: n/a     NTP synchronized: no      RTC in local TZ: yes           DST active: yes      Last DST change: DST began at                       Sun 2013-03-31 02:59:59 EET                       Sun 2013-03-31 04:00:00 EEST      Next DST change: DST ends (the clock jumps one hour backwards) at                       Sun 2013-10-27 03:59:59 EEST                       Sun 2013-10-27 03:00:00 EET          Warning: The RTC is configured to maintain time in the local time zone. This              mode is not fully supported and will create various problems with time              zone changes and daylight saving adjustments. If at all possible use              RTC in UTC, by calling 'timedatectl set-local-rtc 0'.


title: sed syntax to remove 2 characters only when it is box and space

text: I have a `sed` expression to remove the first 2 characters from all the lines in a file.               sed 's/^..//' raw.txt > converted.txt      However, the problem is some lines are large and get appended to the next line. For example,if I consider the input as in the below lines,               □ I have box and space in front     □ I am a large line which will     get appended to next line.     □ I am another line.      As per my `sed` syntax, I am getting the output as,               I have box and space in front     I am a large line which will     t appended to next line.      I am another line.       However, the output am expecting is,               I have box and space in front.      I am a large line which will get appended to next line.      I am another line.       How should I modify the sed expression to achieve this?


title: Can't find rbenv after installation

text: I've been trying to install rbenv on my fresh Debian 7.4 install, per the instructions here. I follow all the steps on the guide, and they all work fine: I can use rbenv to install Rubies and gems just fine. But if I close the terminal and start a new shell I see this:               bash: rbenv: command not found      What gives?


title: How to restart the Python script automatically if it is killed or dies

text: I am running my Python script in the background in my Ubuntu machine (12.04) like this -               nohup python testing.py > test.out &      Now, it might be possible that at some stage my above `Python script` can die for whatever reason. So I am thinking to have some sort of `cron agent` in bash shell script which can restart my above Python script automatically if it is killed for whatever reason. Is this possible to do? If yes, then what's the best way to solve these kind of problem? **UPDATE:** After creating the `testing.conf` file like this -               chdir /tekooz     exec python testing.py     respawn      I ran below sudo command to start it but I cannot see that process running behind using ps ax?               root@bx13:/bezook# sudo start testing     testing start/running, process 27794     root@bx13:/bezook# ps ax | grep testing.py     27806 pts/3    S+     0:00 grep --color=auto testing.py      Any idea why px ax is not showing me anything? And how do I check whether my program is running or not? This is my python script -               #!/usr/bin/python     while True:         print "Hello World"         time.sleep(5)


title: Native IPv6 router on FreeBSD

text: I need your help to configure native IPv6 router on FreeBSD.   1. Interfaces configured well, on both I can see two addresses (real and link local).   2. I can `ping ipv6.google.com` and when do `lynx www.kame.net`, I can see phrase: dancing kame.   3. I installed `radvd` and get IPv6 address from server.   4. I'm using SSH connecting from my local computer to server using IPv6 address.   5. I can ping from local net both my router interfaces.   6. Using `tcpdump` on both interfaces, I can see that echo requests from my local computer are going to `ipv6.google.com`, but without response. So, I think that my server doesn't work as router. As prove of my words, when I do ping on my external interface:                ping6 -I em0 FF02::2      (Pinging link local addresses of neighbor routers.) I can't see my router link local address in this list. So, my router doesn't advertise herself as router and nobody know about my subnet. Here is `rc.conf` cut:               ipv6_activate_all_interfaces="YES"     ip6addrctl_enable="YES"     ip6addrctl_policy="ipv6_prefer"     ifconfig_em0_ipv6="inet6 2a03:XXXX:XXXX:XXYY::1 prefixlen 64"     ifconfig_re0_ipv6="inet6 2a03:XXXX:XXXX:XXXX::fffe prefixlen 64"     ipv6_defaultrouter="2a03:XXXX:XXXX:XXYY::fffe"     ipv6_gateway_enable="YES"      Here is `sysctl` flags:               net.inet6.ip6.forwarding: 1     net.inet6.ip6.redirect: 1     net.inet6.ip6.hlim: 64     net.inet6.ip6.maxfragpackets: 16384     net.inet6.ip6.accept_rtadv: 0     net.inet6.ip6.keepfaith: 0     net.inet6.ip6.log_interval: 5     net.inet6.ip6.hdrnestlimit: 15     net.inet6.ip6.dad_count: 1     net.inet6.ip6.auto_flowlabel: 1     net.inet6.ip6.defmcasthlim: 1     net.inet6.ip6.gifhlim: 30     net.inet6.ip6.kame_version: FreeBSD     net.inet6.ip6.use_deprecated: 1     net.inet6.ip6.rr_prune: 5     net.inet6.ip6.v6only: 1     net.inet6.ip6.rtmaxcache: 128     net.inet6.ip6.use_tempaddr: 0     net.inet6.ip6.temppltime: 86400     net.inet6.ip6.tempvltime: 604800     net.inet6.ip6.auto_linklocal: 1     net.inet6.ip6.prefer_tempaddr: 0     net.inet6.ip6.use_defaultzone: 0     net.inet6.ip6.maxfrags: 16384     net.inet6.ip6.mcast_pmtu: 0     net.inet6.ip6.no_radr: 0     net.inet6.ip6.norbit_raif: 0     net.inet6.ip6.rfc6204w3: 0     net.inet6.ip6.mcast.maxgrpsrc: 512     net.inet6.ip6.mcast.maxsocksrc: 128     net.inet6.ip6.mcast.loop: 1     net.inet6.ip6.deembed_scopeid: 1     security.jail.param.ip6.: 0     security.jail.param.ip6.saddrsel: 0      Please tell me, what have I missed?


title: PyOpenCL and Mesa Radeon driver

text: I'm trying to run pyopencl with the open source radeon drivers on gentoo. The package compiles fine, but every time I try to import the pyopencl module, I get an error telling me that the clGetExtensionFunctionAddress symbol cannot be found in _cl.so (and the libraries this is linked to). This function is indeed defined in the header files installed by mesa (cl.h), yet it seems to be missing from the actual library. OpenCL itself seens to be working, it's just pyopencl that refuses to load. Since I need pyopencl for my current project, for the moment I'm using fglrx, but I'd really prefer to use pyopencl with the open source driver which imho performs much better for everyday work. I was trying to use mesa 9.2.2 and pyopencl 2013.2. To sum it up: How can I get pyopencl running with the open source radeon drivers?


title: Optirun command stops working on Optimus system after some time

text: I need to run CUDA enabled applications, but (because of other things) I'd rather use Optimus technology rather than running on Nvidia card only. Note that for CUDA I need to use proprietary binary nvidia drivers. I followed: https://wiki.debian.org/Bumblebee this tutorial (and setup is mostly working). After reboot I can successfully run `optirun something` command. But after some time I get:                optirun deviceQuery       [ 4574.136296] [ERROR]Cannot access secondary GPU - error: Could not enable discrete graphics card      [ 4574.136358] [ERROR]Aborting because fallback start is disabled.      I use Quadro K2000M:                 lspci -k        01:00.0 VGA compatible controller: NVIDIA Corporation GK107GLM [Quadro K2000M] (rev ff)       Kernel driver in use: nvidia      Here are my questions:   * Does anyone have pointers how to solve this problem on debian.    * Is there any guide on manually restarting nvidia card using bbswitch?    * How can I disable bbswitch at all (losing power management) Could anyone create proper tags:   * bumblebee, cuda, optimus


title: Print EPS file at original size but changed position

text: I'd like to print EPS files, ensuring they print at their original size. I found out that my default document viewer, Okular from KDE, will always scale to fit size, and I can't seem to find a way to disable this. I guess I could use some other UI, so answers in that direction are welcome as well. Next I tried `lpr` from Cups. It does print the EPS at original scale in the bottom left corner of the page, but unfortunately it does not take page margins into account. Is there some tool to add margins to an EPS file, or some command line option to `lp` or `lpr` to move the position of the printed result on the page?


title: How to redirect output of a running program to /dev/null

text: I know that in order to suppress the output of a program I can redirect it to `/dev/null`, for example to hide all error and warning messages from chromium I can start the program like this               chromium-browser 2> /dev/null &      However, if I happen to forget about the error messages and type               chromium-browser &      (which is quite annoying when they appear in the middle of a command) I don't know what to do except for stopping the application and starting it again properly. Can I somehow redirect error output without restarting the application?


title: Unable to update my system Ubuntu13.04: Getting message - requires installation of untrusted packages

text: I had been trying to update my Ubuntu13.04 via 'software updater'. The updater messages that `the following needs to be installed. Press continue to install` When I press continue , a window appears as shown in the attachment. There message appears: `requires installation of untrusted packages` ![enter image description here](http://i.stack.imgur.com/MKovl.png) On pressing O.K. button, the window disappears and nothing happens. How to then update my system with the updates that the `software updater` is reflecting?


title: Replace instance of process in place?

text: I suspect this is not doable just because of the security implications, but here's what I'd like to do. Basically we run a bash shell-script on our CentOS server that calls `Program-A` (in our case JMeter, but that is arbitrary) which runs and dumps data into a log file. After that process finishes the shell-script starts up `Program-B` to analyze the log. What I would like to do is stop the instance of `Program-A1` and replace it with another instance of `Program-A2`, or some how swap them in place so I can safely end `Program-A1` without starting up `Program-B` prematurely. Why would I want to do this? The main reason is that `Program-A` loads some configuration files at its startup and if we make changes to those config files we have to restart the program for them to take effect, which I'd like to avoid. I understand this is most likely not possible, but if it is I would greatly appreciate the information. EDIT: I suppose I wasn't clear enough. Basically my shellscript looks like this:               ./Program-A     ./Program-B      When `Program-A` finishes dumping to our log, `Program-B` picks up the log and parses it. The problem I'm having is sometimes `Program-A`'s settings are not set correctly or something is wrong with the environment when it starts which means that we'll need to run the whole thing again. We'd like to avoid that by just replacing our first instance of `Program-A` (calling it `Program-A1`) with a new instance of `Program-A` (we'll call this `Program-A2`). Does this make more sense to everyone? The main reason we would like to do this is because `Program-A` and `Program-B` are actually a single part of a GIANT shell script that takes hours to run. Rather than restart the whole process for one individual part, we'd like to restart the single troubled program.


title: How to skip/exclude one SCSI bus from scanning during boot?

text: A "Linux debian 3.2.0-0.bpo.3-amd64 #1 SMP Thu Aug 23 07:41:30 UTC 2012 x86_64 GNU/Linux" system has at least 5 SCSI hosts:               root@debian:~# ls /sys/class/scsi_host     host0  host1  host2  host3  host4          root@debian:~# cat /sys/class/scsi_host/host0/proc_name       mpt2sas     root@debian:~# cat /sys/class/scsi_host/host1/proc_name     ata_piix     root@debian:~# cat /sys/class/scsi_host/host2/proc_name     ata_piix     root@debian:~# cat /sys/class/scsi_host/host3/proc_name     ata_piix     root@debian:~# cat /sys/class/scsi_host/host4/proc_name     ata_piix      The mpt2sas SCSI bus has 32 drives attached. On boot (after a reboot) the drives are mostly in standby state (spin down). This causes each drive to spin up in a sequential order. The spin up time of a typical drive is 8 till 9 seconds. As a result the boot after a reboot will take almost 5 minutes. Having configured to the kernel to scan the scsi bus asynchrone `GRUB_CMDLINE_LINUX="scsi_mod.scan=async"` doesn't improve boot after reboot time. And setting `scsi_mod.scan=none` makes the system to not boot at all. The final goal is to boot via USB, which is another scsi_host:               # cat /sys/class/scsi_host/host5/proc_name     usb-storage      How can I configure this system to exclude mpt2sas or (mpt2sas and ata_piix) bus from spinning up all drives during boot after reboot?


title: bash script - need date command variable

text: I am trying to create a script that will parse the `/var/log/secure` file for failed login attempts for today's date only and redirect those attempts into a separate file so I can view those attempts only in that file. I am having a problem with getting the script to work with the date command output. This is my script:               #!/bin/bash     mydate=$(date '+%D')     mytime=$(date '+%H:%M')     monthday=$(date '+%b %d)     error=$(grep Failed /var/log/secure | grep $monthday >> ~/logs/failed.log      With this code, it will not work. However, if I hard code the date in like this:               error=$(grep Failed /var/log/secure | grep 'Feb 28' >> ~/logs/failed.log      it works. How can I make it so that the `$monthday` is the thing grep'd?


title: Editing isolinux leads to kernel panic error in Centos Live CD

text: I downloaded a CentOS Live CD and tried to customize features on it. The CD boots fine if I use it "as-is". If I edit "isolinux.cfg" to edit the change the title of the CD or the automatic boot time, I get the following error:                   Kernel panic - not syncing: Attempted to kill init!     Pid: 1, comm: init Tainted: G     W  --------- 2.6.32-279.el6.x86_64 #1     Call Trace:     ...     ...      Is there a file integrity check that runs before boot that is causing the error? The same does not happen with a Fedora Live CD.


title: About Linux Memory Compaction (CONFIG_COMPACTION)

text: I have a question regarding memory compaction on Linux. Generally compaction is triggered when system cannot satisfy a large contiguous memory allocation. This causes the compaction to run on all zones to defrag the memory. What if I force compaction to run on every memory allocation and compact one pageblock of a zone? Will this be a overhead?


title: SSH connection timing out

text: I am trying to connect to an external host that is living in the Internet. From my laptop I can ssh fine. From an Ubuntu 12.10 server, the connection times out. Since they're in the same network, they are originating from the same IP address. The server receives the initial packets from the server but never acknowledges them (after looking at a tcpdump). I'm having a hard time figuring this one out. Nothing in iptables, nothing in hosts.allow/deny...


title: Terminal server (ser2net) to configure new HP procurve switch

text: Switch: HP ProCurve 2910AL-48G - J9147A This switch is brand new straight from HP. Anyone familiar with ser2net for creating a terminal server to connect from usb>serial>console port on a HP procurve switch? I've done this 4 times in the past couple months and had 0 issues. This exact same new one isn't working. Guides I used as a reference:   http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?lang=en&cc=us&taskId=115&prodSeriesId=3901671&prodTypeId=12883&prodSeriesId=3901671&objectID=c01975721   http://www.gns3.net/switching-how-to-console-into-your-devices/               root@mycomp:/dev# lsusb     Bus 001 Device 006: ID 0557:2008 ATEN International Co., Ltd UC-232A Serial Port [pl2303]          root@mycomp:/dev# dmesg | grep tty     [ 0.000000] console [tty0] enabled     [ 0.738224] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A     [ 0.963603] 00:08: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A     [16153.422206] usb 1-1.1: pl2303 converter now attached to ttyUSB0     [18163.982680] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0     [18167.091054] usb 1-1.2: pl2303 converter now attached to ttyUSB0          /etc/ser2net.conf     3002:telnet:0:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT banner          root@mycomp -> telnet localhost 3002     Trying 127.0.0.1...     Connected to localhost.     Escape character is '^]'.          ser2net port 3002 device /dev/ttyUSB0 [9600 N81] (Debian GNU/Linux)      Then it just hangs there, doesn't take me to a prompt as it did in the past with other brand new switches. If you type anything you get: Connection closed by foreign host. Any ideas on how to troubleshoot this? Also if there is a better way of doing this, feel free to inform me, I have 3 new switches that ideally need to be deployed by end of day tomorrow.


title: How many times does the same character occur twice in a row

text: My task is using grep to find how many times the same character occurs twice in a row.   I was thinking about something like this but it isn`t working               grep '[a-zA-z]{2}' *.txt | wc      How can achieve such a task with grep?


title: PlayOnLinux(POL) Excel 2007 can not open more than one spreadsheet

text: I have Installed CentOS 6.5 - i386 and PlayOnLinux 4.1. On that `MS Office 2007` is installed. `Word 2007` is able to open more than one document simultaneously and also possible to perform Cut, Copy and Paste between documents. But when I am trying to open more than one spreadsheet using `Excel 2007` whole system becomes unstable. How to resolve this problem?


title: Gnome 3.10 ScreenCast + Audio on Arch

text: I'm trying to record my desktop (including audio) in Gnome 3.10 on Arch Linux with the built-in screen recorder (`Ctrl`+`Alt`+`Shift`+`R`). According to this post (and other similar solutions that can be found on the Internet), I've tried to apply the gconf settings               gsettings set org.gnome.shell.recorder pipeline "queue ! videorate ! vp8enc quality=10 speed=2 ! mux. pulsesrc ! audio/x-raw-int ! queue ! audioconvert ! vorbisenc ! mux. webmmux name=mux"      but I get the following error:               No such schema 'org.gnome.shell.recorder'      Browsing with `dconf-editor` I see that `org.gnome.shell.recorder` actually is not there and I couldn't find anything similar... How can I record my desktop in gnome shell 3.10 including internal audio (not mic)? **EDIT:** Also I would like not to include mouse cursor while recording.


title: How to detect exact spec of my disk on a cloud server?

text: I've already read a question about whether your disk is SSD or HDD. When I issued the below command I've got surprised:               cat /sys/block/vda/queue/rotational      The output was 1. The question is why it's vda not an sda? And why it says 1? My server is on `DigitalOcean`. They say that all of their disks are SSD! And when I entered the command below:               cat /proc/scsi/scsi      The output was as below, no disk just CD ROM:               Attached devices:                                                                  Host: scsi1 Channel: 00 Id: 00 Lun: 00                                               Vendor: QEMU     Model: QEMU DVD-ROM     Rev: 1.0                                  Type:   CD-ROM                           ANSI  SCSI revision: 05      There is no specification about my disk. How to detect the exact specification of my disk on a cloud server?


title: Where do my ANSI escape codes go when I pipe to another process? Can I keep them?

text: I sometime want to pipe the color-coded output fror a process, eg. grep... but when I pipe it to another process, eg. sed, the color codes are lost... Is the some way to keep thes codes intact ? Here is an example which loses the colored output:               echo barney | grep barney | sed -n 1,$\ p


title: unzip file, which directory was created?

text: Objective: After expanding archive `a.zip` by using command `unzip` on `Ubuntu 12.10`, assign the name of the folder `a.zip` expanded to to `bash` variable `v`. `a.zip` is assumed and guaranteed to expand to a single folder, rather than multiple folders. Example: If `unzip a.zip` expands to folder `./foo/`, `echo $v` should return `foo`. My environment:               GNU/Linux (kernel 3.5.0-25-generic)     Ubuntu 12.10         bash v4.2.37(1)-release     UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.      * * * Current workaround I am _unhappy_ with: expand via `unzip -d bar a.zip` then `v=$(ls -1 bar)` gives the right result, but messes up the filesystem.


title: A Linux Distro/Project for Digital Literacy

text: I am in Africa, and I wish to know if there's any project that introduces Linux/Unix to new users? A project like this one of Microsoft's on Digital literacy.


title: GID, current, primary, supplementary, effective and real group IDs?

text: The following links discuss these concepts in different contexts. I have read their definitions, but I still can't tell how they are related, or if some of them are just the same.   * Current group ID   * GID   * Primary and supplementary group IDs   * Effective and real group IDs (also here) ### Here is one example of the source of my confusion: According to (4), If I type `id`, I should get what they call **effective** and **real** group IDs. > $ id uid=501(joe) gid=501(joe) groups=501(joe), 100(users) However, this other link refers to the output of `id` to distinguish between **primary** and **supplementary** ids. Moreover, Wikipedia distinguishes between **primary** vs **supplementary** and **effective** vs **real** group ids. How do these concepts relate to each other? Also, is it true that   * **primary** group id = **GID** = **current** group ID?


title: How to reinstall apt on Debian?

text: I accidently removed apt-get from my Debian system by issuing:               dpkg --force-depends --purge apt      How can I reinstall it?


title: Detecting headphone connection/disconnection in Linux

text: I am trying to detect a signal when a headphone is connected or disconnected from the system. What is the best way to do this? If there is a special board with drivers, that will be my preferred way.


title: Restart MySQL server

text: I am using **MySQL v5.1** on **Ubuntu** machine. MySQL on my machine used to work. (Running `mysql -u root` gave me the MySQL command line.) This afternoon, I did the following thing: **1.** check active process related to '`mysql`' by run:               $ ps aux | grep 'mysql'     mysql  1457  3.3  1.3 130044 27076 ?        Ssl  16:22   0:43 /usr/sbin/mysql      **2.** I saw from above output the PID of the mysql process is 1457, so I killed it with:               $ sudo kill 1457      **3.** now, if I run `$ mysql -u root` , I get an error:               ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)      which is reasonable since I killed the process. How can I have my MySQL server back up and running again after I killed it? I tried to run `sudo /etc/init.d/mysql start`, but my MySQL server does not start. Why is that?


title: "Packages have unmet dependencies" but I don't want to install these packages anymore. How do I clean this?

text: You might want to run 'apt-get -f install' to correct these:     The following packages have unmet dependencies:      fglrx-driver : Depends: libfglrx (= 1:14.4.2-1kali1) but it is not going to be installed      gmail-notify : Depends: python-eggtrayicon but it is not going to be installed      libgl1-fglrx-glx : Depends: libfglrx (= 1:14.4.2-1kali1) but it is not going to be installed      libgl1-fglrx-glx:i386 : Depends: libfglrx:i386 (= 1:14.4.2-1kali1) but it is not going to be installed     E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).      I don't want to install these packages anymore (they are not compatible with my graphics unit). And so I do not need to install their dependencies using `apt-get -f install` (as it is suggesting). What is the way to get rid of these packages and this unmet dependency problem? (I tried `apt-get autoclean` && `apt-get autoremove`).


title: Logged on via ssh-key, can I reset my account password?

text: I am logged in on a server via sshkey (`ssh -i /home/me/.ssh/ssh-key me@server`). I got sudo rights on that server from the admin, but I can't exercise them, since I forgot my actual Unix password (or I was never told it). I am already logged on - can I reset my password via `passwd`, without knowing my old password?


title: How to exit login screen and start commandline while at login screen

text: I am at the gnome 2 login screen but I want to exit and re-enter command-line environment. I remember there was a combination hot key one has to invoke.


title: NTPDate runs three times at boot resulting in incorrect date

text: I am running Voyage Linux (a Debian-based distribution) and am having trouble getting the correct date. When I look in `/var/log/daemon.log` I see the following:               Nov 18 11:04:07 voyage ntpdate[1676]: step time server 203.97.109.165 offset 2141299826.398106 sec     Aug 20 17:06:20 voyage ntpdate[1710]: step time server 119.47.118.129 offset 2141299826.401065 sec     Jun 28 06:36:47 voyage ntpdate[1744]: step time server 203.97.109.165 offset 2141299826.460901 sec      The correct date is `Nov 18 11:04:07` but it is getting changed to the middle of June. How can I fix this?


title: omxplayer on different screen

text: I'd like to have two instnces of omxplayer and switch between them. I'm using raspian on raspberry pi. I've tried opening one instance in one screen, and then press alt+ctrl+f2 to switch to the screen two and open the other instance of omxplayer but the video of the first screen is in overlay also in the screen called with f2 (and also all other screen I have). Why? Is it possible to have 2 instances of omxplayer, or one instance with 2 layers..


title: printf white space character in bash script

text: How can the white space character be escaped in printf for the purpose of this script that currently runs in a Cygwin client? The line containing the whitespace (which by itself works from the command line as **echo $SPC** ) is               SPC=$(printf \\$(printf '%03o' 32))      In case you might wonder why, in this code I am trying to simulate an associative array such that it is not dependent on Bash 4+...would like this to be a generic example that theoretically can be run in virtually any bash environment. Here is the entire script:               #!/bin/bash          DEFAULT_INDEX=""     LAST_INDEX=0     SPC=$(printf \\$(printf '%03o' 32))          # MICROSOFT OUTLOOK VERSIONS.     OUTLOOKS=( "Cancel^Do$SPCnot$SPCtry$SPCto$SPCsend$SPCmessage$SPCvia$SPCOutlook"                "URL^Just$SPCthe$SPCmailto$SPCURL"                "Outlook$SPC2003^C:\Program$SPCFiles\Microsoft$SPCOffice\Office12"                "Outlook$SPC2007^C:\Program$SPCFiles\Microsoft$SPCOffice\Office12"                "Outlook$SPC2010^C:\Program$SPCFiles\Microsoft$SPCOffice\Office14" )          # ITERATES THROUGH ARRAY AND MAKES NUMBERED SELECTION LIST.     printOutlooksArraySelectionList() {         LIST_TITLE="MICROSOFT OUTLOOK SELECTION LIST"         echo         printf "\t\t\E[37;1;44m%-0s %s %s %s\033[0m" $LIST_TITLE         echo         echo         DEFAULT_VALUE="Outlook 2010"         index=0         for i in "${OUTLOOKS[@]}"; do             key=${i%%^*}             value=${i##*^}             if [ "$key" == "$DEFAULT_KEY" ]; then                 DEFAULT_INDEX=$index         fi                 printf "\t\E[37;44m%-3s %-13s\033[0m \E[1;34;40m%-41s\033[0m\n" \                        $index $key $value                 echo                 ((index++))         done         # SETS LAST_INDEX TO INDEX VALUE OF LAST ITEM IN ARRAY.         ((LAST_INDEX = index - 1))     }          printOutlooksArraySelectionList      Would like the output to look like the following:                           MICROSOFT OUTLOOK SELECTION LIST              0   Cancel        Do not try to send message via Outlook              1   URL           Just the mailto URL              2   Outlook 2003  C:\Program Files\Microsoft Office\Office12              3   Outlook 2007  C:\Program Files\Microsoft Office\Office12              4   Outlook 2010  C:\Program Files\Microsoft Office\Office14      To work-around, I ended up not using printf, but instead:               echo -e "\t\E[37;44m${index}\t${key}\033[0m\t\t\E[1;34;40m${value}\033[0m"      adequate for my purposes with this script.


title: How to dynamically host any domain w/o creating folders specifically for it?

text: Suppose a domain name has been pointed to my server's IP address.. soon as the domain name comes to me.. i want apache to execute...                python_script domain.tld      or perhaps..                bash_script domain.tld      if the incoming domain looks like this:               domain.tld/test      then..                bash_script domain.tld/test      should be executed. from within the bash script i can run calculations and decide what to display. perhaps things do not work this way due to security concerns but security is not my concern. just would like to test it out.


title: Why am I getting a syntax error with my Shell arithmetic?

text: I have a problem with a linux shell script (`sh`). I'm trying to write a script that calculates combinations, but I think I get overflows when trying to calculate faculties. So, I'm trying another technique. In this technique I used this:               a=`expr $var1 \* $var2 / $var3`      This is giving errors, and apperently, I can't do this:               a=`expr ($var1 \* $var2) / $var3`      because this gives errors as well. How do I do it?


title: Is there any option with 'ls' command that I see only the directories?

text: Sometimes, I need to check only the directories not files. Is there any option with the command ls? Or is there any utility for doing that? **EDIT** : I'm using Mac OS X, and `ls -d` gives me `.` even though I have directories.


title: How to test what shell I am using in a terminal?

text: How to check what shell I am using in a terminal? What is the shell I am using in MacOS?


title: Determine current shell name

text: > **Possible Duplicate:**   >  How to test what shell I am using in a terminal? How do I determine the current shell path or shell name? I only really need to distinguish `sh` and `bash`, however a portable solution would be nice.


title: how to detect command interpreter from within a shell script

text: > **Possible Duplicate:**   >  How to test what shell I am using in a terminal? For example the following script               #!/bin/bash          issue_interpreter_name      would issue:               bash


On some the shell can be read on in the command prompt, other can be seen when `help` is ran. But this are not covered by all the shells. Is there a general command to see what shell is running?


title: ArchBang - Missing wireless interface, or how to remap fn+F1-F1

text: Hello I am using ArchBang on old laptop Dell D410 (Dell D410 Technical Specification). I have troubles with wifi. My assumption (please read bellow explanation why I deducted this) is that I cannot even enable the wifi adapter with keyboard shortcuts (fn+F2). Before current installation of ArchBang release, the box was running on Windows XP with legacy version (unfortunately I do not remember the exact version) of ArchBang in dual boot. On Windows XP the wifi was running correctly. On legacy version of ArchBang there was the same problem which I have with actual version of ArchBang. When I tried to enable wifi (using fn+F2) on legacy ArchBang the message: “problem with mapping of keyboard shortcut (or something similar)” was written to dmesg (or maybe /var/log/messages sorry I do not remember exactly). The box was then reinstalled to recent version of ArchBang hoping it will solve the problem. Now when I press fn+F2 I do not get any message not in dmesg nor in /var/log/messages. However I’ve tried to issue xev and see what happens: and the result is that all shortcuts (brightness, sound control etc.) are working fine (also in real, and in the xev the codes are returned as well), except those which controls wifi (fn+F2). So my assumption is that I have problem not directly with wifi but with enabling the adapter. Wireless is enabled in BIOS, the wireless LED is not flashing. Can I issue some command from command line to enable wifi interface instead of using fn+F2 shortcut? Bellow are output of commands that I have issued:               [root@arch ~]$ uname -a     Linux arch 3.11.5-1-ARCH #1 SMP PREEMPT Mon Oct 14 08:49:01 CEST 2013 i686 GNU/Linux          [root@arch ~]# ifconfig -a     enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500             inet 192.168.1.170  netmask 255.255.255.0  broadcast 192.168.1.255             inet6 fe80::212:3fff:fe21:70fe  prefixlen 64  scopeid 0x20<link>             ether 00:12:3f:21:70:fe  txqueuelen 1000  (Ethernet)             RX packets 1369  bytes 1326271 (1.2 MiB)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 1250  bytes 160246 (156.4 KiB)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0             device interrupt 16           lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536             inet 127.0.0.1  netmask 255.0.0.0             inet6 ::1  prefixlen 128  scopeid 0x10<host>             loop  txqueuelen 0  (Local Loopback)             RX packets 4  bytes 240 (240.0 B)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 4  bytes 240 (240.0 B)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0          [root@arch ~]# dmesg | grep -i wireless     [    9.064627] ipw2200: Intel(R) PRO/Wireless 2200/2915 Network Driver, 1.2.2kmprq     [    9.065083] ipw2200: Detected Intel PRO/Wireless 2200BG Network Connection          [root@arch ~]# lshw -C network       *-network                          description: Ethernet interface            product: NetXtreme BCM5751 Gigabit Ethernet PCI Express            vendor: Broadcom Corporation            physical id: 0            bus info: pci@0000:01:00.0            logical name: enp1s0            version: 01            serial: 00:12:3f:21:70:fe            size: 100Mbit/s            capacity: 1Gbit/s            width: 64 bits            clock: 33MHz            capabilities: pm vpd msi pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation            configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=3.132 duplex=full firmware=5751-v3.29a ip=192.168.1.170 latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s            resources: irq:16 memory:dfdf0000-dfdfffff       *-network UNCLAIMED            description: Network controller            product: PRO/Wireless 2200BG [Calexico2] Network Connection            vendor: Intel Corporation            physical id: 3            bus info: pci@0000:02:03.0            version: 05            width: 32 bits            clock: 33MHz            capabilities: pm cap_list            configuration: latency=64 maxlatency=24 mingnt=3            resources: memory:dfcff000-dfcfffff          [root@arch ~]# lsmod | grep -i intel     snd_intel8x0           23721  1     snd_ac97_codec         89336  1 snd_intel8x0     snd_pcm                63876  2 snd_ac97_codec,snd_intel8x0     snd_page_alloc          5974  2 snd_intel8x0,snd_pcm     snd                    44566  6 snd_ac97_codec,snd_intel8x0,snd_timer,snd_pcm     intel_agp               8688  1 i915     intel_gtt              10172  3 i915,intel_agp     agpgart                22047  3 drm,intel_agp,intel_gtt     [root@arch ~]# lsmod | grep -i ipw2200     ipw2200               128525  0     libipw                 22318  1 ipw2200     lib80211                3037  2 libipw,ipw2200     cfg80211              336964  2 libipw,ipw2200          [root@arch ~]# modinfo ipw2200     filename:       /lib/modules/3.11.5-1-ARCH/kernel/drivers/net/wireless/ipw2x00/ipw2200.ko.gz     firmware:       ipw2200-bss.fw     firmware:       ipw2200-sniffer.fw     firmware:       ipw2200-ibss.fw     license:        GPL     author:         Copyright(c) 2003-2006 Intel Corporation     version:        1.2.2kmprq     description:    Intel(R) PRO/Wireless 2200/2915 Network Driver     srcversion:     DC12C86CD79304BB5E0D6DB     alias:          pci:v00008086d00004224sv*sd*bc*sc*i*     alias:          pci:v00008086d00004223sv*sd*bc*sc*i*     alias:          pci:v00008086d00004221sv*sd*bc*sc*i*     alias:          pci:v00008086d00004220sv*sd*bc*sc*i*     alias:          pci:v00008086d0000104Fsv*sd*bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002762bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002761bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002754bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002753bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002752bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002751bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002742bc*sc*i*     alias:          pci:v00008086d00001043sv0000103Csd00002741bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002741bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002732bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002731bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002722bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002721bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002712bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002711bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002702bc*sc*i*     alias:          pci:v00008086d00001043sv00008086sd00002701bc*sc*i*     depends:        cfg80211,libipw,lib80211     intree:         Y     vermagic:       3.11.5-1-ARCH SMP preempt mod_unload modversions 686     parm:           disable:manually disable the radio (default 0 [radio on]) (int)     parm:           associate:auto associate when scanning (default off) (int)     parm:           auto_create:auto create adhoc network (default on) (int)     parm:           led:enable led control on some systems (default 1 on) (int)     parm:           debug:debug output mask (int)     parm:           channel:channel to limit associate to (default 0 [ANY]) (int)     parm:           rtap_iface:create the rtap interface (1 - create, default 0) (int)     parm:           qos_enable:enable all QoS functionalitis (int)     parm:           qos_burst_enable:enable QoS burst mode (int)     parm:           qos_no_ack_mask:mask Tx_Queue to no ack (int)     parm:           burst_duration_CCK:set CCK burst value (int)     parm:           burst_duration_OFDM:set OFDM burst value (int)     parm:           mode:network mode (0=BSS,1=IBSS,2=Monitor) (int)     parm:           bt_coexist:enable bluetooth coexistence (default off) (int)     parm:           hwcrypto:enable hardware crypto (default off) (int)     parm:           cmdlog:allocate a ring buffer for logging firmware commands (int)     parm:           roaming:enable roaming support (default on) (int)     parm:           antenna:select antenna 1=Main, 3=Aux, default 0 [both], 2=slow_diversity (choose the one with lower background noise) (int)               xev:     ###          fn+F2 (Wireless)     ##########     KeyPress event, serial 48, synthetic NO, window 0x1e00001,         root 0x7f, subw 0x0, time 1416790, (14,261), root:(578,476),         state 0x0, keycode 248 (keysym 0x0, NoSymbol), same_screen YES,         XLookupString gives 0 bytes:         XmbLookupString gives 0 bytes:         XFilterEvent returns: False          KeyRelease event, serial 48, synthetic NO, window 0x1e00001,         root 0x7f, subw 0x0, time 1416790, (14,261), root:(578,476),         state 0x0, keycode 248 (keysym 0x0, NoSymbol), same_screen YES,         XLookupString gives 0 bytes:         XFilterEvent returns: False               fn+F3 (Some battery event - No one knows because batery is old and not used)     ################################################     KeyPress event, serial 48, synthetic NO, window 0x1e00001,         root 0x7f, subw 0x0, time 1481398, (-28,389), root:(536,604),         state 0x0, keycode 244 (keysym 0x1008ff93, XF86Battery), same_screen YES,         XLookupString gives 0 bytes:         XmbLookupString gives 0 bytes:         XFilterEvent returns: False          KeyRelease event, serial 48, synthetic NO, window 0x1e00001,         root 0x7f, subw 0x0, time 1481398, (-28,389), root:(536,604),         state 0x0, keycode 244 (keysym 0x1008ff93, XF86Battery), same_screen YES,         XLookupString gives 0 bytes:         XFilterEvent returns: False          fn+F3 (Enables/Disable NumLock)     #####################     KeyPress event, serial 48, synthetic NO, window 0x1e00001,         root 0x7f, subw 0x0, time 1558307, (-50,327), root:(514,542),         state 0x0, keycode 77 (keysym 0xff7f, Num_Lock), same_screen YES,         XLookupString gives 0 bytes:         XmbLookupString gives 0 bytes:         XFilterEvent returns: False          KeyRelease event, serial 48, synthetic NO, window 0x1e00001,         root 0x7f, subw 0x0, time 1558370, (-50,327), root:(514,542),         state 0x10, keycode 77 (keysym 0xff7f, Num_Lock), same_screen YES,         XLookupString gives 0 bytes:         XFilterEvent returns: False      PS: I am writing here because this post was deleted from ArchLinux forums with statement that ArchLinux forums do not support ArchBang, so I registered do ArchBang forums but so far I am unable to post questions (there was troubles with spam or something like this, so now the registration takes longer)


title: Solaris 11 - (unix: Could not start init) Program terminated)

text: During a restart of a server with Solaris 11, the system halted with the following alert:               WARNING: exec(/usr/sbin/init) failed with errno 8. (unix: Could not start init) Program terminated.      The operating system keeps on reboot and never comes online. Since `init` is one of the first processes to come up we are assuming that we will never be able to log onto the server. Is there a way that we can log into the system and check what the issue is, and possible resolve it?


title: What does file version mean: lsattr -v

text: `lsattr -v` gives me the "version number" of given file(s). What does this mean? On Redhat 7.3, I could've sworn all the version numbers were 1 except those I changed with `chattr -v`. On Fedora 11, they appeared to be **random** numbers. Setting version numbers or even having multiple versions of a file could be very useful, so I want to understand how **"versioning"** works in ext3.


title: Will the system make sure that mdadm is sync-ed before completing a reboot?

text: This is a follow up to my crazy `mdadm` problem. I'm trying to figure out what might have caused `sda` to get out of sync in the first place. The only thing I can think of is that I had just run a bunch of updates and was rebooting to reload the kernel upgrade. Is it possible that both drives hadn't synced? would the system prevent a reboot if there was mdadm syncing going on? could it be made to? any other suggestions as to what might have happened? and how it could be prevented in the further. Nothing seems to be wrong with the drive.


title: Lock a script starting daemons

text: I'm run a script with cron: `*/10 * * * * flock -n /tmp/lock script` I have to make sure that only one instance of the script is running at the same time, and for that I'm using flock. The problem is that sometimes this script starts a daemon, in this case, the daemon blocks the following script executions. I know a possible solution would be unlock the file at the end of the script, but is it possible do it directly in the cron command?


title: Purpose of using setuid() in SUID programs

text: I wonder that an SUID program like `passwd` is using the `setuid()` function call. Why does it drop root privileges? Against what types of attack does this help? Buffer-overflow?


title: How to Format an LVM partition

text: I need to format a partition. But I have one LVM on my machine (VirtualBox) that is composed of **two different two partitions of two Virtual HDD** 's (sdb5 and sdc5) fdisk output ![enter image description here](http://i.stack.imgur.com/aPSIB.png) df output ![enter image description here](http://i.stack.imgur.com/TnF4b.png)


title: How to interpret this top command

text: top - 04:36:16 up 32 days,  2:33,  1 user,  load average: 251.72, 250.54, 231.19     Tasks: 785 total, 249 running, 522 sleeping,   2 stopped,  12 zombie     Cpu(s):  8.9%us, 90.5%sy,  0.4%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.2%si,  0.0%st     Mem:  16313868k total,  7021336k used,  9292532k free,   432196k buffers     Swap:  4194296k total,   295012k used,  3899284k free,   514320k cached            PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND     18873 nudenude  20   0 97.8m  26m 4944 R  4.0  0.2   0:09.35 php     18140 nudenude  20   0 93984  22m 4940 R  3.7  0.1   0:11.04 php     18178 nudenude  20   0 99.6m  26m 4912 R  3.7  0.2   0:11.11 php     18537 nudenude  20   0  100m  26m 4936 R  3.7  0.2   0:10.31 php     18726 nudenude  20   0 98.3m  25m 4868 R  3.7  0.2   0:09.82 php     18977 nudenude  20   0  101m  25m 4952 R  3.7  0.2   0:09.14 php     19049 nudenude  20   0 99.5m  28m 4920 R  3.7  0.2   0:08.87 php     19852 nudenude  20   0  100m  30m 4912 R  3.7  0.2   0:07.08 php     20504 nudenude  20   0 93024  18m 4880 R  3.7  0.1   0:04.86 php     20562 nudenude  20   0  100m  31m 4940 R  3.7  0.2   0:04.73 php     20681 nudenude  20   0 90912  14m 4940 R  3.7  0.1   0:04.40 php     20685 nudenude  20   0 90656  15m 4928 R  3.7  0.1   0:04.38 php      Some things are strange. Why system utilize tons of CPU for %sy? It seems to me the tasks use a lot of virtual memory even though there are still plenty of memory left. So I wonder why? Also what does 15m, 14m means in res and VIRT. Nothing is shown in man top. I checked http://unixhelp.ed.ac.uk/CGI/man-cgi?top and non of it is shown. Note: the load used to be 50%. Moreover, column VIRT is usually 0. However, once in a while it goes to this stuck mode where 90% of CPU is used by kernel. Don't know what the hell is that kernel doing. very little CPU is used by users. No wonder load is extremely high. But what? What is the kernel doing>


title: /etc/crontab what does "test -x" stand for

text: In my `/etc/crontab` file I have:               # m h dom mon dow user  command     17 *  * * * root    cd / && run-parts --report /etc/cron.hourly     25 6  * * * root  test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )     47 6  * * 7 root  test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )     52 6  1 * * root  test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )     #      I know what this does in practice but I don't understant the command lines. Man "test" doesn't help at all:               test - check file types and compare values      Any help would be greatly appreciated


title: Arch USB boot freezing?

text: I have put Arch on my USB and when it starts to boot, but I get the following error during the boot.               [73.100021] --[ end Kernel panic - not sycning: Fatal exception in interrupt


title: How to obtain X.509 certificate on solaris based server?

text: I have a Solaris based T5220 server. I'd like to install an x.509 certificate. What is the procedure to install this certificat? Does that procedure differs from one server to another? i.e. is it different for Netra 240 and T5220 servers?


title: ratpoison keyboard shortcut conflicts

text: I recently installed ratpoison as my first real foray into tiling window managers. The first problem I ran into is that the Ctrl-t keybinding used for ratpoison commands conflicts with those of other software, such as the new tab command in Mozilla Firefox (which is also Ctrl-t), or activating the menu in Debian's aptitude. In fact, it seems that even shortcuts with no apparent conflict are also affected. For instance, the Page Up/Down keys no longer scrolls, and Backspace can't bring me to the previous page in Firefox. I saw a sample .ratpoisonrc that changes the Ctrl-t key to "less" but what key is that on the keyboard?? Also, why do some other keys stop working (i.e. like Page Up Backspace, etc.)? Thanks.


title: What to do after a kernel panic on AIX?

text: There was a "kernel panic" - at least sort of.               errpt | head     IDENTIFIER TIMESTAMP  T C RESOURCE_NAME  DESCRIPTION     A6DF45AA   1205044411 I O RMCdaemon      The daemon is started.     67145A39   1205044111 U S SYSDUMP        SYSTEM DUMP     F48137AC   1205043911 U O minidump       COMPRESSED MINIMAL DUMP     0975DD6C   1205043911 P S ABEND          KERNEL ABNORMALLY TERMINATED     9DBCFDEE   1205044311 T O errdemon       ERROR LOGGING TURNED ON     E87EF1BE   1204150011 P O dumpcheck      The largest dump device is too small.     A6DF45AA   1204012511 I O RMCdaemon      The daemon is started.     67145A39   1204012311 U S SYSDUMP        SYSTEM DUMP     F48137AC   1204012111 U O minidump       COMPRESSED MINIMAL DUMP      How do I analyze the dumpfile? How can I trace what happened?


title: Scientific Linux install ISO hashes?

text: So there are:               https://www.scientificlinux.org/distributions/6x/61/      hashes, but not for the latest:               SL-61-x86_64-2011-11-09-Install-DVD.iso      Where can I find up-to-date hashes for it? [of course over HTTPS, not FTP or HTTP!!]


title: How to uninstall RHEL from a dual-boot system?

text: I had RHEL 5 and WinXP on dual-boot and then from WinXP I deleted those partitions which were allocated to RHEL. Now I am not able to start my computer. The booting process stops at grub. I tried installing XP again so that it repairs the MBR for XP but the bootable CD is not initiating the installation process. How can I recover my winXP? Edit : I will not mind formatting the drive where XP is installed (in my case it's in C drive). Problem solved : Thank you guys for your help and support. I tried the RHEL cd and then in the command mode I tried `fdisk -l` and it showed that 1 partition was being used by Linux. I deleted that and then booted through WinXP CD and followed the steps which zypher suggested and it worked.


title: Proftpd and Webmin - directory limits

text: I use proftpd and configure it via Webmin. I want to limit users access to certain directories   1. Their homes   2. /sample So I go to Files and Directories->Limit users to directories and option: Home directory works fine. The problem is with other directory. It is set just like home directory but users still can see only their home folder without `/sample`. What happened? Ubuntu 13.10


title: Serve content generated by a script with Apache

text: Suppose you have a domain that is pointed to your server's IP. As soon as it reaches your server's IP you use Apache to point it to a DocumentRoot (in a VirtualHost). But instead of pointing it to a document root, can you point it to a script? I want the script to control what is displayed on the web, not the DocumentRoot.


title: Customize flyspell (ispell) dictionary

text: I know how to add custom words to ispell, but I would like to remove certain words from the dictionary. For example, although `ass` and `asses` are correct words, I rarely type them, and would like to flag them as likely typos to `as` and `assess`. Where does ispell store its dictionary? The man page does not provide the location. Also, the man page makes it seem like there are a lot of steps to build a new dictionary, and it isn't just an ASCII file where I can remove certain words. Any advice how to build a new dictionary without a given word? **Edit** From some hints on: http://docstore.mik.ua/orelly/unix/upt/ch29_05.htm It seems like I can start with /usr/share/dict/words, remove the words I don't want, and then make a new ispell dictionary from that. However, I'm having trouble making the new dictionary. `buildhash` is the key program here, but it wants an affixfile, and I do not know how to generate that file.


title: Mark as executable

text: I'm using Elementary OS. How do I mark a .jar file as executable. I do have JDK installed, but I get an error saying it isn't marked as executable.


title: setxkbmap configuration

text: I'm using Lubuntu 13.04 without executing `lxpanel` (I killed it on purpose because I don't want to use it for the project I'm working on now). The problem is that, without `lxpanel` executing, the run prompt (`Alt`+`F2`) doesn't work, and I need a way to execute programs hitting `Alt`+`F2` without `lxpanel` being executed. Diggin' on the internet I found that you can configure your keyboard with _setxkbmap_ , for example with: *setxkbmap -option terminate:ctrl_alt_bksp*, you terminate the session. I'm trying to make something like this: `setxkbmap -option execute:alt_f2`, but it doesn't work. Does anybody know the list of available options for the `-option` attribute and if the option "execute" is available? Do you know if there's a way to do this?


title: Locate a directory from a relative path in ps output

text: When I executed the command to give the pid of my processes running, it gave me like this -               user@machineA:/$ ps -eo pid,command | grep exhibitor | grep java | grep -v grep      1615 java -jar ./exhibitor-1.2.3/lib/exhibitor-1.2.3-jar-with-dependencies.jar --fsconfigdir /opt/exhibitor/conf --hostname machineA      Now I saw this path in the above output -               ./exhibitor-1.2.3/lib/exhibitor-1.2.3-jar-with-dependencies.jar      Now I am trying to understand where this folder is `./exhibitor-1.2.3/` as I am not able to find out. Does this folder on the same ubuntu machine? Is there any way to find out that directory where it is? I am running Ubuntu 12.04


title: spawn external program in the background inside a loop

text: I am trying to stress-test (at a very basic level) a server by simulating multiple client programs with the following:               for i in {1..5} ; do echo ./client-program& ; done      but it fails with:               bash: syntax error near unexpected token `;'      How can I achieve the above and also store the `std:out` and `std::err` of each invoked instance of the "client-program" in separate files? (so that I may later `diff` them for equality).


title: How to make postfix create maildir?

text: How do you make postfix create maildir folders automatically for all users? I have these two lines in postfix main.cf, which supposed do create maildir folder after the first mail but it is not working. What am I missing?               home_mailbox = Maildir      mailbox_command =       At the moment mail looks to sent, but nowhere to be found.


title: libphp4 Not Found?

text: I'm using CentOS 6.5 and Apache 2.2.15 I've installed PHP 4.3.11 by download:               wget http://museum.php.net/php4/php-4.3.11.tar.gz     tar zxvf php-4.3.11.tar.gz     cd php-4.3.11     ./configure     make     make install      It works, i can use php via command on terminal like this: ![php-v](http://i.stack.imgur.com/SZSV9.jpg) But when i run apache, it didn't show PHP language. ![trien8](http://i.stack.imgur.com/s7eo7.jpg) I've checked, that there're no modules libphp4.so and libphp4-zts.so What wrong i did? Any help please...


title: how to by nscd for DNS

text: I am using NSCD for DNS now , but I sometimes see NSCD dying by itself . so is there any way to bypass the NSCD for DNS and what will be the disadvantage ?


title: join sed output

text: I'm looking to somehow pass the output of the following command:               $ sed -n '5p' file-A      into               $ sed '5 c\     > "string extracted from previous sed command" file-B      So basically, I want to replace line x of a file A with line x of a file B. I'm open to any other better options.


title: Mount Windows phone as a removable device

text: I know that the Zune software doesn't work with Linux of any kind, but I found a guide here that shows how to change `regedit` in Windows to use the phone as a removable device with direct access to the files. Is there a way to do this in Linux? Specifically Mint 12


title: How to enable dual booting option at boot screen?

text: I have two hard drives, 160GB and 500GB. On the 160GB I have installed RHEL 6 and on the 500GB, Windows 7. When I start, the hard drive which is set as primary is booting directly. I have set the 160GB as primary, so RHEL 6 boots. How do I set the dual booting option so that I can select which OS should boot? And by default the booting time is set as 3 seconds. How to increase the time?


title: How do I save changed files?

text: I have two folders:   * ORIGINAL/   * ORIGINAL_AND_MY_CHANGES/ My friend has a copy of ORIGINAL/. I would like to generate MY_CHANGES.tgz -- it should contain only new/changed files from ORIGINAL_AND_MY_CHANGES/ comparing to ORIGINAL/. So my friend can unpack it into his copy of ORIGINAL/ and get ORIGINAL_AND_MY_CHANGES/. How can I do this? P.S. I tried `diff` but it can't save binary data and `rsync --link-dest` -- it generates hard links which are useless in the archive. P.P.S. In my case modification time can't be used to decide which file was changed.


title: Why are parameters to Bash's builtin optional?

text: Running simply `builtin` prints nothing and returns exit code 0. This is in accordance with `help builtin`, which shows all parameters as optional. But why isn't this no-op an error? Is there a use case for this? A more useful result would be an error code or, even better, listing the currently available builtins.


title: Why are parameters to Bash's `command` and `type` optional?

text: Similar to Why are parameters to Bash's builtin optional?, these commands print nothing and return exit code 0 if no parameters are provided. But unlike `builtin`, their `help` output state that _at least one parameter is mandatory_. Is this a bug, a feature, or did I misunderstand something?               $ bash --version     GNU bash, version 4.2.10(1)-release (x86_64-pc-linux-gnu)     $ type -a command     command is a shell builtin     $ type -a type     type is a shell builtin     $ help -s command     command: command [-pVv] command [arg ...]     $ help -s type     type: type [-afptP] name [name ...]     $ command     $ echo $?     0     $ type     $ echo $?     0


title: Solaris zone removal and transformation

text: I have a Solaris server which has two zones on it. I need to remove one zone and change the remaining zone into the server's main operating system. What is the best way to do this? I was thinking of backing up a the zone that needs to be kept, reinstalling the OS on the server and then restoring the files from the backed up zone. Are there easier ways?


title: Multiply certain numbers in a text -file by certain constant

text: I want an alternative solution to this jQuery hack, tasting a bit reinventing the wheel -- look I am sure I could do this with some one-liner using basic *ix tools. Look much easier and straightforward way is to find all numbers appended with px, some `\d+px` -match and then multiply it with a constant but `\d` will fail -- match only if not prepended by a digit `[^\d]\d+px` and then do the replacement/multiplication. The simplest and the most elegant solution wins, how can you do the match- multiply-replace? _I use Vim but open to new ideas._


title: How can I get the most bang for my buck with the "diff" command?

text: I have tried using the linux `diff` command in the past without much luck or patience. I usually end up using a GUI utility like DiffMerge or Kdiff. Recently I started trying to use `diff` again to compare files on remote systems via ssh, and I have found the `-y / --side-by-side` option to be very useful, but I still feel like I'm not making this most of this utility. So I'm curious of how to achieve the following things:   1. Highlight changes or use color-coding to make the output more readable   2. Merge - Select lines with differences and effect the changes into one of the files Also, I haven't found many good examples when googling, so **if you have some linux-fu secrets for getting the most out of diff, could you please share?** I will mainly be comparing text-based configuration files but any tricks and tips would be wonderful. **For Reference** - The DiffMerge utility easily shows changes side by side with color highlighting. Icons at the top allow you to switch between views of "show all," "show differences," and "show differences with context." Would love some of this functionality at the command prompt. ![Picture.png](http://img683.imageshack.us/img683/2545/picturetv.png) ps: I should also note that one other option that I find quite useful is `\--suppress-common-lines` which I learned about on this concise and readable blog post.


title: Can QEMU/KVM+OCFS2 be configured to punch holes in sparse image files when files are deleted in the guest?

text: I'm using sparse raw image files for guest VMs and OCFS2 on the host (local- only, not clustered) for the `reflink` feature. I understand from Googling around that OCFS2 is one of the filesystems that can punch holes back into sparse files. If I understand correctly, it may be possible (and apparently can be achieved with XFS) to combine this feature with TRIM/discard support in the guest machines so that when files in the guest are deleted, space on the host is automatically reclaimed. However despite much experimentation, I haven't been able to demonstrate this working. Is this possible, and if it depends on versions of the kernel and/or QEMU, what are the minimum versions I need? Also have I missed anything with the configuration? I've:   * mounted the (ext4) guest filesystem with the `discard` option in `/etc/fstab`   * tried the current beta of Debian Wheezy for host and guest, and CentOS 6.2 for host   * tried running `fstrim` on the guest (I get `FITRIM ioctl failed: Operation not supported`—but I'm not 100% sure if this is relevent)   * tried `bus=ide` and `bus=virtio` (with CentOS 6.2 host)


title: migrating evolution to thunderbierd and maildir format

text: By default, thunderbird stores in mbox fromat, when you use `Config Editor` and search for `mail.serverDefaultStoreContractID` you find out its value: `@mozilla.org/msgstore/berkeleystore;1` If you want to change type of storing messages for fasting such as evoluton you can change it to : `@mozilla.org/msgstore/maildirstore;1` **My Question** is : I need to migraye from evolution 3.x.x to thunderbird, however i changed to maildir format my thunderbird, i googled, most of documentations mentioned to `mbox format` , Do you have any suggestion for `maildir format` for both?


title: Grep multiple pattern negative match

text: So I have a bunch of Apache logs with using the standard log format. I want to get all the log lines that did not come from a web crawler. So lets say I have a file robot_patterns with entries like               Googlebot     msnbot-media     YandexBot     bingbot      If I run the command `grep -f robot_patterns *.log` I will get all the entries by bots matching the above patterns. My actual list has ~30 entries of bots and agents that I wish to ignore. But I want to find all the entries that are **NOT from bots**. So I try `grep -v -f robot_patterns *.log` and no results are returned by grep. This is not what I expect or desire, and I am not finding an obvious way to get what I want. When using the `-v` option combined with multiple patterns in a file, grep will only return a matching line if it matches EVERY pattern.


title: What is the default font used in rxvt?

text: I have installed urxvt and I like the default font being used (white font in attached screenshot) but I can't figure out what it is. The font is not defined in Xresources or Xdefaults.![enter image description here](http://i.stack.imgur.com/7BJLt.png) I have also read that it uses one of the font in fc-list but I don't know which one is being used exactly.


title: How to read a .war file?

text: I am trying to view the content of a .war file. I first did set its permissions with `chmod 777` then when I try to accces it using:               cd /usr/local/standalone/deployments/Sample.war/WEB-INF/classes/      It is giving `cd: /usr/local/standalone/deployments/Sample.war/WEB- INF/classes/: Not a directory` and I am not able to proceed further. Can someone help me in this issue?


title: Drop_caches doesn't drop caches?

text: Sometimes I see my swap file is a bit bigger then usual. I tried `sync && echo 3 > /proc/sys/vm/drop_caches` to no avail. But when I tried `swapoff -a` it takes a bit longer but the swap file is smaller after. How can I clear my swap file without using `swapoff`?


title: RHEL 5.5 - Need to refresh /dev/disk/by-label links

text: I've added a fibrechannel disk to a RHEL 5.5 server. The disk is present and shows under /dev/sdxx - But I need to give udev a kick and have it refresh the /dev/disk/by-label/LABEL links; this is where I do my mount points. I do not want to reboot the system. Any help is appreciated.


title: GNU parallel vs & (I mean background) vs xargs -P

text: I'm confused about the difference or advantage (if any) of running a set of tasks in a `.sh` script using `GNU parallel` E.g. Ole Tange's answer:               parallel ./pngout -s0 {} R{} ::: *.png      rather than say looping through them putting them in the background `&`. E.g. frostschutz's answer:               #copied from the link for illustration     for stuff in things     do     ( something       with       stuff ) &     done     wait # for all the something with stuff      In short are they just syntactically or practically different? And if practically different when should I use each?


title: How can I tell GRUB I want to reboot into Windows—before I reboot?

text: I have a dual boot Linux/windows system set up, and frequently switch from one to the other. I was thinking if I could add a menu item in one of the menus to reboot directly into windows, without stopping at the GRUB prompt. I saw this question on a forum, that's exactly what I want but it's dealing with lilo, which is not my case. I thought of a solution that would modify the default entry in the GRUB menu and then reboot, but there are some drawbacks, and I was wondering if there was a cleaner alternative. (Also, I would be interested in a solution to boot from Windows directly into Linux, but that might be harder, and does not belong here. Anyway, as long as I have it in one way, the other way could be set up as the default. **UPDATE** It seems someone asked a similar question, and if those are the suggested answers, I might as well edit `/boot/grub/grubenv` as `grub-reboot` and `grub-set-default` and `grub-editenv` do. ) Thanks in advance for any tips. **UPDATE** : This is my GRUB version: `(GRUB) 1.99-12ubuntu5-1linuxmint1` I tried running `grubonce`, the command is not found. And searching for it in the repositories gives me nothing. I'm on Linux Mint, so that might be it... Seeing `man grub-reboot`, it seems like it does what I want, as `grubonce` does. It is also available everywhere (at least it is for me, I think it is part of the grub package). I saw two related commands: `grub-editenv` and `grub-set-default`. I found out that after running `sudo grub-set-default 4`, when running `grub- editenv list` you get something similar to:               saved_entry=4      And when running `grub-reboot 4`, you get something like:               prev_saved_entry=0     saved_entry=4      Which means both do the same thing (one is temporary one is not). Surprisingly, when I tried:               sudo grub-reboot 4     sudo reboot now      It did not work, as if I hadn't done anything, it just showed me the menu as usual, and selected the first entry, saying it will boot this entry in 10s. I tried it again, I thought I might have written the wrong entry (it is zero- based, right?). That time, it just hanged at the menu screen, and I had to hard-reset the PC to be able to boot. If anyone can try this out, just to see if it's just me, I'd appreciate it. (mint has been giving me a hard time, and that would be a good occasion to change :P). Reading the code in `/boot/grub/grub.cfg`, seems like this is the way to go, but from my observations, it's just ignoring these settings...


title: No ports can be found using port scan

text: **Problem:**   I have a laptop and a server (Home-Server) with fc17. They are both using the desktop environment. I am trying to set up a VNC server on Home-Server so that I can set everything up without having to sit in front of it for everything. I have tried using the VNC server software included in the distro. and I have tried using TigerVNC Server. I can't get either one to work. When I scan the ports of my server using my laptop, it quickly stops and shown nothing. So I disabled the firewalls on both systems and forwarded all ports to the server on my router. I still cannot find any open ports on my Home-Server. I am at my wit's end. Please help me find out why I cannot find any ports on my server. Note: I can see the ports that are open on my Windows system. Note: Router has OpenVPN Server enabled.         **Scenario:**   Server: Fedora 17   Notebook: Fedora 17   Router: WNDR3700v1   Router Firmware: Gargoyle v1.5.8    **Output from "iptables -L":**               Chain INPUT (policy ACCEPT)     target     prot opt source               destination              ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED     ACCEPT     icmp --  anywhere             anywhere                 ACCEPT     all  --  anywhere             anywhere                 ACCEPT     udp  --  anywhere             anywhere             state NEW udp dpt:openvpn     ACCEPT     udp  --  anywhere             anywhere             state NEW udp dpt:netbios-ns     ACCEPT     udp  --  anywhere             anywhere             state NEW udp dpt:netbios-dgm     ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:netbios-ssn     ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:microsoft-ds     ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:ssh     REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited          Chain FORWARD (policy ACCEPT)     target     prot opt source               destination              REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited          Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination


title: Alternate screensaver settings on different X instances

text: On my desktop system, I run two instances of X-- one is associated with the physical screen, one is associated with a virtual screen (a la `vncserver`). I use the physical one to do things related to being physically present (e.g., mess with local equipment) and I use the virtual one for doing things that transcend and persist across my visits. I connect locally/remotely to the virtual/vncserver instance and all works great... until my default screensaver kicks in. The screensaver runs fine and independently on both instances. But when I'm connected remotely to the virtual instance and become inactive, the screensaver burns up bandwidth. I could change my default screensaver to be something less visually active, but for a variety of reasons, I like having it active on the physical instance. Given that screensaver's behavior is controlled via a file-based configuration, it seems like there should be a way to have different screensaver settings for different displays (especially since you can have different Xorg configurations). Nothing is leaping out at me though-- is it not as easy as it seems like it should be? Note: If it matters, this is on a Centos 6.x system with Gnome 2.something


title: qemu - two clients (tap0 & tap1) via br0 can't ping eachother but server pings ok

text: I've got:   * A host system running Ubuntu with KVM (functional)   * Two clients, one Ubuntu and one Windows 7, nothing fancy. I've also setup (see below) a bridge via br0 for the clients:   * br0: 192.168.2.1 (with DHCP running)   * eth0 -> br0   * tap0 -> br0   * tap1 -> br0 br0 can give IP to the clients, they get:   * Windows 7: 192.168.2.29   * Ubuntu: 192.168.2.30 ## Here's my problem:   * Windows ICMP -> br0: Works   * Ubuntu ICMP -> br0: Works   * Ubuntu ICMP -> Windows: Fails http://www.youtube.com/watch?v=5C1VvJezouI    * * * I played around with some NAT (which i'm getting the hang of via iptables) and that works like a charm! Without any issues both the clients can ping www.google.se and fetch data etc, but not between each other?! * * *    Here's the commands i'm running from the beginning to end:               tc qdisc del dev wlan0 root 2>/dev/null     tc qdisc del dev wlan0 ingress 2>/dev/null     iptables -P INPUT ACCEPT     iptables -F INPUT     iptables -P OUTPUT ACCEPT     iptables -F OUTPUT     iptables -P FORWARD DROP     iptables -F FORWARD     iptables -t nat -F PREROUTING     iptables -t nat -F OUTPUT     iptables -t nat -F POSTROUTING     iptables -t nat -F     iptables -t mangle -F     ip route flush table main     iptables -t mangle -A PREROUTING -p tcp -j CONNMARK --restore-mark          modprobe ifb numifbs=1     modprobe ip_conntrack     modprobe xt_mark     modprobe iptable_nat          echo "1" > /proc/sys/net/ipv4/ip_forward     echo "0" > /proc/sys/net/bridge/bridge-nf-call-arptables     echo "0" > /proc/sys/net/bridge/bridge-nf-call-iptables     echo "0" > /proc/sys/net/bridge/bridge-nf-call-ip6tables          ifconfig br0 192.168.2.1 netmask 255.255.255.0     route add -net 192.168.2.0 netmask 255.255.255.0 dev br0     ip route add default via 192.168.2.1 dev wlan0          kpartx -av win7.img     kpartx -av ubuntu.img          tunctl -u `whoami` -t tap0     ip link set tap0 up     brctl addif br0 tap0          tunctl -u `whoami` -t tap1     ip link set tap1 up     brctl addif br0 tap1          kvm -no-reboot -m 1300 -hda /dev/mapper/loop0p1 -boot order=c -net nic,macaddr="DE:AD:BE:EF:EC:B6" -net tap,ifname=tap0,script=/etc/qemu-dummy          kvm -no-reboot -m 1300 -hda /dev/mapper/loop1p1 -boot order=c -net nic,macaddr="DE:AD:BE:EF:EC:B7" -net tap,ifname=tap1,script=/etc/qemu-dummy      At this point, i'm trying to ping between the clients without success so i close down the systems and run:               brctl delif br0 tap0     brctl delif br0 tap1     ifconfig tap0 down     ifconfig tap1 down     tunctl -d tap0     tunctl -d tap1     kpartx -dv win7.img     kpartx -dv ubuntu.img


title: Command : must be run from a terminal

text: I have a shared hosting account, I logged using ssh. when I type for example `su` I had this output : `su: must be run from a terminal` Is this error relative to the fact that I don't have sufficient permissions or to something else ?


title: Changing hostname doesn't change the terminal name

text: I had set my hostname while installing linux as "ankit". i want to change it to "ankit.centos". I tried changing hostname in `/etc/hosts`, `/etc/sysconfig/network` and `sysctl kernel.hostname=ankit.centos`. Though the hostname is set correctly which I verified by typing `hostname` on terminal, but even after restarting the system the name on terminal is not changed it still is showing `root@ankit$`. Any clues how do change that?


title: mirroring a pane between two windows

text: Is it possible to have the same pane appear in two different windows of a single tmux session? I typically have a single horizontal split in my main window with vim in the top pane (about 80-90% of the terminal height), and a command line in the bottom pane where I run the program I'm working on. Because the bottom window is so small, I often can't see error output, and using tmux's keyboard shortcuts to scroll back is getting tiresome. I'd like to have my second window attach to the same pane so that if I need to see more of my error output, I can just quickly switch to the second window without needing to deal with scrollback. Is this possible? (I guess one fallback would be to use something like tee to write stdout to a log file and tail that in my second window. I'm hoping that's not necessary though)


Why OpenSuse (ver.13) does no install a lot of basic softwares for development. But their GUI and widget softwares are all over the place. For example, there is no `gcc` installed. there is no `make` installed. There is no `git` installed. There is no basic kernel header installed. So after fresh installation of Suse. I have to manually install a lot of things in order just to compile one of my project.


title: How to point to ssh folder with private keys to automatically choose one?

text: I would like to be able to use `ssh user@host` without the `-i identity_rsa_or_else_private_key_file` . Is there a place somewhere in `ssh` configs where I can point where are the private keys located so that the `ssh` will automatically choose one for the connection (so that I don't have to type `-i key_file`)?