Will wget -k still convert links to relative paths if wget is stopped prematurely?

I am running wget on a site that (I have come to realize) has two languages - and duplicate pages for each language. I've already got the content in English, so I'd like to stop wget from downloading anything more. I specified the -k switch when I ran it, so will it convert the links to relative links as usual if I stop wget before it's done completely downloading everything? Or will it simply stop? (There's another question on the StackExchange network that addresses forcing wget to convert links on already downloaded content by running               wget -nc -k [previous options] [previous url]      but timestamps were accidentally turned off so that's not an option.)


How to list all hardware supported by kernel

I want to see all hardware supported by the kernel in use. For example, if I have the 3.8.x.x version of the Linux kernel, how will I know what hardware is supported there. Tools like `lspci`, `lshw`, `lscpu` and `dmidecode` only check the hardware that is used at the moment and trying to find this using the loaded modules with `lsmod` is not handy either. What I want is something that checks all hardware actually supported by the kernel in use without taking into consideration if I am using that hardware or not. For the moment I thought of stuff like:   * Reading the `/lib/modules/3.8.0-5-generic/kernel/drivers` and parsing every file.   * Downloading the git source of the kernel and grepping it for information about this.   * Any other crazy and very long way of doing it. Is there any other smaller way of achieving this.


SSH disconnects when screen locked with vlock

I'm using tmux + PuTTY to get all the UNIX goodness I need when using Windows. I have the following settings in my `.tmux.conf`:               set-option -g lock-command vlock     set-option -g lock-after-time 1800      As expected, after 30 minutes, my screen goes to this:               This TTY is now locked.       Please press [ENTER] to unlock.      And then it all goes wrong... after awhile PuTTY gives me the follow error: `Server unexpectedly closed network connection` ![enter image description here](http://i.stack.imgur.com/8COkk.png) Any thoughts on why I'm getting disconnected from SSH?


How to find packages only which package name equal to text with aptitude?

When I want to search a package which named 'z', aptitude find packages which contains 'z' in package name same as 'like' in SQL, so aptitude find a lots of packages. How can I search packages which package named z?


sudo permission denied but su grants permission

this is the first occurrence where su was required for me. I read an article about changing the value in /sys/devices/virtual/backlight/acpi_video0/brightness to alter my laptop's screen brightness. I first noticed that when I would `$ sudo echo 10 > brightness` I would get permission denied. I switched to root using su and `# echo 10 > brightness` changed my brightness almost instantly. The last weird thing to me happened when I tried `# echo 20 > brightness` (maxbrightness file holds the value 15) and I got a write error Could someone explain this difference between sudo and su to me? Understanding the write error would be an added bonus. Any help, pointers, and/or links would be much appreciated.


Find 'duplicate' mails in maildir when header differs slightly

My problem is that I've been a heavy user of GMail's pop3-import feature and used it to pull mail from other GMail Accounts. Back then I did, however, only import new mail, not all the mail previously stored on the server. Now that I've started to use mutt as my mail client of choice I've decided to import all my former mail accounts and thus archive all my old mail locally. My initial hope was that I could easily weed out the duplicate mails by using a tool like fdupes, but what I did not anticipate was that the Mail-Header is altered slightly by GMail when it it retrieves a mail via Pop3 as it can be seen here:               @@ -1,7 +1,16 @@      Return-Path: <xxxx@googlemail.com>      Delivered-To: unknown      Received: from pop.gmail.com (74.125.43.109:995) by localhost with POP3-SSL;     -  10 May 2011 13:35:06 -0000     +  10 May 2011 14:29:41 -0000     +Delivered-To: yyyy@gmail.com     +Received: by 10.204.52.199 with SMTP id j7cs172325bkg;     +        Sun, 2 May 2010 15:33:19 -0700 (PDT)     +Received: by 10.204.136.15 with SMTP id p15mr6011875bkt.172.1272839446530;     +        Sun, 02 May 2010 15:30:46 -0700 (PDT)     +Received-SPF: softfail (google.com: best guess record for domain of transitioning xxxx@googlemail.com does not designate 84.167.28.93 as permitted sender) client-ip=84.167.28.93;     +Received: by 10.188.26.17 with POP3 id 17mf826641bwz.107;     +        Sun, 02 May 2010 15:30:46 -0700 (PDT)     +X-Gmail-Fetch-Info: xxxx@gmail.com 1 smtp.gmail.com 995 xxxx      Received: from aequitas ( [84.167.28.93])              by mx.google.com with ESMTPS id e20sm18902485fga.1.2008.01.04.07.58.46              (version=TLSv1/SSLv3 cipher=RC4-MD5);      The original looked like this: http://pastebin.com/U6YzNySP Is there an easy way to get rid of those "duplicate files" in an easy way?


how to read and modify fstab in python?

I want to automatically configure my `fstab` in `python` by running a script. I thought of using `ConfigParser` in `python`, but I am unable to use it properly.


Regular Expression for finding double characters in Bash

I am looking for a regular expression that finds all occurences of double characters in a text, a listing, etc. on the command line (Bash). **Main Question** : Is there a simple way to look for sequences like `aa`, `ll`, `ttttt`, etc. where one defines a regular expression that looks for n occurences of the same character with? What I am looking for is achieving this on a very very basic level. On the command line. In a Linux Shell. After quite some research I came to the following answers - and questions resulting from them, thus they just gave me a hint where the solution might be. But: a) (e)grep and the backslash issue   * `grep 'a\{2\}'` looks for `aa`   * `egrep'a{2}'` looks for `aa` Question: Is the necessity of setting backlashes really bound to the command I use? If so, can anyone give me hint what else is to be taken into account when using (e)grep here? b) I found this answer here for my question, though it isn't exactly what I was looking for: `grep -E '(.)\1' filename` looks for entries with the same character appearing more than once but _doesn't ask how often_. This is close to what I am looking for, but I still want to set a number of repeatings. I probably should split this into two or more questions, but then I don't want to flood this awesome site here. P.S.: Another question, possibly off topic but: is it `in`, `inside`, `at` or `on the shell`. And is `on the command line` correct?


how to make Tabs Outliner, for Chromium Browser, popup on mouse move to screen edge?

So, we have the Tabs Outliner extension https://chrome.google.com/webstore/detail/tabs- outliner/eggkanocgddhmamlbiijnphhppkpkmkl That is a very good vertical tabs manager for chromium. The problem is it occupies too much screen, and I dont have a widescreen monitor. So it is a new chrome window that would be visible all the time, occupying the left side of the screen. The problem is: how make it hide automatically after you move your mouse away from it, and after you double click on one of its listed tabs?


Install x11 on my own linux system

I have developed my own tiny linux file system using **buildroot** and **busybox**. I used linux-2.6.38.8 kernel configured and cross-compiled for target system(X86) according to needs.Now the filesystem is built but it has only busybox shell and it doesn't support GUI.It does not have any package- manager too.Now I want to enable GUI on it. I checked **/etc** but there was not any **x11** directory or **x11.conf** file.It does not support **startx** too.               How can I install x11(XFree86 or Xorg) on my system Explicitly.          I also want to install a package-manager for my system.      How can this be achieved?


System hangs on shutdown/restart - is ssh involved?

If I ssh into my server and do 'shutdown -r now', the shutdown hangs on the message 'Sending processes the KILL signal', and I have to walk into the lab and use the power button to force a shutdown. When I do the same thing on a session with a locally attached keyboard/monitor, the shutdown works fine. How do I at least confirm what process is hanging?


join : "File 2 not in sorted order"

I've got two files _jeter3.txt and _jeter1.txt I've checked they are both sorted on the 20th column using `sort -c`               sort -t '     ' -c -k20,20 _jeter3.txt     sort -t '     ' -c -k20,20 _jeter1.txt     #no errors      but there is an error when I want to `join` both files it says that the second file is not sorted:               join -t '   ' -1 20 -2 20 _jeter1.txt _jeter3.txt > /dev/null     join: File 2 is not in sorted order      I don't understand why.               cat /etc/*-release #FYI     openSUSE 11.0 (i586)     VERSION = 11.0      **UPDATE** : using '`sort -f`' and `join -i` (both case insensitive) fixes the problem. But it doesn't explain my initial problem. **UPDATE** : versions of sort & join:               > join --version     join (GNU coreutils) 6.11     Copyright (C) 2008 Free Software Foundation, Inc.     (...)          > sort --version     sort (GNU coreutils) 6.11     Copyright (C) 2008 Free Software Foundation, Inc.     (...)


ssh_config: specify command to be executed on the remote machine upon login

This is an expansion of my earlier question. I need to run a **locally- stored** command (i.e. `mount /home`) on a remote machine upon ssh login. At the moment, I am using:               ssh -t mymachine.example.com 'mount /home ; /bin/bash'      which works fine, but I was wondering whether I could put this command into my `.ssh/config` so that I don't have to type it every time. I found a `LocalCommand` option, but I don't see any `RemoteCommand` option. It is importand that the `command-to-be-executed` be stored on the local machine, as it will contain password to open an encrypted disk. That is the reason why I cannot put the command into `.profile` on the remote machine.


smitty like demo sites?

https://secure.wikimedia.org/wikipedia/en/wiki/IBM_AIX_SMIT      I'm searching for a "demo" site for learning smitty (get the used commands by F6!)      Are there any? Like there are router demo sites:      http://support.dlink.com/emulators/di604_reve/h_wizard.html   http://www.informatione.gmxhome.de/DDWRT/Standard/V23final/         Because AIX can't run in a VM :(


process that only root can run

I have created a process and it is running in the background as a daemon it.Now I want that only root should be able to view the output of that process.My process is something like "top" which accumulate data from the system and show system statistics when asked for and I want is that system statistics should be shown only to the root. Thanks in advance.


How to clone a CentOS server to a VM?

I have a HP Proliant DL380 CentOS 5.10 server that I'd like to clone to a VMWare VM. I have successfully cloned it to identical hardware using Clonezilla, however when I try to restore it to a VM it appears to clone successfully, but on boot I get an error message: ![enter image description here](http://i.stack.imgur.com/Xo3pE.png) I can't find much information on how to perform a clone like this and I think I might be missing something. The maximum ram I can safely set is 4GB (the server has 12) and maximum cpus is 4 (server has 8).


Best way to migrate a mail server?

I have a Plesk panel mail server with used hard disk space of 480GB out of a total of 900GB. I would like to migrate the plesk panel and data to a new server on raid 1 hard drives(600GB). The mail server has OS Ubuntu 10.04 LTS and the new server that I set up is also on Ubuntu 10.04 LTS. Are there any commands that can help me achieve this?


Understanding a simple configuration file for initramfs

