Linux Fedora 20: how do I deal with " import read failed(2)"?

I have been struggling to get yum to work when trying to install emacs in my recent installation of Fedora 20, and posted the question, on this site. "How can I get yum and the internet browser to work after fresh Fedora 20 installation", which inspired several useful answers (many thanks to the kind posters), but none of them, unfortunately, solved it. I don't expect any more to come from that question, but I have tried an approach that might work, but it still fails with the error in this question. I came across the suggestion               [root@localhost Harry]# setenforce 0     [root@localhost Harry]# yum clean expire-cache     [root@localhost Harry]# yum update selinux-policy\*     [root@localhost Harry]# setenforce 1      And tried it out, not getting very far:               [root@localhost Harry]# setenforce 0     [root@localhost Harry]# yum clean expire-cache     Loaded plugins: langpacks, refresh-packagekit     Cleaning repos: fedora updates     0 metadata files removed     [root@localhost Harry]# yum update selinux-policy\*     Loaded plugins: langpacks, refresh-packagekit     fedora/20/i386/metalink                                  |  33 kB     00:00          http://ftp.up.pt/fedora/releases/20/Everything/i386/os/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: ftp.up.pt"     Trying other mirror.      and so it went on for ages, the same error, `[Errno 14] curl#6 - "Could not resolve host: www.mirrorservice.org"` I get whenever I try to use yum. I followed the lead I had and tried this, which looked promising, but again it failed with an error that I cannot fathom out:               [root@localhost Harry]# yum-config-manager --add-repo=http://download.fedoraproject.org/pub/fedora/linux/updates/testing/20/i386/     Loaded plugins: langpacks, refresh-packagekit     adding repo from: http://download.fedoraproject.org/pub/fedora/linux/updates/testing/20/i386/          [download.fedoraproject.org_pub_fedora_linux_updates_testing_20_i386_]     name=added from: http://download.fedoraproject.org/pub/fedora/linux/updates/testing/20/i386/     baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/testing/20/i386/     enabled=1          [root@localhost Harry]# yum install emacs     Loaded plugins: langpacks, refresh-packagekit          You have enabled checking of packages via GPG keys. This is a good thing.      However, you do not have any GPG public keys installed. You need to download     the keys for packages you wish to install and install them.     You can do that by running the command:         rpm --import public.gpg.key          Alternatively you can specify the url to the key you would like to use     for a repository in the 'gpgkey' option in a repository section and yum      will install it for you.          For more information contact your distribution or package provider.          Problem repository: download.fedoraproject.org_pub_fedora_linux_updates_testing_20_i386_      But again a failure, I get it whenever I try `import`:               [root@localhost Harry]# rpm --import public.gpg.key     error: public.gpg.key: import read failed(2).      ## So my question is: is this is a useful approach, and, if so, how do I get round the `import failed(2)` error? In answer to Leiaz's comment, thank you, this is what I get from ifconfig. It's a wired connection to a BT Homehub 3 router, May I add that I have no problem with the internet in Windows XP installed on the same dual boot machine, nor on the two laptops with a wireless connection to the same router. I also have no trouble with the Firefox browser in this Linux, which is the one with the yum trouble, and the one I am using to post this question: in fact it is faster than the one on my laptop.               [root@localhost Harry]# ifconfig     lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536             inet 127.0.0.1  netmask 255.0.0.0             inet6 ::1  prefixlen 128  scopeid 0x10<host>             loop  txqueuelen 0  (Local Loopback)             RX packets 8  bytes 668 (668.0 B)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 8  bytes 668 (668.0 B)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0          p20p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500             inet 192.168.1.100  netmask 255.255.255.0  broadcast 0.0.0.0             inet6 fe80::76d4:35ff:fe5c:f999  prefixlen 64  scopeid 0x20<link>             ether 74:d4:35:5c:f9:99  txqueuelen 1000  (Ethernet)             RX packets 62356  bytes 42267371 (40.3 MiB)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 56754  bytes 11151168 (10.6 MiB)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0      Thanks vonbrand and again Leiaz. This is what I get:               [root@localhost Harry]# cat /etc/resolv.conf      # Generated by NetworkManager     domain home     search home     nameserver 192.168.1.254     [root@localhost Harry]#  route -n     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         192.168.1.254   0.0.0.0         UG    1024   0        0 p20p1     192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 p20p1     [root@localhost Harry]#           [root@localhost Harry]# ping 192.168.1.254     PING 192.168.1.254 (192.168.1.254) 56(84) bytes of data.     64 bytes from 192.168.1.254: icmp_seq=1 ttl=64 time=0.701 ms     64 bytes from 192.168.1.254: icmp_seq=2 ttl=64 time=0.678 ms     64 bytes      ...                                              ...    time=0.683 ms     64 bytes from 192.168.1.254: icmp_seq=10 ttl=64 time=0.668 ms     64 bytes from 192.168.1.254: icmp_seq=11 ttl=64 time=0.665 ms     ^Z     [1]+  Stopped                 ping 192.168.1.254     [root@localhost Harry      * * * Having no idea how to deal with ipv6, and unable to find the answer on the Internet, I thought I would try a different Linux, so I have installed openSUSE, but it appears to have the same problem. As with Fedora, I am using Firefox from within Linux, to post this, and the 'net is fully working in the other windows partition. Please, _please_ can someone help me to solve this, I am completely stumped. Without `emacs` and a C compiler, well Linux is no longer any use to me, after happily using it for more than ten years. Here is the relevant openSUSE result:               harry@linux-18x3:~> gcc     If 'gcc' is not a typo you can use command-not-found to lookup the package that contains it, like this:         cnf gcc     harry@linux-18x3:~> cnf gcc          The program 'gcc' can be found in following packages:       * gcc [ path: /usr/bin/gcc, repository: zypp (openSUSE-13.1-1.10) ]       * gcc [ path: /usr/bin/gcc, repository: zypp (repo-oss) ]          Try installing with:         sudo zypper install gcc          harry@linux-18x3:~> sudo zypper install gcc     root's password:     Download (curl) error for 'http://download.opensuse.org/distribution/13.1/repo/non-oss/content':     Error code: Connection failed     Error message: Could not resolve host: download.opensuse.org          Abort, retry, ignore? [a/r/i/? shows all options] (a):


what is wild card to select all directories in a directory

i want to set sticky bit for all directories in a directory excluding files. is there any wild card to do this?               #sudo chmod g+s /var/www/<WILD_CARD_FOR_ALL_DIRECTORIES>


linux driver installation error - “/lib/modules/2.6.18-194.el5/build: No such file or directory. Stop.”

I got an error               /lib/modules/2.6.18-194.el5/build: No such file or directory. Stop.      while installing `moxa` driver, following is the shell screen shot.               [root@lnx149-252 driver]# pwd     /root/moxa/mxu11x0/driver     [root@lnx149-252 driver]# ls     Makefile  mxu1110_fw.h  mxu1130_fw.h  mxu1131_fw.h  mxu1150_fw.h  mxu1151_fw.h  mxu11x0.c  mxu11x0.h  usb-serial.h     [root@lnx149-252 driver]# make clean     rm -f *.o     rm -f .*.o.cmd     rm -f *.symvers     rm -rf ./.tmp_versions     rm -f mxu11x0.mod*     rm -f .mxu11x0*     rm -f mxu11x0.ko     [root@lnx149-252 driver]# make install       *******************************************************************       # MOXA UPort 1110/1130/1150/1150I USB to Serial Hub Driver v1.2 #       #                for Linux Kernel 2.6.x                           #       #                                                                 #       #               release date : 03/23/2009                         #       *******************************************************************     make -C /lib/modules/2.6.18-194.el5/build SUBDIRS=/root/moxa/mxu11x0/driver modules      make: *** /lib/modules/2.6.18-194.el5/build: No such file or directory.  Stop.     make: *** [module] Error 2     [root@lnx149-252 driver]#      [root@lnx149-252 driver]# uname -a     Linux lnx149-252 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 i686 i386     GNU/Linux     [root@lnx149-252 driver]# uname -r     2.6.18-194.el5     [root@lnx149-252 driver]#      Please help me for a resolution.


What are SSH_TTY and SSH_CONNECTION?

What are the `SSH_TTY` and `SSH_CONNECTION` variables for? On my Ubuntu system both of them are blank; what values should they have?


What is the difference between a linux package and a linux module?

when I do `dpkg --get-selections` or `less /proc/modules` I see two different list. I don't understand the difference between the elements of each...


Processing FreeBSD's PF logs with tcpdump/sed/awk

I'm running FreeBSD and have PF firewall set up and this is command i use to display daily number of firewall hits (blocked traffic)               sudo tcpdump -n -e -tttt -r /var/log/pflog | grep $(date +%Y-%m-%d)|wc -l|sed 's/ *//' >> /home/pentago/www/pf.txt      That displays number, say 95. I want to process pf.txt file in a way that each line has the date before hit count. For example:   * 01-01-2014 - 95    * 02-01-2014 - 98    * 03-01-2014 - 113    * 04-01-2014 - 92 etc.. Simply put, I need sed/awk to prepend the date to each new line of the file. Does that sound reasonable?


using pidof with sh -c

I was wondering why this command line does not print pidof sh               $ sh -c "var=`pidof sh` ; echo \$var; ps -H"      This one prints 123 as expected               $ sh -c "var=123 ; echo \$var; ps -H"      I am on ubuntu linux


Cannot get startX / Xorg to work on freeBSD 8.1

I am following this link for Xorg configuration on FreeBSD 8.1 After this step:               Xorg -config xorg.conf.new -retro      I can see the screen and mouse is also working but I cannot exit out of it any way. I tried `Ctrl`+`Alt`+`Fn`, but it's not working. **Edit:0** Xorg.0.log - http://pastebin.com/bCh53nPR **Edit:2** `xorg.conf.new` http://pastebin.com/WPDnBBQy


Have I installed and started zram successfully?

On my Kubuntu 13.10 laptop, have installed zram by               sudo aptitude install zram-config       and the output of               swapon -s     Filename                                Type            Size    Used    Priority     /dev/sda5                               partition       6150140 0       -1     /dev/zram0                              partition       373300  0       5     /dev/zram1                              partition       373300  0       5     /dev/zram2                              partition       373300  0       5     /dev/zram3                              partition       373300  0       5     /dev/zram4                              partition       373300  0       5     /dev/zram5                              partition       373300  0       5     /dev/zram6                              partition       373300  0       5     /dev/zram7                              partition       373300  0       5      As you can see, /dev/sda5 comes before /dev/zram*, is this setup correct? How can I make sure that zram is working properly?


