title: What could cause a ping request to return inconsistently timed results

text: Here is a sample run:               64 bytes from 192.168.1.9: icmp_seq=27 ttl=64 time=8852.917 ms     64 bytes from 192.168.1.9: icmp_seq=28 ttl=64 time=7918.074 ms     64 bytes from 192.168.1.9: icmp_seq=29 ttl=64 time=6919.258 ms     64 bytes from 192.168.1.9: icmp_seq=30 ttl=64 time=6554.894 ms     64 bytes from 192.168.1.9: icmp_seq=31 ttl=64 time=5555.114 ms     64 bytes from 192.168.1.9: icmp_seq=32 ttl=64 time=6811.810 ms     64 bytes from 192.168.1.9: icmp_seq=33 ttl=64 time=5817.897 ms     64 bytes from 192.168.1.9: icmp_seq=34 ttl=64 time=4820.810 ms     64 bytes from 192.168.1.9: icmp_seq=35 ttl=64 time=3823.977 ms     64 bytes from 192.168.1.9: icmp_seq=36 ttl=64 time=2905.626 ms     64 bytes from 192.168.1.9: icmp_seq=37 ttl=64 time=1906.395 ms     64 bytes from 192.168.1.9: icmp_seq=38 ttl=64 time=905.815 ms     64 bytes from 192.168.1.9: icmp_seq=39 ttl=64 time=4559.416 ms     64 bytes from 192.168.1.9: icmp_seq=40 ttl=64 time=3560.627 ms     64 bytes from 192.168.1.9: icmp_seq=41 ttl=64 time=2563.604 ms     64 bytes from 192.168.1.9: icmp_seq=42 ttl=64 time=1571.941 ms     64 bytes from 192.168.1.9: icmp_seq=43 ttl=64 time=572.513 ms     64 bytes from 192.168.1.9: icmp_seq=44 ttl=64 time=785.998 ms     64 bytes from 192.168.1.9: icmp_seq=45 ttl=64 time=91.560 ms     64 bytes from 192.168.1.9: icmp_seq=46 ttl=64 time=207.244 ms     64 bytes from 192.168.1.9: icmp_seq=47 ttl=64 time=168.893 ms     64 bytes from 192.168.1.9: icmp_seq=48 ttl=64 time=882.917 ms     64 bytes from 192.168.1.9: icmp_seq=49 ttl=64 time=613.126 ms     64 bytes from 192.168.1.9: icmp_seq=50 ttl=64 time=355.128 ms     64 bytes from 192.168.1.9: icmp_seq=51 ttl=64 time=764.870 ms     64 bytes from 192.168.1.9: icmp_seq=52 ttl=64 time=1171.386 ms     64 bytes from 192.168.1.9: icmp_seq=53 ttl=64 time=171.749 ms     64 bytes from 192.168.1.9: icmp_seq=54 ttl=64 time=222.467 ms     64 bytes from 192.168.1.9: icmp_seq=55 ttl=64 time=256.847 ms     64 bytes from 192.168.1.9: icmp_seq=56 ttl=64 time=480.801 ms     64 bytes from 192.168.1.9: icmp_seq=58 ttl=64 time=1036.218 ms     64 bytes from 192.168.1.9: icmp_seq=59 ttl=64 time=35.761 ms     64 bytes from 192.168.1.9: icmp_seq=60 ttl=64 time=139.025 ms     64 bytes from 192.168.1.9: icmp_seq=61 ttl=64 time=74.907 ms     64 bytes from 192.168.1.9: icmp_seq=62 ttl=64 time=96.822 ms     64 bytes from 192.168.1.9: icmp_seq=63 ttl=64 time=15.899 ms     64 bytes from 192.168.1.9: icmp_seq=64 ttl=64 time=286.599 ms     64 bytes from 192.168.1.9: icmp_seq=65 ttl=64 time=1818.499 ms     64 bytes from 192.168.1.9: icmp_seq=66 ttl=64 time=819.665 ms     64 bytes from 192.168.1.9: icmp_seq=67 ttl=64 time=1164.031 ms     64 bytes from 192.168.1.9: icmp_seq=68 ttl=64 time=977.344 ms     64 bytes from 192.168.1.9: icmp_seq=69 ttl=64 time=987.560 ms     64 bytes from 192.168.1.9: icmp_seq=70 ttl=64 time=2449.542 ms     64 bytes from 192.168.1.9: icmp_seq=71 ttl=64 time=1450.172 ms     64 bytes from 192.168.1.9: icmp_seq=72 ttl=64 time=1582.838 ms     64 bytes from 192.168.1.9: icmp_seq=73 ttl=64 time=1155.943 ms     64 bytes from 192.168.1.9: icmp_seq=74 ttl=64 time=364.404 ms     Request timeout for icmp_seq 82     64 bytes from 192.168.1.9: icmp_seq=78 ttl=64 time=5450.020 ms     64 bytes from 192.168.1.9: icmp_seq=79 ttl=64 time=4451.254 ms     64 bytes from 192.168.1.9: icmp_seq=80 ttl=64 time=3537.117 ms     64 bytes from 192.168.1.9: icmp_seq=81 ttl=64 time=2598.308 ms     64 bytes from 192.168.1.9: icmp_seq=82 ttl=64 time=1599.324 ms     64 bytes from 192.168.1.9: icmp_seq=83 ttl=64 time=706.184 ms     64 bytes from 192.168.1.9: icmp_seq=84 ttl=64 time=651.453 ms     64 bytes from 192.168.1.9: icmp_seq=85 ttl=64 time=37.370 ms     64 bytes from 192.168.1.9: icmp_seq=86 ttl=64 time=385.340 ms     64 bytes from 192.168.1.9: icmp_seq=88 ttl=64 time=266.425 ms     ^C     --- 192.168.1.9 ping statistics ---     89 packets transmitted, 57 packets received, 36.0% packet loss     round-trip min/avg/max/stddev = 15.899/2033.889/8852.917/2287.084 ms      I've edited to include details regarding my network speed below. ![Speed Test #1](http://i.stack.imgur.com/C0yAs.png) ![Speed Test #2](http://i.stack.imgur.com/tnFl1.png)


title: brctl Not working fine with bridging eth0 and at0

text: I made an access point with airbase-ng and its at0 I tried to bridge my eth0 and at0 by               brctl addbr demo     brctl addif demo eth0     brctl addif demo at0     brctl demo up     dhclient3 demo &     already removed eth0 ip      so when i use               ping 192.168.1.1 -I eth0      theres no reply but if i use               ping 192.168.1.1 -I demo      it works!!! In browser internet works fine so when i connect my android with at0 (access point) it should same work. but its now working at all :(


title: How to resolve upgrading problem in Ubuntu 13.10?

text: I have googled about this problem. I've searched askubuntu page about this problem but I couldn't get any suitable solution. I have faced this problem while trying to update using: link Before that, I've tried to update using update manager too. But, it failed and display suggestion to type code `sudo apt-get -f install` After that, you can see what I got               habi@habi-MS-7529:~$ sudo apt-get -f install     [sudo] password for habi:      Reading package lists... Done     Building dependency tree            Reading state information... Done     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     2 not fully installed or removed.     After this operation, 0 B of additional disk space will be used.     Setting up checkbox (0.15.6) ...     [Errno 5] Input/output error     dpkg: error processing checkbox (--configure):      subprocess installed post-installation script returned error exit status 1     No apport report written because MaxReports is reached already                                                                   dpkg: dependency problems prevent configuration of checkbox-qt:      checkbox-qt depends on checkbox (>= 0.15.6); however:       Package checkbox is not configured yet.          dpkg: error processing checkbox-qt (--configure):      dependency problems - leaving unconfigured     No apport report written because MaxReports is reached already                                                                   Errors were encountered while processing:      checkbox      checkbox-qt     E: Sub-process /usr/bin/dpkg returned an error code (1)     habi@habi-MS-7529:~$ sudo apt-get -f install     Reading package lists... Done     Building dependency tree            Reading state information... Done     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     2 not fully installed or removed.     After this operation, 0 B of additional disk space will be used.     Setting up checkbox (0.15.6) ...     [Errno 5] Input/output error     dpkg: error processing checkbox (--configure):      subprocess installed post-installation script returned error exit status 1     dpkg: dependency problems prevent configuration of checkbox-qt:      checkbox-qt depends on checkbox (>= 0.15.6); however:       Package checkbox is not configured yet.          dpkg: error processing checkbox-qt (--configure):      dependency problems - leaving unconfigured     No apport report written because MaxReports is reached already                                                                   No apport report written because MaxReports is reached already                            Errors were encountered while processing:      checkbox      checkbox-qt     E: Sub-process /usr/bin/dpkg returned an error code (1)      *Note: It was same error that was seen before typing sudo apt-get -f install About my computer>>> Memory 486.7 MiB Processor Intel Pentium(R) 4 CPU 3.00 GHz x 2 Graphics Gallium 0.4 on llvmpipe(LLVM 3.2, 128 bits) OS type 32-bit Disk 18.5 GB


title: GUI library or Window Manager using HTML

text: Ok... You want some clarity? Being a programmer this sort of question always has conditionals.   1. Are there any DE's or (more generally) DE backends that support building (scripting) or rather modding the UI in HTML and it's associated web languages?   2. If not what are the existing languages in use, how modifiable are they, and would it be possible to build an interpreter to bridge between a HTML written UI layout and a given language. (from what I understand the current standard appears to be XML so this latter option should be somewhat feesable)   3. Putting all of the above aside how difficult would it be to do something like this from 'scratch.' Mint's login manager already has the ability to take HTML files for making custom login screens so it is possible to sandwich a Web-Engine on top of the OS and have it talk between the UI and OS components. That being said @goldilocks mentioned that HTML is really ristrictive in comparison XML. I beg to differ and to that end I built a web page in less than 3 days that mirrors the core UI elements that most DE's use in the way I'd like have them laid out. (non functional of course but it's a start.) :) http://azarel-howard.me/html-desktop/ there are some warts it not being fully polished but the concept is there. (don't forget to mouse over some elements) :) Original Question > Hi I've been searching for the past couple of months for a Linux DE that's > built on HTML. I found this as I was starting this question > http://blogs.gnome.org/alexl/2010/11/23/gtk3-vs-html5/ and it's great but > that's GTK via browser. > > What I want is to able to build my own DE as such using HTML. I'm currently > using Cinnamon in Linux Mint and I can theme it via CSS but I'd like to be > able to make my own DE with custom toolbars and such. > > Note: I'm not talking about a ground up DE just being able to build the user > facing UI (the application switcher [alt+tab],the app menu, toolbars, etc.) > > I'd still use a standard window compositor and file manager etc. and it'd > still all be linked in with the GTK theming engine but more customizable. :) EDIT: For Posterity. Let it be known that Deepin 2014 introduced a desktop UI built using HTML, CSS, and JS. It's not exactly stable (plenty of bugs prevent recommendation for use as a daily driver) but the point is that it's possible. And... this forum had the nearsightedness to close my question as unclear. Well I think it's pretty clear now what I was asking and that it (contrary to the responses below) is totally possible.