I am new to file system. Can somebody explain me what is happening in the following?               # This is a very simple, default initramfs              dir /dev 0755 0 0         nod /dev/console 0600 0 0 c 5 1         nod /dev/tty 0666 0 0 c 5 0         nod /dev/null 0600 0 0 c 1 3         nod /dev/mem 0600 0 0 c 1 1         nod /dev/kmem 0600 0 0 c 1 2         nod /dev/zero 0600 0 0 c 1 5         nod /dev/random 0600 0 0 c 1 8         nod /dev/urandom 0600 0 0 c 1 9              dir /dev/pts 0755 0 0         nod /dev/ptmx 0666 0 0 c 5 2              nod /dev/ttyS0 0666 0 0 c 4 64         nod /dev/ttyS1 0666 0 0 c 4 65         nod /dev/ttyS2 0666 0 0 c 4 66              dir /bin 755 0 0         dir /proc 755 0 0              file /bin/hello ${INSTALL_ROOT}/projects/${SAMPLE}/hello/hello 755 0 0         slink /bin/init hello 777 0 0      What are we trying to achieve here actually? This is similar to this one Generally it is clear to me that we are trying to run (hello ) from init (last line in code). But I need a little bit more explanation.


How to get the authentication status from the last PAM module run

If I have the following PAM stack:               auth required default_pam.so     auth requisite my_custom_pam.so     ....      How do you obtain the authentication status from the last/previous PAM module run for use in your own custom PAM authentication module (in for example the `pam_sm_authenticate` function)?


Multiple "-bash command not found" messages in Mac OS X Snow Leopard Unix

When I open terminal I get an automatic error message `-bash: PATH command not found.` then I am stumped in getting multiple `-bash "x" command not found.` messages, even to simple commands such as `ls` `cd` `mkdir` `rm`.   Just about the ONLY commands I get a response to are `echo` and `export`. Could my Unix system files be corrupt, as has been suggested in some searches for help? My hunch is that there is some setting that directs me away from the proper spot to make UNIX commands, but I don't know how to fix that.


Can a running script identify the logging context?

Let us say I redirect the `STDOUT`, `STDERR` of a program to files.               ./script.sh 1> output.log 2> error.log      Can the running program find this out i.e. know the paths to these files?


how can I set a login prompt as soon as possible in the boot sequence?

I want my login prompt to come as soon as few necessary drivers are loaded. So for example once SPI driver is loaded, I will put the login prompt application just below SPI driver , and the CPU will execute this login application. Ultimately I will be having a fully running login prompt on the console just after loading of SPI drivers is over. How can I set a login prompt as soon as possible in the boot sequence? How should I proceed?


Wine vs Virtualbox?

I have used Wine before. I recently heard of VirtualBox. Do they do the same thing? What are the differences and relative merits of these?


NAS box mounted via CIFS - problem with permissions

I'm running the latest version of Ubuntu, and have mounted a SMB share via a line in `rc.local`. The share mounts correctly, and I can browse files freely, create new files, and then delete them without problems. But when I try and rsync a directory onto the mounted share:               rsync -a --delete /MySource/ /SharedMountPoint/      I get lots of errors:               rsync: failed to set times on "/SharedMountPoint/SomeDir": Operation not permitted (1)      and similar errors about being unable to create temp files. All the files and directories on the share are listed with numeric uid/guid - which I suppose is reasonable, as they were originally created via a sync from a windows box. I have no great need for access control - its just a box on a LAN that me and my family use as a dropbox - I'd basically just like anyone to be able to access it (provided they've done basic authentication).


Documentation for vifm?

![enter image description here](http://i.stack.imgur.com/pJzPB.png) `vifm` looks like a good file manager, but it lacks documentation. Is there a manual or tips on how to use it? I'm looking for information on copying/moving a dir, creating a new empty file, editing a file, creating sym/hardlink, etc.


Multiple monitors as cloned desktop windows

I am running Fedora 16 using an Nvidia card with 2 monitors. I have the monitors setup as 2 separate displays (in that I can move a window from monitor to monitor). One monitor is mounted in a different area than the main monitor (for a display used in an experiment). The question is, can the 2nd monitor's display be shown as a small window (or in a 2nd workspace) in the main monitor so that we see what is being displayed without walking over to the 2nd monitor.


added new library, old one hanging around

In ubuntu 12.04, I downloaded the source for a geospatial library, gdal-1.11.0, into ~/src, configured it and compiled it successfully, it seemed. New files such as `libgdal.a` got put into /usr/local/lib. However when I run a program that depends on it,               $ ogrinfo --formats      I get               ERROR 1: ogrinfo was compiled against GDAL 1.11 but current library version is 1.10      It seems I haven't removed the older version of GDAL. How should I do that? Some info about my system:               $ uname -a     Linux ubuntu 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


Why doesn't `echo abc^H` just print `ab`?

As I recall, `^H` means `Backspace`. I generated it by pressing `CTRL+V`, `CTRL+H`. So the `^H` should remove the last character, as it is the same as `Backspace` and it should act just as if I pressed `Backspace` at this position. Why the does the output of `echo abc^H` remain `abc` and not `ab`?


When is using ~+ useful?

As I understand it, `~+` means the same thing as "the current working directory". So `echo ~+` should print the same as `pwd`. What is the purpose of this tilde expansion `~+` ?


Recover many files using ntfsundelete

I am using the following command to scan for deleted files: `sudo ntfsundelete /dev/sda1 -S 400m-20g -p 100` How can I restore the all of the results? I have tried:               sudo ntfsundelete /dev/sda1 -u 400m-20g -p 100 -d /mnt/bigboy/ntfs      returns `You must specify exactly one device.` and also:               sudo ntfsundelete /dev/sda1 -u -i 44-6057 -p 100 -d /mnt/bigboy/ntfs      which seems to only recover the first file, and then outputs:               Couldn't create output file: File exists      I believe the latter is caused by the fact that for some reason I have lost all of the file nanes. (The drive was shut down immediately, so not sure how.) Any help would be most appreciated.


How to check if my wireless connection uses AES or TKIP from a terminal?

I have a wireless router that has settings to use AES, TKIP or AES+TKIP encryption for wireless connections. My Linux-based device does not like AES (it drops out from time to time), my girlfriend's MacBook Pro does not like TKIP (refuses to connect at all), so it seems I'm stuck with the AES+TKIP setting. Is there any command I can use to check that my Linux device is using TKIP?   Or even better, one to force it to use TKIP?


No such file or directory error when using xargs

I have some files with `.mkv` extension and I want to calculate their total size using `du -h`. Some of the files are preceded by `whitespace` characters.               ranveer@ranveer:~$ ls *.mkv     Arrow.S01E02.720p.HDTV.X264-DIMENSION_(1)  [SHYAMPAREEK.IN].mkv     mymediafirefreefreak.com_The.Mentalist.S05E04.480p.HDTV.X264-mRS.mkv     SHYAMPAREEK.IN-The.Vampire.Diaries.S04E02.720p.HDTV.X264-DIMENSION_(1).mkv     Supernatural.S08E03.720p.HDTV.X264-DIMENSION_(1)SHYAMPAREEK.IN].mkv       [WWW.SHYAMPAREEK.IN].Arrow S01E01 480p HDTV.mkv      [WWW.SHYAMPAREEK.IN].Castle.2009.S05E03.480p.HDTV.x264-mSD.mkv     ranveer@ranveer:~$       Now, I am using `xargs` to apply `du -h` to each of the files but for the files which are preceded by `whitespace` characters I am getting `No such file or directory` error.               ranveer@ranveer:~$ ls *.mkv | xargs -I f du -h "f" | awk '{print $1}'     du: cannot access `[WWW.SHYAMPAREEK.IN].Arrow S01E01 480p HDTV.mkv': No such file or directory     du: cannot access `[WWW.SHYAMPAREEK.IN].Castle.2009.S05E03.480p.HDTV.x264-mSD.mkv': No such file or directory     186M     151M     185M     186M     ranveer@ranveer:~$       But when I apply `du -h` to those files individually it works fine.               ranveer@ranveer:~$ du -h "  [WWW.SHYAMPAREEK.IN].Arrow S01E01 480p HDTV.mkv"     151M      [WWW.SHYAMPAREEK.IN].Arrow S01E01 480p HDTV.mkv     ranveer@ranveer:~$       So, why am I getting error when using the combination of `xargs & du -h`.


Chrooted SFTP with full access to SSH stopped working (Debian)

I've got a home server on Debian 6 for backups. I'd like to setup chrooted SFTP environment with SSH access for some users (only for my knowledge, there are two users now). It almost works or rather worked until yesterday. In `/etc/ssh/sshd_config` I set up a special chrooted group:               Subsystem sftp internal-sftp     [...]     Match Group sftp-chroot     ChrootDirectory %h     X11Forwarding no     AllowTcpForwarding no     ForceCommand internal-sftp      I've created this group and added my account to it. Next I've changed `chmod` and `chown` like in this tutorial (or others very similar). It has worked two days. Yesterday evening I couldn't login into my server - nothing have been changed since last time. Console just returned:               This service allows sftp connections only.     Connection to xxx.xxx.xxx.xxx closed.      It's clear but how has it worked before? Removing user from `sftp-chroot` group solves this problem but of course causes no chroot on SFTP. I'm connecting that way: `ssh my_login@xxx.xxx.xxx.xxx` I'm in groups:               my_login cdrom floppy sudo audio dip video plugdev sftp-chroot      The last entries from `/var/log/auth.log` are:               Jun  4 13:59:54 debian sshd[1132]: Server listening on 0.0.0.0 port 22.     Jun  4 13:59:54 debian sshd[1132]: Server listening on :: port 22.     Jun  4 14:02:50 debian sshd[1185]: Accepted password for my_login from 10.0.0.10 port 57431 ssh2     Jun  4 14:02:50 debian sshd[1185]: pam_unix(sshd:session): session opened for user my_login by (uid=0)     Jun  4 14:02:50 debian sshd[1188]: Received disconnect from 10.0.0.10: 11: disconnected by user     Jun  4 14:02:50 debian sshd[1185]: pam_unix(sshd:session): session closed for user my_login      There's also installed `vsftpd` and `rssh` on the server. I've red a lot of tutorials and documentation, tried different directories permission and owners. Nothing helped. I saw in comments that some people also had this problem but any tip how to work out it. Maybe someone could help or encountered the same issue? Thanks in advance. If something isn't clear I will try describe it better. I'm not native English speaker ;)


How can I rewrite the From: address of an email and resend it?

I have a cPanel web hosting account. On this account I have a PHP-based support/trouble ticket system for my customers to use. I'd like to be able to send an email to both my customer and to the ticket system, but have the email that goes to the ticketing system appear to come _from_ my customer, so that the support ticket which gets created appears under their account. So what I want to do is create some email address `billing- redirect@mydomain.com` which gets piped to a unix command or shell script. This means that when I send an email from `billing@mydomain.com` to `some_customer@example.com` and CC `billing-redirect@mydomain.com`, the shell script should be able to _resend_ the email to `support@mydomain.com` **but resend the email from the To: address of the email**. Is there any way to make a shell script which will accept an email on stdin, rewrite the From: address, and resend the mail to a new address? Can Procmail do anything like that? Or will I have to hand code this myself?


sendmail not sending to the cloud (local mail works)

