Why does "yum update" fails with many duplicates, after many months of no upgrades?

After many months (> 6) of no software upgrades, I logged into an EC2 instances running:               Linux version 2.6.32-358.23.2.el6.x86_64 (mockbuild@x86-022.build.eng.bos.redhat.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Sat Sep 14 05:32:37 EDT 2013      and then tried to do the usual yum-update:               # yum update      Well, that failed with errors like these:               --> Finished Dependency Resolution     Error: Package: coreutils-libs-8.4-19.el6_4.2.x86_64 (@rhui-us-east-1-rhel-server-releases)                Requires: coreutils = 8.4-19.el6_4.2                Removing: coreutils-8.4-19.el6_4.2.x86_64 (@rhui-us-east-1-rhel-server-releases)                    coreutils = 8.4-19.el6_4.2                Updated By: coreutils-8.4-31.el6_5.1.x86_64 (rhui-REGION-rhel-server-releases)                    coreutils = 8.4-31.el6_5.1                Available: coreutils-8.4-9.el6.x86_64 (rhui-REGION-rhel-server-releases)                    coreutils = 8.4-9.el6                Available: coreutils-8.4-13.el6.x86_64 (rhui-REGION-rhel-server-releases)                    coreutils = 8.4-13.el6                Available: coreutils-8.4-16.el6.x86_64 (rhui-REGION-rhel-server-releases)                    coreutils = 8.4-16.el6                Available: coreutils-8.4-19.el6.x86_64 (rhui-REGION-rhel-server-releases)                    coreutils = 8.4-19.el6                Available: coreutils-8.4-19.el6_4.1.x86_64 (rhui-REGION-rhel-server-releases)                    coreutils = 8.4-19.el6_4.1                Available: coreutils-8.4-31.el6.x86_64 (rhui-REGION-rhel-server-releases)                    coreutils = 8.4-31.el6     Error: Package: abrt-addon-python-2.0.8-16.el6_4.1.x86_64 (@rhui-us-east-1-rhel-server-releases)                Requires: abrt = 2.0.8-16.el6_4.1                Removing: abrt-2.0.8-16.el6_4.1.x86_64 (@rhui-us-east-1-rhel-server-releases)                    abrt = 2.0.8-16.el6_4.1                Updated By: abrt-2.0.8-21.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-21.el6                Available: abrt-1.1.13-4.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 1.1.13-4.el6                Available: abrt-1.1.16-3.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 1.1.16-3.el6                Available: abrt-2.0.4-14.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.4-14.el6                Available: abrt-2.0.8-6.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-6.el6                Available: abrt-2.0.8-6.el6_3.2.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-6.el6_3.2                Available: abrt-2.0.8-15.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-15.el6     Error: Package: abrt-addon-ccpp-2.0.8-16.el6_4.1.x86_64 (@rhui-us-east-1-rhel-server-releases)                Requires: abrt = 2.0.8-16.el6_4.1                Removing: abrt-2.0.8-16.el6_4.1.x86_64 (@rhui-us-east-1-rhel-server-releases)                    abrt = 2.0.8-16.el6_4.1                Updated By: abrt-2.0.8-21.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-21.el6                Available: abrt-1.1.13-4.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 1.1.13-4.el6                Available: abrt-1.1.16-3.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 1.1.16-3.el6                Available: abrt-2.0.4-14.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.4-14.el6                Available: abrt-2.0.8-6.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-6.el6                Available: abrt-2.0.8-6.el6_3.2.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-6.el6_3.2                Available: abrt-2.0.8-15.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-15.el6     Error: Package: abrt-addon-kerneloops-2.0.8-16.el6_4.1.x86_64 (@rhui-us-east-1-rhel-server-releases)                Requires: abrt = 2.0.8-16.el6_4.1                Removing: abrt-2.0.8-16.el6_4.1.x86_64 (@rhui-us-east-1-rhel-server-releases)                    abrt = 2.0.8-16.el6_4.1                Updated By: abrt-2.0.8-21.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-21.el6                Available: abrt-1.1.13-4.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 1.1.13-4.el6                Available: abrt-1.1.16-3.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 1.1.16-3.el6                Available: abrt-2.0.4-14.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.4-14.el6                Available: abrt-2.0.8-6.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-6.el6                Available: abrt-2.0.8-6.el6_3.2.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-6.el6_3.2                Available: abrt-2.0.8-15.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-15.el6     Error: Package: glibc-devel-2.12-1.107.el6_4.5.x86_64 (@rhui-us-east-1-rhel-server-releases)                Requires: glibc-headers = 2.12-1.107.el6_4.5                Removing: glibc-headers-2.12-1.107.el6_4.5.x86_64 (@rhui-us-east-1-rhel-server-releases)                    glibc-headers = 2.12-1.107.el6_4.5                Updated By: glibc-headers-2.12-1.132.el6.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.132.el6                Available: glibc-headers-2.12-1.7.el6.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.7.el6                Available: glibc-headers-2.12-1.7.el6_0.3.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.7.el6_0.3                Available: glibc-headers-2.12-1.7.el6_0.4.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.7.el6_0.4                Available: glibc-headers-2.12-1.7.el6_0.5.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.7.el6_0.5                Available: glibc-headers-2.12-1.25.el6.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.25.el6                Available: glibc-headers-2.12-1.25.el6_1.3.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.25.el6_1.3                Available: glibc-headers-2.12-1.47.el6.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.47.el6                Available: glibc-headers-2.12-1.47.el6_2.5.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.47.el6_2.5                Available: glibc-headers-2.12-1.47.el6_2.9.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.47.el6_2.9                Available: glibc-headers-2.12-1.47.el6_2.12.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.47.el6_2.12                Available: glibc-headers-2.12-1.80.el6.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.80.el6                Available: glibc-headers-2.12-1.80.el6_3.3.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.80.el6_3.3                Available: glibc-headers-2.12-1.80.el6_3.4.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.80.el6_3.4                Available: glibc-headers-2.12-1.80.el6_3.5.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.80.el6_3.5                Available: glibc-headers-2.12-1.80.el6_3.6.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.80.el6_3.6                Available: glibc-headers-2.12-1.80.el6_3.7.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.80.el6_3.7                Available: glibc-headers-2.12-1.107.el6.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.107.el6                Available: glibc-headers-2.12-1.107.el6_4.2.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.107.el6_4.2                Available: glibc-headers-2.12-1.107.el6_4.4.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.107.el6_4.4      You could try using --skip-broken to work around the problem     ** Found 143 pre-existing rpmdb problem(s), 'yum check' output follows:      After reading several articles, I tried several things to correct the issue:   * Ran `yum clean all`, then `yum update`.   * Ran `rpmdb --rebuilddb`, then `package-cleanup --dupes`, then `package-cleanup --cleandupes`.   * Ran `yum-complete-transaction`, etc. In all cases, I ended up in the same place. One article suggested that I might have conflicting packages for glibc. In any case, I cannot tell what is going on. Should I re-instance my EC2, or does someone have a solution? Thanks!


Copy a file to a directory that doesn't exist with only one command (Linux)

Is it possible to copy a file to a dir that doesn't exist such that it creates the directory, using only one command? Without using `&&` and more than one command. Edit: It is not duplicate, in the other ask the answer is a function, I ask about a command, only one command, without &&, functions, |, etc. It is a question for learn more and for know if exist commands that do it, because cp don't. Is a question for explain it in a high school.


How do I run 32-bit programs on a 64-bit Debian/Ubuntu?

I have a 64-bit (amd64 a.k.a. x86_64) Debian or Ubuntu installation. I need to run 32-bit (i386/i686) programs occasionally, or to compile programs for a 32-bit system. How can I do this with a minimum of fuss? Bonus: what if I want to run or test with an older or newer release of the distribution?


share vpn conneciton using router

I want to share my VPN connection with other devices. I just got a D-Link router, and I'm a little bit lost about how to deal with it. I connect to internet using the VPN of my university (PPTP). The LAN has a DHCP server, giving to each computer an IP address according to their MAC address (if the mac address is unknown by the DHCP server, then it gives an IP address under a subnetwork that cannot connect to the VPN). The connection to internet can be successful only if the combination IP:VPN_login:VPN_password is correct. I already connected to the router, using telnet on port 23. I know how to change MAC address using `ifconfig ethx down && ifconfig ethx up hw ether <mac address>`. So changing the mac address of the router to mine (which is recognized by the university), the router will get my usual IP address. But now? To connect to vpn, I usually use network-manager on ubuntu, and the toolkit `nmcli`


Cursor movement in terminals

I'm trying to wrap my head how shells move the screen cursor around (Moving around input the arrow keys and such). I've been doing a lot of testing, and I haven't found any system call that allows for movement of the screen cursor in a terminal. Is this done using specific terminal extensions? If so, is there any documentation as to how this is achieved for, say, xterm? This has been driving me crazy, any light you can shed on this is appreciated.


How to append end of every line with the line itself

This is in `file.txt`:               redcar     bluecar     greencar      Im looking for ways to make it become:               redcar redcar     bluecar bluecar     greencar greencar      I've tried many ways using `sed` with no luck


How to disable swap file after install or during Kubuntu install?

My computer has more than 64KB of RAM (8GB), if I run out of memory I want things to crash so I know I'm out of RAM so I'll buy some instead of say wandering why my computer is running slowly when I can just spend another $40 for another 8GB of RAM. I'm running Kubuntu in VirtualBox. I'm not sure if there is any way to permanently disable the swap file after the installation has finished. As with previous Linux installs I've found that the newer GUI installers do NOT provide an option to have a single partition without a swap forcing me to use the old DOS/Console styled installers which do. If I have to reinstall from scratch (not a huge ordeal for me) are there multiple installers or does the regular Kubuntu installer provide a manner to install without a swap file?   * I'm absolutely sure I want to do this, I have not run a pagefile in years in both XP and other Linux distros I've tried and enjoy my systems being responsive.   * I'm semi-capable in the console though please do not ask me to type a hundred lines to do a simple copy/paste or text edit, I'm interested in Linux for production not a hobby.   * I'll be happy to both accept and up-vote whatever answer works as well as clarify anything.


How to determine if X server runs with root privileges

This is a one-liner: Is there a way/command to check if the X server is run as root or as user? * * * This was supposed to be a one-liner but alas... I recently upgraded my `Arch Linux` box. After the upgrade I was notified that `X` now runs rootless. I checked on the official `Arch Linux` page and it states: "X is now rootless with the help of systemd-logind [...]" [1] This got me interested in how to check whether `X` is run rootless or not. How can this be done?


Unable to login to my server using ssh

Yesterday I was migrating to my new server, needed to use rsync, I created a RSA key, so that rsync could connect, I saw an error that says `add to trusted key in location x` I didn't have that location on my new server, so basically when I do `mv rsakey /location.x` The directory didn't exist. I tried regenerating the key. but that didn't help, now I'm unable to login to ssh nor to filezilla `scp protocol` it says `Error: Network error: Software caused connection abort. Error: Could not connect to server` I'm almost certain that the error is caused by RSA key. How can I fix it? By the way I have Ispcp installed, so I might be able to fix it from there. **Note:** I have generated RSA keys on the old and the new server, I can login to the old but not the new one. **EDIT** using terminator on ubuntu 12.04:               $ ssh root@server_ip     Connection closed by server_ip      **EDIT 2** after doing `mv ~/.ssh ssh_backup` i tried to connect and it says `Read from socket failed: Connection reset by peer` i retried and it gave me the `connection closed` error shown above **EDIT 3** the output of `ssh -vv root@server_ip`               OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: /etc/ssh/ssh_config line 19: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to my_ip_address [my_ip_address] port 22.     debug1: Connection established.     debug1: identity file /home/me/.ssh/id_rsa type -1     debug1: identity file /home/me/.ssh/id_rsa-cert type -1     debug1: identity file /home/me/.ssh/id_dsa type -1     debug1: identity file /home/me/.ssh/id_dsa-cert type -1     debug1: identity file /home/me/.ssh/id_ecdsa type -1     debug1: identity file /home/me/.ssh/id_ecdsa-cert type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6+squeeze3     debug1: match: OpenSSH_5.5p1 Debian-6+squeeze3 pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1     debug2: fd 3 setting O_NONBLOCK     debug1: SSH2_MSG_KEXINIT sent     Connection closed by my_ip_address      **@mattdm** I named the location `x` because i forgot what it was, you know that error where it basically says: please move rsa key to trusted sources location, or something like that. maybe it was `/.ssh`


Is there a search utility which can binary split search a large sorted (sequential) text file?

Yes, I know it sounds odd. Sequential and Binary-splits don't mix.. That is unless the sequence is the byte offset within the file itself... I've scrambled together a binary split search in bash script, using `dd`. It has Search-and-Find times of 3-9 seconds for an 8 GB file.. so it works (but slower than I know it can be)... I'd really prefer to not have to polish this wheel; It just took my fancy to do it as an exercise in bash (having a project is the best way to learn a language, etc). I think this would be pretty straight forward in C/++, etc... I'm curious to see some other examples (particularly bash ones.


can't connect to dnsmasq on local machine, port is open but connection refused

I'm running Scientific Linux 6.3 and just updated the machine to dnsmasq-2.48-13.el6.x86_64. The machine is on local ip 192.168.1.100. I have a local caching DNS setup that was working until the update. /etc/dnsmasq.conf configuration:               strict-order     listen-address=192.168.1.100     bind-interfaces     cache-size=5000      I confirmed that dnsmasq is running, the ports open and close as I start and stop dnsmasq.               $ netstat -nl # shows that the port was opened     Proto Recv-Q Send-Q Local Address           Foreign Address        State     tcp        0      0 192.168.1.100:53        0.0.0.0:*              LISTEN     udp        0      0 192.168.1.100:53        0.0.0.0:*      but trying to resolve fails               $ nslookup google.com 192.168.1.100     ;; connection timed out; trying next origin     ;; connection timed out; no servers could be reached      even trying to telnet fails               $ telnet 192.168.1.100 53     Trying 192.168.1.100...     telnet: connect to address 192.168.1.100: Connection refused      I don't seen anything in /var/log/messages related to dnsmasq. Stopping iptables didn't help. I'm not sure where to go from here.


Extend my LVM After Upgrading SSD

So, I have a 120 GB SSD (/dev/sdb) that I have a dual boot of Windows 7 and Fedora 17. When I first started I only have a 60 GB SSD so my space was very limited. I have a partition on my SSD (dev/sdb4) which I created with gparted, that shows a "Partition 5 LVM2" (dev/sdb5) below it which I believe is what the LVM is stored on(?). Anyways, using gparted I extened my /dev/sdb4 to 27GB, which then created a "Free Space" of 17GB within /dev/sdb4. Now I need to combine /dev/sdb5 and the free space into one. I've tried: `lvextend -L+16G /dev/vg_mine/lv_root` which results in:               Extending logical volume lv_root to 20.97 GiB     Insufficient free space: 512 extends needed, but only 0 available      I then used a `resize2fs /dev/vg_mine/lv_root` which results in: `The filesystem is already 1302528 blocks long, nothing to do!` Anybody point me in the right direction? Am I on the right track so far?


Determine if Git working directory is clean from a script

I have a script which runs `rsync` with a Git working directory as destination. I want the script to have different behavior depending on if the working directory is clean (no changes to commit), or not. For instance, if the output of `git status` is as below, I want the script to exit:               git status     Already up-to-date.     # On branch master     nothing to commit (working directory clean)     Everything up-to-date      If the directory is not clean then I would like it to execute some more commands. How can I check for output like the above in a shell script?


Do the "play" utility in Linux really have a "delay" to stop it's process with really small files?

I have a wav file, Duration: 00:00:00.17 (less than a second!) When I call `play` to execute it, `play` executes it fine, but my terminal becomes idle for ~4s until play process is done. Is this by design? Is it possible to just play the sound and be done in less than a second? **EDIT** : Running `time` as suggested by @jsbillings:                File Size: 1.89k     Bit Rate: 90.3k       Encoding: Unsigned PCM         Channels: 1 @ 8-bit         Samplerate: 11025Hz           Replaygain: off                Duration: 00:00:00.17            In:100%  00:00:00.17 [00:00:00.00] Out:1.85k [!=====|=====!]        Clip:0         Done.          real    0m2.912s     user    0m0.004s     sys         0m0.008s


Executing a shared library

Some shared libraries provide an output when called from the command line as if they were executables. For example:               $ /lib/libc.so.6      GNU C Library stable release version 2.13, by Roland McGrath et al.     Copyright (C) 2011 Free Software Foundation, Inc.     This is free software; see the source for copying conditions.     There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A     PARTICULAR PURPOSE.     Compiled by GNU CC version 4.5.2.     Compiled on a Linux 2.6.37 system on 2011-01-18.     [...]      In a shared library of my own written in C, how can I provide this output? I've executed now a library I just made and I get a `segment fault`.


How to get history search to start afresh?

When I do a search using `Ctrl``R`, the search gets limited to entries older than displayed hit. How do I reset this so that it starts from the beginning (i.e. from latest history entry) without leaving the shell?


How to search the whole of bash history without needing to go forwards and backwards?

At times when I do `Ctrl``R` to search through command history, I find that I don't reach the entry I was looking for, even though I know it's in history. I think this is due to me having passed the entry, forcing me to use another command to go the other direction. Is there a command that allows the whole of history to be searched by looping through it (restarting the cycle) when it reaches the end?


How can I run my own scripts in kate 3.8.2? "External tools" isn't available in the plugins section

I am using Kubuntu 12.04 LTS. How can I run my own scripts in `kate` 3.8.2? It appears that the plugin named _External tools_ is no longer available. I would like to run Python or shell scripts in kate and invoke them using a keyboard shortcut, such as `F4`. As an example, this simple script would ideally change to a specific window when I press `F4`.               #!\bin\sh     wmctrl -a "<Window name>"


Can I redirect logfiles to syslog?

I have a Node.js server that is being monitored by forever. Forever generates three logfiles: the server STDOUT, STDERR and the log of forever itself.               $ forever -l forever.log -o out.log -e err.log app.js      But instead of logging to logfiles I would like to log everything to syslog, optionally with adding a prefix of some sorts so my syslog processing servers can sort everything out. On StackOverflow, someone suggested that this can be handled using some bash wrapper and suggested I ask here. So, how would I get those logs into syslog instead of into files?


I accidentally deleted the sudoers file on Mac OS X; is there any way to recover it?

I accidentalley deleted the sudoers file on Mac OS X; is there any way to recover it?   And once you've recovered it, how do you set it to mode 0440? I presume not but I am desperate to get it back!


mounting to non-empty directory, then later deleting original files

I have some unused space on my disk, and decided to use a little of it to create a separate /var partition. There might be an easier way to do this, but my idea is to   1. copy the existing /var directory to the partition;   2. mount the partition over the existing /var directory;   3. using another system, either another distro on the disk or a live CD, to delete the original /var contents while the partition is not mounted. I've done the first 2 steps, and it seems OK so far. I've made an entry in fstab to mount on boot, which I'll test before deleting. But I'm wondering if this is a valid strategy, and also if it's a good idea and/or if there is a better way. It's somewhat of a learning experience for me to play around more with mounting beyond the basics. Edit (results): Thanks to the suggestions below, I completed step 3 without the need to use a 2nd system. The method I used was to remount the root fs using the command `mount --bind / /mnt/temp`, then going to `/mnt/temp/var` and deleting the files and directories there. The one suggestion made after I did it was to create a dummy file, and then check the mounted /var directory to confirm that it was not seen in that directory. But I compared timestamps to see that they were different, so I felt confident that I was OK. Thanks for the suggestions, everyone.


Run sudo as another non-root user and save in this user's home directory

I added a new group: `ircuser` and a new user: `ircuser` In `visudo` I placed this line:               myuser localhost=(ircuser) NOPASSWD: /usr/bin/irssi      Created `ircuser` directory, where config files, caches, etc should be saved:               drwxrwx--- 2 ircuser ircuser 4096 Mar  2 10:28 ircuser      When issuing the command:               sudo -Hu ircuser /usr/bin/irssi      or               sudo -u ircuser /usr/bin/irssi      The program can't save the config file in the `ircuser` directory.               ** ERROR **: Couldn't create /home/myuser/_web/ircuser/.irssi directory     aborting...     Aborted      But, it is being run as `ircuser`:               ps auxw | grep irssi     ircuser  11962  0.0  0.0  23684  2504 pts/6    S+   11:18   0:00 /usr/bin/irssi      So, albeit `irssi` is run by `ircuser` it can't write to a directory owned by the same user? What do I need to change to allow it saving there?


root account expired

I have two accounts on my computer: james and john. james is the only administrative account and a few days ago I set it to expire out of curiosity. Now am stuck. I can not login using james because it has expired, I can not use john for anything because it is not a member of sudoers. I can not login as root probably because root and james shared a password. Kindly help.


Generating sets of files that fit on a given media size for tar -T

Can anyone suggest a script that will take as input the name of one or more directories and a media size, and output lists of files for input to tar using `-T` (assuming no compression)? `scdbackup`/`sdvdbackup` sort of does this, but it's full of bloat that I don't need. So basically looking for something like this:               ./splitTars file1 file2 .... 2.0T      where `file` can be a file or directory, and the last argument is the size of the media (e.g. 2TB). It should then output a file list for each tar archive and give a warning for files that are too big to fit on the media. If nothing like this exists, one way to do it would be to create the list of files using find, re-arrange them in increasing or decreasing size, then start cutting the list up into pieces.


SSH Bash Jail Session

I've seen some game tunneling service providers that jails the customer's account to a Information screen upon login and any input is ignored. Ctrl+C closes the SSH session, and disconnecting. This basically jails the user, but maintains the Tunnel. This made me very curious how it's done. Does anyone knows how this could be done?


Split pages in pdf

I have a scanned pdf file which has scanned two pages on one virtual page (page in pdf file). The resolution is with good quality. The problem is I have to zoom when reading and drag from left to the right.   Is there some command (`convert`, `pdftk`, ...) or script that can convert this pdf file with normal pages (one page from book = one page in pdf file)?


How does using linux affect your career and computer skills overall?

so I would really love to move to linux as my only OS, i had linux installed several times(different distros) But i always go back to windows. Sad, i know Anyway I'm really into computers, i like programming (even though i'm no good at any particular language) i like graphics and simply said i like tinkering with my computer both on hardware and software side. What I'm worried about how will this affect my career in this industry? Well from programming point of view it depends if i code websites or applications. I don't think it really matters in the first case but what about .NET there is pretty big amount of jobs for .NET developers. When we take a look on graphics on linux compared to other OS (by other i mean windows and apple's osx) Adobe products are standard. Period. Well there are ways for running adobe products on linux via wine but i don't like that idea anyway because if i did that it definitely wouldn't be legal copy Even though the gap between photoshop and gimp is getting thinner all the time still it's a standard and i'm worried if i get too comfortable in gimp i will forget my photoshop skills that i have right now... and i'm not sure how would gimp look on my resume :/ The other thing... similar to the case above with adobe. Windows is standard, i've been using windows since i was 10 (18 now) and i can fix all my problems by myself (well with the help of the internet) And i plan on running my own computer store at some point in my life. But even if it won't come to that how can i troubleshoot windows when i will no longer keep up with their updates and new interfaces(i mean windows 8 is such a mess) Sure with the help of internet there shouldn't be much trouble but still, i don't want to end up googling all the time for some ****** software like windows anyway i hope this post is at least a little bit intelligible and i'm looking forward to your answers


using environment variables in tmux.conf files

Is it possible to use an environment variable in a tmux.conf file? I am trying to set a default-path to an environment variable. Currently what I am trying is:               set -g default-path $MYVAR      further I would like to check if $MYVAR is set already so I could do:               if($MYVAR == "") set-environment -g MYVAR /somepath/      Any ideas?


login and su internals

I am trying to understand how user permissions work in Linux. The kernel boots and starts `init` as root, right? Init then runs startup scripts and runs `getty` (`agetty`), again as root. Agetty just reads user name and runs `login`, still as root, I think. Nothing interesting yet. But what does _login_ do? I wasn't able to find anything better than "it attempts to log in". Suppose login finds that password matches (and we trying to log in as usual user), how does it change user id? I thought that there should be system call for that but I wasn't able to find it (maybe I'm just blind?) * * * Also, about `su`. `su` has the 'setuid' bit set so when we run it, it always runs as root. But when we tell it to log in as usual user, it again needs to change user id. Do I understand correctly that the same "magic" happens in `su` and `login` when they need to change user? If so, why have two different programs? Is there any additional sorts of serious business happening when running login?


What functionality do I lose by disabling GDM/KDM/SLIM/CDM etc display managers?

I've been wondering lately why do I need GDM, so I got it disabled for the sake of experiment sake by modifying upstart file /etc/init/gdm (I run Ubuntu 10.10 desktop). So now computer boots to command prompt and I just type in startx if I need GUI. So far everything runs just fine. But, does anyone know if there are any drawbacks to not using gdm? Would I lose any functionality?


In zsh how can I list all the environment variables?

I want to get a list of all environment variables (shell variables? exported variables?) and their values at a given time, in zsh.   What is the proper way to do this?


How can I connect mail(1) to my Gmail/Yahoo/Hotmail account?

I would like to use the `mail` command in a shell script to automatically connect to my Gmail/Yahoo/Hotmail account and send/receive messages. How can I do this?


How to remove URI encoding in file names

I realise this might be quite a simple question, but I'm still quite new to the command line and only have a grasp of basic commands. I've downloaded some lecture presentations (~25 or so) from my University however on doing so they've been named things like...               L2%20Development%20of%20immune%20system.pptx     L4%20Molecular%20Recognition.pdf      As you can see they've downloaded with the URL encoding `%20` instead of a space. My question is how to batch rename all of these files so that the `%20` is removed and replaced with a space instead?


Notational Velocity on Linux?

Is there a Linux equivalent of the note-taking software Notational Velocity?


Portable way to get script's absolute path?

What is a portable way for a (zsh) script to determine its absolute path? On Linux I use something like               mypath=$(readlink -f $0)      ...but this is not portable. (E.g., `readlink` on darwin does not recognize the `-f` flag, nor has any equivalent.) (Also, using `readlink` for this is, admittedly, a pretty obscure-looking hack.) What's a more portable way?


Is there a way to assign a shortcut key to nautilus' right click context menu?

Does anyone know of a way to assign a shortcut key combination to the menu items in the context menu that pops up in nautilus when you click on a file?


What's a good example of piping commands together?

If you were helping someone to learn the concept of pipes on the command line what example would you use? The example that actually came up was as follows:               cat whatever.txt | less      I feel like that's not the best example, namely because there's only one step. What's a good, but fundemental, use of `|`? Ideally the example I'll present will use programs that have outputs themselves that can be run independently and then shown piped together.


How can I share a desktop / log in graphically for an Ubuntu that I have ssh but not console access to?

http://www.ubuntugeek.com/share-your-ubuntu-desktop-using-remote-desktop.html tells how to share a desktop by setting multiple features from within a GUI. Is there such a HOWTO that is based on ssh command line access? I would like to know how I can remotely access a desktop from Ubuntu or any other operating system where I have ssh access and can install packages, but not graphical console access.


Does OpenSUSE Instlux overwrite Windows?

You seem to be able to install OpenSUSE from Windows using Instlux. Does anyone here know what the result is for the Windows installation on the machine? Is it overwritten, or does Instlux work like Ubuntu's Wubi and leave the Windows installation intact? Does it add an item to the Windows bootloader? Does it change the MBR to boot with GRUB?


How to access through terminal to a ntfs partition mounted?

Using Debian 7, I can access (and mount, indeed) to a ntfs partition of my hard drive.I do this by clicking on the 446 GB Filesystem shorcut in the _"Files"_ applicacion which comes with Debian. How can I access to such mounted partition from terminal? And how can I make this partition to be always loaded automatically?


Dropbox, notify-send and OSD interfere with Ctrl-shortcuts

I'm using Ubuntu 13.04 with i3 4.5.1. When i3wm starts, Ctrl-C/-D/-K etc. are working fine. When I start Dropbox, notify-send or change the volume, all Ctrl-something shortcuts stop working. I can reproduce the issue:   1. restart X, login to i3wm   2. open terminal, verify that Ctrl-C, Ctrl-A, Ctrl-K and Ctrl-D work => works   3. start one of the following programs:      * Dropbox with `/usr/bin/dropbox start`     * trigger an OSD notification with `notify-send "Test"`     * change the volume with the volume key   4. try Ctrl-C, -A, -K and -D in terminal again => does not work anymore To restore the Ctrl-something shortcuts, I have to restart X. Interestingly, commands with Shift-Ctrl-something still work, if Shift is pressed first. Here's the output from `xev` when I press Ctrl-C. Before executing step 3 above:                   KeyPress event, serial 33, synthetic NO, window 0x1a00001,             root 0x259, subw 0x0, time 7988829, (-219,177), root:(505,197),             state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,             XLookupString gives 0 bytes:              XmbLookupString gives 0 bytes:              XFilterEvent returns: False              KeyPress event, serial 33, synthetic NO, window 0x1a00001,             root 0x259, subw 0x0, time 7988878, (-219,177), root:(505,197),             state 0x4, keycode 54 (keysym 0x63, c), same_screen YES,             XLookupString gives 1 bytes: (03) "^C"             XmbLookupString gives 1 bytes: (03) "^C"             XFilterEvent returns: False              KeyRelease event, serial 33, synthetic NO, window 0x1a00001,             root 0x259, subw 0x0, time 7988949, (-219,177), root:(505,197),             state 0x4, keycode 54 (keysym 0x63, c), same_screen YES,             XLookupString gives 1 bytes: (03) "^C"             XFilterEvent returns: False              KeyRelease event, serial 33, synthetic NO, window 0x1a00001,             root 0x259, subw 0x0, time 7988970, (-219,177), root:(505,197),             state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,             XLookupString gives 0 bytes:              XFilterEvent returns: False      After step 3 from above:                   KeyPress event, serial 33, synthetic NO, window 0x1e00001,             root 0x259, subw 0x0, time 8064649, (-238,542), root:(486,562),             state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,             XLookupString gives 0 bytes:              XmbLookupString gives 0 bytes:              XFilterEvent returns: False              FocusOut event, serial 33, synthetic NO, window 0x1e00001,             mode NotifyGrab, detail NotifyAncestor              FocusIn event, serial 33, synthetic NO, window 0x1e00001,             mode NotifyUngrab, detail NotifyAncestor              KeymapNotify event, serial 33, synthetic NO, window 0x0,             keys:  2   0   0   0   32  0   0   0   0   0   0   0   0   0   0   0                    0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0              KeyRelease event, serial 33, synthetic NO, window 0x1e00001,             root 0x259, subw 0x0, time 8064926, (-238,542), root:(486,562),             state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,             XLookupString gives 0 bytes:             XFilterEvent returns: False      I have no idea where I should start debugging the problem. Can you give me some pointers how to find the cause of this problem? Thanks! Benedikt


Is it possible to generate a separate file list when creating a tarball?

When using `tar` for backups I'd like to create a separate list of the files that is included in the archive for storing alongside the backup tarball. I also want to be able to store the error messages from tar in a log. Solutions that's not so good:   * `tar --verbose` ... `&> filelist.txt` But this would give errors + file list in one file.   * `tar --list` after the tarball has been created. But this takes a long time. Is there some way to get the file list and store it in a separate file at the same time as I'm rolling the ball for the first time?


Elementary OS - can't take properly a screenshot or record a desktop

Yesterday I installed Elementary OS Linux distro and it seems that I have this weird issue when trying to take a screenshot or record a desktop. I only get black images or black videos. Funny thing is that I can see a cursor. But all background remains black. I tried by reinstalling FGLRX driver for my ATI graphics card. Didn't help. Can anyone tell me what's going on?


Why command `ls -d` only print the `.` directory?

I have tried `man ls`, and then I got > >     -d, --directory >   > > list directory entries instead of contents, and do not dereference symbolic > links As the manual says, `-d` means listing all the directories, but when I type `ls -d` I got               drwxr-xr-x 35 *user group* 4.0K *date* 00:16 .


Use CloneZilla to backup disk2image (Primary Boot) without CD or USB Drive?

Since I won't be near the physical machine, I need to find a way to disk2image backup/restore the Primary Boot HDD in case I mess it up somehow. How do you use CloneZilla to backup disk2image (Primary Boot) without using CD or USB drive?


NFSv3 with Kerberos "unmatched host" error

I've setup NFSv4 using Kerberos (works great), but now I need to add NFSv3 with Kerberos. When trying to mount the NFSv3 export, I get a permission needed error on the client and on the server the error is "unmatched host".               In /etc/export I just have:      /test gss/krb5(rw,sync)      The "unmatched host" error usually means that you haven't specified that the client can access the server in the export file. But with kerberos you shouldn't need to. The export man file states: > **RPCSEC_GSS security** To restrict access to an export using rpcsec_gss > security, use the special string "gss/krb5" as the client. It is not > possible to simultaneously require rpcsec_gss and to make requirements on > the IP address of the client. I'm pretty sure Kerberos is setup correctly (again NFSv4 with kerberos works) and from what I've read on the web, I think the NFS server is setup correctly (settings are below) and the necessary services are running. I currently testing on Ubuntu 10.4, but had the same problem on Novell SLED 10.3. Anyone have an idea what I could be doing wrong? or can point me to a NFSv3 w/kerberos how-to?               nss-common:     NEED_STATD=yes     STATDOPTS=     NEED_IDMAPD=no     NEED_GSSD=yes          nss-kernel-srever:     RPCNFSDCOUNT="8 --no-nfs-version 4  --no-nfs-version 2"     RPCNFSDPRIORITY=0     RPCMOUNTDOPTS="--manage-gids"     NEED_SVCGSSD=yes     RPCSVCGSSDOPTS=" -vvv "


How to use rsync or scp to efficiently copy the files from machineB and machineC to machineA?

I am running my shell script on `machineA` which copies the files from `machineB` and `machineC` to `machineA`. If the file is not there in `machineB`, then it should be there in `machineC` for sure. So I will try to copy from `machineB` first, if it is not there in `machineB` then I will go to `machineC` to copy the same files. In `machineB` and `machineC` there will be a folder like this `YYYYMMDD` inside this folder -               /data/pe_t1_snapshot      So whatever date is the latest date in this format `YYYYMMDD` inside the above folder - I will pick that folder as the full path from where I need to start copying the files - so suppose if this is the latest date folder `20140317` inside `/data/pe_t1_snapshot` then this will be the full path for me -               /data/pe_t1_snapshot/20140317      from where I need to start copying the files in `machineB` and `machineC`. I need to copy around `400` files in `machineA` from `machineB` and `machineC` and each file size is `1.5 GB`. Currently I have my below shell script which works fine as I am using `scp` over `rsync` but somehow it takes `5 hours` to copy the `400` files in machineA which is too long for me I guess. :( Below is my shell script -               #!/bin/bash          readonly PRIMARY=/export/home/david/dist/primary     readonly SECONDARY=/export/home/david/dist/secondary     readonly FILERS_LOCATION=(machineB machineC)     readonly MEMORY_MAPPED_LOCATION=/data/pe_t1_snapshot     PRIMARY_PARTITION=(0 3 5 7 9)     SECONDARY_PARTITION=(1 2 4 6 8)          dir1=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[0]} ls -dt1 "$MEMORY_MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)     dir2=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[1]} ls -dt1 "$MEMORY_MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)          echo $dir1     echo $dir2          if [ "$dir1" = "$dir2" ]     then         # delete all the files first         rm -rf $PRIMARY/*         # below for-loop copies one file at a time in PRIMARY folder         for el in "${PRIMARY_PARTITION[@]}"         do             scp david@${FILERS_LOCATION[0]}:$dir1/t1_weekly_1680_"$el"_200003_5.data $PRIMARY/. || scp david@${FILERS_LOCATION[1]}:$dir2/t1_weekly_1680_"$el"_200003_5.data $PRIMARY/.         done         # delete all the files first         rm -rf $SECONDARY/*         # below for-loop copies one file at a time in SECONDARY folder         for sl in "${SECONDARY_PARTITION[@]}"         do             scp david@${FILERS_LOCATION[0]}:$dir1/t1_weekly_1680_"$sl"_200003_5.data $SECONDARY/. || scp david@${FILERS_LOCATION[1]}:$dir2/t1_weekly_1680_"$sl"_200003_5.data $SECONDARY/.         done     fi      I am copying `PRIMARY_PARTITION` files in `PRIMARY` folder and `SECONDARY_PARTITION` files in `SECONDARY` folder in `machineA`. Now my question is - how would I use `rsync` here instead of `scp(ing)` the files? As I have read that `rsync` is much faster than `scp(ing)` the files. I would like to have same logic as I have in my shell script in `rsync`. I have never worked with `rsync` before so having some issue. Can anyone provide an example? Given my use case does `rsync` will be faster as compare to scp? And if not what other options I can try out to speed up the file transfer? **UPDATE:-** To clarify terdon question - In the question I am only showing 10 files just for example -               PRIMARY_PARTITION=(0 3 5 7 9)     SECONDARY_PARTITION=(1 2 4 6 8)      In general in `PRIMARY_PARTITION` array, I will around 150 file numbers and then in `SECONDARY_PARTITION` I will have another 200 files numbers. Now what I need to do is whatever file number I have in `PRIMARY_PARTITION`, I need to go and find out those files in the `machineB` directory, if the files is already there, then copy it to `PRIMARY` folder in `machineA` but if the file is not there in `machineB` then it should be there in `machineC` so go and copy the files from `machineC` now and put it in `PRIMARY` folder in `machineA`. Similarly I need to do same thing for `SECONDARY_PARTITION`, I will go and find out those files in `machineB` directory, if it is there copy it in `machineA` secondary directory but if it is not there in `machineB`, then it should be there in `machineC` so copy it from `machineC` and put it in `machineA` secondary directory. So all the file numbers we have is in - `PRIMARY_PARTITION` and `SECONDARY_PARTITION`. In general I will have `PRIMARY_PARTITION` and `SECONDARY_PARTITION` like this -               PRIMARY_PARTITION=(0 548 272 4 544 276 8 556 280 12 552 284 16 256 564 20 260 560 24 264 572 28 268 568 516 304 32 512 308 36 524 312 40 520 316 44 288 532 48 292 528 52 296 540 56 300 536 60 68 608 340 64 336 76 348 72 344 84 324 80 320 92 332 88 328 576 372 100 580 368 96 584 380 108 588 376 104 356 592 116 352 596 112 364 600 124 360 604 120 136 408 140 412 128 400 132 404 152 392 156 396 144 384 148 388 440 168 444 172 432 160 436 164 424 184 428 188 416 176 420 180 204 476 200 472 196 468 192 464 220 460 216 456 212 452 208 448 508 236 504 232 500 228 496 224 492 252 488 248 484 244 480 240)          SECONDARY_PARTITION=(1101 1374 1641 1371 1647 1098 1635 1365 1095 1638 1089 1362 1659 1359 1119 1113 1662 1353 1350 1650 1110 1347 1653 1107 1134 1407 1611 1401 1131 1614 1602 1125 1398 1122 1605 1395 1389 1149 1626 1629 1146 1386 1617 1143 1383 1377 1623 1137 1305 1581 1578 1311 1299 1575 1302 1569 1599 1290 1593 1293 1590 1281 1587 1287 1551 1338 1341 1545 1071 1329 1542 1335 1539 1083 1566 1323 1086 1563 1326 1557 1074 1314 1317 1077 1554 1221 1494 1491 1218 1503 1230 1227 1497 1479 1239 1233 1473 1245 1485 1482 1242 1254 1527 1251 1521 1263 1533 1530 1257 1509 1269 1266 1506 1278 1518 1275 1515 1155 1425 1431 1158 1434 1161 1167 1437 1410 1170 1173 1413 1419 1179 1422 1182 1671 1458 1185 1665 1191 1461 1677 1194 1467 1470 1197 1674 1203 1443 1206 1446 1449 1209 1215 1455)      **Another Update:-** After removing `2>/dev/null`, I ran the script again but I got the below error - `ssh: Could not resolve hostname machineB : Name or service not known rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: unexplained error (code 255) at io.c(605) [Receiver=3.0.9] ssh: Could not resolve hostname machineC : Name or service not known rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: unexplained error (code 255) at io.c(605) [Receiver=3.0.9] ssh: Could not resolve hostname machineB : Name or service not known rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: unexplained error (code 255) at io.c(605) [Receiver=3.0.9] ssh: Could not resolve hostname machineC : Name or service not known rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: unexplained error (code 255) at io.c(605) [Receiver=3.0.9] ` Any thoughts what is going on? I have replaced `machineB` and `machineC` with actual names before running the shell script and my system is -               root@machineA:/home/david# uname -a     Linux machineA 3.2.0-24-generic #37-Ubuntu SMP Wed Apr 25 08:43:22 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux      Below is my shell script which I am running -               #!/usr/bin/env bash          readonly PRIMARY=/export/home/david/dist/primary     readonly SECONDARY=/export/home/david/dist/secondary     readonly FILERS_LOCATION=(machineB machineC)     readonly MEMORY_MAPPED_LOCATION=/data/pe_t1_snapshot     PRIMARY_PARTITION=(0 3 5 7 9)     SECONDARY_PARTITION=(1 2 4 6 8)          dir1=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[0]} ls -dt1 "$MEMORY_MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)     dir2=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[1]} ls -dt1 "$MEMORY_MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)          echo $dir1     echo $dir2          ## Build your list of filenames before the loop.      for n in "${PRIMARY_PARTITION[@]}"     do         primary_files="$primary_files :$dir1"/t1_weekly_1680_"$n"_200003_5.data     done          ## Repeat for $SECONDARY_PARTITION     for n in "${SECONDARY_PARTITION[@]}"     do         secondary_files="$secondary_files :$dir2"/t1_weekly_1680_"$n"_200003_5.data     done          echo $primary_files     echo $secondary_files               if [ "$dir1" = "$dir2" ]     then         find "$PRIMARY" -mindepth 1 -delete         find "$SECONDARY" -mindepth 1 -delete              rsync -avz david@${FILERS_LOCATION[0]}"${primary_files}" $PRIMARY/         rsync -avz david@${FILERS_LOCATION[1]}"${primary_files}" $PRIMARY/              ## Do the same for $secondary_partition files         rsync -avz david@${FILERS_LOCATION[0]}"${secondary_files}" $SECONDARY/         rsync -avz david@${FILERS_LOCATION[1]}"${secondary_files}" $SECONDARY/     fi      I am suspecting may be `rsync` syntax is not right. Because if I run single command like this, then it worked fine -               rsync -avz david@machineB":/data/pe_t1_snapshot/20140317/t1_weekly_1680_0_200003_5.data" /export/home/david/dist/primary      **Another Minor Update:-** If I am running like this -               root@machineA:/export/home/david# rsync -avz david@machineB':/data/pe_t1_snapshot/20140317/t1_weekly_1680_0_200003_5.data :/data/pe_t1_snapshot/20140317/t1_weekly_1680_1_200003_5.data' /data01/primary     receiving incremental file list     rsync: change_dir "/home/david/:/data/pe_t1_snapshot/20140317" failed: No such file or directory (2)     t1_weekly_1680_0_200003_5.data          sent 30 bytes  received 504982813 bytes  6196108.50 bytes/sec     total size is 1761988281  speedup is 3.49     rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1536) [generator=3.0.9]      Above command should copy the files to `/data01/primary` directory but it is copying only one file and it doesn't copies second file. But this works fine and the one file get copied -               root@machineA:/export/home/david# rsync -avz david@machineB':/data/pe_t1_snapshot/20140317/t1_weekly_1680_0_200003_5.data' /data01/primary     receiving incremental file list     t1_weekly_1680_0_200003_5.data          sent 30 bytes  received 504982698 bytes  6351984.00 bytes/sec     total size is 1761988281  speedup is 3.49


Should i get red hat desktop?

So I want to learn about Linux more and to an extent Red hat, and I think the asking price ($49p/a) is a decent price to learn, I don't want centos because I would prefer Red Hat software, but is it worth having? I of course plan to get a RHCE at some point so would it be worth investing now so I can learn the distro? Many thanks


llvm and clang on CentOS 5 without root permissions?

I am trying to have llvm and clang on a centOS 5 without root permissions. I tried to do it downloading llvm and clang src packages and trying the ususal configure, make and make install steps as such:               wget http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz     wget http://llvm.org/releases/3.3/cfe-3.3.src.tar.gz     tar xzf llvm-3.3.src.tar.gz && cd llvm-3.3.src/tools/ && tar xzf ../../cfe-3.3.src.tar.gz      I tried with a newer version of gcc compiled for this 64bit CentOS system, because the older version wouldn't work (see below). When I try it with the newer version, I get this:               export LD_LIBRARY_PATH=/home/avilella/src/gcc/gcc-4.7.2/lib64:/home/avilella/src/gcc/gcc-4.7.2/lib     export CC=/home/avilella/src/gcc/gcc-4.7.2/bin/gcc     export CXX=/home/avilella/src/gcc/gcc-4.7.2/bin/g++       export PATH=/home/avilella/src/python/python-2.7.3/bin:$PATH     cd ~/src/llvm/latest/llvm-3.3.src     ./configure --prefix=/home/avilella/src/llvm/latest/llvm && make clean && make -j8 && make install      After these steps, I don't see clang in the bin directory:               /home/avilella/src/llvm/latest/llvm/bin          So I followed the instructions in the clang directory, and ran `make -j8` on it:               cd ~/src/llvm/latest/llvm-3.3.src/tools/cfe-3.3.src     make -j8      Doing so, I get this `clange/Config/config.h` error:               [...]     InitHeaderSearch.cpp:17:51: fatal error: clang/Config/config.h: No such file or directory     [...]      This is mentioned in a bug report from 2011, which I would be solved by now: http://llvm.org/bugs/show_bug.cgi?id=11903 Any ideas? * * * PREVIOUS ATTEMPTS:               cd ~/src/llvm/latest/llvm-3.3.src     ./configure --prefix=/home/avilella/src/llvm/latest/llvm && make clean && make -j8 && make install          checking for clang... clang     checking for C compiler default output file name... configure: error: C compiler cannot create executables     See `config.log' for more details.      Some of the contents of `config.log`:               configure:2047: checking for clang     configure:2063: found /home/avilella/bin/clang     configure:2074: result: clang     configure:2110: checking for C compiler version     configure:2117: clang --version >&5     clang: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by clang)     clang: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by clang)     clang: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by clang)     clang: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by clang)     clang: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by clang)     [...]      * * * I tried to use the fedora18 binary versions available on the llvm website, but it complains about a GLIBC version that cannot be found in the system:               [~/src/llvm/clang+llvm-3.3-x86_64-fedora18/bin] $ ./clang     ./clang: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by ./clang)     ./clang: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./clang)      I've got more recent version of gcc on this system, but I am guessing I need to either download binaries or recompile versions of libc to have this working. The question is how. I tried downloading rpms from here: http://pkgs.org/centos-5-rhel-5/centos-rhel- updates-x86_64/glibc-2.5-107.el5_9.5.x86_64.rpm/download/ I placed the contents of the rpm into a folder:               rpm2cpio $rpm | cpio -idmv      and added that folder lib64 into my LD_LIBRARY_PATH env variable, but that didn't solve the problem either (and made simple command like `ls` and `less` crash):               clang: /home/avilella/src/llvm/glibc/lib64/libc.so.6: version `GLIBC_2.15' not found (required by clang)     clang: /home/avilella/src/llvm/glibc/lib64/libc.so.6: version `GLIBC_2.14' not found (required by clang)


Press a html button via shell script?

i am currently trying to write a script to change some parameters on a webpage via a shell script. I can change the values in the textboxes without any problems, but i can't seem to figure out how i can "press" the Apply button. This is how i change the values, as you can see i need one final "Apply" button press.               setJitterDelay()     {         rate=${1}         if [ "${rate}" == "low" ]; then                 ((htmlJitterNegDelta = 5))                 ((htmlJitterPosDelta = 5))                 ((htmlJitterDelayMax = 10))                 jDelta=5         else                 if [ "${rate}" == "med" ]; then                         ((htmlJitterNegDelta = 25))                         ((htmlJitterPosDelta = 25))                         ((htmlJitterDelayMax = 50))                         jDelta=25                 else                         if [ "${rate}" == "high" ]; then                                 ((htmlJitterNegDelta = 50))                                 ((htmlJitterPosDelta = 50))                                 ((htmlJitterDelayMax = 100))                                 jDelta=50                         else                                 echo "error: low, med, high not selected! Skipped..."                                 return                         fi                 fi         fi         ### APPLY BUTTON     }      I used Firebug to know which values i had to change and the Apply button says this:                 <input id="appFlowBw" type="submit" value="Apply" name="appFlowBw">     <form action="http://wanemu/XGEM_REV_BW_FLOW?blade=1&profile=0" method="post" name="rev_bw_form"></form>      The input is inside the form in the source code:
               	               <INPUT type="submit" name="appFlowBw" id="appFlowBw" value="Apply" disabled>	           </FORM>      But i don't know how i can now "press" this button. I hope you understand my problem and can help. //edit: added form


Issues with .bash_profile and terminal commands

I added some data to my `.bash_profile` to run two aliases ruby version 19 and the proper gems. As soon as I added the data I could not longer run any commands such as the MacPorts command port nor the command mate to run TextMate. As soon as I deactivated `.bash_profile` and `.bash_login` and even `.bash_history` all was well again. `.bash_history` got regenerated and soon thereafter I got `.bash_profile` reinstated with my badly needed aliases, but then I lost the option to run these commands again. Here is some of the output of all these files:               jaspersmbp:~ jasper$ cat .bash_profile         alias ruby='/opt/local/bin/ruby1.9'         alias gem='/opt/local/bin/gem'     jaspersmbp:~ jasper$ cat .bash_login     jaspersmbp:~ jasper$ cat .bashrc         HISTFILESIZE=1000000000         HISTSIZE=1000000     jaspersmbp:~ jasper$ cat .profile         #Django path         export PATH=/opt/local/bin:opt/local/sbin:/opt/local/lib/python2.4/site-packages/django/bin:$PATH         # Apache alias         alias apacherestart='sudo /opt/local/apache2/bin/apachectl -k restart'         #Subversion OSX for Eclips Joomla Development         export PATH=/opt/subversion/bin:$PATH         #Test         #echo $PATH         ##         # Your previous /Users/jasper/.profile file was backed up as /Users/jasper/.profile.macports-saved_2012-05-18_at_09:47:58         ##         # MacPorts Installer addition on 2012-05-18_at_09:47:58: adding an appropriate PATH variable for use with MacPorts.         export PATH=/opt/local/bin:/opt/local/sbin:$PATH         # Finished adapting your PATH environment variable for use with MacPorts.      Does anyone know why making `.bash_profile` active anihilates the use of commands such as mate and port? I really need `.bash_profile` to work so I can use aliases and I need MacPorts port command for all kinds software.


How to sync two directories?

I have an "A" HDD (1,5TB) next to me (on a netbook running OpenBSD 5.1, it's a fileserver)      And I have a "B" HDD (1,5TB) 200km's away from me on an OpenWrt 10.04 router (also "fileserver").      I always put files on the netbook next to me. I need to sync this local storage (on the OpenBSD netbook) with the B storage 200 km's away with max 30 KByte/sec speed. I found a solution for this via google :)      sync files recursively between two folders where files are less than 24 hours old   **Question** : How can I configure that, when I sync to the "B" storage that they will not see these "half-uploaded" files? So I'm searching for a solution like: "If file is not fully copied from A to B, then put a dot before it's name, so they will not see as it is a hidden file.. if the upload finishes to a file, then after that the dot must be removed from their name, so that they can see it.."


Red Hat Enterprise Linux 6 wakes up spontaneously after sleeping

I have a Lenovo ThinkPad T430 running Red Hat Enterprise Linux 6.5. Today I put my computer to sleep, double checked 10 seconds later, only to find out after arriving to my office that my computer woke up inside my backpack. If ThinkPads weren't made of adamantium it would be probably fried. What's happening?


Is there a VPN client for Kali?

I'm pentesting a network using Kali Linux, however sometimes I have to be outside the network. I'd like to perform this via VPN if possible, else I have to drive home each time (10 miles, 15km) which wastes me a lot of time. I there any VPN client available for Kali Linux? It should have PPTP. Thanks!


Git - remove deleted files

I'm using this simple git alias                   rmdel = "!git rm $(git ls-files -d)"      meant "remove deleted", i.e. to remove from the staging area all files deleted from the file system. It works fine except when there are any files containing blanks. Then obviously the list gets split on them as well leading to file names of non-existing files. I think it should be possible to solve it using IFS, but IFS doesn't seem to work in cygwin and I doubt that something like                   rmdel = "!IFS=' ' git rm $(git ls-files -d)"`      could work at all. Any better idea?


Where are wine package for BOSS Linux?

In Wine website, i see different type of Operating system but cant find BOSS LINUX. in which category does it come? Is it called with an other name?


Create partition aligned using parted

I'm partitioning a non-SSD hard disk with _parted_ because I want a GPT partition table.               parted /dev/sda mklabel gpt      Now, I'm trying to create partitions correctly aligned so I use the next command to know where begins the first sector:               parted /dev/sda unit s p free          Disk /dev/sda: 488397168s     Sector size (logical/physical): 512B/512B     Partition Table: gpt          Number  Start  End         Size        File system  Name      Flags             34s    488397134s  488397101s  Free Space      We can see that it starts in the sector 34 (it's by default when this partition table is used). So, to create the first partition I tried:               parted /dev/sda mkpart primary 63s 127s      to align it in the sector 64 since it's multiple of 8 but it shows: **Warning: The resulting partition is not properly aligned for best performance.** The sector size logical and physical in my hard disk are both of 512 bytes:               cat /sys/block/sda/queue/physical_block_size     512          cat /sys/block/sda/queue/logical_block_size      512      How to create partitions correctly aligned? What I'm doing wrong?


Pulseaudio, Phonon, KDE and forwarding sound to headset

Some days ago I bought headet (Jabra BT2045) and I want to use it in Skype voicechat and for example to forward to it another sound streams from my KDE. I've successfully paired and setup as headset Jabra with Blueman or BlueDevil. After that Jabra interface appeared in Phonon list and I moved it to the top of list to transfer music to Jabra, not to my main output. But! There is no sound even if I change output manually with kmix for the streams, or when I've already setup Jabra as default output interface, microphone even don't work! Skype don't see that Jabra interface at settings and sound will appear if I reset all to my standard output (loudspeakers). What am I doing wrong? My dist is Linux Mint and pulseaudio/kde/blueman/bluedevil are up to date from mint repos.


“Grep-ing” from A to B in hexdump's output

Here is the situation: I have to find in the output from an `hexdump` the bytes between a string A and a string B. The structure of the hexdump is something like:               -random bytes     -A + useful bytes + B     -random bytes     -A + useful bytes + B     -random bytes      And now, the questions: - Is it possible to grep "from A to B"? I haven't seen anything like that in the man page or in the internet. I know i can do it manually, but I need to script it. - Is it possible to show the hexdump output without the line numbers? It seems very reasonable, but I have no found the way to do it. Thanks! Edit: I'm trying to recover 2 deleted JPEG images from a loopback device, so I can't show all the output (it's extremely long), but here's a piece of it:               0010400 ff d8 ff e0 00 10 4a 46 49 46 00 01 01 00 00 01     0010410 00 01 00 00 ff fe 00 3c 43 52 45 41 54 4f 52 3a     [...]     0030f50 3e e9 fb a4 54 37 70 7f cb 55 03 fd af f1 a2 32     0030f60 e8 26 8f ff d9 00 00 00 00 00 00 00 00 00 00 00      the standard says that the JPEG files start with 0xff 0xd8 and finish with 0xff 0xd9, so I want to get all the information between that 2 strings (I think that should work, but i haven't tested it yet)


Where can I find documentation about the "sudo !!" command

I just learned that Linux has a `sudo !!` command which literally applies `sudo` to the last entered command. I had never heard about it. Is that a common control? Where can I find documentation about it?


extract only a specific folder Contents from a zipped archive to a given directory

This is very close to the SO How to extract only a specific folder from a zipped archive to a given directory? I need something close but I always get the folder with the contents, not it's contents only This is what was suggested:                #note $2 is passed in and would be == "magefoler"      unzip /srv/file.zip "$2-master/*" -d /srv/www/mage/      What I need to do it to take a zip that has this structure in it               file.zip      |-magefoler-master/      |-magefoler-master/app/*tons of files      |-magefoler-master/skin/*tons of files      and I need to move it to another folder but, I can't move the `magefoler`, I only want the `app` and `skin` folders. This doesn't mean that it'll always be those two folders, just that any child content, files or folders, in the `magefoler` is what I need to get out. What is trying to be avoided is to export all to a folder and then just move it from there. The end result I'm looking for is from the zip file I output to the `/mage` folder like this:               /srv/www/mage/          |--/mage/app/*tons of files          |--/mage/skin/*tons of files


Job server with web/email interface to run remote commands

I'm looking for a solution to run remote commands for my Linux server. Unfortunately I cannot use SSH just only HTTPS (corporate firewall blocks everything different from HTTP/HTTPS on 80/443 ports). I tried a web shell over HTTPS but it is not comfortable and doesn't suit my needs. I just need something to pass a remote command to the server (optionally check the results), queue the commands to be done sequentially, see the statuses and completion for every job (remote command). It would be nice to have a job queue-schedule-runner server with a Web GUI. Another solution that come to my mind is an email interfaced server (I remember something like that from ancient Internet history, but couldn't remember the name) that would run the commands from the emails. If anybody knows something like that please name any of them.


Set custom locales in Gnome3 (on Fedora 20)

I've created my own custom `locale`s and placed them in `/etc/locale.conf` which successfully takes effect if I log in on a virtual console (Ctrl+Alt+F2). In my Gnome3 session those variables are not set, though. For terminal applications I could just place them in the `.bashrc` but that won't help me with graphical applications like Thunderbird and Pidgin. I have tried to follow these hints: Locale settings in shell initialization not used by GNOME session and even emulated the bug in Locale - ArchWiki by creating a `.pam_environment` file, but the `locale`s are still those set by Gnome3. There is a configuration dialogue in the Gnome settings but it only allows to set a very limited set of predefined `locale` combinations and no way to customize them. The relevant files in my home directory:               user@localhost:~$ ls -lah .dmrc .pam_environment .session .xsession .xsessionrc     lrwxrwxrwx. 1 user user 16 12. Jun 08:57 .dmrc -> /etc/locale.conf     lrwxrwxrwx. 1 user user 16 11. Jun 20:23 .pam_environment -> /etc/locale.conf     lrwxrwxrwx. 1 user user 16 12. Jun 09:09 .session -> /etc/locale.conf     lrwxrwxrwx. 1 user user 16 12. Jun 09:07 .xsession -> /etc/locale.conf     lrwxrwxrwx. 1 user user  9 13. Jun 11:22 .xsessionrc -> .xsession     -rw-rw-r--. 1 user user 66 13. Jun 11:13 .profile          user@localhost:~$ cat .profile      source /etc/locale.conf      The contents of `/etc/locale.conf`:               LANG="en_US.utf8"     LC_TIME="de_MY.utf8" # NB: de_MY     LC_MONETARY="de_DE.utf8"     LC_PAPER="de_DE.utf8"     LC_NAME="de_DE.utf8"     LC_ADDRESS="de_DE.utf8"     LC_TELEPHONE="de_DE.utf8"     LC_MEASUREMENT="de_DE.utf8"     LC_IDENTIFICATION="de_DE.utf8"      Does anyone know how to set custom `locale`s in Gnome3 ?


Write data to both a file and a serial port — can I use tee?

I am trying to take the input from a serial port and write it to a file and also then read the file and send it back out the serial port to the host computer. A coworker suggested using the "tee" command but I can't find a good example/wrap my mind around the command. Is it possible to do this with "tee"? it seems that tee can only do one command, like cating a file to a different place, but not cating the port then writing to the document then reading the document and then sending it over the port. Or am i just not understanding the basics of the "tee" command.


How to extend a command in bash so that it expands based on options?

I've started working with a git repository that includes a large amount of content that should be assumed readonly. So, every time I throw a new branch:               git checkout -b newBranch      it should be followed by the command               git update-index --assume-unchanged LARGE_READONLY_DIRECTORY      I figured this would be a perfect opportunity to try my fledgling bash skills, so that all I need to do at the shell is the first line, and it would execute that, then the second, without me remembering to do it (which I won't). I figured what I want to do is have a function in my .bashrc that checks whether the first argument is 'checkout', and the second it '-b'. That first check is easy, but I can't figure out how to note the presence of -b.               git() {         if [[ $1 == 'checkout' ]] && [[$2 == '-b']];                  then echo 'yep!';         fi;              command git "$@";     }      When I execute this, it complains that `[[-b: command not found`. Presumably the fact that it's an option, rather than an argument, is important here. Can anyone tell me how to check for the presence of that argument, so I know to execute the follow-up command?


Show a notification across all running X displays

Using the command line, I'd like show a notification on every running X display. ( and running console ) Something like:               notify-send-all 'Warning' 'Nuclear launch in 5 minutes, please evacuate'      Is there a program that will do this? If not, can this be implemented with bash?


Print like Firefox

Made a CLI script to print Wikipedia articles:               WIKI='https://en.wikipedia.org/w/index.php?title='     TITLE=$1     PRINTABLE='&printable=yes'          SRC=$WIKI$TITLE$PRINTABLE          HTML=$1".html"     PS=$1".ps"          wget $SRC          mv index* $HTML          html2ps $HTML > $PS          lpr -P pr1444 $PS      It works in the respect that if you write `./print Shane_Mosley` this article is printed. But, compared to using Firefox --- navigate to the site, and print from the menus --- the printed result is inferior: much less compact layout (especially tables), no pictures, and cannot handle "unusual" characters. So, my question: Is Firefox "monolithic" or is it actually composed of modular tools, that I can replicate? Or could I use Firefox as a server, that I can feed commands (like go there and print)? If no: are there ways to use my tools in a better way, or are there other tools that would enhance the result?


how do I reference a variable in fish shell with a default fallback

What is the fish shell equivalent to the following bash:               echo ${TEST:-1}      In bash this would print the value of TEST if there was one, or 1 if there was not.


CentOS vs RedHat on hp DL 380 G5

hp lists downloads for:               »   Red Hat Enterprise Linux 5 Server (x86)     »   Red Hat Enterprise Linux 5 Server (x86-64)     »   Red Hat Enterprise Linux 6 Server (x86)     »   Red Hat Enterprise Linux 6 Server (x86-64)      but only               »   CentOS 5      Since, as I understand it, CentOS is basically repackaged RHEL, is there any reason I shouldn't be able to run CentOS 6.4 x86_64 on an hp DL 380 G5, including running the management rpms meant for EL 6? (I've come across threads about CentOS 6.2 having some issues, but not 6.4.) (The management rpms are somewhat key since they would allow me to keep tabs on how the RAID array is functioning via a script, which is what I'm used to.) Can anyone confirm success/trouble with 6.4 64-bit on a G5?


Why is my tar file bigger than the directory backed up

This question did not help me (despite having the same title). So I post this even though this is a duplicate question. As far as I can tell, the total in `du -k` includes all the subdirectories and indicates I have 77 megabytes of data               /raid/fpuData/oldOutput>du -ks     77063332        .     /raid/fpuData/oldOutput>tar -cvzf ../oldOutput.tar.zip *      The backup is sill running, but already the file is considerably bigger than 77 megabytes               /raid/fpuData>ls oldOutput.tar.zip     -rw-r--r-- 1 nobody nobody 14470610944 Jul  1 22:18 oldOutput.tar.zip      The files I'm backing up are all huge text files filled with numbers, like a huge comma delimited spreadsheet). Something like this               0.3454915028125262743685653,0.5590169943749474512628694,...     0.221761776923297210251107,0.3588180924674668759166707,...     -0.06101864995889930837202897,-0.09873024958113109372792593,...     -0.3001958820500086333460388,-0.4857271404396689140625654,...     ...      Why is the `tar` file bigger than the directory? It should be compressed because I'm using the data with the `z` option. What's the point of `tar`ring it, then?


Minimizing hardware interrupts

I am using a modified Linux kernel as a soft real-time OS, on a system that has an architecture like this: ![a busy cat](http://i.imgur.com/ttKPNU9.png) CPU1 and CPU2 have 8 cores each. I have 4 processes that need to be run with minimum jitter, so **what should I do (on both OS-level and hardware configuration level) to minimize the effect of hardware interrupts on these processes**? This is what I'm doing now:   1. Bind the processes to 1 core each on CPU2.   2. Disable SAS2208 controller and connect boot disk only to the SATA controller on C602 PCH. It seems that I can disable most of the features on the C602 PCH to reduce hardware interrupts on CPU1, am I right that this is unnecessary if I isolate the processes to CPU2 (i.e. no remote memory access to DIMMs #1-1 to #1-4 and no interprocess communication between CPU1 and CPU2)?


delete line in vi

How can I delete a line in VI? Here what I am doing right now:   1. Open up the terminal `alt` + `ctrl` + `t`   2. `vi a.txt`   3. I move my cursor to the line which I wan to delete, then **what key-combination is should use to delete line in vi editor**?


Installing XVFB on Suse

I'm setting up an OpenSuse web server and need to run CutyCapt and XVFB, but can't find either in any of the repositories. I'm running OpenSuse 11.4 x64 with no desktop GUI. Any advice on where to start?


Where to download Wolfenstein: Enemy Territory for linux?

Hey Guys, I'm using KUBUNTU 10.10 I would like to use Wolfenstein: Enemy Territory for linux, I know this game is free, right? Please could someone give me the list of the last version of the game? Thank you


Ways to update Ubuntu (debian-based distros) offline

What is the easiest way to update/upgrade an offline Ubuntu machine with the help of a Windows machine that has internet access? This question also applies to installing new packages offline and not only updates/upgrades. The Linux system shall remain completely cut off from the Windows machine, meaning there should be no ethernet connection or the likes between the two computers. **Update:** Please have patience, since I haven't updated this since two weeks.   There are some complications getting apt-offline to work properly on Lubuntu and all other methods seem to be too old and deprecated: AptOff - last update 2006   AptMedium - last update 2007   Keryx - last update 2011, looks like this project was discontinued I hope I will be able to somehow update the offline machine, finally. While I was still not able to update/upgrade the offline system due to authentication errors, I accepted an answer, because it's taking too long.


Getting "A hard disk may be failing" on startup

![Error](http://i.stack.imgur.com/KQ8Qx.png) I keep getting this error message each time I start GNOME, even though I created a new partition table on this drive, I formatted all the partitions, and created them again, and this just won't go away. Any suggestions? **Edit:** I ran badblocks, and this is what I got > badblocks -svw /dev/sdb Checking for bad blocks in read-write mode From > block 0 to 80042206 Testing with pattern 0xaa: done   >  Reading and comparing: done   >  Testing with pattern 0x55: done   >  Reading and comparing: done   >  Testing with pattern 0xff: done   >  Reading and comparing: done   >  Testing with pattern 0x00: done   >  Reading and comparing: done   >  Pass completed, 0 bad blocks found


Change command-line "environment" to programs command

In a console, is it possible to change into a commands "environment"? To explain, I take "git" as an example. While programming and using a git repository, I change to the repos path and then do many "git" commands like "git x ...", "git y ... " etc. So what I want is to somehow change "into" git so that I don't have to type "git" all the time, only "x ..." and "y ...". Or is this a feature you normally wouldn't want?


Plesk 10 migration failure

I have 2 dedicated servers both running CentOS 5.3 and Plesk 10.0.0. I'm trying to migrate stuff from one to the other but it's not happening, just after I fill out "Migration settings" and press "Next" I get "Host xx.xx.xx.xx is not accessible" What I've done so far that didn't have any effect whatsoever:   * stopped the firewall on the source server   * enabled "PermitRootLogin yes" in `/etc/ssh/sshd_config`   * and restarted the service Any ideas? UPDATE: I was able to initiate the migration from the new server (which is blank) to an old one (I need vice versa), so there's definitely something relating settings. I pulled out a log file, and this is where it fails:               23117: 2011-08-22 16:34:22,949 INFO Executing <subprocess[23118] '/usr/local/psa/admin/bin/launchpad --send-scout --host=XX.XXX.XXX.XXX --login=root --session-path=/usr/local/psa/PMM/msessions/2011082216342281'>     23117: 2011-08-22 16:34:32,983 INFO Subprocess raised ExecuteException: Subprocess <subprocess[23118] '/usr/local/psa/admin/bin/launchpad --send-scout --host=XX.XXX.XXX.XXX --login=root --session-path=/usr/local/psa/PMM/msessions/2011082216342281'> was finished with exit code 10     == STDOUT ====================          == STDERR ====================     Cannot send scout to the remote host     23117: 2011-08-22 16:34:32,983 ERROR Subprocess <subprocess[23118] '/usr/local/psa/admin/bin/launchpad --send-scout --host=XX.XXX.XXX.XXX --login=root --session-path=/usr/local/psa/PMM/msessions/2011082216342281'> was finished with exit code 10     == STDOUT ====================          == STDERR ====================     Cannot send scout to the remote host     23117: 2011-08-22 16:34:32,983 INFO Outgoing packet:     <?xml version="1.0" encoding="UTF-8"?>     <response>     <errcode>130</errcode>     <errmsg>Host XX.XXX.XXX.XXX is not accessible</errmsg>     </response>


Slow down CPU when it heats up

I run Gentoo Linux on my laptop. I have an issue, though, where if I'm building some very large piece of software (as I do fairly frequently, since the purpose of this laptop is development), the CPU tends to heat up more than I'd like. I used to use `cpufreqd` to manage this, since it has an `lm_sensors` plugin and can reduce the CPU frequency once it reaches a particular temperature threshold. However, this is no longer going to be a good option, since (apparently) `cpufreqd` is no longer actively maintained, and as such is going to be removed from Gentoo's package tree. Because of this, my question is: **is there some other way I can solve this problem**? I am aware of other similar CPU frequency management daemons, as well as the drivers that are built into the Linux kernel, but as far as I know they do not manage CPU frequency _as a function of CPU temperature_.


I can open a Debian installation DVD but I can't boot the laptop from it

I recently download a DVD from http://cdimage.debian.org/debian- cd/7.6.0/amd64/iso-dvd/debian-7.6.0-amd64-DVD-1.iso and I have an old Toshiba laptop which is running old Debian system on it. After I burn a DVD for above ISO, I try to open it from the target laptop and it works fine. But after I set the laptop to boot from CD/DVD, it can never boot up and fallback to the original GRUB in the laptop. Does anyone know if it is due to I burned this DVD with a tool from Microsoft which originally used to burn Windows installation disk? Thanks!


SSH when to use public key and password?

I think I understand the difference between Public Key authentication and Password. But how do I decide which one to use and which one is most secure in what situation? Can anybody give me some real life example about when to choose public key and when to choose password?


dialog or zenity?

I am working on a project. I have two options for the GUI part. Either use **dialog** or **zenity**. I never used any of these tools before. I have to learn one of them. Suggest me which one should I learn and which will be more beneficial to learn? Which one is old and which one is new? Which one will you prefer?


Red Hat cannot boot after clone with dd

I used `dd` to clone a x4100 server with Linux Red Hat. The hardware is identical for old and new servers. Disks are `sda`, `sdb` and `sdc`(`sdc1` and `sdc2`). But newly restored server gives following errors and Linux can only be started in maintenance mode (read-only):               Red Hat nash version is starting:     shpchp: shpc_init: cannot reserve MMIO region.     shpchp: shpc_init: cannot reserve MMIO region.     shpchp: shpc_init: cannot reserve MMIO region.     shpchp: shpc_init: cannot reserve MMIO region.     Reading all physical volumes. This may take a while     (...)     /boot: ext3 recovery flag is clear but journal has data.     /boot: Run journal anyway         /boot: Unexpected inconsistency RUN fsck manually.      What might be the reason? Did I miss something during backup/restore? How can I fix the new system?


Compiling sample SFML program problems

I'm trying to compile the first sample program that comes with sfml on Fedora. First it told me that I needed to link all of the libraries properly but then I got it all configured and now I'm stuck on this error:               [jdorsey@fedora-josh sfml_test]$ g++ test.o -o test-app -lsfml-graphics -lsfml-window -lsfml-system     /usr/bin/ld: warning: libGLEW.so.1.5, needed by /usr/local/lib/libsfmlgraphics.so, not found (try using -rpath or -rpath-link)     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniform1fARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_shader_objects'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGetObjectParameterivARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_vertex_shader'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewFramebufferTexture2DEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniformMatrix4fvARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGenFramebuffersEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniform3fARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewRenderbufferStorageEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_fragment_shader'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewActiveTextureARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewShaderSourceARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `glewInit'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewBindFramebufferEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewFramebufferRenderbufferEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewLinkProgramARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUseProgramObjectARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewBlendFuncSeparateEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGenRenderbuffersEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniform2fARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniform4fARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewCreateProgramObjectARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `glewGetErrorString'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewCompileShaderARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewDeleteRenderbuffersEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewDeleteObjectARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGetUniformLocationARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGetInfoLogARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_EXT_blend_func_separate'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewDeleteFramebuffersEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewCheckFramebufferStatusEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniform1iARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_texture_non_power_of_two'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_shading_language_100'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewCreateShaderObjectARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewBindRenderbufferEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_EXT_framebuffer_object'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewAttachObjectARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGetHandleARB'     collect2: error: ld returned 1 exit status      I've got all of the glew libraries and include files in the include and lib folders in /usr/local, and I made sure to grab version 1.5, but it just isn't working. I tried adding a config file in ld.so.conf.d but I'm not sure if I'm doing everything right. The main pieces of information that I need are: Am I doing something wrong? Will adding a conf file and doing ldconfig help? How can I fix this? I ran into another question about this but none of the fixes there worked for mine.


RPM dependencies with localinstall

I need to install an rpm package on a system which has no internet access. So, let's say I already have needed dependencies. How do I install them only by running the main `rpm` package? Do they need to be in same directory as main rpm?


Why do I need GRUB_DISABLE_LINUX_UUID=true

I just switched from lilo to grub2 and my first attempt failed with `kernel panic - not syncing vfs unable to mount root fs on unknown block(0 0)`. It turned out that the problem was that the root partition was specified in terms of a UUID instead of a device name. The solution was to uncomment `GRUB_DISABLE_LINUX_UUID=true` in `/etc/default/grub`. The original auto-generated `/boot/grub/grub.conf` contained some UUID entries and some /dev entries.   * How does update-grub choose between UUID and /dev rootfs, i.e. why is it sometimes a UUID and sometimes not?   * What keeps UUIDs from working? I didn't find a kernel parameter which could be set wrongly (kernel 3.8.2)   * Do I need UUIDs in my fstab when grub uses UUIDs?


Is there a way to get apt-get to install from different distributions in one single command?

I'm building a package from source in Debian Wheezy, which has a few build- deps that cannot be satisfied by stable. Therefore, I use a few packages from unstable, testing and wheezy-backports. The best way to do these until now has been to combine the commands using "&&" and using the "-y" switch, like this:               apt-get -y -t testing install pkg1 && apt-get -y -t wheezy-backports install pkg2 && apt-get -y install pkg3      But this still makes apt-get read the package list and check for dependencies for every apt-get separated with "&&". My build-machine is quite slow, and every step takes a lot of time, and I hoped I could shave of a few minutes by saving the redundant package-list reading and dependency checking and get apt- get to do it all at once, something like this:               apt-get -t testing install pkg1, -t wheezy-backports install pkg2, install pkg3          I haven't been able to find anything about the topic, and am not too optimistic, but maybe someone knows a way?


Shell, bash, linux : after variable declaration, why semi-colon and what does it do?

Here is the line.                   variable=`ls -A $1 | grep '[abc]'; ls -1 $1`      I understand the line before the semi-colon but I do not understand how this line works after semi-colon. Does it                 after the command(variable assignment)        and then run the command after semi-colon?      Then the following line would be same?                   variable=`ls -A $1 | grep '[abc]' | ls -1 $1`      Thanks,


targeting a specific block with e2fsck to shorten wait

Recently had a LVM'd CentOS 6.5 install get accidentally cold-shutdown. On bootup, it says that the home partition need fscking:               /dev/mapper/vg_myserver-lv_home: Block bitmap for group 3072 is not in group.  (block 3335668205)          /dev/mapper/vg_myserver-lv_home: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.      ...but I guess the root partition is OK, since it gives me a shell there. So we run `e2fsck -b 32768 /dev/mapper/vg_myserver/lv_home` and after saying Yes to various fixes, on Pass 5 it just prints endless numbers to the screen, very fast. Once in a while it will print them in neat columns, and if these are block numbers, after a couple hours we are still nowhere near the first 2% being done of our 1.2 TB LV. I read that you can use `cleap_mmp` with `tune2fs`, but upon trying that, it doesn't accept cleap_mmp nor list it among valid options. My question is, how does everyone deal with a corrupt ext4 fs without weeks of downtime? Does everyone have this dilemma, or weeks of downtime vs rebuilding your server / lost data? If so why does anyone use or recommend the use of ext4? Is there some trick I'm missing that would **let me target the specific block/group it's complaining about** , so we can get on with it and mount the home fs again?


How shadow a file to point to something else?

**Case:**   * VirtualBox doesn't support Windows' symlink to be shared with host (Linux).   * actually a physical folder which contains the link is share. Everything except the symlink can be accessed.   * Have a symlink in that folder is currently the easiest for my purpose (describing the situation is not feasible). Other options are too length and chances of error are high.   * when the VB shared folder is mounted (`sudo mount -t vboxsf foo /home/apache/foo -o rw`) the symlink (`bar`) it contains is listed but it's content can't be viewed. `file /home/apache/foo/bar` returns an error saying something like > /home/apache/foo/bar: broken symbolic link to `X:\foo\bar' > > ## > > What I can do is VB share the link to which `bar` links to and mount it at > say `~/mounts/bar`. **Question:** How can I shadow `~/foo/bar` so that it actually acts as a proxy to `~/mounts/bar`? In essence shadowing `~/foo/bar`. That way if the host (Windows) shares `foo` on it's network, it's clients will be able to access the content of `foo/bar` and the host VB machine would indirectly read/write to `~/mounts/bar` while pointing at `~/foo/bar`. Actually the application expects one base data directory not multiple.


What C library version does my system use?

How can I tell for sure what userland C library my system uses? Possible reasons to need this information include:   * There's a gigantic source package I am considering downloading which I'm sure will do proper checks and lists a mininum library version, but I'd rather save myself a potential hassle by checking first if it will work.   * I am concerned about ABI compatibility with some third party binaries I want to try and install outside the system's package management system.   * I have a source package who's documentation mentions the need for a minimum version of my system's library, but the build process does not perform any checks.   * I am building a cross-compiler targeting a specific system and do not want to risk forward compatibility problems.


Environment auto-install script

When I work, I often have to switch computers or virtual machines which means that every time I switch, I have to set up my (Linux) environment again. Is there a tool (in contrast to a simple bash script) that I could use, that would automatically set up my environment? The setup would consist of installing Debian packages, importing `.bash_profile` (aliases, functions), environment variables, add lines/fill-in config files, etc...


Script ends abruptly with a Terminated message

This is my bash script. All it does is to check whether a service has started and whether some processes are running as expected. It ends abruptly with a Terminated message. I tried debugging it with the `set -x` flag, and I still dont know what is going wrong. SO and Google dont show me any other people with a similar problem. The script has permissions of 755. Some commands are obfuscated, for obvious reasons.               #!/bin/bash          set -x           DAEMON_BIN=/etc/init.d/init-god     DAEMON_BIN_START="${DAEMON_BIN} start"     DAEMON_BIN_STOP="${DAEMON_BIN} stop"     SOME_VARIABLE="foo"          CHEF_CONFIG_FILE_PATH="/path/to/file"     NODE_INFO_FILE="/mnt/node_info/properties"          function get_key_value (){         value=$(grep -Po "(?<=^${1}:).*" ${NODE_INFO_FILE})         echo $value;     }          eval $DAEMON_BIN_STOP          nohup pkill DAEMON &> /dev/null          nohup pkill -f resque &> /dev/null          eval $DAEMON_BIN_START          sleep 15          PROCESS_COUNT=`ps aux | awk '/[p]rocess-name/' | wc -l`          NODE_NAME=`get_key_value node_name`          if [[ $NODE_NAME -eq $SOME_VARIABLE  && $PROCESS_COUNT -eq 1 ]]; then          echo "DAEMON and scheduler are running fine." ;     else         echo "A problem with DAEMON has occured." ;     fi          EXPECTED_PROCESS_COUNT=`get_key_value no_of_workers`     ACTUAL_WORKER_COUNT=`ps ax | grep [r]esque-[0-9]`          if [[ $EXPECTED_PROCESS_COUNT -eq $ACTUAL_WORKER_COUNT ]]; then          echo "Correct Number of workers initialized." ;     else         echo "More workers exist than are permitted." ;     fi          for (( i=0; i<${EXPECTED_PROCESS_COUNT}; i++ )); do         WORKER_NAME=`get_key_value worker_${i}`         COUNT=`ps ax | grep ${WORKER_NAME} | grep -v grep | wc -l`         if [[ $COUNT -eq 1 ]]; then             #statements             echo "${WORKER_NAME} is running."         else             echo "${WORKER_NAME} may not be running or might have more than 1 copies."         fi     done      The debug output of the script is as follows:               + DAEMON_BIN=/etc/init.d/init-god     + DAEMON_BIN_START='/etc/init.d/init-god start'     + DAEMON_BIN_STOP='/etc/init.d/init-god stop'     + SOME_VARIABLE=foo     + CHEF_CONFIG_FILE_PATH=/path/to/file     + NODE_INFO_FILE=/mnt/node_info/properties     + eval /etc/init.d/init-god stop     ++ /etc/init.d/init-god stop     .     Stopped all watches     Stopped god     + nohup pkill DAEMON     + nohup pkill -f resque     Terminated      Why does this script exit with a Terminated message? What should I do to prevent this from happening?