title: how to intercept IP packets on linux

text: I am trying to achieve this goal on Linux (not sure if it is possible and how if so): I need to write a program to intercept all IP packets on an interface, and deliver this packet to a specific set of user-space programs. By intercept I mean, an IP packet is captured by my program (maybe a kernel module or a special user-space program), then this packet does not go through IP stack anymore. For example, let's say the OS is running a lot of processes (either in kernel- space or user-space), A, B, C, D..., etc. If an IP packet is received at an interface, say eth2, I only want A,B sees this packet, and all other processes do even know the existence of this packet. Can someone put me into the right direction?


title: How to view source of "string.h" and other library function source code in gedit of Ubuntu?

text: I remember viewing source code of library function but now I don't know how to view it. Can someone help me viewing source code of library function?


title: How should I add users non-interactively?

text: I have a set of users I need to add to a new system as part of a BASH script that preps my server. How can I non-interactively add the user, create their home directory, set the group, and enter a default password? For example, if I needed to add the following users, how would I go about that?               user: node     password: spoon     group: ultraMegaPermissions          user:serve     password: spoot     group: sortaNotMega          user:watcher     password: spoogle     group: notMega


title: How can I test whether connection to the given host/port is established in Bash?

text: Currently I'm using netstat for this:               if netstat -an | grep ESTABLISHED | grep $address:$port > /dev/null; then         # command     fi        Is there a more elegant solution?


title: How do I add a postinst file to my debian package?

text: I'm trying to add a 'postinst' script to my debian package to clean up something a previous version may have left behind. I've simply created a 'postinst' file in the debian/ directory, but the file is not present in the .deb file. The permissions:               -rwxrwxr-x 1 kp kp 354 Sep 16 20:00 postinst*      The content:               #!/bin/sh          set -e     set -x          ...


title: Can I use the same binary on Linux, *BSD and Illumos?

text: I want to know, if I can use the binary of a program without modification on the three systems? After all they are all Unices. I talk about the same architecture.


title: Flash fullscreen on secondary (bigger) screen doesn't work

text: I have a dual monitor setup, with a small (laptop) and a bigger screen. Whenever I watch a video on some streaming website, and click fullscreen, the video takes the resolution of the smaller screen (1366x768) but shows up on the big screen (1920x1080). The remaining space on the right and below the video is just grey. I, of course, want the video to be fullscreen on the bigger monitor, and not just 1366x768. Note: This is _not_ the problem where the fullscreen is always displayed on the primary monitor. For me, it doesn't matter whether the secondary monitor is primary or not and even if I switch off the smaller screen using xrandr, and only use the large monitor, the issue remains. I am not 100% sure if the video really takes 1366x768 but I guess it does. I am using openbox as window manager. Any suggestions?


title: Enable superuser when logged in with another user

text: Suppose that the machine has two users:   * Alice (admin)   * Bob (standard user) While Bob is logged in, how can Alice modify a root file (Bob does not have this permission even with `sudo`)? Alice tried:               $ sudo vim /etc/hosts     [sudo] password for Bob:      Bob is not in the sudoers file.  This incident will be reported.


title: Preserve the permissions with rsync

text: Let's say I have a file a.txt in LINUX with permission of 0664. When I use rsync to copy the file to my Mac with `rsync -r -t -v LINUX MAC`, the file's permission becomes 0644. How can I keep the permission for a file when using rsync? The -g option doesn't work.


title: Backup parleys videos

text: I have Parleys Desktop installed on Fedora 13 and I want to format the disk. Can I make a backup of the videos I have installed so I can restore them after the format? What do I need to copy? I don't know where the videos are stored; the application is in `/opt/ParleysDesktop/bin`


title: Latest pidgin installed, but still seeing old version

text: I have installed a new version of pidgin, 2.7.11. In my linux system's application manager this pidgin is the only version selected. But when I open pidgin, the older version (2.7.8) appears. When i tried to remove it as root it gives the following error:               Loaded plugins: fastestmirror     Setting up Remove Process     No Match for argument: Pidgin     Loading mirror speeds from cached hostfile      * addons: mirrors.bd-servers.net      * base: mirrors.bd-servers.net      * extras: mirrors.bd-servers.net      * updates: mirrors.bd-servers.net     No package Pidgin available.       * Maybe you meant: pidgin     No Match for argument: 2.7.8     No Packages marked for removal      Why is the older version opening up when I have the latest one installed on my system? Where is the older one even installed?


title: Transcoding MJPEG Stream to FLV or MP4