I'm using a perl module (Mail::Sendmail) which uses `sendmail` to send stuff. It hasn't been working, but hasn't been giving me any errors. So now I suspect `sendmail`. I tried:               telnet 127.0.0.1 25     mail from:root@localhost.com     rcpt to:max@f33r.com     data      subject: subject line      sgiopjsdoigjsd      sdgsdg           sdgfsdg      .     quit      I get the "mail accepted for delivery" message, which is what should happen. I wait around for a couple minutes and nothing in my inbox. So I take a look at `/var/log/maillog.3` and it doesn't have anything pertaining to what I just did. I tried sending mail locally to another user by doing `mail user@localhost.localdomain` and that worked. But still nothing in the logs (which makes me believe the real logs are somewhere else). **Summing up:**   * Can't send mail to the cloud, but it works locally   * Unknown location of sendmail log file


Using debuild to build shared libraries .deb

I'm trying to package a shared library using debuild to build the .deb file. In runnign dh_make the library option was selected. Have been following this guide Having managed to build the library, i'm getting the foillowing error:                 dh_install     dh_install: mylibrary-dev missing files (usr/lib/lib*.a), aborting     make: *** [binary] Error 255     dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2     debuild: fatal error at line 1337:     dpkg-buildpackage -rfakeroot -D -us -uc failed      I looked inside the directory listed in the error, e.g. ~/mylibrary-1.0/debian/mylibrary-dev/usr/lib/ and it empty. The shared libraries are actually in: ~/mylibrary-1.0/debian/tmp/usr/lib/ However there are no *.a libs in there. The mylibrary-dev.install file list the following:               usr/include/*     usr/lib/lib*.a     usr/lib/lib*.so     usr/lib/pkgconfig/*     usr/lib/*.la     usr/share/pkgconfig/*      For some reason an extra package is listed in the control file.               Source: mylibrary     Priority: extra     Maintainer: satpal <satpal@unknown>     Build-Depends: debhelper (>= 7.0.50~), autotools-dev     Standards-Version: 3.8.4     Section: libs     Homepage: <insert the upstream URL, if relevant>          Package: mylibrary-dev     Section: libdevel     Architecture: any     Depends: mylibrary1 (= ${binary:Version})     Description: <insert up to 60 chars description>      <insert long description, indented with spaces>          Package: mylibrary1     Section: libs     Architecture: any     Depends: ${shlibs:Depends}, ${misc:Depends}     Description: <insert up to 60 chars description>      <insert long description, indented with spaces>      Following the helloworld example used in the guide, it only comes up with Source and a single package Sorry for long post, just wanted ensure there was enough info. Thanks EDIT (@Gilles) my rules file is:               #!/usr/bin/make -f     # -*- makefile -*-     # Sample debian/rules that uses debhelper.     # This file was originally written by Joey Hess and Craig Small.     # As a special exception, when this file is copied by dh-make into a     # dh-make output file, you may use that output file without restriction.     # This special exception was added by Craig Small in version 0.37 of dh-make.          # Uncomment this to turn on verbose mode.     #export DH_VERBOSE=1          %:         dh $@      I don't know howto attached an archive, or if i have enough rep to attached one.


How to clear DNS cache on DD-WRT

How can I clear the DNS cache in DD-WRT on my router? DD-WRT uses the dnsmasq daemon.


Fluxbox borderWith on focused Maximized windows

Using fluxbox for a few days now trying to get things setup as I want them. I added window.focus.borderWidth: 2 (and .borderColor: white) to my .fluxbox/overlay so I can easily determine what window is focused without looking down to the toolbar. This works perfect.. except for: If a window is maximized such as Firefox then no focus border appears, so for maximized windows I cant use the same visuals to determine if they are focused. Why the obsession: I use deco: border (i dont need window title) on a multi-head setup so I like to know whats in focus. In a nutshell, I want large border for focused maximized windows in Fluxbox, how?


How to improve this backup script?

I wrote this backup script. I run `rsync`, `tar` and a dump of mysql. I'd like to add some features like email alert or some kind of statistic. Here is the script:               #!/bin/sh          DATE=`date +%D-%T`     ORIGIN=/home/share/     DEST=/media/BACKUP/mercurio/     LOGFILE=log.txt     echo "=====Starting backup on $DATE =====" >> $LOGFILE     echo "==Start rsync" >> $LOGFILE      rsync -arHu --delete --stats $ORIGIN $DEST/share >> $LOGFILE     wait     if [ $? -eq 0 ]     then             echo "==rsync ok"  >> $LOGFILE     else             echo "==rsync ko"   >> $LOGFILE     fi          echo "==Sart TAR" >> $LOGFILE     tar -czf $DEST`date +%y%m%d-%T`.tar.gz $ORIGIN     wait     if [ $? -eq 0 ]     then             echo "==tar ok" >> $LOGFILE     else             echo "==tar ko" >> $LOGFILE     fi     echo "==Start DUMP" >> $LOGFILE     mysqldump -u root -ptoor --all-databases > ${DEST}databases/`date +%Y%m%d-%k:%M`.sql     wait     if [$? -eq 0 ]     then             echo "==dump ok" >> $LOGFILE     else              echo "==dump ko" >> $LOGFILE     fi     echo "=====End Bakcup=====" >> $LOGFILE


Is there a tool to visualize a filesystem allocation map on Linux?

May you have ever used filesystem defragmentation tools (like Norton SpeedDisk or Piriform Defraggler) on Windows, you have probably seen such a diagram: ![Defraggler ](http://i.stack.imgur.com/2RlKW.png) It displays a filesystem sectors map, painting (as for this particular example) sectors (sets of sectors actually, to fit the whole partition in the screen) occupied by non-fragmented (contiguous) files in blue, the opposite in red and free sectors in white (and some more colours for some more particular cases which can happen to be of interest). You can click on a "sector" and see what particular files "live" there. Is there such a visualization tool for Linux? UPDATE: I've accepted sr_'s answer as it seems perfectly the answer to the question but I would be really happy to see a better option :-)


Distro for a startup?

We run a small start-up in the `SaaS` industry. About half of our current staff are developers using their own laptops with various Linux distros (Ubuntu, Debian, Fedora) with a few exceptions of Windows XP. The other half of our staff performs administrative tasks using only OpenOffice, Thunderbird & Firefox and have very little interest in what OS that is used as long as it works. As we're going to invest in workstations for our staff very soon, we need to choose a Linux distribution that will become the default in the company. Stability will be the primary focus and after what I've read, either `Debian` or `centOS` seems to be the appropriate choice - after ruling `RHEL` out for economical reasons. **From an unbiased business perspective soberly looking at pros and cons and putting preferences aside, what should be our concerns?**   * Is there anything that either `centOS` or `debian` can offer us that the other distro won't?   * What about `SElinux` and similar security systems?


iptables/pf rule to only allow XY application/user?

I think there is no iptables/pf solution to only allow an XY application on e.g.: outbound tcp port 80, eth0. So if I have a userid: "500" then how could I block any other communications then the mentioned on port 80/outbound/tcp/eth0? (e.g.: just privoxy is using port 80 on eth0)      Extra: virtualbox uses port 80 too? when a browser on the guest os visits a site..how to declaire that? - setting the normal user would be too much hole


Postfix: Can I configure it to *not* include original email on undeliverable?

The question's title says it all. Scenario: The Postfix server is used _only_ for mail-relay; in the office back-end, we use hMailServer. Some hMailServer users have their emails auto- forwarded to their BlackBerry account. Sometimes, they changed their BlackBerry operator without informing IT Dept. As a result, the auto-forward (handled by Postfix) failed, and a notification is sent (by Postfix) back to the user's account, which gets re-forwarded to the (no longer active) BlackBerry account, another failure, and ... well, you get the idea: A mailing loop. I need to prevent this from happening. For complex reasons, we can't change our current setup of a separate internal mail server and the cloud-based Postfix mail-relay. So, I must either reconfigure Postfix or use some other mail-relay system that can be configured as such. Thanks in advance.


configure.ac: not using gettext

I am trying to compile a gnome application and I am curious what the output means when I run the `autogen.sh` script:               ~/Documents/Code/window-picker-applet $./autogen.sh     autoreconf: Entering directory `.'     autoreconf: configure.ac: not using Gettext     autoreconf: running: aclocal      autoreconf: configure.ac: tracing     autoreconf: running: libtoolize --install --copy     libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.     autoreconf: running: /usr/bin/autoconf     autoreconf: running: /usr/bin/autoheader     autoreconf: running: automake --add-missing --copy --no-force     data/Makefile.am:11: `%'-style pattern rules are a GNU make extension     data/Makefile.am:11: wildcard $(top_srcdir: non-POSIX variable name     data/Makefile.am:11: (probably a GNU make extension)     autoreconf: Leaving directory `.'     [Output trunkated...]      Why am I getting the info `configure.ac: not using Gettext`? Is that a warning and should I change some of the configuration files to fix it? I know the application has a `po/` folder so I think it should be using Gettext, hence I am confused about this warning. ~~I also had a lot of warnings with the`N_` macro not being defined, so this might be related?~~ **[Update]** See comment below **[/Update]**


Detailed sparse file information on Linux

I have a sparse file, in which only some blocks are allocated:               ~% du -h --apparent-size example     100K    example     ~% du -h example     52K     example      I would like to know which blocks of the file are actually allocated. Is there a system call or kernel interface that could be used to get a list of either the allocations, or the holes of file? Simply checking for a long enough string of zeros (the approach used by GNU cp, rsync, etc) does not work correctly:               ~% cp example example1       ~% du -h example1      32K     example1      It detected other sequences of zeros that were actually allocated.


grep: count total number of occurrences

`grep -c` is useful for finding how many times a string occurs in a file, but it only counts each occurence once per line. How to count multiple occurences per line? I'm looking for something more elegant than:               perl -e '$_ = <>; print scalar ( () = m/needle/g ), "\n"'


How do I read the output of commands in a script

I'm learning Linux scripting at the moment, and one thing I can get working is assigning a command output to a variable. The command `service httpd configtest` returns `Syntax is OK`, so I wrote this.               #!/bin/bash          var=`service httpd configtest`     echo "Output is $var"      From what I've read that should store the output in `var`, then echo it. However, the output when I run that script is               Syntax OK     Output is      What have I done wrong? I'm using CentOS 6.5 if that makes a difference.


run lsof in non-interactive mode

I need to write `lsof` output for several network ports into bash variable. Simple `$(lsof -i :5555)` doesn't work - lsof waits for quit command (Ctrl-C) every time I call it. I can't figure out how to solve my task. Please, help


Which is the most portable of sed, awk, perl and sh?

Can someone put these tools in order of portability? Which of these is _certain_ to be found on even the most minimal *nix systems? Is any of them 100% sure to be present? My guess is that the order is the following:   1. awk   2. sed   3. sh   4. perl While I imagine there are systems which don't default to a bourne shell, _some_ shell will be present as the default, will that always be at `/bin/sh`? Presumably not if it's not a bourne-type shell. Both `awk` and `sed` have pages explaining them on the POSIX specification so presumably they will always be present. Is that so? Can I be _sure_ that both will be installed on any *nix? Including embedded systems?


Send data from file to rsyslog local0 facility

Is any possibility for `logger` to permanently get data from file - and send it to `local0` facility? Why - I want to collect all data in database. For this - I'm use `rsyslog- mysql`. In it - I have configured "channel" for `local0` like:               $ModLoad ommysql     local0.* :ommysql:[...]      And - I have few log-files (Tomcat, our application, some "hand-made" log- files from backup scripts etc). And I want to send data from them in to database - but without editing systems/scripts which this log-files fill (uses). One way I see - run in background (and add to `/etc/rc.local` too) something like:               # tail -f /some/log.file | logger -p local0.*      I found `logger -f` option - but it seems runs only once and get full info from file and send it in to "channel" (facility). P.S. CentOS 6.4


Why does find -exec du sum up differently?

I have family pictures and movies in a folder /media/data/Selbstgemacht and I'd like to find the size of all pictures. In /media/data I use `find Selbstgemacht -type f -iname '*.jpg' -exec du -ch '{}' +` which returns 5,1GB.   However, if I step down into the folder "Selbstgemacht" and use `find . -type f -iname '*.jpg' -exec du -ch '{}' +` it returns 7,0GB. I then compared the output of find to check if they find the same files:   From parent folder `find Selbstgemacht -type f -iname '*.jpg' -printf '%P\n' |sort > test1.txt`   From subfolder `find . -type f -iname '*.jpg' -printf '%P\n' |sort > ../test2.txt` The files are identical, so both find commands find exactly the same files, which leads me to thinking that the difference in the size du reports must be due to something else. What exactly is the cause here? System information:   * Debian stable    * find (GNU findutils) 4.4.2      * D_TYPE O_NOFOLLOW(enabled)     * LEAF_OPTIMISATION, FTS(), CBO(level=0)    * du (GNU coreutils) 8.13


cannot boot Debian Jessie installed via debootstrap

I've just installed a Debian Jessie via debootsrap for testing/learning purpouse, this is its entry in the GRUB menu:               menuentry "Debian GNU/Linux (jessie/sid) (on /dev/mapper/nostromo-DEBIAN)" --class gnu-linux --class gnu --class os {        insmod lvm        insmod part_msdos        insmod ext2        set root='(nostromo-DEBIAN)'        search --no-floppy --fs-uuid --set=root f8ae3cc5-384a-484e-a701-76754242baf3        linux /boot/vmlinuz-3.14-2-rt-amd64 root=/dev/dm-2        initrd /boot/initrd.img-3.14-2-rt-amd64     }      As you can see I use lvm2. Unfortunately, the boot process fails because it cannot find the /dev/dm-2 partition. In facts running `ls /dev/` from busybox console the dm-* devices are all missing, but if I launch another system and I access the new installation via chroot, dm-* devices are present. How can I fix this issue? Thanks in advance.


How to properly configure sudoers file, on debian wheezy?

I have seen many blog posts that say, it is enough to do               aptitude install sudo     su root     adduser USERNAME sudo      But that only protects `aptitude`, in other words:   * `aptitude install sendmail` will ask for password, you need to be `sudo` to run `aptitude`   * `apt-get install sendmail` won't ask for password, no `sudo` privileges needed   * If you edit protected files, like files in `etc` it won't ask for password, no `sudo` privileges needed   * You can run and stop services like `apache`, it won't ask for password, no `sudo` privileges needed How to fix this? This is my sudoers file:                This file MUST be edited with the 'visudo' command as root.     #     # Please consider adding local content in /etc/sudoers.d/ instead of     # directly modifying this file.     #     # See the man page for details on how to write a sudoers file.     #     Defaults        env_reset     Defaults        mail_badpass     Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:$          # Host alias specification          # User alias specification          # Cmnd alias specification      This is the output of `sudo -l`:               Matching Defaults entries for root on this host:         env_reset, mail_badpass,         secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin          User root may run the following commands on this host:         (ALL : ALL) ALL         (ALL : ALL) ALL


Grouped sorting of continuous paragraphs (separated by blank line)?

I think I'm pretty experienced now in sorting by _columns_ ; however, I haven't found anything so far how to sort _continuous rows_. Supposing we have a text file that looks like this: (very simplified, of course)               Echo     Alpha     Delta     Charlie          Golf     Bravo     Hotel     Foxtrot      Now, is it possible to sort the lines alphanumerically _per each block separately_? I mean, so that the result looks like this:               Alpha     Charlie     Delta     Echo          Bravo     Foxtrot     Golf     Hotel      Telling from what I found in the `sort` man page, this might not be possible with the built-in UNIX `sort`command. Or can it even be done without having to resort to external/third-party tools?


TERM=(linux|xterm) vi in an xterm or the AAABBBBBBCCDDD-problem

Usually when I want to run `vim` in a desktop `konsole` session, I make sure the TERM variable is set to `linux` as the arrow keys don't work in insert mode with `TERM=xterm`. They show capital A..D instead of moving the cursor. Now I think this is the wrong way of doing thingsas `konsole` or `xterm` is actually of type `xterm`. Is there a better way for making arrow keys work under `vi` / `vim`? OS: Kubuntu 13.04 (Clean install)


How to implement retry mechanism while executing the server url in the shell script?

I am working on a project in which I need to make a url call to one of my server from the bash shell script..               http://hostname.domain.com:8080/beat      After hitting the above url, I will be getting the below response which I need to parse it and extract value of `syncs` and `syncs_behind`               state: READY process: 30 process_behind: 100 num_rounds: 60 hour_col: 2 day_col: 0 oldest_day_col: 0      Now I need to hit the above url every 10 seconds for a period of 10 minutes and extract the value of `process` and `process_behind` from it and then use it to validate it with below conditions -               process > 8     process_behind = 0      if the syncs is greater than 8 and process_behind = 0, then I will end my shell script with some message saying - "Data has been validated", otherwise I would keep on trying for 10 minute window.. If in that 10 minute window, the above condition doesn't met I will end the shell script anyway meaning I won't retry again. Below is my shell script which does the above thing and it works fine in normal condition when the server is up.               #!/bin/bash          COUNT=60   #number of 10 second timeouts in 10 minutes          while [[ $COUNT -ge "0" ]]; do          #send the request, put response in variable     DATA=$(wget -O - -q -t 1 http://hostname.domain.com:8080/beat)          #grep $DATA for process and process_behind     PROCESS=$(echo $DATA | grep -oE 'process: [0-9]+' | awk '{print $2}')     PROCESS_BEHIND=$(echo $DATA | grep -oE 'process_behind: [0-9]+' | awk '{print $2}')          echo $PROCESS     echo $PROCESS_BEHIND          #verify conditionals     if [[ $PROCESS -gt "8" && $PROCESS_BEHIND -eq "0" ]]; then exit 0; fi          #decrement the counter     let COUNT-=1          #wait another 10 seconds     sleep 10          done      There might be a scenario in which it gets failed suppose if the server is down, then `wget` line throws an exception. Now what I am trying to do is, if the server is down, then I will sleep for 30 seconds and then retry executing the server url again and if it failed again, then sleep again for 30 seconds and then retry executing the server url again. I will retry executing the server url for n times, let's say n is 10. And after that still the server is not up I will exit out of the shell script with non zero status and a message server is down. But if the server is up and I am able to get the response back, I will move forward to extract those fields which I have in my later shell script. Is this possible to implement retry mechanism in bash shell script? Or is there any better way of doing this apart from wget? **UPDATE 1:-** This is what I have got -               #!/bin/bash          COUNT=60   #number of 10 second timeouts in 10 minutes     DATA=""     RETRY=10          while [[ $COUNT -ge "0" ]]; do          while [ $RETRY -gt 0 ]     do         #send the request, put response in variable         DATA=$(wget -O - -q -t 1 http://machineA:8080/beat)         echo "Hello"         if [ $? -eq 0 ]         then             break         else             let RETRY-=1             sleep 30         fi     done          if [ $RETRY -eq 0 ]     then         exit 2     fi          #grep $DATA for process and process_behind     PROCESS=$(echo $DATA | grep -oE 'process: [0-9]+' | awk '{print $2}')     PROCESS_BEHIND=$(echo $DATA | grep -oE 'process_behind: [0-9]+' | awk '{print $2}')          echo $PROCESS     echo $PROCESS_BEHIND          #verify conditionals     if [[ $PROCESS -gt "8" && $PROCESS_BEHIND -eq "0" ]]; then exit 0; fi          #decrement the counter     let COUNT-=1          #wait another 10 seconds     sleep 10          done      If my server is down and I am running the above shell script, then it is printing "Hello" to the console and it works fine. But see my below update - **Update 2:-** Ok, Now I have found the issue, if I am running the shell script like this which I will be running in my production system and if the server is down, then it doesn't prints out "Hello" at all. But if I run the above shell script in Update 1 and if the server is down, then it works fine.               #!/bin/bash          COUNT=60   #number of 10 second timeouts in 10 minutes     HOSTNAME=machineA     DATA=""     RETRY=10          while [[ $COUNT -ge "0" ]]; do          while [ $RETRY -gt 0 ]     do         #send the request, put response in variable         DATA=$(wget -O - -q -t 1 http://$HOSTNAME:8080/beat)         echo "Hello"         if [ $? -eq 0 ]         then             break         else             let RETRY-=1             sleep 30         fi     done          if [ $RETRY -eq 0 ]     then         exit 2     fi          #grep $DATA for process and process_behind     PROCESS=$(echo $DATA | grep -oE 'process: [0-9]+' | awk '{print $2}')     PROCESS_BEHIND=$(echo $DATA | grep -oE 'process_behind: [0-9]+' | awk '{print $2}')          echo $PROCESS     echo $PROCESS_BEHIND          #verify conditionals     if [[ $PROCESS -gt "8" && $PROCESS_BEHIND -eq "0" ]]; then exit 0; fi          #decrement the counter     let COUNT-=1          #wait another 10 seconds     sleep 10          done      This is what I am getting in the debug mode with the above script -               david@some-machine:~$ bash -x ./ping1.sh     + set -e     + COUNT=60     + HOSTNAME=machineA     + DATA=     + RETRY=10     + echo machineA     machineA     + [[ 60 -ge 0 ]]     + '[' 10 -gt 0 ']'     ++ wget -O - -q -t 1 http://machineA:8080/beat     + DATA=      I guess both of the scripts are same? Then why this is happening?


How can I use grep to search multiple unnested directories?

It may sound like I'm asking the same thing as this question, but I have different requirements. This is an example of my filesystem:   * /code/      * internal/        * dev/       * main/     * public/        * dev/       * main/       * release/     * tools/ /code/internal/dev/, /code/public/dev/ and /code/tools/ contain subdirectories for multiple projects. I work almost exclusively in the dev branches of /code/internal/ and /code/public/, and often I want to search for a text string in those directories along with /code/tools/ (which has no branches). In these instances I have to do three separate commands:               $ grep -r "some string" /code/internal/dev/     $ grep -r "some string" /code/public/dev/     $ grep -r "some string" /code/tools/      I'd like to know if there's a single command to do this. If not, I would most likely need to write a simple bash script.


remove files after insertion into tarball

I want to limit the number of files that get put into a tar ball and erease them after they've been inserted into the tarball and being indipendent from the current directory. I've tried this: `tar -C ~/semios/tmp/ -cjvf ~/semios/tmp/test.tar.bz2 $(cd ~/semios/tmp/; ls *| head -5) | xargs rm -f` but this leaves the files where they are as the verbose option of `tar` only prints the file name, not the whole path, I thought I could fix it with the `-C` argument but it doesn't look like it... any hints?


Saving iptables on CentOS, and merging the previous rules with the newly saved ones?

I added some new rules using `iptables` command, then saved them using `/sbin/service iptables save` as described here:   * http://www.centos.org/docs/4/html/rhel-rg-en-4/s1-iptables-saving.html After that in the `/etc/sysconfig/iptables` file presents my new rules only. And all old rules are in the `/etc/sysconfig/iptables.save` file now. As I understand, when the system restarts, the new rules will be applied but the old rules will not. How can I apply them both - new and old rules?


Why does ldd show this dynamic linker location?

Here's the link command. Notice the specially defined dynamic linker near the beginning. ` time gcc **-Wl,-rpath,/data/data/org.freesoft.Macaulay2/files/lib -Wl,-rpath,/data/data/org.freesoft.Macaulay2/files/lib/Macaulay2/armv7l-Linux- Ubuntu-12.04/lib** -L/root/M2/M2/libraries/final/lib **_-Wl,--dynamic- linker=/data/data/org.freesoft.Macaulay2/files/lib/ld-linux.so.3_** -L/usr/lib/gcc/arm-linux-gnueabi/4.6 -L/usr/lib/gcc/arm-linux- gnueabi/4.6/../../../arm-linux-gnueabi -L/usr/lib/gcc/arm-linux- gnueabi/4.6/../../../../lib -L/lib/arm-linux-gnueabi -L/lib/../lib -L/usr/lib/arm-linux-gnueabi -L/usr/lib/../lib -L/usr/lib/gcc/arm-linux- gnueabi/4.6/../../.. timestamp.o ../d/M2inits.o ../d/startup.o ../d/../regex/regex.o ../d/gmp_init.o ../d/gmp_aux.o ../d/main.o ../d/pari-c.o ../d/M2-factory.o ../d/M2types.o ../d/scclib.o ../d/M2lib.o ../d/M2mem.o ../d/gdbm_interface.o ../d/xml-c.o ../d/arithmetic.o ../d/atomic.o ../d/M2.o ../d/system.o ../d/strings.o ../d/varstrin.o ../d/strings1.o ../d/errio.o ../d/vararray.o ../d/ctype.o ../d/nets.o ../d/varnets.o ../d/interrupts.o ../d/pthread0.o ../d/stdiop0.o ../d/gmp.o ../d/engine.o ../d/xml.o ../d/stdio0.o ../d/parse.o ../d/expr.o ../d/stdio.o ../d/stdiop.o ../d/err.o ../d/gmp1.o ../d/tokens.o ../d/getline.o ../d/lex.o ../d/parser.o ../d/binding.o ../d/basic.o ../d/convertr.o ../d/common.o ../d/util.o ../d/struct.o ../d/classes.o ../d/buckets.o ../d/equality.o ../d/hashtables.o ../d/sets.o ../d/version.o ../d/evaluate.o ../d/mysqldummy.o ../d/pthread.o ../d/actors.o ../d/actors2.o ../d/actors3.o ../d/actors4.o ../d/xmlactors.o ../d/actors5.o ../d/threads.o ../d/pari.o ../d/interface.o ../d/interface2.o ../d/texmacs.o ../d/interp.o ../e/error.o ../e/table.o ../e/exptable.o ../e/monordering.o ../e/complex.o ../e/rand.o ../e/matrix-stream.o ../e/cra.o ../e/aring-zz-flint.o ../e/aring-RRR.o ../e/aring-tower.o ../e/aring-m2-gf.o ../e/aring-promoter.o ../e/aring-glue.o ../e/aring-zzp.o ../e/aring-gf.o ../e/aring-ffpack.o ../e/aring.o ../e/schurSn.o ../e/schur2.o ../e/spair- heap.o ../e/dpoly.o ../e/tower.o ../e/interreduce.o ../e/gb-test1.o ../e/finalize.o ../e/NAG.o ../e/overflow.o ../e/memory-status.o ../e/exceptions.o ../e/imonorder.o ../e/sagbi.o ../e/monideal-minprimes.o ../e/dmat-LU.o ../e/lapack.o ../e/LLL.o ../e/fractionfreeLU.o ../e/ntl- interface.o ../e/fplll-interface.o ../e/mat.o ../e/dmat.o ../e/smat.o ../e/coeffrings.o ../e/Eschreyer.o ../e/gbweight.o ../e/qring.o ../e/polyquotient.o ../e/poly.o ../e/debug.o ../e/comp.o ../e/comp-gb.o ../e/comp-gb-proxy.o ../e/comp-gb-declared.o ../e/comp-res.o ../e/res-a0.o ../e/res-a0-poly.o ../e/res-a1.o ../e/res-a1-poly.o ../e/res-a2.o ../e/reducedgb.o ../e/reducedgb-field.o ../e/reducedgb-marked.o ../e/reducedgb-field-local.o ../e/reducedgb-ZZ.o ../e/montable.o ../e/montableZZ.o ../e/schorder.o ../e/GF.o ../e/ZZ.o ../e/QQ.o ../e/RRR.o ../e/CCC.o ../e/assprime.o ../e/buffer.o ../e/comb.o ../e/det.o ../e/frac.o ../e/franzi-brp.o ../e/freemod.o ../e/gb-default.o ../e/gb-homog2.o ../e/gb- sugarless.o ../e/gb-toric.o ../e/gb-walk.o ../e/gbring.o ../e/gauss.o ../e/hermite.o ../e/hilb.o ../e/int-bag.o ../e/intarray.o ../e/matrix.o ../e/matrix-con.o ../e/mem.o ../e/monideal.o ../e/monoid.o ../e/monomial.o ../e/ntuple.o ../e/polyring.o ../e/pfaff.o ../e/relem.o ../e/ring.o ../e/ringmap.o ../e/schur.o ../e/skew.o ../e/skewpoly.o ../e/solvable.o ../e/spair.o ../e/text-io.o ../e/varpower.o ../e/weylalg.o ../e/ZZp.o ../e/interrupted.o ../e/newdelete.o ../e/ntl-internal.o ../e/ntl-debugio.o ../e/matrix-kbasis.o ../e/matrix-symm.o ../e/matrix-sort.o ../e/ring-vecs.o ../e/res-a2-gb.o ../e/engine.o ../e/x-aring.o ../e/x-monom.o ../e/x-monoid.o ../e/x-relem.o ../e/x-free.o ../e/x-mat.o ../e/x-gb.o ../e/x-ringmap.o ../e/x-mutablemat.o ../e/franzi-gb.o ../e/franzi-interface.o ../e/x-monideal.o ../e/x-factor.o ../e/f4/f4.o ../e/f4/f4-syz.o ../e/f4/f4-mem.o ../e/f4/f4-monlookup.o ../e/f4/f4-types.o ../e/f4/f4-computation.o ../e/f4/f4-spairs.o ../e/f4/f4-m2-interface.o ../e/f4/hilb-fcn.o ../e/f4/monhashtable.o ../e/f4/monsort.o ../e/f4/moninfo.o ../e/f4/ntuple- monomial.o ../e/f4/varpower-monomial.o ../e/f4/gausser.o ../system/m2file.o ../system/supervisor.o ../system/tests.o ../kernel/bibasis/bibasis.o ../kernel/bibasis/allocator.o ../kernel/bibasis/launcher.o ../kernel/bibasis/monom.o ../kernel/bibasis/monomDL.o ../kernel/bibasis/monomDRL.o ../kernel/bibasis/monomLex.o ../kernel/bibasis/settings-manager.o -L../d -lM2inits2 -lfac -lcf -lfac -lcfmem -lgc -lpthread -lmpfr -lfrobby -lpari -lmpirxx -lmpir -Wl,-Bstatic -Wl,-Bdynamic -lxml2 -lz -lm -llapack -lblas -lntl -lgdbm -lgc -lreadline -lpthread -ldl -lrt -lstdc++ -lncurses -Wl,-Bstatic -lgfortran -Wl,-Bdynamic -ldl -lrt -lm -lxml2 -lm -lc **-o "/root/M2/M2/StagingArea/armv7l-Linux- Ubuntu-12.04/bin/M2".tmp** ` Here's what ldd has to say about the resulting executable:               ldd /root/M2/M2/StagingArea/armv7l-Linux-Ubuntu-12.04/bin/M2.tmp         libpthread.so.0 => /data/data/org.freesoft.Macaulay2/files/lib/libpthread.so.0 (0x401b2000)         libxml2.so.2 => /data/data/org.freesoft.Macaulay2/files/lib/libxml2.so.2 (0x401cd000)         libm.so.6 => /data/data/org.freesoft.Macaulay2/files/lib/libm.so.6 (0x40023000)         liblapack.so.3gf => /data/data/org.freesoft.Macaulay2/files/lib/liblapack.so.3gf (0x4029b000)         libntl-5.4.2.so => /data/data/org.freesoft.Macaulay2/files/lib/libntl-5.4.2.so (0x40925000)         libgdbm.so.3 => /data/data/org.freesoft.Macaulay2/files/lib/libgdbm.so.3 (0x4009c000)         libreadline.so.6 => /data/data/org.freesoft.Macaulay2/files/lib/libreadline.so.6 (0x400f0000)         libdl.so.2 => /data/data/org.freesoft.Macaulay2/files/lib/libdl.so.2 (0x4008f000)         librt.so.1 => /data/data/org.freesoft.Macaulay2/files/lib/librt.so.1 (0x400ca000)         libstdc++.so.6 => /data/data/org.freesoft.Macaulay2/files/lib/libstdc++.so.6 (0x40a3f000)         libc.so.6 => /data/data/org.freesoft.Macaulay2/files/lib/libc.so.6 (0x40ae6000)         /data/data/org.freesoft.Macaulay2/files/lib/ld-linux.so.3 => **/lib/ld-linux.so.3** (0x400aa000)         libgcc_s.so.1 => /data/data/org.freesoft.Macaulay2/files/lib/libgcc_s.so.1 (0x400d8000)         libz.so.1 => /data/data/org.freesoft.Macaulay2/files/lib/libz.so.1 (0x40120000)         libblas.so.3gf => /data/data/org.freesoft.Macaulay2/files/lib/libblas.so.3gf (0x40138000)         libgfortran.so.3 => /data/data/org.freesoft.Macaulay2/files/lib/libgfortran.so.3 (0x40bc8000)         libgmp.so.10 => /data/data/org.freesoft.Macaulay2/files/lib/libgmp.so.10 (0x40c43000)         libtinfo.so.5 => /data/data/org.freesoft.Macaulay2/files/lib/libtinfo.so.5 (0x40c8d000)      Why does everything point to `/data/data/...` EXCEPT the dynamic loader itself? If you want to reproduce the whole thing, it's a Macaulay 2 build on ARM with this `configure` command:               ./configure  --enable-download --enable-build-libraries=pari --prefix=/data/data/org.freesoft.Macaulay2/files LDFLAGS=-Wl,--dynamic-linker=/data/data/org.freesoft.Macaulay2/files/lib/ld-linux.so.3


