title: "No protocol specified" when running vim with sudo

text: Recently I start to get "No protocol specified" when using `sudo vim`. It's just a warning I guess, because everything was working normally (I can open, edit and save files). The message doesn't appear if I use `sudo -E vim` so I think I did something wrong when editing `/etc/profile` recently, but I'm not sure. How can I fix this?


title: Curl and grep html text

text: Is there a way to grep html text from a curl request and output grab the value that is between two html tags? More specifically the input value of a form?


title: Can I easily remount an external USB drive without unplugging it?

text: Sometimes, a USB drive (or equivalent) that I have plugged in to my machine gets unmounted. Now, I know I could unplug it and plug it back in to remount it, but is it possible to **easily** do it from within the system? For me, "easily" means "without using sudo" and without having to set up any special files, permissions, groups, or directories. It happens infrequently enough that things like that would be overkill. But somehow having to unplug and replug the drive in seems ... not quite right, somehow. I'm using Debian Squeeze with Gnome, in case that makes a difference.


title: how to make PKG_CONFIG_PATH variable to refer an installed library?

text: I am in the process of installing the required libraries for FireFox 3.6 on a Redhat Linux Nash 4.x system. I already have successfully installed the glib2.12.0 library, but When I ./configure the atk 1.9.0 library I get the following error.               checking for pkg-config... /usr/bin/pkg-config     checking for GLIB - version >= 2.5.7... no     *** Could not run GLIB test program, checking why...     *** The test program failed to compile or link. See the file config.log for the     *** exact error that occured. This usually means GLIB is incorrectly installed.     configure: error:     *** GLIB 2.5.7 or better is required. The latest version of     *** GLIB is always available from ftp://ftp.gtk.org/. If GLIB is installed     *** but not in the same location as pkg-config add the location of the file     *** glib-2.0.pc to the environment variable PKG_CONFIG_PATH.      How can I add the path to the Environment variable?


title: Any program like `sudo` to gain root by having two users enter a password?

text: I run a server which is used by a group of individuals for e-mail, mailing lists, personal web homes etc. I thought about ways to provide root access for other members to allow them handling problems on the server. But I don't like to give full root privileges to everyone. What about the idea that **two** users must enter the password in `sudo` style to open a root shell? This would prevent a single user from hijacking the whole server. To increase security any number of needed user passwords above 1 could be used. As I see now this could be a nice way to provide root access within a group of people who know each other quite well and live nearby.   * Do you know such a program?   * what do you think about the concept in general?


title: Prevent GNU Screen from closing

text: Is there any way to make GNU Screen not close if I end all its subprocesses? Ideally, it would create a new window running a shell if I accidentally closed the last window.


title: Why is `tac file | grep foo' (piping) faster than `grep foo < <(tac file)' (process substitution)?

text: _This question was motivated by "Reverse grepping", about grepping a huge file from bottom up._ @chaos said: > >     tac file | grep whatever >   > > Or a bit more effective: >   >   >     grep whatever < <(tac file) >   @vinc17 said: > The `< <(tac filename)` should be as fast as a pipe There are also many interesting comments from other users. My questions:   * What is the difference between `|` and `< <()`?   * Why is one faster than other?   * And which is really faster?   * Why did no one suggest `xargs`?


title: How can I hide messages of udev?

text: When I plug in a usbhub (7 sticks in) udev displays a lot of messages in console. Can I hide these messages or send them to /dev/null?


title: Kernel modesetting hangs my boot, but the ATI driver requires it

text: I have a late 2011 MacBook Pro. It has an integrated Intel video card and a discrete ATI video card. Ideally, I'd like my Xorg to use the ATI card with the free driver (no Catalyst). Here's the problem: kernel modesetting hangs my boot (verified by adding `nomodeset` to kernel parameters), and I can't figure out why. However, the ATI driver _requires_ KMS, as does the Intel driver. What are my options for getting graphics with the desired setup as described above? I'm on kernel 3.13.8, Arch GNU/Linux. I've also tried it with kernel 3.10.35, AKA the LTS kernel. No luck. As suggested in comments, I've tried to ping the affected machine after it locks up. I can't tell for sure, but it appears that it's completely frozen, not just the display. I've also tried booting into Mac OS X and using gfxCardStatus to force using the Intel card. This did nothing. In order to try to get more information, I've booted the MacBook with the following kernel parameters appended to my normal kernel line (the regular kernel, not the LTS kernel, and with `quiet` removed), and with gfxCardStatus set to on-the-fly switching (this seemed to revert automatically on a reboot of OS X):               rootwait ignore_loglevel debug debug_locks_verbose=1 sched_debug initcall_debug mminit_loglevel=4 udev.log_priority=8 loglevel=8 earlyprintk=vga,keep log_buf_len=10M print_fatal_signals=1 apm.debug=Y i8042.debug=Y drm.debug=1 scsi_logging_level=1 usbserial.debug=Y option.debug=Y pl2303.debug=Y firewire_ohci.debug=1 hid.debug=1 pci_hotplug.debug=Y pci_hotplug.debug_acpi=Y shpchp.shpchp_debug=Y apic=debug show_lapic=all hpet=verbose lmb=debug pause_on_oops=5 panic=10 sysrq_always_enabled      ![Very end of boot process log](http://i.stack.imgur.com/JoIsh.jpg) ![Entire end of boot log](http://i.stack.imgur.com/joFZ8.jpg) When I try to start GDM using either the ATI or Intel drivers, booted without KMS, Xorg fails with a message about not finding a suitable driver (expected, since the Intel/AMD drivers need KMS). I've also tried using the `xf86-video- vesa` package, but that fails with a message about having a suitable driver but not having a suitable configuration - something about the BIOS not being right. I've tried using PRIME, but since I can't get Xorg to come up even without acceleration or anything fancy, `xrandr` doesn't work and I can't even get past the first step. I've thought about using vgaswitcheroo or something related, but I don't think that will do anything due to the fact that the underlying issue is, I believe, the fact that KMS is hanging. The final thing I've tried is using the proprietary Catalyst driver, due to the fact that it has it's own KMS implementation, but I couldn't get it to install due to an Xorg server version mismatch. And honestly, I have less than zero desire to use a proprietary driver if I can help it, so I didn't try very hard. I've sent the Linux Kernel Mailing List an email about this, and hopefully someone will get back to me. Is it possible that I've run into a kernel bug or an Xorg bug worth reporting? I've Googled, but nothing helpful's come up.


title: Increasing Command Line Resolution Centos 6.4 VirtualBox

text: I running CentOS 6.4 in just CLI mode. However, I have a 1080 monitor and the resolution from the CLI interface is horrible. Do I still have to install Guest Additions in order to increase display resolution.


title: Change and save pdf annotation setting in Okular?

text: In Okular,   1. I add inline notes to a pdf file. I change the default settings for inline notes:     * from default font "Ubuntu 13" to "Ubuntu 6", and      * from default opacity 100% to opacity 0%.  But I have to change the settings for every inline note. I wonder if it is possible to change the settings and save the change for the following inline notes?   2. Also how can I create a inline note without the box-line boundary?   3. How can I move a existing inline note to another place? Thanks!


title: Need help installing NVIDIA graphics driver for Optimus configuration

text: I have followed the following steps to get Optimus/Bumblebee configuration running on Fedora 20 (fresh basic installation) on my brand new laptop (based on msi barebone MS-16GC). I have listed all steps, very similar to this link The end result has x not booting, I can boot to a terminal. I feel I am stuck at the last step, please help: These are the steps I have taken 1) My BIOS does not support switching on/off the nvidia card 2) Fedora 20 was installed from live cd - kernel/software updated - kernel-devel and kernel- headers are installed, along with gcc-c++ and lshw. NVIDIA display driver version 331.20 is downloaded, but not installed yet. 3) Subsequent current kernel: 3.11.10-301.fc20.x86_64 4) lspci gives two devices of intrest               00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)     01:00.0 3D controller: NVIDIA Corporation GK106M [GeForce GTX 765M] (rev a1)      lshw shows that the NVIDIA card uses nouveau                *-display                  description: 3D controller             product: GK106M [GeForce GTX 765M]             vendor: NVIDIA Corporation             physical id: 0             bus info: pci@0000:01:00.0             version: a1             width: 64 bits             clock: 33MHz             capabilities: bus_master cap_list rom             configuration: driver=nouveau latency=0             resources: irq:16 memory:f6000000-f6ffffff memory:c0000000-cfffffff memory:d0000000-d1ffffff ioport:e000(size=128) memory:f7000000-f707ffff          *-display          description: VGA compatible controller          product: 4th Gen Core Processor Integrated Graphics Controller          vendor: Intel Corporation          physical id: 2          bus info: pci@0000:00:02.0          version: 06          width: 64 bits          clock: 33MHz          capabilities: vga_controller bus_master cap_list rom          configuration: driver=i915 latency=0          resources: irq:43 memory:f7400000-f77fffff memory:b0000000-bfffffff ioport:f000(size=64)      In preperation of driver NVIDIA driver install 5) blacklist nouveau, by creating a file blacklist.conf in /etc/modprobe.d/ with the line `               blacklist nouveau      Reboot               mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img     dracut /boot/initramfs-$(uname -r).img $(uname -r)      Reboot And in /etc/default/grub I added rdblacklist=nouveau to GRUB_CMDLINE_LINUX Followed by the grub2-mkconfig > /boot/grub2/grub.cfg command Reboot the computer (just to be sure) lshw now outputs the following - no sign of nouveau is disabled - device is UNCLAIMED.                *-display UNCLAIMED                     description: 3D controller                     product: GK106M [GeForce GTX 765M]                     vendor: NVIDIA Corporation                     physical id: 0                     bus info: pci@0000:01:00.0                     version: a1                     width: 64 bits                     clock: 33MHz                     capabilities: bus_master cap_list                     configuration: latency=0                     resources: memory:f6000000-f6ffffff memory:c0000000-cfffffff memory:d0000000-d1ffffff ioport:e000(size=128) memory:f7000000-f707ffff      *-display                  description: VGA compatible controller                  product: 4th Gen Core Processor Integrated Graphics Controller                  vendor: Intel Corporation                  physical id: 2                  bus info: pci@0000:00:02.0                  version: 06                  width: 64 bits                  clock: 33MHz                  capabilities: vga_controller bus_master cap_list rom                  configuration: driver=i915 latency=0                  resources: irq:43 memory:f7400000-f77fffff memory:b0000000-bfffffff ioport:f000(size=64)      6) Next I create a file in my home directory called .xinitrc containing following lines               xrandr --setprovideroutputsource modesetting NVIDIA-0     xrandr --auto     exec gnome-session      7) Then I create a file in /etc/X11 called xorg.conf2 containing following data               Section "ServerLayout"         Identifier "layout"         Screen 0 "nvidia"         Inactive "intel"     EndSection          Section "Device"         Identifier "intel"         Driver "intel"     EndSection          Section "Screen"         Identifier "intel"         Device "intel"     EndSection          Section "Device"         Option "ConstrainCursor" "no"         Identifier "nvidia"         Driver "nvidia"         BusID "PCI:1:0:0"     EndSection          Section "Screen"         Identifier "nvidia"         Device "nvidia"     #Comment to output using hdmi cable        Option "UseDisplayDevice" "none"     EndSection      8) Time to install the drivers /* I get stuck here */ Type chmod +x NVIDIA* And then ./NVIDIA* Next I move xorg.conf2 to xorg.conf This installs fine, but when rebooting all I get is a black screen, I can log in to ttyl when I type startx from command line same problem, just black screen. Please help!


title: Does OpenBSD have a limit to the number of file descriptors?

text: What's the maximum number of file descriptors that a process can get on OpenBSD successfully? For example, there is an **`openfiles`** limit in **login.conf(5)** in OpenBSD. If I want to have as many file descriptors as possible, but still don't let a runaway process to bog down the system, what would be a sensible value to set? E.g. if I specify, say, `20000`, will the kernel be capable of giving my application all of these 20000 FDs? What if I'm running multiple instances of a given application (e.g. multiple worker processes)?


title: Programmatically get folders last edit time

text: How can I programmatically get a folders latest edit? I have already written the following script:               #!/usr/bin/perl     my @ls_command_result=qx(ls -l);     my @the_folder=grep /folder_i_want/, @ls_command_result;     print STDOUT "@the_folder";      Using this script i can get the latest edit date of the folder, but the problem is that I just get it as a string, but i will be needing to compare this outcome to other dates and therefore it would be vastly better to have it in the format of say, epoch second. How would it be best to go about getting this information?


title: How to forward one port to another (on the same machine)?

text: A machine (M) is behind a NAT. Port X is forwarded through, and available to the internet. My application wants to connect to port Y. How to I configure M to forward incoming data on port X to port Y?


title: Some UTF-8 characters not being recognized by grep or sed

text: Trying to determine all characters in a file. The file `sample` consists of:               a eɪ     abandon əˈbændən     ability əˈbɪləti     able ˈeɪbəl     able ˈeɪbl     abortion əˈbɔrʃən     abortion əˈbɔrʃn     about əˈbaʊt     above əˈbʌv     abroad əˈbrɔd      Confirmed locale is correct:               $ echo $LANG          en_US.UTF-8      A command to take the second field, split by character, then count how many:               $ cat sample | awk '{print $2}' | grep -o . | sort | uniq -c | sort -n            1 a       1 æ       1 i       1 v       2 d       2 t       3 e       3 l       3 ɔ       3 r       4 n       9 b      11 ə      17 ɪ      Where is `ʃ` and `ˈ`? They aren't combining characters or anything special. Note that other UTF-8 characters are pulled out: `ɔ`, `ə` and `ɪ`, for example. BTW using `sed 's/\\(.\\)/\1\n/g'` has nearly the same results as `grep -o .`, except it adds a line for '\n'. Is there something I'm missing? Does grep have a hidden UTF-8 option? In case it matters I'm using `Ubuntu 12.04.2 LTS`.


title: Remotely compile and run program using ssh and screen

text: I'm trying to compile and run a program remotely. However, I'd like to this within a screen and also I'd like to run this using grid engine on another node after I ssh. Currently I have:               ssh me@server screen -R session 'qlogin; cd path; mvn options program'      This basically works, but I get a message saying that I must be connected to a terminal. I read about this and added the -t option to ssh. With that, my command breaks: it seems like I ssh over, screen starts, then doesn't know about the "mvn" command and terminates my session. I'm wondering why this is happening and how to correctly launch jobs from my local machine, within a screen, on a remote node while using grid engine.


title: How to find out whether a shell script is written in bash or sh

text: How can I find out whether a script is written in `bash` or `sh`? The first line of the script is not helpful here, since on Linux, bash scripts have this line: `#!bin/sh` Actually, there are many distribution where `/bin/sh` is bash (maybe `/bin/sh` is a link to `/bin/bash` in those distributions), and not Bourne Shell. So if I try to run a script that is written in bash in, for example, FreeBSD, the result is not defined, since `/bin/sh` in FreeBSD is Bourne Shell, and not bash. Is there are easy way to identify if a script is bash or sh? Are there some distinctive things in syntax?


