title: How to use all buttons of SteelSeries Cataclysm MMO Gaming Mouse in Xorg (GNOME)?

text: I've a problem with my mouse on Gentoo. The normal buttons (left/right/wheel and previous/next) work, but the other buttons are not recognized by x. I tried in `xev` and using them does not do anything. I'm running Gnome Shell 3.6. I tried configuring /etc/X11/xorg.conf.d/10-evdev.conf to add the device:               Section "InputDevice"             Identifier "GamingMouse"             Driver "evdev"             Option "Name" "SteelSeries World of Warcraft: Cataclysm MMO Gaming Mouse"             Option "Protocol" "ExplorerPS/2"             Option "Buttons" "16"             Option "ZAxisMapping" "4 5"             Option "ButtonMapping" "1 2 3 6 7 8 9 10 11 12 13 14 15 16"     EndSection      but it didn't change a thing. I also tried adding these options in the Input class:               Section "InputClass"             Identifier "evdev pointer catchall"             MatchIsPointer "on"             MatchDevicePath "/dev/input/event*"             Driver "evdev"             Option "Protocol" "ExplorerPS/2"             Option "Buttons" "16"             Option "ZAxisMapping" "4 5"             Option "ButtonMapping" "1 2 3 6 7 8 9 10 11 12 13 14 15 16"     EndSection      but again, it didn't worked. Does someone have a solution to make these buttons work? ### EDIT #1 Some more information with `xinput`. I used `xinput` to gather some more information:               $ xinput -list     ⎡ Virtual core pointer                      id=2    [master pointer  (3)]     ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]     ⎜   ↳ SteelSeries World of Warcraft: Cataclysm MMO Gaming Mouse id=8    [slave  pointer  (2)]     ⎜   ↳ SteelSeries World of Warcraft: Cataclysm MMO Gaming Mouse id=10   [slave  pointer  (2)]     ⎣ Virtual core keyboard                     id=3    [master keyboard (2)]         ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]         ↳ Power Button                              id=6    [slave  keyboard (3)]         ↳ Power Button                              id=7    [slave  keyboard (3)]         ↳ SteelSeries World of Warcraft: Cataclysm MMO Gaming Mouse id=9    [slave  keyboard (3)]         ↳ G15 Gaming Keyboard                       id=11   [slave  keyboard (3)]         ↳ G15 Gaming Keyboard                       id=12   [slave  keyboard (3)]         ↳ G15 GamePanel LCD                         id=13   [slave  keyboard (3)]         ↳ Logitech Logitech G930 Headset            id=14   [slave  keyboard (3)]      ### get-button-maps               $ xinput get-button-map 8     1 2 3 4 5 6 7 8 9 10 11 12 13           $ xinput get-button-map 10     1 2 3 4 5 6 7           $ xinput get-button-map 4      1 2 3 4 5 6 7 8 9 10           $ xinput get-button-map 9     device has no buttons      ### list-props               $ xinput list-props 8     Device 'SteelSeries World of Warcraft: Cataclysm MMO Gaming Mouse':         Device Enabled (139):   1         Coordinate Transformation Matrix (141): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000         Device Accel Profile (263): 0         Device Accel Constant Deceleration (264):   1.000000         Device Accel Adaptive Deceleration (265):   1.000000         Device Accel Velocity Scaling (266):    10.000000         Device Product ID (256):    4152, 4896         Device Node (257):  "/dev/input/event2"         Evdev Axis Inversion (267): 0, 0         Evdev Axes Swap (269):  0         Axis Labels (270):  "Rel X" (149), "Rel Y" (150), "Rel Vert Wheel" (262)         Button Labels (271):    "Button Left" (142), "Button Middle" (143), "Button Right" (144), "Button Wheel Up" (145), "Button Wheel Down" (146), "Button Horiz Wheel Left" (147), "Button Horiz Wheel Right" (148), "Button Side" (260), "Button Extra" (261), "Button Unknown" (259), "Button Unknown" (259), "Button Unknown" (259), "Button Unknown" (259)         Evdev Middle Button Emulation (272):    0         Evdev Middle Button Timeout (273):  50         Evdev Third Button Emulation (274): 0         Evdev Third Button Emulation Timeout (275): 1000         Evdev Third Button Emulation Button (276):  3         Evdev Third Button Emulation Threshold (277):   20         Evdev Wheel Emulation (278):    0         Evdev Wheel Emulation Axes (279):   0, 0, 4, 5         Evdev Wheel Emulation Inertia (280):    10         Evdev Wheel Emulation Timeout (281):    200         Evdev Wheel Emulation Button (282): 4         Evdev Drag Lock Buttons (283):  0          $ xinput list-props 10     Device 'SteelSeries World of Warcraft: Cataclysm MMO Gaming Mouse':         Device Enabled (139):   1         Coordinate Transformation Matrix (141): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000         Device Accel Profile (263): 0         Device Accel Constant Deceleration (264):   1.000000         Device Accel Adaptive Deceleration (265):   1.000000         Device Accel Velocity Scaling (266):    10.000000         Device Product ID (256):    4152, 4896         Device Node (257):  "/dev/input/event4"         Evdev Axis Inversion (267): 0, 0         Evdev Axes Swap (269):  0         Axis Labels (270):  "Rel X" (149), "Rel Y" (150), "Rel Horiz Wheel" (285)         Button Labels (271):    "Button 0" (284), "Button Unknown" (259), "Button Unknown" (259), "Button Wheel Up" (145), "Button Wheel Down" (146), "Button Horiz Wheel Left" (147), "Button Horiz Wheel Right" (148)         Evdev Middle Button Emulation (272):    0         Evdev Middle Button Timeout (273):  50         Evdev Third Button Emulation (274): 0         Evdev Third Button Emulation Timeout (275): 1000         Evdev Third Button Emulation Button (276):  3         Evdev Third Button Emulation Threshold (277):   20         Evdev Wheel Emulation (278):    0         Evdev Wheel Emulation Axes (279):   0, 0, 4, 5         Evdev Wheel Emulation Inertia (280):    10         Evdev Wheel Emulation Timeout (281):    200         Evdev Wheel Emulation Button (282): 4         Evdev Drag Lock Buttons (283):  0      It seems that more than 7 buttons are recognized in id 8, so that seems like a good sign, no? So how could I use this only and perhaps filter the other?


title: Bash operator & not working