httpd server simply doesn't want to run anymore

I have no idea why, if I do `service httpd restart` it just goes back to prompt:               root@host [/home3/backup/2013-08-25/accounts]# service httpd start      httpd (pid 29767) already running     root@host [/home3/backup/2013-08-25/accounts]# service httpd stop     root@host [/home3/backup/2013-08-25/accounts]# service httpd restart     root@host [/home3/backup/2013-08-25/accounts]# service httpd status      Nothing! And after a while it reports that apache is not running. No error message whatsoever. However WHM and CPanel run though.               root@host [/home3/backup/2013-08-25/accounts]# service httpd configtest     Syntax OK     root@host [/home3/backup/2013-08-25/accounts]#      Notice that it used to work fine. I got something: root@host [/home3/backup/2013-08-25/accounts]# service httpd status Terminated               root@host [/home3/backup/2013-08-25/accounts]# 403 Forbidden             Access is forbidden to the requested page:               localhost/whm-server-status (port 80)             Please forward this error screen to localhost's [1]WebMaster.          __________________________________________________________________                   Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/1.0.0-fips         mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635         Server at localhost Port 80          References             1. mailto:webmaster@buildingsuperteams.com?subject=Error%20message%20[403]%20403%20Forbidden%20for%20localhost/whm-server-status%20port%2080%20on%20Thursday,%2029-Aug-2013%2023:43:54%20MDT      forbidden what? Restarting the whole server works. Restarting apache doesn't/


