Nginx strangely started to redirect a default location

I have setup and known to work some sites on my server. One of these sites using https connection hence it uses following server configuration:               server {             server_name ceremcem.net www.ceremcem.net;              listen 80;                   rewrite ^ https://$server_name$request_uri? permanent;              #return 301 https://$host$request_uri;     }      It redirects all http connections to https. Everything was working correctly till some days ago. Now all sites I have have been forwarding to https://ceremcem.net. I have deleted this configuration file, reloaded nginx but problem still exists. All sites in this server are forced to use https connection, and redirect to ceremcem.net. There is no such redirection in none of the files:               root@server:/etc/nginx/sites-enabled# grep https *     root@server:/etc/nginx/sites-enabled#       How can I debug the problem?               root@server:/etc/nginx/sites-enabled# nginx -v     nginx version: nginx/1.6.0     root@server:/etc/nginx/sites-enabled# uname -a     Linux server.aktos-elektronik.com 3.13-1-amd64 #1 SMP Debian 3.13.10-1 (2014-04-15) x86_64 GNU/Linux


How to install CentOS 6.4 on Mac Mini?

I have bought a new Mac Mini, and would like to use it as a Linux server. Now I'm trying to install CentOS on it. I downloaded `CentOS-6.4-x86_64-netinstall.iso` and booted the Mac Mini from a USB-stick. But during the installation process I get these errors:               dmar: No ASTR found     IOAPIC id 0 under DRHD base 0xfed9100     HPET id 0 under DRHD base 0xfed91000     Enabled IRQ remapping in x2apic mode     Enabling x2apic     Enabled x2apic     Setting APIC routing to cluster x2apic     Kernel panic - not syncing: No mapping iommu for ioapic 2          Pid: 1, comm: swapper Not tainted 2.6.32-358.el6.x86_64 #1     Call Trace:     ...      Any suggestions what the problem is? Do I need a different binary to be able to run on an Mac? According to a tweet, CentOS 6.4 seem to work, at least on older, Mac Mini's: https://twitter.com/courtneycotton/statuses/312267424605036544 * * * **UPDATE** : the suggestion of adding `noapic` to the boot took me further in the installation process. Now I had to select an installation medium. The choice is `CD/DVD, Hard drive, NFS directory or URL`, and I have a _USB-stick_ , so I choose _Hard drive_. Then I'm supposed to choose a partition that holds the installation image for CentOS, the choice is between `/dev/sda1`, `/dev/sda2`, `/dev/sda3` or `/dev/sdb1`. Here I have really no idea what name my _USB-stick_ has. I have tried with them all, but if I choose e.g. `/dev/sdb1` I later get the message: > The installation source given by device ['/dev/sdb1'] could not be found. > Please check your parameters and try again. I put my iso file on the USB-stick by following the Ubuntu instructions. Any suggestion on how to go further in the installation process?


Edit mp3 tags remotely from Windows

I have a Windows desktop at home. My mp3's are on a dedicated Debian server. How do I edit the mp3 tags on the Linux server from my windows PC with a GUI software? Is there a GUI software that can connect to Linux and only edit the mp3 tags. I do not want to download the entire mp3 files and then re-upload it. There thousands of mp3s on the server.


Processes do not respond to my signals

I have a strange behavior on my system. When I invoke a command in the shell (bash version 4.2.45(1)-release), say `top` or `cat`, the running program (the process) does not respond to `Ctrl`+`C`. I even tried to run `kill -2 <pid>` and `kill -15 <pid>`, but it didn't help. However, I can kill processes with `SIGKILL`. I own the process, I even tried to send a signal to the process (signals 2 and 15) as root but it did not respond. I can quit `top` if I press `q`. Any ideas about the problem? Or any hint to troubleshoot it? **UPDATE 1** `cat` and `top` were just examples. All processes have the same behavior. I tried to write a simple program to sleep only (without signal handler) and I had the same behavior. **UPDATE 2** I wrote a small program to sleep only. This time I installed signal handler to catch `SIGTERM` and `SIGINT`. When I invoked `kill -15 <pid>` (and so with `-2`), my program did not receive the signal! I also updated the kernel to `3.11.10-100.fc18.i686` and still having the same problem.


grep equivalent of the kwrite regex [A-Z][A-Z]+

So, it took me ages, but I finally learned to _think_ in terms of regular expressions, thanks to using them in `kwrite`. But I still don't know how to translate that knowledge to `grep`. I love my `grep`, when I know what I'm doing with it, but the manual has always given me a headache. I'd like to match stuff like the following lines:               CAPITALSFOLLOWING anewline.     CAPI     TALSFOLL owing     ANEW line.      That is, lines that begin with two or more capital letters. But I can't figure out how. In `kwrite`, I would match these lines using:               \n[A-Z][A-Z]+      But `grep`... hmm. I have a feeling like it's something like:               me@ROOROO:~/$ grep "^[A-Z]something" filename      but               me@ROOROO:~/$ grep "^[A-Z][A-Z]+" filename      doesn't work (returns an empty file). A google search for the term 'grep match one or more occurrence' lead me to believe that               me@ROOROO:~/$ grep "^[A-Z][A-Z]*" filename      was the right syntax. But, alas, that doesn't do the trick.


How does forking affect a process's memory layout?

Please see the following figure showing the memory layout of a process: ![](http://i.stack.imgur.com/XVxqL.png): When someone `forks()`, and a new `task_struct` is assigned, what happens to the addresses of the process? In more or less other words: Imagine there is one process, so the image below holds. Now suppose I do a fork. What happens?


How can I remove GRUB2 entries in Fedora 16?

Recently, I executed the following command:               grub2-mkconfig -o /boot/grub2/grub.cfg      Now I have 6-7 Linux entries + 1 windows entry. How do I remove older kernel entries? I don't want to remove all the recovery kernel options by using:               GRUB_DISABLE_LINUX_RECOVERY="true"


how can I add records to the zone file without restarting the named service?

I'm working on centos6.5 and bind9 and I have managed to add records to a DNS zone by doing this steps: creating the key:                dnssec-keygen -a HMAC-MD5 -b 128 -n HOST example.com.      editing conf. file:               // TSIG Key     key "example.com." {          algorithm hmac-md5;          secret "THE KEY GENERATED ABOVE";     };     zone "example.com" IN {          type master;          file "example.com.zone";          allow-update{ key "example.com."; };     };      give the named authorization to the /var/named folder:               # chown -R named:named /var/named     # find . -type d -exec chmod 770 {} \;     # find . -type f -exec chmod 660 {} \;      I have adding records using this script:               #!/bin/bash     #Defining Variables     DNS_SERVER="localhost"     DNS_ZONE="example.com."     USER_NAME="dd2.example.com."     IP="192.168.1.7"     TTL="60"     RECORD=" $USER_NAME $TTL A $IP"     echo "     server $DNS_SERVER     zone $DNS_ZONE     debug     update add $RECORD     show     send" | nsupdate -k Kexample.com.+157+55566.key      it didn't return any error. I test if I add this record by using dig command:               #dig +short dd2.example.com.     192.168.1.7      but the problem that the record added doesn't appear in the zone file 'example.com.zone'. even when I use reload: `rndc reload MYZONE` or `rndc reload`   it returns an error message like this:               [root@dd Shells]# rndc reload example.com.     rndc: 'reload' failed: dynamic zone      but when I restart the named service: `service named restart` the record appears in the zone file. my question is : Is it a way to the record to be added to the zone file without restarting the named service?


booting freezes after used scheduler greatest stack depth error

I have built the linux kernel 3.14 with debug info. When I tried to boot it gives following error and after that booting freezes. ![enter image description here](http://i.stack.imgur.com/3cb6R.png) Can somebody tell me how to fix this ? Linux Version : Slitaz in Qemu


Clarification on permissions with GID & UID in UNIX

If Test1 & Test2 are users, then               Test1 : UID : 501, GID :501, groups=501,100     Test2 : UID : 502, GID :502, groups=502,100      What will be the correct option from below and explain how?   * Test1 can't access any file from Test2 because both are having different GID   * Test1 and Test 2 can access each others files because both are having 100 as group


Is there a way to search manpages for typical use scenario?

I have a relatively small brain, so there is a limit to what I can store up there. I have been using Linux semi-pro-amateur for a few years and still I am amazed at how little commands I know. Simple stuff like "how do I list all my partitions in a terminal" will launch a 15 minute DuckDuckGo-hunt. I am taking a stand! It ends today! So, is there a way to search manpages for stuff like "list partitions" and getting something like:               $ man-search list partitions          Results for "list partitions"     -----------------------------          df - list drives with size or something     du - list directory usage      I think I already know the answer, but ... maybe you can suggest a quicker way to find the utility I need when I need it. Thanks!


Preventing battery from charging

I'm running on UPS power and would like to prevent the laptop's battery from charging, to increase the amount of power available to other devices. Is there a way to do this? _update_ : The machine is a Dell Latitude D400. If people want more details, just ask. Also, I'm gathering that I need to explain my desired setup a little better. I've gotten a bunch of suggestions about taking the battery out. I'm not sure if people are suggesting to take the battery out while the machine is running — this, as I understand, is not a good idea with most laptops — or to just remove the battery altogether. The latter option is not optimal, because ideally I'd like to use the 30-60 minutes of power in the laptop battery and then switch over to UPS power. The details of the switch-over may constitute a separate question, but if I can't find a way to keep the laptop battery from charging, then removing the battery from the machine altogether may be the best way to do this. I'm not sure yet if this machine will run without a battery, but I'll check that out. Other than the laptop, the UPS is just supporting a cable modem and router and a USB hub. Again in the idealized version of this setup, all the power management changes would be automated, i.e. not require replugging anything or pressing Fn-keys. I'd like the machine to start using laptop battery power when apcupsd indicates that the UPS A/C is out, and then start using UPS power, but not charging the battery, when the battery is almost depleted.


How can I configure `anybody` to run X in a one-liner?

The common solution posted is to run `sudo dpkg-reconfigure x11-common` which gives a graphical prompt, however, I'm wanting to use this non-interactively. Scenario is that I'm SSH'd into a machine as root (during Vagrant provisioning) and need to run `startx` once as a regular user to generate some config files before proceeding to subsequent steps. I believe the reason I cannot simply `su otheruser startx` is due to Xauthority/me being connected via SSH as another user...


Mysterious bash instances using a lot of CPU, how can I debug?

I seem to have multiple `bash` processes running that are taking up most of my CPU. This is the output of `top -c`:                 PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND              20116 terdon    20   0 35288  14m  292 R 400.0  0.2   0:00.43 /bin/bash            20106 terdon    20   0 35992  15m  280 R  95.9  0.2   0:00.65 /bin/bash            20105 terdon    20   0     0    0    0 R  57.6  0.0   0:00.83 [bash]                This is the output of `ps aux | grep bash | head -3`:               terdon  7487 45.3  0.0      0     0 ?        R    19:31   0:01 [bash]     terdon  7488 66.0  0.0      0     0 ?        R    19:31   0:01 [bash]     terdon  7530 23.0  0.2  37984 17408 ?        R    19:31   0:00 /bin/bash      The PIDs change every time I run the command so it looks like something is constantly respawning `bash`. Details:   * There are multiple `[bash]` entries. If I understand correctly `[process name]` means that the process was launched with no command line arguments.   * The PIDs change so something is spawning these.   * I have logged out and logged back in (I am working in Cinnamon) and the problem persists.  Now, I imagine this will go away if I restart, my main question is what I can use to track these processes down? `top -c` does not help, `pgrep bash` just gives me different lists of PIDs, `lsof /bin/bash` just lists running bash instances and `pstree` shows them as independent processes. In case it is relevant, I am running Linux Mint Debian, kernel 3.2.0-4-amd64, GNU bash, version 4.2.36(1)-release. * * * EDIT: I have since rebooted (I had to) and, as expected, the problem has gone away. I am still interested in useful suggestions of how to track down such processes though.


How can I build and install PL/R as a non-privileged user?

There is a postgres instance, and I have the ability to build my own instance. Using these instructions I ran:               USE_PGXS=1 make      which worked but then               USE_PGXS=1 make install      did not, with this error: > /bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/mkinstalldirs > '/usr/lib64/pgsql'   >  mkdir -p -- /usr/share/pgsql/contrib   >  mkdir: cannot create directory `/usr/share/pgsql/contrib': Permission > denied   >  make: _*_ [installdirs] Error 1 Ideally I'd want to install this locally, but I do not know if that is possible. I am on RedHat 5.


Hardware code(s) from "sensors" command

When running the _sensors_ command in the terminal, the output contains what appears to be some sort of unique identifier for each piece of hardware listed. This is the output, as you can see below, for all the components listed. Is there a way to map these listed identifiers to their respective component; i.e. TB0T = CPU Temp? The machine in question is a MacBook Pro. ![enter image description here](http://i.stack.imgur.com/I964o.png)


Which process scheduling algorithm is used by Linux?

The Linux operating system switches between running processes to enable multi- tasking. What algorithm is used to determine when to suspend the execution of the currently running process and which process should run next?


How does linux handles zombie process

Zombie processes are created in Unix/Linux systems. We can remove them via the `kill` command. But is there any in-built clean-up mechanism in Linux to handle zombie processes?


Fedora 20 crashes momentarily on every boot, but system still running

I am trying to figure out what is causing the momentary crash on every boot up, as observed in the output from `last` command:               user    pts/0        :0               Wed Jul 15 21:07   still logged in     user    :0           :0               Wed Jul 15 20:29   still logged in     reboot   system boot  3.15.3-200.fc20. Wed Jul 15 20:29   still running     (unknown :0           :0               Wed Jul 15 20:29 - crash  (00:00)     reboot   system boot  3.15.3-200.fc20. Wed Jul 15 20:29   still running     user    pts/2        :0               Wed Jul 15 17:51 - 19:17  (01:26)     ...     user    :0           :0               Wed Jul 15 14:15 - 19:27  (05:11)     reboot   system boot  3.15.3-200.fc20. Wed Jul 15 14:12 - 19:27  (05:14)     (unknown :0           :0               Wed Jul 16 14:12 - crash  (00:00)     reboot   system boot  3.15.3-200.fc20. Wed Jul 16 14:12 - 19:27  (05:14)     user    pts/0        :0               Wed Jul 16 09:13 - 10:29  (01:15)      I tried to figure out what's wrong by querying the journald log, but I didn't find anything amiss except some private bus connection error and that sendmail got restarted again.               Jul 15 20:29:44 systemd[1]: Started Sendmail Mail Transport Agent.     Jul 15 20:29:44 systemd[1]: Starting Sendmail Mail Transport Client...     ...     Jul 15 20:29:46 systemd[875]: Failed to open private bus connection: Failed to connect to socket /run/user/42/dbus/user_bus_socket: No such file or directory     ...     Jul 15 20:29:51 systemd[1]: Stopping Sendmail Mail Transport Client...     Jul 15 20:29:51 systemd[1]: Stopping Sendmail Mail Transport Agent...     Jul 15 20:29:51 systemd[1]: Starting Sendmail Mail Transport Agent...     ...     Jul 15 20:29:57 systemd[1862]: Failed to open private bus connection: Failed to connect to socket /run/user/1000/dbus/user_bus_socket: No such file or directory      Can anyone tell me how to figure out what is causing the crash?


Understanding iostat with Linux software RAID

I'm trying to understand what I see in `iostat`, specifically the differences between the output for md and sd devices. I have a couple of quite large Centos Linux servers, each with E3-1230 CPU, 16 GB RAM and 4 2TB SATA disk drives. Most are JBOD, but one is configure with software RAID 1+0. The servers have very similar type and amount of load, but the `%util` figures I get with `iostat` on the software raid one is much higher than others, and I'm trying to understand why. All servers are usually 80-90% idle with regard to CPU. _Example of`iostat` on a server without RAID:_               avg-cpu:  %user   %nice %system %iowait  %steal   %idle                9.26    0.19    1.15    2.55    0.00   86.84          Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util     sdb               2.48     9.45   10.45   13.08  1977.55  1494.06   147.50     2.37  100.61   3.86   9.08     sdc               4.38    24.11   13.25   20.69  1526.18  1289.87    82.97     1.40   41.14   3.94  13.36     sdd               0.06     1.28    1.43    2.50   324.67   587.49   232.32     0.45  113.73   2.77   1.09     sda               0.28     1.06    1.33    0.97   100.89    61.63    70.45     0.06   27.14   2.46   0.57     dm-0              0.00     0.00    0.17    0.24     4.49     1.96    15.96     0.01   18.09   3.38   0.14     dm-1              0.00     0.00    0.09    0.12     0.74     0.99     8.00     0.00    4.65   0.36   0.01     dm-2              0.00     0.00    1.49    3.34   324.67   587.49   188.75     0.45   93.64   2.25   1.09     dm-3              0.00     0.00   17.73   42.82  1526.17  1289.87    46.50     0.35    5.72   2.21  13.36     dm-4              0.00     0.00    0.11    0.03     0.88     0.79    12.17     0.00   19.48   0.87   0.01     dm-5              0.00     0.00    0.00    0.00     0.00     0.00     8.00     0.00    1.17   1.17   0.00     dm-6              0.00     0.00   12.87   20.44  1976.66  1493.27   104.17     2.77   83.01   2.73   9.08     dm-7              0.00     0.00    1.36    1.58    95.65    58.68    52.52     0.09   29.20   1.55   0.46      _Example of`iostat` on a server with RAID 1+0:_               avg-cpu:  %user   %nice %system %iowait  %steal   %idle                7.55    0.25    1.01    3.35    0.00   87.84          Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util     sdb              42.21    31.78   18.47   59.18  8202.18  2040.94   131.91     2.07   26.65   4.02  31.20     sdc              44.93    27.92   18.96   55.88  8570.70  1978.15   140.94     2.21   29.48   4.60  34.45     sdd              45.75    28.69   14.52   55.10  8093.17  1978.16   144.66     0.21    2.95   3.94  27.42     sda              45.05    32.59   18.22   58.37  8471.04  2040.93   137.24     1.57   20.56   5.04  38.59     md1               0.00     0.00   18.17  162.73  3898.45  4013.90    43.74     0.00    0.00   0.00   0.00     md0               0.00     0.00    0.00    0.00     0.00     0.00     4.89     0.00    0.00   0.00   0.00     dm-0              0.00     0.00    0.07    0.26     3.30     2.13    16.85     0.04  135.54  73.73   2.38     dm-1              0.00     0.00    0.25    0.22     2.04     1.79     8.00     0.24  500.99  11.64   0.56     dm-2              0.00     0.00   15.55  150.63  2136.73  1712.31    23.16     1.77   10.66   2.93  48.76     dm-3              0.00     0.00    2.31    2.37  1756.39  2297.67   867.42     2.30  492.30  13.08   6.11      So my questions are: 1) Why is there such a relatively high `%util` on the server with RAID vs the one without. 2) On the non-RAID server the `%util` of the combined physical devices (sd*) are more or less the same as the combined LVM devices (dm-*). Why is that not the case for the RAID server? 3) Why does it seem like the software RAID devices (md*) are virtually idle, while the underlying physical devices (sd*) are busy? My first thought was that it might be caused by RAID checking, but `/proc/mdadm` shows all good. Edit: Apologies, I thought the question was clear, but that seems there is some confusion about it. Obviously the question is not about the difference in the `%util` between drives on one server, but why the total/avg `%util` value on one server is so different from the other. Hope that clarifies any misunderstanding.


Backslash with pipe in system command from awk

I want to invoke shell command from awk so I am using `system()` but when I am passing expression in I am getting error at backslash. Here is my expression               echo "select * from abc limit 1;"| impala-shell|grep -Eo " a-[0-9]-[0-9]* \| HS[0-9]  \| [0-9]* \| [0-9]* "      But when I am passing it to shell, I'm getting an error `backslash not last character on line`.               system("echo \"select * from abc limit 1;\"| impala-shell|grep -Eo \" a-[0-9]-[0-9]* \| HS[0-9]  \| [0-9]* \| [0-9]* \" ")      I want to get the above command result in awk programming after `system()` ,I know we can access through getline but dont know exact syntax. **EDIT** When using **\|** in system as **"\|"** got following               `warning: escape sequence `\|' treated as plain `|'`       I took some simple example to see **\|** in an expression               system("echo hey i am  \"\\|\" ashish ")     hey i am \| ashish      but when i try within double qoute and single quote yields in               system("echo \" a-[0-9]* \"\\|\" HS[0-9]  \"\\|\" [0-9]* \"\\|\" [0-9]* \" ")     a-[0-9]* | HS[0-9]  | [0-9]* | [0-9]*     //single quote     system("echo \' a-[0-9]* \"\\|\" HS[0-9]  \"\\|\" [0-9]* \"\\|\" [0-9]* \' ")     a-[0-9]* "\|" HS[0-9]  "\|" [0-9]* "\|" [0-9]*      what i am expecting is `a-[0-9]* \| HS[0-9] \| [0-9]* \| [0-9]*`.


Issue with zsh segfaulting: how to further assess the issue?

I'm using _Linux arch_ 3.15.2-1-ARCH x86_64. I don't use `zsh` (zsh-5.0.5-1) every day, otherwise I would have noticed it _segfaults_ , when I launch it from the `bash` cli:               arch kernel: zsh[2187]: segfault at 8 ip 00007f3b49853083 sp 00007fff2ad39198 error 4 in libc-2.19.so[7f3b497d2000+1a4000]     arch systemd-coredump[2188]: Process 2187 (zsh) dumped core.      Now I remember running it at some point and going through the configuration script(`zsh /usr/share/zsh/functions/Newuser/zsh-newuser-install -f` segfaults too now). So I have done the following:   * Reboot   * The behavior is the same in X or the console   * _Remove_ with configuration and clear package cache, then _reinstall_ : `pacman -Rns zsh; paccache -r; paccache -ruk0; pacman -S zsh`.   * Try to _compile_ using the recipe for _5.0.5-1_ and _5.0.4-1_ : compiles, then goes on to check the binary by executing it, which segfaults in both cases, so this aborts.   * Made sure to _have no_ `.zsh*` file in my home directory - made sure to _have_ the basic `.zsh*` files in my home dir.   * Renamed `/etc/profile`   * Renamed `/etc/zsh/zprofile`   * _zsh-completions_ is/is not installed Ironically, `zsh --version` or `\--help` **work** and echo the relevant info. So what could be the issue with my setup/environment here? * * * Note: ran quick _gdb_ if that brings any insight into what is happening:               (gdb) run     Starting program: /usr/bin/zsh      warning: Could not load shared library symbols for linux-vdso.so.1.     Do you need "set solib-search-path" or "set sysroot"?          Program received signal SIGSEGV, Segmentation fault.     0x00007ffff713e083 in __strchr_sse2 () from /usr/lib/libc.so.6     (gdb) bt     #0  0x00007ffff713e083 in __strchr_sse2 () from /usr/lib/libc.so.6     #1  0x000000000044f2e3 in ?? ()     #2  0x000000000044f7d4 in op ()     #3  0x000000000045003b in ?? ()     #4  0x00000000004505cd in ?? ()     #5  0x00000000004507dc in matheval ()     #6  0x0000000000450829 in mathevali ()     #7  0x00000000004602b0 in ?? ()     #8  0x00000000004624ab in assignsparam ()     #9  0x0000000000463636 in createparamtable ()     #10 0x000000000043f2b5 in setupvals ()     #11 0x0000000000440e14 in zsh_main ()     #12 0x00007ffff70dd000 in __libc_start_main () from /usr/lib/libc.so.6     #13 0x000000000040f7be in _start ()


get xautolock status

I'm currently using xautolock to automatically lock my screen with slock. However, when I'm watching a movie, I certainly _don't_ want my screen to go black suddenly. I read the manpage and saw that `xautolock -toggle` bound to a keyboard shortcut ought to give me control over the whole thing. **But, I want to see the current status.** Or I will get confused. Does anyone know a way to find the xautolock status, or should I do something like make a file containing the current status and use -enable / -disable, checking the file, and `notify-send`ing something?


How would you get all users history

I know there is the $HISTFILE variable where i can find the currently logged in users history-file, but how can i be sure to get every history file on the server I was thinking of the following:               sudo find /home/ -name '*_history*'      With output:               root@anders:~# sudo find /home/ -name '*_history*'     /home/seb/.bash_history     /home/adionditsak/.bash_history     /home/jakob/.bash_history     ...      Would this do the trick - or do you have a better way?


Is it possible to set mod_expires directives dependent on REMOTE_ADDR?

Basically I have a bunch of `mod_expires` directives in my `httpd.conf` like so:               ExpiresByType text/html "access plus 1 hour"      I realize that ultimately, the user's browser determines how long to hold onto something but the above suggestion is too long for the local users (`192.168.0.0/16`) but not long enough for internet visitors. Is it possible to have one set of cache control suggestions for local address and another for the rest of the world (sort of if/else-style)? If so, how would I do that? **EDIT:** This won't help me and I don't have a 2.4 install available to test with right now but if anybody wants to take a crack at posting a solution using 2.4's If/ElseIf/Else directives I'll accept that as an answer and award the bounty.


Bash one liner to change configuration parameters

I have a config file with following structure.               ValueOne = 1     ValueTwo = 2     ValueThree = 3      I want a one liner bash script to find ValueTwo and change the value to 22222. Any idea? _Not School Thing_


Stateful bash function

I’d like to implement a function in Bash which increases (and returns) a count with every call. Unfortunately this seems non-trivial since I’m invoking the function inside a subshell and it consequently cannot modify its parent shell’s variables. Here’s my attempt:               PS_COUNT=0          ps_count_inc() {         let PS_COUNT=PS_COUNT+1         echo $PS_COUNT     }          ps_count_reset() {         let PS_COUNT=0     }      This would be used as follows (and hence my need to invoke the functions from a subshell):               PS1='$(ps_count_reset)> '     PS2='$(ps_count_inc)   '      That way, I’d have a numbered multi-line prompt:               > echo 'this     1   is     2   a     3   test'      Cute. But due to the above mentioned limitation doesn’t work. A non-working solution would be to write the count to a file instead of a variable. However, this would create a conflict between multiple, simultaneously running sessions. I could append the process ID of the shell to the file name, of course. But I’m hoping there’s a better solution which won’t clutter my system with lots of files.


forgot to luksClose usb persistent partition, is this a problem?

Following the Kali Linux documentation for "Adding USB Persistence with LUKS Encryption", I created a persistent partition and encrypted the volume with:               cryptsetup --verbose --verify-passphrase luksFormat /dev/sdb2     cryptsetup luksOpen /dev/sdb2 my_usb     mkfs.ext3 -L persistence /dev/mapper/my_usb     e2label /dev/mapper/my_usb persistence     mkdir -p /mnt/my_usb     mount /dev/mapper/my_usb /mnt/my_usb     echo "/ union" > /mnt/my_usb/persistence.conf     umount /dev/mapper/my_usb      (substituting a volume name for "my_usb") However, I forgot to close the volume (the following line was ophaned on the next page in the documentation, so I didn't see it):               cryptsetup luksClose /dev/mapper/my_usb      Is this a problem? If so, how and is there any way to repair it? This article suggests it is but doesn't say why and the instructions don't work for me. The disk _appears_ to work fine.


Find when a hard disk was first installed

What's the command in AIX to find the first time a given hard disk was installed?


How do I list every file in a directory except those with specified extensions?

Suppose that I have a folder containing **.txt** , **.pdf** , and other files. I would like to list the "other" files (i.e., files not having the extensions **.txt** or **.pdf** ). Do you have any advice on how to do this? I know how to list files not having a given extension. For example, if I want to list all files except the **.txt** files, then either               find -not -iname "*.txt"      or               ls | grep -v '\.txt$' | column      seem to work. But, how can I list everything except **.txt** files _or_ **.pdf** files? It seems that I need to use some sort of logical "or" in `find` or `grep`.


Transfer programs to another OS

I have openSUSE. I can install programs with `yum`.               yum install <progname>      I want to move my install to a new hard disk. How can I transfer programs from one OS to another? My problem is that I have no access to the internet. So how can I install a program on it?


How to recover from recursive 'chmod -x' on my home folder

I pressed `ENTER` after typing the following stupid command on my home directory:               find . -type f -exec chmod -x '{}' ';'      What do you advise as a fix for this. My guess is that I can't do anything but do something like:               find . -type f -exec chmod og+x '{}' ';'      Or may be do some tricky stuff based on extensions (which doesn't seem very pertinent under Linux). Or may be some of you has an idea or a pointer on how to know which file should be executable under linux and how to detect them to turn them back to executables...


Using cut/awk/sed with two different delimiters

I have the following cases:                case@test.com      case_1_2@test.com      case_1@test.com      I'm trying to convert these to                case@test.com      case@test.com      case@test.com      So it should remove everything from the first '_' (including it) to the @ (not including that). I have something, but it doesn't really work correctly: Based on this thread: Cut based on Two Delimiters at one go, and this U&L Q&A: Splitting string by the first occurrence of a delimiter.               sed 's/^.*_\([^ ]*\) .*\@\([^$]*\)$/\1 \2/' infile      But no luck. Anyone want to take a chime at it?


Why do cpuinfo_cur_freq and /proc/cpuinfo report different numbers?

When I do ` sudo watch -n1 cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq ` I get 1.8 - 2.7 GHz. It never goes above 2.7. And when I do ` watch -n1 "cat /proc/cpuinfo | grep MHz" ` I get 768 MHz - 1.8 GHz. It never goes above 1.8. Anyone know what is going on?


How do I time how long my pg_restore takes in the command line?

I'm trying to track the amount of time the process takes for when I move around my data and upgrade my web app. From the command line, how would I track the amount of time elapsed from when the pg_restore command starts to when it finishes?


File and directory naming conventions

I want to refactor the files and directories on my system. However I am not sure what is _best practice_. After reading this question and it's answers I assume the most important part is to be consistent. However, this is where I'm stuck. E.g in root, there are directories suck as `/bin` and `/usr`, which all use lower-case letters. But in my user's directory `/home/foobar/`, there are already a bunch of directories such as `~/Pictures`, `~/Documents` and `~/Music` (which are capitalized)! Maybe this is just because I use Ubuntu, but **what is considered best practice**?


is there a vim shortcut or can I create one for 'tabe other_file'

When possible I create 1 or 2 letter abbreviations for aliases and the like, e.g. `x` for exit or `p` for pwd at the command line. When using vim and doing multiple tabs for different files (which I can switch between with `gt` or `gT` btw) I can edit an additional file with `:tabe filename` which also creates a new tab. Is there any shortcut or is there any way to create one (perhaps using the .vimrc file?) for something like `:ta` or `:tb` or `:tt` or `:tz` etc.


sed - replace complex lines in a file using variables

How do I replace a complex line in a file using sed? For example I want replace a udev rule in /etc/udev/rules.d/70-persistent- net.rules. This doesn't work:               OLD_RULE='SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:36:4c:e5", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"'          NEW_RULE='SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:36:4c:e5", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"'               sed -i "s/$OLD_RULE/$NEW_RULE/g" /etc/udev/rules.d/70-persistent-net.rules      The file remains unmodified.


write only permissions on samba

I am busy setting up a file server in our church office (using samba on a debian machine). I would like to impliment a dropbox-like folder for each user, where othere users may deposit files. Ideally it should work like this: The "owner" (does not necesarily have to be the unix owner) "A" should be able to read and delete files from his own dropbox only (not paste or create new files) All other users should be able to only paste or create files in the "A" directory, no deletion or overwrites. Ideally they should not even be able to list the folder contents. Currently, all regular users belong to a "Users" group, and I have set the directory owners to be their respective users (ie "a" is the owner of the "a" directory inside the "dropboxes/" directory) I tried setting the permissions to 533 and 522 for all these user folders, but I keep on getting the wrong result. I also tried using ACLs, but that, also, did not suceed. The "dropbox" directory lists as follow: drwxrwxr-x 5 root users 4096 Apr 7 01:01 dropboxes Any tips?


Dual monitor configuration on Intel Ivy Bridge

I'm trying to set up a dual monitor machine with an Intel DH67BL motherboard, Ivy Bridge i5-3450 CPU and dual Samsung 204b monitors. I cant seem to get the computer to recognize more than one of these monitors at a time. I can get either monitor to work using the DVI port directly or with a DVI-VGA cable, or by using the HDMI port with an HDMI-DVI cable. I managed to sort of get them working by substituting 2 smaller monitors and hot-plugging to the 204b's, but this locked me into an appallingly low resolution, and broke as soon as I tried adjusting the resolution. KDE's display settings only shows whichever monitor is currently working as connected. The Samsung 204b's also appear to be outputting bad EDID information, so forcing monitor settings is probably going to be neccesary. Edit: I ended up adding an old nvidia card to the computer, which runs both monitors quite happily.


inittab equivalent in fedora 15?

I have just installed Fedora 15 on my laptop. I want to study `/etc/inittab` as I studied it in RedHat 9. I don't see any script in `/etc/inittab`. Also , the way the default runlevel can be changed in `inittab` has changed in Fedora 15. If there is a good tutorial to study the changes in Fedora 15? I found https://fedoraproject.org/wiki/Systemd, but was not much useful.


dual booting centos5.5 and fedora

I already have CentOS 5.5 on my system whose hard disk is ~500GB. I have tried to dual boot with Fedora 16. while installing fedora 16 I have created a ~250GB and ~4GB partitions for "/" and swap. The installation has gone pretty smoothly until a error at the end said that installing bootloader has been unsuccessful. The grub at boot time only shows CentOS entries .Now when I boot into CentOS and run the lvm->lvscan .. it shows 4 partitions (2 swap spaces and two "/" partitions for CentOS and fedora 16). How can boot into Fedora.


Language agnostic configuration file format

Many projects these days use more than one programming / scripting language, and in standard DRY tradition these should not have separate configuration files if they need the same information. After a small survey in `/etc`, it looks like a lot of incompatible syntaxes are used in Ubuntu:   * `varname=value` - `/etc/adduser.conf`   * `varname: value` - `/etc/debconf.conf`   * `varname = value` - `/etc/deluser.conf`   * `$varname value` `/etc/insserv.conf`   * `varname value` - `/etc/login.defs`   * `set varname value` - `/etc/lftp.conf`   *     [section]         varname = value      `/etc/mke2fs.conf`   *     section         label varname value         set varname value      `/etc/smartd.conf` As far as I can see, none of these are "Yaml or XML or JSON," (one of them is INI though). Which format would you recommend (and why) for a project which needs to provide simple values (`debug = true`, `welcome = "Hello world!"`, `threads = 4`), arrays of simple values (`servers = [dev, test, prod]`), and values which refer to other variables (`thread_msg = "Using $threads threads"`) to Bash, Perl and PHP?


How to open chapters of Vim user manual in Vim

I opened the Vim user manual with the `:h user-manual | only` command (to open it in one window) and now I want to enter/open the separate text files. I tried to put my cursor over a section, such as |usr_01.txt| , and press CTRL-j but nothing happened.               Overview ~          Getting Started     |usr_01.txt|  About the manuals     |usr_02.txt|  The first steps in Vim     |usr_03.txt|  Moving around     |usr_04.txt|  Making small changes     |usr_05.txt|  Set your settings     |usr_06.txt|  Using syntax highlighting      |usr_07.txt|  Editing more than one file     |usr_08.txt|  Splitting windows


How to 'UnJustify!' text in GNU nano

I enjoy using `nano` as a respite from my usual GTK-based text editor. I like the simplicity of the interface, and using CTRL-K is the fastest way I know of to edit down long textfiles. However, I have one major gripe: whenever I justify text using CTRL-J, the editor prints the smug little message `Can now UnJustify!` -- yet I have not been able to find a way to unjustify text. Pressing M-U (which a Google search could reveal, M-U not being mentioned at all in the program's help files) simply seems to cause a glitch. The keyboard becomes unresponsive. Am I missing something?


Pipe diff file into patch?

Is there a way to pipe the diff output into `patch`? The -i parameter is for specifying a diff file, but I just want to do it more dynamically, since I will be updating regularly against a directory that changes frequently. For instacne, something along the lines of               patch -b | diff -Nub . /current-files      ? The man file says               -i patchfile  or  --input=patchfile     Read the patch from patchfile.  If patchfile is -, read from standard input, the default.      But when I try it, I just see the output of the diff on the screen, with no changes applied:               testb $> ls     file.txt          testb $> patch -i - | diff -Nub . ../testa     diff -Nub ./file.txt ../testa/file.txt     --- ./file.txt  2011-07-12 09:40:08.195467000 -0400     +++ ../testa/file.txt   2011-07-12 09:39:11.181666500 -0400     @@ -1,9 +1,7 @@      ijaosdfji      jaiosdfjio      jklasdkml     -asdkml     -s;lnk     -lsadjkl     -asdfas     -asdf     +klasdkml     +nas;lnk     +jklsadjkl          diff -Nub ./file2.txt ../testa/file2.txt     --- ./file2.txt 1969-12-31 19:00:00.000000000 -0500     +++ ../testa/file2.txt  2011-07-12 09:39:44.196235000 -0400     @@ -0,0 +1,6 @@     +aljksdf     +jklasdflkjlknm     +nksalk;     +klaskl;     +ioasjdoiaj     +lkmasd'lkm          testb $> ls     file.txt


How to create a list of all applications which were manually installed?

I use Fedora and I'd like to have all the package names in a list, but only the ones I installed myself, not the default ones.


Liveboot Kali does not detect filesystem

_To preempt some questions: yes the boot flag is set, it works correctly when on a computer using EFI_ I used `dd` to burn the Kali .iso (64 bit AMD) onto my USB. It works fine for EFI machines, however if I try to run it on machines without EFI I receive an error message similar to this : `Unable to find Operating System, cannot boot.` I have looked through the files on the USB. `ls`               autorun.inf  dists     g2ldr.mbr  live        setup.exe     boot         firmware  install    md5sum.txt  tools     debian       g2ldr     isolinux   pool        win32-loader.ini      (Output of `tree install live boot isolinux`)               install     ├── gtk     │   ├── initrd.gz     │   ├── install.bat     │   └── vmlinuz     ├── initrd.gz     ├── install.bat     └── vmlinuz     live     ├── filesystem.packages     ├── filesystem.packages-remove     ├── filesystem.squashfs     ├── initrd.img     ├── memtest     └── vmlinuz     boot     └── efi.img     isolinux     ├── advanced.cfg     ├── boot.cat     ├── hdt.c32     ├── install.cfg     ├── isolinux.bin     ├── isolinux.cfg     ├── ldlinux.c32     ├── libcom32.c32     ├── libutil.c32     ├── live.cfg     ├── menu.cfg     ├── splash.png     ├── stdmenu.cfg     └── vesamenu.c32      I noticed that there is only `efi.img` in the boot folder. I am unsure if (like in UNetBootin) the orignal .iso file must be on the USB in order to boot correctly. What do I need to do in order to boot from a "non-EFI" system?


How do I ensure that only one instance of my ksh script runs on Solaris using NFS?

> **Possible Duplicate:**   >  What Unix commands can be used as a semaphore/lock? I have read many similar post and the solution seems to be to use flock. flock does not exist on my system and I don't have rights to add it. **References:**   1. A "BashFAQ" link provided in a comment in how-to-make-sure-only-one-instance-of-a-bash-script-runs talks about using flock


Is it possible to set per-user permissions in Linux?

Is this possible? It seems that I have more options to set permissions in Windows than Linux. Let's say I want to give a user full access to a top-level directory but limit their access to certain subdirectories. Going one step further, how would I do this for multiple users?


Group+rx permission only in directories using ACL?

I need to install `acl` in order to set up a very specific permission structure. Group members should be able to see the files in a directory and change into the subdirectories. However, they should not have permission to read the files! I don't know how to achieve this. The command `setfacl -m d:g:mygroup:rx` will do part of the job, but then all files become readable. So, I need to apply this rule only to the folders `(drwxrwx---)`, everything else should be inaccessible `(rw-------)`.


Do memory-backed filesystems (like sysfs and procfs) have superblock and inode table?

From "Design and Implementation of the Second Extended Filesystem" I know that ext2 has superblock and inode table stored in disk and superblock will be accessed when mounting the filesystem. Do memory-backed filesystems (procfs, sysfs, debugfs, etc.) have superblock and inode table too?


Switch back to path when resume job from background

Say I open `~/vim.txt`, push that to background, then `cd` to another path. When I bring that job to foreground, is there an option to switch back to old path? I noticed it says `pwd`, so I assume it is possible.


How can I use two modes in emacs (markdown and auctex)?

When I edit markdown in emacs I use markdown-mode. However I often have to type some math formulas in the markdown file (processed by `mathjax`). However for those math parts markdown mode is not very comfortable. Is there a way to make emacs automatically switch to latex (auctex) mode (locally) when the point is between two `$` signs for example (`$\mathbb{R}$`) or between two double `$` signs for example               $$     \begin{align}     a = b     \end{align}     $$      ? **Edit** I also want to have the font locking of the "local" mode. **Edit 2** I tried `mmm-mode`, but this doesn't handle font-locking correctly. I guess that `multi-mode.el` or `MuMaMo`-mode might be what I want. But I didn't figure out how to use this in my examples. So, if it is possible to do what I want with one of this or with another mode, it would be great if someone could post detailed steps howto apply it in my case as an answer.


What is the Linux equivalent of bootinfo command?

**bootinfo** for AIX: > ...shows whether the hardware in use is 32-bit or 64-bit. What command/utility for Linux would do this job?


How to get my bluetooth keyboard to be recognized before log in?

Because I need to use my keyboard to log in, I would like my keyboard pair automatically, pre-log in. I am using Debian squeeze, and am new to linux. All tutorials I have found seem to require the HIDD package, which has been deprecated (I think) on current Debian releases. Apt-get install returns a package not found in repo response. Does anyone have a method to slove this problem? If it matters, I am using Debian Squeeze on a Raspberry Pi, and an Apple Bluetooth Keyboard/Magic Trackpad.


filesystem read only

My filesystem is read-only for several days. Searching for somesthing on my `/var/log/messages` and found this.               ****EMITTING CHANGED for /sys/devices/pci0000:00/0000:00:11/host0/target0:0:0/0:0:0:0/block/sda     ****Refreshing ATA SMART data for /sys/devices/pci0000:00/0000:00:11/host0/target0:0:0/0:0:0:0/block/sda     helper(pid 3495):launched job udisks-helper-ata-smart-collect on /dev/sda     helper(pid 3495):completed with exit code 0      I this a health test:               # smartctl -d ata -H /dev/sda      and get the follow output:               smartctl 5.42 2011-10-20 r3458 [x86_64-linux-3.1.0-1.2-default] (SUSE RPM)     Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net          === START OF READ SMART DATA SECTION ===     SMART overall-health self-assessment test result: PASSED      what can I do to prevent my filesystem to get readonly?


Copy markdown input to the clipboard as rich text

I'm about to get involved in some collaborative prose writing with a friend of mine via email. As a regular person, he will of course be using MS Word document formats; as a massive nerd, I prefer to use markdown when writing on a computer. What I need is the exact opposite of this question about converting rich text copied from a webpage to markdown. My naive worst-case workflow would be:   1. Write up the document in markdown   2. Use `pandoc -S file.mkd -o temp.html`   3. Open up `temp.html` in a web browser   4. Copy & paste from the page to the open document in libreoffice I am certain that this can be optimised. (Google Docs is not an option in this case). Even though I've answered the main question, I still feel that this could be optimised further. If there is any way to concatenate .doc files (which I will be receiving and which pandoc can write to), perhaps with the libreoffice command-line interface, then I suppose it would be possible to construct an overly-complicated one-liner and avoid having to leave the terminal at all. If anyone finds a way to do that, I will happily accept that answer over my own.


How to manipulate a CSV file with sed or awk?

How can I do the following to a CSV file using `sed` or `awk`?   * Delete a column   * Duplicate a column   * Move a column I have a big table with over 200 rows, and I'm not that familiar with `sed`.


m key not registering in Bourne-Again shell 3.2, OSX. Guesses?

Just lowercase `m`, and just when invoked interactively through `/bin/sh`. The keyboard works fine, and usually everything works fine. I almost never use `/bin/sh`, just `/bin/bash`, so it was somewhat surprising when I fired up sh on a whim just now. Bash, not Bourne shell, since I guess sh is just a link to `bash` in OSX, too... But regardless it's odd. Bash version 3.2.48(1). My `~/.inputrc` doesn't contain anything odd, and neither does `~/.profile`, or `/etc/profile`, but I'm guessing at some point months ago I modified a config file to make this happen. Either that or something legitimately screwy is up. I know `~/.bash_profile` and `~/.bashrc` aren't being run (because they print things and modify environment variables in a very distinctive way). Whatever the case, it bugs me. Any guesses where else I should look? edit: On restarting the machine, I'm having the problem invoked both invoked as `/bin/bash` and as `/bin/sh`. Invoking bash with --norc doesn't change the odd behavior, which leads me to believe something system-level has been modified distastefully. `m` is not currently an alias for anything (`type m` brings up nothing) and I can still run commands involving `m` by creating a temporary script file and then sourcing it. xev (and basically every other program) confirms that the issue is not with the m keypress event at the kernel or hardware level.


Problem when installing “ia32-libs”

I'm using x64 Ubuntu. A few months ago I accidentally messed up the groups/owners of all files on `/`, but managed to fix it using a VirtualBox install of Ubuntu. Now I'm running into a problem that I think is related to that mistake. When I try to reinstall `ia32-libs` (Skype is having problems so I need to reinstall those libs) I get an error message: > /var/lib/dpkg/info/ia32-libs.postinst: 40: /usr/lib32/gdk-pixbuf-2.0/gdk- > pixbuf-query-loaders: Permission denied `ls -al` /usr/lib32/gdk-pixbuf-2.0/` is this:               total 476     drwxr-xr-x  3 root root   4096 2011-09-24 17:08 .     drwxr-xr-x 53 root root 143360 2011-09-24 17:08 ..     drwxr-xr-x  3 root root     40 2011-09-24 04:44 2.10.0     -rwxr-xr-x  1 root root   9648 2011-04-05 00:40 gdk-pixbuf-query-loaders      I have tried to reinstall `gdk-pixbuff-2.0`, but it didn't work. How can I fix this?


OpenEmbedded: root account doesn't exist!

I'm using the current OpenEmbedded system from: http://git.openembedded.org/openembedded-core/tree/ (For what it's worth, I'm also pulling in layers from http://git.openembedded.org/meta-openembedded/tree/ and http://git.yoctoproject.org/cgit/cgit.cgi/meta-xilinx/tree/.) I have built up a set of recipes and a distro (adapting from an older set of recipes which worked with OpenEmbedded from a couple of years ago), which boots like this:               ...     [    2.441070] EXT3-fs (ram0): error: couldn't mount because of unsupported optional features (240)     [    2.450891] EXT2-fs (ram0): error: couldn't mount because of unsupported optional features (240)     [    2.466262] EXT4-fs (ram0): mounted filesystem with ordered data mode. Opts: (null)     [    2.474002] VFS: Mounted root (ext4 filesystem) on device 1:0.     [    2.480845] devtmpfs: mounted     [    2.484107] Freeing unused kernel memory: 200K (c066f000 - c06a1000)     INIT: version 2.88 booting     [    3.200537] EXT4-fs (ram0): re-mounted. Opts: data=ordered     bootlogd: cannot allocate pseudo tty: No such file or directory     [    3.341168] random: dd urandom read with 9 bits of entropy available     chown: unknown user/group root:root     chown: unknown user/group root:root     chown: unknown user/group root:root     chown: unknown user/group root:root     chown: unknown user/group root:root     chown: unknown user/group root:root     chown: unknown user/group root:root     chown: unknown user/group root:root     INIT: Entering runlevel: 5     Configuring network interfaces... ifconfig: SIOCGIFFLAGS: No such device     ifconfig: SIOCSIFADDR: No such device     Starting Dropbear SSH server: dropbear.     Starting HOSTAP Daemon: nl80211 not found.     Starting syslogd/klogd: done     Starting tcf-agent: OK          MYDISTRO 0.1 zc706-zynq7 /dev/ttyPS0          zc706-zynq7 login: [    8.338466] macb e000b000.ps7-ethernet eth0: link up (1000/Full)     zc706-zynq7 login: root     Password:     Login incorrect     zc706-zynq7 login:      (Never mind the "No such device" errors - I can fix that later.) The problem here is that the usual login method of username="root" (password not even requested) doesn't work. **It appears the root user doesn't even exist here!** Any expected password for root (such as empty, "root", "admin", etc) doesn't work. I can't get into this system. After doing some trial and error debugging, I changed my conf/distro/mydistro.conf to comment out these lines:               ...     # The following features are required by eglibc for a clean build of the sdk.     #DISTRO_FEATURES_LIBC = "libc-libm libc-backtrace libc-spawn libc-locale-code libc-getlogin libc-posix-regexp libc-ftraverse libc-posix-clang-wchar libc-posix-wchar-io libc-inet libc-crypt libc-nsswitch libc-utmp"     #DISTRO_FEATURES = "ext4 usbhost wifi pci ipv4 ipv6 largefile ${DISTRO_FEATURES_LIBC}"      **which causes the default DISTRO_FEATURES to be used fromhttp://git.openembedded.org/openembedded- core/tree/meta/conf/distro/include/default-distrovars.inc** (which is included from http://git.openembedded.org/openembedded- core/tree/meta/conf/distro/defaultsetup.conf, which in turn is included by http://git.openembedded.org/openembedded-core/tree/meta/conf/bitbake.conf on line 682). Now it boots like this:               [    2.446482] EXT3-fs (ram0): error: couldn't mount because of unsupported optional features (240)     [    2.456386] EXT2-fs (ram0): error: couldn't mount because of unsupported optional features (240)     [    2.471774] EXT4-fs (ram0): mounted filesystem with ordered data mode. Opts: (null)     [    2.479516] VFS: Mounted root (ext4 filesystem) on device 1:0.     [    2.486308] devtmpfs: mounted     [    2.489626] Freeing unused kernel memory: 200K (c066f000 - c06a1000)     INIT: version 2.88 booting     [    3.203046] EXT4-fs (ram0): re-mounted. Opts: data=ordered     bootlogd: cannot allocate pseudo tty: No such file or directory     [    3.345494] random: dd urandom read with 8 bits of entropy available     INIT: Entering runlevel: 5     Configuring network interfaces... ifconfig: SIOCGIFFLAGS: No such device     ifconfig: SIOCSIFADDR: No such device     Starting Dropbear SSH server: dropbear.     Starting HOSTAP Daemon: nl80211 not found.     Starting syslogd/klogd: done     Starting tcf-agent: OK          MYDISTRO 0.1 zc706-zynq7 /dev/ttyPS0          zc706-zynq7 login: [    8.348120] macb e000b000.ps7-ethernet eth0: link up (1000/Full)     zc706-zynq7 login: root     root@zc706-zynq7:~#      Yay, the root account works! The question is now: **what is the key missing DISTRO_FEATURE that makes the root account work?**


Copying wallpaper images into a single folder

In my ubuntu 12.04 set-up, there are lots of wallpaper images in the directory `/usr/share/wallpapers`. For example, one might be               usr/share/wallpapers/Leafs_Labyrinth/contents/images/1600x1200.jpg      What I want to do is travel through the wallpapers directory, pick out all the images of size `1600x...` or `1680x...` and copy them to another folder, but renamed, so that the above image would end up being called `Leafs_Labyrinth1600x1200.jpg`. I can't use `find` alone here; I expect I need to use some sort of shell script, of which I have very little experience. Is there an easy "natural" way to do this?


Not allowed to read a file for some reason

I have these permissions on a file:               -rw-r----- 1 root www-data 540 Mar 18 21:12 /etc/phpmyadmin/config-db.php      User `vagrant` is a member of group `www-data`:               vagrant@precise64:~$ cat /etc/group | grep www-data     www-data:x:33:vagrant      Why can't I read the file as `vagrant`?               vagrant@precise64:~$ cat /etc/phpmyadmin/config-db.php     cat: /etc/phpmyadmin/config-db.php: Permission denied


Rsync auto detect directories with small files and compress them together for transfer

I need to transfer some files via rsync and can´t tar them before. So I thought maybe there is a mode which checks the folders content and if it is thousand of small files inside compress that folder for the transfer. However I couldn´t find something like that in the man (http://www.manpagez.com/man/1/rsync/). Is it possible and I didn´t find it or would I have to do this before I use rsync?


PulseAudio conflict with ia32-libs?

When I was ready to install the PulseAudio server, APT reminded me that this package is conflict with these packages: `amarok browser-plugin-gnash browser- plugin-vlc gimp gnash gnash-common goldendict ia32-crossover ia32-libs ia32-libs-i386:i386 libgegl-0.2-0 libjack0:i386 vlc vlc-nox vlc-plugin-notify vlc-plugin-pulse vlc-plugin-vlsub` Why are `amarok` and `ia32-libs` in conflict with PulseAudio? I am confused if I can still use Amarok when I install PulseAudio or not. I am using Debian Jessie,and with ALSA.


Change path in sql script with sed

I'm trying to change the path in a oracle sql script from a bash script.               read -e -p "Enter the ORACLE SID: " -i "orcl" ORACLE_SID_VALUE     sed -i "DEFINE tsdir = '/u02/app/oracle/oradata/orcl';/c\DEFINE tsdir = '/u02/app/oracle/oradata/${ORACLE_SID_VALUE}'" schema-install.sql      when I execute the script i get the following error: _sed: -e expression #1, char 2: extra characters after command_ can anyone please help me with the correct sed command. * * * more info just to clarify: in the file schema-install.sql, there is a line defining where the oracle database will stored. DEFINE tsdir = '/u02/app/oracle/oradata/orcl'; I want to change the value _orcl_ to the value I type into the variable ORACLE_SID_VALUE.


Something happened to Swap; it is not used by default

I always have to go to `gparted` and then turn my swap on. The swap space isn't used by default and if I turn the swap on, the swap is not used! How can I make the swap space be used by default at boot? ![screenshot of System Monitor showing swap as "not available"](http://i.stack.imgur.com/QSJuc.png)


Linux on a tegra tablet for programming

I would like to use a tablet for some mobile programming. It would be nice to read a pdf and immediately try the code on the same device. I've found various videos and tutorials how to get Ubuntu running on an ex-android tablet so I'd like to ask   * Has anybody of you ever used Linux on arm?   * How about driver support? I heard nvidia is releasing tegra drivers for linux but I guess a tablet without working wlan wouldn't be to nice either.   * Did you ever program on arm? Any problems with compilers, IDEs? Does eclipse work? Just to be clear: I'm not sure if a linux on arm is a good idea to code on. Are there any major problems or limitations you know ?


How can I grep the results of FIND using -EXEC and still output to a file?

Better to explain on examples. I can:               find . -name "*.py" -type f > output.txt      But how can I store the output to the same file for:               find . -name "*.py" -type f -exec grep "something" {} \      I can't just do               find . -name "*.py" -type f -exec grep "something" {} \ > output.txt


Resolving symbolic links (pwd)

Say I do the following:               cd /some/path     ln -s /target/path symbolic_name      If then do:               cd /some/path     cd symbolic_name     pwd      I get:               /some/path/symblic_name      and not:               /target/path      Is there a way to have the shell "fully resolve" a symbolic link (i.e. updating CWD, etc.), as if I had directly done:               cd /target/path      ? I need to run some programs that seem to be "aware" or "sensitive" about how I get to my target path, and I would like them to think that I arrived to the target path as if had done `cd /target/path` directly.


Gnome Update Manager stays at 100 % system load

I experience a strange behaviour on my Debian (Wheezy x64) every time I use the Gnome Update Manager.   1. While downloading the files, the CPU load stays low. ![CPU load low while downloading](http://i.stack.imgur.com/9PZnD.png) (click for better resolution)   2. When the new packages are unpacked the CPU runs hot.![CPU load high while updating](http://i.stack.imgur.com/cFtIc.png) (click for better resolution)   3. After finishing all updates the CPU load stays at 100 % (at least for one core) until I close the update manager.![CPU still high after updating](http://i.stack.imgur.com/qwsea.png) (click for better resolution) While I can perfectly understand (1) and (2) I don't see why (3) is the case. Can you explain? [edit] Before update:                 1  [||                                 3.3%]     Tasks: 80, 154 thr; 2 running       2  [||                                 3.3%]     Load average: 0.15 0.21 0.18        Mem[|||||||||||||||||||||||||||||840/1907MB]     Uptime: 00:37:53       Swp[                               0/2047MB]            PID USER     PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command      3054 marcel    20   0  327M 15028 10632 S  2.0  0.8  0:01.28 gnome-terminal      1828 root      20   0  161M 22500  9980 R  1.0  1.2  0:43.00 /usr/bin/Xorg :0 -br -verbose -audit      3616 marcel    20   0 19820  1704  1176 R  1.0  0.1  0:01.49 htop      2476 marcel    20   0 1035M  383M 34944 S  1.0 20.1  2:15.71 /usr/lib/iceweasel/firefox-bin      2540 marcel    20   0 1035M  383M 34944 S  0.0 20.1  0:00.66 /usr/lib/iceweasel/firefox-bin      2266 marcel    20   0  396M 56320 13212 S  0.0  2.9  0:14.18 mutter      2282 marcel    20   0  522M 24896 16444 S  0.0  1.3  0:01.81 gnome-panel      2306 marcel    20   0  434M 43896 20636 S  0.0  2.2  0:06.83 mono /usr/lib/docky/Docky.exe      2255 marcel    20   0  382M 42124 11180 S  0.0  2.2  0:01.58 /usr/lib/gnome-settings-daemon/gnome-      2450 marcel    20   0  804M  139M 32548 S  0.0  7.3  0:32.14 /usr/lib/icedove/icedove-bin         1 root      20   0 10608   812   680 S  0.0  0.0  0:00.57 init [2]       300 root      20   0 21756  1824   820 S  0.0  0.1  0:00.07 udevd --daemon       431 root      20   0 21752  1244   336 S  0.0  0.1  0:00.00 udevd --daemon       432 root      20   0 21752  1208   300 S  0.0  0.1  0:00.00 udevd --daemon      1156 root      20   0 18924   964   708 S  0.0  0.0  0:00.00 /sbin/rpcbind -w      1171 statd     20   0 23104  1168   884 S  0.0  0.1  0:00.00 /sbin/rpc.statd      1191 root      20   0 31504   432   208 S  0.0  0.0  0:00.00 /usr/sbin/rpc.idmapd      1378 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.02 /usr/sbin/rsyslogd -c5      1379 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.00 /usr/sbin/rsyslogd -c5      1380 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.00 /usr/sbin/rsyslogd -c5      1377 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.04 /usr/sbin/rsyslogd -c5      1403 root      20   0  3904    76     0 S  0.0  0.0  0:00.00 /usr/sbin/acpi_fakekeyd      1408 messageb  20   0 24604  1936   800 S  0.0  0.1  0:00.40 /usr/bin/dbus-daemon --system      1438 root      20   0  147M  5208  4180 S  0.0  0.3  0:00.01 /usr/sbin/NetworkManager      2358 root      20   0  147M  5208  4180 S  0.0  0.3  0:00.00 /usr/sbin/NetworkManager      1418 root      20   0  147M  5208  4180 S  0.0  0.3  0:00.37 /usr/sbin/NetworkManager      1435 root      20   0 78444  3144  2532 S  0.0  0.2  0:00.02 /usr/sbin/modem-manager      1445 root      20   0  126M  4064  2828 S  0.0  0.2  0:00.11 /usr/lib/policykit-1/polkitd      1440 root      20   0  126M  4064  2828 S  0.0  0.2  0:00.26 /usr/lib/policykit-1/polkitd      1467 daemon    20   0 16632   368   220 S  0.0  0.0  0:00.00 /usr/sbin/atd      1500 root      20   0 22920  1924  1640 S  0.0  0.1  0:00.00 /usr/sbin/bluetoothd      1505 root      20   0  4208   816   504 S  0.0  0.0  0:00.11 /usr/sbin/acpid      1526 avahi     20   0 34096  1696  1404 S  0.0  0.1  0:00.01 avahi-daemon: running [notebook-marce      1527 avahi     20   0 33976   452   212 S  0.0  0.0  0:00.00 avahi-daemon: chroot helper      1579 root      20   0 20364  1056   828 S  0.0  0.1  0:00.00 /usr/sbin/cron      1590 root      20   0 29072  2940  2416 S  0.0  0.2  0:00.07 /sbin/wpa_supplicant -u -s -O /var/ru      1825 root      20   0 72932  3112  2616 S  0.0  0.2  0:00.00 /usr/sbin/gdm3      1804 root      20   0 72932  3112  2616 S  0.0  0.2  0:00.01 /usr/sbin/gdm3      1813 Debian-e  20   0 48736  1012   568 S  0.0  0.1  0:00.00 /usr/sbin/exim4 -bd -q30m     F1Help  F2Setup F3SearchF4InvertF5Tree  F6SortByF7Nice -F8Nice +F9Kill  F10Quit      after update (with gnome-update-manager still running):                 1  [||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%]     Tasks: 87, 159 thr; 2 running       2  [|||||                                                     7.2%]     Load average: 0.91 0.45 0.27        Mem[||||||||||||||||||||||||||||||||||||||||||||||||||||947/1907MB]     Uptime: 00:40:25       Swp[|                                                     0/2047MB]            PID USER     PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command      3645 root      20   0  398M 57908 33632 S 100.  3.0  1:20.62 /usr/bin/python /usr/bin/update-manager      3658 root      20   0  398M 57908 33632 R 100.  3.0  1:18.40 /usr/bin/python /usr/bin/update-manager      1828 root      20   0  164M 23960 10556 S  1.0  1.2  0:47.46 /usr/bin/Xorg :0 -br -verbose -audit 0 -novtswitch -auth /var/run/gdm3/auth-for-De      3054 marcel    20   0  327M 15028 10632 S  1.0  0.8  0:01.63 gnome-terminal      3616 marcel    20   0 19936  1800  1176 R  0.0  0.1  0:03.67 htop      2476 marcel    20   0 1103M  442M 34960 S  0.0 23.2  2:25.30 /usr/lib/iceweasel/firefox-bin      2450 marcel    20   0  804M  139M 32548 S  0.0  7.3  0:32.28 /usr/lib/icedove/icedove-bin      2266 marcel    20   0  398M 56888 13240 S  0.0  2.9  0:15.63 mutter      3618 marcel    20   0 1103M  442M 34960 S  0.0 23.2  0:00.16 /usr/lib/iceweasel/firefox-bin      2306 marcel    20   0  434M 44480 20924 S  0.0  2.3  0:07.73 mono /usr/lib/docky/Docky.exe      2492 marcel    20   0 1103M  442M 34960 S  0.0 23.2  0:00.38 /usr/lib/iceweasel/firefox-bin      2315 marcel    20   0  434M 44480 20924 S  0.0  2.3  0:00.30 mono /usr/lib/docky/Docky.exe      2282 marcel    20   0  522M 25328 16444 S  0.0  1.3  0:02.00 gnome-panel       300 root      20   0 21756  1828   820 S  0.0  0.1  0:00.11 udevd --daemon      3660 root      20   0 57068  6596  2724 S  0.0  0.3  0:00.05 /usr/lib/libgconf2-4/gconfd-2      2255 marcel    20   0  382M 42124 11180 S  0.0  2.2  0:01.75 /usr/lib/gnome-settings-daemon/gnome-settings-daemon      1445 root      20   0  126M  4064  2828 S  0.0  0.2  0:00.13 /usr/lib/policykit-1/polkitd      1440 root      20   0  126M  4064  2828 S  0.0  0.2  0:00.28 /usr/lib/policykit-1/polkitd      2181 marcel    20   0  151M  4408  3172 S  0.0  0.2  0:00.10 /usr/bin/gnome-keyring-daemon --daemonize --login      3628 marcel    20   0  162M  8064  6540 S  0.0  0.4  0:00.03 /usr/bin/gksu -k -D /usr/share/applications/update-manager.desktop -- /usr/bin/upd      3620 marcel    20   0  210M 24800 11484 S  0.0  1.3  0:00.13 /usr/bin/python /usr/bin/update-manager      2487 marcel    20   0 1103M  442M 34960 S  0.0 23.2  0:01.34 /usr/lib/iceweasel/firefox-bin      2540 marcel    20   0 1103M  442M 34960 S  0.0 23.2  0:00.66 /usr/lib/iceweasel/firefox-bin         1 root      20   0 10608   812   680 S  0.0  0.0  0:00.57 init [2]      1156 root      20   0 18924   964   708 S  0.0  0.0  0:00.00 /sbin/rpcbind -w      1171 statd     20   0 23104  1168   884 S  0.0  0.1  0:00.00 /sbin/rpc.statd      1191 root      20   0 31504   432   208 S  0.0  0.0  0:00.00 /usr/sbin/rpc.idmapd      1378 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.02 /usr/sbin/rsyslogd -c5      1379 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.00 /usr/sbin/rsyslogd -c5      1380 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.00 /usr/sbin/rsyslogd -c5      1377 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.04 /usr/sbin/rsyslogd -c5      1403 root      20   0  3904    76     0 S  0.0  0.0  0:00.00 /usr/sbin/acpi_fakekeyd      1408 messageb  20   0 24604  1936   800 S  0.0  0.1  0:00.42 /usr/bin/dbus-daemon --system      1438 root      20   0  147M  5208  4180 S  0.0  0.3  0:00.01 /usr/sbin/NetworkManager      2358 root      20   0  147M  5208  4180 S  0.0  0.3  0:00.00 /usr/sbin/NetworkManager      1418 root      20   0  147M  5208  4180 S  0.0  0.3  0:00.38 /usr/sbin/NetworkManager      1435 root      20   0 78444  3144  2532 S  0.0  0.2  0:00.02 /usr/sbin/modem-manager      1467 daemon    20   0 16632   368   220 S  0.0  0.0  0:00.00 /usr/sbin/atd      1500 root      20   0 22920  1924  1640 S  0.0  0.1  0:00.00 /usr/sbin/bluetoothd     F1Help  F2Setup F3SearchF4InvertF5Tree  F6SortByF7Nice -F8Nice +F9Kill  F10Quit


How can I easily copy one user's profile to another's in GNOME?

I have a multi-user environment. I would like them to use one profile (with specific settings like: themes, shortcuts, installed keyboard layouts, wallpaper, main menu items, etc.). Currently I need to set the same settings for each user. Is there any way to just copy some files to another user's profile and have all this stuff already configured?


Select a range of logs from daily log archives

I have a folder containing daily logs, named as :               system-2013-01-01.log     system-2013-01-02.log     system-2013-01-03.log     system-2013-01-04.log     system-2013-01-05.log     system-2013-01-06.log     system-2013-01-07.log     system-2013-01-08.log     ...     system-2013-01-31.log      How can I select ( and copy ) the logs from 2013-01-01 to 2013-01-15 ?


Btrfs subvolume questions

Just a few questions about Btrfs:   1. Do I have to mount a Btrfs filesystem before creating subvolumes on it?   2. Can I easily convert an existing directory into a subvolume? (i.e. if I want to make "/home" a separate subvolume can I just go `mk_btrfs_subfolder /home` (or whatever the command is), instead of having to make a new empty subvolume and copying everything over? The commands to do the above would be good but not necessary, just yes/no will be fine and I can Google how.


scp force overwrite read only files

I was wanting to use `scp` to move some files and overwrite any existing instances of these files on the destination server. Some of them may be read only which, of course, courses the `scp` to fail with "permission denied". I couldn't seem to find a `\--force` type switch for `scp`; is this possible? I am aware of `rsync` but this is not currently available on the destination server.


Compilation under Yocto

I've got an image installed with Yocto and a custom distribution on it (kernel 3.1). Theoretically, can I compile code with GCC and execute the binaries on my Yocto ? Can I develop an application on it ? Or do I need to compile on another OS, then create my Yocto image with my application compiled ?


How to quit GNOME file copy GUI after it hangs

Many times I find GNOME file copy GUI tool (Nautilus) irritating when it stops working. It happens when:   * I cancel the copy or move   * I try to copy to blue tooth exchange folder to my friends laptop(when he forgets to permit the operation or if the file is big)   * some other times, it just hangs while copying So I obviously get irritated with this and I want to quit the operation immediately. Unfortunately whenever I try to cancel it, it never works. This happened to me several times so I tried to find the process `ps aux| grep copy or cp` or something like that but I m never successful. Maybe it has become a zombie process I guess.


Control browser from command line

I have an old router that I have set up as an AP on my home network. For some reason it loses connectivity every few days and needs a reboot. I would like to set up a script to run once every night to do this automatically. I can open the my browser (`iceweasel`) and navigate to my admin page of the router from the terminal:               iceweasel http://admin:password@192.168.1.1/WLG_adv.htm      On the page that this command opens there is a button with this code:               <input onclick="return checkData();" name="Apply" value="Apply" type="submit">      Is there a way of performing the same action as this button from the terminal? I'm using a Debian Linux.


Gnome Logout from command

How to get logout from Gnome session via command line ? Also Is there any way in GNOME to do "switch user" from command line ?


How to use colors/colorschemes/fonts in vim effectively so that the text is as readable as possible

I am trying to be more productive in `vim` and as part of this I am trying to make the text presentation i.e. colors etc as nice to the eyesight as possible.   Although I managed to change the default color and cursorline and cursor colors etc, the colors I added where somewhat "random". I.e. what ever I found online. But the result is really not so good and readable.   Do you have a nice template about coloring in vim that I could use to make my life easier and text more readable?   As a side note I am using MacBook which has some transparency in the commandline and this also affects what the appearence is.   Also I am using vim for coding and not regular text editing if this makes a difference.


Windows 8 ask for repair when launched from grub

I've installed Linux Mint and everything works beautifully. After installing I've used boot-repair to be able to launch windows 8 from grub (as I've read somewhere), after that I have those windows-related options in grub:   1. Windows 8 UEFI bkpbootmgfw.efi   2. Windows Boot UEFI loader   3. Windows Recovery Environment (loader)   4. Windows 8 (loader) when I choose option:   1. I get a windows 8 screen "something went wrong..." and the computer restarts and grub is launched again   2. Preperation of Automatic Repair starts, which scared me so I aborted it (I am worried it would mess my linux partition)   3. I didn't try that (again - is that "linux safe"?)   4. A message is displayed: error: can't find command `drivemap'. error: invalid EFI file path. Press any key to continue. Maybe number 2 would solve my problem I am just scare to run not to mess up my Linux.


Do all distrbutions have the same drivers for ATI cards?

The problem is that my fan is too loud and working nonstop on my desktop. I have tried so far: Ubuntu 13.04, Linux Mint 15 and I had in both the same fan problem (nonstop working fan and very loud). In Windows 7 it's working nice. Is this only a problem of Gnome distros or KDE or Xfce based would work better for me? My configuration is: * * * **HP Pro 3410 Microtower PC**. Graphic card: **AMD Radeon HD 6570** Board: **2A9C 1.1** Bus Clock: **133 megahertz** BIOS: **American Megatrends Inc. 6.14 11/05/2010** Processor: **3,20 gigahertz Intel Core i3 550** * * * DRIVERS I HAVE TRIED FOR MY GRAPHIC CARD: I have tried these drivers so far: **xserver-xorg-video-ati, version: 1:7.1.0-0ubuntu2** **fglrx Version: 2:9.010-0ubuntu3** **fglrx-updates Version 2:9.012-0ubuntu1** But the fan is still blowing like a maniac.


Passing a code block as an anon. function

Is it possible to treat a block of commands as an anonymous function?               function wrap_this {        run_something        # Decide to run block or maybe not.        run_something else     }          wrap_this {        do_something        do_somthing else     }          # Do something else          wrap_this {        do_something_else_else        do_something_else_else_else     }      (I realize you create a function or file for each block, but I find this option clearer and easier to read in certain situations.) `while` does it with `do/done` and `function` does it with `{ multiple lines }`. I realize BASH does not have anonymous functions, but is it possible to pass multiple commands to another function, like you can do when defining a function or `while`?


Can't get BIND and NS to work properly

I just got myself an unmanaged Dedicated VPS from OVH and I don't have a prior experience of setting up servers or DNS servers but I followed a couple of tuts and installed webmin and created NS Zones for my Domain but now I'm having a weird issue where mxtoolbox and intodns.com are saying that no NS records are found for my Domain although I did register ns1.example.com and ns2.example.com with my domain registrar (which is Network Solutions in this case) but it still keeps failing and I am unable to access the website. I have been looking for a solution for 2 days now and I still haven't gotten one. Also, I am using CentOs 6.3. Here is my BIND config which I got from Webmin               //     // named.conf     //     // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS     // server as a caching only nameserver (as a localhost DNS resolver only).     //     // See /usr/share/doc/bind*/sample/ for example named configuration files.     //     options {     listen-on port 53 { 127.0.0.1; 198.245.51.xxx;};     listen-on-v6 port 53 { ::1; };     directory   "/var/named";     dump-file   "/var/named/data/cache_dump.db";         statistics-file "/var/named/data/named_stats.txt";         memstatistics-file "/var/named/data/named_mem_stats.txt";     allow-query     { localhost; any; };                      ## IP Range ##     allow-transfer  { localhost; 198.245.51.xxx; };                        ## Slave     DNS IP ##      recursion yes;     dnssec-enable yes;     dnssec-validation yes;     dnssec-lookaside auto;     /* Path to ISC DLV key */     bindkeys-file "/etc/named.iscdlv.key";     managed-keys-directory "/var/named/dynamic";     forwarders {         198.245.51.xxx;         8.33.137.xxx;         };     };     logging {         channel default_debug {                 file "data/named.run";                 severity dynamic;         };     };     zone "." IN {     type hint;     file "named.ca";     };     include "/etc/named.rfc1912.zones";     include "/etc/named.root.key";     zone "example.org" {     type master;     file "/var/named/example.org.hosts";     allow-transfer {         8.33.137.xxx;         };     also-notify {         8.33.137.xxx;         };     };     zone "221.51.245.198.in-addr.arpa" {     type master;     file "/var/named/198.245.51.xxx.rev";     };      **My IP table rules** :- ![enter image description here](http://i.stack.imgur.com/eybKA.png) **My hosts file:-**               Do not remove the following line, or various programs     that require network functionality will fail.          127.0.0.1       localhost.localdomain localhost          198.245.51.xxx  ns1          198.245.51.xxx  example.org          198.245.51.xxx  ns1.example.org          198.245.51.xxx  ns1.example.org.      **My resolv.conf file** :-               namserver 198.245.51.xxx     ns1.example.org 198.245.51.xxx     ns2.example.org 8.33.137.xxx     nameserver 127.0.0.1     nameserver 213.186.33.xx     search ovh.net      **intodns.com results** :- ![enter image description here](http://i.stack.imgur.com/KxRlk.png) **Note:- Just in case there is any confusion regarding the domain** _example.org_ , I just use this alias to mask my domain name but I'm pretty sure you guys already figured that out so just putting it out there. **UPDATE:-** **My Zone File:-**               $ttl 38400     example.org.    IN  SOA ns1.example.org. admin.example.org. (             1368243151             10800             3600             604800             38400 )     example.org.    IN  NS  ns1.example.org.     example.org.    IN  A   198.245.51.xxx     www.example.org.    IN  A   198.245.51.xxx     ns1.example.org.    30m IN  A   198.245.51.xxx     example.org.    IN  NS  ns2.example.org.     ns2.example.org.    IN  A   8.33.137.xxx     198.245.51.xxx.example.org. IN  PTR ns1     198.245.51.xxx.example.org. IN  PTR example.org      **My Zone overview** :- _Zone_   **_Zone_** : Root zone **_Type_** : Root **_Zone_** : 0 **_Type_** : Master **_Zone_** : 0000::1 **_Type_** : Master **_Zone_** : 127.0.0.1 **_Type_** : Master **_Zone_** : 198.245.51.xxx **_Type_** : Master **_Zone_** : localhost Master **_Zone_** : localhost.localdomain **_Type_** : Master **_Zone_** : example.org **_Type_** :Master; **My dig results** :-               [xxxx@xxxxxx ~]# dig ns1.example.org          ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.4 <<>> ns1.example.org     ;; global options: +cmd     ;; Got answer:     ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19537     ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1          ;; QUESTION SECTION:     ;ns1.example.org.            IN      A          ;; ANSWER SECTION:     ns1.example.org.     1800    IN      A       198.245.51.xxx          ;; AUTHORITY SECTION:     example.org.         38400   IN      NS      ns1.example.org.     example.org.         38400   IN      NS      ns2.example.org.          ;; ADDITIONAL SECTION:     ns2.example.org.     38400   IN      A       8.33.137.xxx          ;; Query time: 4 msec     ;; SERVER: 127.0.0.1#53(127.0.0.1)     ;; WHEN: Sat May 11 23:01:48 2013     ;; MSG SIZE  rcvd: 100      Please let me know if you need anymore info.


file(1) command termination when using the -f - option

Say I'd like to use the `file -f -` command inside a script, and send some input using the stdin, when I'm finished I'd like to terminate it gracefully, but unfortunately I haven't found any way to do this (and yes I did read the man page :) ).


Understanding interface forwarding with VPN

I have a server with static IP address that I rented (Debian on it), and I have a server with a server at home which I bought and setup as home server (with Ubuntu Server). What I would like to do is: Use my rented server, which has a static IP address I can always reach, to communicate with my home server through SSH. To so that, I installed and configured a VPN server on my rented server, and a VPN client on my home server. Everything with VPN looks fine. A `route -n` on the rented server (VPN server computer) gives               Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         93.222.111.1    0.0.0.0         UG    0      0        0 eth0     10.8.0.0        10.8.0.2        255.255.255.0   UG    0      0        0 tun0     10.8.0.2        0.0.0.0         255.255.255.255 UH    0      0        0 tun0     93.222.111.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0      where I see that my VPN server has created an interface for my kernel. **My question is:** After having my connection with VPN server successful, how can I use SSH to connect to my home server? If I use `ssh user@homeServerHostname` I get an error: > ssh: Could not resolve hostname homeServerHostname: Name or service not > known What should I do? Please advise. Thank you.


Followed SSD-optimization advice, now root partition won't mount rw

Tonight I decided I wanted to tweak the configuration of my Debian install on my netbook (Ideapad S10-2) to work better with the SSD I put in it. I have done this before and never had any issues but just in case I double- checked what I was doing against the Debian SSD Optimization guide and everything seemed right. At this point I rebooted and things went wrong. The system refused to mount the volume as anything but read-only complaining about the "discard" flag not being recognized. I've tried booting from several different live CDs (well, over PXE anyway) but they all refuse to mount the volume for one reason or another (after running through modprobe dm-mod; cryptsetup luksOpen et al) and I suspect it's the wrong way to go. Well, the problem I'd rather solve is to figure out a way to make the crippled system (which boots with the root partition mounted read-only) mount the root partition rw by somehow ignoring the `discard`flag in `/etc/fstab`, `/etc/lvm/lvm.conf` and `/etc/crypttab` so that I can change those back, reboot and have things back the way they were. Edit: It just dawned on me why it didn't work, the filesystem for the root partition is `ext3` for some reason. I had naively assumed it would be `ext4`. So the solution is clearly to somehow mount while ignoring the discard flag.


TrackPoint hard to control after Debian update

I'm on debian testing, and after rebooting (after an uptime of 3 weeks or so, that included a bunch of package updates, I believe including the kernel) the other day, the fine-adjustment - what a golfer would call putting - of the mouse pointer position gets really hard, it feels like the pointer is still moving, although the the trackpoint is already back at its center position. Using the trackpoint is no fun anymore, it takes seconds just to select a bunch of words. I don't think it's just a trackpoint performance configuration setting. It might be some threshold or the deactivation of some clever algorithm (or the activation of a wannabe clever algorithm) to enhance the usability of the trackpoint. This is an IBM/Lenovo external USB keyboard (it is not a ThinkPad laptop, even though I tagged this question 'thinkpad', as there is no 'trackpoint' tag yet and my current reputation doesn't permit tag creation). My xinput version:               $ xinput --version     xinput version 1.6.0     XI version on server: 2.2      And here the props of the device:               $ xinput list-props 10     Device 'Synaptics Inc. Composite TouchPad / TrackPoint':             Device Enabled (125):   0             Coordinate Transformation Matrix (127): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000             Device Accel Profile (247):     1             Device Accel Constant Deceleration (248):       2.500000             Device Accel Adaptive Deceleration (249):       1.000000             Device Accel Velocity Scaling (250):    12.500000             Synaptics Edges (251):  1632, 5312, 1572, 4284             Synaptics Finger (252): 25, 30, 256             Synaptics Tap Time (253):       180             Synaptics Tap Move (254):       221             Synaptics Tap Durations (255):  180, 180, 100             Synaptics ClickPad (256):       0             Synaptics Tap FastTap (257):    0             Synaptics Middle Button Timeout (258):  75             Synaptics Two-Finger Pressure (259):    282             Synaptics Two-Finger Width (260):       7             Synaptics Scrolling Distance (261):     100, 100             Synaptics Edge Scrolling (262): 1, 0, 0             Synaptics Two-Finger Scrolling (263):   0, 0             Synaptics Move Speed (264):     1.000000, 1.750000, 0.039809, 40.000000             Synaptics Edge Motion Pressure (265):   30, 160             Synaptics Edge Motion Speed (266):      1, 401             Synaptics Edge Motion Always (267):     0             Synaptics Off (268):    0             Synaptics Locked Drags (269):   0             Synaptics Locked Drags Timeout (270):   5000             Synaptics Tap Action (271):     0, 0, 0, 0, 0, 0, 0             Synaptics Click Action (272):   1, 1, 1             Synaptics Circular Scrolling (273):     0             Synaptics Circular Scrolling Distance (274):    0.100000             Synaptics Circular Scrolling Trigger (275):     0             Synaptics Circular Pad (276):   0             Synaptics Palm Detection (277): 0             Synaptics Palm Dimensions (278):        10, 200             Synaptics Coasting Speed (279): 20.000000, 50.000000             Synaptics Pressure Motion (280):        30, 160             Synaptics Pressure Motion Factor (281): 1.000000, 1.000000             Synaptics Grab Event Device (282):      1             Synaptics Gestures (283):       1             Synaptics Capabilities (284):   1, 1, 1, 1, 1, 1, 1             Synaptics Pad Resolution (285): 1, 1             Synaptics Area (286):   0, 0, 0, 0             Synaptics Noise Cancellation (287):     25, 25             Device Product ID (242):        1739, 9             Device Node (243):      "/dev/input/event6"      **Update** I forgot there are 2 devices that might be relevant, this one actually looks more relevant than the synaptics device:               $ xinput list-props 11     Device 'TPPS/2 IBM TrackPoint':         Device Enabled (135):   1         Coordinate Transformation Matrix (137): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000         Device Accel Profile (260):     0         Device Accel Constant Deceleration (261):       1.000000         Device Accel Adaptive Deceleration (262):       1.000000         Device Accel Velocity Scaling (263):    10.000000         Device Product ID (255):        2, 10         Device Node (256):      "/dev/input/event9"         Evdev Axis Inversion (302):     0, 0         Evdev Axes Swap (304):  0         Axis Labels (305):      "Rel X" (145), "Rel Y" (146)         Button Labels (306):    "Button Left" (138), "Button Middle" (139), "Button Right" (140), "Button Wheel Up" (141), "Button Wheel Down" (142)         Evdev Middle Button Emulation (307):    0         Evdev Middle Button Timeout (308):      50         Evdev Third Button Emulation (309):     0         Evdev Third Button Emulation Timeout (310):     1000         Evdev Third Button Emulation Button (311):      3         Evdev Third Button Emulation Threshold (312):   20         Evdev Wheel Emulation (313):    0         Evdev Wheel Emulation Axes (314):       0, 0, 4, 5         Evdev Wheel Emulation Inertia (315):    10         Evdev Wheel Emulation Timeout (316):    200         Evdev Wheel Emulation Button (317):     4         Evdev Drag Lock Buttons (318):  0      Any idea what knob to turn? **Update** I diffed the above properties against those of another machine (a Lenovo laptop where the TrackPoint works fine) also running debian testing, and they are exactly identical. The version of xinput is the same, too. So I guess we can exclude the xinput version as well as the xinput settings for those devices from our considerations. I'll try to get my hand on another IBM USB keyboard and check if it isn't - after all - a hardware issue... [The following is an edit to this question made by _Barry Grumbine_ (thanks, man), that got rejected by http://unix.stackexchange.com/users/2180/shawn-j- goff (no thanks, man). Because I find it very useful and Shawn's rejection hid this bit of information from me (until now) and others, I'll paste it in here:] **Additional Information**   There is an open Debian bug report that I believe describes this problem #682413 The problem seems to be related to the synaptics_usb kernel module. According to synaptics_usb.c, line 30: > [...] touchstick support has not been tested much yet[...]


Startup script not executing after reboot on Solaris

I have a command to start Apache in `/etc/rc3.d` that does not execute when the server reboots. The script is named `S75Apache2`. Someone has speculated that this is because the link has a capital "A" in the name and it might work if renamed to `S75apache2`. Can anyone confirm? I've searched for documentation but cannot find an answer. I can't really test this without rebooting the server again (which I'd rather not do).


dump freezes system

`dump -h 0 -0Lauf /backup/ada0p2.dump /` - causes total system freeze.               server# cat /etc/fstab     # Device        Mountpoint      FStype  Options Dump    Pass#     /dev/ada0p2     /               ufs     rw      1       1     /dev/ada0p3     none            swap    sw      0       0     /dev/ada1p1     /backup         ufs     rw      2       2      nodump flags are set to `/backup` and `/usr/home` following options are set to make sure there are no errors on the disks.               fsck_y_enable="YES"     background_fsck="NO"      FreeBSD 9.0-RELEASE amd64 Please help. **EDIT: This is the last stats I can get before system freezes**               server# top     ...     42 processes:  2 running, 40 sleeping     CPU:  0.0% user,  0.0% nice, 47.6% system,  3.6% interrupt, 48.8% idle     Mem: 71M Active, 39M Inact, 139M Wired, 420K Cache, 124M Buf, 1718M Free     Swap: 4096M Total, 4096M Free            PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND      1723 root          1  97    0 10056K  1188K CPU0    0   0:18 85.06% mksnap_ffs      1711 root          1  20    0 10056K  1360K wait    1   0:00  0.00% dump


Ubuntu doesn't boot normally after manual installing of X.org

I tried to compile and install X.org (for a single card/multiseat in this tutorial) by getting source from here and installing it by:               ./configure --enable-kdrive --enable-xephyr --enable-xfake --enable-xfbdev --enable-kdrive-kbd --enable-kdrive-mouse --enable-kdrive-evdev --enable-glx-tls     make     sudo make install      after this Ubuntu freezes in boot on the Ubuntu logo and doesn't boot up!   **Note** : it boots in recovery mode and X starts by using `startx` from terminal (in recovery mode) ; it just doesn't start normally!   I'm using Ubuntu 12.04 What is the problem?   How can I fix it?


Replace python built with UCS4 with UCS2

I've got fedora fc15 installed with python 2.7.1-7.fc15. It is built with ucs4 and I've got some packages here at work that are built with ucs2. I now cannot build other packages that use these ucs2 packages because my python is ucs4. And the problem is that as soon as I remove python, yum doesn't work and things get complicated. What is the best way to approach this problem, to get ucs2 python and all? Please note that I cannot influence the pre-built company binaries that are built with ucs2 to be built with ucs4. thanks


How to force a connection to a certain host to use to a specific source IP?

When using the Shoutcast2 yellowpages there is a really annoying issue that it always uses the default IP the system uses for an outgoing conection to register itself even if the server is configured to listen on a different ip - I guess I don't need to mention that this makes no sense and the YP system unusable. Marking all other IPs of the systems as deprecated is not an option; I don't want the stream IP to be the default IP for other outgoing connections. So what I'm looking for is a way to make those connections (always to yp.shoutcast.com:80) use a certain source IP address. An existing tool would be perfect but a solution that requires not-too-much coding would be fine, too. I also have root access on the machine so iptables-based solutions would be even better.


Is it possible to login as root user in LXDE desktop environment?

Is it possible to configure certain settings to allow me to login as root user into the GUI on a Fedora 17 with an LXDE desktop? I know I can do it using KDE, but KDE is not an option for this particular machine. I do understand the risk of logging in as root user.


I don't know how to connect preconfigured OpenWRT router to my home network

What I need to do is to connect preconfigured OpenWRT router to another network through WAN cable connection. My router assign the IP address to new router but even if I use this address it still rejects my SSL connection (as it appears). I've done some googling and read some OpenWRT wiki pages but then I found out that I am missing directories such as '/etc/config'. Any suggestions?


How to Download from an FTP site

I am using: `SCO_SV scosysv 3.2 5.0.7 i386`, and I am trying to download ssh and install it. But the only way I can do it, is by using FTP. I have tried the following:               # ftp     ftp> ftp2.sco.com     ?Invalid command     ftp>      What am I supposed to do? I have never used FTP before in any Linux machine. I have Googled it, and I looked at every entry on the first page, and that is all talking about downloading packages from FTP sites—no use.


How to get keycodes for xmodmap?

I'm trying to use `xmodmap` to remap `Alt` / `Super` keys on Dell L100 keyboard, and have trouble getting the keycodes. For instance, using `xev` doesn't give me keycode for `Alt`               FocusOut event, serial 36, synthetic NO, window 0x4a00001,         mode NotifyGrab, detail NotifyAncestor          FocusIn event, serial 36, synthetic NO, window 0x4a00001,         mode NotifyUngrab, detail NotifyAncestor          KeymapNotify event, serial 36, synthetic NO, window 0x0,         keys:  122 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0                   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0         For `Right Super` key, `xev` and `showkey` give different keycodes -- `134` and `126` respectively. What's going on with these keycodes? I tried getting keycodes from `showkey -k`, and using `xmodmap` file below, but that gave a weird map which remapped `b` key:               clear Mod1     clear Control     keycode 125 = Meta_L     keycode 126 = Meta_R     keycode 58 = Control_L     keycode 56 = Control_L     keycode 100 = Control_R     add Control = Control_L Control_R     add Mod1 = Meta_L Meta_R


use iptables to allow incoming connections to some computer on port XYZ?

This is what I have: `iptables -i em1 -A INPUT -j ACCEPT -p tcp --dport 9001 -v`. If I want to accept incoming connections on port 9001 at this (127.0.0.1, or on the network 192.168.1.143) address, what am I doing wrong?


Rename beginning of file name using specific text in the file itself

I have many files in directory (`file1.txt`, `file2.txt`, ...) Every files contains bunch of lines. One of the line is specific text `thetext` followed by random number just like `thetext56`, `thetext21`, etc. I want to rename beginning of the file name using specific text in the file itself. So, `file1.txt` will be `thetextXXfile1.txt`, `file2.txt` will be `thetextXXfile2.txt`, and so on. Simple rename command to add `addtext` on the beginning is               rename 's?^?addtext?' *.html      while getting that specific text in the files is               sed '/thetext/!d' *.html      but I have no idea how to combine both of them.