Error: Missing newline before EOF - inserted

In my application I am inserting some files in main file. In that there is common header file to all the code files `(*.c)`. This giving me error:               D:\New folder\COM_Port_Cont\COM_Port_Task.h(268) : Error 1 : missing newline before EOF - inserted     D:\New folder\COM_Port_Cont\COM_Port_Task.c(48) : Error 2 : missing newline before EOF - inserted     D:\New folder\COM_Port_Cont\Hdw_Ecg_1X5.c(129) : Error 3 : missing newline before EOF - inserted     D:\New folder\COM_Port_Cont\Timer_Wdg_1XX.c(39) : Error 4 : missing newline before EOF - inserted     D:\New folder\COM_Port_Cont\Main_Prj_Rfid.c: 0 warnings, 4 errors.      In this `COM_Port_Task.h` is the common header file.


What is the relationship between GNU and GNOME?

Is there any relation between GNU and GNOME? And further related license GPL?


List only files in a directory and show the inode number

How can I list all files but not directories in a given directory and show the inode-numbers. Something like `ls -li | grep ^-` does not work since the inode number is shown in the beginning of the line.


GTK3+ and C++ on OSX - "No GSettings schemas are installed" error

I'm trying to run a C++ example with GTK3+ and GStreamer components on OSX. I can gcc compile the source with: `gcc -o basic5 basic-tutorial-5.c 'pkg-config --libs --cflags gstreamer-1.0 gstreamer-video-1.0 gtk+3.0'` but when I try to run it I get the following error:               GLib-GIO-ERROR **: No GSettings schemas are installed on the system      I read somewhere to try gsettings list-schemas. That resulted in:               Segmentation fault: 11


Difference in regular expression handling between Perl, Kikki, and Kodos

#!/usr/bin/perl          $mystring = "[2004/04/13] The date of this article.";     if($mystring =~ m/(\d+)/) {             print "The first number is $1.";     }      Perl returns `2004`, but Kiki and Kodos return `/04/`. Why that?


How to use a built in driver in the kernel?

I am building the 3.14 kernel for a board that requires the intel e1000e driver. I would like this kernel to have the driver built in so that I can remove loadable module support. I have chosen the option in menu config and verified that the driver is compiled (the .o exists), however the device does not appear to be found or recognized. Is there something I am missing to add a module to the kernel?


How to search for a string only in textfiles? (recursively)

I can list all the textfiles (by mimetype) in a folder with:               find . -type f -print0 | xargs -0 file -i | fgrep -i text | sed 's/:$//g' 2>/dev/null | awk 'BEGIN {FS=": "} {print $1}'      Ok. But how can I add "fgrep" to this, to search in these files for "STRING" (regexp not needed, that's why fgrep). this isn't good:               fgrep -iR "STRING" *      because it starts to search in ISO files, binary files too... Fedora14/bash.


Keeping my production webserver updated

I have a production webserver (CentOS 6.5) and I just wanted to know how do I keep this updated interms of security updates and stable. For example, is it safe interms of not breaking anything on the server if I run this command?               su -c '/sbin/chkconfig --level 345 yum on; /sbin/service yum start'      This apparently updates the server automatically every day. As CentOS is supported for 10 years, I will want to make use of this.


Difference Between cp -r and cp -R (copy command)

cp- r is meant to copy files recursively, and cp -R for copying directories recursively. But I've checked, and both appear to copy both files and directories, the same thing. So, what's the difference actually?


System too slow

My linux system is responding very slowly.I should wait to get the result of my command. How can i investigate to know the problem of his behavior?


Do I have to swap IP sets, or can I add/remove on the fly?

I was wondering about the semantics of `ipset(8)`. Is it possible to add a rule matching a set to `iptables` and then manipulate the set, or can I only create a set and swap it for an older set in order to apply it to an `iptables` rule matching the name? **I.e. can I add/remove to/from an IP set ad hoc, or can I exchange whole sets while the sets are in active use?** * * * The reason I ask is this is as follows. Say I create a set               ipset create PCs hash:ip     ipset add PCs 1.1.1.1     ipset add PCs 2.2.2.2      ... et cetera. And a rule that allows access to HTTP:               iptables -A INPUT -p tcp --dport 80 -m set --set PCs src -j ACCEPT      What happens when I run:               ipset add PCs 3.3.3.3      will the `iptables` rule now take immediate effect for IP 3.3.3.3 as well? I saw it's possible to use `-j SET --add-set ...` to manipulate IP sets ad hoc from within `iptables` rules. This makes me think it should work to manipulate a set at any given point. However, the `ipset` project site seems to suggest that swapping a new (adjusted) set for another is the better alternative. Be it via `ipset swap` or via `ipset restore -!`. Can anyone shed light on this?


Performance implications of enabling sadc to collect system activity information

I would like to enable `sadc` to collect system activity information so that I could use `sar`. **What are the performance implications of enabling this?** The server in question has very little system resources (Amazon Web Services Micro instance: 1 CPU, 613 MiB RAM). Obviously I cannot benchmark before and after as this is the utility that I would be using to judge system resource usage, but _in general_ how does this affect the system?


Setting up a static IP. Please can someone explain the process

I have just installed Linux Fedora 20 on my laptop; I have it already on my main home computer. I maintain a number of files, mostly my own notes, hints and reminders about how to do things, that I would like to synchronise so that I can edit the files on either machine. I understand that I can do this via the internet, and that one of the first steps is to give each machine a static IP. The instructions to set a static IP seem to involve a lot of editing of special files, but I hesitate to start the process, in case I fumble it, because I do not know what is going on, and so some irrevocable damage. There is a bewildering number of suggestions out there, but they all leave me with the feeling that I am missing something I should already know about. So I have two related questions: 1) How do I choose a static IP, or is that created automatically as part of the process? 2) A longer one, sorry: please can someone explain the process, i.e. what is altered, and why? * * * Solved (so far) Thank you to @mat and @Stefan Schmiedl. I have followed the process Stefan suggested and both machines nicely pinged the other. Now I must look into what to do next, but so far it's nice and easy. If I need to I will put further questions in a separate post. I follow what mat says, but one of the troubles with programming and many other pursuits is that, to be able to ask a sensible question, you need quite a lot of previous knowledge of what is available and appropriate to what you want to do. If you already have that knowledge, then you may not need to ask the question. References tell you the details, but you do also need to know what particular details you want to find out about. There are two kinds of explanation: those that allow the experts to nod wisely to one another, and those that make things clear to the naive enquirer. I was after the second one, which Stefan kindly supplied * * * One more supplementary question: is this the approach to take if one machine is at home and the other is at a different location with a different internet address, router etc.? I have joined a Linux User Group that meets in council offices in another town, and would like the file synchronisation to work from there too.


Using newline delimited list as parameter

There have been several situations where I have had some output such as               thing1     thing2     thing3      But have wanted to do something like:               *command* thing1     *command* thing2     *command* thing3      An example of this would be: let's say I want to kill all screen sessions. Is there any way I can get one command to use somthing like:               screen -ls      which might result in               88.mine (detached)     22.mine (detached)      Can I do something that would result in all of the possible commands such as this:               screen -S 88.mine test -X     screen -S 88.mine test -X      in one fell swoop?


What is rpc.statd, what ports should it be listening on, and how to kill it?