Tracking from httpd instance to PHP script when PHP is a module

I'm trying to figure out exactly what's going on that kicks CPU usage in random `httpd` workers so high but I'm having a little hard of a time figuring out what PHP page is being requested so that I can try to figure out why it's chewing up CPU. If PHP were done as regular (as opposed to Fast) CGI I could look at the process list, but we're using mod_php. Is there a way to get PHP 5.3 to report performance statistics for currently running scripts? This may also be relevant if we decide to eventually go the `php-fpm` route.


redirecting std output and std error

I have been trying to figure out the relationship between file descriptors. One thing I don't understand is, how is:               ls -l /bin/usr > ls-output.txt 2>&1      different from:               ls -l /bin/usr 2>&1 >ls-output.txt


How soon do new releases get packaged into Debian Testing?

Mono 3.0 has been released yesterday. I am really excited by this release and am curious to know when this will be available in Debian testing (Wheezy). Is there a standard timeline set by Debian project for when the newest release of a software will be made available into Testing or in general any of the branches, except Stable?


Import sql files using xargs

I have a number of sql files to import. For a single file I use the following command: `mysql -u root -p dbname < db.sql` Is it possible to use xargs to bulk import all files? something like: `ls *.sql | xargs ....` I know that mysqlimport is the solution but I want to know if it's possible with xargs or not.


Is ArchBang just Arch Linux + Openbox?

I'm a Arch + KDE guy. I need to reinstall frequently, and I don't like that when I do `pacman -S kde` I have to wait like two hours (slow Internet) without using the PC. So I'm looking for an Arch based distro, but just Arch + a WM or DE; nothing more like Chakra does. Is ArchBang just Arch Linux + Openbox ?


How do I make use of unused space on my boot drive on FreeBSD

I have an old FreeBSD Server (running 7.3-RELEASE) that desperately needs additional storage. In fact, it has some-- the original 20G SCSI drives have been replaced by 300G SCSI drives, so in theory there is 280G available that could be used. I'd like to make use of this space. I think the best way to do this is by formatting the unused space as a new slice on the existing drive, but I'm not clear how to do this without destroying the data on the existing slice. Most of the documentation I can find about doing this refers to initial installation. I know how to set up slices and partitions during initial installation, but not how to claim unused space on the drive AFTER initial installation. (I'd also be happy to expand the slice and add additional partitions to the existing slice, but I've heard that this is riskier). I thought the easy way to do this might be to use /stand/sysinstall, but when I go into either Configure->FDisk or Configure->Label, I get this message:               No disks found!  Please verify that your disk controller is being     properly probed at boot time.  See the Hardware Guide on the     Documentation menu for clues on diagnosing this type of problem.      This is obviously untrue, since I'm actually running off of a disk when I get this message, but maybe sysinstall just doesn't like messing with the boot disk? Output of fdisk da0:               ******* Working on device /dev/da0 *******     parameters extracted from in-core disklabel are:     cylinders=2235 heads=255 sectors/track=63 (16065 blks/cyl)          Figures below won't work with BIOS for partitions not in cyl 1     parameters to be used for BIOS calculations are:     cylinders=2235 heads=255 sectors/track=63 (16065 blks/cyl)          Media sector size is 512     Warning: BIOS sector numbering starts with sector 1     Information from DOS bootblock is:     The data for partition 1 is:     sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)         start 63, size 35905212 (17531 Meg), flag 80 (active)             beg: cyl 0/ head 1/ sector 1;             end: cyl 1023/ head 254/ sector 63     The data for partition 2 is:     <UNUSED>     The data for partition 3 is:     <UNUSED>     The data for partition 4 is:     <UNUSED>      Output of bsdlabel da0s1               # /dev/da0s1:     8 partitions:     #        size   offset    fstype   [fsize bsize bps/cpg]       a:  2097152        0    4.2BSD     2048 16384    89       b:  2097152  2097152      swap       c: 35905212        0    unused        0     0         # "raw" part, don't edit       e:  2097152  4194304    4.2BSD     2048 16384    89       f: 29613756  6291456    4.2BSD     2048 16384    89      Update: I came a cross the advice to use sade for this purpose. Unfortunately, sade can't see much empty space:                        0         63         62        -     12     unused        0             63   35905212   35905274    da0s1      8    freebsd      165       35905275      10501   35915775        -     12     unused        0      This may be a dead end. Do I need to figure out drive geometry somehow? It might be relevant to mention that the drive is a RAID 1 mirror set; originally the mirrored drives were both 20G SCSI drives but they've both been swapped out with 300G drives. I'm willing to temporarily break the mirror if that will help.


Mouse cursor became a big X