filesystem that works under qemu and I can mount on my host

I'm using `qemu` for different kind of tasks, I would like to pick a filesystem that is both qemu-compatible and easy to mount under my host. I already discarded both `qcow` and `qcow2` because apparently they are not supported as filesystem by the linux kernel, there is a little trick but it doesn't meet my needs, I basically need to write and read freely from/to this image file, not just take a look when this image is hotplugged to qemu. Could you suggest a way to create a qemu filesystem that will be usable under a GNU/Linux host as any other partition/hard disk ?


Performance differences between pipelines and process substitution

I tend to use pipelines in my bash scripts over process substitution in most situations, especially in cases of using multiple sets of commands as it seems more readable to do `... | ... | ...` over `... < <(... < <(...))`. I'm wondering though why using process substitution is much faster in some situations than using a pipeline. To test this, I `time`d two scripts using `10000` iterations of the same attached commands with one using a pipeline and another using process substitution. Scripts: `pipeline.bash`:               for i in {1..10000}; do         echo foo bar |         while read; do             echo $REPLY >/dev/null         done     done      `proc-sub.bash`               for i in {1..10000}; do         while read; do             echo $REPLY >/dev/null         done < <(echo foo bar)     done      Results:               ~$ time ./pipeline.bash          real    0m17.678s     user    0m14.666s     sys     0m14.807s          ~$ time ./proc-sub.bash          real    0m8.479s     user    0m4.649s     sys     0m6.358s      I know that pipelines create a sub process whereas process substitution creates a named pipe or some file in `/dev/fd`, but am unclear about how those differences impact performance.


