What mount option to use for ext3 file system to minimise data loss or corruption?

I have an embedded setup using an initramfs for the root file system but using a custom ext3 partition mounted on a compact flash IDE drive. Because data integrity in the face of power loss is the most important factor in the entire setup, I have used the following options to mount (below is the entry from my `/etc/fstab` file               <file system> <mount pt> <type> <options>                         <dump><pass>     /dev/sda2     /data      ext3   auto,exec,relatime,sync,barrier=1 0     2      I came by these options from reading around on the internet. What I am worried about is that the content of `/proc/mounts` give the following:               /dev/sda2 /data ext3 rw,sync,relatime,errors=continue,user_xattr,acl,     barrier=1,data=writeback 0 0      From what I understand from reading around is that I want to use `data=journal` option for my mount as this offers the best protection against data corruption. However, from the man page for specific ext3 options for `mount` it says the following about the writeback option: > Data ordering is not preserved - data may be written into the main > filesystem after its metadata has been committed to the journal.   >  This is rumoured to be the highest-throughput option. **It guarantees > internal filesystem integrity** , however it can allow old data to appear in > files after a crash and journal recovery. I am very confused about this - the man page seems to suggest that for file system integrity I want to specify `data=writeback` option to `mount` but most other references I have found (including some published books on embedded linux) suggest that I should be using `data=journal`. What would be the best approach for me to use? Write speed is not an issue at all - data integrity is though.


Reading amount of tracks from an audio CD?

I'm writing a little script to analyze audio CDs. I'm specifically looking for a way to grab the track count from the CD, either from a shell-script or from Python. Is there an easy way to do this? On an Ubuntu 12.04 derivative.


No internet access for system services; however, browser access works

Unable to reload repos via apt-get, aptitude, or synaptic. Dropbox does not connect or sync. Pithos does not connect to pandora.com. Chrome and Firefox browsers do work fine. I have been unable to find why my browsers can touch the internet and not any other apps can.


Init script header not resolving dependency

I need to run a `/usr/sbin` command in my init script, so there is a dependency for the `/usr` filesytem to be mounted. To resolve the dependency, I put `$local_fs` or `boot.localfs` (I also tried `$remote_fs` and `$all`) in the required-start field of init script header, but it does still mount the `/usr` filesystem and my command in the initscript still fails with "command not found" error. I could resolve the issue by adding `boot.localfs` in the `.depend.boot` file, but why could not I resolve from the required-start init script header? Edit: I'm using the SUSE Linux 10.


What sets systemd apart from other init systems?

It is not quite official but it looks like systemd is coming to Debian and after reading some of the heated mailing list discussion on that decision, I am curious about the polarizing nature of systemd among linux users. I run Debian (sysvinit) and Gentoo (OpenRC) systems and know nothing concrete about systemd, though it looks like it is coming my way. I have seen this related question asking the pros and cons of systemd vs upstart, but it has been 3 years since that question was posted and I'm sure things have changed in that time. My question is: How does systemd compare to other init systems?   * What sets it apart -- what can it do that the other init systems cannot?    * Is there anything to lose in switching to it from another init system?    * How does administering systemd compare to the others?


How can I automatically interrupt what I'm doing to input something?

As per Nick Winter's _The Motivation Hacker_ , I want to measure my happiness. I know that I'm bad at remembering things or responding to reminders, so I'd like to set up a daemon that, at random intervals would:   * Check if I'm in a tty and if I am, output a message to that tty/pts, then capture input until newline   * Check if I'm in (currently using) the graphical interface, and if I am, launch a dialog to capture input. How can I do this?


Parse JSON or XML on bootup

I'm compiling my own version of the linux kernel and I was wondering if there is any way to do parse a local XML or JSON file.


Disabling email for an account

I have an amazon ec2 instance running ubuntu. There are only a couple of user accounts and the server is used to host a small web app. Apparently, by default, each user account has an email account. We do not use these accounts. Recently I discovered that one of the accounts is receiving "undeliverable message" emails from spam being sent in its name. We're receiving hundreds per hour and we didn't notice until the disk filled up. Of course we deleted all the emails and in the time it took for the delete to complete we had received 30 more. The best solution is to disable the email for this account. We want to keep the account though. Is there a way to just remove the email account for a user without affecting the account itself. Googling didn't help me. I only found directions for deleting individual emails or deleting the entire user account.


Send keystrokes to a process on Console

If I have a terminal with a shell open, how can I write a shell script (any scripting language is ok with me!) that will send a keystroke to any one of the running processes? As an example, how could I call a function that sends `Esc`,`:`,`wq`,`enter` to the Vim process, assuming I know its PID? Is there an executable that could provide this API? Alternatively, could I do this with something like Tmux?


How do I navigate to a CD drive?

I'm trying to install Virtualbox Guest Additions in Elementary OS. `cd` doesn't seem to work with `cd VBOXADDITIONS_4.2.6_82870`. **Update:** I did what @ivica recommended, and here's what I'm getting: ![enter image description here](http://i.stack.imgur.com/pqMgD.png) I see that I'm supposed to run either `autorun.sh` or `runasrood.sh` or `VBoxLinuxAdditions.run`, but what program am I supposed to run it with?


Missing Python.h in Arch

I use Arch Linux. I want to compile a C++ file that includes `<Python.h>`. But I can't do it. In Debian based systems this problem is resolved with `sudo apt-get install python-dev`. How I can install this package with pacman? *** EDIT *** I wan't to compile this file C.c               #include "Python.h"     int main(int argc, char *argv[])     {       Py_SetProgramName(argv[0]);  /* optional but recommended */       Py_Initialize();       PyRun_SimpleString("from time import time,ctime\n"                          "print 'Today is',ctime(time())\n");       Py_Finalize();       return 0;     }      run this command:               g++ C.c      and i have this error:               call_function.c:1:20: fatal error: Python.h: No such file or directory      #include "Python.h"                         ^     compilation terminated.


Not able to copy original top command executable over a malicious one

Somebody hacked my system and replaced some of the system commands like top, ps, find etc with malicious ones. Now, I am trying to copy the original ones, but the copy or move commands fail, even though I am logged in as root user. I get the following error:               cp /root/top /usr/bin/     cp: overwrite `/usr/bin/top', overriding mode 0755? y     cp: cannot create regular file `/usr/bin/top': Permission denied Can somebody please tell me a way by which I can copy my original files.


What repositories do I need to install heartbeat and haproxy on RHEL?

So I am now managing two RHEL machines that I need to install `haproxy` and `heartbeat` on. When I follow instructions to do so I get the following:               [admin@p2378442 ~]$ sudo yum -y install heartbeat haproxy     Loaded plugins: fastestmirror, security     Loading mirror speeds from cached hostfile      * main-base: yum01tor.peer1.com      * main-extras: yum01tor.peer1.com      * main-updates: yum01tor.peer1.com     Setting up Install Process     No package heartbeat available.     No package haproxy available.     Nothing to do     [admin@p2378442 ~]$      I imagine I just need to add some repository or other to some yum configuration file or other. What is my best bet? I've tried a few things I've found in Google so far; but they don't seem to help. I'm new to RHEL I don't want to just spray packages in to my system on accident! I miss Ubuntu server already...


How to merge all (text) files in a directory into one?

I've got 14 files all being parts of one text. I'd like to merge them into one. How to do that?


When I schedule a command with 'at', can I change where the output is mailed to?

When I schedule a job/command with `at` to be executed in the future, the standard output and error of the command is "mailed" to the user that did the scheduling. So after my job runs, I get a message in the command prompt > You have mail in /var/spool/mail/mattb which I can then read with `mail`. Is it possible to have the output instead sent to my corporate mailbox (i.e. `mattb@company.com`), rather than the local user's `/var/spool/mail`? How does `at` know which address to email the output of the command, or does it only know how to place a message in the user's `/var/spool/mail`? (I would tag this question `at` but I don't have enough rep on this SE site for that yet)


Problem Aliasing a Command With a Pipeline and an Argument

Note: I use tcsh. I am trying make an alias that will use the mutt command to send an email with a pre-written body and subject line but that will take the alias argument and attach it to the email. The best I currently have is:               alias emailattach 'echo "Message Body" | mutt -a \!:1 -s "Subject" email@somewhere.com'      This alias sets just fine, without any whining, but when I try to run it I get the following message:               Can't stat email@somewhere.com: No such file or directory     email@somewhere.com: unable to attach file.      When I remove `-a \\!:1` I no longer get the error message, so I believe the problem could be focused on this portion of the alias. The files I've told `emailattach` to attach are real, attachable files (a PDF specifically), so that's not the issue. I also tried the same alias but without the single quotes and I only got this error:               email@somewhere.com: unable to attach file.      To see if the pipeline was the crux of the problem I tried the following:               alias emailattach mutt -a \!:1 -s "Subject" email@somewhere.com      and then tried just running:               echo "Message Body" | emailattach /path/to/attachment      which gave the same error message as I first listed(`can't stat`...`unable to attach file.`). However, when I just ran:               echo "Message Body" | emailattach       I got this error:               Bad ! arg selector.      Which I assume is just an error saying that I forgot to put in the required argument. What have I written wrong in my alias that makes it not work?


What is this construct in bash? mycommand(){dosomething;}

I actually found following one-liner on commandfu.com: `cmdfu(){ curl "http://www.commandlinefu.com/commands/matching/$@/$(echo -n $@ | openssl base64)/plaintext"; }` I have not come across a similar use of the `()` in bash before. It seems that it creates the command `cmdfu` temporarily within the bash environment. Am I correct here? Or is it actually stored somewhere? Is there a name for this construct so I can read up on it?


X Windows Terminates when I type {+<ENTER>

In particular when I type the following keyboard combo: `<hold shift> [ <release shift> <enter>` I get dumped out of KDE and see a flash of some console output but I can't find it in any log. I'm running Fedora 15 (upgrading is hard). Does anyone have any ideas? **update:** This occurs across applications. In Intellij IDE, in the terminal. **update:** It also happens when I type `= <hold shift> 2 <release shift>` **update:** After a bit of digging I can see in /var/log/messages that it's dumped some info to /var/spool/abrt/ccpp-2012-07-20-10:50:21-1395 and within that it tells me that /usr/bin/Xorg was sent a SIGABRT.


Gnome screensaver floating feet shows only one (left) foot any alternative screensaver with both?

I like gnome screensaver floating feet and looking for version that displays both right, left heels of gnome or at least with choice option for the right. this is just for fun design related question.


run-parts ignores jobs.deny

I use run-parts to run all scripts under a directory,the same way crontab does. But the jobs deny and jobs allow don't block any of the scripts in the directory.               rajeevs@rajeev:/home/rajeevs/test$: ls     a     b     jobs.deny          $:cat jobs.deny     a     b          $:run-parts .     hello a     hello b      Any idea about this strange behavior?


Performance virtualbox diskfiles vs rawdisk

Pros and cons with this two ways to make disk for virtual machines on virtualbox               $ vboxmanage createhd --format VDI --size ${SIZE} --filename /path/to/disk.vdi      and               # vboxmanage createrawvmdk -filename /path/to/disk.vmdk -rawdisk /dev/sdX


Disable SELinux in apache to stop warning

I keep getting this error when I restart `httpd`: > DocumentRoot does not exist What else can I do besides disable editing `/etc/sysconfig/selinux` to fix it?


Is there any difference between mode value 0777 and 777

I saw a code change at work, where the mode values were changed from 777 to 0777 to make nfs setattr work. What is the difference in the 2 values?


How to create a folder which will change its contents’ ownership to what the folder has?

In a GNU/Linux OS there is no way to change ownership of a file until you are root. But what if I want to hide my system’s username e.g. before sending a file to someone, because some things like tar will try to keep it? What I think about is something like               # mkdir --mode=????? /tmp/nobodysfiles     # chown nobody:nobody /tmp/nobodysfiles          $ whoami     popcorneater     $ ls -l ~/file     -rw-r--r-- 1  popcorneater popcorneater 12345 oct.  18 11:10     $ cp ~/file /tmp/nobodysfiles/     $ ls -l /tmp/nobodysfiles/file     -rw-r--r-- 1 nobody nobody 12345 oct.  18 11:11


Custom bash autocomplete for git breaks other git autocomplete features

I am trying to add autocompletion to `git commit` upon hitting `Tab``Tab`. The autocomplete feature I am working on is based on a branch-naming convention. The convention is to append the PivotalTracker Id number to the end of the branch name, so a typical branch would look like `foo-bar- baz-1449242`. We can associate the commits with the PivotalTracker card by prepending `[#1449242]` to the beginning of the commit message. I would like this to be auto-inserted if `git commit` is typed in and the user hits `Tab``Tab`. I have already done this here: https://github.com/tlehman/dotfiles/blob/master/ptid_git_complete (and for convenience, here is the source code):                 function _ptid_git_complete_()       {         local line="${COMP_LINE}"                   # the entire line that is being completed              # check that the commit option was passed to git          if [[ "$line" == "git commit" ]]; then            # get the PivotalTracker Id from the branch name           ptid=`git branch | grep -e "^\*" | sed 's/^\* //g' | sed 's/\-/ /g' | awk '{ print $(NF) }'`           nodigits=$(echo $ptid | sed 's/[[:digit:]]//g')                if [ ! -z $nodigits ]; then             : # do nothing           else             COMPREPLY=("commit -m \"[#$ptid]")           fi         else           reply=()         fi       }            complete -F _ptid_git_complete_ git      The problem is that this breaks the git autocompletion features defined in git-autocompletion.bash How can I make this function compatible with git-autocompletion.bash?


sed on OSX insert at a certain line

So I've been using 'sed' on linux for a while, but have had a bit of difficulty trying to use it on OSX since 'POSIX sed' and 'GNU sed' have so many little differences. Currently I'm struggling with how to insert a line of text after a certain line number. (in this case, line 4) On linux I would do something like this:               sed --in-place "4 a\  mode '0755'" file.txt      So on OSX I tried this:               sed -i "" "4 a\ mode '0755'" file.txt      However this keeps giving me a 'extra characters after \ at the end of a command' error. Any ideas what's wrong here? Do I have a typo? Or am I not understanding another difference between versions of sed?


How to give permissions to other user after logging as root in Linux?

I am a Linux newbie and I have a very basic question. I have one machine which is `machineA` and I have a `root` access to that machine. Now I need to create these below two directories and give permissions to `app` user.               Create ZooKeeper Data directory and give permissions to app : /opt/zookeeper/data     Create ZooKeeper Log directory and give permissions to app : /opt/zookeeper/log      I have already created those directories in `/opt` folder by logging as `root` -               root@machineA:/opt# ls -lt     drwxr-xr-x 4 root root 4096 Dec 17 13:46 zookeeper          root@machineA:/opt/zookeeper# ls -lt     drwxr-xr-x 2 root root 4096 Dec 17 13:46 log     drwxr-xr-x 2 root root 4096 Dec 17 13:45 data      Now I am not sure how to give permissions to `app` user as mentioned above? I believe this is pretty easy question but I am not sure how to do that?


How to boot a system in a second HD but runing the system in another one?

I have two computers, but the old one is not working well. So I'd like to install the old hard disk on the new computer. I know how to do this and I know how to access the data from `sdb`. But I have some old programs installed on `sdb` which I'm not able to install them again on `sda`. So, I'd like to know if it is possible to use some virtual machine (I have installed VM on `sda`) to boot from `sdb` so that I'd be able to use my old programs whenever I need. I'm using Ubuntu 10.04 on both disks. Thanks.


Connected Android device - brings the network down?

I have dealt with sensitive development under Android, and have recently decided to switch to Linux now sit under (Mint 13 - KDE). But strangely, when the Android device is connected, my network goes down and only reboot works. I tried               sudo service network-manager stop     sudo service network-manager start      And this udev rule for the Android device.               vim /etc/udev/rules.d/51-android.rules     SUBSYSTEM == "usb", ATTR {idVendor} == "04e8", MODE = "0666", GROUP = "plugdev"     chmod a + r /etc/udev/rules.d/51-android.rules      Here is an article http://developer.android.com/tools/device.html But with this article, when I try to connect as a drive, I don't know how to mount it. I did this: http://blog.mpshouse.com/?p=609 Basically, **I want the device to work without bringing down my network** What is the cause, what is the problem, what's wrong?


Accessing other folder

I'm having difficulty with groups and permissions.   * I have user `A` part of group `A` that manages a folder `F`.    * A second user `B` part of group `B` must access folder `F` and its content.   * I added user `B` to group `A` but every time `B` tries to access folder `F` gets the message saying:              'Permission Denied'.       Is this the correct way to achieve that or do I need to do something more? I'm using CentOS 6.4.


How to force release of a keyboard modifiers

Sometimes, when I use synergy between my machines when one is using full- screen VirtualBox guest I get stuck with some weird key modifiers turned on. If they exist on my keyboard (like Shift_L) I can just tap it and their status is reset and I can continue typing in small letters. But some of them are not mapped to my keyboard at all (like ISO_Level3_Shift), so I have no means of turning them off at all! How to reset them? Right now, all I can do is to reboot the computer, but it's rather embarrassing solution. All I want is some program that can artificially "tap" all possible keyboard modifiers, so their status would be reset. Can it be done? I use Mint 14 (a clone of Ubuntu 12.10 Quantal).


Test what cd has done ksh

I'm facing a small issue here. I'm doing :               cd $(find . -type d | grep "${4:0:4}.*${4:4:2}.*${4:6:2}")      $4 is a data entered from the user. However, if the user doesn't respect the format to enter, it will do : `cd` Then, my `$?` will be 0 and not 1, and it will `cd` to my home. I'd like to introduce this in my error case to (by error case, I mean : `if $? = 1`). How can I do that ?


create pseudo shell for a command

I feel like this should be straighforward to some degree... Basically, for some command, I want to be able to invoke another command that will scope all params to that command. so...               git commit -am "test"      would become...               ./shell_comand git     >commit -am "test"     >status      so, obviously things like autocomplete and whatnot wouldn't work, but I would expect otherwise this should be doable to some degree? I'm just not quite clear on how...


How to regenerate /etc/init.d/.depend.(boot|start|stop) on Debian?

Suppose one deleted the following files.               /etc/init.d/.depend.boot     /etc/init.d/.depend.start     /etc/init.d/.depend.stop      How to regenerate them?


Why does tmux fail to "scroll" when entering a command that exceeds one line? (OSX Terminal.app)

When I use `tmux` and enter a command that exceeds the line, it fails to redraw the previous line. It simply clears the current line and I can't see what I just wrote. **It does only redraw the first line.** This also happens when I press `up` and the last command does not fit the current line (I only see the last line). If I then press `up` and `down` again, I can see all lines of the command. I'm not sure what causes that problem, but it's pretty annoying. Does it have to do something with my prompt? Just in case, here it is:               export PS1="%{$fg[blue]%}%n%{$reset_color%}@%{$fg[green]%}%m %{$fg[yellow]%}%~ %{$reset_color%}% "     export PS2=$_>     ($TERM is set to screen)      By the way, I'm using zsh and OSX Termial, but the problem is also there with bash. Also the problem does not exist with `xterm` (XQuartz), so i guess it's caused by OSX' Terminal.app.   * Does anyone know a way to fix this anyways?   * Perhaps I could force a redraw somehow? Just found this old thread on the tmux mailinglist. I tried different values for `$TERM` (screen, screen-256colors, xterm, xterm- color, nsterm) but the error persists. So I guess there is nothing I can do despite switching to another terminal emulator?


How to resume pacman package downloads?

I'm trying to install some updates while on a sketchy connection in Arch Linux. What is the best way to do that?               while ! pacman --noconfirm --needed --refresh --upgrade     do         :     done      took over 90 minutes to complete. Possibly this is because I used the strangely named `\--upgrade` option which is for _reinstalling_ packages rather than doing a package upgrade (`\--sysupgrade`).


How do I set up the SELinux sandbox in Debian?

I've installed SELinux in Debian sid in order to use the sandbox that locks down apps to a restricted enviroment, but I can't get it to work. If I try to use the sandbox command in permissive mode without any options, like `sandbox nano`, I get the following error:               /usr/bin/sandbox: [Errno 22] Invalid argument      And if I try to run it with options for temporary home and tmp dirs, with or without the -X option, another error message pops up:               Could not set exec context to unconfined_u:unconfined_r:sandbox_x_t:s0:c236,c539.     Failed to remove directory /tmp/.sandbox-root-vfZJIt: No such file or directory      I have tried using the sandbox app in enforced mode, but it complains about missing type enforcement rules. I don't think that's the issue though. Does anyone know how to fix this?


Keyboard only desktop environment

Is there a (more than a terminal) desktop environment/distro that can be run using only a keyboard - I have an old computer on which I cannot use a mouse - the PS/2 port is broken and it won't accept USB


Bash autocomplete with vim command

In bash, autocompletion of paths has recently stopped working when issuing `vim` commands where the path is deeper than two directories (it continues to work as expected with other commands, such as `ls` and `cd`). For example, if I type `ls .config/btsync/bt` and then press TAB, it expands to `ls .config/btsync/btsync.conf`. If I type `vim .config/bt` and then press TAB, it expands to `vim .config/btsync/`. However, if I type `vim .config/btsync/bt` and then press TAB, nothing happens (I would expect it to expand to `vim .config/btsync/btsync.conf`, as in the `ls` example, above. I get the same issue when running as my own user and when running as su. I read this post which mentioned an issue with older versions of bash- completion but I'm running 2.1-5. UPDATE: After some additional testing, I've found that the root issue is that bash will _only_ complete directory names, not filenames. **UPDATE: It turns out that`bash-completion` was the overall cause. See my second comment on the accepted answer.** Any suggestions as to the potential cause of this behaviour would be gratefully received!


Bash: test whether original script was run with `-x`

Is it possible to test whether a bash script was executed with `-x`? I'm writing a script which also runs some remote scripts, and I'd like to be able to do something like:               USE_X="$( run_with_x && "-x" || "" )"     ssh $host "bash $USE_X some_script.sh"


SSH remote command execution: get output before execution ends

Consider the following simple C program `test.c`:               #include <stdio.h>          int main(void){             printf("foo\n");             sleep(5);             printf("bar\n");             return 0;     }      The program prints "foo" on stdout, waits for 5 seconds and outputs "bar" then. If I run it remotely using               $ ssh remotehost /path/to/test      I do see nothing for 5 seconds, and get both entries displayed altogether when the program quits. Is there any way to get ssh to redirect each output of stdout before command execution is finished?


How to rename file to .. (dot dot)?

Apparently you can rename file to `...`. If I were insane, how would I rename file to `..` or `.`? Is such a filename even allowed? Backslash doesn't seem to disable dot's special meaning:               $ mv test \.     mv: `test' and `./test' are the same file


lvm devices under /dev/mapper missing

I'm using Debian squeeze, and running LVM on top of software RAID 1. I just accidentally just discovered that most of the links under `/dev/mapper` are missing, though my system seems to be still functioning correctly. I'm not sure what happened. The only thing I can imagine that caused it was my failed attempt to get a LXC fedora container to work. I ended up deleting a directory `/cgroup/laughlin`, corresponding to the container, but I can't imagine why that should have caused the problem. `/dev/mapper` looked (I made some changes, see below) approximately like               orwell:/dev/mapper# ls -la     total 0     drwxr-xr-x  2 root root     540 Apr 12 05:08 .     drwxr-xr-x 22 root root    4500 Apr 12 05:08 ..     crw-------  1 root root  10, 59 Apr  8 10:32 control     lrwxrwxrwx  1 root root       7 Mar 29 08:28 debian-root -> ../dm-0     lrwxrwxrwx  1 root root       8 Apr 12 03:32 debian-video -> ../dm-23      debian-video corresponds to a LV I had just created. However, I have quite a number of VGs on my system, corresponding to 4 VGs spread across 4 disks. `vgs` gives               orwell:/dev/mapper# vgs       VG         #PV #LV #SN Attr   VSize   VFree         backup       1   2   0 wz--n- 186.26g  96.26g       debian       1   7   0 wz--n- 465.76g 151.41g       olddebian    1  12   0 wz--n- 186.26g  21.26g       testdebian   1   3   0 wz--n- 111.75g  34.22g      I tried running                /dev/mapper# vgscan --mknodes      and some devices were created (see output below), but they aren't symbolic links to the dm devices as they should be, so I'm not sure if this is useless or worse. Would they get in the way of recreation of the correct links? Should I delete these devices again? I believe that udev creates these links, so would a reboot fix this problem, or would I get an unbootable system? What should I do to fix this? Are there any diagnostics/sanity checks I should run to make sure there aren't other problems I haven't noticed? Thanks in advance for any assistance.               orwell:/dev/mapper# ls -la     total 0     drwxr-xr-x  2 root root     540 Apr 12 05:08 .     drwxr-xr-x 22 root root    4500 Apr 12 05:08 ..     brw-rw----  1 root disk 253,  1 Apr 12 05:08 backup-local_src     brw-rw----  1 root disk 253,  2 Apr 12 05:08 backup-video     crw-------  1 root root  10, 59 Apr  8 10:32 control     brw-rw----  1 root disk 253, 15 Apr 12 05:08 debian-boot     brw-rw----  1 root disk 253, 16 Apr 12 05:08 debian-home     brw-rw----  1 root disk 253, 22 Apr 12 05:08 debian-lxc_laughlin     brw-rw----  1 root disk 253, 21 Apr 12 05:08 debian-lxc_squeeze     lrwxrwxrwx  1 root root       7 Mar 29 08:28 debian-root -> ../dm-0     brw-rw----  1 root disk 253, 17 Apr 12 05:08 debian-swap     lrwxrwxrwx  1 root root       8 Apr 12 03:32 debian-video -> ../dm-23     brw-rw----  1 root disk 253, 10 Apr 12 05:08 olddebian-etch_template     brw-rw----  1 root disk 253, 13 Apr 12 05:08 olddebian-fedora     brw-rw----  1 root disk 253,  8 Apr 12 05:08 olddebian-feisty     brw-rw----  1 root disk 253,  9 Apr 12 05:08 olddebian-gutsy     brw-rw----  1 root disk 253,  4 Apr 12 05:08 olddebian-home     brw-rw----  1 root disk 253, 11 Apr 12 05:08 olddebian-lenny     brw-rw----  1 root disk 253,  7 Apr 12 05:08 olddebian-msi     brw-rw----  1 root disk 253,  5 Apr 12 05:08 olddebian-oldchresto     brw-rw----  1 root disk 253,  3 Apr 12 05:08 olddebian-root     brw-rw----  1 root disk 253, 14 Apr 12 05:08 olddebian-suse     brw-rw----  1 root disk 253,  6 Apr 12 05:08 olddebian-vgentoo     brw-rw----  1 root disk 253, 12 Apr 12 05:08 olddebian-wsgi     brw-rw----  1 root disk 253, 20 Apr 12 05:08 testdebian-boot     brw-rw----  1 root disk 253, 18 Apr 12 05:08 testdebian-home     brw-rw----  1 root disk 253, 19 Apr 12 05:08 testdebian-root


Solaris 11 text mode after boot

I am running Solaris 11 on VMWare Workstation host machine Windows 7. Here is my OS and system details: SunOS solaris 5.11 11.0 i86pc i386 i86pc I want to boot Solaris 11 in text mode only i.e make it persistently boot in text mode and not boot into GUI. I tried editing menu.lst. My menu.lst is as follows:               default 0     timeout 30     splashimage /boot/grub/splash.xpm.gz     foreground 343434     background F7FBFF     title Oracle Solaris 11 11/11     bootfs rpool/ROOT/solaris     kernel$ /platform/i86pc/kernel/amd64/unix -B $ZFS-BOOTFS,console=text     module$ /platform/i86pc/amd64/boot_archive     title solaris-backup-1     bootfs rpool/ROOT/solaris-backup-1     kernel$ /platform/i86pc/kernel/amd64/unix -B $ZFS-BOOTFS,console=text     module$ /platform/i86pc/amd64/boot_archive      My problem is that when I reboot Solaris 11 it initially shows up with a command line login asking for username, but as I'm typing the username in, it just boots into GUI anyway showing up a GUI login screen. How can I make Solaris persistently boot into text mode. I have tried boot time grub parameter editing and that way doesn't work either.


Adding multiple gateways for separate physical interfaces with various metrics/priorities

My system has 3 interfaces. These are eth0, eth1 and usb0. eth0 is linked to my router and is the line I want to be used by default. eth1 is un used. usb0 is a 3G phone that's tethered. My issue is that I wan't to be able to access the internet via both eth0 and usb0 at the same time. Currently as soon as I change the gateway to match each interface, the other connection no longer responds. I have tried adding metric values on my interfaces file:               # This file describes the network interfaces available on your system     # and how to activate them. For more information, see interfaces(5).          # The loopback network interface     auto lo eth0 usb0     iface lo inet loopback             allow-hotplug eth0 usb0          # The primary network interface     iface eth0 inet static             address 192.168.1.67             netmask 255.255.255.0             broadcast 192.168.1.254             network 192.168.1.0             post-up route add default gw 192.168.1.254 metric 1             pre-down route del default gw 192.168.1.254               iface usb0 inet static             address 192.168.42.86             netmask 255.255.255.0             broadcast 192.168.42.254             network 192.168.42.0             post-up route add default gw 192.168.42.129 metric 2             pre-down route del default gw 192.168.42.129      Unfourtunately when it starts up, only the usb0 is actually accessible. When I check the routes, I can see that there is no gateway for the eth0.               ~# route -n     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         192.168.42.129  0.0.0.0         UG    0      0        0 usb0     0.0.0.0         192.168.42.129  0.0.0.0         UG    2      0        0 usb0     192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0     192.168.42.0    0.0.0.0         255.255.255.0   U     0      0        0 usb0      And when I try to access the internet via each of them. eth0 gives me the following:               ~# ping -I eth0 8.8.8.8     PING 8.8.8.8 (8.8.8.8) from 192.168.1.67 eth0: 56(84) bytes of data.     From 192.168.1.67 icmp_seq=1 Destination Host Unreachable     From 192.168.1.67 icmp_seq=2 Destination Host Unreachable     From 192.168.1.67 icmp_seq=3 Destination Host Unreachable     From 192.168.1.67 icmp_seq=4 Destination Host Unreachable     From 192.168.1.67 icmp_seq=5 Destination Host Unreachable     From 192.168.1.67 icmp_seq=6 Destination Host Unreachable     ^C     --- 8.8.8.8 ping statistics ---     7 packets transmitted, 0 received, +6 errors, 100% packet loss, time 6030ms      However, usb0 has internet access.               ~# ping -I usb0 8.8.8.8     PING 8.8.8.8 (8.8.8.8) from 192.168.42.86 usb0: 56(84) bytes of data.     64 bytes from 8.8.8.8: icmp_req=1 ttl=43 time=188 ms     64 bytes from 8.8.8.8: icmp_req=2 ttl=43 time=127 ms     64 bytes from 8.8.8.8: icmp_req=3 ttl=43 time=108 ms     64 bytes from 8.8.8.8: icmp_req=4 ttl=43 time=98.3 ms     64 bytes from 8.8.8.8: icmp_req=5 ttl=43 time=96.9 ms     64 bytes from 8.8.8.8: icmp_req=6 ttl=43 time=165 ms     64 bytes from 8.8.8.8: icmp_req=7 ttl=43 time=226 ms     ^C     --- 8.8.8.8 ping statistics ---     7 packets transmitted, 7 received, 0% packet loss, time 6002ms     rtt min/avg/max/mdev = 96.981/144.575/226.027/46.357 ms      I can't see where I'm going wrong, and on some occasions, though not often, I get the following appearing in my ping:               64 bytes from 8.8.8.8: icmp_req=3 ttl=43 time=132 ms     64 bytes from 8.8.8.8: icmp_req=3 ttl=43 time=672 ms (DUP!)     64 bytes from 8.8.8.8: icmp_req=3 ttl=43 time=1212 ms (DUP!)      Any assistance would be greatly appreciated.


How to count similar results in several columns in Libre Office Calc?

On LibreOffice Calc, I have seven columns filled with any one of the non- numerical values _a_ , _b_ or _c_. For each line, I want to count how many times the _a_ value has been entered. How can I do that? I couldn't find a way to do that with the Data Pilot.


netcat from ubuntu

I'm trying to use netcat to catch kernel printing (netconsole) using `nc -l -u -p 6666`. But when I use this utility in Ubuntu, it immediately exits. Trying to figure out why, I see that in the manual page it is described that `-l` & `-p` can't be used together. The next time I tried to execute it as following. This time I started to get some reply but then it exits.               $ nc -l -u 6666     netconsole: local port 6665     netconsole: local IP 0.0.0.0     netconsole: interface 'eth0'     netconsole: remote port 6666     netconsole: remote IP 10.0.0.1     netconsole: remote ethernet address ff:ff:ff:ff:ff:ff     netconsole: local IP 10.0.0.2      Then I get back host prompt, as if netcat existed without printing anything more. Can someone help me figure out what I'm doing wrong ?


How can i check that a remote computer is online for ssh / script acess?

i'm writting a script that will backup data from my laptop to an ubuntu server. to do so, i'm looking for a (ba)sh command to test if the server is available before starting the backup. something like "ping" on port 22 that returns a boolean how can i do this ? thanks for helping


Execute user script as root in startup applications

I just created a script (logscreenlock) to log lock/unlock screen events (derived from this post):               #! /bin/bash     dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver'" | ( while true; do read X; if echo $X | grep "boolean true" &> /dev/null; then echo `date` "screen locked"; elif echo $X | grep "boolean false" &> /dev/null; then echo `date` "screen unlocked"; fi done )      I wanted to have a startup daemon running `logscreenlock > /var/log/screenlock.log`. Now, to write into /var/log, I need root permissions (I am a sudoer). So I would need `sudo logscreenlock > /var/log/screenlock.log`, but I have two problems with that:   1. logscreenlock is owned by my user and and I would like to keep it that way, but even after `chmod a+x logscreenlock`, I get permission denied if I try to `sudo ./logscreenlock`. I tried to `usermod -a -G <myusergroup> root`, but no luck. How can I overcome this?   2. How can I sudo in the startup applications? will it prompt me for a password right away? * * * EDIT: I found out later that the reason why I couldn't execute logscreenlock as root was that this script is in a remote filesystem where my machine's root is not authenticated.


Getting tmux to copy a buffer to the clipboard

I am trying to figure out a decent way to copy what I have in a tmux buffer into my clipboard. I have tried a couple of different things like               bind-key p select-pane -t 2 \; split-window 'xsel -i -b' \; paste-buffer      which gets me fairly close, all I have to do is hit control-d after I do prefix-p. I tried fixing that by doing               bind-key p select-pane -t 2 \; split-window 'xsel -i -b << HERE\; tmux paste-buffer\; echo HERE'      But that just doesn't work. In fact if I pair this down to just               bind-key p select-pane -t 2 \; split-window 'xsel -i -b << HERE'      it doesn't do anything so I am assuming that split-window doesn't like << in a shell command. Any ideas? Edit: You can skip the `select-pane -t 2` if you want, it inst really important. I just use a specific layout and pane 2 is the one i prefer to split when I doing something else so that goes into my bindings involving splits by default.


Red hat linux command line character underscore problem

When I type a command e.g.               cd /etc/         I get the following               cd /etc$       if I press the backslash key again then I get the correct entry               cd /etc/        I am using gnome but I get the same problem with KDE. Does anyone know what may be causing this problem?


Init-systems and service management on different distributions

Is there some overview which Linux distribution comes with which (default) init system and uses which tool for starting/stopping services? Is there some distribution independent way to start/stop/query a service?   * `/etc/init.d/xyz start` does only work with system-v init systems   * `service xyz start` is not available on every distribution (which distribution does (not) have this?)   * case switching depending on available commands seems to be the only reliable way Background: We need to write an installer for different Linux distribution which needs to restart/query services. Calling the `service` tool would be cool for that, but I'm not sure which distributions support this.


XFCE session fails to load when launched via LightDM

I have set up LightDM as the desktop manager on an ARM Ubuntu install (running with a chroot on an Android device) and this loads and works fine, however when I try to launch a Xfce session as a normal user I end up with a blank black screen with just the mouse (which works). When I check logs I have LightDM outputting: Logging to `.xsession-errors`               ** (process:2129): WARNING **: Failed to open CK session: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ConsoleKit was not provided by any .service files     [+302.39s] DEBUG: Activating VT 7     [+302.39s] WARNING: Error using VT_ACTIVATE 7 on /dev/console: Invalid argument     [+302.39s] WARNING: Error using VT_WAITACTIVE 7 on /dev/console: Invalid argumen      And then in xsession-errors:               init: Unable to register as subreaper: Invalid argument     init: Failed to spawn logrotate pre-start process: unable to granpt: Exec format error     init: Failed to spawn dbus pre-start process: unable to granpt: Exec format error     init: Failed to spawn ssh-agent pre-start process: unable to granpt: Exec format error     init: Failed to spawn ssh-agent post-stop process: unable to granpt: Exec format error     init: Failed to spawn xsession-init pre-start process: unable to granpt: Exec format error      Xorg.0.log:               [  4020.847]      X.Org X Server 1.14.3     Release Date: 2013-09-12     [  4020.847] X Protocol Version 11, Revision 0     [  4020.847] Build Operating System: Linux 3.2.0-51-highbank armv7l Ubuntu     [  4020.847] Current Operating System: Linux localhost 3.0.36+ #34 SMP PREEMPT Sat May 17 17:42:40 CST 2014 armv7l     [  4020.847] Kernel command line: console=ttyFIQ0 androidboot.console=ttyFIQ0 init=/init initrd=0x62000000,0x00170000 mtdparts=rk29xxnand:0x00002000@0x00002000(misc),0x00006000@0x00004000(kernel),0x00006000@0x0000a000(boot),0x00010000@0x00010000(recovery),0x00020000@0x00020000(backup),0x00040000@0x00040000(cache),0x001FE000@0x00080000(userdata),0x00002000@0x0027E000(metadata),0x00002000@0x00280000(kpanic),0x00180000@0x00282000(system),0x01000000@0x00402000(uoa),-@0x01402000(user) bootver=2013-12-27#2.10 firmware_ver=4.4.2     [  4020.848] Build Date: 15 October 2013  09:25:29AM     [  4020.848] xorg-server 2:1.14.3-3ubuntu2 (For technical support please see http://www.ubuntu.com/support)      [  4020.848] Current version of pixman: 0.30.2     [  4020.848]    Before reporting problems, check http://wiki.x.org         to make sure that you have the latest version.     [  4020.848] Markers: (--) probed, (**) from config file, (==) default setting,         (++) from command line, (!!) notice, (II) informational,         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.     [  4020.849] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Jun 19 23:16:02 2014     [  4020.850] (==) Using config file: "/etc/X11/xorg.conf"     [  4020.850] (==) Using system config directory "/usr/share/X11/xorg.conf.d"     [  4020.851] (==) ServerLayout "Layout0"     [  4020.851] (**) |-->Screen "Screen0" (0)     [  4020.851] (**) |   |-->Monitor "<default monitor>"     [  4020.852] (**) |   |-->Device "Card0"     [  4020.852] (==) No monitor specified for screen "Screen0".         Using a default monitor configuration.     [  4020.852] (**) |-->Input Device "USB Mice"     [  4020.852] (**) Option "AutoAddDevices" "on"     [  4020.852] (**) Automatically adding devices     [  4020.853] (==) Automatically enabling devices     [  4020.853] (==) Automatically adding GPU devices     [  4020.853] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.     [  4020.853]    Entry deleted from font path.     [  4020.853] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.     [  4020.853]    Entry deleted from font path.     [  4020.853] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.     [  4020.853]    Entry deleted from font path.     [  4020.853] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.     [  4020.853]    Entry deleted from font path.     [  4020.853] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.     [  4020.853]    Entry deleted from font path.     [  4020.853] (==) FontPath set to:         /usr/share/fonts/X11/misc,         /usr/share/fonts/X11/Type1,         built-ins     [  4020.853] (==) ModulePath set to "/usr/lib/arm-linux-gnueabihf/xorg/extra-modules,/usr/lib/xorg/extra-modules,/usr/lib/xorg/modules"     [  4020.853] (II) The server relies on udev to provide the list of input devices.         If no devices become available, reconfigure udev or disable AutoAddDevices.     [  4020.853] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.     [  4020.853] (WW) Disabling USB Mice     [  4020.853] (II) Loader magic: 0x401deee0     [  4020.853] (II) Module ABI versions:     [  4020.854]    X.Org ANSI C Emulation: 0.4     [  4020.854]    X.Org Video Driver: 14.1     [  4020.854]    X.Org XInput driver : 19.1     [  4020.854]    X.Org Server Extension : 7.0     [  4020.855] Initializing built-in extension Generic Event Extension     [  4020.855] Initializing built-in extension SHAPE     [  4020.855] Initializing built-in extension MIT-SHM     [  4020.855] Initializing built-in extension XInputExtension     [  4020.855] Initializing built-in extension XTEST     [  4020.855] Initializing built-in extension BIG-REQUESTS     [  4020.855] Initializing built-in extension SYNC     [  4020.855] Initializing built-in extension XKEYBOARD     [  4020.855] Initializing built-in extension XC-MISC     [  4020.855] Initializing built-in extension SECURITY     [  4020.855] Initializing built-in extension XINERAMA     [  4020.855] Initializing built-in extension XFIXES     [  4020.855] Initializing built-in extension RENDER     [  4020.855] Initializing built-in extension RANDR     [  4020.855] Initializing built-in extension COMPOSITE     [  4020.855] Initializing built-in extension DAMAGE     [  4020.855] Initializing built-in extension MIT-SCREEN-SAVER     [  4020.855] Initializing built-in extension DOUBLE-BUFFER     [  4020.855] Initializing built-in extension RECORD     [  4020.856] Initializing built-in extension DPMS     [  4020.856] Initializing built-in extension X-Resource     [  4020.856] Initializing built-in extension XVideo     [  4020.856] Initializing built-in extension XVideo-MotionCompensation     [  4020.856] Initializing built-in extension SELinux     [  4020.856] Initializing built-in extension XFree86-VidModeExtension     [  4020.856] Initializing built-in extension XFree86-DGA     [  4020.856] Initializing built-in extension XFree86-DRI     [  4020.856] Initializing built-in extension DRI2     [  4020.856] (II) "glx" will be loaded by default.     [  4020.856] (WW) "xmir" is not to be loaded by default. Skipping.     [  4020.856] (II) LoadModule: "dri2"     [  4020.856] (II) Module "dri2" already built-in     [  4020.856] (II) LoadModule: "glamoregl"     [  4020.857] (II) Loading /usr/lib/xorg/modules/libglamoregl.so     [  4020.869] (II) Module glamoregl: vendor="X.Org Foundation"     [  4020.869]    compiled for 1.14.2.901, module version = 0.5.1     [  4020.869]    ABI class: X.Org ANSI C Emulation, version 0.4     [  4020.869] (II) LoadModule: "glx"     [  4020.870] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so     [  4020.871] (II) Module glx: vendor="X.Org Foundation"     [  4020.871]    compiled for 1.14.3, module version = 1.0.0     [  4020.871]    ABI class: X.Org Server Extension, version 7.0     [  4020.871] (==) AIGLX enabled     [  4020.871] Loading extension GLX     [  4020.871] (II) LoadModule: "fbdev"     [  4020.871] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so     [  4020.872] (II) Module fbdev: vendor="X.Org Foundation"     [  4020.872]    compiled for 1.14.1, module version = 0.4.3     [  4020.872]    Module class: X.Org Video Driver     [  4020.872]    ABI class: X.Org Video Driver, version 14.1     [  4020.872] (II) FBDEV: driver for framebuffer: fbdev     [  4020.872] (++) using VT number 7          [  4020.873] (WW) Falling back to old probe method for fbdev     [  4020.873] (II) Loading sub module "fbdevhw"     [  4020.873] (II) LoadModule: "fbdevhw"     [  4020.874] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so     [  4020.874] (II) Module fbdevhw: vendor="X.Org Foundation"     [  4020.874]    compiled for 1.14.3, module version = 0.0.2     [  4020.874]    ABI class: X.Org Video Driver, version 14.1     [  4020.875] (II) FBDEV(0): using /dev/graphics/fb2     [  4020.875] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support     [  4020.876] (**) FBDEV(0): Depth 24, (--) framebuffer bpp 32     [  4020.876] (==) FBDEV(0): RGB weight 888     [  4020.876] (==) FBDEV(0): Default visual is TrueColor     [  4020.876] (==) FBDEV(0): Using gamma correction (1.0, 1.0, 1.0)     [  4020.876] (II) FBDEV(0): hardware: fb2 (video memory: 24576kB)     [  4020.876] (**) FBDEV(0): Option "fbdev" "/dev/graphics/fb2"     [  4020.876] (II) FBDEV(0): checking modes against framebuffer device...     [  4020.876] (II) FBDEV(0):     mode "1280x800_60.00" not found     [  4020.876] (II) FBDEV(0): checking modes against monitor...     [  4020.876] (--) FBDEV(0): Virtual size is 1920x1080 (pitch 1920)     [  4020.876] (**) FBDEV(0):  Built-in mode "current": 148.5 MHz, 67.5 kHz, 60.0 Hz     [  4020.876] (II) FBDEV(0): Modeline "current"x0.0  148.50  1920 2008 2052 2200  1080 1084 1089 1125 -hsync -vsync -csync (67.5 kHz b)     [  4020.876] (==) FBDEV(0): DPI set to (96, 96)     [  4020.876] (II) Loading sub module "fb"     [  4020.877] (II) LoadModule: "fb"     [  4020.877] (II) Loading /usr/lib/xorg/modules/libfb.so     [  4020.878] (II) Module fb: vendor="X.Org Foundation"     [  4020.878]    compiled for 1.14.3, module version = 1.0.0     [  4020.878]    ABI class: X.Org ANSI C Emulation, version 0.4     [  4020.878] (**) FBDEV(0): using shadow framebuffer     [  4020.878] (II) Loading sub module "shadow"     [  4020.878] (II) LoadModule: "shadow"     [  4020.878] (II) Loading /usr/lib/xorg/modules/libshadow.so     [  4020.879] (II) Module shadow: vendor="X.Org Foundation"     [  4020.879]    compiled for 1.14.3, module version = 1.1.0     [  4020.879]    ABI class: X.Org ANSI C Emulation, version 0.4     [  4020.879] (==) Depth 24 pixmap format is 32 bpp     [  4020.881] (==) FBDEV(0): Backing store disabled     [  4020.881] (==) FBDEV(0): DPMS enabled     [  4020.882] (==) RandR enabled     [  4020.906] (II) SELinux: Disabled on system     [  4020.910] (II) AIGLX: Screen 0 is not DRI2 capable     [  4020.910] (II) AIGLX: Screen 0 is not DRI capable     [  4020.927] (II) AIGLX: Loaded and initialized swrast     [  4020.928] (II) GLX: Initialized DRISWRAST GL provider for screen 0     [  4020.998] (II) XKB: reuse xkmfile /var/lib/xkb/server-B20D7FC79C7F597315E3E501AEF10E0D866E8E92.xkm     [  4023.502] (EE) Server terminated successfully (0). Closing log file.      Also I can launch xfce from the terminal as root fine with `startxfce4` Any ideas what the issue could be?


pwd resolving symbolic links

> **Possible Duplicate:**   >  pwd without symlinks Imagine I have a directory               /home/me/dir      and a symbolic link to it called               /home/me/dirlink      now if I enter `dirlink` and use `pwd`, it of course prints the 2nd one. Is there a flag to make it resolve the symlink and print the 1st one?


Why do I get a 'conformability error' when I attempt to convert water in GNU units?

I've been using the GNU units program and I seem to think that I should be able to convert water between a volume and a weight. Examples:               You have: 1 gram water     You want: cm^3     conformability error         1 gram water = 9.80665 kg^2 / m^2 s^2         cm^3 = 1e-06 m^3      and               You have: 1 gallon water     You want: pounds     conformability error         1 gallon water = 37.122208 kg m / s^2         pounds = 0.45359237 kg


NetBSD 5.1 NDIS Kernel Compile Error

I have an old Toshiba Satellite 4015CDT, with Pentium II MMX, 32MB RAM, 4GB HDD. It also has one USB 1.0 port, parallel and serial ports, a 3.5" floppy drive and a CD-ROM drive (almost dead). I've installed NetBSD on this machine (full install) and now I want to connect it to the Internet. Although it has one PCMCIA modem card in it, it is obviously not an option. In order to do that I tried to connect my Realtek RTL8192U wireless adapter, but although the system gives me the device's name (through dmesg) it fails to recognize it as a network adapter. I followed the instructions here and here to recompile the kernel with NDIS support (I gave this configuration the name "NDIS"). At compile time I got the following error messages:               cc1: warnings being treated as errors     ../../../../dev/if_ndis/if_ndis.c: In function 'ndis_detach':     ../../../../dev/if_ndis/if_ndis.c:1187: warning: passing argument 1 of 'mutex_destroy' from incompatible pointer type     *** Error code 1     Stop.     make: stopped in /usr/src/sys/arch/i386/compile/NDIS      I would very much appreciate any help on this matter. Thanks in advance. P.S. If it is of any help, the system was installed by first booting off the installation floppies ("boot1.fs" and "boot2.fs" downloaded from the official ftp server), and then the packages were copied from a USB flash drive (packages also downloaded from the ftp server).


Is my laptop's overheating issue CPU (Dual Core i5) or GPU (Nvidia 320M) related, and can I fix it in Linux Mint?

I've had the same problem in both Ubuntu 12.10 and Linux Mint 15. I've tried taking my Acer laptop apart (no mean feat for a noob like me) and cleaned and resat the GPU and CPU heatsinks and fan (with fresh heat paste of course).               $ sensors     acpitz-virtual-0     Adapter: Virtual device     temp1:        +64.0°C  (crit = +102.0°C)     temp2:        +43.0°C  (crit = +96.0°C)          coretemp-isa-0000     Adapter: ISA adapter     Core 0:       +66.0°C  (high = +95.0°C, crit = +105.0°C)     Core 2:       +63.0°C  (high = +95.0°C, crit = +105.0°C)      It's helped a little, my 'temp 2' used to be higher, and it took much longer to cool down if I ran a game, but my CPUs are still running very hot (the above is just with chromium and a terminal open in Cinammon). I've installed the latest proprietary drivers (not the ones you can select in 'drivers,' which broke X). Instead I'm running 331.               $ inxi -Gxx     Graphics:  Card: NVIDIA GT216M [GeForce GT 320M] bus-ID: 02:00.0                 X.Org: 1.13.4 drivers: nvidia (unloaded: fbdev,vesa,nouveau) Resolution: 1366x768@60.0hz                 GLX Renderer: GeForce GT 320M/PCIe/SSE2 GLX Version: 3.3.0 NVIDIA 331.13 Direct Rendering: Yes      Despite being 'better than before' my computer still crashes not long after starting any kind of graphics intensive task. Even the game 'Thomas is not along' (seems relatively simple visually) is too much. Now it takes about 20 minutes to crash (rather than 5), but I really would like my laptop to stop overheating so easily. =( I tried installing Bumblebee as I read it's due to some kind of issue that forces the GPU to run but, again, X stopped working. I uninstalled it, and have since spent time trying to find a solution. My googlefu is failing me, so I turn to you for help. Do I need to step back from my nvidia updates to get bumblebee working? Is there a more up to date version I should be using? Maybe it's not the GPU (I would have thought that's what temp 2 is reading, and it's cool). Maybe something is happening to make my CPU run through the roof?               $ inxi -fxz     CPU:       Dual core Intel Core i5 CPU M 430 (-HT-MCP-) cache: 3072 KB bmips: 9043.48                 Clock Speeds: 1: 1199.00 MHz 2: 1199.00 MHz 3: 1199.00 MHz 4: 1199.00 MHz                CPU Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts                 acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good                 nopl xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt                 lahf_lm ida arat dtherm tpr_shadow vnmi flexpriority ept vpid       EDIT: I just tried the 'Advanced' install here: https://wiki.ubuntu.com/Bumblebee installing bumblebee-nvidia, virtualgl and virtualgl-libs-ia32 and had the same problem (X server stopped working).


How to replace quotation marks in a file with sed?

I have a file that contains multiple lines of xml. I would like to replace certain parts of the file. Some parts of the file contains quotation marks (`"`) which I would like to replace. I have been trying to _escape_ the quotation mark with `\`, but I don't think this is working based on the result of my file. Here is an example of one of my sed commands:               sed -e "s/\"text\"/'text'/ig" file.xml > temp.tmp      Is this how you escape quotation marks in a sed command or am I doing something wrong?


Do I need to encapsulate awk variables in quotes in order to sanitize them?

As per an answer on stackoverflow, it's my understanding that encapsulating bash variables in double-quotes is a fairly safe way of sanitizing user input. What about awk variables? For example, if I have something like:               awk -v SOURCEIP="$SOURCEIP" -v REVERSEDNS="$REVERSEDNS" '{        gsub(/^_TMPSOURCEIP_/, SOURCEIP);        gsub(/^_TMPREVERSEDNS_/, REVERSEDNS);        print     }' /home/foo/footemplate      Should I put quotes around the variable in the gsub lines? So it would then look like:               awk -v SOURCEIP="$SOURCEIP" -v REVERSEDNS="$REVERSEDNS" '{        gsub(/^_TMPSOURCEIP_/, "SOURCEIP");        gsub(/^_TMPREVERSEDNS_/, "REVERSEDNS");        print     }' /home/foo/footemplate      Or does this not make a difference?


Is there a convenient general way to "grab" the echoed result of a command in Emacs (of M-: or M-!)?

Sometimes, I want to insert the result of an Emacs command (that has been echoed in the echo area) to another buffer or another running X program. So, I'd like to put it to the kill-ring. What would be a convenient way to do this? For example: I could run a query with a shell command while in dired mode, say: `!``rpm -qf` (to find out which package owns the selected file in the directory listing), and then want to insert the result somewhere else. Or, another example: if I needed the filename of the current buffer (as in Is there a user interface in Emacs allowing one to "grab" the buffer's filename conveniently?), and there was not yet any predefined command for this, I could at least do `M-:``(buffer-file-name)` and then use this general-purpose way to copy the shown result to the kill-ring in order to paste it later. (Of course, I could eval `(kill-new (buffer-file-name))`, but this example here is to illustrate what kind of general-purpose way to do the grabbing of the echoed result I'm looking for.)


Numbering convention for the linux kernel?

What is the convention for numbering the linux kernels? AFAIK, the numbers never seem to decrease. However, i think I've seen three kinds of schemes   * 2.6.32-29   * 2.6.32-29.58   * 2.6.11.10 Can anybody explain what are the interpretations of these numbers and formats?


Can't access NTFS drives after Elementary OS install

I have just setup Elementary OS. I have two hard drives on my desktop and I can’t access either one of them via file manager. To be precise I have two partitions with data that I need to access; dev/sda4(on a 160GB hard drive) and dev/sdb1(on a 1 TB hard drive). I can see these drives using disk utility and gparted and they show them as unknown drives. I have searched the internet for this problem and can’t seem to get anywhere. I have found that I may need to run the command “sudo blkid” to find the device UID so I can mount them with fstab. But whenever I run "sudo blkid" , I just get the UIDs of the ext4 partion(where I installed elementary) and the swap partition. I really need to access the data on those NTFS partitions. Is there any way I can mount those drives on Elementary?


Negatives/downsides of Ubuntu's no-root sudo setup

By default, Ubuntu does not create a root account that the user can login to. Instead users use `sudo` when they need to perform actions that require administrative access. Obviously, the people at Ubuntu feel like this is a good idea, and everything I've read on the Ubuntu site gives plenty of reasons why they think it's a _good_ idea (see RootSudo @ the Ubuntu Wiki, for example). However, many other mainstream distributions, such as Debian, Gentoo, etc. don't set things up this way by default, and I'm trying to figure out why. If Ubuntu's default sudo-root setup is such a good idea, why aren't all of the other mainstream distros doing it too? This leads me to believe that there might be strong reasons for NOT setting it up this way; but I'm having trouble finding anything that gives any details on this. All I'm finding is articles/posts that talk about how great it is ... So my question is: Are there any major problems with Ubuntu's sudo setup (insecurity, functional limitations, etc.) that prevent other distributions from using this setup, and if so what are they? Of course, it might simply be a great idea that other distros have just been slow to pick up on, or resistant to because it's different from how things have worked for the past 30 years. If that's the case, I'd like to know that to.


How to register Nginx as a service, after installing Passenger?

I need passenger/nginx to run many sites on port 80. I have installed it with its own installer (per the instructions on the nginx website. But nginx is not registered as a service. I can only run it through the binary. I need to be able to do this:               $ service nginx restart      Shouldn't passenger have registered nginx as a service?   How can I get Ubuntu's daemon scripts to start the service?


Can I do ssh and do for loop and touch files in a single shot?

for account in ${accounts}     do             `ssh -q id@server "touch EVENTS_${account}_${date}.log"`     done      Instead of doing ssh so many times, can I just do ssh and run the for loop and touch the files?


Start up ssh connection on startup

I need to start a ssh connection to a proxy in order to have access to some resources. I have written the shell script and managed to run the script successfully. However, I found it very inconvenient to run it every time I need to use it. The best I think I should have is run the script in machine startup. But I have one problem: After my machine connects with the proxy, the proxy requires me to input the password in order to authenticate. But how can I tell the shell to "input" the password for me, so I do not need to type it? Any hint? **Solution：**               set timeout 60     spawn /usr/bin/ssh -D 22 -g name@ssh.sshcenter.info     expect {     "password:" {     send "*******\r"     }     }     interact {     timeout 60 { send " "}     }      Then use **expect** command to execute the script. Very nice.


How can I find out a file's range of LBA's using its inode?

While answering this U&L question titled: What command do I use to see the start and end block of a file in the file system?, I tried to figure out if it was possible to determine a file's LBA using it's inode. My answer determined that I could use `hdparm` as one method for finding LBAs:               $ sudo hdparm --fibmap afile           afile:      filesystem blocksize 4096, begins at LBA 0; assuming 512 byte sectors.      byte_offset  begin_LBA    end_LBA    sectors                0  282439184  282439191          8      But I was curious if there was some method using a file's inode to also get the LBA's; without using `hdparm`. I think there might be alternative methods hiding in the tools `filefrag`, `stat`, `debugfs`, and `tune2fs` but teasing it out is eluding me. Can anyone think of alternatives? * * * _Here's some of my research thus far that might be useful to those brave enough to attempt to answer this._ ### filefrag I suspect you could use the tool `filefrag` to do it, specifically using the results from its `-e` switch, perhaps by performing several calculations to get there that I'm not that familiar with. _sample output_               $ filefrag -e afile     Filesystem type is: ef53     File size of afile is 20 (1 block of 4096 bytes)      ext:     logical_offset:        physical_offset: length:   expected: flags:        0:        0..       0:   35304898..  35304898:      1:             eof     afile: 1 extent found      ### inodes Another potential method I suspect might have potential is to use a file's inode information, either directly or through some complex math that is poorly documented on the interwebs. _Example_ First we find out the file's inode. We can do this using either the `stat` command or `ls -i`. _stat_               $ stat afile        File: ‘afile’       Size: 20          Blocks: 8          IO Block: 4096   regular file     Device: fd02h/64770d    Inode: 6560281     Links: 1     Access: (0664/-rw-rw-r--)  Uid: ( 1000/    saml)   Gid: ( 1000/    saml)     Context: unconfined_u:object_r:user_home_t:s0     Access: 2013-12-27 18:40:12.788333778 -0500     Modify: 2013-12-27 18:40:23.103333073 -0500     Change: 2013-12-27 18:44:03.697317989 -0500      Birth: -      _ls -i_               $ ls -i      6560281 afile      With the inode information in hand, we can now open up the filesystem this file resides on using the tool, `debugfs`. **NOTE:** To determine the filesystem a file resides on you can use the command `df <filename>`. Now if we run `debugfs` and run the command `stat <inode #>` we can get a list of extents that contain this file's data.               $ sudo debugfs -R "stat <6560281>" /dev/mapper/fedora_greeneggs-home     debugfs 1.42.7 (21-Jan-2013)     Inode: 6560281   Type: regular    Mode:  0664   Flags: 0x80000     Generation: 1999478298    Version: 0x00000000:00000001     User:  1000   Group:  1000   Size: 20     File ACL: 0    Directory ACL: 0     Links: 1   Blockcount: 8     Fragment:  Address: 0    Number: 0    Size: 0      ctime: 0x52be10c3:a640e994 -- Fri Dec 27 18:44:03 2013      atime: 0x52be0fdc:bbf41348 -- Fri Dec 27 18:40:12 2013      mtime: 0x52be0fe7:18a2f344 -- Fri Dec 27 18:40:23 2013     crtime: 0x52be0dd8:64394b00 -- Fri Dec 27 18:31:36 2013     Size of extra inode fields: 28     Extended attributes stored in inode body:        selinux = "unconfined_u:object_r:user_home_t:s0\000" (37)     EXTENTS:     (0):35304898      Now we have the extents information above, and this is where I get lost and do not know how to proceed. ### References   * Finding what hard drive sectors occupy a file   * Identifying file associated with unreadable disk sector   * Bad block HOWTO for smartmontools   * C5170 Lecture notes -- Internal Representation of Files - The Unix File System   * Logical block addressing   * Ext4 Disk Layout


nginx + php5-fpm doesn't work properly. I see a white screen only

I've just installed nginx and php5-fpm and I wanna test it on port 82. So I call http://mysite.com:82/test555.php and I see nothing. Just a white screen. No errors, no warnings, I don't see nothing at all :) There are an error log of nginx and an error log of php5-fpm - but... There are no any errors. I don't undestand what's wrong. Please help me to find out it.               root@localhost:# echo "<?php phpinfo(); ?>" > /home/www/public_html/test555.php     root@localhost:# chmod 755 /home/www/public_html/test555.php     root@localhost:# cat /etc/nginx/sites-available/default     server {             listen 82;             root /home/www/public_html;             index index.php index.html;                  server_name mysite.com;             access_log /var/log/nginx/nginx-access.com.log;             error_log /var/log/nginx/nginx-errors.com.log;                  location ~ \.php$ {                     fastcgi_pass unix:/var/run/php5-fpm.sock;                     # fastcgi_pass 127.0.0.1:9000;                     fastcgi_index index.php;                     fastcgi_param SCRIPT_FILENAME   $document_root$fastcgi_script_name;                     fastcgi_param QUERY_STRING              $query_string;                     fastcgi_param REMOTE_ADDR               $remote_addr;             }     }          root@localhost:# /etc/init.d/nginx status      * nginx is running          root@localhost:# /etc/init.d/php5-fpm status      * php5-fpm is running          root@localhost:# ls -la /var/run/php5-fpm.sock     srw-rw-rw- 1 root root 0 Feb  3 01:14 /var/run/php5-fpm.sock          root@localhost:# cat /var/log/php5-fpm.log      ....     [03-Feb-2014 01:14:52] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful     [03-Feb-2014 01:14:52] NOTICE: fpm is running, pid 19080     [03-Feb-2014 01:14:52] NOTICE: ready to handle connections          root@localhost:# cat /var/log/nginx/nginx-access.com.log     ...ip... - - [03/Feb/2014:01:29:44 +0000] "GET /test555.php HTTP/1.1" 200 5 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:26.0) Gecko/20100101 Firefox/26.0"          root@localhost:# cat /var/log/nginx/nginx-errors.com.log          root@localhost:#      What can I do next to find out what's going on? I see it should work fine. PHP script returns me code=200 but I doesn't see the output. It never been called, because I tried to add file_put_contents there and it really never been called by nginx. I use ubuntu 12.04 fully upgraded today.


htop gives blank screen

Previously I was using `htop` on 32-bit Manjaro, and it worked fine, then I switched to 64-bit ArchLinux, when starting `htop` it shows a blank screen, and any key press does nothing. I've tried to add `TERM=xterm-color htop`, but it does the same. My current `$TERM` value is `xterm-256color`. I've tried `extra/htop 1.0.2-2`, `aur/htop-svn 308-1` and also `aur/htop- blueweb 1.0.2-1` all give me a blank screen, anything I should do to fix this? EDIT: additional info for ldd: output of `ldd /usr/bin/htop`               linux-vdso.so.1 (0x00007fff5ba70000)     libncursesw.so.5 => /usr/lib/libncursesw.so.5 (0x00007fecdc490000)     libm.so.6 => /usr/lib/libm.so.6 (0x00007fecdc188000)     libc.so.6 => /usr/lib/libc.so.6 (0x00007fecdbdd8000)     /lib/ld-linux-x86-64.so.2 (0x00007fecdc6f8000)      i've tried to reinstall these packages:               core/glibc     multilib/lib32-glibc     core/ncurses      but there are no luck EDIT2: found out using `strace` that there are some program that causes `htop` to hang, after restarting the computer, problem solved..


Use grep with or

How do I search in a textfile with grep for the occurrence of a word or another word? I want to filter the apache log file for all lines including "bot" or "spider"               cat /var/log/apache2/access.log|grep -i spider      shows only the lines including "spider", but how do I add "bot"?


Where to supply authentication details to the Network Proxy (Central Proxy) on Fedora?

My system is running Fedora 16 and I live in a campus where we use LAN to connect to the Internet. And for this, we use an http proxy with authentication (username & password). I tried putting the `proxyaddress:port` in the Network Proxy settings after going to the Network Settings window. However, it never asked for an authentication and the programs that use the internet are unable connect, except for Firefox because it asks for authentication. Also, I could get Yum to work by manually editing `yum.conf`. I even tried using `http://username:password@proxy:port` like in the Yum configuration but it has not helped. Is there any solution to this problem? Thank you.


How to interpret an octal or hex dump of a binary file?

The binary file has strings and some numbers, If I do `od -c filename` or `strings filename`, I can see the strings properly. But, what about numbers? They are in some weird format. The text after doing `od -c filename` is like this:               0000000 036  \0 032 004   S   D  \0  \0  \0  \0   s   e   q   1     0000020          \0  \0  \0  \0  \0  \0  \0  \0  \t  \0   ó 002   3 001     0000040   &  \0 032  \f   O   2 006  \0  \0  \0   o   s   f   u   s   1     0000060           ó 002   3 001   ÿ  \r  \0  \0  \t  \0  \0   @   3   ×     0000100 233   º 004  \0   é 003  \0  \0   &  \0 032  \f   O   2   7  \0     0000120  \0  \0   o   s   f   e   u   1           ó 002   3 001   é 235     0000140  \0  \0 035 003  \0   @   3   × 233   º 004  \0   Ñ  \a  \0  \0     0000160   ä  \0 032  \f   O   r   E  \0  \0  \0   o   s   f   a   p   1      How to decipher this? I even tried `hexdump -C filename` The output is like this:               00000000  1e 00 1a 04 53 44 00 00  00 00 73 65 71 31 20 20  |....SD....seq1  |     00000010  20 20 00 00 00 00 00 00  00 00 09 00 f3 02 33 01  |  ..........ó.3.|     00000020  26 00 1a 0c 4f 32 06 00  00 00 6f 73 66 75 73 31  |&...O2....osfus1|     00000030  20 20 f3 02 33 01 ff 0d  00 00 09 00 00 40 33 d7  |  ó.3.ÿ......@3×|     00000040  9b ba 04 00 e9 03 00 00  26 00 1a 0c 4f 32 37 00  |.º..é...&...O27.|     00000050  00 00 6f 73 66 65 75 31  20 20 f3 02 33 01 e9 9d  |..osfeu1  ó.3.é.|     00000060  00 00 1d 03 00 40 33 d7  9b ba 04 00 d1 07 00 00  |.....@3×.º..Ñ...|     00000070  e4 00 1a 0c 4f 72 45 00  00 00 6f 73 66 61 70 31  |ä...OrE...osfap1|      To clarify, the main file which is a regular file had one attribute which was displaying is some weird format, so we are looking at the raw/binary file. Doing octal dump on the regular file, resolved the viewing problem. With `grep 'id=123' regular_file | head -1 | od -c`, I was able to see what number was in there. I was expecting 1, it showed to us as 001.


How to edit /etc/sysconfig/iptables from: RESCUE MODE boot?

Let's say the `/etc/sysconfig/iptables` needs to be edited because, due to it I can not ssh to my server. I start my server in "Rescue Mode", but when I login, there is no such thing as `/etc/sysconfig/iptables` to edit. What can be done so I can edit that file from this rescue mode? Or at least, is there a way to reboot the system while ensuring, `iptables` is not started, while inside of the rescue mode?


Trying to install Fedora using Unetbootin on a windows 8 laptop

The Unetbootin does whatever it says it needs to do, and then when I restart my computer and attempt to launch it says that it cannot find ubnldr.mbr and won't launch. How can I fix this, or is there an easier way to do the same thing?


Which AIX command's output is this?

Disk          Path  P     Location   adapter    LUN SN       Type         Size   LSS     Vol  Rank  C/A   S   Connection  port RaidMode     -------       -----  -   -----------  ------   -----------  ------------   ----   ----    ---  ----- ----  -   ----------- ---- --------     vpath0        hdisk7     06-00-02[FC] fscsi2   35KJ1320504  IBM 2107-900 65.5GB     2      2   0002   0e   Y   R1-B4-H1-ZA  300 RAID5     vpath0       hdisk19     06-00-02[FC] fscsi2   35KJ1320504  IBM 2107-900 65.5GB     2      2   0002   0e   Y   R1-B7-H3-ZA  630 RAID5      What command produces this output on AIX?


What's the difference between /etc/rc.local and /etc/init.d/rc.local?

I want to add a permanent `iptables` rule to my new `VPS`, and after brief google search i was surprised that there are two places this rule can be added, that seems like identical: `/etc/rc.local` and `/etc/init.d/rc.local`. Maybe someone knows why where is two places for simple startup code to place? Is it linux flavor specific (but ubuntu has both!)? Or one of them is deprecated?


Error when installing Oracle VirtualBox on Ubuntu 12.04

I got the following error and couldn't find any solution on Google:               apt-get -f install VirtualBox-4.3          dpkg: error processing /var/cache/apt/archives/virtualbo 4.3_4.3.6-91406~Ubuntu~precise_amd64.deb (--unpack):          error creating directory `./usr/share/virtualbox/rdesktop-vrdp-keymaps': Read-only file system          dpkg-deb (subprocess): subprocess data was killed by signal (Broken pipe)     dpkg-deb: error: subprocess <decompress> returned error exit status 2          Errors were encountered while processing:     /var/cache/apt/archives/virtualbox-4.3_4.3.6-91406~Ubuntu~precise_amd64.deb     E: Sub-process /usr/bin/dpkg returned an error code (1)


lower bound for download speed in wget

I am trying to download some files by using `wget` but after an hour my download speed decrease. And if I cancel downloading and restart it, download speed will increase for an hour. Is it possible to put a lower bound for download speed in `wget`, so that when speed becomes lower than that threshold, `wget` restarts or gets restarted?


How do I partition a USB drive so that it's bootable and has a Windows-compatible data storage partition?

**split from here** I have a 16gb flash drive, which I want a live ISO to boot from (via unetbootin or something similar). It'll be some 32bit distro that I can plug- in and boot on whatever computer I need to. Since it will be a live ISO, I'll need somewhere to save data. I want the USB drive to have about 1gb for the distro, and the other 15gb for data storage. I made two FAT partitions, the first called 'bootable' and the second 'storage'. The storage works fine in Linux, but Windows only sees the bootable partition. The storage isn't accessible. How can I make the data accessible on Windows, and still have a bootable distribution? If the answer is how to partition it, please include the order and type of each partition. Do I need swap space for this, or is this handled differently?


NFS Ownership/Permissions

I'm trying to get NFS working properly on a DD-WRT install using OTRW2. I can see and mount the share from the client. But when I do, the mounted folder changes it's owner to `root:root` and so my normal user does not have write access. I saw this post by Frater (the original author of the scripts), in which he says that the `unfsd` service is running as `www-data:www-data` and that the share should be `chown`ed. However when I try `chown`ing the `/mnt` symlink or the `/tmp/mnt` mount, I receive the following:               root@router:~# sudo chown www-data:www-data /mnt      changing ownership of `/mnt': Operation not permitted      root@router:~# sudo chown www-data:www-data /tmp/mnt      changing ownership of `/tmp/mnt': Operation not permitted      My `mount`s look like this:               root@router:/opt# mount      rootfs on / type rootfs (rw)      /dev/root on / type squashfs (ro)      none on /dev type devfs (rw)      proc on /proc type proc (rw)      sysfs on /sys type sysfs (rw)      ramfs on /tmp type ramfs (rw)      devpts on /dev/pts type devpts (rw)      devpts on /proc/bus/usb type usbfs (rw)      /dev/discs/disc0/part1 on /opt type ext3 (rw,noatime,data=ordered)      /dev/sda3 on /tmp/mnt type vfat rw,noatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1)      I've tried the default `exports` file as well as this:               root@router:~# cat /opt/etc/exports                                       # /etc/exports: the access control list for filesystems which may be exported      #      to NFS clients.  See exports(5).      #      /mnt       192.168.1.0/24(rw,sync,no_subtree_check,all_squash)          # default     #/mnt       192.168.0.0/255.255.0.0(rw,no_root_squash)      On the client I have a directory that starts out as:               drwxr-xr-x  2 kyle users   4096 Feb 16 09:43 NAS      I've tried from the command line:               kyle@client:~$ sudo mount -v -t nfs router:/mnt NAS      mount.nfs: timeout set for Sun Feb 16 14:09:17 2014      mount.nfs: trying text-based options 'vers=4,addr=192.168.1.1,clientaddr=192.168.1.117'      mount.nfs: mount(2): Protocol not supported      mount.nfs: trying text-based options 'addr=192.168.1.1'      mount.nfs: prog 100003, trying vers=3, prot=6      mount.nfs: trying 192.168.1.1 prog 100003 vers 3 prot TCP port 2049      mount.nfs: prog 100005, trying vers=3, prot=17      mount.nfs: trying 192.168.1.1 prog 100005 vers 3 prot UDP port 2049      And with various `fstab` lines:               # router NAS mounting      router:/mnt           /home/kyle/NAS             nfs      auto      0 0      #router:/mnt           /home/kyle/NAS             nfs      rsize=8192,wsize=8192,timeo=14,intr,_netdev,nfsvers=3   0 0      But the folder always ends up as:               drwxr-xr-x 10 root root   16384 Dec 31  1969 NAS      What do I need to do to make the NFS share writable from the client side?


Fedora doesn't start X on boot

Since a few months I have been facing a problem with Fedora 15. Whenever I start my system, the command prompt is displayed instead of the GUI login. I need to provide a username and password from the command line every time, and after that I have to run `startx`. Whats wrong with my system? Is there any missing file or configuration? How do I fix this problem? Do i need to reinstall my system to solve this problem? Any help and idea will be appreciated.


Failed to boot Grub Error Fedora 17

I had two hard disks. One is internal, 320GB, all NTFS, where Windows 7 is installed in a ~20GB partition. The other is external, 160GB, where I have installed Fedora. Now when I had installed Fedora I completely detached my internal drive so there is no relationship between internal drive (having Windows) and external. I had installed Fedora17 32bit on my 168GB external drive & I was loving it for about 2 weeks. However something bad happened and now whenever I boot via external drive 'Grub Error, unknown filesystem' appears and I can't proceed. I had been using following partitioning layout: (all as ext4)               /boot 300mb     / 30gb     /opt 9gb     swap 2gb      ...rest as NTFS (to be used universally) The following application (under Windows) has the feature of even identifying Linux based filesystems but as you can see everything is corrupted. ![MiniTool screenshot](http://i.stack.imgur.com/96EnS.jpg) Now I can absolutely recal that I did two things that I believe may be the source of corruption & I urgently need help in troubleshooting it.   1. First thing I did was to apply this tutorial. I know this may appear stupid to apply Ubuntu way over Fedora but I was close to solving it... After applying this tutorial I did log-off several times perfectly but didn't reboot!   2. This may well be the probable reason of corruption. As I said I had one NTFS drive so that I can use it even under my Win7...so I logged on to my win7 as always. I had to do some data transfer from my windows to that NTFS partition but I saw some folder namely `./install` or something like that those may have been created by Fedora but I (being silly) just deleted them I don't know whether they were important or not but after this I shutdown my Win then booted via external drive and first time my Fedora took me to Grub selection menu but failed to start I can't recall comprehensively but it asked me to press Ctrl+D or enter root password for recovery I suppose. I panicked (because I have installed many educational application in my Fedora) and just restarted via pressing Ctrl+Alt+Del then the final dreadful error 'Grub error Unknown filesystem`. I booted via bootable USB the same O installed Fedora with, the following screenshot is of application 'Disks' ![Disks screenshot](http://i.stack.imgur.com/mNalv.png) It doesn't recognise anything except the swap and NTFS (labelled khanz) partitions. I even can't retrieve my Maple/Matlab licences from these (as of now) — unknown filesystems? I was told that I should have a separate `/boot` partition because that avoids what I am facing presently, but that didn't go well either.


Find my computer on a LAN network

Let's say that I have a computer plugged in to a local network using a dhcp connection, so it will get a different IP every time. Is there a way to find this computer (so the IP) from a different computer on the same local network? Both computers run Linux. I can set up the "lost" computer a'priori before it gets restarted (and gets a different IP), but I would prefer a solution that just works out of the box (if it exists).


Finding the IP address of an ssh connection made in the past

A few weeks ago I made a few ssh connections from my home PC to my college PC and the other way around. Currently I am sitting at my home PC and I am trying to figure out what was the college PC IP address. Any idea where I could find some clues? I scanned the log files and bash history, but there was nothing obvious there. I am running Debian Testing.


Why does Linux show both more and less memory than I physically have installed?

I know about swap - this question isn't about that. In dmesg, the Linux (x86-64) kernel tells me this about how much memory I have:               [    0.000000] Memory: 3890880k/4915200k available (6073k kernel code, 861160k absent, 163160k reserved, 5015k data, 1596k init)      `cat /proc/meminfo` tells me that I have               MemTotal:        3910472 kB      And by my calculations, I think I should have exactly 4*1024*1024=4194304k RAM. Which is **way** smaller than the second figure in the dmesg line above! What's with all these different figures? By the way, `uname -a` outputs:               Linux pavilion 3.2.2-1.fc16.x86_64 #1 SMP Thu Jan 26 03:21:58 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux


Creating a debian package that depends on libcudart.so.6.0 from cuda-core-libs-6-0

I try to create a Debian package for a program that depends on libcudart.so.6.0. The debuild script aborts with:               dpkg-shlibdeps: Fehler: Bibliothek libcudart.so.6.0 konnte nicht gefunden werden, benötigt von debian/myprog-cuda/usr/bin/myprog-cuda (ELF-Format: »elf64-x86-64«; RPATH: »«).     dpkg-shlibdeps: Fehler: Kann wegen des vorangegangenen Fehlers nicht fortfahren.     Hinweis: Bibliotheken werden nicht in anderen Binärpaketen, die keine Shlibs-oder Symboldatei haben, gesucht.     Um dpkg-shlibdeps dabei zu helfen, private Bibliotheken zu finden, könnte es notwendig sein, LD_LIBRARY_PATH zu setzen.     dh_shlibdeps: dpkg-shlibdeps -Tdebian/myprog-cuda.substvars debian/myprog-cuda/usr/bin/myprog-cuda returned exit code 2     make: *** [binary-predeb-IMPL/myprog-cuda] Fehler 2     dpkg-buildpackage: Fehler: Fehler-Exitstatus von fakeroot debian/rules binary war 2     debuild: fatal error at line 1350:     dpkg-buildpackage -rfakeroot -D -us -uc failed      I think the equivalent english message is "couldn't find library libcudart.so.6.0 needed by debian/myprog-cuda/usr/bin/myprog-cuda". However, the path to that library is already in LD_LIBRARY_PATH. If I start the dpkg-shlibdeps script manually, then I get a different error message:               $ dpkg-shlibdeps -Tdebian/myprog-cuda.substvars debian/myprog-cuda/usr/bin/myprog-cuda     dpkg-shlibdeps: Fehler: Keine Abhängigkeitsinformationen für /usr/local/cuda-6.0/targets/x86_64-linux/lib/libcudart.so.6.0 (verwendet von debian/myprog-cuda/usr/bin/myprog-cuda) gefunden.      This certainly means "no dependency information found for /usr/local/cuda-6.0/targets/x86_64-linux/lib/libcudart.so.6.0 (used by debian/myprog-cuda/usr/bin/myprog-cuda)" I can fix this problem with               $ echo 'libcudart 6.0 cuda-core-libs-6-0' >debian/shlibs.local      Now, 'dpkg-shlibdeps' completes successfully, when I start in myself. However, this does no affect 'debuild' - it still fails the same way it failed before. It seems that 'debuild' runs 'dpkg-shlibdeps' differently from me. Any idea how to track down or fix the problem?


Debian 6 NDISwrapper doesn't install correctly

I'm using Debian 6. I've been trying to set up the Netgear N300 WiFi (model number WNA3100) adapter but haven't been successful. The Ndiswrapper was installed from .deb packages which I downloaded on one computer and transfered to the computer I'm haveing issues with. I have added it to /etc/modules               USERNAME@COMPUTERNAME:~$ sudo ndiswrapper     install/manage Windows drivers for ndiswrapper          usage: ndiswrapper OPTION     -i inffile       install driver described by 'inffile'     -a devid driver  use installed 'driver' for 'devid' (dangerous)     -r driver        remove 'driver'     -l               list installed drivers     -m               write configuration for modprobe     -ma              write module alias configuration for all devices     -mi              write module install configuration for all devices     -v               report version information          where 'devid' is either PCIID or USBID of the form XXXX:XXXX,     as reported by 'lspci -n' or 'lsusb' for the card               # /etc/modules: kernel modules to load at boot time.     #     # This file contains the names of kernel modules that should be loaded     # at boot time, one per line. Lines beginning with "#" are ignored.     # Parameters can be specified after the module name.          loop          ndiswrapper      But modprobe doesn't recognize it as present and I can't get online.               USERNAME@COMPUTERNAME:~$ sudo modprobe ndiswrapper     FATAL: Module ndiswrapper not found.


Why doesn't this piped script work?

#!/bin/bash     rm out     mkfifo out     nc -l 8080 < out | while read line     do         echo hello > out            echo $line     done      If I browse to the IP of the machine this script is running on (using port 8080), I would expect to see the word 'hello' and then on the machine running the script, I would expect it to output lines from the request. However, nothing happens. The browser gets no response, and nothing is output to the server's terminal. Why doesn't it work, and what can I modify to make it work? I want to keep it to simple pipes, I don't want to use process substitution or anything like that.


Does ntpd default allow query requests through?

I am confused as to what is the default access policy of an ntp server. According to the ntp_acc man page, access can only be denied if specifically blacklisted. > Clients can be denied service because they are explicitly included in the > restrict list created by the restrict command or implicitly as the result of > cryptographic or rate limit violations. To test if I am correct, I ran the following command on an ntp server that didn't have any restrict policy against the client and I was able to successfully query the server.               [root@localhost ~]# ntpdate -q 192.168.122.50     server 192.168.122.50, stratum 3, offset 6.177375, delay 0.02585      4 Nov 20:51:40 ntpdate[2259]: step time server 192.168.122.50 offset 6.177375 sec      This proved my theory that ntp default allows all queries to the server but not necessarily all types of ntp traffic to the server. So here are my question(s):   1. Is all access to an ntp server really unrestricted or is just queries?   2. Can a ntp client modify the time of an ntp server (I would guess this could be done by spoofing yourself as one of the ntp's server's servers but I am not sure)?


Limiting grep search

Please help! Must use grep for this assignment. Must control grep function to search for a string strictly in a given field (Sadly no delimiters) Search field is characters 12-26. Must check if user input name of choice exists or not (variable "$name"). if so, then must cut out specific fields (No problem with that) My code for this point:               ...(previous lines of code & conditions..)     while read line     do       grep -E "^.{11}[ :alpha: ]{1,15}$name" | cut -c31-43 #(eg. opponent)#      done     ...     #grep start point and end point.       How can I add the option for the user input variable `$name` into the regexp??


where are the "files" of ipcs and why are named pipes (mkfifo) not listed in ipcs

I was researching about linux shared memory and stumbled upon this `ipcs` command. From the man page:               ipcs - provide information on ipc facilities      `ipc` is not explained in the man page but it most likely stands for inter- process communication. That also makes sense from the context of the information it lists: shared memory segments, message queues and semaphore arrays. I was wondering, since everything in linux/unix is a "file", or at least a file-like object, where are the "files" from the elements listed in `ipcs`? Why are named pipes created by `mkfifo` not listed in `ipcs`? As far as I understand fifos are queues. How are the named pipes created by `mkfifo` different from the message queues created by `ipcmk`?


How to manage installed from source programs?

I have servers (with Debian or Centos) and I would like to install programs from sources, because I can always have up to date software. If I want to install some program from source I usually do next steps:   1. Download archive with source   2. Unzip and cd to directory with source   3. Run `./configure prefix=/usr/local`   4. `make && sudo make install` After that I remove downloaded archive and unzipped folder with source. My questions are:   1. If I want to update program to newer version, what steps should I perform?   2. How can I remove program installed in such way?   3. Is it correct to remove folder with source after installation or it can be usefull later?


Apache server in raspberry PI not visible from outside( public IP)

I have made a fresh install of Arch Linux ARM into a Raspberry PI and I mounted there a LAMP, all fresh. I have another Arch(x86) in my laptop with Apache also there, and as far as I know, two web servers cannot run in the same network segment so, the problem is as follows. In my laptop, having Apache running, if I enter via the public ip of my network everything turns ok and I can see my website but, (obviously turning this server down) if I enter from the public IP with the Apache running in the raspberry pi( yes, only that Apache running) i cannot see my website in there. Also, if I access via local network it is a normal success, I can see my website. So, I can enter my raspberry website only via local but in my other web server i can enter it via local and public. I have the same conf files in both of them so what is the difference? I was planning in making the rpi as a development server.   Thanks in advance


Command to list contents if directory, or do output contents if file?

Is there any command to list the contents if passed a directory, but output the contents if it's a file? For example, often when I am navigating the directory structure I will start typing into the terminal something like               ll /etc/path/  # I see a file in tab-completion that interests me, called myfile.txt     ll /etc/path/myfile.txt  # I do the auto-completion to get it into the command line     less /etc/path/myfile.txt  # Now I have to go back and change 'll' to 'less'      Alternatively, if I'm looking for a file, I start with               less /etc/path  # I see in tab-completion several files that might interest me, so I need to know more     ll /etc/path  # See more info about file sizes, etc, so I can choose the file I want. Have to change 'less' to 'll'     less /etc/path/myfile.txt  # Now that I know which file I want, I have to go back and change 'll' to 'less'      This is something I end up doing dozens of times a day, and starts to slow me down. Is there a command or script that does the likeliest scenario for you? For example               some-program /etc/path/to/file/or/directory      If the target is a text file or symlink to a text file, 'less /etc/path/to/.....' would be executed. But if it were anything else, e.g. directory, binary file, block device, it would do 'll /etc/path/to/......' Of course if it does something you don't want, like 'less' on a file symlink but you want to see the symlink itself with 'll', then you just run 'll' manually. Anything like this exist (I bet it's out there, it seems like such a common task)? Or am I just using Linux command line in an inefficient way and there are better ways to navigate through it...how do you do it? Or I am really the only one going back and forth in the command line all the time switching 'less' to 'll' and back again? I tried writing something but I'm a bash beginner so it's definitely not working, and quite clunky even if it were. Surely there's a better way out there, some magic command I've just not heard about?               some-program() {       if [[ $# > 1 ]]; then         echo "Only one argument supported at this time"       exit 1       fi       if [[ $# == 0 ]]; then         ELEMENT="."       else         ELEMENT="$1"       fi       if [[ -d $ELEMENT ]]; then         ls --color=auto -alF "$ELEMENT"       else         less "$ELEMENT"       fi     }


Rsync adding a "?" at the beginning of directories

I currently have many of these commands running in a `.sh` file that looks like this:               rsync -avz -e ssh --rsh='ssh -p1337' --bwlimit=10000 root@DestinationIP:/home/backup /home/localbackup     rsync -avz -e ssh --rsh='ssh -p1337' --bwlimit=10000 root@DestinationIP:/home/backup2 /home/localbackup2      When I go to run this, it goes through to the destination correctly, but adds a "?" to the beginning of the directory locally, which prompty fills up the hard drive to the brim. Have I done a flag incorrectly? I thought `rsync` was supposed to sync the directories, not duplicate them.


What's those underscore commands?

When I `tab tab` `_` in terminal, Bash suggests 206 posibilities. I tried to run one of them `_git_rm` but nothing happend, what are they? Here is a screenshot: ![enter image description here](http://i.stack.imgur.com/AadL6.png)


how to determine how many times pid_max wrapped?

Is it even possible to know that? may be some kind of tests are required to be performed in order to find that information? My system, just after I login, seem to have already wrapped the max_pid, so a still alive pid got the same pid of an old process (what messes one of mine scripts...)! I am trying to understand what is happening and if there is some workaround to that... my `/proc/sys/kernel/pid_max` is 32768