I have found `rpc.statd` running from a `netstat -tunap` command, on several ports (TCP:59061, UDP:40594, UDP:919) on my Debian server. I believe it's to do with NFS but I'm not running an nfs server (AFAIK!). (Another question mentions this problem, but the packages referred to there don't exist on my system.) So what ports should it be running on, and if I don't need it (I connect to an NFS share, but I don't serve any) how do I get rid of it?


Migrate from thunderbird to sylpheed while preserving folder structure

Is there an automatic way migrate a `thunderbird` mailbox to `sylpheed` while preserving the folder structure. I tried the importexport extension for `thunderbird` and got a directory with multiple mbox files and subfolder which contain again mbox file. For example               inbox1     inbox2     foo.sdb        foo1inbox1        foo2inbox1        foofoo.sdb           foofoo1inbox1           foofoo1inbox2            foo2.sdb        foo2inbox1        foo2inbox2      Sure I can import manually every single mbox file with sylpheed, but is there an automatic way to import all at once and preserve the folder structure?


Can I set my Debian box to use OpenDNS nameservers if it uses DHCP?

I have a Debian box with this in /etc/network/interfaces:               auto eth0     allow-hotplug eth0     iface eth0 inet dhcp          auto wlan0     iface wlan0 inet dhcp         wpa-ssid NetworkName         wpa-psk NetworkPass      and this in /etc/resolv.conf (presumably this stuff gets pulled from my Cisco router automatically?)               domain cable.myisp.com     search cable.myisp.com     nameserver isp_nameserver_ip1     nameserver isp_nameserver_ip2      I'd like to use OpenDNS (or Norton Secure DNS, basically just some other DNS server), so can I just remove the first two lines from /etc/resolv.conf and update the last two with new nameserver IP addresses? Is there anything else I'd need to do? I can change the settings on my router easy enough but is it possible to do this within the OS?


LMDE: Install latest Iceweasel or Firefox

I am using LMDE (Linux Mint Debian Edition).   By default, this ships with a quite old Firefox version (21.0). And if you install Iceweasel, it does not get better. There are a number of forum posts about installing a newer version of Iceweasel OR Firefox. Ultimately a lot of them lead here: http://mozilla.debian.net/, where I am asked to add this repository to /etc/apt/sources.list               deb http://cdn.debian.net/debian experimental main      and to install as follows               $ apt-get update     $ apt-get install -t experimental iceweasel      Unfortunately, this gets me into the following error:               The following packages have unmet dependencies:      iceweasel : Depends: libc6 (>= 2.17) but 2.13-37 is to be installed                  Depends: xulrunner-23.0 (>= 23.0-2) but it is not going to be installed     E: Unable to correct problems, you have held broken packages.      If this is relevant, here is my /etc/apt/sources.list               deb http://packages.linuxmint.com/ debian main upstream import     deb http://mirror.rts-informatique.fr/linuxmint/debian/latest testing main contrib non-free     deb http://mirror.rts-informatique.fr/linuxmint/debian/latest/security testing/updates main contrib non-free     deb http://mirror.rts-informatique.fr/linuxmint/debian/latest/multimedia testing main non-free          deb http://repository.spotify.com stable non-free          # Opera sources added by smxi     deb http://deb.opera.com/opera sid non-free          # for Iceweasel 4     deb http://cdn.debian.net/debian experimental main      and my /etc/apt/sources.bk (which is probably just a backup file, is it?)               deb http://packages.linuxmint.com/ debian main upstream import     deb http://debian.linuxmint.com/latest testing main contrib non-free     deb http://debian.linuxmint.com/latest/security testing/updates main contrib non-free     deb http://debian.linuxmint.com/latest/multimedia testing main non-free


Automating excel report

Could you please help me for the below concerns.   1. I'll be executing one script which gives some output   2. Have to arrange them in a table format in excel   3. Attach the excel and send it through mail Anyone please suggest idea for automating the above steps. I can do 1st and 3rd step but i've no idea regarding the second step :(


Check if SSH is enabled or Disabled in Solaris 11

**How can I check to see if SSH is enabled on Solaris 11?** I have tried typing `ssh` in the terminal, and it came back with a list of options, which none of them made sense to me. All I want to know is if it is enabled or not. I am trying to use `PuTTY` to connect remotely, so I know my IP address that I'm connecting to is correct, but I'm not sure if SSH is enabled on this system. The reason I tried just typing `ssh`, was because I normally test to see if `gcc` is enabled, by typing `gcc` in the terminal. So I thought it would be the same concept. Thanks for your help.


Can tree be used to list the number of files per level?

As title, I need to look into a particular directory and list the number of files per level. The directory is pretty large, about 10-15 levels deep. For instance, if I have the following:               D1     |     |-- D2A (5 files in this directory)     |    |-- D3A (6 files in this directory)     |    |-- D3B (7 Files in this directory)     |     |-- D2B (1 file in this directory)      Then it should tell me that level 3 has 13 files and level 2 has 6 files (or 6+13, doesn't matter). Can `Tree` accomplish this? I've tried around mixing the options but it does not seem to work.


make ls display current date and time

I'm new to Linux and I'd like ls to display current date and time as a side effect every time I use `ls`. How do I go about changing what a command does?


open of .rpm failed: Permission denied

Whenever I try to install some .rpm I've downloaded, I'm getting:               > sudo rpm -i something.rpm     error: open of something.rpm failed: Permission denied      It seems that the choice of rpm doesn't matter. I've chmodded the the .rpm first (777) but it doesn't make a difference. What am I missing? Using `rpm -i -v` doesn't reveal any additional information. System is RHEL6 64-bit.


rsync 3.1.0 is creating empty backup directories

I just noticed that there is a discrepancy between version 3.0.9 and 3.1.0 of rsync. Running the command `$ rsync -a --delete --backup --backup-dir=../old source/ dest/` with version 3.1.0 gives the output `Created backup_dir ../old/` even when no files are copied to the backup directory. I usually add the current time to the backup directory name, which means I end up with many empty directories. With version 3.0.9 of rsync, a backup directory was only created if needed. My questions are:   1. Is this an intended behaviour, and if so, is it possible to suppress the creation of empty backup directories?   2. Can I install version 3.0.9 of rsync alongside with version 3.1.0 such that one is called say rsync309 and the other one rsync310, and then have an alias linking rsync to either of the two (which in my case means that I would keep using rsync 3.0.9 as I found this new behaviour annoying)?


Does fetchmail support SSL or TLS when using SMTP to forward email?

I am trying to forward emails that are fetched with `fetchmail` to another SMTP host, which enforces `STARTTLS`. I could not find a way to enable TLS in `fetchmail`. Is this possible at all? If so, how?


Is it possible to see cp speed and % copied?

I'm having problems when copy large files using nautilus (it gets stuck) so I need to copy using cp. I would like to know if there is any parameter that shows the % copied and also the transfer speed.


Routing Tables: What is the effect of the RTF_IFSCOPE flag?

(Related to this question I posted a while ago on apple.stackexchange.) What is the difference between the following two routing table entries:               default            E.F.G.H     UGSc            0        0     en1     default            E.F.G.H     UGScI          25        0     en1      (Where E.F.G.H is some gateway IP address.) Specifically what effect does the `RTF_IFSCOPE` flag have on the routing table entry?


Configure postfix to send and receive to and from localhost

Does anyone know what needs to be configured for postfix so that emails can be sent to localhost and received from localhost? **e.g.** send an email to user1@localhost will:   * result in user1 receiving an email in their mail client (configured to receive local emails)   * user1 can then respond to user2@localhost   * Both user1 and user2 are configured on the same machine i.e. if there is no internet/network connection both these users can still send and receive to/from each other. The reason I ask is because I want to set this up for a dev environment so that I can test an application I am developing.


Why does my Arch install hang at random stages during boot?

I've installed Arch on my Macbook Pro, and I can't get it to boot. I removed the `quiet` flag from grub.cfg to figure out what's going on, but I can't find any pattern. Here are the last few lines of three unsuccessful boots:               ...     [ OK ] Reached target Sound Card.     [ OK ] Created slice system-systemd\x2drfkill.slice.            Starting Load/Save RF Kill Switch Status of rfkill0...     [ OK ] Reached target Bluetooth.     [ OK ] Found device Hitachi_HTS[...blah blah blah...] EFI.             Mounting /boot...     [ OK ] Started Load/Save Screen Backlight Brightness of leds:smc::kbd_backlight.     [ OK ] Found device Hitachi_HTS[...blah blah blah...] home.            Starting File System Check on /dev/disk/bu-uuid/44[...valid UUID of my /home partition...]     [   7.420848] sd 6:0:0:0: [sdc] No caching mode page found     [   7.42... ] sd 6:0:0:0: [sdc] Assuming drive cache: write through     [   7.42... ] sd 6:0:0:0: [sdc] No caching mode page found     [   7.42... ] sd 6:0:0:0: [sdc] Assuming drive cache: write through     [   7.43... ] sd 6:0:0:0: [sdc] No caching mode page found     [   7.43... ] sd 6:0:0:0: [sdc] Assuming drive cache: write through      ^ Hangs here.               [ OK ] Started udev Coldplug all Devices.     [ OK ] Started Remount Root and Kernel File Systems            Starting Load/Save Random Seed...     [ OK ] Started Create Static Device Nodes in /dev.            Starting udev Kernel Device Manager...     [ OK ] Reached target Local File Systems (Pre).     [ OK ] Started udev Kernel Device Manager.     [ OK ] Started Load/Save Random Seed.     [ OK ] Reached target Sound Card.      ^ Hangs here.               [ OK ] Found device Hitachi_HTS[...blah blah blah...] EFI.            Mounting /boot...     [ OK ] Found device Hitachi_HTS[...blah blah blah...] home.            Starting File System Check on /dev/disk/bu-uuid/44[...valid UUID of my /home partition...]     [ OK ] Created slice system-systemd\x2backlight.slice.            Starting Load/Save Screen Backlight Brightness of leds:smc::kbd_backlight...     [ OK ] Started Load/Save Screen Backlight Brightness of leds:smc::kbd_backlight.     [ OK ] Created slice system-systemd\x2drfkill.slice.            Starting Load/Save RF Kill Switch Status of rfkill0...     [ OK ] Reached target Bluetooth.     [ OK ] Started Load/Save RF Kill Switch Status of rfkill0.      ^ Hangs here. I have Arch installed on a MacbookPro8,2 with rEFInd and GRUB v2.


SSH to decrypt encrypted LVM during headless server boot?

When I installed Ubuntu 10.04 and, now, 10.10, I was offered the option of enabling "encrypted LVM" for my hard drive. After choosing that option, I am prompted for my password during boot to decrypt the LVM. Now, I am thinking about setting up a headless server that runs Linux (not necessarily Ubuntu), but I am worried that since the server is headless I won't be able to decrypt it during startup. Would I be able to SSH in during boot to enter my password for the encrypted LVM? If so how do I set it up? Or is there another solution? Again this question is NOT specific to Ubuntu. Thanks.


Add applications to launcher

I recently installed Matlab in `/usr/matlab`. What do I do to make it appear in the application launcher on the top left of the taskbar?


How to setup a local POP3 server?

I'm developing a Thunderbird extension and I would like to setup a fake POP3 account to play with. What's the easiest way to setup a local POP3 server? It doesn't need to be particularly secure/robust, as it's meant only for local testing purposes.


securing SSH and disabling direct root

In these instructions below what appears on my terminal is different so not sure what I should change. After port 22 mine says #AddressFamily any and further down for protocol it has longer line saying #activation of protocol 1 then on line below uncommented Protocol 2. Also if you disable direct root login do you use sudo instead with same password you created for root? Scroll down to the section of the file that looks like this:               #Port 22     #Protocol 2, 1     #ListenAddress 0.0.0.0     #ListenAddress ::      Uncomment and change               #Port 22      to look like      Port 5678 (choose your own 4 to 5 digit port number (49151 is the highest port number AND do not use 5678  lol )          Uncomment and change      #Protocol 2, 1     to look like      Protocol 2          Uncomment and change      #ListenAddress 0.0.0.0     to look like      ListenAddress 123.123.123.15 (use one of your own IP Addresses that has been assigned to your server)      Note 1: If you would like to disable direct Root Login, scroll down until you find               #PermitRootLogin yes     and uncomment it and make it look like      PermitRootLogin no      whereas mine is this:               #Port 22     #AddressFamily any     #ListenAddress 0.0.0.0     #ListenAddress ::          # Disable legacy (protocol version 1) support in the server for new     # installations. In future the default will change to require explicit     # activation of protocol 1     Protocol 2      argh you have to do an online course just to work this forum :/


E: Some index files failed to download. They have been ignored...” when tunning “sudo aptitude update”?

This is what the end of output after I run `sudo apt-get update` on Ubuntu 12.04:               Ign http://apt.typesafe.com unicorn/main Translation-en     35% [Working]W: Failed to fetch http://ppa.launchpad.net/eclipse-team/ppa/ubuntu/dists/precise/main/source/Sources  404  Not Found          W: Failed to fetch http://ppa.launchpad.net/eclipse-team/ppa/ubuntu/dists/precise/main/binary-amd64/Packages  404  Not Found          W: Failed to fetch http://ppa.launchpad.net/eclipse-team/ppa/ubuntu/dists/precise/main/binary-i386/Packages  404  Not Found          E: Some index files failed to download. They have been ignored, or old ones used instead.      My version of Ubuntu is 12.04. **Update:** I figured out dates with this command `find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;` Here is output: /etc/apt/sources.list                1  #############################################################      2  ################### OFFICIAL UBUNTU REPOS ###################      3  #############################################################      4        5  ###### Ubuntu Main Repos      6  deb http://mirror.mirohost.net/ubuntu/ precise main restricted universe multiverse      7  deb-src http://mirror.mirohost.net/ubuntu/ precise main restricted universe multiverse      8        9  ###### Ubuntu Update Repos     10  deb http://mirror.mirohost.net/ubuntu/ precise-security main restricted universe multiverse     11  deb http://mirror.mirohost.net/ubuntu/ precise-updates main restricted universe multiverse     12  deb http://mirror.mirohost.net/ubuntu/ precise-backports main restricted universe multiverse     13  deb-src http://mirror.mirohost.net/ubuntu/ precise-security main restricted universe multiverse     14  deb-src http://mirror.mirohost.net/ubuntu/ precise-updates main restricted universe multiverse     15  deb-src http://mirror.mirohost.net/ubuntu/ precise-backports main restricted universe multiverse     16       17  ###### Ubuntu Partner Repo     18  # deb http://archive.canonical.com/ubuntu precise partner     19  # deb-src http://archive.canonical.com/ubuntu precise partner     20       21  ###### Ubuntu Extras Repo     22  # deb http://extras.ubuntu.com/ubuntu precise main     23  # deb-src http://extras.ubuntu.com/ubuntu precise main     24  # deb http://linux.dropbox.com/ubuntu precise main     25  # deb-src http://linux.dropbox.com/ubuntu precise main      /etc/apt/source.list                1  deb http://security.ubuntu.com/ubuntu precise-security main universe      /etc/apt/sources.list.d/webupd8team-y-ppa-manager-precise.list                1  # deb http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu precise main      2  # deb-src http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu precise main      /etc/apt/sources.list.d/google-talkplugin.list                1  ### THIS FILE IS AUTOMATICALLY CONFIGURED ###      2  # You may comment out this entry, but any other modifications may be lost.      3  deb http://dl.google.com/linux/talkplugin/deb/ stable main      /etc/apt/sources.list.d/playonlinux.list                1  # deb http://deb.playonlinux.com/ quantal main      /etc/apt/sources.list.d/private-ppa.launchpad.net_commercial-ppa- uploaders_intellij-idea-ce_ubuntu.list                1  # deb https://private-ppa.launchpad.net/commercial-ppa-uploaders/intellij-idea-ce/ubuntu precise main #Added by software-center; credentials stored in /etc/apt/auth.conf      2  deb https://private-ppa.launchpad.net/commercial-ppa-uploaders/intellij-idea-ce/ubuntu precise main #Added by software-center; credentials stored in /etc/apt/auth.conf      /etc/apt/sources.list.d/webupd8team-sublime-text-3-precise.list                1  # deb http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu precise main      2  deb-src http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu precise main      /etc/apt/sources.list.d/typesafe-apt.list                1  # Typesafe repository.      2  deb http://apt.typesafe.com/ unicorn main # Typesafe "unicorn" releases.      /etc/apt/sources.list.d/eclipse-team-ppa-precise.list                1  deb http://ppa.launchpad.net/eclipse-team/ppa/ubuntu precise main      2  deb-src http://ppa.launchpad.net/eclipse-team/ppa/ubuntu precise main      /etc/apt/sources.list.d/medibuntu.list                1  ## Please report any bug on https://bugs.launchpad.net/medibuntu/      2  deb http://packages.medibuntu.org/ precise free non-free #Medibuntu - Ubuntu 12.04 "precise pangolin"      3  # deb-src http://packages.medibuntu.org/ precise free non-free #Medibuntu (source) - Ubuntu 12.04 "precise pangolin"      /etc/apt/sources.list.d/lezhoev-qstamina-precise.list                1  deb http://ppa.launchpad.net/lezhoev/qstamina/ubuntu precise main      2  deb-src http://ppa.launchpad.net/lezhoev/qstamina/ubuntu precise main      /etc/apt/sources.list.d/webupd8team-java-precise.list                1  deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main      2  deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main      /etc/apt/sources.list.d/tualatrix-ppa-precise.list                1  deb http://ppa.launchpad.net/tualatrix/ppa/ubuntu precise main      2  deb-src http://ppa.launchpad.net/tualatrix/ppa/ubuntu precise main      /etc/apt/sources.list.d/kilian-f_lux-precise.list                1  deb http://ppa.launchpad.net/kilian/f.lux/ubuntu precise main      2  deb-src http://ppa.launchpad.net/kilian/f.lux/ubuntu precise main      /etc/apt/sources.list.d/ubuntu-wine-ppa-precise.list                1  deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu precise main      2  deb-src http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu precise main      /etc/apt/sources.list.d/fsqcds-goldendict-precise.list                1  deb http://ppa.launchpad.net/fsqcds/goldendict/ubuntu precise main      2  deb-src http://ppa.launchpad.net/fsqcds/goldendict/ubuntu precise main      /etc/apt/sources.list.d/webupd8team-rhythmbox-precise.list                1  deb http://ppa.launchpad.net/webupd8team/rhythmbox/ubuntu precise main      2  deb-src http://ppa.launchpad.net/webupd8team/rhythmbox/ubuntu precise main      /etc/apt/sources.list.d/upubuntu-com-devel-precise.list                1  deb http://ppa.launchpad.net/upubuntu-com/devel/ubuntu precise main      2  deb-src http://ppa.launchpad.net/upubuntu-com/devel/ubuntu precise main      And I caught another snippet of trouble at `sudo apt-get update`:               Err http://ppa.launchpad.net precise/main Sources                                                               404  Not Found     Err http://ppa.launchpad.net precise/main amd64 Packages                                                        404  Not Found     Err http://ppa.launchpad.net precise/main i386 Packages                                                         404  Not Found        * _**How to solve this trouble?_**


How can I configure IP address from class E on Linux?

I would like to configure an IP address from class E, for example `241.0.0.2`. Currently Linux (Linux-2.6.21.7-hrt1) returns the following answer:               ifconfig: SIOCSIFADDR: Invalid argument      Is there a way to do this? (The reason for using class E is that I would like to avoid IP address conflicts with customer IP networks.)


Circumvent permissions of filesystem on an external drive

Suppose that I have only non-root access on a desktop Linux machine. I want to work with an external, pluggable storage device (hdd, flash drive or memory card) with an ext{2,3,4} file system. Since I have physical control over the storage device, it seems that I should be able to do whatever I want with it, regardless of my privileges on the current system. I can mount it using `pmount`. But how do I access files that have such permissions that I wouldn't be able to access them if they were on a local file system? (For example, files owned by root with permissions `0600`)


How do I stop ssh-agent trying all keys with agent forwarding?

Often I'll connect via SSH to VM instances to deploy code from private Bitbucket repositories, cloning repositories via git over SSH. Today I was getting the error: `conq: repository access denied. deployment key is not associated with the requested repository.` A quick search showed it was this problem. The issue is my forwarded SSH agent was trying to connect to Bitbucket with a Vagrant development key that I'd added since I'd last tried to clone a private repository over SSH. (Removing the Vagrant key from my `.ssh` directory allowed me access to the private repositories again.) My SSH `config` is:               Host bitbucket.org       User git       IdentityFile ~/.ssh/bitbucket_key       IdentitiesOnly yes      and locally this seems to behave as expected. The output of `ssh -v git@bitbucket.org` shows               debug1: Authentications that can continue: publickey     debug1: Next authentication method: publickey     debug1: Offering RSA public key: /home/me/.ssh/bitbucket_key      whereas when I'm connected to another server over SSH:               debug1: Offering RSA public key: steve@not_a_bitbucket_key     debug1: Authentications that can continue: publickey     debug1: Offering RSA public key: steve@still_not_a_bitbucket_key     debug1: Authentications that can continue: publickey     debug1: Offering RSA public key: steve@bitbucket_key      Is there some other configuration other than `IdentitiesOnly` that I'm missing to ensure only the requested keys are sent to particular servers when using agent forwarding? Running Ubuntu 12.04 with OpenSSH 5.9p1 installed.


Run Script at fail login attempt?

Lately, I've been trying to create a Bash script to capture a webcam photo when a fail attempt to login is registered. First of all, I found 2 guides related to this (links at the end), they explained how to create script etc.. It was going pretty good until I noticed my System (Archlinux, Fresh installation) doesn't have PAM's common-auth file. I've checked the entire `/etc/pam.d/` directory and still can't find the file or a file with same contents. My Script so far:               #!/bin/bash          # Let's watch our thief's face n.n               ts=$(date +"%m_%d_%Y_%H_%M_%S")          ffmpeg -f video4linux2 -s vga -i /dev/video0 -vframes 3 /home/haoa2/Logins-Fail/login-$ts.jpg          exit 0      My `/etc/pam.d/` directory contents: `chage`, `chfn`, `chgpasswd`, `chpasswd`, `chsh`, `groupadd`, `groupdel`, `groupmems`, `groupmod`, `login`, `newusers`, `other`, `passwd`, `polkit-1`, `rlogin`, `rsh`, `shadow`, `slim`, `su`, `sudo`, `su-l`, `system-auth`, `systemd-user`, `system-local-login`, `system-login`, `system-remote-login`, `system-services`, `useradd`, `userdel`, and `usermod` The orginal answer, and a tutorial-like answer. (Note: I know there is a related answer out there, but this quetion is more about the PAM's file rather than Scripting.)


Sudo changes PATH, yet executes the same binary

There are two Python interpreters installed:               [user@localhost ~]$ /usr/bin/python -V && /usr/local/bin/python -V     Python 2.4.3     Python 2.7.6      Sudo changes PATH when executed:               [user@localhost ~]$ env | grep PATH && sudo env | grep PATH     PATH=/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/user/bin     PATH=/usr/bin:/bin      Yet Python run through sudo is the same as the one run directly:               [user@localhost ~]$ sudo python -V && python -V     Python 2.7.6     Python 2.7.6      I would expect `sudo python` to run `/usr/bin/python` which is the only one visible on the modified `PATH`. Why does it run `/usr/local/bin/python` instead? I asked this question on sudo-users mailing list but we couldn't find the reason for this behavior in discussion with sudo maintainer Todd C. Miller. For reference:               [user@localhost ~]$ sudo -l     Matching Defaults entries for user on this host:         requiretty, !visiblepw, env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS         LC_CTYPE LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE         LINGUAS _XKB_CHARSET XAUTHORITY"          Runas and Command-specific defaults for user:               User user may run the following commands on this host:         (ALL) NOPASSWD: ALL               [user@localhost ~]$ sudo sudo -V     Sudo version 1.7.2p1          Sudoers path: /etc/sudoers     nsswitch path: /etc/nsswitch.conf     ldap.conf path: /etc/ldap.conf     ldap.secret path: /etc/ldap.secret     Authentication methods: 'pam'     Syslog facility if syslog is being used for logging: authpriv     Syslog priority to use when user authenticates successfully: notice     Syslog priority to use when user authenticates unsuccessfully: alert     Ignore '.' in $PATH     Send mail if the user is not in sudoers     Use a separate timestamp for each user/tty combo     Lecture user the first time they run sudo     Require users to authenticate by default     Root may run sudo     Allow some information gathering to give useful error messages     Visudo will honor the EDITOR environment variable     Set the LOGNAME and USER environment variables     Length at which to wrap log file lines (0 for no wrap): 80     Authentication timestamp timeout: 5 minutes     Password prompt timeout: 5 minutes     Number of tries to enter a password: 3     Umask to use or 0777 to use user's: 022     Path to mail program: /usr/sbin/sendmail     Flags for mail program: -t     Address to send mail to: root     Subject line for mail messages: *** SECURITY information for %h ***     Incorrect password message: Sorry, try again.     Path to authentication timestamp dir: /var/run/sudo     Default password prompt: [sudo] password for %p:      Default user to run commands as: root     Path to the editor for use by visudo: /bin/vi     When to require a password for 'list' pseudocommand: any     When to require a password for 'verify' pseudocommand: all     File containing dummy exec functions: /usr/libexec/sudo_noexec.so     File descriptors >= 3 will be closed before executing a command     Reset the environment to a default set of variables     Environment variables to check for sanity:             TERM             LINGUAS             LC_*             LANGUAGE             LANG             COLORTERM     Environment variables to remove:             RUBYOPT             RUBYLIB             PYTHONINSPECT             PYTHONPATH             PYTHONHOME             TMPPREFIX             ZDOTDIR             READNULLCMD             NULLCMD             FPATH             PERL5DB             PERL5OPT             PERL5LIB             PERLLIB             PERLIO_DEBUG              JAVA_TOOL_OPTIONS             SHELLOPTS             GLOBIGNORE             PS4             BASH_ENV             ENV             TERMCAP             TERMPATH             TERMINFO_DIRS             TERMINFO             _RLD*             LD_*             PATH_LOCALE             NLSPATH             HOSTALIASES             RES_OPTIONS             LOCALDOMAIN             CDPATH             IFS     Environment variables to preserve:             XAUTHORIZATION             XAUTHORITY             TZ             PS2             PS1             PATH             MAIL             LS_COLORS             KRB5CCNAME             HOSTNAME             HOME             DISPLAY             COLORS     Locale to use while parsing sudoers: C     Local IP address and netmask pairs:             10.0.2.15 / 255.255.255.0             fe80::a00:27ff:febb:56ce / ffff:ffff:ffff:ffff::               [user@localhost ~]$ sudo cat /etc/sudoers | grep -v -E '^#|^$'     Defaults    requiretty     Defaults   !visiblepw     Defaults    env_reset     Defaults    env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR \                             LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \                             LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION \                             LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC \                             LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS \                             _XKB_CHARSET XAUTHORITY"     root    ALL=(ALL)       ALL     user    ALL=(ALL)       NOPASSWD: ALL               [user@localhost ~]$ which sudo && command -V sudo     /usr/bin/sudo     sudo is hashed (/usr/bin/sudo)          [user@localhost ~]$ cat /etc/redhat-release      Red Hat Enterprise Linux Server release 5.10 (Tikanga)


Run script as a different user from root

From root user, how can I give permissions to another user to execute the file /root/script.sh ? The idea is to run the script like `sudo -u user1 /root/script.sh`


Raspberry Pi Wireless USB stick

I recently acquired a Raspberry Pi, and have installed Debian Squeeze on it, and after doing a small bit of research (I'm not too proficient with Linux) I found and ordered a USB wireless dongle ("LevelOne WUA-0605 N_Max Wireless USB Adapter") that appears to have support for Linux. This is the page I found that looks like it says the dongle has a Linux driver. I installed (what I think) was the driver package, `firmware-ralink`. Now I'm not sure what i need to do to make it work. `lsusb` lists the device as               Bus 001 Device 008: ID 0bda:8172 Realtek Semiconductor Corp.         RTL8191SU 802.11n wLAN Adapter


Passing parsed output of sed to find (in this direction)

Well, I think you can find dozens of questions on this platform how to pipe `find` _output_ to `sed`, but I haven't found anything for the reverse direction so far. What I want to do is modify my _input_ , and _then_ pass it to `find`. Supposing I want to do something like the following, in order to make life easier for myself by avoiding to type in those cumbersome asterisk wildcards. (I hope it's obvious enough that the expression which follows the triple redirection operator `<<<` is eventually planned to get replaced by a parameter, e. g. `$1`, in a script later. The line below is merely for demonstration.)               $ sed 's/ /\*/g' <<< ' foo bar baz ' | find . -type f -iname -       That `-` at the end of this one-liner was actually _supposed_ to use the output of `sed` as input for `find`; however, extending the `find` part to               ... find -D tree . -type f -iname - ...       revealed that the parameter was _not_ passed to `find`. Perhaps you cannot pass pre-processed input to `find` using a pipe at all?


The most universal scripting language for Linux is?

We are writing scripts for Linux systems, there has been some debate over what would be the most universally Linux present scripting language to use. Bash, SH, Posix? What?


Unable to control audio volume in BackTrack5 R2

I have Backtrack5 R2, one of the several problems I have is the audio works but I cannot control the volume, it is always the same and it's very annoying. What can I do to fix this?


How to install Gentoo with VirtualBox and use it as native OS later?

I'd like to try Gentoo (again...). I know that many steps require a lot of configuration and much more time. I'd like to do something else on computer during long waiting, because of that I would like to install it using VirtualBox and then move it to an partition and use it as normal OS. Update: I know how to `chroot` from live to HDD, "restore" GRUB bootloader. I need especially to know how to have my Gentoo installed to real HDD partition using VirtualBox.


Support of USN Journal (change journal) in NTFS-3G driver

Does any one know if ntfs-3g driver implements change journal? I checked official website but couldn't find any information re. USN.


Reading System manual and large files

How can I copy the description of cat command from the manual to the file named cat-man? I have tried to the synopsis of cat command while it is always with a error that no file name cat-man or destination.


I'm experimenting with OpenVPN connections routed through Tor, using pairs of Tor gateway and OpenVPN-hosting VMs. On the server side, link local ports are forwarded to Tor hidden-service ports on the associated gateway VM. On the client side, OpenVPN connects through socks proxies on the associated Tor gateway VM. The above setup works using Debian 7 for all Tor gateway and OpenVPN-hosting VMs. I'm using Whonix, which has been updated to OpenVPN 2.3.2 (built on 2013-09-12). Server-client ping is about 1200 msec. However, the setup does not work using pfSense 2.1 as Tor gateway and OpenVPN- hosting VMs on the server side. pfSense 2.1 also has OpenVPN 2.3.2 (built on 2013-07-24). For both Debian and pfSense clients, I see:               TCP connection established with [AF_INET]192.168.0.10:9152     recv_socks_reply: TCP port read timeout expired: Operation now in     progress (error ...)      This is the same error reported in Debian bug #657964 for openvpn version 2.2.1-3: "openvpn: Can't connect to a VPN using SOCKS proxy". It's also been reported in OpenVPN bug #328 for openvpn version 2.3.2: "openvpn client gives up instead of retrying when proxy server is slow". However, this may not be the same bug. The problem here may be latency in forwarding OpenVPN server ports through Tor hidden services, rather than latency in Tor SOCKS proxies on the client side. Or it may be both. In any case, I find that OpenVPN 2.3.2 servers fail with this client error in pfSense 2.1, but not in Debian 7. Perhaps the latest package in the Debian 7 repository includes bug fixes that were issued since the pfSense 2.1 build. How can I configure OpenVPN to wait for slow SOCKS proxies?


vsftpd - ftp user cannot create folders

CentOS - I have created an ftp user that can log in remotely over the internet to the vsftpd server. Now I can log in via ftp, see all the directory listings (not limited/jailed) to any directory, but I **cannot create a new folder** inside `/var/www/html` When I want to create a new directory, it fails:               550 Create directory operation failed      Note, that I have done the following:               chmod 775 as well as chmod 777      as the root user on the server itself (using putty). How do I get write access to a specific folder for an FTP user? **Note** : I have the following permissions:               drwxr-xr-x. 6 david root 4096 Jul  7 20:30 html


Missing /etc/default/grub in fedora15

Based on this suggestion, I want to edit `/etc/default/grub` to add the line:               GRUB_CMDLINE_LINUX="acpi_osi=Linux"      However, I don't have that file on my system. What should I do?


How to find list of available shells by command-line?

How to list available shells for use by command-line?


RED HAT LOGIN problem with root

I want to log in to my new installed RHEL 6.2 I am totally new to Linux. I tried to log in with root, and password that I created during the installation process, but after log in this appears root@myName ~1# : what should I write? I wrote startx but it didn't work


All installed software/commands will not run unless root user in Slackware 14

I originally thought it was just startx, but now I've discovered ALL commands are "not found" for any user except root... I obviously haven't checked the path for every single one, but the path for 'startx' is fine. Basic commands such as ls, echo, cd, etc. all still work, just not ones I've had to install like startx, nano, google-chrome, etc. This happened after installing Vidalia, with the dependencies libevent, GeoIP, tor, and vidalia. Vidalia ran once, but did not run again, and upon reboot all was gone... was this a virus?? (all were from Slackbuilds)


"mkdir foo; svn mv * foo"

I often want to do some variant of this idiom:               $ mkdir 2010     $ svn mv * 2010      Of course, I get an error because the glob matches 2010 as well:               svn: Cannot copy path '2010' into its own child '2010/2010'      Is there a way to replace `"svn mv * 2010"` with a different one-liner that does the right thing?


Move all files to a new directory excluding that directory

I have the following:               ~@matrix:~/btp200/assignments> ls -la     total 40     drwxr-xr-x 3 molszewski1 users 4096 Feb  6 13:20 .     drwxr-xr-x 6 molszewski1 users 4096 Feb  6 13:14 ..     -rw-r--r-- 1 molszewski1 users 5727 Feb  6 13:20 ISBN.cpp     -rw-r--r-- 1 molszewski1 users  361 Feb  6 13:18 ISBN.h     -rw-r--r-- 1 molszewski1 users 3753 Feb  6 13:17 ISBNPrefix.cpp     -rw-r--r-- 1 molszewski1 users  422 Feb  6 13:15 ISBNPrefix.h     drwxr-xr-x 2 molszewski1 users 4096 Feb  6 13:20 a1     -rw-r--r-- 1 molszewski1 users    0 Feb  6 13:15 a1.cpp     -rw-r--r-- 1 molszewski1 users 6271 Feb  6 13:18 prefixRanges.txt     ~@matrix:~/btp200/assignments> mv * a1     mv: cannot move `a1' to a subdirectory of itself, `a1/a1'      How can I move everything into directory `a1` excluding `a1`?


Is any part of the X.org software multithreaded?

None of the command-line shells that I am aware of are multithreaded. In particular, even those shells that support "job control" (Control-Z, `bg`, `fg`, etc) do so via facilities (namely, `fork`, `exec`, signals, pipes and PTYs) that predate Unix _threads_. Nor is Emacs multithreaded even though it is able to "do many things at the same time". (Again, it forks and execs external programs a lot and uses signals, pipes and PTYs to communicate with those external programs.) My question is, Does the dominant implementation of the X11 protocol (X.org) use Unix threads -- in either the server or any of the client libraries? If so, approximately when did it (or its ancestor, XFree86, or XFree86's ancestor) start doing so?


Can a Gnome Terminal profile use UTF-8 by default?

I am on an Ubuntu (I think) system. I **don't** have root, so I can't change the locale. I want to make my default terminal profile use UTF-8 by default. There should be a way to do this, either in the `.gconf/apps/gnome-terminal/` directory somewhere, or in a environment variable, or something. However, I can't seem to find it. Edit with more details: In a terminal, I have:               grid-unv55$ locale     LANG=en_US.UTF-8     LC_CTYPE="en_US.UTF-8"     LC_NUMERIC="en_US.UTF-8"     LC_TIME="en_US.UTF-8"     LC_COLLATE="en_US.UTF-8"     LC_MONETARY="en_US.UTF-8"     LC_MESSAGES="en_US.UTF-8"     LC_PAPER="en_US.UTF-8"     LC_NAME="en_US.UTF-8"     LC_ADDRESS="en_US.UTF-8"     LC_TELEPHONE="en_US.UTF-8"     LC_MEASUREMENT="en_US.UTF-8"     LC_IDENTIFICATION="en_US.UTF-8"     LC_ALL=     grid-unv55$ gnome-terminal      When try to more a UTF document in that new terminal, I get:               \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd     \noise:bgspeech \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd      Which appears on my screen as dots. (the uffds were a cut and paste. I left the "\noise:bgspeech" in there so you could see that ascii cut and pasted correctly)


How can I use my server to compile a kernel for my laptop?

My laptop, an HP pavilion with an nVidia card, has some issues with suspending. Namely firewire breaks on suspend and the nvidia drivers cause Xorg to hang on resume. I'd like to compile my own kernel to build firewire in instead of as a loadable module, and disable `agpart` to see if these changes fix these issues... However, my laptop isn't the fastest nor does it have a ton of RAM, and its fans are on their last legs. I'd like to configure the kernel build on the laptop buy compile the kernel on our in-house VMware server which has a lot more horsepower. Both the laptop and the server have Ubuntu on them (Ubuntu desktop on the laptop, Ubuntu... _wait for it_... Server on the Server. Bet you never would have guessed that!) How can I use one linux system to compile a kernel for the architecture of a different linux system?


How do I configure SELinux to allow outbound connections from a CGI script?

I'm migrating to a new webserver which has SELinux set up (running Centos 5.5). I've got it set up so that it can execute CGI scripts with no problem, but some of the older Perl based scripts are failing to connect to remote webservices (RSS feeds and the like). Running: `grep perl /var/log/audit/audit.log` gives:               type=SYSCALL msg=audit(1299612513.302:7650): arch=40000003 syscall=102 success=no exit=-13 a0=3 a1=bfb3eb90 a2=57c86c a3=10 items=0 ppid=22342 pid=22558 auid=0 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=235 comm="index.cgi" exe="/usr/bin/perl" subj=root:system_r:httpd_sys_script_t:s0 key=(null)      As my crash course in SELinux goes, it looks like it is actively refusing the outbound connection, but how do I configure it to allow for CGI scripts to make outbound requests?


Emacs X toolkit support?

From what I understand, Emacs uses GTK as it's default X toolkit. Does Emacs support X toolkits other than GTK? For example, can I build Emacs to use Qt4 instead of GTK?


Can I read and write to alternate HFS+ file forks or NTFS data streams from Linux?

It's possible to mount both Apple HFS+ and Microsoft NTFS filesystems under Linux. Both filesystems support multiple content streams per file, though this is not widely used.   * Apple uses the term _fork_.   * Microsoft uses the term _Alternate Data Stream_. Are there (semi) standard ways to access these filesystem features from Linux? If so are the methods uniform between the two filesystems or are only arcane ad-hoc methods available? (Perhaps something with `ioctl`s?)


Follow a pipe using less?

Can less follow (by pressing F) a piped input (similarly to a file)? For a file that is being written to, the command               less <file>      will follow the file when pressing F. But if I have a command that pipes output directly into less, like this               command | less      pressing F will do nothing. So it looks like pipes cannot be followed like files can? Or maybe it has to do with command also writing to STDERR? The effect I'm trying to achieve is always see the latest output of the command: just like keeping PageDown pressed! A related remark holds for G (go to end): when piping directly to less, it won't work.


How to add header and footer to the flat file

I need to add a header and a footer to flat file - I just need to get values from the parameter like system date and report run date in the top line and for the footer I need to get the record count and prepend `00000` to it as shown below: Header:               "A"  "F" "2012-03-01"    "20120229" Footer:               "$M" "0000001252"    "." "0000" How can I achieve this in Unix?


Moving stuff off of SSD to HDD after installation. Using mount --bind? LiveCD?

I installed Ubuntu 12.10 on my SSD. /dev/sda1. No other partitions. No swap. Then I went about reading how to optimize usage, and have come to the conclusion I want my /home, /var and /tmp mounted on my hard disk drive. I don't have it mounted yet, but I have a line in my fstab that lists the UUID of my HDD and has it (/dev/sdb1) mounted in /media/hdd. Hard disk too, no partitions. Just plain disk space. I do _NOT_ want to create partitions on either my SSD or HDD. All I want however, is to _move_ my /tmp, /home and /var partitions to my HDD. What are my options to do this cleanly, preferably without using a LiveCD to login? (I am imagining I could use a LiveCD, literally do               mv /home /media/hdd/home     ln -s /media/hdd/home /home          mv /var /media/hdd/var     ln -s /media/hdd/var /var          mv /tmp /media/hdd/tmp     ln -s /media/hdd/tmp /tmp      What about permissions? Is my thinking correct? Can I somehow use a mount --bind option to achieve the same?


How to force drop all partitions and erase disk from terminal?

My question is in fact related to OS X, however I'm using Linux tools to resolve my problem. I'm trying to delete all the partitions on my SSD drive and create new GUID (HFS+) partition table. Native Disk Utility is unable to eject disk to re- partition it. From the terminal, which is included in the OS X install, I've ran `diskutil` and here is the output: ![enter image description here](http://i.stack.imgur.com/YrI05.jpg) diskutil unmountDisk force /dev/disk0...12 also can't unmount disks. I've started Ubuntu 12.10 from USB, tried to delete all partitions with GParted (except the recovery partition); it seems to be ok, but the disk is still unavailable for creating partitions with Apple Disk Utility. And certainly I can't create HFS+ partitions in GParted, cause I don't have `hfsprogs` installed, and there is no way to install 'cause I don't have Internet connection (Ubuntu can't work with Mac Book Retina wifi adapters). So, the main question is what are these 12 partitions and how to delete them and create one HFS+ partitions? **upad:** ![enter image description here](http://i.stack.imgur.com/ydclT.jpg)


Make yaourt does not reinstall when already installed

Is there a way to make yaourt does not reinstall when the package (from AUR) already installed                $ yaourt -Q jruby      local/jruby 1.7.3-1      but somehow                $ yaourt --needed --noconfirm -S jruby      keep redownload (even if it has been downloaded before) and reinstall jruby


Understanding btrfs disc usage for single data volume

On my 256 GB disc:               # btrfs fi show /dev/sdd3     Total devices 1 FS bytes used 143.43GiB     devid    1 size 234.22GiB used 234.22GiB path /dev/sdd3     Btrfs v3.12      I don't understand the discrepancy between "143.43GiB" and "used 234.22GiB". I thought, perhaps I have duplication of the data on, but the way I read this:               # btrfs filesystem df /     Data, single: total=230.20GiB, used=142.32GiB     System, DUP: total=8.00MiB, used=32.00KiB     System, single: total=4.00MiB, used=0.00     Metadata, DUP: total=2.00GiB, used=1.19GiB     Metadata, single: total=8.00MiB, used=0.00      my data is stored only once, "single", and I don't understand where the remaining, roughtly 100 GiB, is used. Quote from the the btrfs wiki: > single - data usage matches the raw block group usage on a single device > (data = raw; 1GB of data requires 1GB of disk Mount info:               # mount | grep sdd3     /dev/sdd3 on / type btrfs (rw,noatime,ssd,noacl,space_cache)


Compile Node.js for Raspberry fast

I wan't to know if there is a faster way to compile the node.js code for raspberry then letting the raspberry itself compile the code. Assuming I have cloned the nodejs source into _/home/pi/node/_ on my raspberry.   1. Is it right to run the `./configure` on the raspberry.   2. Then copy the node folder to my desktop computer and run `make`.    3. Then copy the folder back to my raspberry _/home/pi/node_ and run `make install`. Would that work and if yes, are there any downsides to this method? * * * **EDIT:** I accepted to use the precompiled Version suggested by goldilocks as it is truly the fastest way of getting the newest node asap.


man causes a broken pipe when using a pager other than less

I'm trying to write a simple script to format my man pages, but I've run into a broken pipe error. These lines both cause the error:               env MANPAGER=cat man $foo     man -P cat $foo      and this is the script I'm ultimately trying to use (converts underlines into italics)               man -P ul "$1" | sed -e $'s/\033\\[4m/\033\\[3m/g' -e $'s/\033\\[24m/\033\\[23m/g'      I get the same problem with `cat`, `ul`, and `tee`, and the only thing that seems to work is `less`.


How to use a value returned by a script in grep filter?

I'm on FreeBSD's csh. I want to form a row with domains of one user and then use this row to filter exim maillog to get only mail from/to this user's domains. I wrote a script to form a row from a list of DirectAdmin-domains:               #!/bin/sh     user="some-user"              list=$(cat /usr/local/directadmin/data/users/$user/domains.list)         domaincount=$(echo $list|wc -w)         echo $list| tr ' ' '|'      Executing this script returns rows with domains like this: `'domain.com'` or this: `'domain1.com|domain2.net'` Now I want to use this as an argument to `grep`, but               cat /var/log/exim/mainlog |egrep `/path/to/rowscript`      returns nothing, while replacing manually `/path/to/rowscript` with its result returns what I want to see. Tried to use               grep -E "`/path/to/rowscript`",      egrep '`/path/to/rowscript`'      egrep `/bin/sh /path/to/rowscript`     egrep $(/path/to/rowscript)         getting "Illegal variable name."      etc., but still no luck. BTW, `date` in backticks works well:               cat /var/log/exim/mainlog | grep `date +%Y-%m-%d`      What am I doing wrong?


Move some files on every dir to a different dir

> **Possible Duplicate:**   >  How can I move files by type recursively from a directory and its sub- > directories to another directory? I'm quite new to Linux and specially to the shell and all of its commands. My goal is to move some files in every directory to another directory. To be more clear, I have this:               /DIR       - /dir1         - file1         - file2         - ...       - /dir2         - file1         - file2         - ...       - ...       - /dirn         - file1         - file2         - ...       What I need is to move all the file1 and file2 into a new dir in its own dir, so that I get something like this:               /DIR       - /dir1       - /mydir           - file1             - file2         - ...       - /dir2       - /mydir           - file1             - file2         - ...        For the sake of the question I have to say that dir names are not like "dir1", "dir2" and so on, but are arbitrary names. Files, however, are always named the same (models.py and wrappers.py). Thanks for your help.   P.S.: I'd really appreciate if you could explain me your answers, in order to learn a bit more about Linux and not just copy-pasting the code.


Mouse pad error after new Linux kernel install

Yesterday I upgraded my debian laptop with the backports repository. Amongst the packages it installed, a new kernel was added (3.2.0). When booting on this kernel, the right-click on my mouse pad (is it called that way?) doesn't work. I tried booting on my old kernel (2.6.39) and it works like a charm. I have a bunch of live CDs for various distros lying around on my desk, so I tried launching live sessions. It confirmed my idea that it is a kernel issue. My hardware doesn't work well with recent kernels. My question is not how to solve my particular problem (I'm not even giving details about my hardware). What's the way to go when facing such a problem? Can anyone point me to good documentation?


Recommended reading to better understand Unix/Linux internals

I've worked on *nix environments for the last four years as a application developer (mostly in C). Please suggest some books/blogs etc. for improving my *nix internals knowledge.


Isolate a hosts networking with iptables

I want to isolate a host on my home intranet using `iptables` on my linux router. So say for instance, I have a host that has the IP of `10.0.1.50` and I want it to be able to talk to the rest of the Internet, but I don't want the router to allow it to talk to any other host in `10.0.1.0/24`. However, I want to be able to allow hosts in `10.0.1.0/24` to connect to `10.0.1.50` on port `80` only as long as the connection isn't created on the host. I am doing this in case `10.0.1.50` is compromised, so it can't talk to the rest of my network.


Yarbu Execution

I am attempting to use a Project called Yarbu It appears to be exactly what I am looking for. However I am a noob at Linux and am having difficulty getting it to work. I successfully completed the install by following the steps seen here. After following those steps, I created a .conf file (found here) and placed it into /home/john/yarbu-1.4.8/etc/yarbu/conf/default however still nothing happens when I execute the program. I do not know how to proceed from here and I am fairly certain that its user error that is resulting from my unfamiliarity with linux. What should I try next? Why does this program require "sudo" to execute? Did I need to create the .conf file before I did "make install"? Any direction would be helpful and appreciated.


Debian thinks my file system is encoded as ISO-8859-1

This may not be the appropriate site for this question, because it's more a complaint than a question, but here goes. Today I updated my computer from Mint 15 to Debian 7.6. And after I'd done that, my computer thought that all the existing filenames were encoded as ISO-8859-1 rather than UTF-8. So, for instance, filenames containing "à" now got displayed as "Ã " and so on.   Turns out I needed to tell my system _explicitly_ that the file system uses UTF-8, by putting `export LANG=en_US.UTF-8` in my .bashrc file. And the question is, why? Why should something like that be necessary in this day and age, 2014? The default was UTF-8 for Mint, obviously; why should Debian be any different? What would cause Debian to use such an obscure and outdated default, even if I told it at install time what I wanted my locale to be, and /etc/locale.gen only contains `en_US.UTF8 UTF8` as the only (uncommented) line. And do I need to remember to edit the .bashrc file for every new user account that I create from now on to edit the export line in?


"Open file" dialog: Focus jumps to text field (LMDE / Cinnamon)

I have a usability problem with the "Open file" dialog. The questions would be:   * Is there any way out? E.g. can I disable the autocomplete?   Otherwise, I might post a bug report..   * Why does this happen?   Which package / component is responsible for this dialog?   (so I know where to report it) Details: I'm on LMDE (Linux Mint Debian Edition) with Cinnamon. The problem happens in the "Open file" dialog i get in GEdit, Chromium, etc.   I don't know which exact package is responsible for the Open file dialog - Cinnamon, Gnome, Nemo or something else. Maybe someone could confirm if this happens in other distros / desktops.   Thus, I also don't know if this is better suited for unix.stackexchange or for askubuntu. Steps to reproduce:   * Hit Ctrl+O in an application (browser, gedit, other) to open the "Open file" dialog.   -> The dialog contains a file browser area, and at the top, a text field for file name / path.   -> focus is on the text field.   * Click into the file browser area   -> this will set the focus on the file browser area   * Start typing   -> this will search in the list of files in the file browser area   * Hit the up/down arrow keys   -> this will move the current selection up and down in the file browser area   * When a directory is selected, hit Enter   -> this will let the dialog dive into that folder.   -> PROBLEM: Now the focus is back on the text field!   -> A dropdown with autocomplete suggestions appears.   * Start typing.   -> this will type in the text field, instead of searching in the file browser   * Hit TAB.   -> this will select an autocomplete option, instead of jumping to the file browser   * Hit the down arrow key.   -> This will go down into the autocomplete dropdown, instead of to the file browser area. This is all quite painful to me. I like to focus on the file browser area, but the dialog won't let me :(


sed special character replace not working in shell script

I want to write a script 'test.sh' that will take a user's input and replace all special characters with a '\' + the character. My script:               #!/bin/bash     echo 'input='"$1"     arg=`echo "$1" | sed 's:[]\[\^\$\.\*\/]:\\&:g'`     echo 'modified input='"$arg"      My command works on the string 'xy', which does not have any special characters. I run this in my terminal:               test.sh xy      And I obtain:               input=xy     modified input=xy      However, when I run this:               test.sh x.y      I get:               input=x.y     modified input=x&y      I don't understand why this script is not working. I expect to get:               input=x.y     modified input=x\.y      I think the problem lies in this sed command but I'm not sure where:               sed 's:[]\[\^\$\.\*\/]:\\&:g'


Windows share suddenly empty

I have a laptop running Mint 15 Olivia that can access a shared folder from a Windows Vista desktop. Normally I can access and modify the files as if it were just another folder on the laptop, both through Nemo's interface and from the terminal. This morning the drive which previously contained the shared folder appeared as empty. Even if I unplug the ethernet connection and turn wired connections off for the laptop (the desktop is not connected to the internet except through the laptop), the desktop still appears in the file system, but it is empty. If I try to access the folder from the terminal, using a command that worked last night, it claims that there is no such drive or directory. This happened once before, and I fixed it by restarting the Linux laptop, so I don't think the Windows computer is the problem here. Toggling the wired connection on/off on the laptop and disconnecting and reconnecting the ethernet do not change anything. Is there a way to fix this without restarting the computer?


Ethernet Sniffing Embeded Device

I recently dug out some prototyping equipment from the trash and I want out figure out what the heck it is. It has a port labelled 'Ethernet' and when I plug it into a router the lights flash like its trying to pull an ip but it does not. My router is running DD-Wrt and I have a netbook with Knoppix I can use on the router. How could I go about sniffing the communication and figure out what IP the device wants and how to communicate with it?


Start and monitor process with CRON

There is a stub application written in C. Now I want to run this application periodically, say at 11.30am daily. I thought of using the _cron_ process but I don't know how to do it. Please help. Also I want the _cron_ to periodically check if the application is running normally or not. If the application crashes or hangs, _cron_ should be able to restart the application within a certain period of time.


What filesystem has best support for shrinking?

Most mainstream filesystems can be grown fairly reliably, but what if I think I would like to shrink in future? XFS is a non runner. Reiser seems to have good support but gives scary BETA warnings , it works really fast though. Btrfs seems to promise good things but I've no experience with it.


How To Install Thunderbird 24.0 on centos

How do I update thunderbird to latest version 24 on centos 6.3 (final) 64bit. I cannot find any good tutorial on installing it on centos. Merely copying and pasting the 'thunderbird' folder in '/usr/lib64/' doesn't do anything. The current version installed on my machine is 17.0.9


Executing a program according to the last modified date

I need to write a script which would execute some executables in a directory according to the last modified date. The oldest should run first. How do I do it? This is what I have done so far               for f in  ./jobqueue/*; #accessing the queue     do          chmod +x *  # giving executable permission for the files         $f  # running the executables     done


How to turn off the beep only in bash tab-complete

I find the beep useful for some things, so I **only** want to turn it off for tab completion (I'm not asking how to completely turn it off, that has already been answered in a different question on Serverfault). I also don't have root access, working on RHEL5.


apt-get won't install: dpkg: files list for package 'gnome-themes-standard-data' is not a regular file

I'm trying to install packages to get a webcam stream running on my raspberry pi. All of a sudden, apt-get is totally busted -- every time I try to install, reinstall or purge something that might fix the problem, I get the following error:               dpkg: unrecoverable fatal error, aborting:      files list for package 'gnome-themes-standard-data' is not a regular file     E: Sub-process /usr/bin/dpkg returned an error code (2)      Which is remarkably frustrating! I have no idea what this error is, what caused it, or how to fix it, but it's totally stopped me in my tracks. I've tried apt-get update which runs to completion, but I can't upgrade or purge the problem package. It breaks even using -f and aptitude instead of apt-get. Here's me trying to install ffmpeg:               pi@raspberrypi:/var/backups$ sudo apt-get install ffmpeg     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following extra packages will be installed:       libav-tools libavdevice53 libavfilter2 libjack-jackd2-0 libopencv-core2.3 libopencv-imgproc2.3     Suggested packages:       jackd2     The following NEW packages will be installed:       ffmpeg libav-tools libavdevice53 libavfilter2 libjack-jackd2-0 libopencv-core2.3 libopencv-imgproc2.3     0 upgraded, 7 newly installed, 0 to remove and 150 not upgraded.     Need to get 0 B/2,235 kB of archives.     After this operation, 5,970 kB of additional disk space will be used.     Do you want to continue [Y/n]? Y     Selecting previously unselected package libjack-jackd2-0:armhf.     dpkg: unrecoverable fatal error, aborting:      files list for package 'gnome-themes-standard-data' is not a regular file     E: Sub-process /usr/bin/dpkg returned an error code (2)     pi@raspberrypi:/var/backups$ sudo apt-get purge gnome-themes-standard-data     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages will be REMOVED:       gnome-themes-standard* gnome-themes-standard-data*     0 upgraded, 0 newly installed, 2 to remove and 150 not upgraded.     After this operation, 3,892 kB disk space will be freed.     Do you want to continue [Y/n]? Y     dpkg: unrecoverable fatal error, aborting:      files list for package 'gnome-themes-standard-data' is not a regular file     E: Sub-process /usr/bin/dpkg returned an error code (2)     pi@raspberrypi:/var/backups$ sudo apt-get update     Hit http://mirrordirector.raspbian.org wheezy InRelease     Hit http://archive.raspberrypi.org wheezy InRelease     Hit http://mirrordirector.raspbian.org wheezy/main armhf Packages     Hit http://archive.raspberrypi.org wheezy/main armhf Packages     Hit http://mirrordirector.raspbian.org wheezy/contrib armhf Packages     Hit http://mirrordirector.raspbian.org wheezy/non-free armhf Packages     Hit http://mirrordirector.raspbian.org wheezy/rpi armhf Packages     Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB     Ign http://archive.raspberrypi.org wheezy/main Translation-en     Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en_GB     Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en     Ign http://mirrordirector.raspbian.org wheezy/main Translation-en_GB     Ign http://mirrordirector.raspbian.org wheezy/main Translation-en     Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en_GB     Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en     Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en_GB     Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en     E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.      pi@raspberrypi:/var/backups$ sudo dpkg --configure -a     pi@raspberrypi:/var/backups$ sudo apt-get update     Hit http://mirrordirector.raspbian.org wheezy InRelease     Hit http://archive.raspberrypi.org wheezy InRelease     Hit http://mirrordirector.raspbian.org wheezy/main armhf Packages     Hit http://archive.raspberrypi.org wheezy/main armhf Packages     Hit http://mirrordirector.raspbian.org wheezy/contrib armhf Packages     Hit http://mirrordirector.raspbian.org wheezy/non-free armhf Packages     Hit http://mirrordirector.raspbian.org wheezy/rpi armhf Packages     Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB     Ign http://archive.raspberrypi.org wheezy/main Translation-en     Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en_GB     Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en     Ign http://mirrordirector.raspbian.org wheezy/main Translation-en_GB     Ign http://mirrordirector.raspbian.org wheezy/main Translation-en     Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en_GB     Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en     Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en_GB     Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en     Reading package lists... Done     pi@raspberrypi:/var/backups$ sudo apt-get upgrade     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages will be upgraded:       apt apt-utils binutils cups-bsd cups-client cups-common curl debian-reference-common debian-reference-en dmsetup       dpkg dpkg-dev e2fslibs e2fsprogs gdb gdbserver gvfs gvfs-backends gvfs-common gvfs-daemons gvfs-fuse gvfs-libs       idle idle-python3.2 idle3 ifupdown initramfs-tools initscripts iptables isc-dhcp-client isc-dhcp-common iso-codes       krb5-locales libapt-inst1.5 libapt-pkg-dev libapt-pkg4.12 libarchive12 libavahi-client3 libavahi-common-data       libavahi-common3 libavahi-glib1 libc-bin libc-dev-bin libc6 libc6-dev libcairo-gobject2 libcairo2 libcomerr2       libcups2 libcupsimage2 libcurl3 libdbus-glib-1-2 libdevmapper-event1.02.1 libdevmapper1.02.1 libdpkg-perl       libgail-3-0 libgcrypt11 libgl1-mesa-glx libglapi-mesa libglib2.0-0 libglib2.0-data libgnutls26 libgssapi-krb5-2       libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 libgtk-3-0 libgtk-3-bin libgtk-3-common libgudev-1.0-0 libicu48       libjavascriptcoregtk-1.0-0 libjavascriptcoregtk-3.0-0 libjson0 libk5crypto3 libkrb5-3 libkrb5support0 liblapack3       liblapack3gf libldap-2.4-2 liblvm2app2.2 libnewt0.52 libobrender27 libobt0 libpixman-1-0 libpoppler19 libprocps0       libproxy0 libqt4-network libqt4-svg libqt4-xml libqtcore4 libqtdbus4 libqtgui4 libsmbclient libsmpeg0 libss2       libssl1.0.0 libsystemd-login0 libudev0 libwbclient0 libwebkitgtk-1.0-0 libwebkitgtk-1.0-common libwebkitgtk-3.0-0       libwebkitgtk-3.0-common libwebp2 libxml2 libxslt1.1 linux-libc-dev locales lxtask multiarch-support openbox       openssh-client openssh-server openssl perl perl-base perl-modules pistore poppler-utils procps python       python-minimal python-numpy python-rpi.gpio python3 python3-minimal python3-numpy python3-rpi.gpio python3.2       python3.2-minimal rsyslog samba-common sgml-base smbclient ssh sudo sysv-rc sysvinit sysvinit-utils tasksel       tasksel-data tzdata udev whiptail x11-common xserver-common xserver-xorg xserver-xorg-core xserver-xorg-input-all     150 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     Need to get 0 B/118 MB of archives.     After this operation, 742 kB of additional disk space will be used.     Do you want to continue [Y/n]? Y     Extracting templates from packages: 100%     Preconfiguring packages ...     dpkg: unrecoverable fatal error, aborting:      files list for package 'gnome-themes-standard-data' is not a regular file     E: Sub-process /usr/bin/dpkg returned an error code (2)     pi@raspberrypi:/var/backups$       Is this fixable or do I have to flatten and reimage Wheezy on my SD card? Any help is greatly appreciated.


In emacs, is there a way to Hex edit/view a buffer without losing the undo info?

When I use _hexl-mode_ in emacs, it discards the buffer's undo info.   Is there another way to hex-edit the buffer and yet retain the undo info? If there is no alternative hex-editor, is there a hex-viewer which can view the buffer? I have tried _hexview-mode_ , but it doesn't view the actual buffer; it views the buffer's _file (from disk)_ , so I don't see the current edit.


How to encrypt data in Linux while leaving access for certain app

Is there any way to set up Linux in such a way that a regular user can not view or modify an encrypted file (located on an encrypted partition probably), while he at the same time is allowed to work with an application that has full access to that file? Please note that the file should be encrypted and not just inaccessible. Reason: I want to use sqlite for my application, but it is not encrypted, and storing encrypted chunks is not a good idea in terms of proper indexing. So I thought maybe Linux may solve this. Oh, and this application will be delivered along with a set-up machine, so end-users wont need to mess with the partitions and installation.


Testing which modules are unloaded with modprobe

I'm currently searching for the right driver for my Broadcom BCM4313 network/wifi device. At first no network was recognized at all, now I managed to connect, but the connection is really slow. I read that it can be helpful to unload some driver modules with `modprobe` since they can disturb each other. To find the right driver I'm thinking of trying to unload all of them and then activate each one alone. Is there a possibility to find out which modules are activated and is there a command to unload all wifi modules at once? Any other hints concerning my troubleshooting are welcome as well. ## Edit: To prevent misunderstanding: From the comments I assume that screening the modules is not a good way to find the right driver. I was still looking for a way to find the active modules to get a deeper understanding of which module is active and ergo doing something and which is not.


how long use of linux?

`/proc/uptime` shows how long the system has been running since the last time I turned it on. Is there a way to determine the total amount of time the system has ever been on since I first installed it? For example, if I setup the system, run it for 20 minutes, turn it off, and turn it on again for 10 minutes, I'm looking for something that tells me the system has been run for 30 minutes total. Is there a command that does this? What about one for finding the date the system was installed?


Finding computer uptime from first day until now

I need to find PC uptime from the day of installation until now. Is this logged somewhere? Does any file log this cumulative uptime?


openvpn WARNING: No server certificate verification method has been enabled

I tried to install openvpn on debian squeez (server) and connect from my fedora 17 as (client). Here is my configuration: ### server configuration               # Server TCP     proto tcp     port 1194     dev tun          # Keys and certificates     ca /etc/openvpn/easy-rsa/keys/ca.crt     cert /etc/openvpn/easy-rsa/keys/server.crt     key /etc/openvpn/easy-rsa/keys/server.key     dh /etc/openvpn/easy-rsa/keys/dh1024.pem          # Network     # Virtual address of the VPN network     server 192.170.70.0 255.255.255.0     # This line adds the client to the router network server     push "route 192.168.1.0 255.255.255.0"     # Create a route server to the tun interface     #route 192.170.70.0 255.255.255.0          # Security     keepalive 10 120     # type of data encryption     cipher AES-128-CBC     # enabling compression     comp-lzo     # maximum number of clients allowed     max-clients 10     # no user and group specific to the use of the VPN     user nobody     group nogroup          # to make persistent connection     persist-key     persist-tun          # Log of the OpenVPN status     status /var/log/openvpn-status.log          # logs openvpnlog /var/log/openvpn.log     log-append /var/log/openvpn.log          # verbosity     verb 5      ### client configuration               client     dev tun     proto tcp-client     remote <my server wan IP> 1194     resolv-retry infinite     cipher AES-128-CBC          # Keys     ca ca.crt     cert client.crt     key client.key          # Security     nobind     persist-key     persist-tun     comp-lzo     verb 3      Message from the host client (fedora 17) in the log file `/var/log/messages`:               Dec  6 21:56:00 GlobalTIC NetworkManager[691]: <info> Starting VPN service 'openvpn'...     Dec  6 21:56:00 GlobalTIC NetworkManager[691]: <info> VPN service 'openvpn' started (org.freedesktop.NetworkManager.openvpn), PID 7470     Dec  6 21:56:00 GlobalTIC NetworkManager[691]: <info> VPN service 'openvpn' appeared; activating connections     Dec  6 21:56:00 GlobalTIC NetworkManager[691]: <info> VPN plugin state changed: starting (3)     Dec  6 21:56:01 GlobalTIC NetworkManager[691]: <info> VPN connection 'Connexion VPN 1' (Connect) reply received.     Dec  6 21:56:01 GlobalTIC nm-openvpn[7472]: OpenVPN 2.2.2 x86_64-redhat-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] built on Sep  5 2012     Dec  6 21:56:01 GlobalTIC nm-openvpn[7472]:[COLOR="Red"][U][B] WARNING: No server certificate verification method has been enabled.[/B][/U][/COLOR]  See http://openvpn.net/howto.html#mitm for more info.     Dec  6 21:56:01 GlobalTIC nm-openvpn[7472]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts     Dec  6 21:56:01 GlobalTIC nm-openvpn[7472]:[COLOR="Red"] WARNING: file '/home/login/client/client.key' is group or others accessible[/COLOR]     Dec  6 21:56:01 GlobalTIC nm-openvpn[7472]: UDPv4 link local: [undef]     Dec  6 21:56:01 GlobalTIC nm-openvpn[7472]: UDPv4 link remote: [COLOR="Red"]<my server wan IP>[/COLOR]:1194     Dec  6 21:56:01 GlobalTIC nm-openvpn[7472]: [COLOR="Red"]read UDPv4 [ECONNREFUSED]: Connection refused (code=111)[/COLOR]     Dec  6 21:56:03 GlobalTIC nm-openvpn[7472]: [COLOR="Red"]read UDPv4[/COLOR] [ECONNREFUSED]: Connection refused (code=111)     Dec  6 21:56:07 GlobalTIC nm-openvpn[7472]: read UDPv4 [ECONNREFUSED]: Connection refused (code=111)     Dec  6 21:56:15 GlobalTIC nm-openvpn[7472]: read UDPv4 [ECONNREFUSED]: Connection refused (code=111)     Dec  6 21:56:31 GlobalTIC nm-openvpn[7472]: read UDPv4 [ECONNREFUSED]: Connection refused (code=111)     Dec  6 21:56:41 GlobalTIC NetworkManager[691]: <warn> VPN connection 'Connexion VPN 1' (IP Conf[/CODE]      ### ifconfig on server host(debian):               ifconfig      eth0      Link encap:Ethernet  HWaddr 08:00:27:16:21:ac                 inet addr:192.168.1.6  Bcast:192.168.1.255  Mask:255.255.255.0               inet6 addr: fe80::a00:27ff:fe16:21ac/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:9059 errors:0 dropped:0 overruns:0 frame:0               TX packets:5660 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:919427 (897.8 KiB)  TX bytes:1273891 (1.2 MiB)     tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00                 inet addr:192.170.70.1  P-t-P:192.170.70.2  Mask:255.255.255.255               UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:100                RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)      ### ifconfig on the client host (fedora 17)               as0t0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500             inet 5.5.0.1  netmask 255.255.252.0  destination 5.5.0.1             unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 200  (UNSPEC)             RX packets 0  bytes 0 (0.0 B)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 2  bytes 321 (321.0 B)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0          as0t1: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500             inet 5.5.4.1  netmask 255.255.252.0  destination 5.5.4.1             unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 200  (UNSPEC)             RX packets 0  bytes 0 (0.0 B)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 2  bytes 321 (321.0 B)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0          as0t2: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500             inet 5.5.8.1  netmask 255.255.252.0  destination 5.5.8.1             unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 200  (UNSPEC)             RX packets 0  bytes 0 (0.0 B)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 2  bytes 321 (321.0 B)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0          as0t3: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500             inet 5.5.12.1  netmask 255.255.252.0  destination 5.5.12.1             unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 200  (UNSPEC)             RX packets 0  bytes 0 (0.0 B)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 2  bytes 321 (321.0 B)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0          **p255p1**: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500             inet 192.168.1.2  netmask 255.255.255.0  broadcast 192.168.1.255             inet6 fe80::21d:baff:fe20:b7e6  prefixlen 64  scopeid 0x20<link>             ether 00:1d:ba:20:b7:e6  txqueuelen 1000  (Ethernet)             RX packets 4842070  bytes 3579798184 (3.3 GiB)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 3996158  bytes 2436442882 (2.2 GiB)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0             device interrupt 16        ### p255p1 is label for eth0 interface **and** ### on the server :               root@hoteserver:/etc/openvpn# tree     .     ├── client     │** ├── ca.crt     │** ├── client.conf     │** ├── client.crt     │** ├── client.csr     │** ├── client.key     │** ├── client.ovpn     │*     │**      ├── easy-rsa     │** ├── build-ca     │** ├── build-dh     │** ├── build-inter     │** ├── build-key     │** ├── build-key-pass     │** ├── build-key-pkcs12     │** ├── build-key-server     │** ├── build-req     │** ├── build-req-pass     │** ├── clean-all     │** ├── inherit-inter     │** ├── keys     │** │** ├── 01.pem     │** │** ├── 02.pem     │** │** ├── ca.crt     │** │** ├── ca.key     │** │** ├── client.crt     │** │** ├── client.csr     │** │** ├── client.key     │** │** ├── dh1024.pem     │** │** ├── index.txt     │** │** ├── index.txt.attr     │** │** ├── index.txt.attr.old     │** │** ├── index.txt.old     │** │** ├── serial     │** │** ├── serial.old     │** │** ├── server.crt     │** │** ├── server.csr     │** │** └── server.key     │** ├── list-crl     │** ├── Makefile     │** ├── openssl-0.9.6.cnf.gz     │** ├── openssl.cnf     │** ├── pkitool     │** ├── README.gz     │** ├── revoke-full     │** ├── sign-req     │** ├── vars     │** └── whichopensslcnf     ├── openvpn.log     ├── openvpn-status.log     ├── server.conf     └── update-resolv-conf      ### on the client:               [login@hoteclient openvpn]$ tree      .     |-- easy-rsa     |   |-- 1.0     |   |   |-- build-ca     |   |   |-- build-dh     |   |   |-- build-inter     |   |   |-- build-key     |   |   |-- build-key-pass     |   |   |-- build-key-pkcs12     |   |   |-- build-key-server     |   |   |-- build-req     |   |   |-- build-req-pass     |   |   |-- clean-all     |   |   |-- list-crl     |   |   |-- make-crl     |   |   |-- openssl.cnf     |   |   |-- README     |   |   |-- revoke-crt     |   |   |-- revoke-full     |   |   |-- sign-req     |   |   `-- vars     |   `-- 2.0     |       |-- build-ca     |       |-- build-dh     |       |-- build-inter     |       |-- build-key     |       |-- build-key-pass     |       |-- build-key-pkcs12     |       |-- build-key-server     |       |-- build-req     |       |-- build-req-pass     |       |-- clean-all     |       |-- inherit-inter     |       |-- keys [error opening dir]     |       |-- list-crl     |       |-- Makefile     |       |-- openssl-0.9.6.cnf     |       |-- openssl-0.9.8.cnf     |       |-- openssl-1.0.0.cnf     |       |-- pkitool     |       |-- README     |       |-- revoke-full     |       |-- sign-req     |       |-- vars     |       `-- whichopensslcnf     |-- keys -> ./easy-rsa/2.0/keys/     `-- server.conf      Is the source of the problem `cipher AES-128-CBC`, `proto tcp-client` or UDP or the interface `p255p1` on Fedora17 or that file authentification `ta.key` is not found?


How to duplicate a stream and process both parts in a streaming way?

Sometimes I want to insert something in a pipeline for reporting or some other secondary use. It might be as simple as `wc -l`, or a more complex beast like `awk` or even a python script. It'd be nice to run a pipeline like this:               zcat my_data_file.gz \     | wc -l > /tmp/linecount     | process_data.py      The problem is that most utilities won't right the data to stdout. `tee` can write the data to a temporary file, but then I have to wait until everything is done:               zcat my_data_file.gz \     | tee /tmp/f \     | process_data.py && \     wc -l /tmp/f > /tmp/linecount && rm /tmp/f      This is not optimal: it may be a very long-running pipeline; I may want to see intermediat results from the analogue to `wc` sooner; and I may not want to store all the data in a temporary file.


QT applications does support Unicode

My system is Gentoo amd64, and the desktop environment is Xfce4. So far, most applications works well, except the terminal and QT-family applications. The Chromium,Thunar, Thunderbird and many other applications supports Unicode very well. I can see and input Chinese. But the terminal does not support displaying/inputting Chinese. I tried to set the LANG and LC_CTYPE variables, set the fonts...nothing works. My SMPlayer and VLC uses QT based UI, and both of the cannot play the video if the path/file name contains non-ASCII characters. But they works well otherwise.


Linux Mint 12: DVD version vs CD version

I have the CD version so why should i consider upgrading to the DVD version? what are the major features that the DVD version offer? From a programmer's point of view:   * performance   * Libraries   * additional software


Transpose several columns (of varying lengths) into rows

A similar question to mine was asked that concerned transposing multiple columns into rows. However, the particular column format that I am dealing with is slightly different in that my file contains a **_varying_** number of columns that sometimes have duplicates. For example:               100       1       2     3            200  300       1    1       2    2     3    3          100       1       2       3          400  500  600  700  800  900       1    1    1    1    1    1     2    2    2    2    2    2     3    3    3    3    3    3          100 400 700        1   1   1     2   2   2     3   3   3      I would like to transpose these columns into rows that look like the following:               100 1 2 3     200 1 2 3     300 1 2 3     100 1 2 3     400 1 2 3     500 1 2 3     600 1 2 3     700 1 2 3     800 1 2 3     900 1 2 3     100 1 2 3     400 1 2 3     700 1 2 3       And then sort the rows by the values of the first column as follows:               100 1 2 3     100 1 2 3     100 1 2 3         200 1 2 3     300 1 2 3     400 1 2 3     400 1 2 3         500 1 2 3     600 1 2 3     700 1 2 3     700 1 2 3         800 1 2 3     900 1 2 3       And sum the values for duplicated rows as follows:               100 3 6 9         200 1 2 3     300 1 2 3     400 2 4 6     500 1 2 3     600 1 2 3     700 2 4 6        800 1 2 3     900 1 2 3       You will notice that because rows 100, 400, and 700 had duplicates, their columnar values have been summed. Any insights or suggestions are greatly appreciated.


How to make URL's out of this text with least resources?

INPUT:               nyeeeeeeeeeeeeeee.txt:sadfsadf     sadjflsajfd:jasdlfjalsfd     foo/asdfsafd.txt:laksjdlfajsfd      OUTPUT:               nyeeeeeeeeeeeeeee.txt:sadfsadf     sadjflsajfd:jasdlfjalsfd     foo/asdfsafd.txt:laksjdlfajsfd      So I need to convert the INPUT to OUTPUT, the difference is that OUTPUT is "clickable" because this is in a HTML file. **Q:** How can I do this with awk, sed or perl? I know I can do a "read line by line", but what is the most resource efficient way to do this? (I only need 1 solution, not for all sed/awk/etc.) `:` is the delimiter.


How can I make a switch accessible via the internet, that allows users to turn on or off a python script?

I have a python script running on a home laptop that runs Ubuntu 13.10. I want to give 2 or 3 people the ability to start or kill that script, but no other privileges. I don't want to give them access to the script itself, since the code is sensitive. Is there an easy way to do that?


Groupwise uniq command?

I am searching for a command to get from a file in this format:               hello 32     hello 67     hi    2     ho    1212     ho    1390     ho    3000      To this format (deduplicate by taking the last row of a "group"):               hello 67     hi    2     ho    3000      At the moment I am using a Python and pandas snippet:                   df = pd.read_csv(self.input().path, sep='\t', names=('id', 'val'))              # how to replace this logic with shell commands?         surface = df.drop_duplicates(cols=('id'), take_last=True)              with self.output().open('w') as output:             surface.to_csv(output, sep='\t', cols=('id', 'val'))      * * * Update: Thanks for the great answers. Here are some benchmarks: Input file is 246M and contains 8583313 lines. Order does not matter. First column has a fixed size of 9 chars. Example of the input file:               000000027       20131017023259.0        00     000000027       20131017023259.0        11     000000035       20130827104320.0        01     000000035       20130827104320.0        04     000000043       20120127083412.0        01     ...      * * *                                             time        space complexity          tac .. | sort -k1,1 -u        27.43682s   O(log(n))     Python/Pandas                 11.76063s   O(n)     awk '{c[$1]=$0;} END{for(...  11.72060s   O(n)      Since the first column has a fixed length, `uniq -w` can also be used:               tac {input} | uniq -w 9        3.25484s   O(1)


List files sorted numerically

I have a bunch of files from `log1` to `log164`. I'm trying to LIST the directory (sorted) in a UNIX terminal but the sort functions are only providing the format like this:               home:logs Home$ ls -1 | sort     log1.gz     log10.gz     log100.gz     log101.gz     log102.gz     log103.gz     log104.gz     log105.gz     log106.gz     ...etc      What I want is               home:logs Home$ ls -1 | sort     log1.gz     log2.gz     log3.gz     log4.gz     log5.gz     log6.gz     log7.gz     ...{more here}     log99.gz     log100.gz     log101.gz     log102.gz     ...etc      Any suggestions in what I could use to do this?


EUI64 and ipv6: how to use own EUI64 for IPv6 autoconfiguration

As I heard the extended unique identifier (EUI-64) can be used as the lower 64 bits of a IPV6 address. How can I set my own EUI64 = ( IEEE_company_ID + manufacture_ID) on the interface on Linux SUSE SLES11 to use it for Lilnk Local and SLAAC generation of ipv6 address on that interface? Is it possible?   Or generation of LinkLocal and SLAAC address uses only MAC48’s EUI64! Best wishes, Ivan


enable SMART for HP hard disk

I would like to use SMART to perform a health check of my hard disk. I have an HP server of 4 years ago I believe. Everytime I try to use the following command                smartctl -a /dev/sda      I got an error message saying the following                Device does not support SMART           Error Counter logging not supported      Device does not support Self Test logging      Does it really mean that there is no way I can use SMART on these disk or is it just because I am missing some driver or my BIOS is too old? According to `dmidecode` I have bios 2.7 so it should be not too old. I am using CENTOS 6.4.