Remove ^M character from log files

Remove ^M character from log files. In my script I redirect output of my program to a log file. The output of my log file contains some ^M (newline) characters. I need to remove them while running itself. My command:               $ java -jar test.jar >> test.log       `test.log` has: > Starting script ... ^M Starting script ...Initializing


Make feh notice newly plugged-in monitor for image scaling

I use my laptop with multiple monitor, I want `feh` to understand that a new monitor has plugged in and scale wallpaper image accordingly. I use the following code, but when a new monitor is plugged in, `feh` tiles the last wallpaper on all monitors.                feh --bg-scale ~/Pictures/wallpaper/example.jpg


How to put current line at top/center/bottom of screen in vim?

Any quicker navigation trick to place the line at which the cursor is at the moment to the   * top of the screen?   * center of the screen?   * bottom of the screen?


How do I resize GNOME shell top bar

I am on Ubuntu 12.04 and installed gnome-shell, but I found the top bar is larger than it normally is, how can I change its size?


Is there a way to install only the base Fedora system?

I'd like to install a base Fedora system meaning without all the other programs/applications that come when installing a Gnome/KDE/XFCE spins. How do I do this? This is the first time I'd be installing Fedora and I'm quite accustomed to Arch Linux so I want the same approach, or similar approach of building from the base install up to the system of my preference. I've been reading the documentation and came across using the boot options `linux text` but I don't think this will install a base Fedora system, just that the installation menu system will be in text mode, but I could be wrong.


Is it possible to make scp fail when you do a local copy?

Is it possible to make `scp` fail when you do a local copy? I find it annoying to accidently create files with names like `192.168.11.5` when I meant to type `192.168.11.5:` and hence copying the file to the remote computer.


A distro that supports intel/nvidia hybrid graphics out of the box

I've spent so much time trying to get various flavours of Linux to run on my Dell XPS LS02 laptop which only has a HDMI output. I've tried all sorts of solutions and methods including http://bumblebee- project.org/ However none have managed to get me a stable second display working. The question, is there any distribution that supports the intel/nvidia(optimus) hybrid chipset out of the box?


Why am I having ghosting and tearing with the i3 window manager paired with xcompgmr when tiling terminals vertically?

I'm using the _i3_ tiling window manager. As it doesn't do compositing, I've enabled the `xcompmgr` compositor in my _~/.i3/config_ file as well as `feh` to display a wallpaper:               exec --no-startup-id xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55     exec feh --bg-scale ~/Downloads/Arch-Linux-Bluewave.jpg      Now `lxterminal` supports translucency etc. but when I arrange my terminals vertically, some **ghosting** , tearing and decoration artifacts from other workspaces appear to the top right - and disappear as soon as the window is tiled horizontally. Furthermore, when `transmission-gtk` "floats" a dialog box, moving that box around leaves ghosting in the form of tiny horizontal lines which remain until some refresh. Is there any workaround?


Sharing private keys across machines

Say I have **local** access to two machines **A** and **B** and **remote** access to machine **C**. If I generate a public-private pair of keys for accessing machine C from A, can I share the private key with machine B to access machine C from it? Or do I need to generate a new public-private pair? At the moment I have a pair of keys working to access C from A, but when I use this private key from B it doesn't work. In case it matters, I use a config file for this as follows:               Host XXX     User XXX     HostName XXX     IdentityFile ZZZ      Where ZZZ points to the key in B (different paths in the machines A and B) I am using the same username in both.


Permissions for a submission script

I'm a TA for an introductory Python programming class (all work is done from the terminal), and I'm writing a project submission script. Ideally I want a directory setup like this:               submissions/        user1/           project1/           ...        user2/           project1/           ...        ...      Ideally, I'd like nothing inside the submissions directory to be readable or writable to any of the users, and I'll provide a submission script that copies all of their work into the right place. Currently I have a little Perl script that does the submission part and works when I use it, but how can I set up the permissions (or the script) so that the students don't get a `permission denied` error while running the script (requiring write permissions to the submissions directory), but they don't simultaneously have write permissions?


Can't apply chmod to a file

I have a file on my HDD,               cd /media/celebisait/5AC69788C6976355      There is my file called `myFile.tar.gz`. I do a`ls -l`,               -rw------- 2 celebisait celebisait  1387745311 Jun  6  2013 myFile.tar.gz      Everything seems fine. However, when I do,               $ sudo chmod 755 myFile.tar.gz      I do not have any errors but nothing happens, i.e., when I do `ls -l` again, I get the same output,               -rw------- 2 celebisait celebisait  1387745311 Jun  6  2013 myFile.tar.gz      Chmod does not change.. Why? PS: I use Ubuntu 13.04. ## Edit:               $ cd /media/celebisait/5AC69788C6976355     $ df          Filesystem     1K-blocks      Used Available Use% Mounted on     /dev/sda2       89873576  42976028  42325544  51% /     none                   4         0         4   0% /sys/fs/cgroup     udev            16436736         4  16436732   1% /dev     tmpfs            3289260       920   3288340   1% /run     none                5120         0      5120   0% /run/lock     none            16446280       764  16445516   1% /run/shm     none              102400        52    102348   1% /run/user     /dev/sda1          94759      2208     92551   3% /boot/efi     /dev/sdb1      767999996 541212516 226787480  71% /media/celebisait/5AC69788C6976355     /dev/sdb2      767999996   1466472 766533524   1% /media/celebisait/54D09DBDD09DA5B0      ## Edit 2:               $ cd /media/celebisait/5AC69788C6976355     $ mount          /dev/sda2 on / type ext4 (rw,errors=remount-ro)     proc on /proc type proc (rw,noexec,nosuid,nodev)     sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)     none on /sys/fs/cgroup type tmpfs (rw)     none on /sys/fs/fuse/connections type fusectl (rw)     none on /sys/kernel/debug type debugfs (rw)     none on /sys/kernel/security type securityfs (rw)     none on /sys/firmware/efi/efivars type efivarfs (rw)     udev on /dev type devtmpfs (rw,mode=0755)     devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)     tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)     none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)     none on /run/shm type tmpfs (rw,nosuid,nodev)     none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)     /dev/sda1 on /boot/efi type vfat (rw)     binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)     gvfsd-fuse on /run/user/celebisait/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=celebisait)     /dev/sdb1 on /media/celebisait/5AC69788C6976355 type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)     /dev/sdb2 on /media/celebisait/54D09DBDD09DA5B0 type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)      ## Edit 3:               $ sudo fdisk -l /dev/sdb1          Disk /dev/sdb1: 786.4 GB, 786432000000 bytes     255 heads, 63 sectors/track, 95611 cylinders, total 1536000000 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x6e697373          This doesn't look like a partition table     Probably you selected the wrong device.               Device Boot      Start         End      Blocks   Id  System     /dev/sdb1p1   ?  1936269394  3772285809   918008208   4f  QNX4.x 3rd part     Partition 1 does not start on physical sector boundary.     /dev/sdb1p2   ?  1917848077  2462285169   272218546+  73  Unknown     Partition 2 does not start on physical sector boundary.     /dev/sdb1p3   ?  1818575915  2362751050   272087568   2b  Unknown     Partition 3 does not start on physical sector boundary.     /dev/sdb1p4   ?  2844524554  2844579527       27487   61  SpeedStor     Partition 4 does not start on physical sector boundary.          Partition table entries are not in disk order      ## Edit 4:               $ sudo fdisk -l /dev/sdb          Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes     255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x9c73d093             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1            2048  1536002047   768000000    7  HPFS/NTFS/exFAT     /dev/sdb2      1536002048  3072002047   768000000    7  HPFS/NTFS/exFAT     /dev/sdb3      3072002048  3907026943   417512448    7  HPFS/NTFS/exFAT