Below is a screenshot from Chromium browser, running in Razor-Qt desktop, In other DEs, the cursor is just normal, but here you can see it becomes a big X, anyone know how to fix that? The cursor theme is not broken, as it works for KDE4 and XFCE4 ![enter image description here](http://i.stack.imgur.com/RKLot.png) P.S That happens to all GTK apps, Qt app works fine


Why are logical volumes used with LUKS partitions?

All of the instructions I've seen on setting up a LUKS encrypted drive require using logical volumes to create root and swap partitions inside a LUKS device. Why not just put standard partitions inside with `fdisk` or `parted`? I know that it can be done. I've tried it. But I have no idea how to set up GRUB and initramfs to work with them. And in order to get the partitions to show up (e.g. in `blkid`) I have to run `parted` and remake them. They aren't automatically added to any device list when I open the encrypted device.


What happens in each step of the Linux kernel-building process?

I've read many tutorials about how to build custom kernels and boot Ubuntu using those kernels, and successfully followed the guides and booted custom kernels, but I have no understanding about what each of the command in the guides do and what is actually happening with each command. The procedure described on Ubuntu's site does a lot of work with `fakeroot`, `dpkg`, `make-kpkg`, some initramfs, and other horrible stuff that works but simply does not help me understand what is going on.   * What is the output of `make` in a linux kernel directory?    * Does it create a "compressed kernel image"?    * What is the name of the "compressed kernel image" file and where is it placed?   * What does `make modules` do?   * Should `make modules` be done before or after `make`?   * Doesn't `make` build my modules automatically?   * What is the process (in English, not just the list of commands) of adding newly built kernels to the list of bootable kernels?   * What does `make install` do?   * Will `make install` add it to my list of bootable kernels so that I don't have to do anything more?   * Is there an equivalent `make modules_install`?


To not autoremove something

I have uninstalled my distro's (Debian Wheezy) package of torchat, and use a newer version I've built myself. Since removing the package apt-get wants me to autoremove something which the software I've built still depends on. How do I make it so I never see this warning again?               The following package was automatically installed and is no longer required:        python-socksipy     Use 'apt-get autoremove' to remove it.


awk, sed, grep, perl... which to print out in this case?

I have this syntax in a file (http response times from analog):

seconds	reqs	%reqs	Gbytes	%bytes

0	10927	 0.47%	0.01	 0.18%

<= 0.01	1026471	44.59%	0.11	 1.81%

0.01-0.02	535390	23.26%	0.06	 0.95%

0.02-0.05	93298	 4.05%	0.27	 4.29%
      etc. What I want to be left with is the value for seconds - so 2 characters after "x" and before the first < And also the request length, so 2 characters after "R" and before the next subsequent < Probably not the best exercise to get to grips with regex but that's what I'm stuck with. Any help would be incredibly useful. Expected result:               seconds reqs      0 10927      &lt= 0.01 1026471      0.01-0.02 535390      0.02-0.05 93298


"Short read block" error trying to boot RHEL

I changed my network configurations from static IP to DHCP and removed the DNS entry, etc. Then I rebooted the computer, but am now unable to boot, I get an error message along the lines of "short read block filesystem ext3". How can I fix this?


Wifi connection works but can't connect to internet

I've recently switched to using Slackware 14 on my laptop, so far I'm quite happy with the distro, except for 1 _really_ annoying little thing: I can surf using hotspots, and all sorts of public wifi-access-points, but I can't seem to get on-line at home. Prior to running Slackware, I was using Debian, so yes, my laptop has been on my home network, without mac-spoofing or anything.   Currently, I've setup my wlan interface as `eth1`, and added these lines in my `/etc/rc.d/rc.local`:               wpa_supplicant -B -Dwext -ieth1 -c/etc/wpa_supplicant.conf      Which does the trick, it seems, using something like `wpa_cli` or `wpa_gui`, I can easily connect to my home network.   I therefore changed the wpa_supplicant file a bit, adding:               network={         ssid="HomeSweetHome"         psk=0123464sdasd4d56agr6 #output from wpa_passpharse HomeSweetHome mypassphrase         key_mgmt=WPA2-PSK #and so on     }      But no matter what I do (use settings above, or connect manually) I can connect to other machines on the LAN, but as soon as I try to google something, nothing happens. Constantly "Waiting for siteX" is all I get. Does anybody here have any idea as to what I'm missing here? There _has_ to be something I haven't configured as supposed to here... I can't think of anything ATM, though. _Update:_   Yes, I can `ping 8.8.8.8`, no problem. I can add network locations and share files with the other computers in the network, too. Output of `ifconfig eth1`:               eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500             inet 192.168.1.64  netmask 255.255.255.0  broadcast 192.168.1.255             inet6 fe80::213:ceff:fef1:5267  prefixlen 64  scopeid 0x20<link>             ether 00:13:ce:f1:52:67  txqueuelen 1000  (Ethernet)             RX packets 491  bytes 57950 (56.5 KiB)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 75  bytes 10228 (9.9 KiB)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0             device interrupt 17  base 0x6000  memory 0xdfcff000-dfcfffff        Output of `route -n`:               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         192.168.1.1     0.0.0.0         UG    303    0        0 eth1     127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo     192.168.1.0     0.0.0.0         255.255.255.0   U     303    0        0 eth1      `ping google.com`: All went well, 0% packet loss, on average 20ms/packet. `tcptraceroute` isn't installed at the moment, but I'll set it up in due time. For now, here's the output of `traceroute -n 8.8.8.8`               traceroute 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets      1  192.168.1.1  1.190 ms  1.872 ms  5.465ms      2  192.168.0.1  5.520 ms  5.699 ms  6.960 ms      3  78.21.0.1  15.007 ms  15.850 ms  17.525 ms      4  * * * *      5  213.224.253.9  27.151 ms  28.096 ms  28.146 ms         # And so on, all the way to:     12  * * * *     13  8.8.8.8  17.921 ms  22678 ms  20.022 ms


Configuring a tftp server for multiple clients

I am using a tftp server to hold the boot image for a dev board and the dev board is hard-coded to look at a particular IP address for the server. This all works fine. What I want to do now is be able to set up a second dev board to look at the same IP address for the server, but get a different boot image. I would like to do this by having the tftp server use a different root directory based on the IP address of the client connecting to it. Is there a way to do this? I realize there may be some way to do this with iptables, but I have to turn the firewall on the server machine off entirely for other reasons, so that may not be terribly practical. For reference, I'm using Fedora 15 for the server, but that can be changed if need be.


How to install/make the kernel section 9 manpages which document its functions and data structures?

The kernel sources contain _functions_ and _data structures_ which are documented, for instance in `panic.c`:               /**      *  panic - halt the system      *  @fmt: The text string to print      *      *  Display a message, then perform cleanups.      *      *  This function never returns.      */     void panic(const char *fmt, ...)      Instead of going through the sources every time, it would be useful to view those APIs as _manpages_ and leverage this existing documentation framework. * * * How do you install/make the _kernel section 9 manpages_ (`/usr/share/man/man9`) which document the aforementioned functions and data structures?


Why does 'nohup command >& /dev/null' seem to "work" in some shells?

I edited an answer on Ask Ubuntu that was suggesting the following               nohup gedit >& /dev/null &       When they actually meant               nohup gedit &> /dev/null &       Now, the latter correctly redirects both stderr and stdout to `/dev/null`, I was expecting the former to either create a file called `&` or, more likely, to give an error as it does for other cases:               $ echo "foo" >&      bash: syntax error near unexpected token `newline'      Instead, it seems to work in exactly the same way as the former, a `gedit` window appears and no error message is printed. I should also note that this is shell specific:   * `bash` (4.2.45(1)-release), `zsh` (5.0.2), `csh` (deb package version: 20110502-2) and `tcsh` (6.18.01) : works as described above, no error message, no files created.   * `dash` (0.5.7-3):              $ nohup gedit >& /dev/null &      $ dash: 2: Syntax error: Bad fd number        * `ksh` (93u+ 2012-08-01): fails, but a process is apparently started (`1223`) though no `gedit` window appears:              $ nohup gedit >& /dev/null &      [1] 1223     $ ksh: /dev/null: bad file unit number        * `fish` (2.0.0):              > nohup gedit >& /dev/null &      fish: Requested redirection to something that is not a file descriptor /dev/null     nohup gedit >& /dev/null &                     ^      So, why does this command simply run with no errors (and no output file created) in some shells and fail in other? What is the `>&` doing in the apparently special case of `nohup`? I am guessing that `>& /dev/null` is being interpreted as `>&/dev/null` but why isn't the space causing an error in these shells?


understanding the "chunk size" in context of RAID

Am I correct that _chunk size_ in context of RAID is essentially the same thing as _cluster_ in file-system context? In other words, _chunk size_ is the smallest unit of data which can be written to a member of RAID array? For example if I have a chunk size of 64KiB and I need to write a 4KiB file and cluster size of the file-system is also 4KiB, then is it true that I will use one 64KiB chunk and basically waste 60KiB?


Is there an equivalent of GNU Screen's "log" command in tmux?

I make heavy use of screen's "log" command to log the output of a session to a file, when I am making changes in a given environment. I searched through tmux's man page, but couldn't find an equivalent. Is anyone aware of a similar feature in tmux, or do I have to write my own wrapper scripts to do this? EDIT: I'm aware of 'script' and other utilities that allow me to log a session. The reason that screen's functionality is so useful is the ability to define a logfile variable which uses string escapes to uniquely identify each session. e.g. I have a shell function which, given a hostname, will SSH to that host in a new screen window and set the window title to the hostname. When I start a log of that session, it is prefixed with the window title. If this functionality doesn't exist in tmux, I'll have to create a new set of shell functions to set up 'scripts' of sessions I want to log. This isn't hugely difficult, but it may not be worth the effort given that screen does exactly what I need already.


Install vlc in CentOS 6.4 and embed on web page

I am doing the following: in `/etc/yum.repos.d/`:               $ wget http://pkgrepo.linuxtech.net/el6/release/linuxtech.repo     $ yum install vlc -y      How do I get the player on my web page, because currently with embed tag it is still saying "missing plug in". Is this the best option for playing `stream.cgi`? I am doing all this so I can play `videostream.cgi` from my outdoor wireless network cam, because otherwise I cannot see how to ftp that stream having already tried within admin of camera network, and anyway if I could find a way I still wouldn't know how to convert the rtsp stream.


What does __ prefix before some kernel api's convey?

Why do some function calls in kernel specially have this prefix `__` example: `__init initialization(void)` is `__init` a macro? What does this convey? Are these a special class of function calls inside the kernel or do they resemble any assembly function body present inside? What actually are they trying to represent?


du command gives error and result at the same time

I would like to know the disk space of my VPS, and although for folders `du` works fine as               $ du -sh /home/     325M    /var/      But trying to get the entire vps is giving me this result.               [root@user/]# du -sh     du: cannot access `./proc/18097/task/18097/fd/4': No such file or directory     du: cannot access `./proc/18097/task/18097/fdinfo/4': No such file or directory     du: cannot access `./proc/18097/fd/4': No such file or directory     du: cannot access `./proc/18097/fdinfo/4': No such file or directory     1.3G    .      I am assuming 1.3G is the space, but why does the error happen? How do I fix it?


Again about routing

Have a problem with primitive routing. Have a CentOs with 3 NICs (1 external). I want to confgure forwarding between two internal. Config: eth0 - 192.168.1.105 \ 24 eth1 - 10.10.10.1 \ 25 eth2 - 10.10.10.129\ 25 Clients have a gateway 10.10.10.1 and 10.10.10.129 (depending on subnet) Here is route: ![enter image description here](http://i.stack.imgur.com/XvCw2.png) sysctl.conf net.ipv4.ip_forward = 1 - enabled. When i'm test ping from clients, clients can ping their gateway, other NIC ip(ex. client with ip 10.10.10.10 pings 10.10.10.1(gw) and 10.10.10.129), but cannot ping any client from neighbour subnet. There is the problem?


Error while loading shared libraries: libdl.so.2 (and others), no such file. Libraries exist

Attempting to install a Java application from a .bin file. When opening the installer from command line, I see these errors:               [boxen]# ./ZendStudio-5_2_0.bin      Preparing to install...     Extracting the JRE from the installer archive...     Unpacking the JRE...     Extracting the installation resources from the installer archive...     Configuring the installer for this system's environment...     awk: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory     dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory     /bin/ls: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory     basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory     dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory     basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory     hostname: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory          Launching installer...          grep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory     /tmp/install.dir.7515/Linux/resource/jre/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory      ... The catch is that every one of these objects exist on the system.               # locate libdl.so.2     /usr/lib/libdl.so.2     /usr/lib64/libdl.so.2          # locate libc.so.6     /usr/lib/libc.so.6     /usr/lib/i686/nosegneg/libc.so.6     /usr/lib64/libc.so.6          # locate libnsl.so.1     /usr/lib/libnsl.so.1     /usr/lib64/libnsl.so.1      If I issue this,               echo $LD_LIBRARY_PATH      I get nothing. So, I add include directories to the path:               [boxen]# LD_LIBRARY_PATH=/usr/lib:/usr/lib64/:/usr/local/lib/:/usr/local/lib64/     [boxen]# echo $LD_LIBRARY_PATH     /usr/lib:/usr/lib64/:/usr/local/lib/:/usr/local/lib64/      And re-run the installer...               [boxen]# ./ZendStudio-5_2_0.bin      Preparing to install...     Extracting the JRE from the installer archive...     Unpacking the JRE...     Extracting the installation resources from the installer archive...     Configuring the installer for this system's environment...     awk: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory     dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory     /bin/ls: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory     basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory     dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory     basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory     hostname: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory          Launching installer...          grep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory     /tmp/install.dir.8055/Linux/resource/jre/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory      ... Exact same batch of errors. Installed Java version:               java version "1.7.0_65"     OpenJDK Runtime Environment (rhel-2.5.1.2.el7_0-x86_64 u65-b17)     OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)      Installed glib:               # rpm -qa | grep glibc     glibc-2.17-55.el7.i686     glibc-2.17-55.el7.x86_64     glibc-headers-2.17-55.el7.x86_64     glibc-common-2.17-55.el7.x86_64     glibc-devel-2.17-55.el7.x86_64      What could be causing the installer to not see files that are plainly there and in the environment variable?


Pulseaudio: "virtual" sink just for controlling volume

I got a box that runs XBMC and other media apps, and various apps that play status sounds. I'd like to have two "virtual" sinks (basically just for controlling the volume of a group of applications), one for status sounds and one for Multimedia. I've experimented with various pulseaudio modules, without any success. I know how to assign applications to specific sinks, but how to create this kind of "just change volume and forward to the default sink"-sinks?


Why is minecraft much darker on my Linux side than my Windows side?

I'm using oracle java for both (verified by checking what version of java running process was using). I use an nvidia graphics card. I'm using the latest beta drivers for linux. This is been an issue across 3 different computers with different types of linux (all debian based...Ubuntu, Xubuntu, Lubuntu, and Mint) and different video cards. It's not terrible, but it is quite noticeable. I remember about 3 or 4 years ago was when I first noticed it. EDIT: after taking screenshots and comparing the screenshots in each OS, the game is not any darker or brighter. There must be some sort of color profile going on in linux, because its darker than it should be by a lot. On the moody setting, your view distance is only about 3 to 5 blocks, but unfortunately that aspect isnt captured by screenshot.


Cannot modify files in my home directory

I have a laptop running Ubuntu Server 12.04 and suddenly, yesterday, I don't know what happened, but all the permissions changed of my home directory, so when ever I try to create a file, it says something like:   `mkdir: cannot create directory 'Samba': Read-only file system` Note: This is in my home folder, not in the root folder or many of it's sub folders.


wait does not wait

If i have a file called `myprogram` containing               sleep 200     date      Run this in the background:               $ sh myprogram &      i want to know when `myprogram` has completed by using `wait` command               $ cat >notify     wait PID     echo "Program completed"     $ sh notify &      `PID` is the process ID given from third command, my problem is that the message "program completed" printed on the terminal immediately after the last command,why wait does not wait? , i am using ubuntu 11.10


Piping the output of ls or tree to less loses colors?

`tree` and `ls` can distinct file types by coloring filenames differently. `tree` and `ls` often output a long list of files (including directories), so I pipe the stdout output to `less`. But `less` doesn't preserve the colors. How can we make it show colors, or some alternative ways? Just saw the linked list, but piping to `less -R` or `less -r` doesn't work. My OS is Ubuntu 12.04. `less` is Version 444: 09 Jun 2011.


Parsing the output of date with sed

I am trying to replace the whitespaces in the output of date with '_' with no success.               $date     Fri Sep 14 14:10:04 EDT 2012          $ date | sed 's/ /_/'     Fri_Sep 14 14:10:24 EDT 2012      As you can see, the last command only replaced the first whitespace by a `_`'. Why did it skip the other whitespaces?


Missing libraries in fedora 19

On fedora 19 64bit, which packages should I install for the compilation options -lz and -lcrypto? I am trying to compile git statically. This is the complete error message:               [rubenroy@localhost git]$ make prefix=/home/rubenroy/git-static CFLAGS="${CFLAGS} -static"     LINK git-credential-store     /usr/bin/ld: cannot find -lz     /usr/bin/ld: cannot find -lcrypto     libgit.a(path.o): In function `getpw_str':     path.c:(.text+0xd0b): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking     libgit.a(wrapper.o): In function `xgetpwuid_self':     wrapper.c:(.text+0xeac): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libpthread.a(libpthread.o): In function `sem_open':     (.text+0x67fb): warning: the use of `mktemp' is dangerous, better use `mkstemp'     libgit.a(ident.o): In function `add_domainname':     ident.c:(.text+0x3cc): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking     collect2: error: ld returned 1 exit status     make: *** [git-credential-store] Error 1     [rubenroy@localhost git]$      EDIT: The libraries are installed now, but I still get an error while compiling:               [rubenroy@localhost git]$ make prefix=/home/rubenroy/git-static CFLAGS="${CFLAGS} -static"      LINK git-credential-store     libgit.a(path.o): In function `getpw_str':     path.c:(.text+0xd0b): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking     libgit.a(wrapper.o): In function `xgetpwuid_self':     wrapper.c:(.text+0xeac): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libpthread.a(libpthread.o): In function `sem_open':     (.text+0x67fb): warning: the use of `mktemp' is dangerous, better use `mkstemp'     libgit.a(ident.o): In function `add_domainname':     ident.c:(.text+0x3cc): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(fips.o): In function `FIPSCHECK_verify':     (.text+0x116): undefined reference to `dlopen'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(fips.o): In function `FIPSCHECK_verify':     (.text+0x12d): undefined reference to `dlsym'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(fips.o): In function `FIPSCHECK_verify':     (.text+0x142): undefined reference to `dladdr'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(fips.o): In function `FIPSCHECK_verify':     (.text+0x14e): undefined reference to `dlclose'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(fips.o): In function `FIPSCHECK_verify':     (.text+0x1a6): undefined reference to `dlclose'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':     (.text+0x11): undefined reference to `dlopen'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':     (.text+0x24): undefined reference to `dlsym'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':     (.text+0x2f): undefined reference to `dlclose'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':     (.text+0x334): undefined reference to `dlsym'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':     (.text+0x3f2): undefined reference to `dlerror'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':     (.text+0x464): undefined reference to `dlsym'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':     (.text+0x522): undefined reference to `dlerror'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':     (.text+0x589): undefined reference to `dlopen'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':     (.text+0x5ed): undefined reference to `dlclose'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':     (.text+0x625): undefined reference to `dlerror'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':     (.text+0x6b1): undefined reference to `dladdr'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':     (.text+0x711): undefined reference to `dlerror'     /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':     (.text+0x772): undefined reference to `dlclose'     collect2: error: ld returned 1 exit status     make: *** [git-credential-store] Error 1


How to display all the partitions in a tree-like format (primary, extended and logical)?

I'm trying to find something that resembles the output of `findmnt` but with volumes instead mount-points (example):               TARGET                       TYPE        FSTYPE       sda      ├─sda1                       Primary     ext4     │ └─/     ├─sda2                       Primary     NTFS         ├─sda3                       Primary     ext4      │ └─/boot     └─sda4                       Extended       ├─sda5                     Logical     ext4       │ └─/home       └─sda6                     Logical     ext4         └─/var The show of TYPE and FSTYPE is optional, what interest me more is the tree layout. The output of `lsblk` is somewhat incomplete since it doesn't show the differences between Primary, Extended and Logical partitions. (I know I'm being picky here):               lsblk -a     NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda      8:0    0 186.3G  0 disk      ├─sda1   8:1    0 106.6G  0 part      ├─sda2   8:2    0  52.8G  0 part /media/F66E431C6E42D551     ├─sda3   8:3    0  1023M  0 part [SWAP]     ├─sda4   8:4    0     1K  0 part      ├─sda5   8:5    0   953M  0 part /boot     ├─sda6   8:6    0   487M  0 part [SWAP]     ├─sda7   8:7    0    14G  0 part /     └─sda8   8:8    0  10.5G  0 part /home      I know that `sda4` extended partition includes `sda5`, `sda6`, `sda7`, `sda8` logical partitions; but if I was seeing someone else output I wouldn't know. If instead of `part` and `disk` it saids `pri` `log` and `ext` would be a good alternative, at least I know the relationship. But since all are `part`s... no good. `sudo fdisk -l` output:               Disk /dev/sda: 200.0 GB, 200049647616 bytes     255 heads, 63 sectors/track, 24321 cylinders, total 390721968 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x1549f232             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *          63   223629311   111814624+   7  HPFS/NTFS/exFAT     /dev/sda2       225724416   336437306    55356445+   7  HPFS/NTFS/exFAT     /dev/sda3       223629312   225724415     1047552   82  Linux swap / Solaris     /dev/sda4       336439294   390721535    27141121    5  Extended     /dev/sda5       336439296   338391039      975872   83  Linux     /dev/sda6       338393088   339390463      498688   82  Linux swap / Solaris     /dev/sda7       339392512   368687103    14647296   83  Linux     /dev/sda8       368689152   390721535    11016192   83  Linux          Partition table entries are not in disk order


vi creating a swap files before create a new file

This is a strange problem. the swap file get created for the new files. so, my directory is empty there is no file exist and then when I `vi test.txt` I get the swap file message. It looks like the `vi` create .swp files as crash dump and show me that restore file message.                   nfs setting:         netapp-3240:/vol/vol0/test /testing nfs  rsize=8192,wsize=8192,timeo=14,intr     0 0              [user@rh-test]cat /etc/redhat-release         Red Hat Enterprise Linux Server release 5.9 (Tikanga)              [user@rh-test]ls -la         total 8         drwx------ 2 root root 4096 Nov  8 15:35 .         drwx------ 9 root root 4096 Nov  8 13:59 ..         /testing               [user@rh-test]vi test.txt                   E325: ATTENTION         Found a swap file by the name ".test.txt.swp"                   owned by: rahmed   dated: Fri Nov  8 15:30:06 2013                  [cannot be read]         While opening file "test.txt"                      dated: Fri Nov  8 15:29:59 2013              (1) Another program may be editing the same file.             If this is the case, be careful not to end up with two             different instances of the same file when making changes.             Quit, or continue with caution.              (2) An edit session for this file crashed.             If this is the case, use ":recover" or "vim -r test.txt"             to recover the changes (see ":help recovery").             If you did this already, delete the swap file ".test.txt.swp"             to avoid this message.              Swap file ".test.txt.swp" already exists!         [O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:              [user@rh-test]ls -la         total 8         drwx------ 2 root   root          4096 Nov  8 15:39 .         drwx------ 9 root   root          4096 Nov  8 13:59 ..         -rwx------ 1 user   sysadmins    0 Nov  8 15:39 .test.txt.swo         -rwx------ 1 user   sysadmins    0 Nov  8 15:39 .test.txt.swp      of course if I create a file by echo then no swap file.                   [user@rh-test]echo "this is test file" > test.txt              /testing         [user@rh-test]ls -la         total 8         drwx------ 2 root   root          4096 Nov  8 15:29 .         drwx------ 9 root   root          4096 Nov  8 13:59 ..         -rwx------ 1 user   sysadmins   18 Nov  8 15:29 test.txt      The output of `:set dir` is `directory=.,~/tmp,/var/tmp,/tmp` Please note that this is only happening on this nfs mount `/test`. the other local and nfs mounts on same system not having this issue. mount options: `netapp-3240:/vol/vol0/test on /testing type nfs (rw,rsize=8192,wsize=8192,timeo=14,intr,addr=10.200.23.22)` **After changing to nfsvers=2 it is starting working** nfsvers=2 or nfsvers=3 — Specifies which version of the NFS protocol to use. This is useful for hosts that run multiple NFS servers. If no version is specified, NFS uses the highest supported version by the kernel and mount command. This option is not supported with NFSv4 and should not be used. `netapp-3240-2:/vol/vol1/testing on /test type nfs (rw,rsize=16384,wsize=16384,intr,nfsvers=2,addr=10.200.23.22)` ** ##  Resolved: ###  This issue was related to NetApp option not set correctly. In order to resolve this we had to set this option on NetApp `options cifs.ntfs_ignore_unix_security_ops on` on NetApp.**


How to set xscreensaver to use blank mode without GUI?

After installing `xscreensaver` in Arch Linux my laptop has started displaying fancy, battery-depleting animations when nobody is looking. How do I configure this to use the `blank` mode via the command line (i.e., without `xscreensaver-demo`)?


Run Script once a day with systemd

I want to run a backup script 10 minutes after booting up my machine but only once a day. Is it possible to build up such scenarios with systemd?


Globbing with * in Bash - Debian vs RHEL

Where is the difference? Do these distributions handle globbing differently? Platforms: Debian Wheezy 7, Red Hat Enterprise Linux 7. Bash is always used. In my example, `cat` prints every file in `/etc` via `stdout` while output via `stderr` is discarded. Wildcard `*` is supposed to represent every file name. There can only be a single match. So the command should print a single line. On RHEL it does, but on Debian it does not because the result is preceded by `No such file or directory`.   * As anticipated, these commands search in /etc, on both platforms:              (Debian|RHEL)# cat $(find /etc/ ) 2>>/dev/null | grep MatchThisString     (Debian|RHEL)# cat $(find /etc/ -name "*") 2>>/dev/null | grep MatchThisString     (Debian|RHEL)# cat $(find /etc/ -name *) 2>>/dev/null | grep MatchThisString        * However, on Debian, the * wildcard is not understood. On RHEL, it works as expected.              Debian# cat $(find /etc/ *) 2>>/dev/null | grep Match     find: `*': No such file or directory     MatchThisString      * * * EDIT: My original question is answered: `*` is matched itself. New question, more specific: find * looks for a file named “*” on Debian but not on RHEL.


Recovered deleted files on Mac by command line

I accidentally deleted a file by running:               rm -rf ./Desktop/myScript.sh      I think it's possible to recover the file, because the `rm` command removes temporarily. How can I recover the deleted file on Mac OSX?


What user installs a .deb package?

I am experiencing a behavior in the installation of a _.deb_ package that I don't really understand. I have a set of "things" in my computer that I deploy to remote computers using a _.deb_ package. I work in my local machine logged as the user "`borrajax`". There's also a "`borrajax`" user in the remote machine where I install my _.deb_. When I need to deploy my "things", I create a _.deb_ package in my machine (with `sudo dpkg --build`), copy it to the remote machine and install it with `sudo dpkg -i myPackage.deb` . When I do that, the "expanded" (or installed) files become owned by the local user `borrajax`, which is good. Now, I have a coworker that also tries to do the same thing but he is logged in as a different local username (he doesn't have a `borrajax` user in his machine, but... `foobar` - I guess his parents didn't like him much-). He follows exactly the same process I do with my local user `borrajax` but with his local `foobar` user: Create the `.deb` in his machine, copy it to the remote machine and install it with `dpkg -i`. Well... In that case, the installed files become owned by `root`, which prevents the installation to continue (which is not a bug, but a feature). All these machines are Ubuntu (11.10 mine, 12.04 the remote one and my coworker's one) so what I would like is the package become installed with whatever user has the uuid 1000. I would expect the name not to be so relevant (It may be just a coincidence there's a `borrajax` user in my machine and in the remote one). So in this case, the username seems very relevant. Why is that? As I mentioned earlier, my local user `borrajax`, my coworker's `foobar` and the `borrajax` in the remote machine are all the uid=1000. Why does the user's name (seem to be) so important? My local `borrajax` user may not have anything to see at all with the `borrajax` in the remote machine. If the package was created by the user with uid 1000, why "sometimes" (if I've created it) it is installed with whatever user has the uid 1000 in the remote machine and "sometimes" it's installed with root (if my coworker has created it)? I can always change the owner of the installed files using `chown 1000` in the postint script, or use some other kind of workaround but I would like to understand first why is this happening, and how is it that the username in two different machines seems so important? Thank you in advance


How can I switch 2 characters in vi?

I like the fact that I've memorized `d``d``p` for switching two lines (i.e. `d``d` deletes the line and then `p` puts it back '1 higher'). Is there are similar set of keystrokes for switching 2 characters so that `wsih` would become `wish`?


I'm failing to restore a VirtualBox VM

I am trying to restore a VM but I get this error message: ![enter image description here](http://i.stack.imgur.com/SOuax.png) I think this happened because, while the VM was live, I removed one snapshot. How do I fix this, short of restoring older snapshots? **NOTE** : This problem happens when I use version **4.0.4**. Version **3.2.10** allows me to delete a snapshot of a VM, even though it's live. I guess it's a regression... watch me downgrading.


GRUB error 15, no boot menu nor /boot

I am have a fully updated Arch Linux system that was running fine. Last night I tried to setup autofs per instructions on the Arch wiki, but upon restart there was no boot menu and only a GRUB error message saying "Error 15". (1) Using Ext2explore in Windows, I can see the following partition structure: ![partitions from Windows](http://i.stack.imgur.com/wbnz1.png) (2) Using fdisk in an ArchLinux live cd, I can see this: ![partitions from Arch live cd](http://i.stack.imgur.com/ICI00.png) (3) I tried to do "fdisk /dev/sda/" then the commands x, f, w to correct error, but fdisk says my partitions' "ordering is correct already" (4) Using the root and setup commands in the GRUB shell also ended in failure (it tells me it can't find GRUB files, /boot/grub/, etc. etc.). Specifically, I tried "root (hd0,1)", then "setup (hd0)", (also hd0,0, hd0,2, etc.), all failed. Is there any hope of restoring my system? Thanks for your help. P.S. here is my menu.lst, which can be seen in Ext2explore:               # Config file for GRUB - The GNU GRand Unified Bootloader     # /boot/grub/menu.lst          # DEVICE NAME CONVERSIONS      #     #  Linux           Grub     # -------------------------     #  /dev/fd0        (fd0)     #  /dev/sda        (hd0)     #  /dev/sdb2       (hd1,1)     #  /dev/sda3       (hd0,2)     #          #  FRAMEBUFFER RESOLUTION SETTINGS     #     +-------------------------------------------------+     #          | 640x480    800x600    1024x768   1280x1024     #      ----+--------------------------------------------     #      256 | 0x301=769  0x303=771  0x305=773   0x307=775     #      32K | 0x310=784  0x313=787  0x316=790   0x319=793     #      64K | 0x311=785  0x314=788  0x317=791   0x31A=794     #      16M | 0x312=786  0x315=789  0x318=792   0x31B=795     #     +-------------------------------------------------+     #  for more details and different resolutions see     #  http://wiki.archlinux.org/index.php/GRUB#Framebuffer_Resolution           # general configuration:     timeout   5     default   0     color green black          # boot sections follow     # each is implicitly numbered from 0 in the order of appearance below     #     # TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.     #     #-*          # (0) Arch Linux     title  Arch Linux     root   (hd0,0)     kernel /vmlinuz26 root=/dev/disk/by-uuid/f4c13c68-54e4-4631-8a5a-d1649d5c3b02 ro vga=771     initrd /kernel26.img          # (1) Arch Linux     title  Arch Linux Fallback     root   (hd0,0)     kernel /vmlinuz26 root=/dev/disk/by-uuid/f4c13c68-54e4-4631-8a5a-d1649d5c3b02 ro     initrd /kernel26-fallback.img          # (2) Windows     #title Windows     #rootnoverify (hd0,0)     #makeactive     #chainloader +1      I tried the solution provided in the first answer, but failed with the following output: ![Can't install Grub after chroot](http://i.stack.imgur.com/SCBAd.png) Also notice that menu.lst is not there, even though it appeared when I examined the partition in Ext2explore. Also, here are the contents of /etc/fstab: ![fstab](http://i.stack.imgur.com/6nLEn.png)


How to enable flash on Chromium

How do you get Adobe's flash video to play on Chromium? Is it this painful, or is there somewhere an extension? **NOTE** : On Debian, I install **flashplugin-nonfree** for Mozilla-based browsers. Is there an equivalent package for Chrome? **UPDATE** : I needed to re-install **flashplugin-nonfree** for this to work.


How is the linux graphics stack organised?

Can anybody explain(hopefully with a picture), how is the linux graphics stack organised? I hear all the time about X/GTK/GNOME/KDE etc., but I really don't have any idea what they actually do and how they interact with each other and other portions of the stack. How do Unity and Wayland fit in?


Why do new terminals in Awesome spawn with SHLVL>1?

I have a `PS1` which shows the SHLVL if it's not 1 to quickly see if I'm in a subshell. This works as expected when using GNOME, but when I spawn a new terminal in Awesome WM (`Mod4`+`Return`) it always starts with `SHLVL=2` or higher. Is this normal? This is directly related to the number of times I have restarted Awesome (`Mod4`+`Ctrl`+`r` or `pkill -HUP awesome`). Is there some way to avoid spawning new shells when restarting? These commits seem to be relevant, since Awesome ends up running something like `$SHELL -c ...` on `HUP`, but I don't know enough C to fix it. My `/bin/sh` is `dash` and my login shell is `bash`. Reported the issue.


Does Bash have similar features such as Fish's autosuggestions and highlighting?

I recently noticed 2 features in Fish and was wondering if anyone knew if these were also available in Bash? ### Syntax highlighting ![ss #1](http://i.stack.imgur.com/IeSEw.png) Specifics:   * You'll quickly notice that fish performs syntax highlighting as you type. Invalid commands are colored red by default:   * A command may be invalid because it does not exist, or refers to a file that you cannot execute. When the command becomes valid, it is shown in a different color   * fish will underline valid file paths as you type them   * This tells you that there exists a file that starts with 'somefi', which is useful feedback as you type. ### Autosuggestions ![ss #2](http://i.stack.imgur.com/peyTN.png) Specifics:   * fish suggests commands as you type, and shows the suggestion to the right of the cursor, in gray.   * It knows about paths and options   * To accept the autosuggestion, hit right arrow or Control-F. If the autosuggestion is not what you want, just ignore it.


What are the recommended ways of defending a remote *nix install from a hamfisted admin?

Once in a while (often a long while), I have a difficulty where I execute a command that completely screws up a Linux machine. Most recently, I accidentally mounted-again the root partition (thinking it was the new USB drive I had just formatted), and then proceeded to recursively chown the partition to myself (again, just trying to grant myself user-access to the USB drive). As soon as I realized what I had done (in mid-progress), I aborted it, but the damage was done. Many core programs were no longer root owned, so the machine was essentially in a zombified state. Some user functions (ssh, rsync) still functioned, but administration level stuff was totally locked-out. Couldn't mount, umount, reattach to screen sessions, reboot, etc. If the machine were in the living room here with me, "repairing" it (reinstall) would have been trivially easy. But it isn't. It is in my brother's house. He's not big on me walking him through repairs/reinstall, and I understand that. So, I'm going over in a few days to fix the damage I did (and hopefully install something more admin-screwup-resistant). I say all that to ask the question: What are the recommended ways of hardening an install against admin-hamfistedness? Things not considered, or considered and dropped quickly:   1. Harden the administrator to not execute stupid commands: A great idea, but won't work, because as a human, I occasionally will do things that I realize after-the-fact are a bad idea. What I'm looking to do is out-think myself in advance, so when I do something stupid, the machine will refuse, and I'll realize "Oh crap! That could have been Very Bad (TM)! Let's not do that again." Things I've considered:   1. Mount the root partition read-only: Would protect the root from changes, which might have negative affects if parts are expected to be writeable, and aren't. Also wouldn't necessarily protect the partition from being mounted again somewhere else as read-write.   2. Use a compressed-readonly root image of some sort with a union-like writeable layer above it so no changes are ever really made to root, and a reboot clears any screw-ups: This would be OK/good if no changes ever need to be made to root, and maybe /etc could be reloaded/populated from a persistent file somewhere else.   3. Use btrfs with regular (daily, maybe) snapshots, so that if an error is made, recovery is easier: Might still be sub-optimal as it would require direct user intervention, and I don't know that I could walk someone else through the changes to roll back the oops.   4. Use a more "live"/"embedded" Linux/BSD distro designed more with stability/predictability/security in mind instead of a more generic distro As things stand now, I'm likely to use option 4 to install a somewhat more limited system than the full Debian install I had been using. But as just a file server and torrent client, it should work fine, and as a remote machine, defending the machine from myself is a pretty big asset.


Empty XFCE Applications menu

After installing one application that put its launcher in the wrong menu category I decided to relocate it to its correct category. To this effect I edited the Applications menu (`right click on it -> Properties -> Edit menu`). After making little changes to the menu its entries disappeared and now looks like shown in the following image: ![No entries in the main XFCE menu](http://i.stack.imgur.com/y3KJU.png) I have looked at the instructions in the XFCE Wiki and I'm supposed to do:               # cp ~/.cache/xfce4/desktop/menu-cache-name-of-the-generated-file.xml ~/.config/xfce4/desktop/menu2.xml     # cd ~/.config/xfce4/desktop/     # cat menu.xml > menu3.xml     # cat menu2.xml >> menu3.xml     # mv menu.xml menu.orig.xml     # mv menu3.xml menu.xml      but there's no `~/.cache/xfce4/desktop/` directory in my computer. What can I do to restore the main applications menu? PS: I'm using Ubuntu 10.10 Maverick Merkat with XFCE.


How can I block a network with lighttpd?

I already block some simple ip lighttpd but I want to block a whole network. I've problem to understand what is this network address for example 10.0.0.0/8 and/or 172.16.2.0/24 network? What is this /8 or /24 means? I use $HTTP["remoteip"] to add my ip I want to deny the access.


How to remotely check if apache server responds

I have 2 servers. one of them often crashes. I want to send a SMS to my phone when it crashes. I wrote this simple bash script in another server and put it in crontab to run every 10 minutes.               wget --spider http://mywebsite.com || php sendsms.php      Is this the right way? sometimes I get SMS, but I see that server is running without any problem.


What is the difference between which and where

What is the difference between `where` and `which` shell commands? Here are some examples                ~  where cc     /usr/bin/cc     /usr/bin/cc     ~  which cc     /usr/bin/cc      and                 ~  which which     which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'     /usr/bin/which       ~  which where     /usr/bin/which: no where in (/usr/local/bin:/bin:/usr/bin:/home/bnikhil/bin:/bin)      also                 ~  where which     which: aliased to alias | /usr/bin/which --tty-only --read-alias --show-dot      --show-tilde     which: shell built-in command     /usr/bin/which     /usr/bin/which       ~  where where     where: shell built-in command      To me it seems that they do the same thing one being a shell builtin, not quite sure how that is different from a command?


What does it mean to be in group 0?

Several users in a system I inherited have their group set to 0 in /etc/passwd. What does that mean? Do they essentially get full root privileges? The system is running CentOS 5, and the users appear to be primarily system- related things, although a former administrator is also in that group: > >     $ grep :0: /etc/passwd >     root:x:0:0:root:/root:/bin/bash >     sync:x:5:0:sync:/sbin:/bin/sync >     shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown >     halt:x:7:0:halt:/sbin:/sbin/halt >     operator:x:11:0:operator:/root:/sbin/nologin >     jsmith:x:500:0:Joe Smith:/home/jsmith:/bin/bash >     $ >


Which tasks/commands can't be executed with user gid=0 but not uid=0 on Linux

In a Linux server I will have an user with gid=0 but it's uid won't be 0. As there are many commands with root:root and execute permissions for group I know there will be a lot of administrative task that this user can't do because many programs checks at start if UID=0 Anyone knows what commands/tasks can't do a user with UID!=0 and GUID=0? That user could mount filesystems or change passwords...? For example, the user can't read messages as it has only read permissions for root owner. I know the question is open. Many thanks!


best practice to backup config files

I want to setup froxlor on not fresh install remote server (Ubuntu 10.04.2). I take care of admin the server since two month. Before I start, the previous guy installed and config some services and files. I don't know what he exactly does, I can only view what he installed (by the history) but not what he edit. I want to install the Server-Management-Panel 'Froxlor' to administrate the whole stuff with it and not doing it manually by ssh. My cousin (he rent the server) should also be able to config some stuff with the browser. These services already installed and configured and used   * apache 2 + php 5 + mysql 5.1   * proftp 1.3   * postfix 2.7 + courier 0.62 The tutorials I found, are based on fresh install system. I already installed froxlor, but for using it I have to execute some scripts and change/overwrite the config files of the services. But if I do it, the current configurations will be lost. **What's the best practice to backup the configs as simple as possible** (with less effort and problems) and configure froxlor and then merge the backuped files. Which data / config files I have to backup?


Best language to write linux services

I want to create a crawler that scans one single web page and sends me an email in case something is wrong on the page (the page holds some webservers' status - Up/Down). What would be the best language to write such a service in? I've considered PHP or Python, but as they are interpreted languages (+PHP has a max time limit that a script runs), I don't think they're the best fit for this. Also, C/C++ is not an option. I was thinking about Java, since it has Threading and I may need it, but I'm not sure.


Using Trash with Mutt: Does it make sense?

I come from Thunderbird, which I found to be bloatware with spontaneous hiccoughs using 20–40% of processing power, weak IMAP and local mailfolder handling and a constant 100–500MB of RAM use. But it moved every deleted message to the Trash folder instead of purging directly. Since I’m unsure if you really need that (mutt has the `marked deleted` stage), are there any experienced mutt users that can answer? Especially: Have you experienced loss of mail you first thought was unnecessary to archive but was not and gone? I normally don’t double-check before purging. Do you? (Statement aside: Mutt (with `offlineimap`, `msmtp` and 10 accounts) is by far the hardest program I ever had to configure. I am a Vim user on Archlinux…) Edit (for purpose of documentation): To set up a trash with Mutt, there basically are two possibilities:   1. Doing it via macro:              macro index D \     "<save-message>+/ACCOUNT/Trash<enter>" \     "move message to the trash"        2. Installing the patch.


Changing Redhat Network Settings From DHCP to STATIC IP Via Configuration Files

In order to make the statically assigned IP work, I have already modified the file /etc/sysconfig/network-scripts/ifcfg-eth0 as follows:               DEVICE=eth0     IPADDR=10.33.17.143     NETMASK=255.255.255.0     BOOTPROTO=static     ONBOOT=yes      Any other configuration files that I might need to take care of before the static IP could be used? I am trying to change the network settings from the default DHCP to static IP.


Linux Mint - Cairo Dock freezes when removing an item

I have installed Cairo Dock on Linux Mint which works great except when I go to remove an item from the dock it freezes. This is because I haven't confirmed the removal of the button from the dialog box. as per this page - http://glx-dock.org/bg_topic.php?t=6145 The problem is 90% of the time I have absolutely no idea where this dialog box is. Sometimes (rarely) it will show on top of all my open applications and I click "Yes" and we go happily on our way, but usually it won't show, and minimizing all applications doesn't reveal it. I've even tried removing an item from the dock with no applications open at all and the dialog box won't show even on top of the desktop. Any ideas?


Managing iptables for home lan routing

I have a LAN at home.   * One Netgear router - 192.168.0.1 connected to the internet.   * One Macbook - 192.168.0.10 (connected to Netgear router)   * One PC with Kali Linux - 192.168.0.20 (connected to Netgear too) I'm trying to route all Macbook traffic through the PC. So I set the network settings on my Macbook proxy-server address - 192.168.0.20 (PC). I have no problems with this - all packets go to the PC (through Netgear router of course). Its okay. but.. How to manage the NAT table on Linux to route Macbook's traffic to the router (and so to the internet)? I tried to do something like this, but it doesn't work correctly:               iptables -t nat -A PREROUTING -s 192.168.0.10 -j DNAT --to-destination 192.168.0.1     iptables -t nat -A POSTROUTING -s 192.168.0.10 -j SNAT --to-source 192.168.0.20      with this settings I have BAD REQUEST 400 in my browser on Mac.


Configure webserver for compression

Based on this page: http://code.google.com/speed/page- speed/docs/payload.html#GzipCompression I need to enable compression on my website, but I have no idea how to do this. If this is the right stackexchange page for me to ask this question, could you please help me do this setup?


Snapshot large changing files

At home I have the following backup scheme: All machines daily rsync to the servers $FULL_COPY directory. The server takes snapshots of that directory daily (also weekly/monthly), keeping at most X snapshots. Also using rsync:               rsync -ar --link-dest=$LATEST_SNAPSHOT $FULL_COPY $NEW_SNAPSHOT      This works great, files not changed since last snapshot get hard linked. The problem is large files (to be precise Thunderbird's inbox), a small change means an entire copy of the file. My snapshots are easily a couple of GB, but maybe only a few MB has changed. Is there a smarter way to do this? (my $FULL_COPY is also replicated on a remote machine, so I'm not in need of this redundancy). My only idea is a CoW filesystem supporting snapshots. But that would mean major surgery on my system which I'm not fond of.


A Chromebook-like distro based on Firefox OS?

I'm wondering if it's possible to make an operating system distro based on the same principle as Firefox OS or ChromeOS. One which is basically a Gnu/Linux kernel / core of tools combined with Mozilla's "Boot2Gecko" stack of Gonk / Gecko / Gaia (https://wiki.mozilla.org/B2G/Architecture) and which runs apps written in HTML5 / javascript. I want this as something I can boot from a pendrive or install on an ordinary laptop (not for a mobile-phone). Does anyone know if there's currently a project to make this? Or, if not, what would be involved in trying to put one together? (Using B2G + http://www.linuxfromscratch.org/ etc.)


How exactly do people "crack" Unix/Linux Systems?

No im not looking to become a cracker or something like that, but Im trying to figure out the process (more from a programming perspective). So im assuming (guessing) a cracker's main goal is to gain root access to install whatever software (or script) he's written up right? or maybe installing their own kernal module (thats devious for whatever reason) How exactly does a person go about doing this? I know people use scripts to check for exploits......but I don't see how, and I also don't exactly see what they do with them once they find them? Are they checking versions for known exploits......and then once they find one....... I know this all sounds very newbish. but im just trying to get an idea of how it works since I know Linux/Unix systems are supposed to be very secure but im trying to figure out how someone would even go about (the process) of gaining root access.


Debian (Gnome): unable to login

I am new to Linux, installed Gnome, and unable to login, as only root is set, and disabled, I think after reading on the Internet. Now how do i get back to the command line, at least so I can deal with that and fix my issues from there? I am unable to bypass the Gnome login screen.


Should you run automatic updates

I'm running production Centos web servers. I want to know what is best practice for running updates. Should I automate this with yum-cron or yum- updatesd? Or is there a danger of updates breaking sites so it would be better to update on a test server and then run updates manually weekly? The majority of the servers are using only the official repositories but some have the atomic repository for PHP modules that are not available otherwise. What's best in this case? can I set yum to only use Atomic for the PHP modules ? I don't want everything updating to the bleeding edge stuff in Atomic, I would trust rather Centos (or really Red Hat) to keep my servers stable and secure.


Why do I get an "rsync: failed to set times on ... : Operation not permitted (1)" error on Ubuntu 10.10 with SME Server 7.4?

I am trying to cron an rsync via ssh between two fileservers that are running SME Server 7.4 and Ubuntu 10.10, respectively. The first rsync worked just fine (for reasons that I do not know), but now, well... here's the output:               [i@i-drive ~]$ rsync -avz -e ssh /home/e-smith/files/ibays/drive-i/files/Warehouse\ Pics/* fm-backup@[hostname removed]:~/img_all/     sending incremental file list     Converted Warehouse Pictures/     rsync: failed to set times on "/home/fm-backup/img_all/Converted Warehouse Pictures": Operation not permitted (1)     Converted Warehouse Pictures/12903-13099/     rsync: failed to set times on "/home/fm-backup/img_all/Converted Warehouse Pictures/12903-13099": Operation not permitted (1)     Converted Warehouse Pictures/12903-13099/13038/     rsync: recv_generator: mkdir "/home/fm-backup/img_all/Converted Warehouse Pictures/12903-13099/13038" failed: Permission denied (13)     *** Skipping any contents from this failed directory ***     Converted Warehouse Pictures/30500 - 30600/30677/     rsync: failed to set times on "/home/fm-backup/img_all/Converted Warehouse Pictures/30500 - 30600/30677": Operation not permitted (1)     Converted Warehouse Pictures/30500 - 30600/30677/P1430928.JPG     Converted Warehouse Pictures/30500 - 30600/30677/P1430929.JPG     rsync: mkstemp "/home/fm-backup/img_all/Converted Warehouse Pictures/30500 - 30600/30677/.P1430928.JPG.8SDmeO" failed: Permission denied (13)     rsync: mkstemp "/home/fm-backup/img_all/Converted Warehouse Pictures/30500 - 30600/30677/.P1430929.JPG.qEfwpI" failed: Permission denied (13)     Converted Warehouse Pictures/30900 - 31000/     rsync: recv_generator: mkdir "/home/fm-backup/img_all/Converted Warehouse Pictures/30900 - 31000" failed: Permission denied (13)     *** Skipping any contents from this failed directory ***     Converted Warehouse Pictures/Tiff's Folder/     rsync: failed to set times on "/home/fm-backup/img_all/Converted Warehouse Pictures/Tiff's Folder": Operation not permitted (1)     Converted Warehouse Pictures/Tiff's Folder/IMG_3474.JPG     Converted Warehouse Pictures/Tiff's Folder/IMG_3475.JPG     Converted Warehouse Pictures/Tiff's Folder/IMG_3476.JPG     rsync: mkstemp "/home/fm-backup/img_all/Converted Warehouse Pictures/Tiff's Folder/.IMG_3474.JPG.aBPfwH" failed: Permission denied (13)     rsync: mkstemp "/home/fm-backup/img_all/Converted Warehouse Pictures/Tiff's Folder/.IMG_3475.JPG.4rQNSM" failed: Permission denied (13)     rsync: mkstemp "/home/fm-backup/img_all/Converted Warehouse Pictures/Tiff's Folder/.IMG_3476.JPG.EpQJkY" failed: Permission denied (13)     Unconverted Warehouse Pictures/PANA 1430200/Thumbs.db     Unconverted Warehouse Pictures/PANA 1430300/     rsync: failed to set times on "/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430300": Operation not permitted (1)     Unconverted Warehouse Pictures/PANA 1430300/Thumbs.db     Unconverted Warehouse Pictures/PANA 1430400/     rsync: failed to set times on "/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430400": Operation not permitted (1)     Unconverted Warehouse Pictures/PANA 1430400/Thumbs.db     Unconverted Warehouse Pictures/PANA 1430500/     rsync: failed to set times on "/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430500": Operation not permitted (1)     Unconverted Warehouse Pictures/PANA 1430500/Thumbs.db     Unconverted Warehouse Pictures/PANA 1430600/     rsync: failed to set times on "/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430600": Operation not permitted (1)     Unconverted Warehouse Pictures/PANA 1430600/Thumbs.db     Unconverted Warehouse Pictures/PANA 1430700/     rsync: failed to set times on "/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430700": Operation not permitted (1)     Unconverted Warehouse Pictures/PANA 1430700/Thumbs.db     Unconverted Warehouse Pictures/PANA 1430800/     rsync: failed to set times on "/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430800": Operation not permitted (1)     Unconverted Warehouse Pictures/PANA 1430800/Thumbs.db     Unconverted Warehouse Pictures/PANA 1430900/     rsync: failed to set times on "/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430900": Operation not permitted (1)     Unconverted Warehouse Pictures/PANA 1430900/Thumbs.db     Unconverted Warehouse Pictures/PANA 1440000/     rsync: failed to set times on "/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1440000": Operation not permitted (1)     Unconverted Warehouse Pictures/PANA 1440000/Thumbs.db     Unconverted Warehouse Pictures/PANA 1440100/     rsync: failed to set times on "/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1440100": Operation not permitted (1)     Unconverted Warehouse Pictures/PANA 1440100/Thumbs.db     Unconverted Warehouse Pictures/PANA 1440200/     rsync: failed to set times on "/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1440200": Operation not permitted (1)     Unconverted Warehouse Pictures/PANA 1440200/Thumbs.db     rsync: mkstemp "/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430200/.Thumbs.db.IRLwfB" failed: Permission denied (13)     inflate returned -3 (0 bytes)     rsync error: error in rsync protocol data stream (code 12) at token.c(546) [receiver=3.0.7]     rsync: connection unexpectedly closed (8118 bytes received so far) [sender]     rsync error: error in rsync protocol data stream (code 12) at io.c(601) [sender=3.0.7]      (Note: Trust me, I know that TRWTF is the terrible and horrible way that the directory is organized. That's another project for another day.) Neither account is root, and I don't want to have to make the accounts root for this to work. i@i-drive rsyncs just fine to my OSX fileserver, and from the same folder, even. The account on the OSX box isn't root, either.


I encountered the error when attempting to transfer source files from a remote Linux web server to a local HP dt1000i Desktop Hard Drive connected to an Ubuntu 12.10 box via USB. A Samba share is configured for the HP drive to enable the Windows machines on my LAN to access the files. Samba was set up using the built-in graphical folder sharing functionality within Ubuntu. I can modify the files fine in Windows, but problems occur using `rsync`. When the error occurred, I was trying to use `rsync` to backup files from my web space to the HP drive. I executed the `rsync` command in PuTTY from a Windows 8 machine on my LAN: `rsync -avz --progress --partial -e 'ssh -p 2222' user@www.example.com:/home/user/ /media/HPDesktopDrive/Backup/HostGator/` This resulted in the following error: `rsync: failed to set permissions on "/path/to/file.txt": Operation not permitted (1)`. I thought the source of the error was the mount options for the HP drive in the `/etc/fstab` file: both the `user_id` and `group_id` options were set to zero so I tried change them to `1000` as per the advice in NAS box mounted via CIFS - problem with permissions. An `ls -la` of the Samba share reports that the user and group are recursively set to `root:root`. I tried to address this by executing `sudo chown -R mike:mike /media/HPDesktopDrive/`, but the files are still set to `root:root`. What is the correct command to change the permissions from my Windows machine via PuTTY and will this address the problem?


Why when I enter the command "hostname" it returns something other than my computers name?

_I am using a macBook Pro_ I enter: `new-host-2:~ Justin$ hostname` And it returns: `new-host-2.home` Why is this when it says in setting/sharing my computers name is "Justin's macbook pro" and computers on my local network can access my computer at "Justins-MacBook-Pro.local" The tutorial I am reading says that the command should return one of the "many" names of your computer, I am assuming this is one, but if it is where else on my computer can I find this name or a list of names for my computer? And why did it not return "Justins-MacBook-Pro.local", this format was what the tutorials computer returned?


Is it possible to change the sector size of a partition for zfs raidz pool in linux?

I've been migrating a zfs raidz pool on linux to new discs via virtual devices which were sparse files. I've used partitions on the discs as the discs are different sizes of 1.9T each. The last disc to add is a 4Tb disc and I partitioned it as the others with a 1.9T partition to add to the pool. It's using a GPT partition table. When I try to replace the last file with the 1.9T partition on the 4T disc I get the following               zpool replace -f zfs_raid /zfs_jbod/zfs_raid/zfs.2 /dev/sdd1      cannot replace /zfs_jbod/zfs_raid/zfs.2 with /dev/sdd1: devices have different sector alignment      How can I change the partition sector size to be 512 like the others, or failing that is it possible to change the other pool devices to 4024 ? Apparently the logical sector sizes are all 512               cat /sys/block/sdd/queue/hw_sector_size     Disk /dev/sdd: 4000.8 GB, 4000787030016 bytes, 7814037168 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      As I have repartitioned the disc that contained the original 4th file based device that I'm trying to replace but it didn't work, I recreated the device file so it's currently resilvering that. zpool status output:               NAME                            STATE     READ WRITE CKSUM     zfs_raid                        DEGRADED     0     0     0       raidz1-0                      DEGRADED     0     0     0         sda3                        ONLINE       0     0     0         sdc2                        ONLINE       0     0     0         sdb1                        ONLINE       0     0     0         replacing-3                 OFFLINE      0     0     0           /zfs_jbod/zfs_raid/zfs.2  OFFLINE      0     0     0           /mnt/butter2/zfs.4        ONLINE       0     0     0  (resilvering)


How to disable SMTP auth plain for Citadel 8.20 on Slackware 14.0?

How do I turn off SMTP AUTH PLAIN for Citadel 8.20 on Slackware 14.0? If I set up postfix to handle SMTP would this allow me to not have SMTP auth plain enabled


My HFS+ (hfsplus) partition won't mount with exec permissions

I'm dual-booting an old MacBook Pro with OS X 10.5 and Ubuntu Studio 13.04. I've partitioned my internal SATA drive as follows:               /dev/sda1: LABEL="EFI" UUID="3F3C-1AF6" TYPE="vfat" (EFI Boot Partition)     /dev/sda2: UUID="b5ad14bd-a515-3227-a77a-3dfc75a9a771" LABEL="MacKael" TYPE="hfsplus" (OS X Partition)     /dev/sda3: LABEL="Ritz-MacLinux" UUID="239fd22b-f7c0-4485-ac0c-628501642561" TYPE="ext4" (Ubuntu Partition)     /dev/sda4: UUID="f5c8b700-b743-42a1-bae3-43fb361d26a7" TYPE="swap"      /dev/sda5: UUID="87d54eaf-0b0f-3394-a33a-832cd486d919" LABEL="Shared" TYPE="hfsplus" (Shared Partition (unjournaled))      My fstab entry for the Shared partition looks like this:               UUID=87d54eaf-0b0f-3394-a33a-832cd486d919 /home/kael/.archive     hfsplus    auto,exec,rw,user  0 0      However, when I boot my computer and run `mount`, the result is this:               /dev/sda5 on /home/kael/.archive type hfsplus (rw,noexec,nosuid,nodev)      I've tried running `mount -t hfsplus -o remount,rw,exec,user /dev/sda5 /home/kael/.archive`, but it doesn't even seem to acknowledge the options I give it. Nothing changes. I can't find any error messages, either. I've looked through all of the logs and can't find any messages about that partition. Any thoughts or suggestions would be appreciated.


How to remove duplicate letters using sed?

Using sed, how can I remove duplicate letters from HEADERS within a text file?               NNAAMMEE            nice - run a program with modified scheduling priority          SSYYNNOOPPSSIISS            nice     [-n    adjustment]    [-adjustment]    [--adjustment=adjustment] [command [a$      Above is a an example. I want the output after parsing with `sed` to be:               NAME            nice - run a program with modified scheduling priority          SYNOPSIS            nice     [-n    adjustment]    [-adjustment]    [--adjustment=adjustment] [command [a$


"startx" not found in Slackware 14.0

Had been running smoothly for a while in Slackware 14 on my laptop, did full install with KDE,then after installing Tor and Vidalia, the Vidalia icon stopped working, so I restarted the computer. For my primary user, `startx` was no longer recognized as a command. I was still able to startx from root, so then I made a user `test` using all defaults and `startx` works here too... though after reboot, `startx` is also "not found" for test. `echo $PATH startx` for the user:               /usr/local/bin:/bin:/usr/bin startx      `echo $PATH startx` for the superuser (`su -l`):               /usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/kde4/libexec:/usr/lib/qt/bin:/usr/share/texmf/bin startx      I have also tried copying `.Xauthority` from root to the user, but to no avail. Another thing I tried was setting x to start using init scripts, but when it booted x, and I attempted to log in as user, it ignored my command until I logged in as root


How is Fedora 16 with proprietary software?

I was using Arch, Kubuntu and Ubuntu the most recently. I am considering Fedora for a stable KDE environment. But since the Fedora team is actively discouraging proprietary software like **Flash, NVidida drivers** , **wifi, bluetooth** and **MP3 support** , is it easy to actually install them without jumping through hoops and breaking your system? Is there any "software bundle" for enabling all of the above, like Ubuntu has non-free-extras?


Fedora 18 No Wireless

Just installed Fedora 18 and I can't get the wireless to work.   What do I have and what have I done? I have a `Broadcom BCM4312` which is supported by the `broadcom-wl` driver. (link)               lspci | grep Network     00:19.0 Ethernet controller: Intel Corporation 82567LM Gigabit Network Connection (rev 03)     0c:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01)      I have installed the driver and the kernel modules for it:               rpm -qa | grep -e '-wl' | sort     akmod-wl-5.100.82.112-7.fc18.4.i686     broadcom-wl-5.100.82.112-4.fc18.noarch     kmod-wl-3.7.4-204.fc18.i686-5.100.82.112-7.fc18.8.i686      The kernel:               uname -r     3.7.4-204.fc18.i686      I have loaded the module               modprobe wl          lsmod | sort | grep wl     cfg80211              171182  1 wl     lib80211               13684  1 wl     wl                   2465403  0       And even removed the `ssb` module, which I read on couple forums.   Restarted the service, and even rebooted:               service NetworkManager restart      After all these, the wireless card is still not visible. What am I missing?


Storing thousands of files in one directory

I have a web-site that I'm checking for performance issues and bugs, and i came across a caching code that caches thousands of files into one single directory. I understand that this is not good and that I/O will degrade and i also heard about potential inode problem. And i know how to fix the caching code, but the thing is that at this point fixing would be very expensive. **The question** : What is the worst case scenario if i live it like it is right now? What will happen to the website? (right now this one single cache directory has 400K files) I'm new to Ubuntu. And i understand that this is might be an off-topic. But i think this is a "system" question and it does not belong to the 'programming' part of the stackoverflow. Thanks! **UPDATE:** The file system is UFS


'redirect' ssh path?

Instead of using...               ssh://user@mysite.net:1234/mnt/thing/usr/prj      I want to use               ssh://user@mysite.net:1234/prj      How would I do this? It would be good if users can't access `/home`, `/var` and such. I only need this for data transfers.


Can I configure my shell to print STDERR and STDOUT in different colors?

I want to set my terminal up so `stderr` is printed in a different color than `stdout`; maybe red. This would make it easier to tell the two apart. Is there a way to configure this in `.bashrc`? If not, is this even possible? * * * **Note** : This question was merged with another that asked for `stderr`, `stdout` _and the user input echo_ to be output in _3 different colours_. Answers may be addressing either question.


How to detect memory type under Linux?

Which Linux utility can tell me if I have registered or unbuffered ECC memory in my server? `Lshw` and `dmidecode` do not work for me; `dmidecode` provides no information about registered vs. unbuffered:               Handle 0x0022, DMI type 17, 28 bytes     Memory Device             Array Handle: 0x0021             Error Information Handle: Not Provided             Total Width: 72 bits             Data Width: 64 bits             Size: 4096 MB             Form Factor: DIMM             Set: None             Locator: DIMM-1A             Bank Locator: Not Specified             Type: <OUT OF SPEC>             Type Detail: Synchronous             Speed: 1066 MHz (0.9 ns)             Manufacturer: Not Specified             Serial Number: Not Specified             Asset Tag: Not Specified             Part Number: Not Specified


sed : insert sth before subsequent lines that begin the same, but are not the same

I have a LaTeX file with one glossary entry per line:               ...     \newglossaryentry{ajahn}{name=Ajahn,description={\textit{(Thai)} From the Pali \textit{achariya}, a Buddhist monk's preceptor: `teacher'; often used as a title of the senior monk or monks at monastery. In the West, the forest tradition uses it for all monks and nuns of more than ten years' seniority}}     \newglossaryentry{ajivaka}{name={\=Aj\={\i}vaka},description={Sect of contemplatives contemporary with the Buddha who held the view that beings have no volitional control over their actions and that the universe runs according to fate and destiny}}     ...      Here we're only concerned about the `\newglossaryentry{label}` part of each line. The lines of the file has been sorted with `sort`, so duplicate labels come up like this:               \newglossaryentry{anapanasati}{name=\=an\=ap\=anasati,description={`Awareness of inhalation and exhalation'; using the breath, as a mediation object},sort=anapanasati}     \newglossaryentry{anapanasati}{name={\=an\=ap\=anasati},description={Mindfulness of breathing. A meditation practice in which one maintains one's attention and mindfulness on the sensations of breathing. \textbf{[MORE]}}}      **How do I`sed` this file, to insert a line before duplicate labels?**               #!/bin/sh          cat glossary.tex | sed '     /\\newglossaryentry[{][^}]*[}]/{         N;         s/^\(\\newglossaryentry[{][^}]*[}]\)\(.*\)\n\1/% duplicate\n\1\2\n\1/;     }' > glossary.sed.tex      I made it as far as the command above, but it has a flaw: it reads the lines to pattern space in pairs, and so it only works when the duplicate happens to be the pair it read in. These will not match for example:               \newglossaryentry{abhinna}{name={abhi\~n\~n\=a},description={Intuitive powers that come from the practice of concentration: the ability to display psychic powers, clairvoyance, clairaudience, the ability to know the thoughts of others, recollection of past lifetimes, and the knowledge that does away with mental effluents (see \textit{asava}).}}     \newglossaryentry{acariya}{name={\=acariya},description={Teacher; mentor. See \textit{kalyanamitta.}}}     \newglossaryentry{acariya}{name=\=acariya,description={Teacher},see=Ajahn}     \newglossaryentry{adhitthana}{name={adhi\d{t}\d{t}h\=ana},description={Determination; resolution. One of the ten perfections \textit{(paramis).}}}      Because first it reads in the lines with _abhinna_ and _acariya_ , then it reads _acariya_ and _aditthana_ . I figure that this needs some extra `sed` magic with hold space and conditional printing of lines, but I couldn't get my head around it.


How do you automatically elevate an automatic task to root privileges or is there an alternative approach?

I'm trying to write, in essence, an automatic deployment script for use by our development team and I know I can set up SSH to use keys so that I can automatically authenticate via key instead of password for the purposes of executing remote commands; however, what I'm stuck on is that the task that needs to execute for deployment requires us to restart an upstart job which requires root privileges. I've looked around on the internet (and here) and have been mostly unsuccessful and finding solutions. The question: Is there a way to remotely (and automatically, the script is not monitored so password authentication as sudo requires will not work) elevate to root privileges to restart a job or give a user group the ability to do that? Overall I would still consider myself a newbie Linux user, I haven't done a lot of work with permissions but I've learned my way around operations pretty well.


Cent OS 6.3 Hidden files in shell

I need help, I want to be able to check whether a file is hidden or not in Cent OS 6.3. These are often referred to as (dot) files but I can clearly see Cent OS 6.3 handling these by appending a ~(tilde) to the end EG: myfile (not hidden) myfile~ (hidden) Now, I can tell that a file is "hidden" if it's a dot file, but what is going on with this tilde (~) terminating character - is this particular to Cent OS 6.3? Is this something I can simply check for in the file name (EG: starting with a dot or ending with a tilde) I would appreciate help on this as, I would assume "hidden" is a file attribute rather than a "naming convention" as I wrong?