text: I want to transcode MJPEG stream that comes from IP camera (http://xx.yy.zz.tt:8080/video.cgi) to FLV or MP4 stream under Linux OS so that users can play the file using a web based Flash player such as Flowplayer. I discovered VLC for that purpose but I cannot figure out the exact command line string. I also need HTTP authentication feature since IP camera access is password protected. I also interested in any non-VLC solution if any (ffmpeg?).


title: How to avoid being asked passphrase each time I push to Bitbucket

text: I set up my ssh stuff with the help of this guide, and it used to work well (I could run `hg push` without being asked for a passphrase). What could have happened between then and now, considering that I'm still using the same home directory.               $ cat .hg/hgrc      [paths]     default = ssh://hg@bitbucket.org/tshepang/bloog          $ hg push     Enter passphrase for key '/home/wena/.ssh/id_rsa':      pushing to ssh://hg@bitbucket.org/tshepang/bloog     searching for changes     ...


title: How can I press key of "keycode 53" every minute in X?

text: I want to automate my typing. I can use window managers such as gnome and fvwm. I can access to ubuntu and obsd.


title: Syncing directories in both directions with rsync

text: I happen to know about rsyn, and I use rsync to sync between my mac and a linux server as follows.               rsync -r -t -v MAC LINUX     rsync -r -t -v LINUX MAC      I expected to run the first command to sync, but I needed the second command also when a change is made in LINUX. Am I missing something? Does rsync have an option to sync between two directories?


title: how to list blocked connections events by the firewall?

text: So, I used firestarter that had logged blocked connections events with some useful details (but it is not being updated and I found somewhat unsafe as any moment we could click to deactivate the firewall..) I would like to know if there is some way to do that with command line script? also to translate remote IPs into url names optionally? or if there is some graphical application that helps on showing that!? EDIT: there is conntrack-tools, but how to use it? it seems new kernel versions, new ubuntu releases, that wont work properly... I used to be able to track scanport attacks, now I have no clue...


title: securing a file on disk with password protection usig strong ssl cipher and view the file in more secured way

text: I was trying to decrypt a file to standardout and piped its content to a given command. for example `cat` comand, `wc` command etc. However I felt the following command can be simplified, any further thoughts?               echo "openssl enc -aes-256-cbc -in "$(read -p "enter file:" fp && echo \"$fp\")" -k "$(read -s -p "enter passwd:" pswd && echo \"$pswd\")" -d | "$(read -p "enter command:" cmd && echo \"$cmd\")" " | xargs -0 -I{} /usr/bin/bash -c {}      for sake of completeness, commands to encrypt and decrypt a file for example. ### encrypt a file (password protected)               openssl enc -aes-256-cbc -in in.txt -out out.txt -e      ### decrypt a file               openssl enc -aes-256-cbc -in out.txt -k hello -d      of course we could use any supported cipher.


title: Native Linux program to comment pictures

text: I am searching for a native Linux program to comment (tag) pictures. Think of a square on someone's face with text somewhere. I don't want to change the picture (as would be the case with any vector based drawing program), but just manage my collection of pictures.


title: Splitting a large binary file into sections determined by context patterns

text: I have a large (2GB) file that looks like this:               ^%%-=-=-=-=-=-=-=-=-=-=-=-=-=-%%^     <binary data>     ^%%-=-=-=-=-=-=-=-=-=-=-=-=-=-%%^      <binary data>     ^%%-=-=-=-=-=-=-=-=-=-=-=-=-=-%%^     <binary data>     ...      The `^%%-=-=-=-=-=-=-=-=-=-=-=-=-=-%%^` lines are separators. The binary segments are large. There are about fifty of them in the file. I am trying to extract the binary parts of this file. Each binary segment needs to go into its own file. I tried using `csplit`,               csplit --digits=2 --prefix=out stu.ear '/\^%%-=-=-=-=-=-=-=-=-=-=-=-=-=-%%\^/'      but received the following output and two `out??` files,               1     2097951144      Is there a tool for this job (a `csplit` implementation that works with binary files, perhaps?)


title: How to deal with a package "not upgraded" using aptitude?

text: I'm (still) on Debian Squeeze. When I try to upgrade the system, here's what I get:               [09:20]/root# aptitude upgrade     No packages will be installed, upgraded, or removed.     0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded.     Need to get 0 B of archives. After unpacking 0 B will be used.      Looking at the log, I get a hint at the name of the culprit package:               Aptitude 0.6.3: log report     Sat, Jun 22 2013 09:20:13 +0200          IMPORTANT: this log only lists intended actions; actions which fail due to     dpkg problems may not be completed.          Will install 0 packages, and remove 0 packages.     ===============================================================================     [HOLD] libxcb1     ===============================================================================          Log complete.      However, if I look at the package, I don't get any more details:               [09:21]/root# aptitude show libxcb1     Package: libxcb1     State: installed     Automatically installed: no     Version: 1.6-1     Priority: optional     Section: libs     Maintainer: XCB Developers <xcb@lists.freedesktop.org>     Uncompressed Size: 188 k     Depends: libc6 (>= 2.3.2), libxau6, libxdmcp6     Breaks: libxcb-xlib0     ...      I'm surprised by how little info `aptitude` is giving me about its refusal to upgrade the package. My question is: **What are the steps I should follow in this situation to find out why this package is not upgraded?** * * * **Update** : Here's the desired command:               $ apt-cache policy libxcb1     libxcb1:       Installed: 1.6-1       Candidate: 1.6-1+squeeze1       Version table:          1.6-1+squeeze1 0             500 http://security.debian.org/ squeeze/updates/main amd64 Packages      *** 1.6-1 0             500 http://debian.mirrors.ovh.net/debian/ squeeze/main amd64 Packages             100 /var/lib/dpkg/status


title: How to detect a working ttyUSB for my usb modem

text: I working with OpenWRT and need setup USB 3G Modem. When i connect USB modem i see in logs that system create four ttyUSB. Why four?               Tue Jul 29 07:45:23 2014 kern.info kernel: [  580.220000] usbserial_generic 1-1:1.0: The "generic" usb-serial driver is only for testing and one-off prototypes.     Tue Jul 29 07:45:23 2014 kern.info kernel: [  580.230000] usbserial_generic 1-1:1.0: Tell linux-usb@vger.kernel.org to add your device to a proper driver.     Tue Jul 29 07:45:23 2014 kern.info kernel: [  580.240000] usbserial_generic 1-1:1.0: generic converter detected     Tue Jul 29 07:45:23 2014 kern.info kernel: [  580.280000] usb 1-1: generic converter now attached to ttyUSB0     Tue Jul 29 07:45:23 2014 kern.info kernel: [  580.280000] usbserial_generic 1-1:1.1: The "generic" usb-serial driver is only for testing and one-off prototypes.     Tue Jul 29 07:45:23 2014 kern.info kernel: [  580.290000] usbserial_generic 1-1:1.1: Tell linux-usb@vger.kernel.org to add your device to a proper driver.     Tue Jul 29 07:45:23 2014 kern.info kernel: [  580.300000] usbserial_generic 1-1:1.1: generic converter detected     Tue Jul 29 07:45:23 2014 kern.info kernel: [  580.340000] usb 1-1: generic converter now attached to ttyUSB1     Tue Jul 29 07:45:23 2014 kern.info kernel: [  580.340000] usbserial_generic 1-1:1.2: The "generic" usb-serial driver is only for testing and one-off prototypes.     Tue Jul 29 07:45:23 2014 kern.info kernel: [  580.350000] usbserial_generic 1-1:1.2: Tell linux-usb@vger.kernel.org to add your device to a proper driver.     Tue Jul 29 07:45:23 2014 kern.info kernel: [  580.360000] usbserial_generic 1-1:1.2: generic converter detected     Tue Jul 29 07:45:23 2014 kern.info kernel: [  580.440000] usb 1-1: generic converter now attached to ttyUSB2     Tue Jul 29 07:45:23 2014 kern.info kernel: [  580.450000] usbserial_generic 1-1:1.3: The "generic" usb-serial driver is only for testing and one-off prototypes.     Tue Jul 29 07:45:23 2014 kern.info kernel: [  580.450000] usbserial_generic 1-1:1.3: Tell linux-usb@vger.kernel.org to add your device to a proper driver.     Tue Jul 29 07:45:23 2014 kern.info kernel: [  580.460000] usbserial_generic 1-1:1.3: generic converter detected     Tue Jul 29 07:45:24 2014 kern.info kernel: [  580.500000] usb 1-1: generic converter now attached to ttyUSB3      After this i know that modem is working. Therefore i setup network interface where i must select a working ttyUSB. But how can i know which ttyUSB is work? For each port i run               gcom -d /dev/ttyUSB0 info     gcom -d /dev/ttyUSB1 info     etc...      For find working port. But this method is not good because slow and hard to parse. I should write a bash script to detect working ttyUSB for my modem and put in network config. How can i do it? My router have only one USB port. Every USB 3G Modem use different ttyUSB port. PS. How can i imagine i can send some data to each port and check result. If result good, then use this ttyUSB.


title: Maximum Number of Entries in Crontab

text: If it exists, what is the maximum number of cron jobs (entries?) that can be added to a server's crontab? How do I tell? I'm on RHEL 6. I googled around, but did not see a conclusive answer -- some were 256, some 65K, some said limitless.


title: Make 'CTRL-/' behave the same in vtty and xterm

text: When I press `Ctrl`+`/` in a graphical terminal (e.g. xterm) I get "undo". However, in a virtual terminal (e.g. `Ctrl`+`Alt`+`F1`) I get "backspace". In practice I run into this when I'm using emacs in a virtual terminal, probably debugging some X problem, and I try to use `C`+`/` to undo but instead get a backspace. I believe I have experienced this on multiple computers over the years, so I don't think it's very specific to my current setup (ubuntu).


title: How to salvage a lvm/luks install from custom install

text: I was battling with setting up a Mint install on an encrypted hard-drive, and I think I partially succeeded. But I cannot boot the system because some configuration is not correct, and since I'm a Linux noob, I have no idea how to fix it now. The rough guidelines I followed was along the lines of http://blog.andreas- haerter.com/2011/06/18/ubuntu-full-disk-encryption-lvm-luks.sh The differences are that I partitioned with GParted. I'm also dual-booting with Windows, and I'm not using extra partition for /home.   * vg is on extended partition `/dev/sda4`, within logical partition `/dev/sda5`   * `/boot` in on primary partition `/dev/sda3`   * bootloader is on `/dev/sda` The install went good, I can mount the file-system as in script, from live DVD, but the script in chroot part failed, and the system doesn't boot... Can anyone tell me what do I have to do to allow boot to mount the encrypted partition? Is it enough to edit fstab and crypttab only? They seem to reside on the encrypted partition, so not readable by boot... If it's enough, what they should look like? Everything seems very confusing, and I cannot find a good source I could read about the problem... UPDATES: `fdisk -l /dev/sda`                  Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT     /dev/sda2          206848   209715199   104754176    7  HPFS/NTFS/exFAT     /dev/sda3       209715200   210763775      524288   83  Linux     /dev/sda4       210763776   625141759   207188992    5  Extended     /dev/sda5       210765824   567281663   178257920   83  Linux     /dev/sda6       567283712   625141759    28929024    7  HPFS/NTFS/exFAT      `pvs`               PV         VG   Fmt  Attr PSize   PFree     /dev/dm-0  mint lvm2 a-   170.00g    0       `pvscan`               PV /dev/dm-0   VG mint   lvm2 [170.00 GiB / 0    free]     Total: 1 [170.00 GiB] / in use: 1 [170.00 GiB] / in no VG: 0 [0   ]      `vgscan`               Reading all physical volumes.  This may take a while...     Found volume group "mint" using metadata type lvm2      `vgs`               VG   #PV #LV #SN Attr   VSize   VFree     mint   1   2   0 wz--n- 170.00g    0       `mount /dev/mapper/mint-root /mnt` + `cat /mnt/etc/fstab`               # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc            /proc           proc    nodev,noexec,nosuid 0       0     /dev/mapper/mint-root /               ext4    errors=remount-ro 0       1     # /boot was on /dev/sda3 during installation     UUID={uuidhre} /boot           ext4    defaults        0       2     /dev/mapper/mint-swap none            swap    sw              0       0      `cat /mnt/etc/crypttab` - manually edited               # <target name> <source device>     <key file>  <options>     lvm_crypt /dev/sda5 none luks      The tutorial for the reference in readable format: http://blog.andreas- haerter.com/2011/06/18/ubuntu-full-disk-encryption-lvm-luks SOLUTION: The post install update doesn't work in tutorial. You have to create the crypttab file manually, or fix it up before calling initramfs. I called everything except `intitramfs`, opened the `/mnt/etc/crypttab` with `nano`, patched the file, and then called `chroot` with `initramfs` only. Everything worked smoothly this way.


title: How can I determine the fs type of my current working directory?

text: I need a platform-independent and lightweight way of detecting the mount type of my CWD. Specifically, I need to determine if my CWD is in an SSHFS, NFS, CIFS, SMB, or local block store mount. I need to do this on Mac OSX 10.6, 10.7, and RHEL5 (at minimum). There's a possibility of using df, but df behaves quite differently on these two platforms. Plus, I'd have to CLI scrape its output with awk, which while workable is... fragile. This info must be available on some level. Is there a tool that I'm unaware of that could provide this information to me?


title: Directory locked!

text: I have been trying to install virtualbox using this command:               sudo apt-get install virtualbox.qt      But I am getting this error:               E: Unable to lock directory /var/cache/apt/archives/      I have been trying to find the answer here and have already tried:               sudo rm /var/lib/dpkg/lock     sudo dpkg --configure -a          sudo rm /var/lib/dpkg/lock         sudo rm /var/cache/apt/archives/lock          ps aux | grep apt     kill -9 processnumber      But none of them work.


title: Command to know privileges of a user group

text: If I run `cat /etc/group` command or `groups username` I am able to know the list of groups as group of a particular user.   * Is there any command through which I could know which type of privileges a group has?    * Which type of privileges are assigned to a particular user?    * Do all users of a particular group have the same privileges?


title: assigning a multiline variable (tcsh prompt) to another

text: For tcsh, I have a prompt that is multiline:               set prompt = "%/\\     %n@%m[%h]% "      This shows the cwd on one line and then the user/host on second line. However, with this, I cannot make a copy of that:               setenv X "$prompt"     Unmatched ".      The reason this is an issue for me, is that when I use virtualenv to create virtual environment for Python, it will automatically create an "activate" script, which as part of the script, it saves the current prompt and alters it to include virtual environment info. The prompt is restored, when the "deactivate" script is invoked. Is there a way to assign a multiline variable to another? I'm thinking I need to just give up on the multiline prompt, because I think I'll have problems, once the activate script is invoked, as I have aliases for updating the prompt (I got this a long time ago from someone). From my .cshrc file:               alias set_prompt 'set prompt = "%/\\     %n@%m[%h]% "'          alias cd 'cd \!*; set_prompt'          set_prompt      Is there any better way to do this, so that the prompt is updated when moving, but I can also use the activate script to alter the prompt? Here is a fragment from the automatically generated activate script for reference:               set _OLD_VIRTUAL_PROMPT="$prompt"          if ("" != "") then         set env_name = ""     else         if (`basename "$VIRTUAL_ENV"` == "__") then             # special case for Aspen magic directories             # see http://www.zetadev.com/software/aspen/             set env_name = `basename \`dirname "$VIRTUAL_ENV"\``         else             set env_name = `basename "$VIRTUAL_ENV"`         endif     endif     set prompt = "[$env_name] $prompt"      Thanks.


title: Look for English word in a file via terminal

text: How to find and print out English words contained in a file via linux command line?


title: How to export LD_LIBRARY_PATH to all users and system services

text: I want to export LD_LIBRARY_PATH to system services and all users. System services are run before login, so .bashrc is not applicable. How to achieve this?


title: lsof for a specific process?

text: There's a `bzip2` process running in the background and I have no idea where it came from. It's eating up a lot of resources. Can I do a reverse `lsof` to see which files are being accessed by this process? I've suspended the process for the time being.


title: How to remove a trailing CRLF from a file?

text: I have a binary file with a trailing CRLF (2 bytes total) that I want to remove. How should I do it? Please note that I'm using busybox and I don't have perl.


title: vboxdrv setup error in debian

text: I try to run this command in terminal and this error happened:               root@ali-lapdeb:/home/alireza# /etc/init.d/vboxdrv setup     Stopping VirtualBox kernel modules ...failed!       (Cannot unload module vboxdrv)      and this my dmesg output : http://codepad.org/GjMsU9Rp (I paste code here because i not allowed to enter this much code) What is this lines :               [ 9557.201022]  [<ffffffffa0ea8000>] ? 0xffffffffa0ea7fff     [ 9557.201076]  [<ffffffffa0e69f77>] ? supdrvInitDevExt+0x187/0x780 [vboxdrv]     [ 9557.201144]  [<ffffffffa0e72e7e>] ? VBoxHost_RTMemAllocTag+0xe/0x30 [vboxdrv]     [ 9557.201202]  [<ffffffffa0ea8000>] ? 0xffffffffa0ea7fff     [ 9557.201255]  [<ffffffffa0ea8094>] ? VBoxDrvLinuxInit+0x94/0x1000 [vboxdrv]     [ 9557.201311]  [<ffffffff81002162>] ? do_one_initcall+0x112/0x170     [ 9557.201358]  [<ffffffff810c6937>] ? load_module+0x1b07/0x23f0     [ 9557.201403]  [<ffffffff810c3530>] ? m_show+0x1c0/0x1c0     [ 9557.201443]  [<ffffffff810c734d>] ? SyS_finit_module+0x6d/0x70     [ 9557.201491]  [<ffffffff814ae4f9>] ? system_call_fastpath+0x16/0x1b      and what is my problem ? * * * linux debian testing,acer 5741G,               root@ali-lapdeb:/home/alireza# apt-cache policy virtualbox     virtualbox:       Installed: (none)       Candidate: 4.3.10-dfsg-1       Version table:          4.3.10-dfsg-1 0             500 http://ftp.debian.org/debian/ testing/contrib amd64 Packages          4.3.6-dfsg-2 0             100 /var/lib/dpkg/status     root@ali-lapdeb:/home/alireza# uname -a     Linux ali-lapdeb 3.13-1-amd64 #1 SMP Debian 3.13.7-1 (2014-03-25) x86_64 GNU/Linux


title: remove only specific text occurrences from string using sed

text: I have a text file that contains many rows of this sort of thing:               /*[17:51:27][1 ms]*/ UPDATE `country` SET `region_id` = '4' WHERE `country_id` = '36';       Is there a way that I can use `sed` to remove the comments _only_ , so that's everything that starts with a `/*` and ends with a `*/`? This would make the line become:               UPDATE `country` SET `region_id` = '4' WHERE `country_id` = '36';      I know how to use `sed` to remove an entire line that starts with something, in the example of a text file with SQL in it it would likely be a hash symbol `#`.


title: Cronjob to run every 30 minutes

text: I want to set a cronjob entry that runs a script every 30 minutes from 9:00 to 18:00 but I do not want it to run at 18:30. The script should run for the first time at 9:00 and for the last time at 18:00. Is this possible?


title: How do systemd and chkconfig interact with respect to services and runlevels?

text: I recently updated some of our machines to Fedora 17. I have noticed that there are some services that I can configure their runlevels using `chkconfig`, while others don't appear there at all, and can be configured using `systemctl`. For example, there are the similar commands `chkconfig network off` and `systemctl disable NetworkManager.service`. (I understand that `network` and `NetworkManager` are different, that's not the point.) Why are some services configurable via one tool and not the other? Does one tool replace the other? For example, runlevels are very obvious with `chkconfig`, but I can't even tell if that concept exists with `systemd`. Edit: I found a table that maps calls from chkconfig to systemctl


title: How to remember the difference between du and df?

text: `du` and `df` do rather similar things, and so I always find myself typing the wrong one. I think if I knew what "du" and "df" stands for it might make it easier to remember which to use. What is a way to differentiate between these two so I can remember which does which action?


title: Default applications (GNOME 3)

text: I'm trying to associate a custom application to a file type in GNOME 3 (FC15). In GNOME 2 one could go in the "Open with" pane of the file properties dialog and add a custom command there. The custom command edit box seems to have disappeared from the "Open with" pane in GNOME 3, so I was wondering if there is some workaround to manually assign the application. In other words, from which file/directory does GNOME pull out that application list? How do I add a custom one?


title: How to know if a pdf file is compressed or not and to (un)compress it

text: I just learned that pdf files can be compressed to reduce its disk size.   1. I was wondering how to know if a pdf file has already been compressed?   2. What applications/commands can be used to compress or uncompress a pdf file? My environment is Linux Ubuntu 10.10. * * * Some attempts don't give satisfactory results:   1. Here are the results of trying pdftk:              $ pdftk 3.pdf output 5.pdf uncompress      $ pdftk 3.pdf output 3comp.pdf compress      $ ls -l 3.pdf 3comp.pdf 5.pdf     -rwxrwx--- 1 root plugdev  8652269 2011-07-30 12:27 3comp.pdf     -rwxrwx--- 1 root plugdev  8652319 2011-07-29 22:15 3.pdf     -rwxrwx--- 1 root plugdev 16829828 2011-07-30 12:27 5.pdf      Properties of the files show that all of them are not optimized.   2. Results of converting to ps and then back to pdf:              $ pdf2ps 3.pdf 3.ps     $ ps2pdf 3.ps 3c.pdf     $ ls -l 3.pdf 3.ps 3c.pdf     -rwxrwx--- 1 root plugdev   8808946 2011-07-30 13:14 3c.pdf     -rwxrwx--- 1 root plugdev   8652319 2011-07-29 22:15 3.pdf     -rwxrwx--- 1 root plugdev 122375966 2011-07-30 13:14 3.ps


title: Monitoring file locks, locked using flock

text: I would like to get a list of pid's which hold shared lock on `/tmp/file`. Is this possible using simple command line tools?


title: $PATH not modified inside LXDE on Raspbian

text: I have a bin directory in home/pi. This is added to my $PATH when I login (by .profile), but when I go into LXDE and use LXTerminal my bin directory is no longer added to $PATH.


title: Set the MAC address for VLAN device

text: I created a VLAN device via NetworkManager in my Fedora 19. Also I need a specific MAC address, so I edit the `/etc/sysconfig/network- scripts/ifcfg-VLAN` and edit the `MACADDR=` variable. But this didn't work and after the reboot the MAC address of physical LAN is set in `ifconfig -a` for my new `vlan0` device. And I need to run `su -c 'ifconfig eth0 hw ether <MAC>'` to set the correct MAC. What's the problem with setting MAC in `/etc/sysconfig/network-scripts/ifcfg- VLAN` file?


I have been using Linux for years and have never really felt 100% confident with it. I have bought a couple of 'Linux' books and, each time, I am disappointed to read that they are aimed at more advanced users. I was about to buy 'Linux Administration: A Beginner's Guide' and, yet again, its introductory page says: > A part of the title of this book reads "A beginners Guide"; this is mostly > apt. But what the title should say is "A Beginner's to Linux Administration > Guide"...we assume that you are already familiar with Microsoft Windows > servers at a power user level or better. So, I am really struggling to find a book that is going to give me the introductory knowledge that is needed to fill in the basics before I go on to read the 'Beginning Linux books'. Perhaps one of the _Unix Classics_ , (whatever that might be). Just to give you an insight into my goals: I am not so interested in becoming a _system administrator_ , more of a _lead web developer_. So, **Which book would you recommend to gain enough foundation to learn Linux well enough to be a lead developer?** To make this question as objective as possible, in order to be a valid answer:   * it must be _a book_   * the introduction to the book should not say "we assume the reader is already a power user / experienced in linux / sys admin"    * by reading the book I'd be able to be suitably qualified to read "Linux Administration: A Beginner's Guide" **Update in response to:** Re: “This is like asking for a book that teaches you how to ride a bicycle.” If we were to use that analogy the one answer would be "The highway code". Because, although you might have learned to ride a bike in your backyard, its the kind of book you should read _before_ you go out onto the main roads. It does not require you to have had experience of cycling _before_ you read and understand it. It is not intended as a substitute for hands-on experience. And, by reading it, you avoid the need to run `man redtrafficlight` as you approach a junction. * * * The following are books which I have bought/considered buying, but discovered that they do not meet the criteria:   * Fedora Linux, Tyler   * Linux in a Nutshell,    * Beginning Ubuntu LTS Server Administration, Sander van Vugt   * Unix and Linux System Administration Handbook, Nemeth et al


title: Sound input issue with skype, selecting a microphone?

text: Ok, Skype yet again has issues with sound. This time, it is unable to record audio. The system is using PulseAudio and I am using a web cam as a microphone. Actually, I tried another web cam and had both plugged in at one point. lsusb shows the devices plugged in. Skype only allows selecting pulseaudio as the input device, with no other choices. Skype only seems to see the mic input on the analog sound card (which has no mic attached). I have tried using _KMix_ , the KDE _phonon dialog_ (hidden in _KMix_ 's menus), _alsamixer_ and even happened across _pavucontrol_. None seemed to be able to reorder the preference for device to use as the mic or at least select the desired mic. It could be a flaw in OpenSUSE 11.4, or I could just be missing something obvious. All would show that the webcam mic was available and allow me to set the input levels, for either webcam. How do I select the webcam mic?


title: Why use superflous dash (-) to pass option flags to tar?

text: To create a tar file for a directory, the `tar` command with `compress`, `verbose` and `file` options can be typed thus:               $ tar -cvf my.tar my_directory/      But it also works to do it this way:                $ tar cvf my.tar my_directory/      That is, without the dash (-) preceding the options. Why would you ever pass a dash (-) to the option list?


title: What does this message from kernel mean?

text: When I start VirtualBox, I got warning: `VirtualBox' uses 32-bit capabilities (legacy support in use)` It seems harmless though, but I still would like to know what that means? And why did I get that? I run a 64bit `Arch Linux` with Intel VT (i5 CPU), `VT enabled`. While checking 32bit files in /usr/lib/virtualbox, I got:               %> find . -type f -exec is32elf {} \;     ./VBoxDD2GC.gc     ./VMMGC.gc     ./VBoxDDGC.gc     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.amd64/VBoxEhciRC.rc     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.x86/VBoxPuelMain.so     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.x86/VBoxEhciR0.r0     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.x86/VBoxPciRawR0.r0     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.x86/VBoxVRDP.so     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.x86/VBoxEhciRC.rc     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.x86/VBoxEhciR3.so     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.x86/VBoxPciRawDrv.so     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.x86/VBoxUsbCardReaderR3.so     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/linux.x86/VBoxPciRawR3.so     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/solaris.x86/VBoxPuelMain.so     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/solaris.x86/VBoxEhciR0.r0     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/solaris.x86/VBoxVRDP.so     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/solaris.x86/VBoxEhciRC.rc     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/solaris.x86/VBoxEhciR3.so     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/solaris.x86/VBoxUsbCardReaderR3.so     ./ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack/solaris.amd64/VBoxEhciRC.rc      Maybe that can explain something?


title: How to install glibc.i686 using rpm with dependency resolved

text: I know that I can use `yum` to do that. But my problem is a little different. I want to write a `kickstart` post installation script so after installation of the OS as a post-installation step the glibc.i686 rpm is downloaded using `wget` and installed. The main OS being installed is x86_64. Hence I can't select the glibc.i686 package during installaion. Besides I can't use `yum` in the post-installation script because I think it would be too complicated. So I thought I get all the dependencies rpms and install them using `rpm`. But trying to find the dependencies, shows nss-freebl something rpm but when I try to install that package then it refers to glibc.i686 (i.e. we have a circular dependency). If I try to install both of them together in the same rpm command then it shows the list of dependencies. How can I resolve this?


title: How to print all the lines not containing a string along with adjacent lines?

text: I'm trying to wrap my mind around this task. I want from the following output, to exclude all the lines that contain `Auto-installed: 1` and the 2 lines before. I was naively thinking that `grep -v -B2 string` will solve the problem... needless to say, only makes it worse. This is the content:               Package: libopencore-amrwb0     Architecture: amd64     Auto-Installed: 1          Package: transfig     Architecture: amd64     Auto-Installed: 0          Package: xfig-libs     Architecture: amd64     Auto-Installed: 1          Package: xaw3dg     Architecture: amd64     Auto-Installed: 0      And this is how the results look:               Package: transfig     Architecture: amd64     Auto-Installed: 0          Package: xaw3dg     Architecture: amd64     Auto-Installed: 0      (note, empty lines are not showing, if it doesn't show empty lines is a plus but is not required, also results should include the Packages which Auto- Installed values is 0) I know I can match line breaks but either end in not printing anything or printing everything but the lines breaks in between. Any solution is acceptable, it doesn't have to be grep (it even can be emacs).


title: Is mainline Linux kernel capable of GPGPU programming?

text: The question is simple, is there general purpose GPU support in the Linux kernel? Let me explain in more details since it's too broad of a topic. By the word "capable" I mean native support. That crosses out OpenGL AND OpenCL as those are just APIs to help code applications in user mode. Some common misconceptions are that since super computers use GPGPUs and run Linux, then Linux use them. Well, not quite. The Linux distributions running on super computers are often times not the same as the ordinary distributions we know. They are so far modified that they're not Linux but a whole new operating system. Another famous answer might be the poor support of GPUs. Well, lets not go there and eliminate all other factors be it bottleneck or something else like architecture. Lets reword the question as follows: > Does the mainline Linux kernel natively utilize stream processing via > general purpose registers of a GPU? And if it is, to what extent?


title: How to separate Awesome's `rc.lua` configuration into multiple files?

text: I've just moved to Awesome WM from OpenBox. I like that it's very extensible, customizable and I have huge control about window layout. I like structured and organized things and I'd like to separate that huge `.config/awesome/rc.lua` configuration into multiple files. But I'm still newbie to Awesome and I've never used lua before.


title: Change the root filesystem on an embedded system

text: I'm using Buildroot to generate an embedded Linux with a kernel v. 2.6.39, which in the end starts busybox. Everything works fine when building with Initramfs as "rootfs". But Initramfs isn't the best for my needs, so i want to switch to other fs like SquashFS or even better not compressing it at all. Anyways i can't figure out how to tell the kernel it shall boot for instance the SquashFS file. What i do know, is that this is done by some kernel command line parameters. Unfortunately i can't find more about this with different search engines or here. And so it doesn't work. It always ends, as expected, with a kernelpanic. And how is it done if I haven't got it compressed and therefor it just has to be copied from Flash to RAM ?


title: Fedora 17, WebGL, intel integrated graphics

text: I have troubles with getting started WebGL in Google chrome. This is the info about my GPU from `about:gpu`:               GPU0 VENDOR = 0x8086 [Intel Corporation],        DEVICE= 0x0116 [2nd Generation Core Processor Family                        Integrated Graphics Controller]      I made some research and did checked enabled in `about:flags` the following properties:   * WebGL   * accelerated 2D canvas   * Override software rendering list Also I tried to start chrome with `-ignore-gpu-blacklist` but still WebGL and hardware acceleration is unavailable. I know that WebGL need OpenGL at least 2.0. Then I searched in repositories and found only two libraries which were seemed like what I need, I installed them, but still no result. What do I need to make it work ?


title: Weird graphics after fresh arch install on virtual box

text: I just installed arch on virtualbox to test it out but for some reason it's not displaying correctly ( here's how it looks: http://imgur.com/avbpxHE ) I'm using virtualbox version 4.2.16 Basically I just followed the beginner's guide and installed cinnamon after it was completed. I also enabled 3d support, assigned 128mb to video memory and followed the steps here https://wiki.archlinux.org/index.php/Virtualbox#Arch_Linux_guests to install the guest additions. I think the problem is that the guest additions aren't working correctly since I tried to use the shared clipboard functionality and it didn't work either, I'm not sure how to troubleshoot the problem at all can anyone give me some advise?


title: Errors during 32-bit glibc2.17 compile

text: I'm trying to compile the current glibc (2.17) from the official ftp on my machine (kernel 3.7.3). No patches or extras are applied. For x86_64 everything works fine, but I need the 32-Bit libs as well. According to the manual, I run this to configure (64-bit already installed):               ../../src/glibc-2.17/configure --prefix=/home/user/glibc32 --enable-kernel=3.7.3 BUILD_CC='gcc' CC='gcc -mx32' CXX='g++ -mx32'      At first, I got the error specified in the following line from pread.c and pwrite.c               #ifdef __NR_pread64   /* Newer kernels renamed but it's the same.  */     # ifdef __NR_pread     #  error "__NR_pread and __NR_pread64 both defined???"     # endif     # define __NR_pread __NR_pread64     //Match __NR_pwrite* for pwrite.c accordingly     #endif      That didn't make any sense to me, so i changed those to:               #ifdef __NR_pread64   /* Newer kernels renamed but it's the same.  */     # ifndef __NR_pread     #  define __NR_pread __NR_pread64     # endif     #endif      Now my error is swapon (misc/swapon.c) not matching the prototype (sys/swap.h):               int     swapon (path)         const char *path;     {         __set_errno (ENOSYS);         return -1;     }          stub_warning (swapon)      The prototype is:               /* Make the block special device PATH available to the system for swapping.     This call is restricted to the super-user.  */     extern int swapon (const char *__path, int __flags) __THROW;      This is clearly no match, but I have no idea, how to bypass this... There must have been people before me who have tried this and I cant imagine there being this kind of errors in a glibc release. What am i doing wrong? Should i continue these kind of "fixes"? I cant really just pass 0 as the second parameter, or can I?


title: What did I just kill?

text: Is there any way to find out what I just killed?               $ ps -A -o pid,cmd | grep someApp | grep -v grep     2802 python someApp.py     $ sudo kill 2302     $      **EDIT:** To clarify, I need to know what PID 2302 was before I killed it. The `ps` line is to give context as to how I killed 2302 when I don't even know what it was.


title: Creating links to websites

text: I'm using Ubuntu 12.04 and I would to create a folder with all of my shortcuts. Is it possible to create icons (like usual links to files in my harddisk) that automatically launch my browser and open a specific page? For example, I would like to have an icon on my desktop that automatically opens the StackExchange homepage. How can I do that?


title: Mount a USB disk in Linux which was not properly unmounted in Windows

text: I would like to know if there is a software solution in Linux for the following situation:   * Connect a USB disk to a Windows host (could be XP, Vista,7 , etc).   * Copy a big file to the USB disk.   * Disconnect the USB device in an unsafe way from Windows   * Connect the USB device to a Linux host   * Try to mount the USB device The result is that the USB disk will not mount in Linux, since it contains an open file. One way to solve this would be to reconnect the USB disk to Windows and dismount safely and then mount the USB disk to Linux. Is there a way to solve this problem, using only Linux tools, without involving Windows to close the USB disk properly.


title: CrunchBang & Openbox: no reaction to laptop power button pressed

text: I've just installed #! and I'm loving the customizable Openbox DE. However, when I press the power button on my laptop, the system doesn't react. For example, when I was using Debian & Gnome, and when I pressed the said button, Gnome displayed a dialog box asking me whether I want to shutdown etc. The mentioned dialog box also appears when I go to `menu->exit` in Openbox. Question: How can I bind the shutdown button to `Openbox->exit`? Some info: `xev` + shutdown button says:               KeymapNotify event, serial 46, synthetic NO, window 0x0,         keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0                   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0


title: Use all system memory in Solaris

text: I am doing server testing and intentionally trying to crash a virtual Solaris server by using all memory. Server has a ulimit of 15 GB (several hundred GB of total system/swap memory). Is there a straight forward way of doing this using a shell/Perl script? (This is in a hardened/secured environment so the only accessable tool is Perl [and shell of course]). Background: What is actually being tested is failover of essential processes to another server. Lately we have been having a number of processes "go out of control" and consume all system resources thus causing server to crash (separate issue). I am trying to create a simple repeatable scenario to test the response to this situation.


title: how do I get numbers from this command

text: I am doing a geocache in Arizona. The Linux code for the coordinates are written as               -w-rw---x  r---wxrwx      any 2 can be substituted for a 9. The false coordinates are N 33 27.000 W 112 20.000 so it should be close to this. Is there an emulator I could use to get this calculated?


title: How can I kill a job that was initiated in another shell (terminal window or tab)?

text: If I begin a process and background it in a terminal window (say `ping google.com &`), I can kill it using `kill %1` (assuming it is job 1). However if I open another terminal window (or tab) the backgrounded process is not listed under `jobs` and cannot be killed directly using `kill`. **Is it possible to kill this process from another terminal window or tab?** Note: I am using the Xfce Terminal Emulator 0.4.3 and bash (although if a solution exists in another common shell but not bash I am open to that as well)


title: How to convert *text* to {\i text} with sed?

text: I would like to replace every occurrence of *text* into {\i text}.               text *text* text     *text* text *text*     *text text text* text      should become               text {\i text} text     {\i text} text {\i text}     {\i text text text} text      etc. How can I do this?


title: Host reachable via SSH from my desktop but not my laptop

text: I try to use `ssh` to log in to a remote host. This works for my Ubuntu desktop, however, it fails from my Fedora 14 laptop. The failure means after I type `ssh username@host` and pressed `Enter`, nothing else shows on my screen. And using `ping` on the desktop works fine, however nothing returned on my laptop. It seems that the host is not reachable from my laptop. Both machines are in the same network environment (they share the same home router), except the desktop uses wired connection while the laptop uses wireless. Besides the host files on both machines have no entry for the host name I want to reach. Have anyone encountered this kind of error? Any idea?


title: Make firefox command run downloaded firefox instead of iceweasel

text: I have downloaded Firefox, but when I run `firefox` in `Alt+F2` (Gnome 3.4.2), Iceweasel runs instead. I used the `type` command to find the file apparently responsible for this:               #!/bin/sh          FIREFOX="$(which $0)"     [ -x "$FIREFOX.real" ] && exec "$FIREFOX.real" "$@"          exec iceweasel "$@"      An easy solution is to replace the last line with:               exec [location of downloaded firefox] "$@"      Is there another way to make it so that `firefox` runs my downloaded copy of firefox instead of `iceweasel`?


title: How does clear command work?

text: I was recently trying to learn more about how the shell works and was looking at how the `clear` command works. The executable is located in `/usr/bin/clear` and it seems to print out a bunch of blank lines (equal to the height of the terminal) and puts the cursor at the top-left of the terminal. The output of the command is always the same, regardless of the size of the terminal:               $ clear | hexdump -C     00000000  1b 5b 48 1b 5b 32 4a                              |.[H.[2J|     00000007      and can be replicated with the echo having the exact same effect:               $ /bin/echo -e "\x1b\x5b\x48\x1b\x5b\x32\x4a\c"      I was really curious how this output of this command translates to clearing the console.


title: How to stop Rainlendar from hiding on the Linux Mint desktop?

text: Rainlendar is a great tool to keep events and tasks on the desktop (I did not find a better solution yet). The problem is that the application completely hides if you press:   * The "Show Desktop" button of Mint's panel (taskbar)   * `Special-Key + d` / `CTRL + ALT + d` Possible Rainlendar position settings:   * _On Top_ - Does not work   * _Normal_ - Does not work   * _On Bottom_ - Does not work   * _On Desktop_ - With this option, the application won't hide, but would be on top of every window. So this isn't really a solution. **Is it possible to prevent Rainlendar from hiding or is there at least a command to show Rainlendar again (at the moment I have to kill the process and start it again) or any other solution?** I'm using:   * Linux Mint 15 "Olivia" with Cinnamon 1.8.8   * Rainlendar 2.11.1 Everything is up-to-date at the moment.


title: How to create multiple tar files with bash script and use date as file names?

text: I have a lot of files and want to create an archive for every 100 files i.e. the first 100 files are in one tar file, and the 101st to 200th files are in another tar file. And I want to use the date (nanoseconds) as tar names. I have got something like this:               ( cd "${SOURCE_DIR}" && find . -type f -name "${FILE_GLOB}" ) |        xargs -n 100 | xargs -I % sh -c '{tar -C "${SOURCE_DIR}" --files-from - % -cf "${DESTINATION_DIR}/$(date '+%Y%m%d%H%M%S%N')-$(uname -n).tar~"}'      Now the problem is, the '%' in date format string will accept argument from `xargs`, which I do not want. How can I prevent this from happening?


title: Multiple installed versions of git - centos

text: I manually installed git 1.6 a year or two ago. I noticed today that the 1.7 version is available in yum, and installed it (package git-all) I now get the following output:               [root@ovz5197 ~]# git --version     bash: /usr/local/bin/git: No such file or directory     [root@ovz5197 ~]# which git     /usr/bin/git     [root@ovz5197 ~]# /usr/bin/git --version     git version 1.7.4.1     [root@ovz5197 ~]#       Any idea why the output of `which` seems to contradict the first line above?


title: How do you protect a plain text credentials file with the username and password?

text: I am trying to setup an auto-mounting network drive. The network drive requires a user/pass. In the man page for "mount.cifs" there are two ways to provide the user/pass.   1. [not recommended] put the user/pass in /etc/fstab   2. create a separate credentials file and put the user/pass in the credentials file "[option 2] is preferred over having passwords in plaintext in a shared file, such as /etc/fstab. **Be sure to protect any credentials file properly.** "   * My background is: software developer, lots of linux software development (installing development libraries, installing applications like Eclipse, or java). I am not an IT or sysadmin guy.    * This is on my own development machine **Given my lack of IT/sysadmin background, what is the standard suggested method for "protecting any credentials file properly"?** (I would also appreciate, if there are multiple methods for protecting the credentials file, to please list in order of most common to least and describe the tradeoffs.)


title: How can I use grep to search a file for string combinations?

text: What I'm trying to do is use grep to search my Apache logs. What I want is to find is every entry from a certain IP address that also has .html or .php in the line. In other words, I want to see what pages they've accessed without all of the Javascript, CSS, and images included. I know I can search for the lines with the IP address with `grep '123.123.123.123' logfile` but how I can add to the pattern so that it will only match lines that include the IP address, and '.php' or '.html'?


title: How to choose LUKS encryption when installing RHEL 6?

text: With the default RHEL 6 installer, how can I choose the LUKS encryption? Afaik if I prepare the disk like               cryptsetup luksFormat -c cast5-cbc-plain -s 128 /dev/$DEVICE      could be the "fastest" encryption, but the installer only prompts for password, then later, at the partitioning it recognizes it as "unknown" partition. UPDATE: so in short, I just want to speed up io with using the mentioned faster encryption (? are there faster/but still ""secure""?) with the default install. How can I don it? **UPDATE#2: what would be the fastest encryption that can be still used in the default GUI install??**


title: Work out the link count of inode number?

text: How can I work out the link count of an inode number? If I know the inode number is, say, 592255 - what workings out can I do to find out the link count? I know directories have a link count of at least 2, but don't know how to work it out.


title: KVM Domain not creating

text: While I am trying to create a new KVM Machine , I am getting the following error ,               Unable to complete install: 'Domain has not existed.  You should be able to find more information in the logs'          Traceback (most recent call last):       File "/usr/share/virt-manager/virtManager/asyncjob.py", line 44, in cb_wrapper         callback(asyncjob, *args, **kwargs)       File "/usr/share/virt-manager/virtManager/create.py", line 1910, in do_install         guest.start_install(False, meter=meter)       File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 1223, in start_install         noboot)       File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 1303, in _create_guest         self._consolechild) = self._wait_and_connect_console(consolecb)       File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 1328, in _wait_and_connect_console         raise RuntimeError(_("Domain has not existed.  You should be "     RuntimeError: Domain has not existed.  You should be able to find more information in the logs      **NOTE:** I am getting this error while I am trying to use custom Storage pool that is , `/dev/sdaXX/` mounted on `/vmstore` mount point & image file path `/vmstore/disk.img` ERROR_LOG               2014-03-24 21:06:48.178+0000: 7166: error : virNetSocketReadWire:1194 : End of file while reading data: Input/output error     2014-03-24 21:07:56.242+0000: 7170: warning : qemuSetupCgroupForVcpu:566 : Unable to get vcpus' pids.     2014-03-24 21:07:56.329+0000: 7166: error : qemuMonitorIO:614 : internal error End of file from monitor     2014-03-24 21:16:04.269+0000: 7167: warning : qemuSetupCgroupForVcpu:566 : Unable to get vcpus' pids.     2014-03-24 21:16:04.344+0000: 7166: error : qemuMonitorIO:614 : internal error End of file from monitor     2014-03-24 21:16:24.361+0000: 7167: warning : qemuSetupCgroupForVcpu:566 : Unable to get vcpus' pids.     2014-03-24 21:16:24.436+0000: 7166: error : qemuMonitorIO:614 : internal error End of file from monitor


title: automated script to transfer live linux root?

text: is there a script that can make a bootable copy of the currently running live (ubuntu) root partition from a booted hard disk to another (then bootable) hard disk and/or bootable USB flash disk? such a script would have to do a "cp -a" for the relevant files, fix the /etc/fstab for the root uuid, warn about other auto partitions in /etc/fstab, do whatever magic may be needed for device/sys/proc files (if any), and install grub2. for the grub selection, some prompts would be nice (such as 'add to current grub for choice at boot time' or 'install grub on new device as boot and allow removing of original disk'). presumably, after the script has finished, I could then disconnect the original root disk and boot its replacement. I apt-got partimage, but it does not recognize a btrfs. fsarchiver seems like a better choice. http://www.fsarchiver.org/QuickStart , but it seems more like a "cp -a" replacement (so are various rsync and tar based methods). dd is obviously a bad idea on a mounted root. (on OSX, SuperDuper does live partition-to-partition quite nicely. the OSX boot "alt" key can then discover the new partition and boot it. no need for grub.) advice appreciated. /iaw PS: this is not a question on generic backup. it is related to the by-hand instructions at Debian/Grub2: Moving root partition to new drive? .


title: Can I mirror lo as eth0?

text: Is it possible to make eth0 point to lo? I have dumb process that keeps acting as eth0 exists while it doesn't.


title: Debug out-of-memory with /var/log/messages

text: The following report is thrown in my messages log:               kernel: Out of memory: Kill process 9163 (mysqld) score 511 or sacrifice child     kernel: Killed process 9163, UID 27, (mysqld) total-vm:2457368kB, anon-rss:816780kB, file-rss:4kB      Doesn't matter if this problem is for `httpd`, `mysqld` or `postfix` but I am curious how can I continue debugging the problem. How can I get more info about why the PID 9163 is killed and I am not sure if linux keeps history for the terminated PIDs somewhere. If this occur in your message log file how you will troubleshoot this issue step by step?               # free -m                       total       used       free     shared    buffers     cached     Mem:          1655        934        721          0         10         52     -/+ buffers/cache:        871        784     Swap:          109          6        103`


title: Bash script for scp interpreting tilde (~) too soon

text: So, I just started a new C++ class that requires me to program in a Linux environment. I don't have Linux installed on my machine, but I do have OS X and I can ssh into a linux machine in the lab at school (and this is preferable since my code must compile and run on the lab machine regardless of whether or not it works on my machine). If you can't tell by the end of this question, I am not incredibly familiar with Linux. I will frequently need to take files that I download onto my local machine and put them on the remote machine, edit them to make the program, and then put them back onto my local machine to upload them to our dropbox. I got tired of typing   `scp -P xx user@remote.host.com:~/filename filename`   and decided to make an alias to do this. That's when I discovered aliases don't handle this kind of thing, so I decided to write a shell script instead. Here's what I've got:               #!/bin/bash          # Author: me     # Created 26 August 2014     # transfers a file from remote machine to current directory in local machine     # keeps same filename          location="$1"     # name gets just the part of the path after the last slash     # ie the filename     name="$(echo "$1" | sed -n -e 's/^.*\///p')"     # echo "$location"     # echo "$name"     scp -P xx user@remote.host.com:"$location" "$name"      Theoretically, I can just type `get ~/path/to/filename` and it will get the file from the remote host and copy it (with the same filename) into the current directory on the local machine. That scp command, if run from the command line, works great. When I stick it in a shell script, it breaks. It gives me the error: `No such file or directory` After a lot of testing (you can see some commented out debugging output up there) and researching, I found that the shell is expanding `~` _before_ it sends it to the script (well, this is my guess based on what I found out about globs). My script is then looking for the file in the path of my _local_ machine's home folder instead of the _remote_ machine's home folder. How do I make it stop doing that? I realized while typing this question that I probably just need some quotes when I run the command... but I really don't want to do that. Can I fix this somehow without having to type `get "~/filename"` because having to type those quotes is really annoying. Sorry if there's a lot of extraneous info but I figured too much is better than too little. Thanks! PS: I already found this about configuring ssh. While useful, I would still have to type the exact filename twice, which does not allow me to be as lazy as I want to be.


title: Do I need to worry about "tail: unrecognized file system type 0xbeefdead"?

text: I'm trying to follow a regular text file with `tail -f -n 50 filename`. I get the information from the file just fine, except I always get this error message: > tail: unrecognized file system type 0xbeefdead It happens on every file. The `0xbeefdead` worries me -- it looks like a hacker tag.               $ tail --version     tail (GNU coreutils) 8.4


title: Scripting - Folders with spaces

text: I'm trying to write a script that's robust enough to work with spaces. Its currently in a for loop, but the problem I'm having is folders with spaces in its name.               ASOURCE="Home Photos 2012 camcorder" #example filename     if [ -d "$(echo $ASOURCE)" ] # If directory exists     then     #command     else     echo "File does not exist: " $1 #Error     echo "DIR :" $(echo $ASOURCE | sed 's/\ /\\ /g')     fi      It fails on the the verification. I've tried pre-escaping the spaces, but to no avail


title: Set up network with static IP and wpa_supplicant on Debian

text: On Debian, I am trying to set up my network to use ad-hoc mode with a static IP address. I also want wpa_supplicant to be running so that I can scan use it to scan for WiFi networks in range. To get the ad-hoc network with static IP address working I modified the `/etc/network/interfaces` file so that it looks like this:               auto lo     iface lo inet loopback     iface eth0 inet dhcp          auto wlan0     iface wlan0 inet static       address 192.168.1.1       netmask 255.255.255.0       wireless-channel 1       wireless-essid MyNetworkName       wireless-mode ad-hoc      But with this configuration, if I try to access `wpa_supplicant` using `wpa_cli` I get an error which indicates that wpa_supplicant is not running. Is there something I can add to this configuration that will allow wpa_supplicant to start up but not be used to connect up to a network? I suppose I could just use `iwlist scan` to find the list of available wireless networks in range... but I already have my parsing setup for the output of `wpa_cli scan_results` :)


title: Execute a command on user logon

text: In Linux desktop system, I want to execute a command when the user logs in. After reading some other posts, I tried to insert the command in `~/.bashrc` but unsuccessfully. Moreover, the system uses a graphic interface for the user login, so the command should not be related to the start of a shell. I also tried to append the command to one of the scripts contained in `/etc/profile.d` with no results. Is there another way to do this? Any file that the system reads after the login?


title: parsing through log file and printing out regex backreferences

text: I want to parse my /var/log/maillog to print out the email addresses in "from=<>" and "to=<>" (mainly to do a quick check for false positives in the DNS RBLs that I've configured) A maillog entry looks like this (postfix):               Jun 20 17:27:52 foobarserver postfix/smtpd[15925]: NOQUEUE: reject: RCPT from sbr.nouveauquebec.com[184.22.154.110]: 554 5.7.1 Service unavailable; Sender address [corporate@nouveauquebec.com] blocked using urired.spameatingmonkey.net; Red listed, see http://spameatingmonkey.com/lookup/nouveauquebec.com; from=<something@spam.com> to=<foo@foo.bar> proto=ESMTP helo=<sbr.nouveauquebec.com>      and my regex is               from=<(\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b)> to=<(\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b)>      I'm storing the matches in back references \1 and \2 which I want to print out. What I want to do is pipe the output from `cat /var/log/maillog` and apply the regex on each line and output the backreferences. Is there a quick way to accomplish this?


title: Negatives of running processes with real-time priority?

text: The question is as the title says, are there any downsides of running processes with real-time priority (`chrt -f 99`)? My hypothesis is that this combined with an affinity will ensure that any pre- emption of my process is minimal and therefore any jitter (specifically network latency) will be minimised - this will not help with overall latency, but at this moment I'm more concerned with jitter. (Kernel: 2.6.16/3.0)


title: List of top level folders with contents no younger than 30 days

text: I have an automated system for creating FTP accounts (vsftpd with jailed virtual users) that works well, but I still rely on manual cleanup of stale accounts. My definition of a stale account is one in which no files or folders exist that are less than 30 days old. So far, I can run this:               find /home/vsftpd -ctime +30 |awk -F'/' '{print $4}' |sort -u       Which will give me a list of folder containing _at least one_ file older than 30 days. I could also run with `-ctime -30` and, with some heavy looping, negate that list to get me the information I need. I'm hoping there's a way to do this as a (moderately sensible) one-liner, but my find-foo fails me at this point. Can anyone help?


title: HDD allocation fstab

text: In my PC running Ubuntu 12.04 LTS I have installed three SATA hard drives. Two of them are installed near a cooler. I want to physically switch two drives (one that is not near the fan should be moved near the fan). How would Ubunutu deal with the switch? The device names in fstab, are they in any way relying on the sata port that they are connected to on my motherboard? EDIT: This is my /etc/fstab               # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc                                       /proc             proc  nodev,noexec,nosuid  0  0       # / was on /dev/sda1 during installation     UUID=f04e6038-4412-46c4-b58d-67bfe3f8eddd  /                 ext4  errors=remount-ro    0  1       # /Volumes/Backup was on /dev/sdb1 during installation     UUID=dc25bafb-adbc-4a65-845c-02c9253a795e  /Volumes/Backup   ext4  defaults             0  2       # /Volumes/Storage was on /dev/sdc1 during installation     UUID=74867f3e-acda-4efc-a6aa-7d21484d64a4  /Volumes/Storage  ext4  defaults             0  2       /dev/sdc2                                  /Volumes/Storage  ext4  defaults             0  0       #/dev/sdc1                                  /media/sdc1       swap  sw                   0  0      /dev/sdc1        none        swap        defaults        0        0       EDIT (changed /etc/fstab according to comments):               # /etc/fstab: static file system information.     #     # Use 'blkid' to print the universally unique identifier for a     # device; this may be used with UUID= as a more robust way to name devices     # that works even if disks are added and removed. See fstab(5).     #     # <file system>                            <mount point>             <type>  <options>            <dump>  <pass>     proc                                       /proc                     proc    nodev,noexec,nosuid  0       0       UUID=f04e6038-4412-46c4-b58d-67bfe3f8eddd  /                         ext4    errors=remount-ro    0       1       UUID=dc25bafb-adbc-4a65-845c-02c9253a795e  /Volumes/Backup           ext4    defaults             0       2       UUID=74867f3e-acda-4efc-a6aa-7d21484d64a4  /Volumes/Storage          ext4    defaults             0       2        UUID=88ee73e8-7556-40fa-b696-fbc15161036b  none                      swap    defaults             0       0


title: Why is vim creating files with DOS line endings?

text: I have               set fileformat=unix      in my .vimrc, and yet if I create a file in vim (running in Cygwin) it persists in creating DOS files, and I have to run the little cotton-pickers through dos2unix to clean them. (I guess I don't really _have_ to, since Git cleans them up for me, but it just bugs me to death that a Unix text editor, which I've specifically instructed to use Unix line endings is polluting them with extra garbage.) Why would this happen? How can I fix it? (And by "fix" I do _not_ mean something that requires me to convert each file individually. That's not a fix. That's what's totally broken.)


title: Ubuntu 10.04 bad install...now Mac won't boot

text: I've been having a problem all day. It all started when I tried to partition my HD to install Ubuntu with bootcamp on my mac. The install froze and when I restarted the Apple logo was replaced with a "do not enter" sign (circle with slash). I've been searching forums for a solution and even tried to run a LiveCD but that failed. I think I need to remove GRUB from my MBR. Anyone have some suggestions/help? Much appreciated.


title: How to display xclock on another computer?

text: I want to display `xclock` on another computer. On my computer (`111`) I am able to `ping` the other computer (`222`) inside my home network:               $ ifconfig wlan0     wlan0     Link encap:Ethernet  HWaddr 44:55:66:77:88:99                 inet addr:192.168.0.111  Bcast:192.168.0.255  Mask:255.255.255.0     $ ping 192.168.0.222      The router is a D-Link DIR-655 Wireless N Gigabit Router.               $ xclock -display 192.168.0.111:0      Displays the `xclock` on my computer (`111`) as expected. On the other computer (`222`):               $ xhost +      But then back on my computer (`111`) it also displays on my computer when changed to:               $ xclock -display 192.168.0.222:0      To attempt to verify the use of the `-display` switch:               $ xclock -display 192.168.0.111:0.1     Error: Can't open display: 192.168.0.111:0.1     $ ping 192.168.0.333     ping: unknown host 192.168.0.333     $ xclock -display 192.168.0.333:0      I would expect it to fail but it also displays on my computer (`111`) but with a bit of a delay. These results tells me that the `display` argument is getting to `xclock`.               $ uname -a      Linux mycomputer 3.2.0-27-generic #43-Ubuntu SMP Fri Jul 6 14:46:35 UTC 2012 i686 i686 i386 GNU/Linux      I am using LXDE rather than GNOME or KDE. I am only attempting to get `xclock` to display and am not interested in addressing security issues in this question.


title: Sound not working in Debian except in google chrome and test utilities

text: Yesterday, I had Archlinux on my Dell Latitude E6520 and the sound was working perfectly fine (I even had the loud beep I couldn't get rid of). Today, I installed Debian and alsa. The first surprise was that in alsamixer, I had half as many playback devices shown... I unmuted them and it somehow worked - at least when I had my headphones plugged in. But after trying to make the sound work on Heroes of Newerth, I tried on Chromium (a game I had installed thinking it was the browser T.T) and it didn't have sound either... Now the odd part is that I'm listening to music on Google chrome while writing this message... The output of this first command looks to me like the one I had on Archlinux:               lspci -v |grep Audio     00:1b.0 Audio device: Intel Corporation Cougar Point High Definition Audio Controller (rev 04)     01:00.1 Audio device: nVidia Corporation Device 0e08 (rev a1)      But when I use `alsamixer` and press `F6` (Select sound card), I only have 3 choices:               - (default)     0 HDA Intel PCH       enter device name...      Whereas I'm quite sure I had a fourth one under Archlinux. I tried to install this http://www.dell.com/support/drivers/us/en/19/Product/latitude-e6520?s=dhs But apparently it doesn't work... Not that I expected it to work, it's intended for Ubuntu...               sudo dpkg -i alsa-driver-hda-krug-ubuntu-audio-dev-dkms_2.6.35.22.20110103_all.deb     (Reading database ... 129240 files and directories currently installed.)     Preparing to replace alsa-driver-hda-krug-ubuntu-audio-dev-dkms 2.6.35.22.20110103 (using alsa-driver-hda-krug-ubuntu-audio-dev-dkms_2.6.35.22.20110103_all.deb) ...          ------------------------------     Deleting module version: 2.6.35.22.20110103     completely from the DKMS tree.     ------------------------------     Done.     Unpacking replacement alsa-driver-hda-krug-ubuntu-audio-dev-dkms ...     Setting up alsa-driver-hda-krug-ubuntu-audio-dev-dkms (2.6.35.22.20110103) ...     Loading new alsa-driver-hda-krug-ubuntu-audio-dev-2.6.35.22.20110103 DKMS files...     First Installation: checking all kernels...     Building only for 2.6.32-5-amd64     Building for architecture amd64     Building initial module for 2.6.32-5-amd64          Error! Bad return status for module build on kernel: 2.6.32-5-amd64 (amd64)     Consult the make.log in the build directory     /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/ for more information.      Here is the content of the make.log:               /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build$ ls     dkms.conf    hda_codec.o    hda_hwdep.c  idt90.patch  patch_analog.c  patch_cirrus.o    patch_hdmi.c     patch_si3054.o     hda_beep.c   hda_eld.c      hda_intel.c  Kbuild       patch_analog.o  patch_cmedia.c    patch_hdmi.o     patch_sigmatel.c     hda_beep.h   hda_eld.o      hda_local.h  Kconfig      patch_ca0110.c  patch_cmedia.o    patch_realtek.c  patch_sigmatel.o     hda_codec.c  hda_generic.c  hda_proc.c   Makefile     patch_ca0110.o  patch_conexant.c  patch_realtek.o  patch_via.c     hda_codec.h  hda_generic.o  hda_proc.o   make.log     patch_cirrus.c  patch_conexant.o  patch_si3054.c   patch_via.o     xavierm02@xavierm02-D-L:/var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build$ cat make.log     DKMS make.log for alsa-driver-hda-krug-ubuntu-audio-dev-2.6.35.22.20110103 for kernel 2.6.32-5-amd64 (amd64)     Thu Aug  2 17:17:56 EDT 2012     make -C /lib/modules/2.6.32-5-amd64/build M=/var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build modules     make[1]: Entering directory `/usr/src/linux-headers-2.6.32-5-amd64'       CC [M]  /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/patch_analog.o       CC [M]  /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/patch_ca0110.o       CC [M]  /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/patch_cirrus.o       CC [M]  /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/patch_cmedia.o       CC [M]  /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/patch_conexant.o       CC [M]  /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/patch_hdmi.o       CC [M]  /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/hda_eld.o       CC [M]  /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/patch_sigmatel.o       CC [M]  /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/patch_realtek.o       CC [M]  /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/patch_si3054.o       CC [M]  /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/patch_via.o       CC [M]  /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/hda_codec.o       CC [M]  /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/hda_generic.o       CC [M]  /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/hda_proc.o       CC [M]  /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/hda_hwdep.o     /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/hda_hwdep.c: In function ‘parse_hints’:     /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/hda_hwdep.c:435: error: implicit declaration of function ‘skip_spaces’     /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/hda_hwdep.c:435: warning: assignment makes pointer from integer without a cast     /var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/hda_hwdep.c:450: warning: assignment makes pointer from integer without a cast     make[4]: *** [/var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build/hda_hwdep.o] Error 1     make[3]: *** [_module_/var/lib/dkms/alsa-driver-hda-krug-ubuntu-audio-dev/2.6.35.22.20110103/build] Error 2     make[2]: *** [sub-make] Error 2     make[1]: *** [all] Error 2     make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-5-amd64'     make: *** [all] Error 2      * * * I don't think the driver on the dell website is the way to go since I didn't use it to get everything working on Archlinux but I'm not sure at all. Another thing I think I did on Archlinux is install a package with a really long name that (maybe) had something to do with audio and had me use `uname -r` to know which one intall. I went through my whole history and couldn't find where I found out I had to install this... Neither could I recall the name of the package... But I'm quite sure it had something to do with alsa... (because the only other thing it could've been is something about nvidia and I installed nvidia with a downloaded tar.gz...) By the way, `uname -r` returns `2.6.32-5-amd64`. I have pulseaudio installed. PS: Sound only works with headphones at the moment, but that's not the biggest issue. PS 2: Sound works in Mumble if I set the output to ALSA. Setting the sound to ALSA in HoN won't change anything. And Chromium doesn't give you any kind of choice. In case it somehow matters, HoN is launched in another instance of the X server on :1 whereas the rest remains on :0.


title: login scenario and root ssh access block

text: I'm kinda new to linux so bear with me. I followed a tutorial on how to grant root access to other users and what I did was, in `/etc/passwd/` I changed the other users' uid/gid to `0:0`. The problem is that once I block ssh access to user root by changing `PermitRootLogin` to no in `sshd_config`, all other users that share the `0:0` uid/gid also loose access via ssh to the box. Help please..., or guide in right path to achieving this... **_the box does not have internet access, so, installing sudo/sudoer to manage users it's not possible_**


title: How to simulate user interaction when running another script

text: I am new to shell scripting. When I want to run a bunch of Linux commands I do fine, but how do I give user input when another script is called and asks for input while it runs. Here is the situation where I am stuck. I install the same server setup in classrooms frequently so I want to completely automate it.               #!/bin/bash     sudo apt-get install python -y     sudo apt-get install python-m2crypto -y     sudo apt-get install git-core -y     git clone https://github.com/learningequality/ka-lite.git     cd ka-lite/     ./setup_linux.sh          #the script works until here     #now, while the setup script is running, the following needs to happen     #I need to press enter twice     #enter the password twice     #press enter twice     #press y and then enter          #here are some things I tried, none of them worked     send "yes\n"     send "yes\n"     #echo | <Press [enter] to continue...> #enter     #echo | <return> #enter     Password8 #password     Password8 #password     echo | <yourfinecommandhere> #enter     echo | <return> #enter     y


title: How do I configure logging for ulimits?

text: I was wondering if anything gets logged when any ulimits are hit (open files, etc). If so, where is this logged, and what should I be looking for? I'm using CentOS 6.


title: What is the difference between tput's 'setf' and 'setaf'?

text: The command `tput` has two different options for setting color, `setf` and `setaf`, yet both of them seem to work just fine on my computer:               $ tput setf 2 && echo 'Hello world!'     $ tput setaf 2 && echo 'Hello world!'      There seems to be a similar duality with `setb` and `setab`. What is the difference between the two options?


title: How to debug/audit which devices cache writes?

text: I store documents on btrfs partition built upon sparse dm-crypt device located on ext4 main partition on physical harddrive. When kernel panics (and this happens on daily basis on my ASUS P53E with 3.6 kernel :-( ) I loose recently modified files (always the files' contents got replaced with zeros). One way of preventing damage to files it is to disable the write cache. For this I would need to disable write caching for the btrfs partition, the dm-crypt device that backs the partition, and for the sparse file where dm- crypt device lives.   1. How can I check the cache-write status for the drives?   2. How can I disable it? I use Mint 13 Maya with 3.6.8 mainline kernel.


title: Convert image of a partition into image of a disk with partition table

text: I have an image of an existing partition generated with `dd if=/dev/sdXN of=image.bin`. Now I want to use this image as the basis for a virtual machine. I know how to convert the image into a format that VirtualBox can use. The problem is that the "disk" image is really just the image of one partition and thus does not contain an MBR or a partition table. This makes it very hard to boot the VM. Is there a simple way, given an image of a partition, to create a proper disk image, including a partition table?


title: PNG Image not displaying for desktop icon on Fedora 16/17 with Gnome

text: I attempted to create a desktop icon in Fedora Gnome but I only get a generic binary icon for my application. Installing Gimp or OpenOffice magically makes my icon appear. I used Google Chrome on Fedora as an reference for making a desktop icon using png images. Google Chrome uses 32-bit PNG files in `/usr/share/icons/hicolor/#x#/apps/google-chrome.png`, where `#x#` is the various resolutions: 16x16, 22x22, 24x24, 32x32, 48x48, 64x64, 128x128, and 256x256. The permissions on these files were all `0644` or `-rw-r--r--`. Google places their `google-chrome.desktop` file in `/usr/local/share/applications/` with permission `0644`. **Attempt:** I copied all of these conditions except the location of the .desktop file:   * `my-app.desktop` file was placed in `/usr/share/applications` with permission `0644`   * All png files were saved as 32-bit images and properly located in `/usr/share/icons/hicolor/#x#/apps` with permission `0644`   * My desktop file is as follows:  (my-app.desktop)               [Desktop Entry]     Version=1.0     Name=My-App     GenericName=My Application     Comment=Test Application     Terminal=false     Icon=my-app.png     Type=Application     Exec=/opt/my-app/my-app     MimeType=application/x-executable     Categories=Network         **Result:** Navigating to `/usr/share/applications` my my-app.desktop file looks like a plain file:   ![enter image description here](http://i.stack.imgur.com/tBxvO.png) In the Gnome desktop menu, my application looks like a generic binary file:   ![enter image description here](http://i.stack.imgur.com/Kjmn6.png) Installing Gimp or OpenOffice will make my icon appear as intended without modification to the `my-app.desktop` file or the png files. I have tried the following different things to solve the problem:   * Changing `Icon=my-app.png` to `Icon=my-app` in my-app.desktop   * Saving the PNG files as 24-bit


title: grub-mkfont input and output formtas

text: I have a font that I can set using setfont and rc.conf [CONSOLEFONT]. It is in psf2 format. I would like to use the font in Grub as well. I'm using Grub2. When I run               grub-mkfont -o ~/outfont pc.psf      I get the output               can't open file pc.pf2, index 0: error 2: unknown file format      Although the man page is a bit lacking, from what I've read elsewhere, it looks like grub-mkfont should be able to take an host of input formats (including psf2?) and outputs a psf2 font. This doesn't match what I see. I have a grub font that works, and I notice that it doesn't have the psf2 "magic" at the top, but rather it starts with `FILE` , {0,0,0,4} (bytes), `PFF2NAME`, etc. and generally looks like a text/binary mixed format wit things like `MAXH`, `Regular 16`, `FAMI`, etc. in it. Is Grub2 different in this regard? The quest is: What format does grub-mkfont take and output? How can I convert my psf2 font into that format? It looks like information about these things is somewhat scarce, so please offer information even if you can't fully answer the question! Anything small could be big! Thanks.


title: What are the main differences between those linux distro vs general daily linux we use?

text: In one hand i have general daily linux: `Fedora/CentOS/ArchLinux/Ubuntu`. On other hand i have following:   * eCos   * FreeRTOS   * BuildRoot   * RTEMS   * openembedded   * uCLinux Did anyone used those uncommon linux distro's often, where do they best suite for (server or desktop use or for nonstop services)? Are they completely different then our general linux?


title: File name in file system

text: I have a strange question about file system in Unix. Why isn't it possible to give the same name to two files under same directory ? Wouldn't it be possible to use IDs to differentiate between distinct files with a similar name?


title: Run an application under Tomcat

text: I have an application that needs to run under Tomcat. I have installed Tomcat but I don't know where can I put the directory of the project.