text: As per the bash reference, we can give a non-blocking command by ending it with an ampersand(&) character. However, when I try the below command its not working:               python -m SimpleHTTPServer 8080&      The reason I intend to do so is that I want to start the built-in python webserver as part of another larger program which is also written in python. Can you plz advice how do I issue this command in a non-blocking/daemon mode? I even tried to execute this command using "subprocess.Popen()" in python which is also supposed to create a non-blocking process, but even that is not working:-(.. EDIT: Here is the portion of my python code that starts the webserver (Adding 'nohup' seems to do the trick):               pid_webserver = execute("nohup python -m SimpleHTTPServer 8080 &",wait=False,shellexec= True)     #pid_webserver = execute("python -m SimpleHTTPServer 8080 &",wait=False,shellexec= True)          def execute(command,errorstring='', wait = True, shellexec = True):         try:             print 'command=' + command             p=subprocess.Popen("gksu '" + command + "'", shell=shellexec,stdout=subprocess.PIPE,stderr=subprocess.PIPE)             if wait:                 p.wait()                 result=get_stdout(p)                 return result             else:                 print 'not waiting'                 return p         except subprocess.CalledProcessError as e:             print 'error occured:' + errorstring             return errorstring


title: Issue partitioning with paragon partition manager

text: I have 4 primary partitions. One of them is a Windows partition and one of the others is a 100MB system reserved partition. I want to convert my other primaries to logicals and place them into one extended partition so that I'll be able to create two more primaries, so I can install Fedora 19 on it. I'd like one partition for swap (8GB) and one for Fedora (30GB) but there isn't an option to convert one of these partitions to an extended one. I can only convert them to logical.   1. Is it necessary to create an extended partition? Can't I just create two logical partitions?   2. If so, how can I create an extended partition with two logical partitions inside it?   3. I'm using paragon partition manager 12 but I can use other software if you recommend it.


title: WordPress on LinuxMint: Can't create directory (or write file)

text: I run Linux Mint, with Apache2, PHP and MySQL. I've activated modules for Apache so that users' `public_html` can be used and that PHP-scripts can be run from them. I installed WordPress in my `public_html` (i.e. `~/public_html/wordpress`), but it didn't work fully. When I tried to change the background image or the header image, I got an error message that stated that a directory (either year/month or month/year) - where uploads are stored - could not be created. Obviously my web server doesn't have permission to create directories - and probably not to create files - in `public_html` or its subdirectories (like some directories under `~/public_html/wordpress`). I'm therefore wondering what my options are here. Is there some module I must add or some config file I must fix, so that the web server can write? Or must I perhaps change the owner and/or group of `public_html` - and its subdirectories (is there a way to ensure that subdirectories belong to the same owner/group)? ...obviously without locking me out from making changes to my webpage. Suggestions, advice and best practices very welcome. I know I probably would get less trouble if I installed WordPress as root under `/var/www`, but I would prefer to avoid that solution.


title: A robust way to execute a command/run a script at login?

text: I have two commands that change keyboard behaviour:                xset r rate 120 66      /usr/bin/setxkbmap -option "ctrl:nocaps"      When I open a terminal and execute them, they change auto-repeat settings and remap CAPS LOCK to control, not only in the terminal window but for my whole desktop environment. I'd like them to be run automatically when I login to my account (either using a GUI or via ssh/etc.). I'd like to do this in a robust way (i.e. I don't want to use distribution-specific tools) and I don't want to use any GUI tools. I supposed that there is some file that is executed at login and I should just paste these commands there, but adding them to `~/.bash_login` didn't have any effect, similarly with `~/.bash_profile`. With `~/.profile`, only `/usr/bin/setxkbmap -option "ctrl:nocaps"` had effect. How can I achieve this?


title: Solaris 11: Accessing a pool on disk from live DVD?

text: I made a rather bad mistake while playing around with Solaris 11, which has left me locked-out. I accidently changed the first character of my username in /etc/passwd, and the "new" username is not recognized as having the root-role (major bummer). So I need a way to access the root-filesystem in rpool on the partition I use for Solaris while using the live install-DVD. Sadly `zpool` doesn't detect the partition while i run the live-DVD, and since I'm a bit of a novice, I don't want to experiment on my own and make things worse... So what is the correct way of getting Solaris to detect a pool on a disk- partition and/or access a filesystem in a pool on a disk-partition when it's not automatically detected?


title: Open application on custom desktop in xmonad

text: Suppose I call `shell-command` from `emacs` for example `(shell-command "evince")`. Is it possible to move the application (in the present example `evince`) started this way automatically to desktop `5` in `xmonad`.


title: List files of certain type under a dir?

text: If you want to list just directories (in the present directory) use `ls -d */` What if you want to list just ordinary files, just executable files, or just soft links, or files of any other type? Because `ls -F` appends `*` to executable files,`@` to symbolic linked files, `/` to directories, I tried `ls -d **` and `ls -d *@`, but they don't work.


title: Mint 13 bug that prevents right clicking on desktop icons and numerous other symptoms

text: I use Mint 13 with Gnome Shell 3.4. For the last month or two I have had an issue that randomly occurs, and once it does only logging out or rebooting fixes it. I randomly have a problem that causes at least these things:   1. Right clicking on icons does not work, if I do it acts as if I have right clicked on the desktop   2. In Google Chrome if I right click on a page to open a link in a new tab, if I go back to the original tab it is no longer functional until I reload the page.   3. When I am in a text editor (even in a Virtual Box system,) and click in the editor panel, it acts as if I was holding the `shift` key and highlights the text from where the cursor was to where I clicked. My first thought was that this was a keyboard issue so I opened up Wire Shark and there is no input form my keyboard. I have searched around but have not been able to come up with a fix. Let me know if you need any more info or if there is another tag I should use since I'm new to asking questions here. I have also asked this question in Linux Mint Forums here. Thanks!


title: How to create CSV file without unnecessary spaces

text: I use the **xls2csv** binary in order to translate **XLS** doc to **CSV** in my linux red-hat machine, example: ( from man page )                xls2csv -x "1252spreadsheet.xls" -b WINDOWS-1252 -c "ut8csvfile.csv" -a UTF-8      But I noticed about the following problems - **steps 1,2** ( the following problems cause many troubles in my bash script ) **THE PROBLEMS ARE:** **(1)** CSV file include unnecessary spaces (on the left side of word or on the right side of word) Example of wrong syntax in CSV                ,"/var/adm/sys ldd/all  /Comm/logs   ","WORD "," WORD"      Example of right syntax in csv                ,"/var/adm/sys ldd/all  /Comm/logs",WORD,WORD      **(2)** quotation marks appears in the CSV even if word is (one word between separators), in fact we not need quotation marks in case of SINGLE word between the separators ( separator “,” ) Example of wrong syntax in CSV                ," WORD ",      Example of right syntax in csv                ,WORD,      Please advice how to solve the problems as described here in order to create "clean csv file" according to **steps 1,2** implementation could be with **awk,sed ,perl one liner, or any solution under bash** script Example of CSV file before the fix                1,"/var/adm/sys ldd/all  /Comm/logs",34356,"234245 ",24245      2,"/var/adm/sys ldd/all      /Comm/debugs.txt"," 45356",435,"  578 58976  "      3,"   add this line in crontab    :",34356,"234245 ",24245      4,"1.0348    54 35.5"," 45356","   435","578 "      4,"1 2 "," 45356 95857 ","   435","578 "      5,"1 2 "," 45356 95857 ","   "435","578" "      6,"1.0348    54 35.5"," 45356"," "4"""    ""35","578 "      7,"1.0348    54 35.5",""45356",""4"""""35,"578 "      Example of correct CSV file ( after the fix )                1,"/var/adm/sys ldd/all  /Comm/logs",34356,234245,24245      2,"/var/adm/sys ldd/all      /Comm/debugs.txt",45356,435,"578 58976"      3,"add this line in crontab    :",34356,234245,24245      4,"1.0348    54 35.5",45356,435,578       4,"1 2","45356 95857",435,578      5,"1 2","45356 95857","435,578"       6,"1.0348    54 35.5",45356,"4"""    ""35,578      7,"1.0348    54 35.5",""45356",""4"""""35,578      Commas cannot appear within fields. Note the explicit newline contained within a field of `line 2`. When a field is within double quotes and contains no white space (e.g. line 7 `""45356"`), those double quotes must not be removed because that whole field including those quotes is an encoded password


title: Vim high CPU usage upon opening JS files

text: Vim and especially Gvim stops responding and utilizes 100% of CPU upon opening big .js files (1000+ lines). Pressing `Ctrl``c` stops the process. Whatever Vim does trying to open the file, it displays the file contents--all folded into a single fold--and each character input in insert mode takes minutes to display on the screen. Then I have to restart Vim, to be able to edit the files. This does not occur everytime, even for the same files, but occurs 3-5 times a day. Using `strace -p PID` I see the following messages repeating continuously               poll([{fd=7, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=8, events=POLLIN}], 5, 0) = 0 (Timeout)     read(7, 0x7fffc4477280, 16)             = -1 EAGAIN (Resource temporarily unavailable)     recvfrom(6, 0x21848f4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)     poll([{fd=7, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=8, events=POLLIN}], 5, 0) = 0 (Timeout)     read(7, 0x7fffc4477280, 16)             = -1 EAGAIN (Resource temporarily unavailable)     recvfrom(6, 0x21848f4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)     poll([{fd=7, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=8, events=POLLIN}], 5, 0) = 0 (Timeout)     read(7, 0x7fffc4477280, 16)             = -1 EAGAIN (Resource temporarily unavailable)     recvfrom(6, 0x21848f4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)     ...      I've tried with `vim --noplugin`, yet the same problem occurs. I'm on a Ubuntu 12.04.1 x64 running self compiled Vim. `vim :version` gives the following info:               VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 15 2012 17:16:57)     Included patches: 1-631     Huge version with GTK2 GUI.  Features included (+) or not (-):     +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent    +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +conceal +cryptv +cscope +cursorbind     +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +float +folding -footer +fork() +gettext -hangul_input     +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap -lua +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm     +mouse_netterm -mouse_sysmouse +mouse_xterm +mouse_urxvt +multi_byte +multi_lang -mzscheme +netbeans_intg +path_extra -perl +persistent_undo +postscript +printer +profile +python -python3     +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse     +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact     +xterm_clipboard -xterm_save        system vimrc file: "$VIM/vimrc"          user vimrc file: "$HOME/.vimrc"           user exrc file: "$HOME/.exrc"       system gvimrc file: "$VIM/gvimrc"         user gvimrc file: "$HOME/.gvimrc"         system menu file: "$VIMRUNTIME/menu.vim"       fall-back for $VIM: "/usr/local/share/vim"     Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I /usr/include/libpng12   -I/usr/local/include  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1     Linking: gcc   -L.  -rdynamic -Wl,-export-dynamic  -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0   -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl   -ldl     -L/usr/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions   -lruby-1.9.1 -lpthread -lrt -ldl -lcrypt -lm  -L/usr/lib      Is there anything wrong with my setup? What may be the problem?


title: Raid 0 Linux Installation fails to install grub

text: I have a Raid 0 setup (striping) via BIOS not through software raid. When I install linux mint or Ubuntu it fails to install the boot loader or set the boot loader to boot. I get an error stating grub-install /dev/sda failed. On start up of a fresh install I get the blinking cursor and no grub boot menu. I've tried a few different fixes with gpart and trying to use the advanced partition during install but I keep getting bootloader failed to load. I've also used the `fdisk -l` outputting only /dev/sda1 info which is the usb liveCD. Howevever, using `fdisk /dev/mapper/nvidia_djcffehh -l` will show the RAID drive with the boot partition, swap, and file system. Not sure why it isn't working as it has worked in the past but since doing a fresh install it doesn't work properly. Is it possible that because the liveCD USB is being mounted at /dev/sda that it is messing with the file system? Also I am using Linux Live USB creator. The USB driver appears as a hard drive on the bios and not as a removable device. Any ideas would be helpful.


title: Installation of MPFR previous versions of GMP clash

text: So it's a common error when installing MPFR that if more than one version of libgmp are installed you hit errors. This is quite well documented in the INSTALL file, If I run `locate libgmp` the result is               /home/lee/maple16/bin.IBM_INTEL_LINUX/libgmp.so     /home/lee/maple16/bin.IBM_INTEL_LINUX/libgmp.so.3     /home/lee/maple16/bin.IBM_INTEL_LINUX/libgmp.so.3.4.1     /home/lee/maple16/bin.IBM_INTEL_LINUX/ATHLON256/libgmp.so     /home/lee/maple16/bin.IBM_INTEL_LINUX/ATHLON256/libgmp.so.3     /home/lee/maple16/bin.IBM_INTEL_LINUX/ATHLON256/libgmp.so.3.4.1     /home/lee/maple16/bin.IBM_INTEL_LINUX/ATHLON512/libgmp.so     /home/lee/maple16/bin.IBM_INTEL_LINUX/ATHLON512/libgmp.so.3     /home/lee/maple16/bin.IBM_INTEL_LINUX/ATHLON512/libgmp.so.3.4.1     /home/lee/maple16/bin.IBM_INTEL_LINUX/ATHLONXPSSE1/libgmp.so     /home/lee/maple16/bin.IBM_INTEL_LINUX/ATHLONXPSSE1/libgmp.so.3     /home/lee/maple16/bin.IBM_INTEL_LINUX/ATHLONXPSSE1/libgmp.so.3.4.1     /home/lee/maple16/bin.IBM_INTEL_LINUX/P4SSE2/libgmp.so     /home/lee/maple16/bin.IBM_INTEL_LINUX/P4SSE2/libgmp.so.3     /home/lee/maple16/bin.IBM_INTEL_LINUX/P4SSE2/libgmp.so.3.4.1     /home/lee/maple16/bin.IBM_INTEL_LINUX/PIII/libgmp.so     /home/lee/maple16/bin.IBM_INTEL_LINUX/PIII/libgmp.so.3     /home/lee/maple16/bin.IBM_INTEL_LINUX/PIII/libgmp.so.3.4.1     /home/lee/maple16/bin.IBM_INTEL_LINUX/PIIISSE1/libgmp.so     /home/lee/maple16/bin.IBM_INTEL_LINUX/PIIISSE1/libgmp.so.3     /home/lee/maple16/bin.IBM_INTEL_LINUX/PIIISSE1/libgmp.so.3.4.1     /usr/lib/i386-linux-gnu/libgmp.so.10     /usr/lib/i386-linux-gnu/libgmp.so.10.0.2     /usr/lib/i386-linux-gnu/openssl-1.0.0/engines/libgmp.so     /usr/local/Wolfram/Mathematica/7.0/SystemFiles/Libraries/Linux/libgmp.so.3     /usr/local/Wolfram/Mathematica/7.0/SystemFiles/Libraries/Linux-x86-64   /libgmp.so.3     /usr/local/Wolfram/Mathematica/8.0/SystemFiles/Libraries/Linux/libgmp.so.10     /usr/local/Wolfram/Mathematica/8.0/SystemFiles/Libraries/Linux-x86-64   /libgmp.so.10     /usr/share/doc/libgmp10     /usr/share/doc/libgmp10/README.Debian     /usr/share/doc/libgmp10/TODO.Debian     /usr/share/doc/libgmp10/changelog.Debian.gz     /usr/share/doc/libgmp10/copyright      /var/lib/dpkg/info/libgmp10:i386.list     /var/lib/dpkg/info/libgmp10:i386.md5sums     /var/lib/dpkg/info/libgmp10:i386.postinst     /var/lib/dpkg/info/libgmp10:i386.postrm     /var/lib/dpkg/info/libgmp10:i386.shlibs      The version I actually want to use I have just installed and can see in `/usr/local/lib` (odd that this doesn't appear above??). The INSTALL files says if this is the case then                 If you want to use the GMP version under /usr/local, then you       should uninstall all the other GMP versions (header and library       files) that may be seen in the search paths, but *NOT* the one       under /usr (the version under /usr is provided by the OS vendor,       and changing/removing anything related to it may break your       system, and /usr should have a lower precedence than /usr/local       anyway).        but I'm not sure exactly what to uninstall and indeed how, do I just delete? Moreover the `locate libgmp` doesn't even find the one under `/usr` anyhow.I don't want Maple or Mathematica to die on me... Other fixes I've tried are `export CPLUS_INCLUDE_PATH=usr/local/include , export C_INCLUDE_PATH=usr/local/include, export LIBRARY_PATH=usr/local/lib, export LD_LIBRARY_PATH=usr/local/lib, export LD_RUN_PATH=usr/local/lib` as I read somewhere else that this may help, but to no avail. I've also patched with the latest. I naievly just deleted libgmp.so.10.0.2 and libgmp.so.10 from /usr/lib/i386-linux-gnu/ and this seems to have caused major issues with gcc working, ahh


title: Is there any way I can fit this into my ~/.bashrc as a function?

text: I just discovered this useful bit of code on this useful-looking website.               #!/bin/sh      exec tclsh "$0" ${1+"$@"}           proc main {} {          set lines [lrange [split [read stdin] \n] 0 end-1]          set count [llength $lines]               for {set idx_1 0} {$idx_1 < $count} {incr idx_1} {              set idx_2 [expr {int($count * rand())}]              set temp [lindex $lines $idx_1]              lset lines $idx_1 [lindex $lines $idx_2]              lset lines $idx_2 $temp          }               puts [join $lines \n]      }           main      Unfortunately, I don't like scripts. If I can, I make `bash` functions instead. (I've even gone so far as to completely obfuscate Python scripts in order to fit them into my ~/.bashrc unobtrusively, viz:)               dna-ify () {     python -c "exec'eJxdkUFrhDAQhe/5FdNsIQpu9rIspSBtLz330N4EiTq6AY0hiaW7v75j1F1aLwlv3vdmMu4eDpN3h0qbA5pvsJdwHg3bQT022nT51+f7/omx1o0DlGU7hclhWYIe7OgCWKdNINXUQRO1qsp1VjmPGfiLz6BSHk/HDNAsmZ6xWHaQ36zyzXXTgCZ8xEqSrhapmqZUay0Rre7RqAFFBoZUn4sXkbL5RlkrEY+Z8ZSi27mFlxv4zIA+H2jujpDRokn+GFLpUDVEYk+sGcP8BukDDS61VyFckvRfyN1wQ/3aaBsprumMvaUqu97JeJFxMZiIa68res61uhmW1cnqdFw9K0spMRMSvvww2NdQcPzBuhA8gy0iA14I2WBkC7HEFSK9S3NPEgoOj68EerQ55yn7BbL1snM='.decode('base64').decode('zlib')" $@     }      So, is there any (and, as the above sample should indicate, I do mean _any_ ) way I can do that with this bit of code?


title: Wait command usage in Linux?

text: #!/bin/bash     function back()     {         sleep $1         exit $2     }     back $1 $2 &     b=$!     if `wait $!`;then         echo success     else         echo failure     fi                    bash-3.00# ./back 300 0     failure     bash-3.00# ./back 300 1     failure      I was expecting `success` as exit status when I send 0, but I am still getting `failure`. Also, `wait` doesn't wait for 300 seconds. Instead, I get the message immediately. I assume `$!` is the immediate child of `$$` in my script. Isn't it? Is it possible to capture the exit status of wait like `exit_status=$(wait $!)`?               if ! ((exit_status));then         echo sucess     else         failure     fi


title: Preferred way to install bash functions?

text: I've written a bash function called up which I share via github. Now I'm struggling with installation instructions. I know of two options to 'install' bash functions:   1. put them into `.bashrc`   2. put them into a file called .bash_functions and source that file into `.bashrc` So, my idea would be to suggest downloading the function and modify the `.bashrc` file accordingly. I investigated how similar projects implement this and some of them even manipulate the `.bashrc` file on installation (i.e. they put the function in there). It seems pretty common to do this but I feel that manipulating the `.bashrc` automatically is a bad idea. So, what's the preferred way? Is there some consensus about this?


title: extending wifi scan list to 2.3GHz and 10MHz width

text: How to extend wifi frequency scan list to be able to connect 2.3GHz or 2.5GHz access points? And how to set channel width to 10MHz? Arch Linux. Broadcom and Atheros drivers.


title: Limiting the total size of samba's vfs_recycle by pruning oldest deleted files first

text: Running SerNet Samba 4.0.9 on CentOS 6.4 serving as an AD DC and fileshare for XP clients. Added recycler per the example here. My concern is that the recycle dir will eventually grow large. `vfs_recycle`'s docs mention a parameter for limiting individual file sizes, but what's a best practice to prevent the bin from growing too large? Cronjob to delete old files when the total is past a certain size? I found tmpwatch, but it's only time-based. What I'd like the system to do is keep files as long as it reasonably can, i.e., without too much space being taken up. The flip side is that I also don't want it keeping files too long if it means running out of space. Thus I'm looking for something with roughly this thinking:   1. if bin_size < limit then quit   2. delete oldest file in bin   3. goto 1. Of course there may be a more efficient algorithm, and it could be tweaked to prefer deleting bigger files unless they're past a certain age so that a big delete doesn't unnecessarily result in the pruning of a bunch of older-but- not-too-old small files.


title: List directories with dot directories last, then dot files

text: I'm aware of the `ls` option `\--group-directories-first` but that's not exactly what I want to achieve. The output should be: (sorted by name ASC)   * Directories   * Hidden Directories   * Hidden Files


title: How to resolve a hostname via nsswitch?

text: I want to test in a script whether a hostname resolves to something other than 127.0.0.1 as a pre-flight test for an install script. The tools I know (dig, nslookup) specifically query DNS. In my situation a correct entry in /etc/hosts is a valid configuration. So the question is: Is there a dig-like tool, ideally already on the system, that does the full name-resolution process via nsswitch.conf, like (for example) ping does?               dig my-test-server-that-only-exists-in-etc-hosts       returns NXDOMAIN.


title: Can I make a tmux pane "sticky"?

text: Is it possible to make one or more tmux panes "sticky"? I.e. these panes will appear in all windows which are currently available in my tmux session?


title: Why are user IDs recycled?

text: The other day, I deleted a user from one of our servers. That user had the ID `1002`. Today, I've added a new user to the system. To my surprise, he got the user ID `1002`. Because I neglected to delete the homedir of the deleted user, the new user now owns the homedir of the old user (as well as all other resources that were previously owned by `1002`). I would have assumed that user IDs are never reused to avoid any conflicts like this. Why are they recycled and should I care/take precautions?


title: How to export a vector graphic to eps?

text: I have a Scalable Vector Graphic (svg) which I can convert to pdf with inkscape. The pdf still looks fine when viewed in okular or evince. However, I require an eps file. I understand that eps may contain vector data, but all I get is pixelated mess with a bounding box that is too small. Initially I tried the inkscape export feature to generate eps files. I also tried to transform the well looking pdf with `pdf2ps` + `ps2eps`, but I get the same disgusting results. What am I doing wrong? How is this supposed to be done?


title: How do I make python programs behave like proper unix tools?

text: I have a few Python scripts laying around, and I'm working on rewriting them. I have the same problem with all of them. It's not obvious to me how to write the programs so that they behave like proper unix tools. Because this               $ cat characters | progname      and this               $ progname characters      should produce the same output. The closest thing I could find to that in Python was the fileinput library. Unfortunately, I don't really see how to rewrite my Python scripts, all of which look like this:               #!/usr/bin/env python                                                                                # coding=UTF-8          import sys, re          for file in sys.argv[1:]:                                                                                f = open(file)         fs = f.read()         regexnl = re.compile('[^\s\w.,?!:;-]')         rstuff = regexnl.sub('', fs)         f.close()         print rstuff      The fileinput library processes stdin if there is a stdin, and processes a file if there is a file. _But it iterates over single lines._               import fileinput     for line in fileinput.input():         process(line)      I really don't get that. I guess if you're dealing with small files, or if you're not doing much to the files, this may seem obvious. But, for my purposes, this makes it much slower than simply opening the entire file and reading it into a string, as above. Currently I run the script above like               $ pythonscript textfilename1 > textfilename2      But I want to be able to run it (and its brethren) in pipes, like               $ grep pattern textfile1 | pythonscript | pythonscript | pythonscript > textfile2


title: Why doesn't setuid on /sbin/dhclient work as intended?

text: I am the only user on my machine, and prefer not to type `sudo` every time I use `dhclient`. Therefore, I tried `sudo chmod u+s /sbin/dhclient`. However, when I subsequently run `dhclient wlan0` from a non-root shell, I still get `RTNETLINK answers: Operation not permitted` I am running `Ubuntu 13.10`. Why does setting the `UID` bit not achieve the desired effect, and are there any workarounds?


title: How to make diff print a full file diff when a file does not exist?

text: I'm trying to compare files on the root file system with a backup, and I'd like the comparison to work a bit like `git` or `svn` `diff` when a file has been _added or removed_ - That is, display the _full file diff_. `diff` unfortunately just prints a `No such file or directory` message, which is not very useful. I couldn't find an option for this. The simplest workaround I could find is to parse the `diff` output and `diff -u path <(printf '')` or `diff -u <(printf '') path` depending on which path exists. That's a bit of a kludge - Probably 10 lines of code for what could be a simple `diff` option. Another workaround is               diff -u <([ -e "$path1" ] && cat "$path1") <([ -e "$path2" ] && cat "$path2")      , but that loses the file names in the diff. Based on Craig Sanders's answer and the previous workaround, I ended up with this:               diff -u \         "$([ -e "$path1" ] && echo "$path1" || echo /dev/null)" \         "$([ -e "$path2" ] && echo "$path2" || echo /dev/null)"      **Edit** : Turns out there _is_ an option for it:               -N, --new-file            treat absent files as empty      In other words:               diff -Nu "$path1" "$path2"


title: Guard against killing an already killed process

text: I'm writing a script that tries to kill a process. But the process might already been killed by others. How can I guard against it and prevent this kill command from terminating my process with throwing an error? I have `PID` of the process


title: Make Grub2 boot into Windows/old kernel once

text: How can I make Grub2 boot into windows or an old kernel once (i.e Windows becomes the default option for once and grub boots into that after the timeout)? The reason being:   1. My keyboard usually hangs during Grub timeout screen   2. I would like to make the command (after the configuration, if possible) an alias (e.g `bootonce`). So whenever I want to boot into Windows or an old kernel I would just run the alias and Grub would boot into that option without me having to choose it manually from the menu.


title: How to combine zsh autocomplete for wrapper function arguments and existing command

text: I work mostly in gvim and many terminals. Originally, I preferred to open all my files in a single vim instance. To that end I used an alias to open files from my terminals in the current 'vim server'.               alias rv="gvim --remote-silent"      But having many files from multiple projects open in a single vim instance impacts my productivity, so I'm upgrading my alias to a function.               # main function     rv() {         local args options server              options=$(getopt -o hils:t: -l "help,info,list,set:,target:" -- "$@")              if [[ $? -ne 0 ]]; then             echo "Failed to parse options."             return 1         fi              # a little magic, necessary when using getopt         eval set -- "$options"              # go through the options with a case and use shift to analyze one option at a time.         while true; do             case "$1" in                 -h|--help)                     echo "Usage: $0 [-hil] [--help] [--info] [--list]";                     echo "       $0 {-s | --set} <name> [<file1 file2...>]";                     echo "       $0 {-t | --target} <name>] <file1 file2...>";                     return 0;;                 -i|--info)                     gvim_show_info;                     return 0;;                 -l|--list)                     gvim_list_servers;                     return 0;;                 -s|--set)                     gvim_set_server_name ${2:u};                     shift 2;;                 -t|--target)                     server="$2";                     shift 2;;                 --)                     shift;                     break;;             esac         done              if [[ "$#" -eq 0 ]]; then             # if no files specified...             if [[ -n "$server" ]]; then                 # throw error if --target option was specified.                 echo "Error!  --target requires one or more filenames."                 return 1;             fi         else             # if files were specified...             if [[ -n "$server" ]]; then                 # if --target was specified                 gvim_run_remote $server "$@"             else                 gvim_run_remote $(gvim_get_default_server) "$@"             fi         fi              return 0;     }      Now this new `rv` has it's own options. I can use it to:   * list available vim servers (-l --list)   * set the default vim server for the current shell (-s --set)   * show the default vim server (-i --info)   * open files in a specific vim server (-t --target)   * open files in default vim server: `rv files...` However, since I'm using a function for `rv` instead of an alias, I lose the zsh completion I previously enjoyed. I've read up on creating a completion function, `_rv`, that will show `rv`'s options, but I want to combine my completion options with the existing vim completion options. I know there may be some conflicts with `rv`'s `-s` and `vim`'s `-s`, but I figure I can handle that elegantly with the `\--` separator. **TLDR;** So, how do I create a completion script that combines the `_arguments` options for both `_rv` and `_vim`? I prefer to reuse `_vim` if possible instead of copy-pasting it's arguments list into `_rv`. Here's my `_rv`. _Updated 2014/6/10 16:10_               #compdef rv          _rv() {         typeset -A opt_args         local alternatives              alternatives=(             'args:rv options:_rv_options'             'files:file:_vim_files'         )              _alternative $alternatives && return 0              return 1     }          _rv_options() {         local arguments              arguments=(             '(-i -l -s -t --info --list --set --target)'{-h,--help}'[Print usage info.]'             '(-h -l -s -t --help --list --set --target)'{-i,--info}'[Print default vim server. As stored in $GVIM_SERVER.]'             '(-i -h -s -t --info --help --set --target)'{-l,--list}'[Print list of existing vim servers.]'             '(-i -h -l -t --info --help --list --target)'{-s,--set}'[Set default vim server for the current shell.]:vim servers:_rv_vim_servers'             '(-i -h -l -s --info --help --list --set)'{-t,--target}'[Open files in a particular vim server.]:vim servers:_rv_vim_servers'             )              _arguments -s -C $arguments && return 0              return 1     }          _rv_vim_servers() {         local -a servers         servers=( ${(f)"$(_call_program servers vim --serverlist 2>/dev/null)"} )         _wanted servers expl server compadd -M 'm:{a-z}={A-Z}' -a servers && return     }          # invoke the completion command during autoload     _rv "$@"      **Current Behavior** Currently `_rv` completion will is usable, but not ideal.   * When I type `rv <TAB>`, I do not see the vim options. Only rv options and file paths are displayed. `_vim` is completing file paths for me, so hooray to that!   * When I type `rv -s <TAB>`, I see the list of vim servers, but also the file paths are displayed. A file is not permitted at this point in the command, and should not appear in the autocomplete. **Expected Behavior**   * When I type `rv <TAB>`, I expect to see: 1) rv options, 2) vim options, 3) file path list   * When I type `rv -s <TAB>`, I expect to see: 1) vim server names (as provided by `_rv_vim_servers`.   * When I type `rv /valid/file/path/<TAB>`, I expect to only see a file path list. Since `_vim` already has this capability, I would prefer to rely on it.


title: How to change TFTP root Directory

text: How can I change root Directory of TFTP in RHEL 6 ? Default Location is `/var/lib/tftpboot`


title: Linux development server

text: I have an issue. I want to set up a Linux development server on my home PC so everyone who has credentials can log in from anywhere into that machine and write code. What should I do or what should I read to achieve this? My current level of Linux staff is newbie so I would appreciate it if you answer in a newbie language :) So already I have installed X Ubuntu on my PC and that's all.


title: Process each line from text file and delete related files from disk

text: I used the find command to find several files and folders and output them to a text file like so:               nohup find /oradba -name '*soapr*' 2>/dev/null >find_soapr_db40.txt &      So instead of displaying my results to the screen, I sent them to the file. Normally, I could just append "-exec rm -rf {} \;" to the end of my find command to find related files and delete them at the same time.               find / -name '*soatst*' 2>/dev/null -exec rm -rf {} \;      But **how can I run a command to process each line from the .txt file and delete the files they are referencing from the disk?** The text file contains items like the following:               /oradba/app/oracle/admin/soaprod2     /oradba/app/oracle/admin/soaprd2     /oradba/app/oracle/product/10.2.0.5/db_aprpsu/dbs/initsoaprd2.ora     /oradba/app/oracle/product/10.2.0.5/db_aprpsu/dbs/hc_soaprd2.dat     /oradba/app/oracle/product/10.2.0.5/db_aprpsu/dbs/alert_soaprd2.log     /oradba/app/oracle/product/10.2.0.5/db_aprpsu/dbs/spfilesoaprd2.ora


title: Is "zero-copy networking" implemented by default on Linux?

text: I saw this article: http://lwn.net/2001/0419/kernel.php3 > Zero-copy networking will be in 2.4.4. This patch, by David Miller, Alexey > Kuznetsov, and others, has been in development and testing for some time, > and was incorporated into the "ac" kernel series back in 2.4.2ac4. In a way, > it is a surprising change to see in a stable kernel series, since it makes > fundamental changes deep in the networking code. From all reports, however, > it is solid, and, in certain situations, it should produce significant > performance benefits. Can someone tell me if zero-copy networking exists by default in Linux, or whether this patch was just to allow people who wanted to do zero-copy networking to be able to implement it? In other words, in the current Ubuntu does it perform zero-copy networking all the time or would I have to use certain system calls to utilise the above patch?


title: changing column separators in a file

text: I have a large file, that I need to process and after writing some scripts that don't seem to work properly, I have discovered that a small subset of the lines in the file are actually space separated rather than tab separated. > **Question** : So I'm wondering what the best way would be to change these > space-separated lines to tab-separated ones? The file contains 4 entries in each line, about 5000 entries total and about 150 of them are space separated rather than tab-separated.


title: IP packets have wrong source address

text: I have two 4g modems connecting to a network and sending and receiving data. There is a problem though, as the modems keep getting kicked off the network because the source IP address of the packets is incorrect. It seems that packets that originate from datacard 1 have the source IP address of datacard 2. The mobile network checks the source IP address of the packet against the IP address of the connected modem, sees there is a mismatch and kicks that modem off the network. I need to rectify this problem and have both modems send IP packets with the correct source IP address. However, I'm very inexperienced in this kind of thing, and I would very much appreciate some advice for starting points. I believe that the IP tables and ip route have been checked and that hasn't resolved this problem.


title: Is the file table in the filesystem or in memory?

text: In the context of operating system control tables, does the term "file tables" refer to a data structure that is part of the filesystem, or that is in main memory (and in which case I assume it would only have references to open files)? My textbook1 says, > The tables provide information about the existence of files, their location > on secondary memory, their current status, and other attributes. Much, if > not all, of this information may be maintained and used by a file management > system, in which case the OS has little or no knowledge of files. Also, what is a file management system? Does that mean the filesystem? 1Stallings, _Operating Systems_ , 7th ed., p. 127


title: How to read value of variable, where the name of variable is the value of another variable

text: I think an example is in order. Consider I have these two environment variables setup (by a Continuous Delivery tool): `PACKAGE_VER=1.2.3` and `USE_VERSION_FROM=PACKAGE_VER`. What I want now is a script that can't predict the name of the variable pointing out `1.2.3`, only `USE_VERSION_FROM`. And so, I'm looking for a way to get my script to know the version to use (`1.2.3`) without knowing anything other than that `USE_VERSION_FROM` points out the name of the variable that holds the version number. My naïve non-working first attempt:               #!/bin/bash     VERSION_TO_USE="${${USE_VERSION_FROM}}"


title: su does not change user but does not respond with an error either

text: While logged in as `root` I would like to `su` to a specific regular user. I run `su username` and immediately receive the prompt back, still as root. There is no error given. I'm aware of the old "the user you're trying to su to doesn't have permission for the folder you're currently in" problem, and that's not the case in this scenario. Furthermore, there is no error displayed, which is always the case (as far as I know) when that particular permissions issue is encountered. I've tried `su - username` with the same effect. The command is processed, no errors are seen, and I receive the prompt back immediately. What could be causing this behavior? How can I troubleshoot this?


title: Amazon Linux - update path to java

text: I downloaded a fuller version of java, and I wanted to update the default path to java. I tried updating the bashrc file as they did here http://www.cyberciti.biz/faq/linux-unix-set-java_home-path-variable/ , but that did not work. How do I fix this?


title: In bash, what are potential negative consequences of pausing a process with control-z?

text: Using bash, one can pause a process with `control-z`. However, are there any general circumstances or guidelines to beware of where a process would not behave well with being paused? My specific scenario was in creating a tar file that was taking longer than expected. I wanted to pause it to put it in the background, but decided not to. My question isn't, of course, specific to tar. Rather, I'm hoping to understand the pausing feature in bash a bit better as well as what would make a process react poorly to being paused.


title: Silent boot opensuse without fbsplash

text: I want to boot my openSUSE 10.3 distro without any boot messages. I've looked at fbsplash, but it requires patching the kernel, a thing which I cannot do at the moment (not because I don't want it or that I don't know how to do it, but because we are working with running linux distributions all over the world, which can't be reinstalled). So I went on trying to disable as much console output as possible by editing the `menu.lst` file for grub and some other things. That partially worked but several kernel errors keep popping up. I just want to boot up silent until the terminal login screen. Is this possible?


title: Reading from /dev/random does not produce any data

text: I often use the command               cat /dev/urandom | strings --bytes 1 | tr -d '\n\t ' | head --bytes 32      to generate pseudo-random passwords. This doesn't work with `/dev/random`. Specifically   * `cat /dev/urandom | strings --bytes 1 | tr -d '\n\t '` produces output   * `cat /dev/random | strings --bytes 1` produces output   * `cat /dev/random | strings --bytes 1 | tr -d '\n\t '` **does not** produce output NB: When using `/dev/random` you may have to wiggle your mouse or press keys (e.g. ctrl, shift, etc.) to generate entropy. **Why does the last example not work?** Does `tr` have some kind of large internal buffer that `/dev/urandom` fills quickly but `/dev/random` doesn't? P.S. I'm using CentOS 6.5               cat /proc/version     Linux version 2.6.32-431.3.1.el6.x86_64 (mockbuild@c6b10.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Fri Jan 3 21:39:27 UTC 2014


title: How can I grep a directory based on the contents of two successive lines?

text: How can I grep a **directory** for lines that contain "Foo", but **only** get matches when the next line also contains "Bar"?


title: Edit Cups web interface

text: I have a Ubuntu desktop installation running Samba + CUPS and this gives me a very nice printing server in the clients Windows environment. However when I look at the printers queue the "name" shows as unknown and the "user" as withheld; my assumption is that this is due to fact that the clients are running Windows. The cups print-log file does have the hostname, IP and file name in it. Is there any way to alter the web interface to show the hostname / IP / file name?


title: How to split files?

text: ### Input.txt               line.....1     line.....2     line.....3     .....          line.....3     line.....4     line.....5     .....          line.....4     line.....5     line.....6     .....          line.....5     line.....6     line.....7     .....      Condition for output file names mentioned in `name.txt`. ### name.txt               chapter01.txt     chapter02.txt     chapter03.txt     chapter04.txt      ### need output for following txt files               chapter01.txt     line.....1     line.....2     line.....3     .....          chapter02.txt     line.....3     line.....4     line.....5     .....               chapter03.txt     line.....4     line.....5     line.....6     .....          chapter04.txt     line.....5     line.....6     line.....7     .....      Kindly give solution...


title: My Ubuntu 14.04 LTS doesn't have sound

text: I installed Ubuntu 14.04 on VMware workstation version 10.0.0 on my Windows 7 machine. After installing I figured out that it doesn't have any sound so I checked the sound settings. All items seem to be at their default states and correct. Any suggestion to find the problem?


title: pdftk: cannot view pdf file

text: I am trying to view/edit a pdf file in pdftk, and I get the following error:               [lucas@lucas-ThinkPad-W520]~/Downloads$ pdftk file.pdf     Done.  Input errors, so no output created.      What am I doing wrong? Whether or not pdftk can provide a GUI, I just want to view the file contents.


title: Difference between root account and administrative account

text: If a user with administrative privilege can have all the powers of root using `sudo` , then what is the advantage of having root account?


title: Nagios trap snmptt fails to trigger

text: I want to monitor a HP 7500 switch power supplies. I have my OID, given by the HP web interface. So I create a snmptt.conf.hp, I create a service, passive and volatile, add this OID to a trap, and linked trap to service, then service to host. I configured snmptt.conf, in order to log as `/var/log/snmptt.log`, and `snmptt_unknown.log`. With `log_enable = 1`, and `debugging = 1` ... But nothing happens! No log at all! No `smptt*.log` or `snmptrapd.log` ... By looking with tcpdump, I'm sure that traps arrive well. But Nagios.log tell me this:               Warning: The results of service 'Service_Trap_PowerSupply_KO' on host 'XX.XX.XX.XX' are stale by 0d 0h 0m 59s (threshold=0d 0h 5m 0s).  I'm forcing an immediate check of the service.     Warning: The results of service 'Service_Trap_PowerSupply_OK' on host 'XX.XX.XX.XX' are stale by 0d 0h 0m 59s (threshold=0d 0h 5m 0s).  I'm forcing an immediate check of the service.      So name of my services look ok. On trap for KO the other for OK. When we unplug on powersupply, this is recorded in `nagios.log`.


NOTE: This is for RHEL/centOS. Currently my way of configuring the MTU is via GUI using `system-config- network` and setting the MTU to 4096. I would like a non-interactive script to do this instead. How do you configure the MTU for all network adapters via a script? UPDATE: Changing the MTU for a specific network adapter using `system-config-network` will actually result in making a persistent change to the adapter's configuration. I need the script to also make changes that are persistent.


title: Blackscreen and cursor only after booting up KDE in an ArchLinux system

text: Today I updated my system and answered yes to all doing so. After a reboot I only see the programs that are configured to start on startup and no windows frames are available (however I can interact with the on-top-of-all opened program windows) My /var/log/pacman.log changes are reflected here: > >     [2014-07-31 15:24] [PACMAN] Running 'pacman -Syu --color never' >     [2014-07-31 15:24] [PACMAN] synchronizing package lists >     [2014-07-31 15:24] [PACMAN] starting full system upgrade >     [2014-07-31 15:24] [PACMAN] removed kactivities (4.13.0-1) >     [2014-07-31 15:24] [PACMAN] removed polkit-qt (0.103.0-3) >     [2014-07-31 15:24] [PACMAN] upgraded ffmpeg (1:2.3-1 -> 1:2.3.1-1) >     [2014-07-31 15:24] [PACMAN] installed kactivities4 (4.13.3-1) >     [2014-07-31 15:24] [PACMAN] installed polkit-qt4 (0.112-1) >


title: Linux : Major and Minor device numbers

text: What types of devices fall under the major device number category and what types of devices fall under the minor device number category. What is the real difference between the two categories?


title: Where does backtick and single quote come from when denoting commands e.g. `prog'?

text: When referring to commands in tutorials, man pages, and articles I see authors use the backtick and single quote in this way:               `./configure'     `make'      I believe I have seen gcc denote points of failure during compilation with that sequence. Where does it come from and why do many people use it as a convention for commands to issue?


title: How do I extract the filesystem image from vmlinux.bin?

text: jor1k ships a vmlinux.bin. I think there is an initrd inside, cause I don't know where else it would be. I am trying to extract the filesystem image so I can change it, but I don't know how to. I tried using extract-vmlinux from the Linux source distribution, but it `Cannot find vmlinux`.


title: Importance of knowing if a standard library function is executing a system call

text: Is it actually important for a programmer to know if the standard library function he/she is using is actually executing a system call? If so, why? Intuitively I'm guessing the only importance is in knowing if the general standard function is a library function or a system call itself. In other cases, I'm guessing there isn't much of a need to know if a library functions uses internally a system call?


title: What distro for my PowerBook G4?

text: I've got an old PowerBook G4 with a 1333 MHz CPU and 1.25 GB RAM. What are some good distro to use? I tried Yellow Dog and Fedora (which didn't work), but I would prefer something more Debian-like, with apt and all that.


title: Are two files hardlinked?

text: How can I tell if two files are hard-linked from the command line? e.g. something link this:               $ ls     fileA fileB fileC          $ is-hardlinked fileA fileB     yes          $ is-hardlinked fileA fileC     no


title: Xfce - BackBox Linux 3.05 - Network-Manager Secure connection notification missing

text: I have just installed `backbox` 3.05 x64. When i configured OpenVPN I recognized that there is no notification about the established secure connection as it appeared on my Kubuntu KDE and Ubuntu Gnome installations.   1. Is it possible to activate notifications on secure connections in the menu panel?   2. How can I enable those notifications if 1. is true?


title: How to get all Users and echo if they work or not?

text: How do I get a list of users(given from the command line) with `grep` and output if they are logged/work or not ?


title: Lost everything after using install-mbr

text: I was dual booting Windows 8 and BackTrack5 but I erased the MBR while using easyBCD. So I tried this…               sudo install-mbr -i n -p D -t 0 /dev/sda1      `/dev/sda1` was the primary partition in my system which is "System Reserved" for Windows. When I rebooted my system, it got stuck at the boot logo "HP" and BIOS won't show up even when I pressed the `Esc` to pause start up.   I tried to boot BackTrack5 linux from flash drive, but the flash drive won't get detected, since BIOS itself is not showing up!   My BIOS version is "Insyde F.66A" and I am using HP pavilion dv4t-1300 CTO notebook PC. What could be the reason for BIOS not showing up? Can it be fixed?


title: How do I stop bash from syntax checking sourced files?

text: I have the following code in a file that is sourced by both zsh and bash.               if test $SHELLNAME = zsh ; then         lss() { l -l ${1:-.}/*(s,S,t); }         laf() { l ${1:-.}/.*(.); }         lad() { l -d ${1:-.}/.*(/); }         lsw() { l -ld ${1:-.}/.*(R,W,X.^ND/); }     fi      `SHELLNAME` is `zsh` if the shell is zsh and `bash` if the shell is bash. Each of the above functions contains code that works with zsh, but not bash. When I source this file, I receive the following errors.               bash: <filename>: line 67: syntax error near unexpected token `('     bash: <filename>: line 67: `     lss() { l -l ${1:-.}/*(s,S,t); }'      At the moment, I am using `eval` to bypass bash's syntax checking.               if test $SHELLNAME = zsh ; then         # Using eval makes sure bash can't try to syntax-check these functions.         eval 'lss() { l -l ${1:-.}/*(s,S,t); }'         eval 'laf() { l ${1:-.}/.*(.); }'         eval 'lad() { l -d ${1:-.}/.*(/); }'         eval 'lsw() { l -ld ${1:-.}/.*(R,W,X.^ND/); }'     fi      Is there a better solution to this problem? (perhaps one that doesn't use `eval`)


title: The VM with Kali Linux hangs

text: I have downloaded the newest Back Track version _"Kali Linux"_ as a VM image. I run it using my VM Workstation latest build. First time I visited Youtube to play some videos it asked me to download Adobe but when I use the Virtual machine to work on the installation of Adobe it hangs and I can't use it. Someone has told me before it's a VM side issue thus now I got my latest build of the VM but nothing has changed. Can somebody suggest me why that is?


title: Generate what a GRUB2 kernel line would look like

text: In GRUB 0.97 we were able to see what the kernel line/options would look like by just viewing `/boot/grub/grub.conf`. Now the only way I know how to check the next boot kernel options/kernel version is by rebooting and waiting until the new GRUB2 menu generates. How can I view kernel options/version that will be loaded in GRUB2 prior to rebooting? Would it be possible to generate an "example" GRUB menu prior to reboot so we can see what it would look like without having to piece together configuration files?


title: put history command onto command line without executing it

text: I use !n where (n) is the line number for executing a line in the history file I want executed at the command prompt which I find via history|less. But there is a command line history event I wish to manually modify. How can I insert into the command line a history events contents without it actually executing so I can modify and then press return? Best,


title: Switch display output without rebooting but not in Xorg

text: My graphic card has two output (VGA and DVI). Is it possible to switch from one to the other without rebooting ? It works in Xorg by restarting the X server (I guess it should be doable with `xrandr` too) but I'd like to do it in the **linux console**. I have looked at vbetool but I am not sure it is the right way (the commands I tried did not work anyway). I have a nvidia card.


title: Find out sysctl default values? (without rebooting)

text: I have modified the value of `net.core.rmem_max` with `sysctl`, and now I would like to set it back to its default value. If I reboot, `net.core.rmem_max` will go back to its default value (because it is not overridden in `/etc/sysctl.conf`), but can I know this value without rebooting? Ideally I should have run `sysctl net.core.rmem_max` to read the value before modifying it, but I forgot...


title: Ansi escape code in VIM

text: I have a log file with colored log entries, where colors are defined by ansi escape codes. When I display the file (using `cat` or `more`), terminal understands the ansi codes and logs are colorful. But I want the power of VIM to do some text manipulation on log entries and yet see them colorful. Is there any plugin that can parse ansi codes in vim and color the text? The only plugins I found were able to strip the ansi codes and show the plain text monochrome.


title: GUI archive manager that works well over ssh

text: I'm using `file-roller` and it doesn't work well when my archive file is accessed via ssh (it throws an error when I try to open it). Any alternatives?


title: MBR is toast or at least Grub is

text: This started after some kernel trouble that I left alone for a while. I had miscompiled a kernel then tried to re-compile it and started to organize a list of boot options in grub for differently configured kernels and vbox threw a fit so I left the computer alone for a while. Booting it back up now I get 1 of 2 different error messages.               grub loading stage 1.5     error 17/18      or               grub loading stagerror      I'm running Gentoo 64bit and I have been updating it through a `chroot` environment This is on a 2TB drive that I have 1.08TB used that I can not back up though I have a `tar` image of the root partition layout is as fallows               1    50GB    EXT4    /        10GB   Used    40GB  Free     2    1950GB  EXT4    /home    1.08TB Used    800GB Free


title: missing argument to find -exec

text: I want to remove certain files using find and -exec. But unlikely bash tells me, that I'm "missing" some argument.               find . -name *.png -exec rm {} /;      what do I miss? same "missing argument" return for my attempt to rename some files:               find . -name ic_launcher.png -exec mv {} other_name.png /;      Can somebody tell me, what bash does miss, and why this command isn't successful?


title: VMWare Tools Stops Working upon dist-upgrade

text: To give a little background, i'm trying to prepare a Vagrant environment that I will use for WordPress development. I downloaded the Precise_64 VMWare Workstation box and configured the Vagrant Plugin and can start up the VM and SSH into it with no issues. As a standard thing while working with all boxes (to mimic my production environment) I do `apt-get update && apt-get dist- upgrade` to have the latest version of core packages before I go installing other things. At some point down the line I do a `vagrant reload` and it fails while loading the "HGFS Kernel Module" and says I cannot use shared directories without it loading. I then SSH into the machine and noticed that the VMWare Tools process is not even running. I was able to recreate this on another machine and on a new machine that the `dist-upgrade` stops VMWare Tools from loading on reboot. How can I fix this so when I start a new VM and update things I won't have to deal with this issue anymore?


title: X stuck when using OpenGL

text: On a stock Dell, RHEL 5.3, my X gets stuck when running any OpenGL program for more than a few seconds. After a few seconds, the screen freezes, and after another few seconds sometimes the screen turns white. Any openGL program does that. I wrote a very simple program that uses only very basic polygon drawing, and it still causes X to freeze. Killing X won't help it recover. Both `dmesg` and the X log don't show any special errors except of               (WW) AIGLX 3D driver claims not to support visual 0x23     (WW) AIGLX 3D driver claims not to support visual 0x24     ...     (WW) AIGLX 3D driver claims not to support visual 0x32      Similar error message appears after I execute an glut OpenGL program. What could be the trouble? How can I further debug the issue?


title: Directing Xorg input to selected application

text: I'm trying to play Frets on Fire using my PS3 Guitar Hero III controller. It works right away, but it's also controlling the cursor as if it's a mouse. I'd like to play the game windowed, but that's impossible because the controller would move the cursor and unfocus the game window. One idea I had is to direct the input to one application only, so only the game window will accept input from the guitar. I could not find such an option so far. But I'm not very familiar with Xorg, so I might have missed something. If there's such an option, or if someone comes up with a better idea, it would be of great help to me.


title: Difference between help, info and man command

text: I know that these command will help to get syntax and options for commands but my question is that how they differ from each other?


title: Simple queuing system?

text: Given a commodity PC, we would like to use it to execute some tasks in the background round the clock. Basically, we would like to have commands like:               add-task *insert command here*     list-tasks     remove-task(s)      The added tasks should simply be put in a queue and executed one after another in the background (keeping running after logout of the shell). Is there any simple script/program that does this?


title: Keyboard Problem with Debian testing and gdm3

text: I'm driving a Debian testing machine that is running fine. But since testing includes Linux Kernel 3 I have the following problem: While booting all is working (I mean especially the keyboard) - controlled by switching `NumLock` state. The moment gdm3 starts (from init) the keyboard dies... It can only be reanimated by killing gdm3 (I do this via **`ssh`** ). Running `startx` from console behaves fine, thus the "`xorg.conf`" seems to be fine. The output from `startx` reads as               X.Org X Server 1.10.3     Release Date: 2011-07-08     X Protocol Version 11, Revision 0     Build Operating System: Linux 3.0.0-rc6-amd64 x86_64 Debian     Current Operating System: Linux sobolev 3.0.0-1-amd64 #1 SMP Sun Jul 24 02:24:44 UTC 2011 x86_64     Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.0.0-1-amd64 root=UUID=7d005ab3-c823-4cc9-b70a-9316a5eab8d6 ro quiet     Build Date: 07 August 2011  06:45:11PM     xorg-server 2:1.10.3-1 (Cyril Brulebois <kibi@debian.org>)     Current version of pixman: 0.22.2             Before reporting problems, check http://wiki.x.org             to make sure that you have the latest version.     Markers: (--) probed, (**) from config file, (==) default setting,             (++) from command line, (!!) notice, (II) informational,             (WW) warning, (EE) error, (NI) not implemented, (??) unknown.     (==) Log file: "/var/log/Xorg.0.log", Time: Fri Aug 26 09:19:48 2011     (==) Using system config directory "/usr/share/X11/xorg.conf.d"     (II) [KMS] Kernel modesetting enabled.     The XKEYBOARD keymap compiler (xkbcomp) reports:     > Warning:          Type "ONE_LEVEL" has 1 levels, but <RALT> has 2 symbols     >                   Ignoring extra symbols     Errors from xkbcomp are not fatal to the X server      Any ideas? I'm using a PS/2 keyboard and USB mouse. The mouse is alive under gdm3.


title: Enabling menu icons in Gnome3

text: When I start Thunderbird or the IDE 'Eclipse', there are no icons in the menu entries. Several solutions found on the Internet suggest things like setting a specific dconf-value, but with my installation (Arch) this is not possible:               % gsettings set org.gnome.desktop.interface menus-have-icons true     No such key 'menus-have-icons'      So what is the current way for enabling these icons?


title: In Linux, why do you need to be root to write to /proc/sysrq-trigger?

text: **WARNING: THE NEXT KEY COMBINATION WILL CRASH YOUR COMPUTER** Ok, I get that this is an administrative tool and all, but I realized that any user can do `ALT` + `SysRq` + `C`. This link explains what I'm talking about. But only as root I can do something like `echo c > /proc/sysrq-trigger` and have it actually crash the system. If someone has physical access they can just plug in a keyboard and crash the computer (or server), but it would be even harder for them to get root privileges in a terminal, right? Is there a specific reason as to why it works as non-root from a keyboard but only as root from a console? This is not what I'm looking for. It is talking about an issue with the _Fn_ part on keyboards. It doesn't even allow you to do it with `sudo`. You have to first `su root`.


title: When running sudo make install environment variables are not passed

text: I have problems with using `pkg-config` in a `Makefile`, while running in `sudo` mode. I need to have `PKG_CONFIG_PATH` set for pkg-config to find geany.pc file that is held in `/usr/local/lib/pkgconfig`. If I run:               $ echo $PKG_CONFIG_PATH     /usr/local/lib/pkgconfig      If I run with `sudo`:               $ sudo echo $PKG_CONFIG_PATH     /usr/local/lib/pkgconfig      So I try running my Makefile that looks like this:               PLUGIN_DIR=`pkg-config --variable=libdir geany`/geany          all: pyflakes.o         gcc pyflakes.o -o geanypyflakes.so -shared `pkg-config --libs geany`          pyflakes.o: pyflakes.c         gcc -Wall -c pyflakes.c -fPIC `pkg-config --cflags geany`           install:         echo ${PKG_CONFIG_PATH}         cp geanypyflakes.so ${PLUGIN_DIR} --verbose          clean:         rm geanypyflakes.so pyflakes.o               sudo make install      and I get following ouput:               echo           cp geanypyflakes.so `pkg-config --variable=libdir geany`/geany --verbose     `geanypyflakes.so' -> `/geany'      Why suddenly `PKG_CONFIG_PATH` is not set? I can run `sudo -E` and then it works, but I would like to understand why it suddenly is not working. **EDIT** Running export before didn't help:               $ export PKG_CONFIG_PATH='/usr/local/lib/pkconfig' && sudo make install     echo           cp geanypyflakes.so `pkg-config --variable=libdir geany`/geany --verbose     `geanypyflakes.so' -> `/geany'


title: 3D drawing program to pose human figures (like Windows Poser)

text: Are there any good Linux-alternatives to the Windows-program Poser - a program that allows you to manipulate human-figures (dressed in skins) in a humanly way (ie. with the restriction a human body impose on body-movement)?


title: Why is iwconfig in /sbin?

text: My Ubuntu boot has `iwconfig` living in `/sbin`. I was under the impression that `/sbin` is usually for programs that are required for bootstrapping, or at least need to be available before `/usr` is mounted. I don't really see how `iwconfig` fits either of these conventions, though. What's the rationale?


title: How can I prevent systemd from freezing my system when Flash dies?

text: Since a recent update, when I quit a web page containing a Flash animation in Firefox, the `plugin-container` process becomes a zombie, and then the `systemd-journald` process (also maybe something like `systemd-coredump` sometimes) eats several hundreds megabytes of memory. I don't have much RAM, so it makes my system swap, and when my system swaps it freezes. How can I prevent that? Should I disable something related to logging or core dumps? I'm using an up-to-date Archlinux system, with Firefox 30.0, systemd 213-9 and Flash 11.2.202.378.


title: How to copy a file and move it to a location using unix

text: I need a file to stay in the same location but also move it to a different location.   What am I doing wrong?               cp RubyTest.sublime-settings \         ~/Library/Application Support/Sublime\ Text\ 2/Packages/User


title: how to 'forward' x display data?

text: this is my situation: there are three computers   1. lab server (CentOS)   2. lab personal computer(window s7)   3. personal laptop(ubuntu) since the lab server only allowed ip address of my desktop at the lab, I was unable to establish a direct remote connection to the lab server through my laptop. So I have reached to the point where I made my lap desktop into a ssh server where now I can eventually connect to the lab server through my laptop. But the problem is that I was only able to connect to the lab server only in the CLI basis. The real deal is that I want to use the simulation programs which involves X windows stuff. After a lot of struggling, with my laptop---lab desktop----lab server connected established, I execute the simulation program through my laptop but what really happens is the simulation program is executed and displayed at the 'lab desktop'.. in other words, I have failed to send the X windows display data from 'lab server' to 'my laptop'.. I guess this does make sense since eventually the regardless of how further I am logged in to the lab server, the connection coming 'out' from the lab server is tunneled to my 'lab desktop'. So I guess the X display data is automatically sent to my 'lab desktop'. So I am guessing that there could be two ways to solve this:   1. find a way that I don't know yet which will enable the X display data to be sent from the 'lab server' directly to 'my laptop'...   2. find a way to somehow 'port forward' my lab desktop so that the incoming X display data from the lab server toward 'my laptop'... Can anyone help me in anyway on this matter??


title: Is it possible to retrieve the active window process/title in Gnome?

text: I need a solution for getting the current active (focused) window information on a Gnome 2 desktop. I'm mostly interested in the process running that window and window title. Is it possible? **SOLUTION:** Getting window title:               xwininfo -root -children | grep $(printf '%x\n' $(xdotool getwindowfocus)) | grep -oEi '"[^"]+"' | head -1      Getting process name:               ps -e | grep $(xdotool getwindowpid $(xdotool getwindowfocus)) | grep -v grep | awk '{print $4}'      or:               cat /proc/$(xdotool getwindowpid $(xdotool getwindowfocus))/comm


title: Very slow Ubuntu server

text: I have an Ubuntu Server with 200MB RAM and 400MB swap space that has no heavy load. I used `top` to verify its load. However, it's very slow and takes several seconds to execute a `ls` command or other similar light commands. Can anyone suggest what the problem may be?


title: how to know the use of my applications?

text: I want to know how long my programs have been used. For example if I use my web browser I want to know the start and the close time to obtain a total of use time. Basically I want to know when an application starts an when its ends, and in function of the event do something like register the time in a file. I've searched about listening kernel events or something like that but nothing. Also i tried with `supervisord` but it says that the process closes too quickly and did not record anything. Another of my attempts was to use the `pyinotify` library to monitor the `/proc` folders but that was a complete failure. I'm working in Ubuntu. Any tips? These are my sources   * https://github.com/seb-m/pyinotify   * http://supervisord.org/


title: Debian: pulseaudio sink volumes syncing?

text: Running Debian jessie with pulseaudio, sometimes I would use `pavucontrol` to adjust volumes of different applications at varying levels. Then when I would forget about it and adjust the volume using keys mapped to `pactl set-sink- volume 1 -- -10%`. But if the sink volume was 50% and then I set the application volume in `pavucontrol` to `100%`, forgot about it, then used `pactl set-sink-volume 1 -- -10%` the application volume would exceed 100%... and if it's an alsa container then it would make awful screeching sounds very loudly. Is there a quick way to reset all of the applications volumes?


title: tar extraction depends on filename?

text: I often download tarballs with wget from sourceforge.net. The downloaded files then are named, e.g `SQliteManager-1.2.4.tar.gz?r=http:%2F%2Fsourceforge.net%2Fprojects%2Fsqlitemanager%2Ffiles%2F&ts=1305711521&use_mirror=switch` When I try to               tar xzf SQliteManager-1.2.4.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fsqlitemanager%2Ffiles%2F\&ts\=1305711521\&use_mirror\=switch      I receive the following error message:               tar (child): Cannot connect to SQliteManager-1.2.4.tar.gz?r=http: resolve failed          gzip: stdin: unexpected end of file     tar: Child returned status 128     tar: Error is not recoverable: exiting now      After renaming the file to `foo.tar.gz` the extraction works perfect. Is there a way, that i am not forced to rename each time the target file before extracting?


title: chmod recursive permission on thousands of files

text: This is a more general question about 'chmoding' recursively. I have this script which at some point needs to change the permissions recursively in a folder which has a few hundred thousand files. There are new files added in that folder every day, but the ones that are already there have the permissions already set and they don't change. My question is... when I call               chmod 775 . -R  does it try to set the permission for the files that already have the right permissions set, or only for the new files that don't have the right permissions? It seems to always take ages to get past this command in the script, even though the 'new' files are only a few thousand and it should do their permissions fairly quickly. I've looked at the man page for chmod, but it doesn't seem to mention anything on this case. If chmod doesn't check for permissions beforehand, should I start looking at combining 'find' with 'chmod'?


title: Configure Solaris to write out a core image of an abnormally terminated telnet and man process

text: What is the easiest way to configure Solaris to write out a core image of an abnormally terminated telnet and man process?


title: Insert a new directory path to PATH in .cshrc file fail

text: I want to add a additional directory to PATH in `.cshrc` in my home directory . But after I put the path to it ,It still not working . I don't know what's the problem ... After I add this directory to `.cshrc` I type the name of program to use it , But it can't find ... I want to add a directory called .tools in my home directory The original file               set path = (. ~ /sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin)      After I added               set path = (. ~ ~/.tools /sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin)


title: xdg-open is installed yet also is not installed

text: $ xdg-open     The program 'xdg-open' is currently not installed. You can install it by typing:     sudo apt-get install xdg-utils          $ sudo apt-get install xdg-utils     Reading package lists... Done     Building dependency tree            Reading state information... Done     xdg-utils is already the newest version.     0 upgraded, 0 newly installed, 0 to remove and 89 not upgraded.          $ whereis xdg-open     xdg-open: /usr/bin/xdg-open /usr/bin/X11/xdg-open /usr/share/man/man1/xdg-open.1.gz          $ which xdg-open          $ xdg-open     The program 'xdg-open' is currently not installed. You can install it by typing:     sudo apt-get install xdg-utils      No, I didn't mean "recursion". I'm on Linux Mint 15 MATE, but instead of MATE I'm using the i3 window manager. **Edit taking @slm's advice**               $ type -a xdg-open     type: xdg-open not found      But it's in /usr/bin/xdg-open. I checked.               $ dpkg -S /usr/bin/xdg-open     xdg-utils: /usr/bin/xdg-open      The next one was even more interesting.               $ dpkg -S xdg-open     git-annex: /usr/share/doc/git-annex/html/bugs/Fix_for_opening_a_browser_on_a_mac___40__or_xdg-open_on_linux__47__bsd__63____41__.html     xdg-utils: /usr/bin/xdg-open     xdg-utils: /usr/share/man/man1/xdg-open.1.gz      The bug-fix is just a mail archive of a patch for an OSX problem. Anyway, I guess I could try using the full path:               $ /usr/bin/xdg-open     /usr/bin/xdg-open: No such file or directory


title: Installing an application to run using wine

text: I would like to install FoxIt and PDF-XChange to run using wine. There are some things that I would like to see:   1. I would like it to be `~/.wine` free. Once in a while I play with windows program and would like to be able to do `rm -rf ~/.wine` without interfering with these programs.   2. I would like it to have access to all the same areas that most users do.   3. I would ( except for a few environmental settings ) like to install it once in some common location ( probably in `/opt` ) that most users can use.   4. I would like it to run three different ways: from the command line, from the desktop as an icon, from the application launcher menu, or by clicking associated files ( in this case pdf ). I would like to do this in both KDE and GNOME. It would also be nice if there was some written "recipe" on how to do this. Meaning an entry similar to entries in the _Name your favorite programming language_ Cookbook.


title: Executing a script in zsh - file permissions

text: I'm confused about execute file permissions not behaving as I expect. Probably because my expectations are wrong. Anyway: I have a script file, for simplicity is just called `s`, located in `~/bin`. For the sake of this example, the file contains just the following lines:               #!/bin/zsh     echo "Test";      Very simple. I navigate to the `~/bin` directory, and `chmod` the file permissions of `s` to `400` - i.e., read-only for me only. No execute permission. So then I try executing the script by entering its path, giving this:               % ./s     zsh: permission denied: ./s      So far so good. The file can't be executed due to the wrong permissions. Bumping permissions up to `500` (execute permission granted) works fine too - with these permissions, the file executes fine:               % ./s     Test      This is all as expected. But then I `chmod` permissions back down to `400` (execute permission off again), try `source`ing the file, and this happens:               % source s     Test      Although permissions are `400`, the script executes. So here's my question: why does `./s` fail (like it should) but `source s` executes normally? Doesn't this defeat the whole purpose of the execute permission? At `400` permissions, `sh s` and `zsh s` also work. I'm sure I'm either doing or understanding something horribly wrong somewhere. Can someone point out where to me, and explain the difference between `./s`, `source s`, `sh s` and `zsh s`?


title: Does the SFTP server accept passwords at all?

text: I'm trying to connect to a sftp server via `sftp USERNAME@SERVERNAME`. Whatever I do, I get "Permission denied (publickey)." Googling doesn't help as everybody recommends switching to key-based authentication, which is a funny idea for somebody not in control over the server. But maybe the server has been switched in the meantime (and nobody told me). Using `-v` I get:               debug1: Host HOSTNAME is known and matches the RSA host key.     debug1: Found key in .../.ssh/known_hosts:5     debug1: ssh_rsa_verify: signature correct     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug1: SSH2_MSG_NEWKEYS received     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug1: Authentications that can continue: publickey     debug1: Next authentication method: publickey     debug1: Offering public key: .../.ssh/id_rsa     debug1: Server accepts key: pkalg ssh-rsa blen 279     debug1: Authentications that can continue: publickey     debug1: Trying private key: .../.ssh/id_dsa     debug1: No more authentication methods to try.     Permission denied (publickey).     Couldn't read packet: Connection reset by peer      Does it mean that the server accepts no passwords at all? I guess yes, and this may be a very stupid question...


title: ncurses.h is not found, even though it is on the search path

text: I have installed `ncurses` package from source, and now I have               $HOME/local/include/ncurses/curses.h     $HOME/local/include/ncurses/ncurses.h      on my filesystem. I have also set up the search pathes so that               $ echo $C_INCLUDE_PATH     $HOME/local/include:     $ echo $CPLUS_INCLUDE_PATH     $HOME/local/include:      (i have eddited the output of echo to replace home path with `$HOME`) however, when i `./configure` another package i get               checking ncurses.h usability... no     checking ncurses.h presence... no      what's the problem that the system cannot detect `curses` installation?


title: How to assign user root rights?

text: I have Suse Linux on my desktop. So I am root and "normal" user. Frequently e.g. to start tomcat or install/remove a program I should use `sudo` or switch to super user. But I have defined many aliases in `.bashrc`, path in `.profile` etc. Is it possible to assign to normal user some rights of super user? E.g. to install program?


title: How to find out what process is writing to STDOUT?

text: I have two instances of a process running. One of them is "frEAkIng oUT!" and printing errors non stop to STDOUT. I want to kill the broken process but I have to make sure I don't terminate the wrong one. They were both started about at the same time and using `top` I can see they both use about the same amount of memory and CPU. I can't seem to find anything that points to which process is behaving badly. The safest thing would be to figure out which process/pid is writing to STDOUT. Is there any way to do that?


title: What went wrong with this driver install?

text: I am trying to install the correct LAN card drivers on openSuse 12.1. This is the output of the log file for the `autorun.sh` script:               -------------------------------     Sun Jul  1 21:50:45 IDT 2012     -------------------------------     Sun Jul  1 21:59:26 IDT 2012     make -C src/ clean     make[1]: Entering directory `/home/shelly/r8168-8.031.00/src'     make -C /lib/modules/3.1.0-1.2-desktop/build SUBDIRS=/home/shelly/r8168-8.031.00/src clean     make: Entering an unknown directory     make: Leaving an unknown directory     make[1]: Leaving directory `/home/shelly/r8168-8.031.00/src'      How can I figure out what went wrong?


title: Compilation error on Ubuntu

text: I'm trying to install the driver of the probe IPEH-00202242179, I downloaded an installation file with the following commands:               $ cd peak-linux-driver-7.9     $ make clean     $ make      $ su -c "make install"       But the problem is when I do `make` I get the following error message: > make [1]: [PCAN-settings] Error 1 * What should I do to solve this problem?


title: No answer on Broadcastping

text: Actually I'm making an android app, but as the problem appears by using android's Linux runtime, I'm asking my question here. The thing is, that I need to ping the network's broadcast address to receive the IP's from answering devices. For that I used `"ping -c 5 -b "+getBroadcast()`.   My problem is, that there aren't any answer-packages (0 of 5 packages received), even if c is 10 or 30 (so it's not a time problem).   The point is, that if I don't use the broadcast, but ping the devices directly the answer comes (even 5 times, but that's normal). Even my android phones are answering, although Linux based systems don't do that by default. Is it because of the router or do I make something wrong? P.S. I'm using an AVM router (Fritz!Box)


title: How to debug init.d script that isn't being run

text: I am trying to get `god` to start during boot on Debian. I added a script to the `/etc/init.d/` directory which looks like this.               #!/usr/bin/sh     ### BEGIN INIT INFO     # Provides:          god     # Required-Start:    $remote_fs $syslog     # Required-Stop:     $remote_fs $syslog      # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: start god process monitoring     # Description:       Start god process monitoring     ### END INIT INFO          god_conf="absolute/path/to/god.conf"     god_pid_file="/var/run/god/god.pid" ; mkdir -p `dirname $god_pid_file`     god_log_file="/var/log/god/god.log" ; mkdir -p `dirname $god_log_file`     case "$1" in       start)         god -c "$god_conf" -P "$god_pid_file" -l "$god_log_file"         RETVAL=$?         echo "God started"         ;;     ...      I ran the following command to create the necessary symbolic links `sudo update-rc.d god defaults` However, when I reboot the machine, god does not seem to get started. My question is, how can I debug this problem. I have looked at `demsg` and don't see anything related to `god`. I have also looked at the `syslog` and didn't see anything there. Also, the god.log file is empty and there is no god.pid file. I don't know if the problem is that my init script is not even getting called or if it is failing when it tries to start god. I have tried starting god manually by running `sudo /etc/init.d/god start` and that seems to work fine. Any ideas?


title: How are Linux kernel compile config's determined?

text: I am compiling my first Kernel (3.5 rc1) from source through `menuconfig`. Certain configuration options are pre-set.   * Who / what determines if they are pre-set?   * Does the `make menuconfig` somehow detect my computer and its devices and characteristics and generates them?   * Or do the default configs come with the source, pre-determined by someone (who put the source out)?


title: Connecting to a machine which is behind a university gateway

text: I have a username and password to connect to a remote machine which is behind a university gateway (using ssh). However, I don't have a username and password to connect to the gateway itself. I tried to so some port forwarding without luck. What else can I do (which is legitimate)? Thanks


title: Pulseaudio startup fails on VPS as non-root

text: I installed pulseaudio, but I can't manage to run it as any non-root user. `pulseaudio -vvvv` output is (relevant parts with errors): > D: [pulseaudio] cli-command.c: Checking for existence of > '/usr/lib/pulse-2.0/modules/module-udev-detect.so': success   >  D: [pulseaudio] module-udev-detect.c: /dev/snd/ is apparently not existing > yet, retrying to create inotify watch later.   >  libudev: udev_monitor_enable_receiving: bind failed: Operation not > permitted   >  E: [pulseaudio] module-udev-detect.c: Failed to enable monitor: Operation > not permitted   >  I: [pulseaudio] module-udev-detect.c: Most likely your kernel is simply too > old and allows only privileged processes to listen to device events. Please > upgrade your kernel to at least 2.6.30.   >  E: [pulseaudio] module.c: Failed to load module "module-udev-detect" > (argument: ""): initialization failed.   >  E: [pulseaudio] main.c: Module load failed.   >  E: [pulseaudio] main.c: Failed to initialize daemon. The user executing the command is member of the groups `audio`, `pulse` and `pulse-access`.   Also, I have no `/dev/snd` devices, only `/dev/audio` to `/dev/audio3`, `dev/audioctl`, `dev/sndstat` and `dev/dsp` to `dev/dsp3`. The server runs on debian 7, `uname -a` output is   `Linux euve30818 2.6.32-028stab109.2 #1 SMP Mon Oct 28 17:42:24 MSK 2013 x86_64 GNU/Linux`, so my kernel actually is new enough, contrary to the logged statement. As mentioned, the server is virtual. I read that for virtual servers, problems with udev can occur and that seems to be the case here. However I found no fixes / workarounds or settings to make it work. Nontheless, I assume it should be possible, since everything works fine as root. Any recommendations on how to proceed?


title: Raspberry Pi and CUPS with OKI C3200

text: I'm trying to use my Raspberry Pi (`raspberrypi 3.10.25+`) as an print server gateway to my OKI C3200.      I have successfully installed `CUPS 1.5.3` and my printer was detected immediately, so the installation/setup was not a problem.      This is how it looks like now (it is in German though): ![cups1](http://i.stack.imgur.com/WSoMu.png)    After successfully adding the printer in windows 7, I get the following error message when trying to print something: ![cups2](http://i.stack.imgur.com/vSMrE.png)   ...which basically translates to:               "Could not connect printer to LPR port"         Printing a test page via CUPS does not work either.   The funny thing is, I can print documents from my iPhone 4 without a problem, so it is possible to use the OKI C3200 as a network printer.      Now, I am not really sure if this problem is because I am missing something with the CUPS configuration or if the cause lays somewhere completely different...      Maybe someone else encountered this error message and knows how to do fix this?      Edit: Printing a test page from CUPS does work (although it took ~10 minutes).


title: Bash iterate over a list of strings

text: I have this bash script:               for opt in string1 string2 string3 ... string99     do somestuff      It works, but I would like to replace the explicit listing of my strings with a file which actually contains all the strings; something like this:               strings=loadFromFile     for opt in $strings     do somestuff      How should I do this?


title: causing a reboot from user space

text: This program , written for Gnu Assembler on an x86 linux system is supposed to cause a triple fault and then reboot.               .text     .global _start     _start:     # write our string to stdout              movl    $len,%edx   # third argument: message length         movl    $msg,%ecx   # second argument: pointer to message to write         movl    $1,%ebx     # first argument: file handle (stdout)         movl    $4,%eax     # system call number (sys_write)         int $0x80       # call kernel     # Triple Fault -- reboot         movq    $1, %rsp    # Load the stack pointer with a one         pushq    %rax       # Push the A register, should cause a triple fault.          # and exit              movl    $0,%ebx     # first argument: exit code         movl    $1,%eax     # system call number (sys_exit)         int $0x80       # call kernel          .data                   # section declaration          msg:         .ascii  "Will reboot by triple fault!\n"    # our dear string         len = . - msg           # length of our dear string      It causes a segmentation fault instead. Is it possible to get this to work from user mode, If run as root?


title: How to tell of whether the kernel parameter [passed at command line] is a valid kernel parameter?

text: In the `grub.conf` configuration file I can specify command line parameters that the kernel will use, i.e.:               kernel /boot/kernel-3-2-1-gentoo root=/dev/sda1 vga=791 plasticDuck      After booting up a given kernel, is there a way to tell if all parameters were passed 'correctly'? I.e. there is no `plasticDuck` kernel parameter, but:               dmesg | grep plasticDuck      only returns:               Kernel command line: root=/dev/sda1 vga=791 plasticDuck      (no error)


title: Is there a way to split a HTML file without losing all the formatting within each segment?

text: So... the split command allows me to split a file into pieces. The problem with that, though, is that only one of the files is going to contain the HTML headers, and only one of them is going to contain the HTML footers. (this is probably relevant for a lot of other files that contain header/footer information)


title: How to display kernel command line parameters?

text: In the `grub.conf` configuration file I can specify command line parameters that the kernel will use, i.e.:               kernel /boot/kernel-3-2-1-gentoo root=/dev/sda1 vga=791      After booting a given kernel, is there a way to display the command line parameters that were passed to the kernel in the first place? I've found sysctl,               sysctl --all      but sysctl shows up _all_ possible kernel parameters.


title: Is it  possible to  keep a FreeBSD system up to date (base system + packages) using only binaries?

text: I have been using Debian and NetBSD systems for a long time, and I have got used to do binaries upgrades for the base system and for packages (using pkgin with NetBSD) Now the NetBSD kernel does not work so well with the VPS provider, but FreeBSD is a supported option there, so I am thinking to make the switch. I have seen that binary upgrades from the base systems seem reliable with **freebsd-update** , how _reliable_ is this for binary packages ? I mean _reliable_ , that you would trust it to be done on a server running Apache with php, python, a DNS server without too much downtime. http://forums.freebsd.org/showthread.php?t=17722 mentions at step 2 deleting everything and reinstalling afterwards. Not my peace of cake.