zsh autocomplete directory

I'm new to zsh and one thing that I do quite often is execute shell scripts that are in a directory of mine called Scripts. I'm not always inside of the Scripts directory, however... I may be in $HOME and therefore would like to just type `Sc<Tab>` and have it autocomplete to `Scripts/` and then be able to autocomplete which script I want to run from there, of course... However, zsh doesn't seem to do this by default. It will only autocomplete directory names for me if I have typed `ls` or `cd`. If I'm trying to autocomplete a directory first, it just simply won't do it. Is there a way to change this behavior? Edit: I figured out that I could do `./Sc<Tab>` and it would autocomplete for me. I guess I'm just used to not having to type out `./` before something to get it to autocomplete, so I'd still like to know if this is possible in zsh, but this is an acceptable workaround for now.


Linux 3D graphic libraries

What libraries can be used for 3D graphics on Linux? Are there big differences for 3D graphics programming between Linux and Windows? I found about DirectX and OpenGl by searching, but I'm not sure that these are graphic libraries.


First and last day of a month

Given two numbers, month and year, how can I compute the first and the last day of that month ? My goal is to output these three lines:   1. month / year (month in textual form but that is trivial)   2. for each day of the month: name of the day of the week for the current day: Fri. & Sat. & Sun. [...]   3. day number within the month: 1 & 2 & 3 [...] & 28 & .. ? I'm looking for a solution using GNU `date` or BSD `date` (on OS X).


File descriptors & shell scripting

I am having a very hard time understanding how does one use file descriptors in shell scripts. I know the basics such as               exec 5 > /tmp/foo      So fd 5 is attached to foo for writing.               exec 6 < /tmp/bar      … for reading.               exec 5>&-      … close fd. Now what does this do?               #!/bin/bash          exec 5 > /tmp/foo      exec 6 < /tmp/bar           cat <&6 | while read a     do          echo $a >&5     done      As i understand `&5` closes the fd, so how is the output still being re- directed successfully after each call? This is a copy pasta from : Here It claims using this over a simple `echo $a > file` would make it much quicker, I however fail to understand. I would appreciate any links to decent tutorial. I google powers seem to be failing me.


How to save a GNOME 3 session

GNOME 2 allows one to either save the session automatically or manually (i.e. _save the session as it looks right now_ ). This is a nice feature because it restores the various desktop states between logins (and system restarts):   * which apps were open   * where (physically) on the desktop were they open   * what specific window sizes were these apps set to Looking around, I can't find the feature in GNOME 3? Did I not look hard enough?


Python library conflict with lower version

I am trying to reinstall yum in `CentOS`. Because I made some mistake by removing python.               so I got error as follows     There was a problem importing one of the Python modules     required to run yum. The error leading to this problem was:             No module named rpm          Please install a package which provides this module, or     verify that the module is installed correctly.          It's possible that the above module doesn't match the     current version of Python, which is:     2.4.3 (#1, Nov 11 2010, 13:34:43)      [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)]          If you cannot solve this problem yourself, please go to      the yum faq at:       http://wiki.linux.duke.edu/YumFaq      And then I followed some tutorial from http://www.electrictoolbox.com/install- yum-with-rpm-on-centos/ But I got an error while trying to install python libs               error: Failed dependencies:         python < 2.4.3-32.el5 conflicts with python-libs-2.4.3-43.el5.i386      How can I fix this? **Edit**               rpm -qa|grep python     python-iniparse-0.2.3-4.el5     python-2.4.3-27.el5_5.3     libselinux-python-1.33.4-5.5.el5     gamin-python-0.1.7-8.el5     python-elementtree-1.2.6-5     python-urlgrabber-3.1.0-6.el5     audit-libs-python-1.7.17-3.el5     libxml2-python-2.6.26-2.1.2.8.el5_5.1     python-sqlite-1.1.7-1.2.1


High CPU utilization with zip command

When I am using the `zip` utility in Linux to compress files, CPU utilization is going to 100%. Can anybody help me why CPU utilization is so high? I'm using the command:               zip file_name *.xml


Unix - How to append text to every line of a file except for the header line/first line

I have a file say abc.txt with following data (real data has many records,say around 200) > Sno | Name   >  1 | Jack   >  2 | Jill   >  3 | June Now how do I append text to make my file look like this, > Sno | Name | Place   >  1 | Jack | Paris   >  2 | Jill | Paris   >  3 | June | Paris I tried replacing globally ,but first line should be appended with different text.So please help me out guys.


Mixing audio tracks in a video file in Linux

I have a video file that has two audio tracks. The first one is background music and the other one is commentary. I want to merge those tracks together. This is the media information I got from ffmpeg:               Input #0, avi, from '24.avi':       Metadata:         encoder         : BandiAviMuxer 1.0       Duration: 00:17:49.13, start: 0.000000, bitrate: 10514 kb/s         Stream #0:0: Video: mpeg1video (MPEG / 0x4745504D), yuv420p, 1280x1024 [SAR 1:1 DAR 5:4], 104857 kb/s, 30 tbr, 30 tbn, 30 tbc         Stream #0:1: Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16p, 192 kb/s         Stream #0:2: Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16p, 192 kb/s      I am looking for a GUI tool, because I need to be able to interactively fine tune the relative volume of the audio tracks. I may need to apply different volume ratios throughout the video. So I need some ability to edit volume as curves, with keypoints and some simple interpolations between them. I haven't done any video editing recently so I do not know what the possibilities are. Using a Linux only software is fine with me.


Lubuntu PowerPC with no apt repositories?

I've installed Lubuntu 13.04 on my G4 Mac Mini, however it didn't have any `apt` repositories, except from the CD. I've copied over the repositories from my i386 installation, but it can't find some of them. What repositories do I need to make it work? **Output from`apt-get update`:**               ...          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/main/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/restricted/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/universe/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/multiverse/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring/main/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring/restricted/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring/universe/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring/multiverse/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-updates/main/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-updates/restricted/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-updates/universe/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-updates/multiverse/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-backports/main/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-backports/restricted/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-backports/universe/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-backports/multiverse/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          E: Some index files failed to download. They have been ignored, or old ones used instead.      **Old`/etc/apt/sources.list`:**               deb cdrom:[Lubuntu 13.04 _Raring Ringtail_ - Release powerpc (20130424)]/ raring main multiverse restricted universe      **`/etc/apt/sources.list` copied from i386:**               # deb cdrom:[Lubuntu 13.04 _Raring Ringtail_ - Release i386 (20130423.1)]/ raring main multiverse restricted universe          # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to     # newer versions of the distribution.     deb http://gb.archive.ubuntu.com/ubuntu/ raring main restricted     deb-src http://gb.archive.ubuntu.com/ubuntu/ raring main restricted          ## Major bug fix updates produced after the final release of the     ## distribution.     deb http://gb.archive.ubuntu.com/ubuntu/ raring-updates main restricted     deb-src http://gb.archive.ubuntu.com/ubuntu/ raring-updates main restricted          ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu     ## team. Also, please note that software in universe WILL NOT receive any     ## review or updates from the Ubuntu security team.     deb http://gb.archive.ubuntu.com/ubuntu/ raring universe     deb-src http://gb.archive.ubuntu.com/ubuntu/ raring universe     deb http://gb.archive.ubuntu.com/ubuntu/ raring-updates universe     deb-src http://gb.archive.ubuntu.com/ubuntu/ raring-updates universe          ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu      ## team, and may not be under a free licence. Please satisfy yourself as to      ## your rights to use the software. Also, please note that software in      ## multiverse WILL NOT receive any review or updates from the Ubuntu     ## security team.     deb http://gb.archive.ubuntu.com/ubuntu/ raring multiverse     deb-src http://gb.archive.ubuntu.com/ubuntu/ raring multiverse     deb http://gb.archive.ubuntu.com/ubuntu/ raring-updates multiverse     deb-src http://gb.archive.ubuntu.com/ubuntu/ raring-updates multiverse          ## N.B. software from this repository may not have been tested as     ## extensively as that contained in the main release, although it includes     ## newer versions of some applications which may provide useful features.     ## Also, please note that software in backports WILL NOT receive any review     ## or updates from the Ubuntu security team.     deb http://gb.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse     deb-src http://gb.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse          deb http://security.ubuntu.com/ubuntu raring-security main restricted     deb-src http://security.ubuntu.com/ubuntu raring-security main restricted     deb http://security.ubuntu.com/ubuntu raring-security universe     deb-src http://security.ubuntu.com/ubuntu raring-security universe     deb http://security.ubuntu.com/ubuntu raring-security multiverse     deb-src http://security.ubuntu.com/ubuntu raring-security multiverse          ## Uncomment the following two lines to add software from Canonical's     ## 'partner' repository.     ## This software is not part of Ubuntu, but is offered by Canonical and the     ## respective vendors as a service to Ubuntu users.     # deb http://archive.canonical.com/ubuntu raring partner     # deb-src http://archive.canonical.com/ubuntu raring partner          ## This software is not part of Ubuntu, but is offered by third-party     ## developers who want to ship their latest software.     deb http://extras.ubuntu.com/ubuntu raring main     deb-src http://extras.ubuntu.com/ubuntu raring main


ntpd takes 9 hours to sync

I had a situation lately with a host that need up to date ntp servers. We had during the weekend a crash of our internet router. When everything came back to hte normal our application was still complaining about NTP. We discovered that the ntp client took 9h to get sync. Here is the ntpd's logs :               Aug 19 15:31:15 host ntpd[26550]: kernel time sync status 0040     Aug 19 15:31:15 host ntpd[26550]: frequency initialized 97.149 PPM from /tmp/drift     Aug 20 00:29:24 host ntpd[26550]: synchronized to 192.168.10.13, stratum 3     Aug 20 00:29:24 host ntpd[26550]: kernel time sync disabled 0001      When the issue occured here is the output of peers state :               # ntpq     ntpq> peers     remote refid st t when poll reach delay offset jitter     ==============================================================================     srv1 145.238.203.10 3 u 31 64 377 0.714 -685.16 6.388     srv2 145.238.203.10 3 u 5 64 377 0.652 -1385.7 12.165      Someone told me that I should use minpoll and maxpoll settings to solve this issue. What should I do to avoid 9H NTP synchronisation ?


Indexing and modifying Bash parameter array $@

Is it possible to refer to indexes in `$@`? I can't find any reference to use like the following anywhere in GrayCat's wiki, and the Advanced Scripting Guide and others assign this to a different variable before modifying that instead.               $ echo ${@[0]}     -bash: ${@[0]}: bad substitution      The goal is DRY: The first argument is used for one thing, and the rest for something else, and I'd like to avoid duplicating either the code to normalize, the `$@` array, or to create a separate function for this (although at this point it's probably the easiest way out). Clarification: The object was to modify the values of the _variable-length_ `$@` to make the code easier to debug. The current version is a bit too hacky for my liking, although it works even for bizarre paths like               $'--$`\! *@ \a\b\e\E\f\r\t\v\\\"\' \n'      **Update** : Looks like this isn't possible. The code now uses both code and data duplication, but at least it works:               path_common()     {         # Get the deepest common path.         local common_path="$(echo -n "${1:-}x" | tr -s '/')"         common_path="${common_path%x}"         shift # $1 is obviously part of $1         local path              while [ -n "${1+defined}" ]         do             path="$(echo -n "${1}x" | tr -s '/')"             path="${path%x}"             if [[ "${path%/}/" = "${common_path%/}/"* ]]             then                 shift             else                 new_common_path="${common_path%/*}"                 [ "$new_common_path" = "$common_path" ] && return 1 # Dead end                 common_path="$new_common_path"             fi         done         printf %s "$common_path"     }      Bounty goes to anyone who can get rid of the **duplication of code** to collapse duplicate slashes or **duplication of data** to hold `$1` and the other parameters, or both, while keeping the code a reasonable size and succeeding all the unit tests:               test "$(path_common /a/b/c/d /a/b/e/f; echo x)" = /a/bx     test "$(path_common /long/names/foo /long/names/bar; echo x)" = /long/namesx     test "$(path_common / /a/b/c; echo x)" = /x     test "$(path_common a/b/c/d a/b/e/f ; echo x)" = a/bx     test "$(path_common ./a/b/c/d ./a/b/e/f; echo x)" = ./a/bx     test "$(path_common $'\n/\n/\n' $'\n/\n'; echo x)" = $'\n/\n'x     test "$(path_common --/-- --; echo x)" = '--x'     test "$(path_common '' ''; echo x)" = x     test "$(path_common /foo/bar ''; echo x)" = x     test "$(path_common /foo /fo; echo x)" = x     test "$(path_common $'--$`\! *@ \a\b\e\E\f\r\t\v\\\"\' \n' $'--$`\! *@ \a\b\e\E\f\r\t\v\\\"\' \n'; echo x)" = $'--$`\! *@ \a\b\e\E\f\r\t\v\\\"\' \n'x     test "$(path_common /foo/bar //foo//bar//baz; echo x)" = /foo/barx     test "$(path_common foo foo; echo x)" = foox     test "$(path_common /fo /foo; echo x)" = x