title: What documentation shows the associated numbers for linux signals like SIGTERM and SIGKILL?

text: I can look around the internet and find that the associated number for SIGKILL is 9, but is there linux documentation (such as, a man page) showing the complete list of signals and their numbers?


title: ImportError when running WSGI app in Apache: undefined symbol: PyUnicodeUCS2_DecodeUTF8

text: I'm trying to run MoinMoin under Apache on SLES 11P1. I'm getting the following error in my Apache log when somebody tries to access the site:               mod_wsgi (pid=20772): Target WSGI script '/srv/www/wiki/moin.wsgi' cannot be loaded as Python module.     mod_wsgi (pid=20772): Exception occurred processing WSGI script '/srv/www/wiki/moin.     wsgi'.     Traceback (most recent call last):       File "/srv/www/wiki/moin.wsgi", line 44, in <module>         from MoinMoin.web.serving import make_application       File "/usr/local/lib64/python2.6/site-packages/MoinMoin/web/serving.py", line 14, in <module>         from MoinMoin import version, log       File "/usr/local/lib64/python2.6/site-packages/MoinMoin/log.py", line 92, in <module>         import logging.config       File "/usr/lib/python2.6/logging/config.py", line 30, in <module>         import sys, logging, logging.handlers, string, socket, struct, os, traceback, types       File "/usr/lib/python2.6/logging/handlers.py", line 27, in <module>         import logging, socket, types, os, string, cPickle, struct, time, re     ImportError: /usr/lib64/python2.6/lib-dynload/cPickle.so: undefined symbol: PyUnicodeUCS2_DecodeUTF8      However, I have no problem if I execute the failing statement manually from a Python interpreter:               $ python     'import site' failed; use -v for traceback     Python 2.6.6 (r266:84292, Feb 17 2011, 08:36:48)      [GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2     Type "help", "copyright", "credits" or "license" for more information.     >>> import logging, socket, types, os, string, cPickle, struct, time, re     >>>      What could cause that error when running under Apache, but not when running Python at the command-line? Edit: It looks like they are hitting different shared libraries. Apache is hitting `/usr/lib64/python2.6/lib-dynload/cPickle.so` and the Python interpreter that I invoke at the command-line is hitting `/usr/lib/python2.6/lib-dynload/cPickle.so`               $ python -v      ...     >>> import cPickle     dlopen("/usr/lib/python2.6/lib-dynload/cPickle.so", 2);     dlopen("/usr/lib/python2.6/lib-dynload/cStringIO.so", 2);


title: Linking ".." do somewhere other than parent directory and other strange fs beharviors

text: Can the entry ".." become linked to someplace other than the parent directory? Is it possible to cause "tar" to create this weird behavior? Scenario: I have a pre-built compiler to a embeded system, distributed as tar.gz files, which works perfectly in Ubuntu 10.04. When testing an upgrade to Ubuntu 12.04 in a VirtualBox VM, it failed to find out some header files. Exploring the files for the cause of the problem, I noticed it became lost following "/a/somewhat/convoluted/../../path/../full/of/up/../references/". Exploring a bit more, I found some strange behavior:   * "ls /that/strange/../../path" shows me the files as expected.   * typing "ls /that/strange/../../path" in bash for a list of files inside "/that/strange/../../path" (ie, triggering the filename completion without running "ls") shows me a DIFFERENT list of files.   * when I fix the path interpreting the ".." by hand, both outputs are the same. I suppose "ls" and the filename globbing differ in the way they find the files (opendir/readdir, glob, etc.) and one of these operations steps in a filesystem error. Running fsck in the VM resulted in nothing unusual. Same result for installing the compiler again in a new VM. "tar" returned no error. Do somebody got this kind of problem?


title: Mouse sensitivity confusion

text: In my few years of using Linux from using Windows for so long, there have been many new concepts for me to grasp. One of the more obvious seeming mysteries to me is how the mouse is configured in Linux. As a life-long Windows gamer, I've always seen mouse acceleration as my nemesis, as I would expect many gamers. I can remember being baffled when I first started (using Fedora 9) and finding that I had no mouse acceleration when the acceleration level was in the _middle_ , not when it was turned right down. From then until Fedora 14 it was all dandy set like that, but when I recently moved to Fedora 17, these settings don't feel right. The only time I don't have acceleration is when the acceleration is turned right down, except then the mouse is very insensitive and the sensitivity level makes _no difference_ at all. I read recently about a command called `xset` which lets you have control over the actual values of the variables 'acceleration' and 'threshold' (the number of 'dots' travelled at which point the cursor should accelerate), and someone suggested that perhaps the way to have no acceleration is to set threshold to 1 and use the acceleration value as the sensitivity. However, this doesn't work, even with the threshold set to 1. I can still clearly detect acceleration. I know I'm using vague words, but you'll have to take my word for it when I say it "feels" like it has acceleration, no matter what I set it to. Even now, as I'm clicking in this text box to correct typos, I'm not hitting the right spot as I would do on Windows with my normal mouse motion because of it. I should mention that I don't use a fancy mouse or anything; it's just a Microsoft IntelliMouse Optical that you might find in an office (yes, not the favourite mouse for gamers). Have I missed something obvious, or is it really a complicated thing to change? * * * EDIT: this post: > (Some settings to remove mouse acceleration.) ... So now we have no > acceleration, but is that what we want? The mouse is a bit slow now. Sadly > that's how it is. With acceleration disabled you get a 1:1 relationship > between the mouse and the display. You move the mouse left one dot and the > mouse pointer moves one pixel left. If there were a way to multiply the > input movement (say by 2) then every other pixel on each axis would be > inacessible to the mouse. That would make accurate positioning of the mouse > pretty difficult. The 'sensitivity' setting in some GUI mouse control panels > actually does the opposite of what you would expect - the most sensitive is > a 1:1 ratio - it's the acceleration which makes it seem so much faster. I find this a bit hard to believe, or at least that sensitivity does move a number of dots on screen per dot moved by the mouse.


title: Simple example of using Fedora alternatives to install old version of make

text: Can anyone help me using the Fedora alternatives system in order to install an old version of make? I know the actual program is irrelevant, but I need it so I'll use it as my example. I currently have `make-3.82` installed on my Fedora 14 box, but I need to have 3.81 installed to build the android kernel. I already downloaded the 3.81 source and built it, but now I want to install it alongside 3.82 and be able to switch between them using Fedora alternatives. Now I installed `make-3.81` from source into `/usr/local`, how would I use alternatives to achieve my goal? I know I must use the alternatives command, but so far my attempts have failed and I would like a concrete example.


title: Difference of folders and files

text: I have two folders which have different folders inside. Those folders also contains different files. I am looking for the command that would give me the difference between those two parent folders. Not just difference of files that are contained in one folder and not in the other, but also difference in files contents. I have done this so far: `diff -rq fold1 fold2` .. But that doesn't give me the difference between the files. What command could I run?


title: Nemo Filemanager suddenly looks different

text: Today I started Nemo and noticed it's new (ugly) look which looks like some kind of fallback mode: ![](http://i.stack.imgur.com/xTFJF.png) When looking at the package history, I only see recent updates of phonon packages and the installation of wireshark and minitube. The current version is 2.0.8, downgrading to version 1.8.4-1 didn't help.


title: Can libnotify be used to execute a script?

text: Can `libnotify` be used to execute a script? I want to use a script to play a sound, or even run more complicated programs via the `notify-send` in bash files and other programs. Is that possible? It seems to use only popups?


title: Binutils documentation compilation problem

text: I'm trying to compile and install binutils+GCC for my machine on my own. I have compiled lastest binutils sources without getting any error, but installation seems to have some problems with `gas` documentation. Here is my installation log:               make[2]: Leaving directory '/src/binutils-2.23.51-1/build/etc'     make[2]: Entering directory '/src/binutils-2.23.51-1/build/gas'     Making install in doc     make[3]: Entering directory '/src/binutils-2.23.51-1/build/gas/doc'     make[4]: Entering directory '/src/binutils-2.23.51-1/build/gas/doc'     make[4]: Nothing to be done for 'install-exec-am'.     ../../../gas/doc/c-arc.texi:223: command @bullet not accepting argument in brace should not be on @table line     ../../../gas/doc/c-arm.texi:393: command @bullet not accepting argument in brace should not be on @table line     ../../../gas/doc/c-arm.texi:394: warning: @item missing argument     ...     ../../../gas/doc/c-cr16.texi:65: warning: @item missing argument     ../../../gas/doc/c-tic54x.texi:113: @code expected brace     ...     ../../../gas/doc/c-i386.texi:979: warning: node prev `i386-Bugs' in menu `i386-Arch' and in sectioning `i386-16bit' differ     ...     ../../../gas/doc/c-xtensa.texi:9: warning: node `Z80-Dependent' is next for `Xtensa-Dependent' in menu but not in sectioning     Makefile:397: recipe for target 'as.info' failed     make[4]: *** [as.info] Error 1     make[4]: Leaving directory '/src/binutils-2.23.51-1/build/gas/doc'     Makefile:592: recipe for target 'install-am' failed     make[3]: *** [install-am] Error 2     make[3]: Leaving directory '/src/binutils-2.23.51-1/build/gas/doc'     Makefile:2182: recipe for target 'install-recursive' failed     make[2]: *** [install-recursive] Error 1     make[2]: Leaving directory '/src/binutils-2.23.51-1/build/gas'     Makefile:4761: recipe for target 'install-gas' failed     make[1]: *** [install-gas] Error 2     make[1]: Leaving directory '/src/binutils-2.23.51-1/build'     Makefile:2141: recipe for target 'install' failed     make: *** [install] Error 2      The output is very large and some of the warnings are repeating (they just occur on different lines). It looks like the problem is caused by `as.info` file, and I guess I'm using old version of some tool for `.texi` files. I don't know what to do now. Does anybody have any idea what can I do for running the installation successfully?


title: Fedora 20 dosen't accept correct PIN for mobile broadband

text: I have a problem with the WWAN (Qualcomm Gobi 2000) in my Lenovo ThinkPad W510. I can not unlock my SIM card with the correct PIN. I enter the PIN in this dialog and after this ![SIM PIN](http://i.stack.imgur.com/BSU57.png) I get immediately this dialog ![SIM PIN2](http://i.stack.imgur.com/VduwJ.png) After I enter the SIM PIN2 the only thing that happens is that I get a notification that says that the connection is disabled. I know that this is not a problem with the PIN or the SIM card because I checked both with my Windows 8 notebook. What I have to do to use the WWAN in my notebook. Update from 2014-04-29 Just found this via `journalctl`               Apr 29 17:43:32 NetworkManager[1022]: <info> Activation (cdc-wdm0) starting connection 'O2'     Apr 29 17:43:32 NetworkManager[1022]: <info> (cdc-wdm0): device state change: disconnected -> prepare (reason 'none') [30 40 0]     Apr 29 17:43:32 NetworkManager[1022]: <info> Activation (cdc-wdm0) Stage 1 of 5 (Device Prepare) scheduled...     Apr 29 17:43:32 NetworkManager[1022]: <info> Activation (cdc-wdm0) Stage 1 of 5 (Device Prepare) started...     Apr 29 17:43:32 NetworkManager[1022]: <info> Activation (cdc-wdm0) Stage 1 of 5 (Device Prepare) complete.     Apr 29 17:43:32 ModemManager[900]: <info>  Simple connect started...     Apr 29 17:43:32 ModemManager[900]: <info>  Simple connect state (3/8): Enable     Apr 29 17:43:32 ModemManager[900]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (disabled -> enabling)     Apr 29 17:43:32 NetworkManager[1022]: <info> (cdc-wdm0) modem state changed, 'disabled' --> 'enabling' (reason: user-requested)     Apr 29 17:43:32 ModemManager[900]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (enabling -> disabled)     Apr 29 17:43:32 NetworkManager[1022]: <info> (cdc-wdm0) modem state changed, 'enabling' --> 'disabled' (reason: unknown)     Apr 29 17:43:32 NetworkManager[1022]: <warn> (cdc-wdm0) failed to connect modem: Couldn't set operating mode: QMI protocol error (60): 'InvalidTransaction'     Apr 29 17:43:32 NetworkManager[1022]: <info> (cdc-wdm0): device state change: prepare -> failed (reason 'unknown') [40 120 1]     Apr 29 17:43:32 NetworkManager[1022]: <warn> Activation (cdc-wdm0) failed for connection 'O2'     Apr 29 17:43:32 NetworkManager[1022]: <info> (cdc-wdm0): device state change: failed -> disconnected (reason 'none') [120 30 0]     Apr 29 17:43:32 NetworkManager[1022]: <info> (cdc-wdm0): deactivating device (reason 'none') [0]     Apr 29 17:43:32 firewalld[887]: 2014-04-29 17:43:32 ERROR: UNKNOWN_INTERFACE: cdc-wdm0     Apr 29 17:43:32 NetworkManager[1022]: <warn> (cdc-wdm0) firewall zone remove failed: (32) UNKNOWN_INTERFACE: cdc-wdm0     Apr 29 17:45:52 PackageKit[2687]: daemon quit     Apr 29 17:46:40 dbus-daemon[928]: dbus[928]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service'     Apr 29 17:46:40 dbus[928]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service'     Apr 29 17:46:40 systemd[1]: Starting PackageKit Daemon...     Apr 29 17:46:40 PackageKit[3672]: daemon start     Apr 29 17:46:40 dbus-daemon[928]: dbus[928]: [system] Successfully activated service 'org.freedesktop.PackageKit'     Apr 29 17:46:40 dbus[928]: [system] Successfully activated service 'org.freedesktop.PackageKit'     Apr 29 17:46:40 systemd[1]: Started PackageKit Daemon.     Apr 29 17:46:44 PackageKit[3672]: get-updates transaction /395_dedbecee from uid 1000 finished with success after 4026ms      Update from 2014-05-02 AFAIK the WWAN firmware is loaded and the device is successfully initialized:               nmcli -p n     ============       Netzwerk     ============     NETZWERK       ------------     aktiviert      [root@uss-titan marceljanus]# nmcli -p d     ======================================               Status der Geräte     ======================================     GERÄT     TYP       STATUS               --------------------------------------     wlp3s0    wifi      verbunden            cdc-wdm0  gsm       nicht verbunden      em1       ethernet  nicht verfügbar      lo        loopback  nicht verwaltet           lsusb     Bus 002 Device 004: ID 05c6:9205 Qualcomm, Inc.      Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub     Bus 003 Device 004: ID 090c:1000 Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) Flash Drive     Bus 003 Device 002: ID 04b3:310d IBM Corp.      Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 001 Device 005: ID 17ef:480f Lenovo Integrated Webcam [R5U877]     Bus 001 Device 004: ID 0a5c:217f Broadcom Corp. BCM2045B (BDC-2.1)     Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor     Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub      Output from `/var/log/messages` after trying to enable the connection:               May  2 15:11:34 NetworkManager[889]: <info> Activation (cdc-wdm0) starting connection 'O2'     May  2 15:11:34 NetworkManager[889]: <info> (cdc-wdm0): device state change: disconnected -> prepare (reason 'none') [30 40 0]     May  2 15:11:34 NetworkManager[889]: <info> Activation (cdc-wdm0) Stage 1 of 5 (Device Prepare) scheduled...     May  2 15:11:34 NetworkManager[889]: <info> Activation (cdc-wdm0) Stage 1 of 5 (Device Prepare) started...     May  2 15:11:34 NetworkManager[889]: <info> Activation (cdc-wdm0) Stage 1 of 5 (Device Prepare) complete.     May  2 15:11:34 ModemManager[793]: <info>  Simple connect started...     May  2 15:11:34 ModemManager[793]: <info>  Simple connect state (3/8): Enable     May  2 15:11:34 ModemManager[793]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (disabled -> enabling)     May  2 15:11:34 NetworkManager[889]: <info> (cdc-wdm0) modem state changed, 'disabled' --> 'enabling' (reason: user-requested)     May  2 15:11:34 ModemManager[793]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (enabling -> disabled)     May  2 15:11:34 NetworkManager[889]: <info> (cdc-wdm0) modem state changed, 'enabling' --> 'disabled' (reason: unknown)     May  2 15:11:34 NetworkManager[889]: <warn> (cdc-wdm0) failed to connect modem: Couldn't set operating mode: QMI protocol error (60): 'InvalidTransaction'     May  2 15:11:34 NetworkManager[889]: <info> (cdc-wdm0): device state change: prepare -> failed (reason 'unknown') [40 120 1]     May  2 15:11:34 NetworkManager[889]: <warn> Activation (cdc-wdm0) failed for connection 'O2'     May  2 15:11:34 NetworkManager[889]: <info> (cdc-wdm0): device state change: failed -> disconnected (reason 'none') [120 30 0]     May  2 15:11:34 NetworkManager[889]: <info> (cdc-wdm0): deactivating device (reason 'none') [0]     May  2 15:11:34 firewalld: 2014-05-02 15:11:34 ERROR: UNKNOWN_INTERFACE: cdc-wdm0     May  2 15:11:34 NetworkManager[889]: <warn> (cdc-wdm0) firewall zone remove failed: (32) UNKNOWN_INTERFACE: cdc-wdm0


title: Command 'uptime' returns 'average'

text: I wrote a simple bash script that checks the load average values using 'uptime' every 5 minutes and writes a result to the text file. Everything is OK except one thing: every day from 12:00 to 13:00 I see text value 'average' instead of regular integer values. How should I interpreter the 'average' as a result of 'uptime' command? And if I run 'uptime' from the command line everything is OK - I see regular integer values. The source code below:               #!/bin/bash          sCurrentUptime="$(uptime | awk '{print $10}')"     iLength="${#sCurrentUptime}"     sUptime="${sCurrentUptime:0:iLength-1}"     iUptime=${sUptime/.*}     now="$(date)"     echo $now';'$iUptime      And here are the outputs (last collumns contains load average value):               Thu Apr 17 08:40:01 MSK 2014;0     Thu Apr 17 09:00:01 MSK 2014;2     Thu Apr 17 09:20:02 MSK 2014;3     Thu Apr 17 09:40:02 MSK 2014;3     Thu Apr 17 10:00:01 MSK 2014;2     Thu Apr 17 10:20:01 MSK 2014;3     Thu Apr 17 10:40:01 MSK 2014;1     Thu Apr 17 11:00:02 MSK 2014;2     Thu Apr 17 11:20:01 MSK 2014;3     Thu Apr 17 11:40:01 MSK 2014;2     Thu Apr 17 12:00:02 MSK 2014;3     Thu Apr 17 12:20:02 MSK 2014;average     Thu Apr 17 12:40:01 MSK 2014;average     Thu Apr 17 13:00:01 MSK 2014;average     Thu Apr 17 13:20:01 MSK 2014;3     Thu Apr 17 13:40:01 MSK 2014;1     Thu Apr 17 14:00:01 MSK 2014;2     Thu Apr 17 14:20:01 MSK 2014;3     Thu Apr 17 14:40:01 MSK 2014;2     Thu Apr 17 15:00:01 MSK 2014;2     Thu Apr 17 15:20:01 MSK 2014;3     Thu Apr 17 15:40:01 MSK 2014;1


title: How do I make a tmpfs mountpoint persistent across reboots?

text: If I create a ram disk on cent os using tmpfs will it go away on restart? I know the data will go away (I would assume), but will it still survive a reboot? I am going to allocate a ram disk for use on mysql /tmp directory I just want to make sure it will work after reboot. (I don't have another server to try it on)


title: Can not start Oracle after installation

text: I'm using Lenovo G580 under intel i5 third generation with 4GB RAM. I'm trying to install Oracle 11g standard edition After completing all pre installation and post installation procedures, when I started sqlplus I got an error, something like this:               sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory      I've searched many websites, but I didn't get clear way to rectify this. What do I need to do to get rid of this error?


title: Fedora 3200x1800 resolution to small - can't see anything

text: I bought the a new notebook (Dell M3800) and installed Fedora 20 with KDE for the first time on it (actually my first Linux system ever). My problem is now, that my resolution is tooo big.. I can't see anything. And I can't even select a lower one, which should fit ( **16:9** ). So a friend of mine changed somehow manually the resolution to **1920x1080** , but somehow it doesn't looks like it's perfectly high resolution. He created somehow a file and a script (because when you run that file it takes effect, but after a restart it's on the QHD+ resolution again). Anybody knows why the resolution doesn't looks like that good. Maybe somebody has a cleaner solution for me? Here is the output of `xrandr`:               Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192         eDP1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 346mm x 194mm        3200x1800     59.98 +        2048x1536     60.00          1920x1440     60.00          1856x1392     60.01          1792x1344     60.01          1600x1200     60.00          1400x1050     59.98          1280x1024     60.02          1280x960      60.00          1024x768      60.00          800x600       60.32    56.25          640x480       59.94          1920x1080     59.96*      VGA1 disconnected (normal left inverted right x axis y axis)     HDMI1 disconnected (normal left inverted right x axis y axis)     DP1 disconnected (normal left inverted right x axis y axis)     HDMI2 disconnected (normal left inverted right x axis y axis)


title: Calling `source` from bash function

text: I'm trying to source a file whose name is passed from stdin. My plan is to create a function like this:               mySource() {         # get stdin and pass it as an argument to `source`         source $(cat)     }      to be called like this: `$ echo "file1.sh" | mySource` wherein `file1.sh` is:               FILE=success     export FILE      Assuming `$FILE` is initialized to `hello world`, when I run `$ echo "file1.sh" | mySource`, I expect `$ echo $FILE` to print `success`; however, instead it prints `hello world`. Is there some way to source a file from a function?


title: How do I access a web server behind NAT and proxy?

text: I have installed a local web server for an web application for a customer. Their server is behind NAT and uses proxy for access internet. Is there a way to access the web application remotely from my computer?


title: Identify lines that are out of order

text: I have a process that generates output _mostly_ in lexicographically sorted order according to a (timestamp) field, but occasionally the lines will be output in the wrong order:               2014-08-14 15:42:02.019220203 ok     2014-08-14 15:42:03.523164367 ok     2014-08-14 15:42:04.525655832 ok     2014-08-14 15:42:06.523324269 ok     2014-08-14 15:42:05.930966407 oops     2014-08-14 15:42:07.643347946 ok     2014-08-14 15:42:07.567283110 oops      How can I identify each location where the data are "unsorted"? Expected output (or similar):               2014-08-14 15:42:05.930966407 oops     2014-08-14 15:42:07.567283110 oops      I need a solution that works as the data are generated (e.g. in a pipeline); it's less useful if it only operates on complete files. `sort --check` would be ideal but it only outputs the _first_ point of disorder; I need a full listing.


title: remove a char string from a command output (sed, or maybe something else)

text: I'm trying to retrieve the distro name from the `lsb_release -i` output, but using               lsb_release -i | sed 's/Distributor ID: //g'      won't do the trick. What am I doing wrong? Or maybe should I change the tool?


title: Simpler processing of shell script options

text: I'm looking for way to process shell script arguments that is cleaner and more "self documenting" than getopt/getopts. It would need to provide...   * Full support of long options with or without a value after '=' or ' '(space).   * Proper handling of hyphenated option names (i.e. --ignore-case)   * Proper handling of quoted option values (i.e. --text "A text string") I would like to eliminate the overhead of the big loop with embedded case statement that getopt/getopts requires and reduce option processing to something like...               option=argumentparse "$@"     [[ option == ""           ]] && helpShow     [[ option =~ -h|--help    ]] && helpShow     [[ option =~ -v|--version ]] && versionShow     [[ option =~ -G|--GUI     ]] && GUI=$TRUE     [[ option =~ --title      ]] && TITLE=${option["--title"]}      Here, an argumentparse() function resolves the various syntax possibilities into a consistent format, perhaps an associative array. There must be something coded out there somewhere. Any ideas? _(updated and retitled)_


title: Enable udev and speex support for pulseaudio

text: I tried to install pulse audio, but after running `./configure` I got a warning message:               ===== WARNING WARNING WARNING WARNING WARNING WARNING WARNING =====     You do not have udev support enabled. It is strongly recommended     that you enable udev support if your platform supports it as it is     the primary method used to detect hardware audio devices (on Linux)     and is thus a critical part of PulseAudio on that platform.     ===== WARNING WARNING WARNING WARNING WARNING WARNING WARNING =====               ===== WARNING WARNING WARNING WARNING WARNING WARNING WARNING =====     You do not have speex support enabled. It is strongly recommended     that you enable speex support if your platform supports it as it is     the primary method used for audio resampling and is thus a critical     part of PulseAudio on that platform.     ===== WARNING WARNING WARNING WARNING WARNING WARNING WARNING =====      I tried to find information about enabling these two services, but I couldn't find anything. How can I enable them?


title: Video Gibberish (once every week or two)

text: Trying to track down an odd video problem. I was running Ubuntu (Precise Penguin) before and running Lucid before that. In both cases the video was running fine (over the last two years). However just less than two months ago I installed Linux Mint 13 and am returning to a mess of video gibberish on my computer about once every week or two. The last time it happened was this morning (Feb 18th). Since the VAR LOG MESSAGES log isn't enable in Mint by default, I don't have a lot of historical data to give. I just enabled it about a week and a half ago. VAR LOG MESSAGES http://pastebin.com/yjgtjhn1 XORG.0 LOG http://pastebin.com/Jy1acYu4 For further clarification, the "gibberish" looks like what would happen if you had an incorrect video driver. However attempting go switch to another TTY using CTRL ALT F* does nothing. I've also tried to restart X with CTRL+ALT+Backspace and that does nothing either. Oddly I end up just hard resetting the computer to get things back. Can anyone shed any light on this problem for me or give me further troubleshooting steps?


title: switching nvidia profiles

text: I have an old laptop with a nivdia card (360m) and I use powermizer to force it to run a very low clock. Heres my configuration at `/etc/X11/xorg.conf.d/20-nvidia.conf`                  Section "Device"           Identifier "Device0"                                                             Driver    "nvidia"                                                                           Option     "RegistryDwords" "PowerMizerLevelAC=0x3"                                                                                Option     "NoLogo" "1"        EndSection      Right now, whenever I watch movies or play a few games on Steam, I manually change the file so that gpu runs at a higher clock. Its a bit clumsy but it gets the job done. Are there better ways to do this? ( Like a different X profile for different users)


title: `ls` behavior on EACCES error for /root and /root/some-rubbish

text: I'm trying to code a clone of the `ls` command as part of a school exercise. I'm wondering why the following output is displayed by `ls`:               $> ls -- -test_dir  /root /root/some-rubbish     ls: /root/some-rubbish: Permission denied     -test_dir:     test.txt          /root:     ls: root: Permission denied      Specifically, I've noticed that when the searched folder has more than one "part", that is, when is it has at least one `/` between two alphanumerical parts, like `that/folder`, then `EACCES` errors get displayed at the top. Otherwise, they are displayed in alphabetical order like any other listed directory. I'm currently testing this on OSX 10.8, if that makes any difference. I hope the above is clear enough. If not, I'll try to clarify.


title: How to build a python egg for a TRAC plugin?

text: I'd like to install a mercurial plugin for Trac. The manual provides an svn path with the source code. I need to create an "egg" from that source code. Do I need to have SVN installed in order to do this, or can this be done in a different way? (I'm very new to Linux, I've been using it only for the past two weeks.)


title: Can I query which processes (if any) are currently accessing the microphone?

text: I'm running Debian (technically Raspbian), trying to get a Star-Trek style voice-command system. I've got it mostly up and running, but in the interests of privacy and all that jazz, I don't want my microphone always recording. I'm wondering, is there a way to poll which processes, if any, are currently accessing the microphone? The idea is that I'd make myself a little indicator to tell if the microphone was currently recording audio or not. My ultimate goal is to turn the microphone on and off using a TV-remote, and to have an LED indicator for if it's on or off. I've got all the hardware stuff working, I just need the software end now. I believe that right now I'm configured in pure ALSA i.e. not PulseAudio, though I could be wrong.


title: How to detect IP of given device in same network

text: I have a very typical situation in which I want to connect an (android) phone to a linux notebook in the same (wifi) network using ssh. The IP's are assigned by DHCP so I know only the one of the client in advance. Knowing the IP of the client I could in principle loop a ssh command over all possible IP's in the same net to see if a server is listening there. However this seems highly inefficient. So, how can I figure out the IP of my host (knowing it's MAC address) so I can connect to it using ssh? I know about other software which achieves something like this so it must be possible. Related: can I dynamically assign a hostname to this IP on the client (assuming it is Linux) so that I can use a static entry in the ssh config file?


title: One non-root user run jetty by port 512 which less that port1024

text: Customer asks us to create a non-root user to run our web system which bind port 512, less than 1024. When web server(jetty) runs, this is the exception:               2013-10-16 14:49:51.406:WARN::failed Server@2c2893ce: java.net.SocketException: Permission denied     2013-10-16 14:49:51.406:WARN::EXCEPTION     java.net.SocketException: Permission denied             at sun.nio.ch.Net.bind0(Native Method)             at sun.nio.ch.Net.bind(Net.java:444)             at sun.nio.ch.Net.bind(Net.java:436)             at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)      So I found out some solutions about how non-root user bind port less than 1024, at last the solution i used was set "cap_net_bind_service" to java, by set Capabilities, the command is:               sudo setcap cap_net_bind_service+eip /usr/lib/jvm/jdk1.7.0_25/bin/java      But when i start jetty again, another error happens:               [admin@VPRCEMSUSOFC04 bin]$ ./jetty.sh start     Starting Jetty: /usr/lib/jvm/jdk1.7.0_25/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory      Even when I execute `java -version`, it also causes an exception:               [admin@VPRCEMSUSOFC04 bin]$ java -version     java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory      But when I login with root, it`s fine:               [root@VPRCEMSUSOFC04 etc]# java -version     java version "1.7.0_25"     Java(TM) SE Runtime Environment (build 1.7.0_25-b15)     Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)      I can`t understand why this happen. Why there are two different results under root and non-root user. It seems that set Capabilities impact this. The Linux kernel is 2.6.32-220.el6.x86_64. OS is Red Hat Enterprise Linux Server release 6.2 (Santiago).


title: What is the best way to check if file has changed in Bash and keep 15 last copies of it?

text: What would be the best way to write a bash script and run it from `cron` (every hour) that:   1. Would see if a file in a directory has changed   2. If changed, make a copy with incrementing version number and date appended to filename   3. Keep last 15 versions of the file in the directory and delete the ones above 15th I kind of feel I could have a go at it, but this one is important for me so I would be very glad to have opinion from others as I don't know shell scripting that well. I use mostly Debian and fedora.


title: How to get lilbmp3lame encoding to work with ffmpeg?

text: When I am converting an FLV to an AVI one, I always get:               Unknown encoder 'libmp3lame'      But I've installed it with Ubuntu Software Center. I am using this command:               ffmpeg -i video.flv -acodec libmp3lame -vcodec msmpeg4 -ab 192kb -b 1000kb -s 640x480 -ar 44100 video.avi      How do I get this to work?


title: What's the difference between fdisk -l and df -h?

text: In my ubuntu system, I want to have a look about my system disk info. When I use `fdisk -l` without `sudo`, I get nothing. But with `sudo fdisk -l`, I only get a device /dev/sda1, but when I use `df -h`, I get so many devices, like `/dev/sda2`, `/dev/sda4` and so on. What is the difference between such disk operations?               # fdisk -l     WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use          Disk /dev/sda: 6000.1 GB, 60000069312512 bytes     255 heads, 63 sectors/track, 729466 cylinders, tatal 11718885376 sectars     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000        Device Boot     Start          End      Blocks   Id  System     /dev/sda1              1   4294967295  2147483647+  ee  GPT          # df -h     Filesystem     Size  Used Avail Use% Mounted on     /dev/sda2      457G  2.0G  432G   1% /     udev            16G  4.0K   16G   1% /dev     tmpfs          6.3G  236K  6.3G   1% /run     none           5.0M     0  5.0M   0% /run/lock     none            16G     0   16G   0% /run/shm     /dev/sda4      5.0T  604G  4.2T  13% /var


title: How to monitor user who using dropbear ssh tunneling?

text: I was used OpenSSH in my debian server. I can see who is using ssh tunneling using either nethogs or top command. When i change from openssh to dropbear i cant monitor user again. In nethogs or top command it only show root user. How to see if other user is using ssh tunneling ? Thanks.


title: What do $@ and $< in a makefile mean?

text: I am seeing a makefile and it has the symbols $@ and $< in it. I have never seen them, and Google does not show any results about them. Do you know what these commands do?


title: How to refresh the desktop background in various desktop environments?

text: In XFCE 4.10 I can refresh my desktop background with `xfdesktop --reload`. I would like to know how I can do the same for as many as possible other desktop environments (Unity, KDE, LXDE, Mate, Cinnamon, GNOME2, GNOME3,...).


title: Can I pipe stdout on one server to stdin on another server?

text: `stdout` on one CentOS server needs to be piped to `stdin` on another CentOS server. Is this possible? ## Update ScottPack, MikeyB and jofel all have valid answers. I awarded the answer to Scott because, even though my question didn't specify security as a requirement, it's always nice to be safe. However, the other two fellows' suggestions will also work.


title: How to automate configuration of the Linux kernel build

text: I'm compiling a flavor of the Linux kernel based on the default configuration (for an ODROID system), with some additional features enabled. I want to automate this process so that I don't have to reselect the features again if I want to build a newer version of the kernel. I could have saved the whole `.config` file, but if the default configuration changes in the future release, then my `.config` file will get outdated. Is there some alternative to `make menuconfig` that will just take a set of features and enable them in an unattended fashion?


title: usb / virtual com port - is it dead?

text: I have video gimbal that I am attempting to setup. The device, a Basecam 3 Axis unit, has a micro USB port interface. When I plug a USB cable from my Debian laptop to the gimbal and run "lsusb" I get no changes. Additionally dmesg shows nothing. Yet the board receives power (solid red light, solid green light and a high-pitched "chirp" confirms as much). If I don't see anything listed in lsusb and dmesg, is it a high probability that there is an issue the board itself?


title: How to play 720p video in Fedora 20 if necessary plugin not found?

text: I tried to play an 720p video in the default video player in Fedora 20, but it couldn't play it. It shows that a plugin is needed to play this file format and searches it online, and says that there is no such plugin. Is there any other way to configure the default player or suggest me another media player which can play 720p video mp4 format?


title: How to kill a process that says "Operation not permitted" when attempted?

text: I have a process I would like to kill:               computer@ubuntu:~$ ps aux | grep socat     root      2092  0.0  0.0   5564  1528 pts/1    T    14:37   0:00 sudo socat TCP:xxx.17.29.152:54321 PTY,link=/dev/ttyGPS0,raw,echo=0,mode=666     computer@ubuntu:~$ kill 2092     -bash: kill: (2092) - Operation not permitted   <--------------- How to kill ??


title: How to use ( yumdownloader --resolve <package name> ) on ( yum -y groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts" )?

text: As soon as I finish installing "centos-minimal" from the minimal ISO file, I need to install the GUI desktop. for this I simply run, `ifup eth0`, and then I run:               yum -y groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts"      I would like to install all these from a local folder if possible. Here's what I know. For example to install `gcc` locally I can simply create a folder named `gcc` on my USB stick for example. Then go into that folder and then run this command:               yumdownloader --resolve gcc      This will download everything needed to install `gcc` on my system, assuming that system does not yet have `gcc` installed. It will download all of the dependencies and so on, into the folder: `gcc`. Then the next time around when I re-install CentOS minimal, I can just go into this folder and run:               yum --nogpgcheck localinstall *.rpm -y      It installs `gcc` as long as I'm in the "gcc" folder with all the files that were downloaded. The question is, how to apply this to this command:               yum -y groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts"      Because I don't think there is such program as:                "Desktop" and so on..       What would the `yum install <package name> -y` equivalency be for:               yum -y groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts"      because if I knew that, then I could use this:               yumdownloader --resolve <package name>      To download all the necessary packages to a folder and then install the GUI from a folder without an internet connection the next time around, when I re- installed CentOS minimal Linux.


title: How to safely reverse dns lookup on ip in a shell script

text: I'm trying to find out how to take in a hostname and pop out an ip address (reverse dns lookup). I came up with this but I'm not too sure it's safe across different linux distros:               nslookup $ip|grep "name ="|sed 's/^.*name = //'| sed '$s/\.$//'      It appears to be okay. The call to nslookup gives:               $ nslookup 127.0.0.1     Server:     192.154.28.100     Address:    192.154.28.100#53          1.0.0.127.in-addr.arpa  name = localhost.      So we grep to remove the lines that don't give the hostname. Then we use said to remove everything before "name = " and remove the . at the end. If there are more than one line for whatever reason, then we just take the first one only. That gives 'localhost' There must be some better way to do this?


title: Alternate keyboard inputs: dwm on Debian

text: Currently my laptop's keyboard has some broken keys (`z`, `x`, `c`). When using my Windows partition I know I can just use `Alt`-codes to enter the keys or use alternate hotkeys for the respective keys (`Alt`- and `Shift``Insert` for copy and paste). I know that using GTK I can use `Shift``Alt``U`,"hex code". But what about dwm, how to I input `z`, `x`, `c`?


title: Copy files in different subdirectories that excludes a string

text: I'm trying to copy all files of a type in a given directory and subdirectories but excluding files of a different type. `find /var/ftp/pub/bs -iname "*foo*.foo" -exec cp {} /var/ftp/pub/bs1 \;` which works but I'd rather do the exclude which is more accurate. So I need to copy files with that end with `*.foo` but exclude files that contain `foo1` Something like this (which doesn't work)               find /var/ftp/pub/bs -iname "*.foo" | grep --exclude="*foo1*" -exec cp {} /var/ftp/pub/bs1


title: Copying to an external NTFS partition: slows down when I copy many files at once

text: I have made my peace with the fact that NTFS(-3g) on Linux will be slower than NTFS performance on Windows. I can write to my external NTFS-formatted USB 3.0 HDD at about 100+ MB/s on Windows while I have to settle for 30 MB/s (give or take) on my Debian (Wheezy) box. That's not the problem, however. I found (empirically) that if I want to copy, say, 20 files from my box to the HDD, the copying starts off at the "normal" 30 MB/s but gradually slows down to a miserly 4 MB/s!! Whereas, if I do the copy, say, 5 files at a time (serially) the copying speed remains at 30 MB/s for _all four_ copy processes. This is not specific to Debian, by the way. I've observed similar behavior on Fedora and Ubuntu. My question is, is this behavior normal or should I be concerned? If something is wrong, how should I go about debugging it/fixing it?


title: Proxmox Master Node crashes

text: I've inadvertently discovered a Proxmox bug. I run a personal cluster of 4 nodes (a technology lab for giggles and gags). Each node has a Dell Perc 5i and 4 HDDs in RAID 10. The standard Proxmox install uses the entire logical drive and puts in place 2 partitions, the system drive and a local drive (`/var/lib/vz`). I recently discovered that running QCOW2 allows me to take snapshots whereas running VMDK's does not. I also learned that I cannot migrate VMs unless they are on network storage. Not a problem, first I install NFS server on all the nodes, then created and export a NFS folder on `/var/lib/vz` file system (`/var/lib/vz/nfs`) then added this as network storage. Next I began to migrate my drives to the NFS folder on the local machine, and converting the images to QCOW2 using the web interface drive move command. This works, but here is how I can consistently crash the Proxmox cluster service:   1. If I try to copy more than one VM drive at a time on the master node.   2. If I try to copy a very large (250Gb) VM by itself on the master node. The master node seems to just go south. The web interface shows everything is down. Progress on the copy just halts. OS sync commands run at the shell never return, shutdown requests hang, init 0 commands hang. Eventually, I have to cycle the power on the node. So, some questions:   1. Is it because I'm copying to NFS? I'm using a bog standard nfs4 nfs-kernel-server.   2. Is it because I'm keeping the drive that hosts the master quorum too busy? After all, the RAID 10 setup is reading and writing these large files from local to a nfs share on the same machine - we are keeping the TCP stack and the drive itself very busy.   3. Is there some best practice I'm missing here? - I know I would never put this into production - keep in mind this is a home-made cluster running a lab of inexpensive servers.  Any help would be appreciated.


title: Is there a way to convert a zip to a tar without extracting it to the filesystem?

text: Is there a way to convert a `zip` archive to a `tar` archive without extracting to a temporary directory first? (and without writing my own implementation of `tar` or `unzip`)


title: When do jiffies increment? How a process runs in a jiffy?

text: I know that jiffies length is selected at kernel compile time and it is defaulted to 250 (4ms).   Source: man 7 time - The Software Clock, HZ, and Jiffies I wonder what happens inside a jiffy. What are the conditions to increase the value of `utime` or `stime` in `/proc/pid/stat`? When does it happens? I have some thoughts but I'm not sure they are true:   * When a process gets time to run, the jiffy count is incremented instantly.   * Linux can't tell how many operations have been executed in 1 jiffy.   * Furthermore Linux can't tell how much time has been used by the current process in 1 jiffy. (Has it used all the 4 milliseconds, or less?)   * Current process starts in the beginning of the jiffy and never starts later.   * When a process is done and there is remaining time from current jiffy nothing happens (nop).   * If a process with higher priority occurs it does not affect the current jiffy. It would help a lot to understand theese.


title: Updating PHP 5.3 to 5.4 in CentOS

text: I followed this tutorial to update PHP from 5.3 version to 5.4. My distro is CentOS 5.5. After running the following command:               yum --enablerepo=remi,remi-test install httpd php php-common        I get following error:                   --> Finished Dependency Resolution     php53-common-5.3.3-13.el5_8.i386 from updates has depsolving problems       --> php53-common conflicts with php-common     Error: php53-common conflicts with php-common      You could try using --skip-broken to work around the problem      You could try running: package-cleanup --problems                             package-cleanup --dupes                             rpm -Va --nofiles --nodigest      How can I solve this error?


title: Sample a few lines from an strace printout

text: I've got a process that I want to inspect with strace, but since it's printing out a lot of stuff, I would like to sample only a few lines every X seconds from it. Is there any way of doing that with bash or similar? For example:               strace -p 123456 | "print out most recent 80 lines every 2 seconds"


title: Restore Gnome Panel to Default Configuration

text: Is there any way to restore the gnome panel configuration back to default?


title: suse cannot install software

text: I just installed suse 11.3, but cannot update the system. Update Applet says: > PackageKit Error repo-not-available: Failed to download /media.1/media from > http://download.opensuse.org/distribution/11.3/repo/oss/ I filled in my details in yast->proxy, and Firefox works fine with the same details. My laptop is a Packard Bell with ATI graphics card which I am yet to install. Could it be the network card?


title: How do I connect to a pc through another pc using ssh

text: I have **three** Computers. **PC1** and **PC2** is on a private LAN, where **PC1** is known to **PC2** as `192.168.0.2` **PC2** and **PC3** is on a another LAN, where **PC2** is known to **PC3** as `192.168.123.101` How can I connect to **PC1** from **PC3** with SSH. Is there something like:               ssh user@192.168.0.2 -via user@192.168.123.101


title: Is it possible to have multiple SSH host aliases?

text: I have a laptop that can obviously be inside or outside of my home network at times. When I need to SSH into a machine inside of my network, the connection is fairly straightforward:               localhost $ ssh machinelearning      When I'm trying to access the machine from _outside_ of my network, I then need to connect to my router, then SSH from there:               localhost $ ssh router.mytotallyuniquedomain.com     router $ ssh machinelearning      I remember there being a shortcut for doing the latter command in `~/.ssh/config`, but at the moment I can't remember what it is. Is there a way for me to supply multiple hostnames or types of connections so that when I do this:               $ ssh machinelearning      SSH will first attempt to connect to the `machinelearning` host in the local network and then attempt to tunnel in through `router.mytotallyuniquedomain.com`, all without me having to type out the long hostname?


title: SSH Twice in bash alias/function

text: At work, we run a portal server to access all of our "real" servers. Essentially, anyone who needs to SSH into one of the "real" (web) servers would first SSH into the portal, so it looks like this:               mike@localhost#    ssh mike@portal     #ssh login notice stuff blah blah     mike@portal#    ssh mike@webserver      I'm trying to write a bash alias or function to combine these two steps into one. I'm not the sysadmin by any stretch, so keeping this as simple as possible without installing extra software would be nice. I've tried the following but it won't go through as I had hoped:               ssh mike@portal; ssh mike@webserver #terminates on terminal for portal     ssh mike@portal `ssh mike@webserver` #hangs     ssh mike@portal ssh mike@webserver #connects, but gives error "pseudo-terminal will not be allocated because stdin is not a terminal"      Any ideas or workarounds for this?


title: How can I find which process sends data to a specific port?

text: I have a service, keeping a certain port open. I'm getting data to it, that I neither expect nor want to get, and I'm trying to pin-point the source of this data. So how can I find which process that _sends_ data to a specific port, as opposed to which process is listening.


title: Black screen after changing primary monitor

text: I've just did a clean install of Linux Mint Maya x64. I am using two monitors (default screen of my laptop and external HP w2007v). The problem is that after I've changed my primary monitor to the external one (did it using control center), I get black screen on both after login and I can't do anything. Is there any way to make my computer work again? It doesn't matter now which one will be default, I just want it to work again.


title: Iptables: matching outgoing traffic with conntrack and owner. Works with strange drops

text: In my iptables script I have been experimenting with writing as finely grained rules as possible. I limit which users are allowed to use which services, partly for security and partly as a learning exercise. Using iptables v1.4.16.2 on Debian 6.0.6 running the 3.6.2 kernel. However I've hit an issue I don't quite understand yet.. . ### outgoing ports for all users This works perfectly fine. I do not have any generic state tracking rules.               ## Outgoing port 81     $IPTABLES -A OUTPUT -p tcp --dport 81 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT     $IPTABLES -A INPUT -p tcp --sport 81 -s $MYIP -m conntrack --ctstate ESTABLISHED -j ACCEPT      ### outgoing ports with user matching               ## outgoing port 80 for useraccount     $IPTABLES -A OUTPUT --match owner --uid-owner useraccount -p tcp --dport 80 -m conntrack --ctstate NEW,ESTABLISHED --sport 1024:65535 -j ACCEPT     $IPTABLES -A INPUT -p tcp --sport 80 --dport 1024:65535 -d $MYIP -m conntrack --ctstate ESTABLISHED -j ACCEPT      This allows port 80 out only for the account "useraccount", but rules like this for TCP traffic have issues.               ## Default outgoing log + block rules     $IPTABLES -A OUTPUT -j LOG --log-prefix "BAD OUTGOING " --log-ip-options --log-tcp-options --log-uid     $IPTABLES -A OUTPUT -j DROP      ## The Issue The above works, the user "useraccount" can get files perfectly fine. No other users on the system can make outgoing connections to port 80.               useraccount@host:$ wget http://cachefly.cachefly.net/10mb.test But the wget above leaves x7 dropped entries in my syslog:               Oct 18 02:00:35 xxxx kernel: BAD OUTGOING IN= OUT=eth0 SRC=xx.xx.xx.xx DST=205.234.175.175 LEN=40 TOS=0x00 PREC=0x00 TTL=64 ID=12170 DF PROTO=TCP SPT=37792 DPT=80 SEQ=164520678 ACK=3997126942 WINDOW=979 RES=0x00 ACK URGP=0        I don't get these drops for similar rules with UDP traffic. I already have rules in place that limit which users can make DNS requests. The dropped outgoing ACK packets seem to be coming from the root account (URGP=0) which I don't understand. Even when I swap useraccount for root. I believe that ACK packets are categorised as new because conntrack starts tracking connections after the 3rd step of the 3 way handshake, but why are the being dropped? Can these drops be safely ignored? ## Edit So I often see rules like these, which work fine for me:               $IPTABLES -A OUTPUT -s $MYIP -p tcp -m tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT     $IPTABLES -A INPUT -p tcp -m tcp --sport 80 -d $MYIP -m state --state ESTABLISHED -j ACCEPT      I swapped "-m state --state" for "-m conntrack --ctstate" as state match is apparently obsolete. Is it best practice to have generic state tracking rules? Are the rules above not considered correct? For tight control over outgoing users connections would something like this be better?               $IPTABLES -A INPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT     $IPTABLES -A OUTPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT          $IPTABLES -A OUTPUT -p tcp --dport 80 -s $SERVER_IP_TUNNEL -m conntrack --ctstate NEW -m owner --uid-owner useraccount -j ACCEPT          $IPTABLES -A OUTPUT -p tcp --dport 80 -s $SERVER_IP_TUNNEL -m conntrack --ctstate NEW -m owner --uid-owner otheraccount -j ACCEPT


title: Set MAC address to default

text: Sometimes I need to spoof MAC address, I'm doing so with this command:               ip link set dev eth0 address XX:XX:XX:XX:XX:XX      Is there a way how to set MAC address back to default without reboot?


title: Which driver for Intel HD Graphics should I install?

text: Recently, I have replaced my old motherboard Giga G41M + Pentium 5500 CPU with the new Giga B75M + Celeron G540 CPU. The old motherboard has an on-board GPU, Intel GMA X4500. The new motherboard has no on-board GPU, but the new CPU has an on-die GPU, Intel HD Graphics. I'm running Debian testing, without reinstall after upgraded the hardware. Command `lspci -vk` shows the driver `i915` is in use for the video:               00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) (prog-if 00 [VGA controller])             Subsystem: Giga-byte Technology Device d000             Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+             Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-             Latency: 0             Interrupt: pin A routed to IRQ 43             Region 0: Memory at f7800000 (64-bit, non-prefetchable) [size=4M]             Region 2: Memory at e0000000 (64-bit, prefetchable) [size=256M]             Region 4: I/O ports at f000 [size=64]             Expansion ROM at <unassigned> [disabled]             Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-                     Address: fee0300c  Data: 4171             Capabilities: [d0] Power Management version 2                     Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)                     Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-             Capabilities: [a4] PCI Advanced Features                     AFCap: TP+ FLR+                     AFCtrl: FLR-                     AFStatus: TP-             Kernel driver in use: i915      Now the problems,   * Though `i915` works, but it seems a bit of too slow. For example, it can only play the video "Ducks take off 1080p" less than 1 fps.   * Is `2nd generation...` lspci reported the right generation? In the Wikipedia it shows my Intel HD Graphics is the **6th** generation.   * Is `i915` the right driver for my Intel HD Graphics? It seems the module name for HD Graphics is `intel` from some Ubuntu sites. If so, I can't find the `intel` driver for Debian. Should I use the ubuntu sources.list? Where to get the `intel` driver?   * Or, maybe I can simply let Xorg to rescan the hardware and re-pick the right driver for me?


title: What is the usage of pattern before substitute command in sed

text: There is an example in this link about `sed`: To delete the first number on all lines that start with a "#" use:               sed '/^#/ s/[0-9][0-9]*//'      What is the benefit of first pattern(`/^#/`)? It could be simply:               sed 's/^#[0-9][0-9]*//'


title: Recommendation for an eBook reader for Gnome

text: There are eBook readers for Android, there's Okular for KDE, and stuff like that, but what I want, is an eBook (ePub format) reader for my normal Linux desktop. I know there's Calibre, which goes way beyond being just an eBook reader, and theres FBReader, Which doesn't really work as of yet. Given that eBooks have been around for several years now, I'd assume, more software would've sprung up by now.


title: Pidgin will not disable the notifications

text: I'm using Pidgin 2.10.0-1.fc14 and libpurple 2.10.0. I have completely disabled all the notifications from _Plugins_ : _Libnotify Popups_ and _Message Notifications_. The problem is it still notifies every time someone is typing and a new message is received. I just want all the notifications to be shut off completely. What am I missing? **EDIT:** I've even removed `pidgin-libnotify` and still no effect.


title: zfs deduplication "low" ratio

text: In Solaris 11, in a pool named `mypool` I activated deduplication with               zfs set dedup=on mypool      Then I created two 100 MB file: `file1` and its copy `file1copy`. Only their names are different: their contents is the same. The mountpoint of `mypool` is `/mypool`. If I copy both `file1` and `file1copy` into `/mypool`, the output of               zpool list mypool      indicates a `DEDUP` ratio of barely `1.34x`. Why?? Then, following this guide I created a filesystem with               zfs create -o dedup=on -o mypool/archive      and then two users' filesystems `mypool/archive/a` and `mypool/archive/b` which inherited the deduplication from the parent filesystem. If now I copy `file1` into `mypool/archive/a` and `file1copy` into `mypool/archive/b` there is still a `DEDUP` ratio of `1.34x`. It becomes `2` only if I put the _same_ file, say `file1`, into _both_ `mypool/archive/a` and `mypool/archive/b`. Why?? Can a simple name difference strongly tear down deduplication? Shouldn't deduplication act at block level? * * * 1) Output of `zdb -S mypool`               Simulated DDT histogram:          bucket              allocated                       referenced               ______   ______________________________   ______________________________     refcnt   blocks   LSIZE   PSIZE   DSIZE   blocks   LSIZE   PSIZE   DSIZE     ------   ------   -----   -----   -----   ------   -----   -----   -----          1    1.48K    189M    189M    189M    1.48K    189M    189M    189M          2      800    100M    100M   99.9M    1.56K    200M    200M    200M      Total    2.26K    289M    289M    288M    3.04K    389M    389M    388M          dedup = 1.35, compress = 1.00, copies = 1.00, dedup * compress / copies = 1.35      2) Output of `zdb -b mypool`               Traversing all blocks to verify nothing leaked ...              No leaks (block sum matches space maps exactly)              bp count:            3679         bp logical:     410970112      avg: 111707         bp physical:    408433664      avg: 111017     compression:   1.01         bp allocated:   615948288      avg: 167422     compression:   0.67         bp deduped:     157286400    ref>1:    800   deduplication:   1.26         SPA allocated:  458661888     used: 76.47%      In both `mypool/archive/a` and `mypool/archive/b` folders there was also another file.


title: Error trying to call find from perl

text: use warnings;     use File::Find;          my $srceDir = "//mnt/Share_Drive/Verizon PM&T/Capture Files/";     opendir(DIR, $srceDir) or die "Can't open $srceDir: $!";     my @files = (find -type f -newermt "12 Feb 2013", $srceDir);     closedir(DIR);      I can run the `find` command with the `-newermt` option in Linux just fine but when I put it in the perl script I got the errors below, could you help? Thanks               String found where operator expected at ./queryAlm.pl line 11, near "newermt "12 Feb 2013""       (Do you need to predeclare newermt?)     syntax error at ./queryAlm.pl line 11, near "newermt "12 Feb 2013""


title: glibc malloc() uses mmap() for small blocks of memory allocation?

text: I learned that on Linux the glibc’s malloc() uses mmap() for very big chunk of memories and brk() is used for small allocations. However that does not seem to be the case when I experiment the theory with a test program. First, I use a ‘for’ loop in my code to assign a big chunk of memory (80MB) implemented by an array with the condition Option1==TRUE, and each allocation is a multiple of a page size. The chunk of memory will be freed altogether when Option2==TRUE. Note Option1 and Option2 can be set from the command line where my process is running. Observation: when Option1 was satisfied, the RSS value of my process increased 80MB. After that I set Option2 to be TRUE (while Option1 is disatisfied), then about the same amount memory was reduded from the RSS value (given back to OS). Everything is good so far. After that, I modified the 'for' loop to assign _two_ big chunks of memory (80MB each) implemented by _chunk_ and _chunk1_ with Option1. Within each loop the same indexes of the two arrays are assigned with the same amount of memory, and each allocation is _smaller_ than one page. The chunk of memory for _chunk_ will be freed completely when Option2==TRUE. And the chunk of memory for _chunk1_ will be freed completely when Option3==TRUE. Observation: the RSS value of my process increased 160MB with Option1==TRUE, and the value remained after Option2==TRUE. And it also remained after Option3==TRUE. I use the Valgrind massif tool to check the memory usage and it reported there are about 160 MB pages mmap’ed by the two malloc() functions in the ‘for’ loop. I can understand that the memory blocks by small allocations are kept in the process so that they can be used for future allocations. But shouldn't those small allocations be implemented by brk() but not mmap()? Is it because valgrind does not provide the accurate report or because there are some other cases that use mmap() to implement malloc() ? My code for the second test is copied below:                       char *chunk[200000];             char *chunk1[200000];             int i = 0;             int j,k;     ......             if (<Option1 == TRUE>) {                 if (i < 100) {                     for (k=0; k<2000; k++) {                     chunk[i*2000+k] = (char *)malloc(400);                     chunk1[i*2000+k] = (char *)malloc(400);                     memset (chunk[i*2000+k], 0, 400);                     memset (chunk1[i*2000+k], 0, 400);                     }                 }             }             if (<Option2 == TRUE>) {                 for (j = 0; j < 200000; j++) {                     if (chunk[j] != NULL) {                         free(chunk[j]);                         chunk[j] = NULL;                     }                 }             }             if (<Option3 == TRUE>) {                 for (j = 0; j < 200000; j++) {                     if (chunk1[j] != NULL) {                         free(chunk1[j]);                         chunk1[j] = NULL;                     }                 }             }     ......


title: How many authorized_keys can/should be set up in SSHD?

text: I'm following a FreeNX install wiki page for ArchLinux. Right now I'm setting the SSHD parameter for "AuthorizedKeysfIle". And this brings up the question, How many authorized_keys can/should be set up in SSHD to support all the services that use SSH tunnel? More importantly, this FreeNX tutorial is instructing me to point SSHD to a NX directory, but then what about SSH? NFS? A quick search finds several files in different locations:               /root/.ssh/authorized_keys2     /var/lib/nxserver/home/.ssh/authorized_keys2     /root/.ssh/authorized_keys     /srv/nfs4/mrwizard_xtian/.ssh/authorized_keys     /home/mrwizard/xtian/.ssh/authorized_keys


title: How does "man" restore the screen when I quit the program?

text: If I open a man page of a program like `cat` or `ls`, it prints (may not be the appropriate word) the contents of the man page and when I press `q`, it shows the screen just like before invoking the `man` command. How does the restore happen? What erases everything and then prints the previous contents of the shell? Example:               [VAR121@Tesla Testing]$  man ls      Output:               LS(1)                                                        User Commands                                                        LS(1)          NAME            ls - list directory contents          SYNOPSIS            ls [OPTION]... [FILE]...           ............      When I press `q`, the screen goes back to shells default appearance, such as the prompt shown below.               [VAR121@Tesla Testing]$  man ls     [VAR121@Tesla Testing]$      How is the screen restored ?


title: How do I configure systemd to activate an encrypted swap file?

text: My previous question produced the commands to add an encrypted swap file:               # One-time setup:     fallocate -l 4G /root/swapfile.crypt     chmod 600 /root/swapfile.crypt          # On every boot:     loop=$(losetup -f)     losetup ${loop} /root/swapfile.crypt     cryptsetup open --type plain --key-file /dev/urandom ${loop} swapfile     mkswap /dev/mapper/swapfile     swapon /dev/mapper/swapfile      But Arch Linux uses systemd, and I'm having trouble figuring out how to best get systemd to activate my swap file automatically. systemd.swap suggests that I should have a `dev-mapper-swapfile.swap` unit that looks something like:               [Unit]     Description=Encrypted Swap File          [Swap]     What=/dev/mapper/swapfile      That would execute the `swapon` command. But I'm not sure how to execute the commands to prepare `/dev/mapper/swapfile`. I gather that `dev-mapper- swapfile.swap` should declare a dependency on some other unit, but I'm not sure what that unit should look like.


title: How do you properly install Steam on Elementary OS?

text: A week ago I tried to install Steam, I downloaded the .deb package and installed it, and played a game with it. In the next day, Steam prompted me with this: > Steam needs to install these additional packages:   >  libgl1-mesa-dri:i386, libgl1-mesa-glx:i386, libc6:i386 And then I did it, I installed those packages. But it broke my system. The next time I rebooted my system, it went straight to tty, no GUI. I tried a bunch of things to fix it but the only way (for me, a new guy to Linux) was to reinstall the system. Now I'm trying to install it again and I found on the internet that installing `ia32-libs` would fix Steam. When I was going to install it, apt-get said that it would need to **remove elementary-desktop**. This is bad. Right now I don't know how to install Steam without breaking my system. What's the proper way to install it? If it's relevant, I'm using integrated graphics with an Intel Core i3 processor, Linux 3.2.0-51, distro: elementary OS Luna 64bit.


title: vimdiff disable/enable color coding

text: Is there any way to quickly disable/enable color coding in `vimdiff` ? The problem is, I have colored text in `vim` and the text is invisible is the text-color is Red, and the `vimdiff` too tries to put a background color of Red, making it hard to read. So, I would like to disable the color coding for sometime, for verifying the text and re-enable it later. Any quick, easy way to do this?


title: RedHat server packages are never found

text: I set up a virtual server Red Hat machine but every time I try to use the "yum" command to install new packages, the command works properly but it is never been able to find any package even the simplest and most common ones. I have Red Hat Enterprise Linux Server release 5.5 Am I missing something here? I'm very new to Red Hat but I cannot seem to find anything about this in the internet. Thank you,


title: How to use cut command to get the first and last elements of a row?

text: I've asked almost the same question already, but this time, I want to retrieve the X **latest** elements of a row of a CSV file. For example, with an input file as this one:               1;foo;bar;baz;x;y;z     2;foo;bar;baz;x;y;z     3;foo;bar;baz;x;y;z      What would be the command (eventually using `cut`) to get the last 2 columns, so I get:               y;z     y;z     y;z      In fact, my real target is to retrieve the first 3 **and** the last 2 fields of each row, so I get:               1;foo;bar;y;z     2;foo;bar;y;z     3;foo;bar;y;z      Unfortunately, I cannot use a command like `cut -d \; -f 1-3,10-11` (if there are 11 elements in the row), because the CSV file does not respect the _real_ CSV format. Indeed, some fields in the middle of the rows are _encrypted_ , and their encrypted value may sometimes contains a `;` characters (and of course, they are not wrapped inside `"`). In others words, my lines may look like that:               1;foo;bar;#@$"é&^l#;baz;x;y;z     2;foo;bar;#¤=é;)o'#;baz;x;y;z     3;foo;bar;#]]'~é{{#;baz;x;y;z      and as you can see, on the second line, there is an additional `;` character, so I can't use here a command like `cut -d \; -f 1-3,7-8`, because if will return that, which is wrong:               1;foo;bar;y;z     2;foo;bar;x;y  (-> Wrong here, there is a shift)     3;foo;bar;y;z      So how can I use `cut` to solve my problem? Thanks ps: I am specially in love with the `cut` command, so if you have a command that does what I want but that is not `cut`, then it's fine too :) _Edit_ It seems important to note that the machine is quite old: `uname -a` give this message:               SunOS ###### 5.10 Generic_142900-05 sun4u sparc SUNW,Sun-Fire-V240      and some commands may not be present (like `rev`)


title: ldapsearch error "Invalid general option name" for every option

text: Whenever I try to use `ldapsearch` with a `-o` option I get the following error: > Invalid general option name: An example command I am trying to run (taken from redhat documentation):               ldapsearch -p 389 -h server.example.com -o "mech=GSSAPI"          -o "authid=dn:uid=jsmith,ou=people,dc=example,dc=com"          -o realm=EXAMPLE.COM      But it doesn't matter what option I try, I still get this error. I also made sure `openldap` was up to date on this computer.


title: Guide how to configure D-Bus safely?

text: Recently I have tried to improve the safety/security of my system by using Linux Security Modules LSM like (apparmor, grsecurity or NSA Selinux). In my case apparmor. Trying to limit untrusted binary BLOB "Microsoft Skype" software I run into the problem that Skype effectively uses D-Bus. I fear now that potential risk linked to opening access to D-Bus and privilege escalation, in short open door caused by D-Bus if not configured correctly. (i.e. Something of this sort http://www.websecuritywatch.com/privilege-escalation-via-a-dbus- vilnerabilitiy/) Is there a guide how I can configure D-Bus in a way that it limits the mischief and trouble a program can do? I would very much like to have a Guide that focuses on the safety configuration of D-Bus. The only thing I have found at present is http://www.redhat.com/magazine/003jan05/features/dbus/#security which is not very helpful and rather frustrating as to my understanding it suggests that the price for the D-Bus "functionality" is yet another extensive and overarching security setup in addition to the trouble to setup already the LSM. This is why I would appreciate if somebody could indicate me if and where there is information about configuring D-Bus safely.


title: How copy and rename files found in "find" function Linux?

text: I have a folder named `/home/user/temps` which has 487 folders. In each folder I have a file called thumb.png. I want to copy all files named thumb.png to a separate folder and rename them based on the folder they came from.


title: Single command to move a domain from cPanel's localdomains to remotedomains file?

text: I find myself needing to do this a few times daily and would love an easier way to do it. > The domain example.com's email is handled by a third party, so the server > needs to be told this by listing its domain in /etc/remotedomains. I then remove the domain from localdomains: > pico /etc/localdomains > > Search for "example.com" (being careful not to land on > "subdomain.example.com") > > Remote "example.com" from /etc/localdomains > > Save and close And place it within remotedomain: > pico /etc/remotedomains > > Goto end of file and add "example.com" > > Save and close A way to do this in one command would be great! :)


title: Disable autoscrolling in gnome 3.4

text: I've recently updated my gnome to 3.4 and a problem appears. When I start scrolling, scroll never ends and even continues to scroll when I switch to another window. How can I disable this annoying feature? I run gnome on ArchLinux with kernel 3.3


title: unrecognized --sysroot option.(Eclipse)

text: I'm trying arm cross compilation using `sysroot` for the `autotools` project.The options I'm using for `autogen` script is as follows.               CC=arm-linux-gnueabihf-gcc --with-sysroot=/opt/sysroot/dir \        --host=arm-linux-gnueabihf --sysroot=/opt/sysroot/dir --prefix=/some/dir      But in eclipse plugin it is showing that `\--sysroot` option is unrecognized but the same command is working fine in the terminal.               ERROR:     configure: error: unrecognized option: --sysroot=/opt/sysroot/dir     configure: error: unrecognized option: --sysroot=/opt/sysroot/dir     Try ./configure --help' for more information      And If I remove `\--sysroot` option in eclipse then the `autogen` works fine but I'm getting the following linker error.               /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/lib/../lib/libwebkit_clutter-0.so when searching for -lwebkit_clutter-0     /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible //usr/lib/libwebkit_clutter-0.so when searching for -lwebkit_clutter-0     make[2]: Leaving directory `/home/dir/workspace/Sharukh/sources/applications'     /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lwebkit_clutter-0     make[1]: Leaving directory `/home/dir/workspace/Sharukh/sources'     /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/lib/../lib/libwebkit_clutter_mx.so when searching for -lwebkit_clutter_mx     /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible //usr/lib/libwebkit_clutter_mx.so when searching for -lwebkit_clutter_mx     /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lwebkit_clutter_mx     /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /lib/../lib/libcgroup.so when searching for -lcgroup     /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible //lib/libcgroup.so when searching for -lcgroup     /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lcgroup     collect2: error: ld returned 1 exit status     make[2]: *** [bin_Sharukh] Error 1     make[1]: *** [install-recursive] Error 1     make: *** [install-recursive] Error 1      What am I missing?


title: Slow boot and slow desktop, along with indecipherable log messages

text: I am a Linux Mint 17 - Cinnamon user, and have been using it for the past 1 month. I am new to this OS, and trying to learn how to work in a linux environment. My system boots extremely slowly (takes about 20 minutes), and when it does boot the desktop is very unresponsive. Double clicks and keystrokes take way too long to register, though the mouse moves around normally. **The whole thing started yesterday after my system shut down because of a power cut. I was not upgrading or installing anything.** While looking for clues as to what went wrong, on rebooting, I pressed the arrow keys a bit and this took me to a logging screen (?) listing a bunch of (boot?) tasks and their status. There were a bunch of               * xyz task                                                      [ok]      followed by:               * Starting load fallback graphics devices                       [fail]      Followed by more [OK]s, followed by:               * Starting SMB/CIFS file and active directory server            [fail]        After a few more [OK]s the system boots, and there I have the slowdown problems described above. I am dual booting this on my desktop along with windows 7. The entire Linux mint system is on a different hard disk, as is my windows installation. My PC specifications include: a core i7 processor. 8GB RAM. a Nvidia GTX 670 Graphics Card.


title: Which Desktop Environments do not require D-Bus?

text: Are there Desktop Environments (i.e. something comparable to Gnome, KDE, Xfce etc.) which do not require D-Bus? An optimal answer would best give a comprising list or alternatively confirm that today Desktop Environments necessarily depend on D-Bus (possibly giving a reason why this is so?)


title: Bind key to a bash script

text: I'm trying to bind a key (now without function) to a bash script that I have made on Ubuntu. I'm using a clevo W150HNM/Sager NP5160 I want to use button 1 or 4 for this. (see photo) I don't get any output from `xev`, `getscancodes` or `cat /dev/input/eventX` when pressing this key. How can I use this key to run the script?


title: How to use kdialog progressbar from a Bash script when the bar was initialized in another script?

text: Here is an example of how to use the kdialog progressbar. It works.               dbusRef=`kdialog --progressbar "Press Cancel at Any time" 10`     qdbus $dbusRef showCancelButton true          until test "true" = `qdbus $dbusRef wasCancelled`; do      sleep 1      inc=$((`qdbus $dbusRef Get "" "value"` + 1))      qdbus $dbusRef Set "" "value" $inc;     done          qdbus $dbusRef close      However, I can't figure out how to make it work when the main script file calls a 2nd script file. I want to keep updating the same progress bar from the second script. The error is:   * qdbus Set '' value 53 Path '' is not a valid path name. The code to update the progressbar is exactly the same in the second script file as the first. Generically, it is this:               qdbus $dbusRef Set "" value "$PROGRESS"      Obviously, some variable values are not getting passed around. But none of the tutorials I have seen explain the variables. For example, what is `value`? What is `$dbusRef`? In short, how do I update the same progressbar from a second bash script file that is called by the first?


title: How can I list subversion's runtime configuration options?

text: Say I want to know the value of the `global-ignores` option. How can I find it out?