Linux apache set custom launch page Virtualhosts

I set up DNS and virtualhosts on my Linux system but when surfing to ex: www.vb1.be it shows the correct directory (home/vb1/) and their subdirectories. I know this is because the main html file that should be loaded isn't named index.html but homepage.html. So how can I set this homepage.html to launch every time someone surfs to www.vb1.be?               <VirtualHost *:80>         ServerAdmin webmaster@example.com         DocumentRoot /home/vb1.be         ServerName vb1.be         ServerAlias www.vb1.be         ErrorLog logs/vb1.be-error_log         CustomLog logs/vb1.be-access_log common     </VirtualHost>


How to redirect to my squid proxy using iptables since DNAT target: only valid in nat table

I want to redirect the traffic in my lan network through squid proxy but I am having some problems with `iptables` rules. When I use the following rule:               # iptables -I FORWARD -s 192.168.1.0/255.255.255.0 -p tcp --dport 80 -j DNAT --to-destination 192.168.1.196:3128      I get the following error:               x_tables: ip_tables: DNAT target: only valid in nat table, not filter      I have tried using `PREROUTING` chain but there is nothing like this in my iptables:               # iptables -I PREROUTING -s 192.168.1.0/255.255.255.0 -p tcp --dport 80 -j DNAT --to-destination 192.168.1.196:3128     iptables: No chain/target/match by that name.      I am using iptables version `v.1.4.10`               # iptables -t nat -L PREROUTING     Chain PREROUTING (policy ACCEPT)     target     prot opt source               destination              prerouting_rule  all  --  anywhere             anywhere                 zone_lan_prerouting  all  --  anywhere             anywhere                 zone_wan_prerouting  all  --  anywhere             anywhere      my whole `iptables -nLv`               root@OpenWrt:~# iptables -L -n -v     Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                776 93902 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           ctstate RELATED,ESTABLISHED          0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0                 3231  164K syn_flood  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x17/0x02       7098  429K input_rule  all  --  *      *       0.0.0.0/0            0.0.0.0/0                 7096  429K input      all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain FORWARD (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                  0     0 DROP       udp  --  *      *       0.0.0.0/0            0.0.0.0/0           MAC XX:XX:XX:XX:XX:XX udp spt:22509           0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           MAC XX:XX:XX:XX:XX:XX tcp spts:59000:65399          0     0 DROP       udp  --  *      *       0.0.0.0/0            0.0.0.0/0           MAC XX:XX:XX:XX:XX:XX udp spts:49950:65399       8271 3071K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           ctstate RELATED,ESTABLISHED        451 44484 forwarding_rule  all  --  *      *       0.0.0.0/0            0.0.0.0/0                  451 44484 forward    all  --  *      *       0.0.0.0/0            0.0.0.0/0                    5   276 reject     all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination               7408  581K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           ctstate RELATED,ESTABLISHED          0     0 ACCEPT     all  --  *      lo      0.0.0.0/0            0.0.0.0/0                  206 13814 output_rule  all  --  *      *       0.0.0.0/0            0.0.0.0/0                  206 13814 output     all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain forward (1 references)      pkts bytes target     prot opt in     out     source               destination                446 44208 zone_lan_forward  all  --  br-lan *       0.0.0.0/0            0.0.0.0/0                    0     0 zone_wan_forward  all  --  eth1   *       0.0.0.0/0            0.0.0.0/0                     Chain forwarding_lan (1 references)      pkts bytes target     prot opt in     out     source               destination                   Chain forwarding_rule (1 references)      pkts bytes target     prot opt in     out     source               destination                   Chain forwarding_wan (1 references)      pkts bytes target     prot opt in     out     source               destination                   Chain input (1 references)      pkts bytes target     prot opt in     out     source               destination                515 43070 zone_lan   all  --  br-lan *       0.0.0.0/0            0.0.0.0/0                 6560  385K zone_wan   all  --  eth1   *       0.0.0.0/0            0.0.0.0/0                     Chain input_lan (1 references)      pkts bytes target     prot opt in     out     source               destination                   Chain input_rule (1 references)      pkts bytes target     prot opt in     out     source               destination                   Chain input_wan (1 references)      pkts bytes target     prot opt in     out     source               destination                   Chain output (1 references)      pkts bytes target     prot opt in     out     source               destination                206 13814 zone_lan_ACCEPT  all  --  *      *       0.0.0.0/0            0.0.0.0/0                  203 13301 zone_wan_ACCEPT  all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain output_rule (1 references)      pkts bytes target     prot opt in     out     source               destination                   Chain reject (5 references)      pkts bytes target     prot opt in     out     source               destination               3249  166K REJECT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with tcp-reset       3257  198K REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable           Chain syn_flood (1 references)      pkts bytes target     prot opt in     out     source               destination               3231  164K RETURN     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x17/0x02 limit: avg 25/sec burst 50          0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain zone_lan (1 references)      pkts bytes target     prot opt in     out     source               destination                515 43070 input_lan  all  --  *      *       0.0.0.0/0            0.0.0.0/0                  515 43070 zone_lan_ACCEPT  all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain zone_lan_ACCEPT (2 references)      pkts bytes target     prot opt in     out     source               destination                  3   513 ACCEPT     all  --  *      br-lan  0.0.0.0/0            0.0.0.0/0                  515 43070 ACCEPT     all  --  br-lan *       0.0.0.0/0            0.0.0.0/0                     Chain zone_lan_DROP (0 references)      pkts bytes target     prot opt in     out     source               destination                  0     0 DROP       all  --  *      br-lan  0.0.0.0/0            0.0.0.0/0                    0     0 DROP       all  --  br-lan *       0.0.0.0/0            0.0.0.0/0                     Chain zone_lan_REJECT (1 references)      pkts bytes target     prot opt in     out     source               destination                  0     0 reject     all  --  *      br-lan  0.0.0.0/0            0.0.0.0/0                    5   272 reject     all  --  br-lan *       0.0.0.0/0            0.0.0.0/0                     Chain zone_lan_forward (1 references)      pkts bytes target     prot opt in     out     source               destination                446 44208 zone_wan_ACCEPT  all  --  *      *       0.0.0.0/0            0.0.0.0/0                    5   272 forwarding_lan  all  --  *      *       0.0.0.0/0            0.0.0.0/0                    5   272 zone_lan_REJECT  all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain zone_wan (1 references)      pkts bytes target     prot opt in     out     source               destination                 64 21010 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:68          0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 8       6496  364K input_wan  all  --  *      *       0.0.0.0/0            0.0.0.0/0                 6496  364K zone_wan_REJECT  all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain zone_wan_ACCEPT (2 references)      pkts bytes target     prot opt in     out     source               destination                644 57237 ACCEPT     all  --  *      eth1    0.0.0.0/0            0.0.0.0/0                    0     0 ACCEPT     all  --  eth1   *       0.0.0.0/0            0.0.0.0/0                     Chain zone_wan_DROP (0 references)      pkts bytes target     prot opt in     out     source               destination                  0     0 DROP       all  --  *      eth1    0.0.0.0/0            0.0.0.0/0                    0     0 DROP       all  --  eth1   *       0.0.0.0/0            0.0.0.0/0                     Chain zone_wan_REJECT (2 references)      pkts bytes target     prot opt in     out     source               destination                  0     0 reject     all  --  *      eth1    0.0.0.0/0            0.0.0.0/0                 6496  364K reject     all  --  eth1   *       0.0.0.0/0            0.0.0.0/0                     Chain zone_wan_forward (1 references)      pkts bytes target     prot opt in     out     source               destination                  0     0 forwarding_wan  all  --  *      *       0.0.0.0/0            0.0.0.0/0                    0     0 zone_wan_REJECT  all  --  *      *       0.0.0.0/0            0.0.0.0/0


How can I know if a virtual package is "installed" on a Debian system?

Some packages, have a `Provides:` header. For example, the package `postfix` on Debian Wheezy has `Provides: mail-transport-agent`. The package `mail-transport-agent` which doesn't exist physically is considered as a "virtual" package. **How can I know, on a Debian based system, if a given virtual package is "installed" (or "provided")? Can I list every "provided" virtual package?** _Hint_ : to list every existing virtual package, installed or not, do: `aptitude search "~v"`


What is the referent of a file descriptor?

My understanding is that a _file descriptor_ is an integer which is a key in the kernel's per-process mapping to objects such as `open()`ed files, pipes, sockets, etc. Is there a proper, short, and specific name for “open files/sockets/pipes/...”, the referents of file descriptors? Calling them “files” leads to confusion with unopened files stored in the file system. Simply referring to file descriptors does not adequately describe the semantics (e.g. copying _the integer_ between processes is useless). Consulting The Open Group Base Specifications and my own system's manpages leads me to the conclusion that the referent of a file descriptor is an _object_ and when it is specifically an open file it is, well, an _open file_. Is there a more specific term than _object_?