What Unix programs can I *not* install when I have a standard undergraduate directory account?

I'm an undergrad in the astrophysics department and I have access to the Red Hat Linux computers, but only from an undergrad account I tried installing matplotlib once, but it was a massive pain (and I had to do it with substantial assistance) I know that I can't install anything that absolutely has to change files that are below my user directory. But what portion of programs can I then not be able to install?


Is there a maximum size to the bash history file?

Can I increase the size of the command history in bash? Note that I use a Red Hat Linux computer in the undergraduate astrophysics department here (so I don't get that many privileges).


How to configure DUAL-WAN on a Linux/*BSD machine?

I have two internet connections. The cables from the two ISP's (dhcp; 1-10/10 Mbit; 2-20/20Mbit connection) are on two interfaces: eth0 and eth1. On eth3 there is a Gbit switch and on the switch there are many clients. How do I configure the Dual-Wan? I mean I don't want that the clients get notice of that one of the ISP has failed, and "not serving internet"! So if a client runs `ping 8.8.8.8` and the cable of one of the ISP is torn apart because of a yellow monster :) then there would be no ping outage. Any Linux-based OS would do (or even *BSD!)


Command-line way of send pinging

I have lots of Drupal powered website. Each of the website has Multiping module to pinging ping server. Is there any way of send pinging through command-line? I hope I can build dedicated server for pinging.


Is it possible to change passwords temporarily?

I have a Linux system with several users. I don't know their passwords, nor do I want to know them. I have to do a batch copy of some of their directories over SSH, with their account and password. My idea was to make a backup of `/etc/shadow`, then alter it with new passwords for each user (one that I know, like "tmppass"), do my backups, then replace the `/etc/shadow` file with the old one. Will that work? If so, how do I generate the password/s? (The passwords are like $1$xxxxxx/xxxxx).


Prompting for input in post-install script in dpkg

I am writing a debian package and need to prompt the user for some textual details(default password, etc), as well as some one-of-many choices("Pick one of the following: foo, bar"). Will shell scripts run in dpkg use `read` or `select` correctly, or do I need another solution? If so, please point me to a quick guide about it(not necessarily noob-friendly).


Can't access HTTP contents, but HTTPS and SSH are fine

I'm having a weired issue wih my Fedora 14 recently. Many details involed. Let's start from this: I've been using Fedora 14 for months, and recent few days, offten I can't access Internet for hours. I can verify by a iPod Touch that connected to the same router, that the connection is fine. Say the `traceroute` below. Any tips? **-- updates --** The computer has two network devices, eth0 and wlan0. When having the problem in Linux, I can't access Internet from neither. But if booted into Windows 7 on the same machine and the same time, Internet is available via wlan0, but not eth0! It sounds like that eth0 is broken? But I can use SSH and HTTPS via eth0 under Linux. Now it's fine again. But I suspect it will happens again in few days. I'll post the tcpTraceroute then. **traceroute on Linux**               traceroute to 163.com (220.181.8.178), 30 hops max, 60 byte packets      1  * * *      2  58.246.230.1 (58.246.230.1)  6.228 ms * *      3  * * *      4  * * *      5  * * *      6  * * 112.64.243.170 (112.64.243.170)  6.627 ms      7  * * *      8  219.158.15.141 (219.158.15.141)  7.874 ms * *      9  * * *     10  * * *     11  * * *     12  * * 202.97.53.21 (202.97.53.21)  57.812 ms     13  * * *     14  220.181.16.138 (220.181.16.138)  57.633 ms * *     15  * * *     16  * * *     17  * * *     18  * * 220.181.8.178 (220.181.8.178)  59.643 ms      **traceroute on Router (Tomato)**               traceroute to 163.com (220.181.8.90), 30 hops max, 38 byte packets      1  58.246.230.1 (58.246.230.1)  2.178 ms  2.125 ms  9.450 ms      2  112.64.245.49 (112.64.245.49)  1.491 ms  1.361 ms  1.104 ms      3  112.64.245.37 (112.64.245.37)  1.647 ms  1.351 ms  1.712 ms      4  112.64.247.1 (112.64.247.1)  1.911 ms  4.424 ms  2.837 ms      5  112.64.243.170 (112.64.243.170)  2.322 ms  2.242 ms  2.126 ms      6  112.64.243.89 (112.64.243.89)  2.903 ms  2.345 ms  2.032 ms      7  219.158.21.237 (219.158.21.237)  3.180 ms  2.553 ms  2.501 ms      8  219.158.96.49 (219.158.96.49)  25.018 ms  24.734 ms  24.605 ms      9  219.158.5.82 (219.158.5.82)  24.555 ms  24.450 ms  24.473 ms     10  219.158.35.2 (219.158.35.2)  53.599 ms  77.827 ms  53.791 ms     11  202.97.53.21 (202.97.53.21)  55.111 ms  54.861 ms  55.390 ms     12  220.181.16.2 (220.181.16.2)  55.531 ms  56.193 ms  55.430 ms     13  220.181.16.138 (220.181.16.138)  52.883 ms  56.370 ms  54.770 ms     14  220.181.17.58 (220.181.17.58)  61.931 ms  51.274 ms  53.879 ms     15  220.181.8.90 (220.181.8.90)  50.331 ms  50.219 ms  50.177 ms


Disable /net ghosting for autofs5

I recently have been trying out Arch Linux. It seems that their autofs has a usability bug, although I confess that I'm new enough to Arch that I may be missing something horribly obvious. I want autofs to automagically mount hosts under `/net` like it has always done. Traditionally it used `/etc/auto.net` to accomplish this, however it seems that they've done away with this and now you simply use the following line:               /net -hosts --timeout=60      Fine and dandy, most things seem to work. However, under Arch it seems that ghosting is enabled by default. This is a bad thing, because it uses my hosts file which only contains aliases of my local host (which is NOT running an NFS server, mind you). As a result, I get all kinds of errors about being unable to mount these hosts _every time_ I run an `ls` in `/net`. Notice: I'm not using `\--ghost`, and yet it enables it by default. Arch confirms this on their wiki. This is extremely annoying, how do I _disable_ ghosting? Google has failed me horribly, any insight is appreciated. Thanks.


How do I kill 1 gnome-terminal window?

Why in the world do all my gnome terminals run under 1 process in Ubuntu? This is integrating things that should remain separated! I much prefer `xterm`'s rational mode of running one process per window. I tried to switch some auto-started windows from `xterm` to `gnome-terminal` so I can freeze a log file from scrolling while I'm looking at it. Unfortunately, I can no longer kill my log windows that are littering my desktop. Just accidentally killed every terminal I had open!!!   1. Can I kill individual `gnome-terminal` windows as if they are single shell processes? (you know, like a normal process)   OR   2. Can I stop auto-scrolling of `tail -f` inside an `xterm` by manually scrolling up, so I can read the log file while it's growing?


Applications are not using the same keyboard mappings, it seems

I’m using an american keyboard and writing in Portuguese. I updated `/etc/sysconfig/keyboard` as the following article suggested. It worked but only in the console. Firefox and Sublime Text2 shows **'+c** (ç) as **ć** , gedit shows nothing. In Firefox and Sublime Text2 the only problem is **ç** , gedit is quite different, it seems like a Brazilian ABNT2 keyboard. **OS: CentOS 6** Contents of locale:               LANG=pt_BR.UTF-8     LC_CTYPE=”pt_BR.UTF-8″     LC_NUMERIC=”pt_BR.UTF-8″     LC_TIME=”pt_BR.UTF-8″     LC_COLLATE=”pt_BR.UTF-8″     LC_MONETARY=”pt_BR.UTF-8″     LC_MESSAGES=”pt_BR.UTF-8″     LC_PAPER=”pt_BR.UTF-8″     LC_NAME=”pt_BR.UTF-8″     LC_ADDRESS=”pt_BR.UTF-8″     LC_TELEPHONE=”pt_BR.UTF-8″     LC_MEASUREMENT=”pt_BR.UTF-8″     LC_IDENTIFICATION=”pt_BR.UTF-8″     LC_ALL=      contents of `/etc/sysconfig/keyboard`               KEYTABLE=”br-latin1-us”     MODEL=”latin1-us”     LAYOUT=”br”     KEYBOARDTYPE=”pc”


Linux VPS Configuration

I just recently got my hands on a linux (Fedora) VPS and I would like to ask if there are special configurations that I have to be wary of. Do I still configure it like I would configure a normal virtual machine? Are there more things to take care of, or be cautious about because that machine is 24/7 available online, and can fall pray to those (hackers/crackers) seeking a machine to test their knowledge on? I would appreciate your input.


How to enable WIFI on VMWare Fedora 12? (It's detecting and working fine on Windows 7)

I am new to Linux. I have Fedora 12 running on my VMware. I am unable to see any options to enable WIFI connection on Fedora. When I am accessing Internet through WIFI and its working perfectly fine on Windows 7 (on which VMware is running on). Am I missing something here? Can someone help me out with this!


Earphone remote in sound jack as X input

I have got new earphones, the AKG K318's to be exact and they have one of those remotes. On a smartphone, such as an Android phone or iPhone, the buttons map to actions on the music player such as play/pause, volume up/down, skip, previous, you get the idea. I was wondering how I could replicate the same function on my computer. I imagine the process consists of getting X to recognize the input, and then somehow mapping those inputs for an application to use. The "device" (which would connect via sound jack) isn't listed in `xinput`, nor do the buttons trigger regular keyboard events. **How can I use the earphones plugged in the output sound jack as X key inputs?**


How to define a `bc` function for later use?

I've always found `bc` kind of mysterious and intriguing. It was one of _the_ original Unix programs. And it's a programming language unto itself. So I gladly take any chance I can find to use it. Since bc doesn't seem to include a factorial function, I want to define one like so:               define fact(x) {       if (x>1) {         return (x * fact(x-1))       }       return (1)          }      But... I can't then reuse that, can I? I'd want to be able to do something like               me@home$ bc <<< "1/fact(937)"


Why do we use "./" to execute a file?

Why do we use `./filename` to execute a file in linux? Why not just enter it like other commands `gcc`, `ls` etc...


What is the difference between running "bash script.sh" and "./script.sh"?

If script.sh is just something typical like               #!/bin/bash     echo "Hello World!"      Is there a preferred way to run the script? I think you first have to chmod it so it becomes executable?


Use of ./ in running the compiled code

Why do we use **./** before running a compiled code in linux? It does not seem to necessary if I am in a directory higher than the one having compiled code. Let me explain by example. If my code is in **/home/uname/code** , and I am also in the same directory, I have to use **./a.out**. But if I am in **/home/uname/** then I can use **./code/a.out**. Here I am using **./** but I think it is more to navigate through the directories and not as an indication that it has to run a code. So why do I need to use **./** to run a compiled code if I am in same directory as the code?


Why is ./filename required to run executable script?

After creating a Python script file, test.py, in my home directory, and running `chmod +x test.py` to make it executable, and placing `#!usr/bin/env` as the file header, I expected to be able to run the script from `bash` on OS X, using:               $ test.py      but `bash` returned:               -bash: test.py: command not found      The following command worked:               $ ./test.py      Why is the relative path required for this executable script in the present working directory?


What does ./ mean?

I'm having a hard time getting what `./` does. In the Linux Essentials books, it asks me in an exercise to delete a file named `-file`. After googling, I found that I need to do `rm ./-file` but I don't get why!


Why do you need the "./" when executing programs in the current directory?

> **Possible Duplicate:**   >  Why do we use "./" to execute a file? It seems redundant and gets annoying after a while -- is there a way to change this? If not, can somebody explain the reasoning behind this? Thanks!


Upstart: How to run a "stop" before stopping other services?

I recently found out about the upstart "service starter" that Ubuntu is using and that is (apparently) the future to start/stop jobs in Linux. It's pretty new to me (I was used to the old SysV system of putting scripts in `/etc/rc[X].d/`) and I don't know if it's possible to stop a service (call the service with the "`stop`" parameter, although the parameter doesn't seem to matter that much anymore) before other services are stopped. I want to run a small script that informs a remote server that the machine is shutting down. I need to run that script before the `dbus` and the `network` services are taken down. Is there any way of doing it with Upstart? Or... better said, what is the way of doing that through Upstart `.conf` files? (I'm sure there's a way, I just don't know it)


ssh-agent not starting in OpenSuSE desktop

It seems that ssh-agent is not starting on my OpenSuSE system. When I run `pgrep -fl ssh-agent`, the result is blank. On my Linux Mint laptop, I get `1785 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session x-session- manager`. How do I fix this? Can anyone with OpenSuSE check to see if it's not started up by default, or if I maybe messed something up? ### things tried... I've tried adding the following to `.xinitrc`,               if test -S "$SSH_AUTH_SOCK" -a -x "$SSH_ASKPASS"; then           ssh-add < /dev/null     fi      and my `.xsession` file contains,               ssh-agent {       ssh-add &       startkde     }      but neither of these things seems to do anything. Thanks in advance!!


Is there some way to make alias expansion work inside if...fi on Bash?

Check this script:               #!/bin/bash     if true;then         alias WeirdTest='uptime';shopt -s expand_aliases         WeirdTest     fi     WeirdTest      The first time `WeirdTest` is executed it says "command not found".


Debian Jessie GRUB2 on a multi-boot EFI laptop cannot start a Gentoo kernel-initramfs

I have an HP Pavillion Touch 14-N009LA laptop running on an AMD A8-4555M CPU, 8 GB of RAM, and a 750 GB HD, currently running on dual boot Windows 8.1 accessible via the system's EFI boot manager, and Debian Jessie accessible via a special option on my startup menu to start an OS installed under legacy BIOS mode. I am trying to install Gentoo on a dm-crypt partition and I have already set up an encrypted partition for the system's root, and a plaintext partition for the Gentoo kernel, initramfs and GRUB configuration. I have already installed the stage 3 files, Portage, compiled the kernel and generated a LUKS-capable initramfs using `genkernel --luks all`. After unsuccessfully getting the system to boot from Gentoo's GRUB2, I figured I could also boot Gentoo by adding an entry to Debian's GRUB configuration, so I edited `/etc/grub.d/40_custom` with the following:               menuentry "Gentoo Linux" {     set root=(hd0,9)     linux /kernel-genkernel-x86_64-3.12.21-gentoo-r1 cryptdevice=/dev/sda11:dm-root root=/dev/mapper/dm-root     initrd /initramfs-genkernel-x86_64-3.12.21-gentoo-r1     }      After running `update-grub2` the entry shows up just fine on the GRUB configuration. However, when I try to boot said entry, GRUB claims that it can't find the specified kernel image, even though I'm absolutely sure I'm specifying it fine. ![Debian GRUB2 error message](http://i.stack.imgur.com/5BBqE.jpg) * * * **More details about my system's configuration:** Output of `lsblk`:               NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda       8:0    0 698.7G  0 disk      ├─sda1    8:1    0   400M  0 part      ├─sda2    8:2    0   260M  0 part /boot/efi     ├─sda3    8:3    0   128M  0 part      ├─sda4    8:4    0 183.1G  0 part /media/C <Windows 8.1>     ├─sda5    8:5    0   350M  0 part      ├─sda6    8:6    0  25.2G  0 part      ├─sda7    8:7    0   1.6G  0 part /boot <Debian boot>     ├─sda8    8:8    0   8.2G  0 part [SWAP]     ├─sda9    8:9    0    40G  0 part / <Debian system root>     ├─sda10   8:10   0   4.4G  0 part <Gentoo boot>     ├─sda11   8:11   0 426.4G  0 part <Gentoo encrypted system root>     └─sda12   8:12   0   8.7G  0 part      sr0      11:0    1  1024M  0 rom        Output of `parted -l`:               Model: ATA WDC WD7500BPVX-6 (scsi)     Disk /dev/sda: 750GB     Sector size (logical/physical): 512B/4096B     Partition Table: gpt          Number  Start   End    Size    File system     Name                          Flags      1      1049kB  420MB  419MB   ntfs            Basic data partition          hidden, diag      2      420MB   693MB  273MB   fat32           EFI system partition          boot      3      693MB   827MB  134MB                   Microsoft reserved partition  msftres      4      827MB   197GB  197GB   ntfs            Basic data partition          msftdata     10      197GB   202GB  4719MB  ext2                                          msftdata     11      202GB   660GB  458GB                                                 msftdata     12      660GB   669GB  9343MB  linux-swap(v1)      7      669GB   671GB  1709MB  ext2                                          msftdata      8      671GB   680GB  8791MB  linux-swap(v1)      9      680GB   723GB  42.9GB  ext4                                          msftdata      5      723GB   723GB  367MB   ntfs                                          hidden, diag      6      723GB   750GB  27.1GB  ntfs            Basic data partition          hidden, msftdata      Contents of `/dev/sda10`, my Gentoo boot partition:               total 9436     drwxr-xr-x 4 root root    4096 Jul  1  2014 grub     -rw-r--r-- 1 root root 3916272 Jul  1  2014 initramfs-genkernel-x86_64-3.12.21-gentoo-r1     -rw-r--r-- 1 root root 3603216 Jul  1 17:16 kernel-genkernel-x86_64-3.12.21-gentoo-r1     drwx------ 2 root root   16384 Jun 30 17:09 lost+found     -rw-r--r-- 1 root root 2103510 Jul  1 17:16 System.map-genkernel-x86_64-3.12.21-gentoo-r1


How can you avoid clobbering configuration files when installing with make

When using the autotools build system and installing with `make install` how is it possible to avoid clobbering existing configuration files? I've defined a configuration file in a `Makefile.am` like so:               dist_sysconf_DATA = $(top_srcdir)/server.conf      How is it possible to define data files in such a way that `make install` will not clobber an existing version?


gpg uses temporary files, instead of pipe

I have my `/root` mounted as `read-only`. I have a script that sends an encrypted email using `gpg`. something like the following:               echo "hello" | gpg --no-verbose -e -a -r martin@example.com | mail martin@example.com      But I get an error:               gpg: failed to create temporary file `/root/.gnupg/.#dkflsfj: Read-only file system      How can I tell `gpg` not to use temporary files? I have found an option `use- temp-files` in `man gpg`               use-temp-files     On  most Unix-like platforms, GnuPG communicates with the keyserver helper program      via pipes, which is the most efficient method. This option forces GnuPG to use      temporary files to communicate. On some platforms (such as Win32  and  RISC  OS),     this  option  is  always enabled.      I don't have this option enabled in my config. Apparently, it is set by default. Is there any way I could "negate" this option? Or any other way to fix this problem? **UPDATE** : the option `no-use-temp-files` does not seem to have any effect:               echo "asdf" | gpg --keyserver-options no-use-temp-files -e -a -r martin@example.com      I still get the same error: `gpg: failed to create temporary file`/root/.gnupg/.#jkfjg': Read-only file system`


phpmyadmin in linux installation

I am trying to install **Request Tracker** tool in my **RHEL 5.6** machine.I am following the instructions as mentioned in this link. However, I am facing couple of issues. The first issue is in the below step. I have some dependency issues for php files.               # yum install  rpm* nmap expect vsftpd net-snmp* ntp* subversion subversion-devel      mysql mysql-server mysql-devel screen perl-Crypt- PasswdMD5 graphviz php-xml      php-cli php-mhash php-ldap php-devel php-pdo php-imap php-readline      php-ncurses php-soap php-snmp php-common php-mcrypt php-odbc php-mbstring      php-gd php-bcmath php php-xmlrpc php-pear php-mysql php-dba mod_perl-devel      mod_auth_mysql mod_perl mod_authz_ldap gd gd-devel gd-progs gcc*      -- exclude=gcc-java* -- exclude=gcc4-java phpmyadmin mod_fcgid perl-GD      perl-GnuPG-Interface perl-GraphViz perl-YAM       So, I tried to do the below command.               yum install php      When I do the above command, I received the below message.               Package matching php-5.1.6-40.el5_9.i386 already installed. Checking for update.     Nothing to do      So, as per the tutorial link, I needed **phpmyadmin**. So, I used the below command. It gave me the below output.               Error: Missing Dependency: php-api = 20041225 is needed by package php-mcrypt-5.1.6-5.el5.i386 (epel)     Error: Missing Dependency: php-common = 5.1.6-40.el5_9 is needed by package php-gd-5.1.6-40.el5_9.i386 (rhel-i386-server-5)      If I try to install the missing dependencies, **php-common** using yum command, I receive the below message.               Package matching php-common-5.1.6-40.el5_9.i386 already installed. Checking for update.      If I try to install the missing dependency, **php-api** using yum command, I receive the below message.               php53-common-5.3.3-21.el5.i386 from rhel-i386-server-5 has depsolving problems       --> php53-common conflicts with php-common      How can I install the phpmyadmin so that I can continue with the installation of Request tracker tool?


gparted without GUI / X

Is there a CLI gparted version without GUI / X? parted shows warnings like the following when resizing / moving partitions: > WARNING: you are attempting to use parted to operate on (resize) a file > system. parted's file system manipulation code is not as robust as what > you'll find in dedicated, file-system-specific packages like e2fsprogs. We > recommend you use parted only to manipulate partition tables, whenever > possible. Support for performing most operations on most types of file > systems will be removed in an upcoming release. or > Error: file system has incompatible feature enabled. Compatible features are > has_journal, dir_index, filetype, sparse_super and large_file Use tune2fs or > debugfs to remove features. gparted can move / resize them. I thought they were using the same libraries. Is there any alternative to parted?


Install another PHP version. Fedora 17

How can I install another PHP version? I have php 5.4.5 for now, but I need the version 5.3.15 running too. How can I perform this on Fedora 17? Without using a Virtual Machine?


Rename multiple files removing last characters and renumbering

I have a photo directory with hundreds of files named in the format:               2013-08-02 19.21.27.jpg      I wish to keep the first 10 characters (date) and append "-001", etc. being consecutive for each date. The output would be:               2013-08-02-001.jpg     2013-08-02-002.jpg     2013-08-03-001.jpg      etc. I then plan to resize the jpg's using something like:               for file in *.jpg; do convert $file -resize 900x900\> 900x900-$file; done


Rewrite module won't work on Xubuntu/Apache

I have a Xubuntu (12.10) machine with Apache and PHP servers from the apt-get repository. I need to create a simple REST service in PHP and therefore need to set up .htaccess so that arbitrary URLs would get redirected to my PHP script. I have the following FS structure               -- /var/www/       -- service/         -- .htaccess         -- index.php      I found an article online that recommends to create a syntactic error in your .htaccess file and then see if the server answers with a 500 instead of a 404. That's why I have the following .htaccess contents.               RewriteEngine on     some junk     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d      I also have the following snippet in my apache2.conf (which was there by default and I checked that it should be OK).               <Files ~ "^\.ht">         Order allow,deny         Deny from all         Satisfy all     </Files>      I have enabled the rewrite module using the `a2enmod` command. My `/etc/apache2/mods-enabled` folder therefore contains the `rewrite.load` symlink. When I hit `http://localhost/service` or `http://localhost/service/index.php` everything works fine (i.e. I get the correctly processed index.php results). When I try any other URL, though, such as `http://localhost/service/whatever` I get a 404 error page. Restarting the apache service does not help either. It seems that the Apache server is still ignoring my `.htaccess` file. What am I missing?


Is there any web browser that uses keybinding apart from uzbl?

I have just found out about uzbl but for some reason it crashes with segmentation fault when I log into gmail (Arch). I don't have the time nor the knowledge of dealing with this segmentation fault so I have thought about using another browser of that type. Are there any? Thanks.


Should I put application into /usr/local or /usr/local/share?

What are the "standards" -- should I put application (not just binary, but entire distribution) to /usr/local or /usr/local/share. For example scala or weka -- it contains examples, binaries, libraries, and so on. So it would be               /usr/local/scala-2.9.1       or               /usr/local/share/scala-2.9.1      Since I am the only admin it is not a big deal for me, but I prefer to using something which is widely used, not with my own customs. **Important:** I am not asking about cases, where you should split app into /usr/local/bin, /usr/local/lib and so on. Rather I am asking about case when you have to keep one main directory for entire application.


Why this error: "cannot create directory `foo': Permission denied"

I get this error when I try creating a directory:               [rex <03:57 PM> /var/tmp/pb82]$  mkdir foo     mkdir: cannot create directory `foo': Permission denied      But doesn't the following output indicate that I should be able to create directories there since I am a member of the www-data group to which that directory belongs?               [rex <03:57 PM> /var/tmp/pb82]$  ls -l ..     total 8     drwxrwxr-x 5 root www-data 4096 Aug  7 15:32 jinfo     drwxrwxr-x 3 root www-data 4096 Aug  7 20:43 pb82     [rex <03:58 PM> /var/tmp/pb82]$  whoami     rex     [rex <03:58 PM> /var/tmp/pb82]$  groups rex     users www-data      Edit: in response to @UlrichDangel:               [rex <04:08 PM> /var/tmp/pb82/jinfo]$  id     uid=1008(rex) gid=100(users) groups=100(users)


How to set up the DOMAIN_HOME environment variable in SUSE Linux

I am running Java NetBeans 6.9 jdk 6 on SUSE Linux (a newbie on linux) and I currently need to get the path of the weblogic domain of my Java application. I have read that I can directly access the environment variable by using this :               System.getenv("DOMAIN_HOME")      The problem is I couldn't find the `DOMAIN_HOME` environment variable (actually I have no idea on setting up the env. variable in linux). I found instructions on the internet telling me that I could set this up by setting :               Export DOMAIN_HOME = /desired_path_to_domain      Following several instructions found on the internet, I have already tried the following resolutions :   1. I wrote this on my home's .profile : **`export DOMAIN_HOME=$DOMAIN_HOME:/path_to_domain`**   2. I also wrote that on my home's .bashrc and on `/etc/bash.bashrc`   3. I executed this on the konsole printenv ... and as expected I saw the list of all the environment variables. At first, I thought it was pointed to .profile but it wasn't. It was displaying an entirely different value from what was defined on .profile when I executed the line echo #PATH ... so I concluded that my environment variables weren't defined on .profile The question is, where exactly is that printenv (environment variables) defined and how can I modify it to include my `DOMAIN_HOME` variable. Guys, I really need this. I came up posting on forums because none of the solutions above or anywhere else could solve my problem. `DOMAIN_HOME` remains null (even after restarting my linux server).


Linker error: /usr/bin/ld: cannot find -lgcc_s

I am trying to compile `symlinks` (tar.gz-file), which is a very small tool with one line for compilation:               gcc -Wall -Wstrict-prototypes -O2 -N -s -o symlinks symlinks.c      which gives the error               ....         /usr/bin/ld: cannot find -lgcc_s     /usr/bin/ld: cannot find -lgcc_s     collect2: ld returned 1 exit status      The output of               /sbin/ldconfig -p | grep libgcc      is               libgcc_s.so.1 (libc6) => /lib/i386-linux-gnu/libgcc_s.so.1      and trying to include the mentioned directory directly               gcc -Wall -Wstrict-prototypes -L /lib/i386-linux-gnu/  -O2 -N -s -o symlinks symlinks.c      produces the same error. Three questions:   1. Why does it not work with the first command, as the lib seems to be in the search path   2. Why does including the path itself does not help   3. How to fix this?


curious soft raid 5 setting inconsistency

Lately I bit the bullet and upgrade my OS from Fedora 11 to Fedora 15, and I've been trying very hard to figure out why Fedora 15 can't see the Raid setup that I created in Fedora 11. I think I must have missed something so I resort to group wisdom here. When I upgraded, I used a new boot drive for Fedora 15, so I can physically swap the boot drives and boot into either Fedora 11 or 15. Fedora 11 can still see the Raid and everything works. Fedora 15 shows something very strange. [edited to add the output of the request of @psusi ] **On Fedora 11** I had a regular boot drive (/dev/sda) and an lvm built on raid 5 (/dev/sdb, /dev/sdc, /dev/sdd). Specifically, the raid disk /dev/md/127_0 is built from /dev/sdb1, /dev/sdc1, /dev/sdd1, where each partition takes the whole disk space. The volume group of the boot drive (/dev/vg_localhost/) is irrelevant. The volume group that I created onto the raid disk is called /dev/lvm-tb-storage/. The following is the settings that I got from the system (mdadm, pvscan, lvscan, etc.)               [root@localhost ~]# cat /etc/mdadm.conf           [root@localhost ~]# pvscan       PV /dev/md127   VG lvm-tb-storage   lvm2 [1.82 TB / 0    free]       PV /dev/sda5    VG vg_localhost        lvm2 [61.44 GB / 0    free]       Total: 2 [1.88 TB] / in use: 2 [1.88 TB] / in no VG: 0 [0   ]          [root@localhost ~]# lvscan       ACTIVE            '/dev/lvm-tb-storage/tb' [1.82 TB] inherit       ACTIVE            '/dev/vg_localhost/lv_root' [54.68 GB] inherit       ACTIVE            '/dev/vg_localhost/lv_swap' [6.77 GB] inherit          [root@localhost ~]# vgdisplay       --- Volume group ---       VG Name               lvm-tb-storage       System ID                    Format                lvm2       Metadata Areas        1       Metadata Sequence No  6       VG Access             read/write       VG Status             resizable       MAX LV                0       Cur LV                1       Open LV               1       Max PV                0       Cur PV                1       Act PV                1       VG Size               1.82 TB       PE Size               4.00 MB       Total PE              476839       Alloc PE / Size       476839 / 1.82 TB       Free  PE / Size       0 / 0          VG UUID               wqIXsb-KRZQ-eRnH-JvuP-VdHk-XJTG-DSWimc            --- Volume group ---       VG Name               vg_localhost       System ID                    Format                lvm2       Metadata Areas        1       Metadata Sequence No  3       VG Access             read/write       VG Status             resizable       MAX LV                0       Cur LV                2       Open LV               2       Max PV                0       Cur PV                1       Act PV                1       VG Size               61.44 GB       PE Size               4.00 MB       Total PE              15729       Alloc PE / Size       15729 / 61.44 GB       Free  PE / Size       0 / 0          VG UUID               IVIpCV-C4qg-Lii7-zwkz-P3si-MXAZ-WYUSe6          [root@localhost ~]# vgscan       Reading all physical volumes.  This may take a while...       Found volume group "lvm-tb-storage" using metadata type lvm2       Found volume group "vg_localhost" using metadata type lvm2          [root@localhost ~]# mdadm --detail --scan     ARRAY /dev/md/127_0 metadata=0.90 UUID=bebfd467:cb6700d9:29bdc0db:c30228ba          [root@localhost ~]# ls -al /dev/md     total 0     drwxr-xr-x.  2 root root   60 2011-09-13 03:14 .     drwxr-xr-x. 19 root root 5180 2011-09-13 03:15 ..     lrwxrwxrwx.  1 root root    8 2011-09-13 03:14 127_0 -> ../md127          [root@localhost ~]# mdadm --detail /dev/md/127_0      /dev/md/127_0:             Version : 0.90       Creation Time : Wed Nov  5 18:26:25 2008          Raid Level : raid5          Array Size : 1953134208 (1862.65 GiB 2000.01 GB)       Used Dev Size : 976567104 (931.33 GiB 1000.00 GB)        Raid Devices : 3       Total Devices : 3     Preferred Minor : 127         Persistence : Superblock is persistent              Update Time : Tue Sep 13 03:28:51 2011               State : clean      Active Devices : 3     Working Devices : 3      Failed Devices : 0       Spare Devices : 0                   Layout : left-symmetric          Chunk Size : 64K                     UUID : bebfd467:cb6700d9:29bdc0db:c30228ba              Events : 0.671154              Number   Major   Minor   RaidDevice State            0       8       17        0      active sync   /dev/sdb1            1       8       49        1      active sync   /dev/sdd1            2       8       33        2      active sync   /dev/sdc1          [root@localhost ~]# cat /proc/mdstat      Personalities : [raid6] [raid5] [raid4]      md127 : active raid5 sdb1[0] sdc1[2] sdd1[1]           1953134208 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]          unused devices: <none>          [root@localhost ~]# mdadm --examine /dev/sdb1     /dev/sdb1:               Magic : a92b4efc             Version : 0.90.00                UUID : bebfd467:cb6700d9:29bdc0db:c30228ba       Creation Time : Wed Nov  5 18:26:25 2008          Raid Level : raid5       Used Dev Size : 976567104 (931.33 GiB 1000.00 GB)          Array Size : 1953134208 (1862.65 GiB 2000.01 GB)        Raid Devices : 3       Total Devices : 3     Preferred Minor : 127              Update Time : Tue Sep 13 03:29:50 2011               State : clean      Active Devices : 3     Working Devices : 3      Failed Devices : 0       Spare Devices : 0            Checksum : f1ddf826 - correct              Events : 671154                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     0       8       17        0      active sync   /dev/sdb1             0     0       8       17        0      active sync   /dev/sdb1        1     1       8       49        1      active sync   /dev/sdd1        2     2       8       33        2      active sync   /dev/sdc1          [root@localhost ~]# fdisk -lu 2>&1     Disk /dev/dm-0 doesn't contain a valid partition table     Disk /dev/dm-1 doesn't contain a valid partition table     Disk /dev/md127 doesn't contain a valid partition table     Disk /dev/dm-2 doesn't contain a valid partition table          Disk /dev/sda: 250.0 GB, 250000000000 bytes     255 heads, 63 sectors/track, 30394 cylinders, total 488281250 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0x00000080            Device Boot      Start         End      Blocks   Id  System     /dev/sda1              63      610469      305203+  83  Linux     /dev/sda2          610470   359004554   179197042+  83  Linux     /dev/sda3   *   359004555   359414154      204800   83  Linux     /dev/sda4       359422245   488279609    64428682+   5  Extended     /dev/sda5       359422308   488278371    64428032   8e  Linux LVM          Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0xb03e1980            Device Boot      Start         End      Blocks   Id  System     /dev/sdb1              63  1953134504   976567221   da  Non-FS data          Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0x7db522d5            Device Boot      Start         End      Blocks   Id  System     /dev/sdc1              63  1953134504   976567221   da  Non-FS data          Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0x20af5840            Device Boot      Start         End      Blocks   Id  System     /dev/sdd1              63  1953134504   976567221   da  Non-FS data          Disk /dev/dm-0: 58.7 GB, 58707673088 bytes     255 heads, 63 sectors/track, 7137 cylinders, total 114663424 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0x00000000               Disk /dev/dm-1: 7264 MB, 7264534528 bytes     255 heads, 63 sectors/track, 883 cylinders, total 14188544 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0x00000000               Disk /dev/md127: 2000.0 GB, 2000009428992 bytes     2 heads, 4 sectors/track, 488283552 cylinders, total 3906268416 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0x00000000               Disk /dev/dm-2: 2000.0 GB, 2000007725056 bytes     255 heads, 63 sectors/track, 243153 cylinders, total 3906265088 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0x00000000      The kernel boot parameter that I have               kernel /vmlinuz-2.6.30.10-105.2.23.fc11.x86_64 ro root=/dev/mapper/vg_localhost-lv_root rhgb quiet      **On Fedora 15** I installed Fedora 15 on a new boot drive, on which the installation program also created an lvm (/dev/vg_20110912a/) for me, but again that's irrelevant. Under Fedora 15, `lvm`, `pvscan`, `vgscan` see nothing but the irrelevant boot drive. `mdadm`, however, shows something very strange -- the original raid is broken into three raid, and the combination is very puzzling.               [root@localhost ~] # cat /etc/mdadm.conf     # mdadm.conf written out by anaconda     MAILADDR root     AUTO +imsm +1.x -all          [root@localhost ~]# pvscan       PV /dev/sda2   VG vg_20110912a   lvm2 [59.12 GiB / 0  free]       Total: 1 [59.12 GiB] / in use: 1 [59.12 GiB] / in no VG: 0 [0   ]          [root@localhost ~]# lvscan       ACTIVE            '/dev/vg_20110912a/lv_home' [24.06 GiB] inherit       ACTIVE            '/dev/vg_20110912a/lv_swap' [6.84 GiB] inherit       ACTIVE            '/dev/vg_20110912a/lv_root' [28.22 GiB] inherit          [root@localhost ~]# vgdisplay       --- Volume group ---       VG Name               vg_20110912a       System ID                 Format                lvm2       Metadata Areas        1       Metadata Sequence No  4       VG Access             read/write       VG Status             resizable       MAX LV                0       Cur LV                3       Open LV               3       Max PV                0       Cur PV                1       Act PV                1       VG Size               59.12 GiB       PE Size               32.00 MiB       Total PE              1892       Alloc PE / Size       1892 / 59.12 GiB       Free  PE / Size       0 / 0          VG UUID               8VRJyx-XSQp-13mK-NbO6-iV24-rE87-IKuhHH          [root@localhost ~]# vgscan       Reading all physical volumes.  This may take a while...       Found volume group "vg_20110912a" using metadata type lvm2          [root@localhost ~]# mdadm --detail --scan     ARRAY /dev/md/0_0 metadata=0.90 UUID=153e151b:8c717565:fd59f149:d2ea02c9     ARRAY /dev/md/127_0 metadata=0.90 UUID=bebfd467:cb6700d9:29bdc0db:c30228ba          [root@localhost ~]# ls -l /dev/md     total 4     lrwxrwxrwx. 1 root root   8 Sep 13 02:39 0_0 -> ../md127     lrwxrwxrwx. 1 root root  10 Sep 13 02:39 0_0p1 -> ../md127p1     lrwxrwxrwx. 1 root root   8 Sep 13 02:39 127_0 -> ../md126     -rw-------. 1 root root 120 Sep 13 02:39 md-device-map          [root@localhost ~]# cat /dev/md/md-device-map     md126 0.90 bebfd467:cb6700d9:29bdc0db:c30228ba /dev/md/127_0     md127 0.90 153e151b:8c717565:fd59f149:d2ea02c9 /dev/md/0_0          [root@localhost ~]# mdadm --detail /dev/md/0_0     /dev/md/0_0:             Version : 0.90       Creation Time : Tue Nov  4 21:45:19 2008         Raid Level : raid5         Array Size : 976762496 (931.51 GiB 1000.20 GB)       Used Dev Size : 976762496 (931.51 GiB 1000.20 GB)        Raid Devices : 2       Total Devices : 2     Preferred Minor : 127         Persistence : Superblock is persistent              Update Time : Wed Nov  5 09:04:28 2008             State : clean      Active Devices : 2     Working Devices : 2      Failed Devices : 0       Spare Devices : 0                  Layout : left-symmetric         Chunk Size : 64K                  UUID : 153e151b:8c717565:fd59f149:d2ea02c9             Events : 0.2202              Number   Major   Minor   RaidDevice State         0       8       48      0   active sync   /dev/sdd         1       8       16      1   active sync   /dev/sdb          [root@localhost ~]# mdadm --detail /dev/md/127_0     /dev/md/127_0:             Version : 0.90       Creation Time : Wed Nov  5 18:26:25 2008         Raid Level : raid5         Array Size : 1953134208 (1862.65 GiB 2000.01 GB)       Used Dev Size : 976567104 (931.33 GiB 1000.00 GB)        Raid Devices : 3       Total Devices : 2     Preferred Minor : 126         Persistence : Superblock is persistent              Update Time : Tue Sep 13 00:39:51 2011             State : clean, degraded      Active Devices : 2     Working Devices : 2      Failed Devices : 0       Spare Devices : 0                  Layout : left-symmetric         Chunk Size : 64K                  UUID : bebfd467:cb6700d9:29bdc0db:c30228ba             Events : 0.671154              Number   Major   Minor   RaidDevice State         0   259     0       0   active sync   /dev/md/0_0p1         1       0       0       1   removed         2       8       33      2   active sync   /dev/sdc1          [root@localhost ~]# cat /proc/mdstat     Personalities : [raid6] [raid5] [raid4]     md126 : active (auto-read-only) raid5 md127p1[0] sdc1[2]         1953134208 blocks level 5, 64k chunk, algorithm 2 [3/2] [U_U]          md127 : active (auto-read-only) raid5 sdb[1] sdd[0]         976762496 blocks level 5, 64k chunk, algorithm 2 [2/2] [UU]          unused devices: <none>          [root@localhost ~]# mdadm --examine /dev/sdb1     /dev/sdb1:             Magic : a92b4efc             Version : 0.90.00             UUID : bebfd467:cb6700d9:29bdc0db:c30228ba       Creation Time : Wed Nov  5 18:26:25 2008         Raid Level : raid5       Used Dev Size : 976567104 (931.33 GiB 1000.00 GB)         Array Size : 1953134208 (1862.65 GiB 2000.01 GB)        Raid Devices : 3       Total Devices : 3     Preferred Minor : 127              Update Time : Tue Sep 13 00:39:51 2011             State : clean      Active Devices : 3     Working Devices : 3      Failed Devices : 0       Spare Devices : 0         Checksum : f1ddd04f - correct             Events : 671154                  Layout : left-symmetric         Chunk Size : 64K              Number   Major   Minor   RaidDevice State     this    0       8       17      0   active sync   /dev/sdb1             0    0       8       17      0   active sync   /dev/sdb1        1    1       8       49      1   active sync   /dev/sdd1        2    2       8       33      2   active sync   /dev/sdc1          [root@localhost ~]# fdisk -lu 2>&1     Disk /dev/mapper/vg_20110912a-lv_swap doesn't contain a valid partition table     Disk /dev/mapper/vg_20110912a-lv_root doesn't contain a valid partition table     Disk /dev/md127 doesn't contain a valid partition table     Disk /dev/mapper/vg_20110912a-lv_home doesn't contain a valid partition table          Disk /dev/sda: 64.0 GB, 64023257088 bytes     255 heads, 63 sectors/track, 7783 cylinders, total 125045424 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x0001aa2f            Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048     1026047      512000   83  Linux     /dev/sda2         1026048   125044735    62009344   8e  Linux LVM          Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0xb03e1980            Device Boot      Start         End      Blocks   Id  System     /dev/sdb1              63  1953134504   976567221   da  Non-FS data          Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x7db522d5            Device Boot      Start         End      Blocks   Id  System     /dev/sdc1              63  1953134504   976567221   da  Non-FS data          Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x20af5840            Device Boot      Start         End      Blocks   Id  System     /dev/sdd1              63  1953134504   976567221   da  Non-FS data          Disk /dev/mapper/vg_20110912a-lv_swap: 7348 MB, 7348420608 bytes     255 heads, 63 sectors/track, 893 cylinders, total 14352384 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000               Disk /dev/mapper/vg_20110912a-lv_root: 30.3 GB, 30299652096 bytes     255 heads, 63 sectors/track, 3683 cylinders, total 59179008 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000               Disk /dev/md127: 2000.0 GB, 2000009428992 bytes     2 heads, 4 sectors/track, 488283552 cylinders, total 3906268416 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 65536 bytes / 131072 bytes     Disk identifier: 0x00000000               Disk /dev/md126: 1000.2 GB, 1000204795904 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953524992 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 65536 bytes / 65536 bytes     Disk identifier: 0x20af5840               Device Boot      Start         End      Blocks   Id  System     /dev/md126p1              63  1953134504   976567221   da  Non-FS data     Partition 1 does not start on physical sector boundary.          Disk /dev/mapper/vg_20110912a-lv_home: 25.8 GB, 25836912640 bytes     255 heads, 63 sectors/track, 3141 cylinders, total 50462720 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000      My kernel boot parameter:               kernel /vmlinuz-2.6.40.4-5.fc15.x86_64 ro root=/dev/mapper/vg_20110912a-lv_root rd_LVM_LV=vg_20110912a/lv_root rd_LVM_LV=vg_20110912a/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet rdblacklist=nouveau nouveau.modeset=0 nodmraid      The last `mdadm --examine /dev/sdb1` shows exactly the same result as in Fedora 11, but I don't understand why `mdadm --detail /dev/md/0_0` shows only /dev/sdb and /dev/sdd, and `mdadm --detail /dev/md/127_0` shows /dev/sdc1 and /dev/md/0_0p1 . Since `mdadm --examine /dev/sdb1` shows the correct result, Fedora 15 is able to access the raid somehow, but I am not sure what to do. Shall I create/assembly a new raid /dev/md2 and hope that the `lvm` that I had created will magically show up? Thank you in advance.


Increase Space of /usr directory in Cent OS

On my CentOS 5 server, `fdisk -l` outputs:               Disk /dev/xvda: 100.0 GB, 100000595968 bytes     255 heads, 63 sectors/track, 12157 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes          Device Boot      Start         End      Blocks   Id  System     /dev/xvda1               1         487     3911796   83  Linux     /dev/xvda2             488         731     1959930   82  Linux swap / Solaris     /dev/xvda3             732       12157    91779345   8e  Linux LVM      and `df -h` outputs:               Filesystem            Size  Used Avail Use% Mounted on     /dev/xvda1            3.7G  1.4G  2.4G  37% /     /dev/mapper/vg00-usr  4.0G  4.0G   20K 100% /usr     /dev/mapper/vg00-var  4.0G  440M  3.6G  11% /var     /dev/mapper/vg00-home 4.0G  269M  3.8G   7% /home     none                  512M  1.4M  511M   1% /tmp     tmpfs                 512M     0  512M   0% /usr/local/psa/handlers/before-local     tmpfs                 512M     0  512M   0% /usr/local/psa/handlers/before-queue     tmpfs                 512M     0  512M   0% /usr/local/psa/handlers/before-remote     tmpfs                 512M   16K  512M   1% /usr/local/psa/handlers/info     tmpfs                 512M     0  512M   0% /usr/local/psa/handlers/before-local     tmpfs                 512M     0  512M   0% /usr/local/psa/handlers/before-queue     tmpfs                 512M     0  512M   0% /usr/local/psa/handlers/before-remote     tmpfs                 512M   16K  512M   1% /usr/local/psa/handlers/info     tmpfs                 512M     0  512M   0% /usr/local/psa/handlers/spool      My `/usr` drive doesn't have any free space, but `fdisk` shows 100GB of unused space. Can I use that space to increase the capacity of the `/usr` directory? How? And how can I remove unwanted files from `/usr`?


How to iterate through a list of files with spaces that is sorted (case insensitive)?

I am doing this in OSX which uses bash but obviously, not all bash conventions are used so hopefully your suggestion is available to me :) I have the following files   1. `fun bar1.txt`   2. `Foo bar2.tXT` (that's an uppercase XT)   3. `fun fun.txt` What I was is to iterate through the file list in a sorted manner? something like:               for i in (my-sorted-file-list); do         echo $i     done      Any ideas how this can be done? thanks a lot


How to paste same information into 2 different files?

I'd like to create two files in `/etc/skel` using a script which does many other things in addition to the creation of the files in `/etc/skel`. The part from script regarding `/etc/skel` looks like this:               cat <<EOF > /etc/skel/.vimrc     :set nu     set incsearch     :set ignorecase     :set smartcase     :set ts=2     EOF      I tried adding `&& /etc/skel/.virc` on the end of the first line in the script but to no avail. Is there any way to do that other than doing the whole `cat` again into the other file?


How to disable a mouse movement input, while leaving mouse buttons enabled?

I have a mouse I just use for the buttons. I want to disable only the movement input of the mouse. Physically covering the sensor doesn't work.


How to randomize the output from seq?

I know I can use seq to generate a random list of numbers 1, 2, 3, 4... I want to get those numbers into a random order like 3, 1, 4, 2... I know I can use shuf to shuffle the lines of a file. So I could use seq to write random numbers to a file and then use shuf to shuffle them -- or write some sort of shuffle function. But this seems needlessly complex. Is there a simpler way to randomize the items in an array with a single command?


Does watch only monitor the visible output?

Does `watch` only monitor the visible output of a command? Say I'm in a directory with the following contents:               $ ls     a  b  c  d  e  f  g  h  i  j  k  l  m  n      If I run `watch -g ls -1` I expect it to exit if a file is added or removed. What actually happens is that it exits _only_ if the file in question is visible in the terminal output of `watch`:               $ watch -g ls -1     Every 2.0s: ls -1                                                                 Wed Nov 13 16:35:03 2013          a     b     c     d     e     f      Deleting the file `m` which is not visible because of the size of my terminal does nothing. Deleting a visible file, say `d`, causes `watch` to exit as expected. The `-g` flag is explained thusly in my `man` page:                  -g, --chgexit               Exit when the output of command changes.      What's going on? Is this normal? How can I use `watch` for commands with long output? I am using `watch from procps-ng 3.3.4` which was installed from the Debian repos.


Why do I need to specify two init images - initrd and boot - inside KVM to boot to bash?

My machine is running inside a KVM virtual machine (Parallels Desktop v8), having a BIOS (not UEFI), having one SATA drive connected, one GPT partition on that disk, the partition is ext4 formatted, the bootloader is extlinux v. 4.05, and the kernel is Ubuntu 13.10 package linux-image-3.11.0-18-generic. The system boots to (initramfs) prompt when only `initrd` and no `boot` argument is specified:               (initramfs) cat /proc/cmdline     initrd=/boot/initrd.img-3.11.0-18-generic ro quiet BOOT_IMAGE=/boot/vmlinuz-3.11.0-18-generic      Only after inserting `boot=/dev/sda1` the system boots to bash prompt, as pointed out in the answer of question How to fix boot into initramfs prompt and "mount: can't read '/etc/fstab': No such file or directory" and "No init found"? I have read that the kernel is usually able to find its boot partition without additional configuration. Environment:               $ sudo efibootmgr     Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.     $ sudo modprobe efivars     (no result)      Faulty (initramfs) prompt:               mount: can't read '/etc/fstab': No such file or directory     mount: mounting /dev on /root/dev failed: No such file or directory     mount: mounting /sys on /root/sys failed: No such file or directory     mount: mounting /proc on /root/proc failed: No such file or directory     The filesystem doesn't have requested /sbin/init.     No init found. Try passing init= bootarg.          (initramfs) cd /root || mkdir /root     (initramfs)      ### Update #1 - (initramfs) echo $(pwd) output               (initramfs) cd /root && echo $(pwd) || mkdir /root?     /root     (initramfs)      ### Update #2 - (initramfs) ls /dev output               (initramfs) ls /dev     vga_arbiter rfkill mem null port zero full random urandom kmsg tty console     tty0-tty63 vcs vcsa vcs1 vcsa1 snapshot ecryptfs fuse ptmx ttyS0-ttyS31     ttyprintk hpet ram0-ram15 loop-control loop0-loop7 net ppp bus input psaux     uinput rtc0 mapper mcelog cpu_dma_latency network_latency network_throughput     pts core fd stdin stdout stderr btrfs-control char rtc sg0 bsg sda sda1      ### Update #3 - (initramfs) ls / && ls /*/ output               (initramfs) ls /     dev root conf bin etc sbin run init lib64 scripts lib sys proc tmp var     (initramfs) ls /*/     /var/:     lock          /tmp/:          /sys/:     hypervisor kernel power block dev fs module firmware class devices bus          /scripts/:     panic init-bottom local-premount nfs functions local init-top          /sbin/:     blkid wait-for-root rmmod hwclock udevadm dumpe2fs modprobe          /run/:          /root/:          /proc/:     1-130 142-148 167-169 219-231 233 243-245 248 self ounts net sysvipc fs     driver tty bus sys cgroups irq mtrr fb acpi misc scsi mdstat execdomains     ioports imem schedstat sched_debug timer_list timer_stats dma modules     kallsyms latency_stats buddyinfo pagetypeinfo vmstat zoneinfo slabinfo     vmallocinfo swaps filesystems locks cmdline consoles cpuinfo devices      interrupts loadavg meminfo stat uptime version softirqs kcore kmsg      kpagecount kpageflags version_signature key-users crypto diskstats     partitions sysrq-trigger          /lib64/:     ld-linux-x86-64.so.2          /lib/:     udev klibc-dev6iJxsMLkI8yu6xMVSFDIuVsJk.so x86_64-linux-gnu modules firmware systemd          /etc/:     modprobe.d ld.so.conf.d udev ld.so.conf ls.so.cache mtab          /dev/:     ...see above...          /conf/:     initramfs.conf arch.conf conf.d          /bin/:     kmod udevadm dmesg busybox poweroff fstype losetup ipconfig reboot halt sh     run-init pivot-root date dd insmod nfsmount sleep mount cpio resume      ### Update #4 - ls /scripts/* /conf/* /sys/firmware/*/ output               (initramfs) ls /scripts/* /conf/* /sys/firmware/*/     /scripts/functions /scripts/local /scripts/nfs /conf/initramfs.conf /conf/arch.conf            /sys/firmware/memmap/:     9 8 7 6 5 4 3 2 1 0          /sys/firmware/acpi/:     hotplug tables pm_profiles interrupts          /conf/conf.d:          /scripts/panic:     ORDER keymap          /scripts/local-premount:     ORDER fixrtc resume          /scripts/init-top:     ORDER all_generic_ide blacklist udev          /scripts/init-bottom:     ORDER udev      Why isn't the kernel not able to find the boot partition in this case?


Equivalent of VINO in Red Hat

Vino is a VNC server which is installed by default on Ubuntu (Debian family). Is there a VNC Server installed by default on Red Hat, is it the same?


GNU Screen doesn't echo unicode characters correct

When I do this in my terminal:               echo -e "\xF0\x9f\x8d\xba"      I get a cool beer mug in my terminal: However, when I start screen, and try the same, I'm getting a �. How do I get the nice beer mug? This is my .screenrc:               nethack on     startup_message off     defscrollback 3000     hardstatus on     hardstatus alwayslastline     hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %c"     termcapinfo xterm 'bc@:bs@'     ignorecase on     maptimeout 0     vbell off     defutf8 on     defencoding utf8      Also running screen with the `-U` option doesn't help.


Can 32-bit and 64-bit CentOS 6.4 servers both be AD domain controllers for the same domain?

If I have two CentOS 6.4 servers, one i386 and the other x86_64, running Samba 4.0.7, will they replicate domain controller data with each other (and from a Windows Server 2003 AD DC) without any special setup? Can anyone confirm this or a similar setup as having worked?


Running VNC viewer without opening a console

Right now I have to open a console and type:               xtightvncviewer [ip-address]      to open the viewer. That's okay, but then I need to leave the console open or otherwise the viewer will close. I've tried:               nohup xtightvncviewer [ip-address] &      and:               xtightvncviewer [ip-address]     [ctrl-Z]     bg      In both cases, it pops up a little password dialog, and opens the viewer, but it's still dependent on the console being open. Is there a way to open xtightvncviewer as "headless"?


Why does "cat ttyUSB0" not produce output?

I connected an infrared receiver to a USB port ... (the last line of dmesg tells device file)               $ dmesg     [10496.596063] usb 7-2: new full-speed USB device number 2 using uhci_hcd     [10496.751112] usb 7-2: New USB device found, idVendor=0df7, idProduct=0620     [10496.751117] usb 7-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0     [10496.751120] usb 7-2: Product: USB-Serial Controller     [10496.751124] usb 7-2: Manufacturer: Prolific Technology Inc.     [10496.787441] usbcore: registered new interface driver usbserial     [10496.787467] usbcore: registered new interface driver usbserial_generic     [10496.787483] usbserial: USB Serial support registered for generic     [10496.795104] usbcore: registered new interface driver pl2303     [10496.795129] usbserial: USB Serial support registered for pl2303     [10496.795160] pl2303 7-2:1.0: pl2303 converter detected     [10496.807238] usb 7-2: pl2303 converter now attached to ttyUSB0      Then I went on to try it ...               $ sudo cat /dev/ttyUSB0      but no output, simply hangs. Even though, as I press any button on my remote control, the infrared receiver device's LED flashes, so that does seem to work. Why could that be? * * * notes:   * the above command quits when I remove device from USB port and prints "cat: ttyUSB0: No such device", and dmesg prints 3 lines:               [13707.264086] usb 7-2: USB disconnect, device number 2       [13707.264894] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0      [13707.264915] pl2303 7-2:1.0: device disconnected)        * with the device files for keyboard this works, eg:                $ sudo cat /dev/input/by-id/usb-USB_USB_Keykoard-event-kbd       produces many weird characters on the console as I press any key the keyboard   * same happens on other USB ports too


A shell-like environment for binary processing

This question came to me a couple of times before, now in response to the question Loop through binary data chunks from stdin in Bash Answers given in http://stackoverflow.com/questions/993434/what-language-is-to-binary-as-perl- is-to-text were also not satisfactory. I'm looking for a scripting environment suited specifically to handle I/O with binary files. I know I can use one of the fully-fledged programming languages (c/Python/...) but they have an enormous initialization and coding overhead (allocation and fread/fwrite in c, bitstrings in Python...) not to mention they are less suited for scripting (calling other applications from it). Perl is no better with its `unpack` functions, string-oriented operation and goofy syntax. Something like `od`, but as a language. What I expect:   1. set or change endianness with a single switch/command.   2. simple specification of requested type (something like extending bash `read var` with `int32 var`, `float var` etc.).   3. handling of binary through pipes, skipping of specified number of bytes.   4. standard scripting flow control (for/if/...) that we are used to. I'd like to process raw data (photography, scientific data, unknown and poorly documented formats) with the same ease and insight that you get when inspecting ASCII files. I'm using `c` now, but it's not optimal for ad-hoc scripting, and can't be interactive. Does anyone know a tool like that? No clicky GUI software, please, it needs to work over ssh, from other scripts and so on. "Does not exist" is an acceptable, but depressing answer.


Different between `ulimit -e` and `renice`?

I would like to run a backup script in low CPU and disk I/O. Is there any different between this:               #!/bin/bash          ulimit -e 19     ionice -c3 -p $$      and this:               #!/bin/bash          ionice -c3 -p $$     renice -n 19 -p $$


present users a login prompt? /bin/login? getty?

I have a service that execs a command when a user connects to it through a socket, and redirects everything it receives to the executed program. It works ok with shells like bash, giving the user a remote shell. Instead of forking bash or sh, I'd like to run something that asks for user and password, like `/bin/login` Is that the correct command to run? Isn't there anything that a non-root service could use to do the same? I thinks `getty` calls `/bin/login`, but can I just run it as a user? I guess I could install telnetd and redirect to `telnet localhost` but I'd rather not run a telnet server.


How to install language support in TexLive on Debian Wheezy?

I'd like to use the babel-croatian package which is available for download on CTAN. But how do I install this package? Or perhaps there is a command-line way?


Multiple instances of Postfix throwing error fatal: unknown service: smtp/tcp

I am trying to configure multiple postfix-2.12 instances on FreeBSD 10.0-RELEASE following the README.               postmulti -e init     postmulti -I postfix-out -G mta -e create     ...      This all works I can start and stop instances everything seems good. When I test sending an email locally using telnet. Postfix logs the following `fatal: unknown service: smtp/tcp` error. The configuration files are vanilla no chroot in master.cf.                mynetworks = 127.0.0.1/8 192.168.5.0/24      If I run postfix as a single instance everything works fine. So postfix can read `/etc/services` when run as a single instance. The spool directory that is created with postmulti looks identical to postfix spool dir. I have been hammering at this for way too long. Has anyone implemented multiple instances of postfix on FreeBSD or can give some suggestions?


How to install libevent tmux?

I've been trying to install libevent / ncurses / tmux into '$HOME/local', but am having an issue running .configure for tmux. What I am trying to do is install it as follows:               TMUX_VERSION=1.8     ############     # libevent #     ############     tar xvzf libevent-2.0.19-stable.tar.gz     cd libevent-2.0.19-stable     ./configure --prefix=$HOME/local --disable-shared     make     make install     cd ..          ############     # ncurses  #     ############     tar xvzf ncurses-5.9.tar.gz     cd ncurses-5.9     ./configure --prefix=$HOME/local     make     make install     cd ..          ############     # tmux     #     ############     tar xvzf tmux-${TMUX_VERSION}.tar.gz     cd tmux-${TMUX_VERSION}     ./configure CFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses" LDFLAGS="-L$HOME/local/lib -L$HOME/local/include/ncurses -L$HOME/local/include"      I've managed to get this far, but keep getting an error with the line above saying it can't find libevent. Now I have checked $HOME/local/lib and it contains the following files:               libevent.a            libevent_core.la      libevent_pthreads.a   libform_g.a           libncurses++.a        libpanel.a            terminfo libevent.la           libevent_extra.a      libevent_pthreads.la  libmenu.a             libncurses.a          libpanel_g.a libevent_core.a       libevent_extra.la     libform.a   libmenu_g.a           libncurses_g.a        pkgconfig      So it looks like libevent is installed. The rest of the code is below, which I haven't got to just yet. CPPFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses" LDFLAGS="-static -L$HOME/local/include -L$HOME/local/include/ncurses -L$HOME/local/lib" make cp tmux $HOME/local/bin cd .. Anyone know what the issue could be? Thanks!


How to backup /etc/{,g}shadow files with 0000 permission?

I am trying to backup several servers' `/etc` by using `rsync` from another server. Here's a relevant snippet:               PRIVKEY=/path/to/private.key     RSYNC_OPTS="--archive --inplace --no-whole-file --quiet"     ssh -n -i $PRIVKEY root@${ip} "rsync $RSYNC_OPTS /etc 192.168.25.6::"'$(hostname)'      where `${ip}` is the IP Address of the server to be backed up, while `192.168.25.6` is the IP Address of the server holding the backup. Everything went well, except for `/etc/{,g}shadow` files on some servers. Since their permissions are `0000`, rsync seems to not want to read them ("Permission denied (13)" errors). A quick check using the following:               ssh -i $PRIVKEY root@${ip} "cat /etc/{,g}shadow"      successfully dumped the files. Is there a way to get round this rsync limitation? * * * **EDITs** The backup server is Ubuntu 12.04. The servers to be backed up are a smorgasbord of Ubuntu, RHEL, OEL, and CentOS servers. I've tried adding `-t` to the ssh options, and prefixed rsync with `sudo`, but still have the same errors.


what is the structure of a linux process? In linux there are processes executed on a address and which use system resources. Can anyone tell me the structure of a process and which parameter processes share during execution?


How to know if /dev/hda2 is Primary partition or Extended partition

If all four primary partitions exist on an IDE drive, they are numbered as follows:   * /dev/hda1   * /dev/hda2   * /dev/hda3   * /dev/hda4 We have also the partitions on a disk with one primary partition and the sole extended partition might be numbered as follows:   * /dev/hda1 (primary)    * /dev/hda2 (extended) This naming strategy leads to confusion :   How it is named : `/dev/hda2` in both of cases :   * Primary partition   * Extended Partition Another way to express the issue : How to distinct if it is primary or extended partition


How to create a Debian live USB with persistence?

I would like to use Debian wherever I go by installing it on a USB flash drive, but I'm not sure how to make it save the settings and be able to install/update packages without loosing them on reboots. So I downloaded a Hybrid ISO image from this link, and I followed the instructions in the FAQ:               dd if=image.iso of=/dev/sdb bs=4M; sync      This command copied the image to the flash drive by creating a partition which size is the same as the ISO image (1.3 GB out of 8GB), and the rest of the flash drive is unallocated. I searched on how to do this, but every tutorial uses a different approach and some of them are outdated and talk about the old usb-hdd image. So how should I install this hybrid image on the flash drive ? How should I partition my flash drive to be able to install packages and save settings ? and how can I install this image without using `dd` ?


Why are rules not combining in an ssh config file?

It seems like the following would work as expected, i.e., that the second rule, having a hostname that matches the first rule, would apply it.               Host *.hostname.com      User myuser      IdentityFile ~/.ssh/myidentity          Host blah      HostName complicated.hostname.com      However typing `ssh blah` only applies the second rule (and not the user or identity file of the first one). I have two questions:   1. Why is this happening?   2. Is it possible to (simply) do what I am trying to do?


Arguments, options and dashes

Why do console applications get the arguments started with either:               a) one dash (myapp -arg1 123; ls -al)     b) two dashes (myapp --arg1 123; git push origin master --force)     c) without dashes at all (myapp 123; man ls)     d) without dashes but with the equal sign (myapp arg1=123; dd if=/dev/zero)      Isn't there a standard convension? Even among the standard Linux applications all three cases a), b) and d) do exist at the same time. And it's tough to remember when I should use, for example, `-help` and when `\--help`.


user input not accepted in nested case statement

I am trying to create a nested case statement in which user input is expected (Y/N). However, the system never waits for the input and always goes to the third option, "Please answer yes or no". Can anyone tell me what I am missing? Here is the case statement                #!/bin/bash          SERVSTAT=/mnt/support/scripts/log/serverstatus.txt     FUSE_PATH=/home/jet/instances/     LOG=data/log/karaf.log     echo " " >  $SERVSTAT     STATUS=status          find /etc/init.d/* -name '*service' -print0 | while IFS= read -r -d '' FILE;     do     if [ "$FILE" != "." -o "$FILE" != ".." ]; then     APP_NAME=`echo ${FILE:12} | sed 's/-service//'`             OUTPUT=$($FILE $STATUS)     case "$OUTPUT" in         *not* )             echo "Do you wish to start $APP_NAME ?"             read  yn             case $yn in              [yY] | [yY][Ee][Ss] )                     $FILE start                     tail -f $FUSE_PATH/$APP_NAME/$LOG                     ;;              [nN] | [n|N][O|o] )                     ;;             * )             echo "Please answer yes or no.";;             esac             ;;            * )             echo "App $APP_NAME is running"     esac     fi     done      I'm Trying to execute this in RHEL 6


How to use one variable's name to refer to another variable?

a=2     pt2=3     echo $a     2     echo $pt2     3      How can I use               echo $pt($a)      to print the contents of `pt2`? An alternative is               b=pt$a     echo $b     pt2     echo $[$b]     3


return the numeric value of a indexed variable rather than its name

The following piece of code illustrates my problem I'm afraid I oversimplified it way too much in the first round.               #!/bin/bash     dogLover=1     catLover=2     for ii in dog cat         do             petLover=${ii}Lover             echo (evaluate $petLover)         done      I want the code to return the numeric values 1 and 2 rather than dog and cat. Presumably this is easy to do, but I can't seem to see how on the web. What I really need is a bash equivalent of the "eval" command in matlab


Passing arguments with quotes and doublequotes to bash script

At this moment I have:               #!/bin/bash     screen -p 'ScreenName' -x eval 'stuff '"'"$@"'"'\015'     echo eval 'stuff '"'"$@"'"'\015'      But when I call my script as:               # script.sh asd "asd" 'asd'      my arguments passed as: **asd asd asd** and I get output:               eval stuff 'asd asd asd'\015      _I except a: **asd "asd" 'asd'_** How I can change my script to pass whole arguments line with all quotes?


Home folder structure in Ubuntu 12.04.1?

Long story short, i just accidentally deleted my entire home folder. Thankfully it seems like the hidden files are still there. I'm not sure, but aren't all of the folders within the home folder (Desktop, Downloads and whatever else is in there) empty by default? If that is the case, could some super nice person just name all of the files located in the home folder so that i can rebuild it? Thanks a bunch in advance


What value is stored in linux xtime variable?

Whenever I print the value of `/proc/interrupts` the value of `rtc0` in `IRQ8` which is for RTC shows only 1 interrupt on CPU0. I have read that when booting the value of the xtime variable is stored from the Real time Clock and whether this interrupt is 1 because of this? And also what would be the value of the xtime variable? Is it the number of seconds passed after epoch?


Change the HOME of a user during a graphical session

The other day I had the idea to create display manager independent guest session. My basic idea was to change the login shell to a custom program that creates a temporary home on the fly (f.e. `/tmp/guest-XXXXXX`) and assign this session that home. After the user logs out it would remove that directory again. The problem I ran into is the following, I need to set a home in `/etc/passwd` and I can overwrite the HOME environment variable without a problem, but applications still seem to use the home set in `passwd` instead of the environment variable, at least in a graphical environment. I can not set the home in `passwd` because I do not know about it until the session has started. The basic logic I came up with looks like this:   * login shell started   * temporary home created   * HOME is set to this temporary home   * a real shell is forked   * after that real shell terminates, the temporary home is removed This seems to work when I `su` into the user, but running a graphical session means that mot/all programs started use the home set in `passwd`. Is it possible to change a user home on the fly/while a graphical session is active? DId I overlook something in the architecture of how the graphical sessions work?


Return value of commands when using stdin?

Imaging I am executing the following command:               echo "root:mypass" | chpasswd      How can I get the return code / error code returned by chpasswd? Is that possible in this case at all? I tried               RET = `echo "root:mypass" | chpasswd`      but this gives me only "command not found"?


Persistent folder missing from home folder, despite correct password and no errors

Tails 1.0 on stick 1. Password entered correctly on login screen for persistent storage (otherwise it would complain.) Booting from another (older) Tails stick, stick 2, can unlock and mount stick 1's persistent storage just fine and see all files. So why when I boot from stick 1 and enter the password correctly, does the Persistent folder not appear in the home folder (not in file browser GUI nor `sudo ls -a ~/`)? There's no error or anything, so why might it be missing?


Fastest `uniq` tool in linux

I have large text file (1.5 G), I want to know what the fastest and more reliable tool in linux is. I usualy use:               awk '!x[$0]++' file.txt      But when I use `htop` command I see my memory usage is increasing... I want to know whats is the fastest and more reliable one...(for huge files)               uniq?     sort?     sed?     awk?      And why? Thank you


Upgrading Slackware 13.1 to Slackware-current, is it a big leap?

I have Slackware 13.1 installed on my computer, with some software that I installed via pkgtools, slackbuilds, and compiled. I want to upgrade it to Slackware-current (13.37). Can I safely upgrade this by following UPGRADE.txt? Is this a big leap that will come problem (dependency, version conflict, etc)? What about my additional application that I installed via slackbuilds or compiled, are there any chance that they don't compatible with the newer library version?


Turning off dual monitors with "xset dpms force off" does not work - why?

I would like to turn off my dual monitors by running: `xset dpms force off` but just the primary monitor is beeing turned off while the other just gets a "black screen" (like if it was turned off) but it is not off. The led is still gleaming green indicating the monitor is on.


Does the kernel delete entries in /dev on an initramfs?

I have a fully custom, minimal, embedded Linux (vanilla, 3.3.8, i486, Vortex86dx) system that boots from an initramfs image. No standard distribution scripts are used, just a single rcS file that does the initialisation. I have an IDE Flash disk with two partitions at /dev/hda1 and /dev/hda2. As this is a minimal embedded distribution for a fixed system, it has a static /dev directory that contains /dev/hda1 and /dev/hda2, and there is no UDEV. At the point that init calls rcS, the /dev/hda1 entry is no longer present. No other scripts, user applications or daemons have been run at this point. /dev/hda1 _appears_ to have been deleted by the kernel(?) I do not have this same problem if I boot my target via an NFS root filing system during my development process. I use Buildroot to create the /dev directory via the device_table_dev.txt file. e.g.               # IDE Devices     /dev/hda    b   640 0   0   3   0   0   0   -     /dev/hda    b   640 0   0   3   1   1   1   4      I inspected the rootfs.tar.gz from Buildroot output/images. The /dev directory contains /dev/hda1:               brw-r-----  1 root root  3,   0 Jul  2 13:44 hda     brw-r-----  1 root root  3,   1 Jul  2 13:44 hda1     brw-r-----  1 root root  3,   2 Jul  2 13:44 hda2     brw-r-----  1 root root  3,   3 Jul  2 13:44 hda3     brw-r-----  1 root root  3,   4 Jul  2 13:44 hda4      My post-boot directory listing (done from within rcS, at the top of the script) on the target looks like this:               brw-r-----   1 root   root    3,   0 Jul  2 12:44 hda     brw-r-----   1 root   root    3,   2 Jul  2 12:44 hda2     brw-r-----   1 root   root    3,   3 Jul  2 12:44 hda3     brw-r-----   1 root   root    3,   4 Jul  2 12:44 hda4      /dev/hda1 is missing. /dev/hda2 is a partition on the same disk yet it is still there. Strange. If I run the Busybox utility "mdev -s", it restores/dev/hda1 on the target and it works normally. e.g. I can mount it Has anyone ever seen this behaviour before? Does the kernel delete entries from /dev?


IGB-Falsely claims to have parameter note

Because of some circumstances I have to install SLES 9 SP4 on a nearly new hardware. After the installation there is just a problem my network card(Intel Ethernet Server Adapter I350-T2). After the installation of the igb modul they're detected in Yast. I can now configure them like it should be but after applying the configuration nothing works. And ifconfig shows nothing. When I go back to Yast to check the configuration nothing has changed and my configuration is still there. After a reboot I get the error that the igb modul falsely claims to have the parameter note. I don't know what to do now and google was useless.


Cant detach/ kill xm console on node server

please advice, why I cant attach console from xm command? > [root@vm ~]# xm console vm104   >  Another console has already been attached to guest


Transfer files from CentOS VM VirtualBox to Windows host machine

How can I transfer the scripts and text files I've created in my CentOS environment and put it in my host desktop (Windows 7)? I've tried using ftp but it needs to configure the routers to use vsftpd, which I do not have administrative privileges. Is there any way I can transfer these files in another approach? Thank you.


Similar software to SourceTree

Is there a similar piece of software to SourceTree, a GUI for git, for Linux? I know about Giggle, git cola, etc. I'm looking for a beautiful, easy to use GUI for git.


Can I safely delete old directories in my home directory?

I have several hidden directories in my home directory of which I don't know if I need them any more. How do I know if I can safely delete them? For instance, next to the directory `.gimp-2.8` there is also `.gimp-2.4` which dates from two years ago. And it contains more files than the recent one.   Now I could move the old one elsewhere, start up the Gimp and see if it behaves differently, but can I be sure that there are no other applications which make use of these older files? And there is a very old directory `.gnome2_private` and I don't even run Gnome, I run KDE. But a quick test shows that when I create a new user on my computer, this directory is created automatically, so it does serve a function, right? And so on. And there are directories that I don't recognise the name of, so I have no idea to which applications they belong. How can I find out about them?


1GB huge page - Is writing occurring in 1GB chunks?

I'm trying to understand the relation between huge page size and how data is actually being written to RAM. What happens when a process uses a 1GB huge page - does writing occur in 1GB chunks? I guessing I'm completely wrong with this assumption?


Monitoring interface changes with udev, especially if a route is set

Is there a way to monitor interface up/downs, especially to check if a route is setup or removed, with udev?


How do I create a dialog with multiple text fields using zenity?

I want to crate a GUI for some command line programs and I need to get info from multiple text fields e.g. 'Username', 'Password' and a checkbox 'Sign automatically?'. I need to set particular variables in my script equal to the respective text fields' input by the user e.g. `user`, `pass`, `login`. Also it would have an OK button and a Quit button. How can I realise this this? I searched online and I was able to find only examples with one text field?


Is there an easier way to manipulate GRUB 2 entries?

Using GRUB 2 is harder than GRUB 1 for these use cases:   * It looks like if I want to reorder GRUB 2 menu entries appear in the selection window, I have to rename the files in " **/etc/grub.d/** " directory.   * If I have to change boot order, I first have to look in " **/boot/grub/grub.cfg** ", check when the entry I want to be default appears, then set the `GRUB_DEFAULT` parameter in " **/etc/default/grub** " to match it (counting from 0). The old GRUB used to allow me to do all of this by just moving text entries in " **/boot/grub/menu.lst** " around. This much-simpler way kept me using GRUB 1 for a while. This makes me wonder if there's a specialized tool to make all of this easier.


How to know the types of windowing system, window manager and desktop environment of a Unix-like OS

I was wondering what commands/utilities can be used in terminal to know the types of windowing system (such as X window system), window manager (such as Metacity, KWin, Window Maker) and desktop environment (such as KDE, Gnome) of a Linux or other Unix-like operating systems? Thanks!


How do I migrate configuration between computers with different hardware?

I want to migrate the configuration of an Ubuntu desktop to a new box with different hardware. What is the easiest way to do this? /etc/ contains machine and hardware specific settings so I can't just copy it blindly. A similar problem exists for installed packages. edit: This is a move from x86 to x86-64.


Issue with degraded raid5 after power outage

I have a raid5 that consists of 8 disks. After a power outage mdadm tells me that the raid is degraded. Here is the output:               /dev/md0:             Version : 0.90       Creation Time : Sat Jul 10 09:08:28 2010          Raid Level : raid5          Array Size : 13674601472 (13041.12 GiB 14002.79 GB)       Used Dev Size : 1953514496 (1863.02 GiB 2000.40 GB)        Raid Devices : 8       Total Devices : 7     Preferred Minor : 0         Persistence : Superblock is persistent              Update Time : Thu Aug  2 18:42:05 2012               State : clean, degraded      Active Devices : 7     Working Devices : 7      Failed Devices : 0       Spare Devices : 0                   Layout : left-symmetric          Chunk Size : 64K                     UUID : 09dd4536:a6153f6b:f1f4aaa9:53aab85a              Events : 0.9189750              Number   Major   Minor   RaidDevice State            0       8        0        0      active sync   /dev/sda            1       8       16        1      active sync   /dev/sdb            2       8       96        2      active sync   /dev/sdg            3       8      112        3      active sync   /dev/sdh            4       8       32        4      active sync   /dev/sdc            5       8       48        5      active sync   /dev/sdd            6       8       64        6      active sync   /dev/sde            7       0        0        7      removed      So /dev/sdf is missing. So I tried to get some infos about this drive. smartctl does not report any issues and `fdisk -l` lists it as expected. Lastly I tried `mdadm -E /dev/sdf` and I get this output:               /dev/sdf:               Magic : a92b4efc             Version : 0.90.00                UUID : 09dd4536:a6153f6b:f1f4aaa9:53aab85a       Creation Time : Sat Jul 10 09:08:28 2010          Raid Level : raid5       Used Dev Size : 1953514496 (1863.02 GiB 2000.40 GB)          Array Size : 13674601472 (13041.12 GiB 14002.79 GB)        Raid Devices : 8       Total Devices : 8     Preferred Minor : 0              Update Time : Wed Mar 28 17:19:58 2012               State : clean      Active Devices : 8     Working Devices : 8      Failed Devices : 0       Spare Devices : 0            Checksum : afeeecc7 - correct              Events : 9081618                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     7       8      112        7      active sync   /dev/sdh             0     0       8        0        0      active sync   /dev/sda        1     1       8       16        1      active sync   /dev/sdb        2     2       8       32        2      active sync   /dev/sdc        3     3       8       48        3      active sync   /dev/sdd        4     4       8       64        4      active sync   /dev/sde        5     5       8       80        5      active sync   /dev/sdf        6     6       8       96        6      active sync   /dev/sdg        7     7       8      112        7      active sync   /dev/sdh      What is the issue here? Should I replace `sdf` or is this repairable? **Update** I also had look at `dmesg` and I get this:               [    9.289086] md: kicking non-fresh sdf from array!     [    9.289090] md: unbind<sdf>     [    9.296541] md: export_rdev(sdf)


Mono spits out too many errors after update, try to reinstall, more errors

I had errors with `apt-get update && apt-get dist-upgrade`, from mono mono, so I tried this instead: `sudo apt-get install --reinstall banshee banshee-extension-soundmenu banshee- extension-ubuntuonemusicstore giver libappindicator0.1-cil libart2.0-cil libavahi1.0-cil libgconf2.0-cil libgdata1.7-cil libgkeyfile1.0-cil libglade2.0-cil libglib2.0-cil libgmime2.4-cil libgnome-vfs2.0-cil libgnome2.24-cil libgtk-sharp-beans-cil libgtk2.0-cil libgudev1.0-cil liblaunchpad-integration1.0-cil libmono-addins-gui0.2-cil libmono- addins0.2-cil libmono-cairo2.0-cil libmono-corlib1.0-cil libmono-corlib2.0-cil libmono-data-tds1.0-cil libmono-data-tds2.0-cil libmono-i18n-west1.0-cil libmono-i18n-west2.0-cil libmono-management2.0-cil libmono-messaging2.0-cil libmono-posix2.0-cil libmono-security1.0-cil libmono-security2.0-cil libmono- sharpzip0.84-cil libmono-sharpzip2.84-cil libmono-sqlite2.0-cil libmono- system-data-linq2.0-cil libmono-system-data1.0-cil libmono-system-data2.0-cil libmono-system-messaging2.0-cil libmono-system-web1.0-cil libmono-system- web2.0-cil libmono-system1.0-cil libmono-system2.0-cil libmono-wcf3.0-cil libmono-zeroconf1.0-cil libmono1.0-cil libmono2.0-cil libndesk-dbus- glib1.0-cil libndesk-dbus1.0-cil libnotify0.4-cil libtaglib2.0-cil libubuntuone1.0-cil mint-meta-gnome-dvd mono-2.0-gac mono-csharp-shell mono- gac mono-gmcs mono-runtime tomboy > ./errors2.txt` http://pastebin.com/YJszy4q4               Reading package lists...     Building dependency tree...     Reading state information...     The following packages were automatically installed and are no longer required:       libcommons-pool-java libtomcat6-java libcommons-dbcp-java     Use 'apt-get autoremove' to remove them.     0 upgraded, 0 newly installed, 60 reinstalled, 0 to remove and 0 not upgraded.     56 not fully installed or removed.     Need to get 0 B/1,846 kB of archives.     After this operation, 0 B of additional disk space will be used.     (Reading database ... 334292 files and directories currently installed.)     Preparing to replace libmono-posix2.0-cil 2.6.7-5ubuntu3.1 (using .../libmono-posix2.0-cil_2.6.7-5ubuntu3.1_all.deb) ...     Unpacking replacement libmono-posix2.0-cil ...     Preparing to replace libmono-security2.0-cil 2.6.7-5ubuntu3.1 (using .../libmono-security2.0-cil_2.6.7-5ubuntu3.1_all.deb) ...     Unpacking replacement libmono-security2.0-cil ...     Preparing to replace libmono-system2.0-cil 2.6.7-5ubuntu3.1 (using .../libmono-system2.0-cil_2.6.7-5ubuntu3.1_all.deb) ...     Unpacking replacement libmono-system2.0-cil ...     Preparing to replace mono-2.0-gac 2.6.7-5ubuntu3.1 (using .../mono-2.0-gac_2.6.7-5ubuntu3.1_all.deb) ...     Unpacking replacement mono-2.0-gac ...     Processing triggers for man-db ...     Setting up libmono-posix2.0-cil (2.6.7-5ubuntu3.1) ...     Setting up libmono-system2.0-cil (2.6.7-5ubuntu3.1) ...     Setting up libmono-security2.0-cil (2.6.7-5ubuntu3.1) ...     Setting up mono-2.0-gac (2.6.7-5ubuntu3.1) ...     Setting up mono-gac (2.6.7-5ubuntu3.1) ...     * Installing 3 assemblies from libappindicator0.1-cil into Mono     E: installing Assembly /usr/lib/cli/appindicator-sharp-0.1/appindicator-sharp.dll failed     E: Installation of libappindicator0.1-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 6 assemblies from libart2.0-cil into Mono     E: installing Assembly /usr/lib/cli/art-sharp-2.0/art-sharp.dll failed     E: Installation of libart2.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libavahi1.0-cil into Mono     E: installing Assembly /usr/lib/cli/avahi-sharp-1.0/avahi-sharp.dll failed     E: Installation of libavahi1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 6 assemblies from libgconf2.0-cil into Mono     E: installing Assembly /usr/lib/cli/gconf-sharp-2.0/gconf-sharp.dll failed     E: Installation of libgconf2.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 14 assemblies from libgdata1.7-cil into Mono     E: installing Assembly /usr/lib/cli/Google.GData.AccessControl-1.7/Google.GData.AccessControl.dll failed     E: Installation of libgdata1.7-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libgkeyfile1.0-cil into Mono     E: installing Assembly /usr/lib/cli/gkeyfile-sharp-1.0/gkeyfile-sharp.dll failed     E: Installation of libgkeyfile1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libglade2.0-cil into Mono     E: installing Assembly /usr/lib/cli/glade-sharp-2.0/glade-sharp.dll failed     E: Installation of libglade2.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libglib2.0-cil into Mono     E: installing Assembly /usr/lib/cli/glib-sharp-2.0/glib-sharp.dll failed     E: Installation of libglib2.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libgmime2.4-cil into Mono     E: installing Assembly /usr/lib/cli/gmime-sharp-2.4/gmime-sharp.dll failed     E: Installation of libgmime2.4-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 2 assemblies from libgnome2.24-cil into Mono     E: installing Assembly /usr/lib/cli/gnome-sharp-2.24/gnome-sharp.dll failed     E: Installation of libgnome2.24-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 6 assemblies from libgnome-vfs2.0-cil into Mono     E: installing Assembly /usr/lib/cli/gnome-vfs-sharp-2.0/gnome-vfs-sharp.dll failed     E: Installation of libgnome-vfs2.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 5 assemblies from libgtk2.0-cil into Mono     E: installing Assembly /usr/lib/cli/gtk-sharp-2.0/gtk-sharp.dll failed     E: Installation of libgtk2.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libgudev1.0-cil into Mono     E: installing Assembly /usr/lib/cli/gudev-sharp-1.0/gudev-sharp.dll failed     E: Installation of libgudev1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from liblaunchpad-integration1.0-cil into Mono     E: installing Assembly /usr/lib/cli/launchpad-integration-sharp-1/launchpad-integration-sharp.dll failed     E: Installation of liblaunchpad-integration1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 7 assemblies from libmono-addins0.2-cil into Mono     E: installing Assembly /usr/lib/cli/Mono.Addins-0.2/Mono.Addins.dll failed     E: Installation of libmono-addins0.2-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 3 assemblies from libmono-addins-gui0.2-cil into Mono     E: installing Assembly /usr/lib/cli/Mono.Addins.Gui-0.2/Mono.Addins.Gui.dll failed     E: Installation of libmono-addins-gui0.2-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 5 assemblies from libmono-zeroconf1.0-cil into Mono     E: installing Assembly /usr/lib/cli/Mono.Zeroconf-1.0/Mono.Zeroconf.dll failed     E: Installation of libmono-zeroconf1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libndesk-dbus1.0-cil into Mono     E: installing Assembly /usr/lib/cli/NDesk.DBus-1.0/NDesk.DBus.dll failed     E: Installation of libndesk-dbus1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libndesk-dbus-glib1.0-cil into Mono     E: installing Assembly /usr/lib/cli/NDesk.DBus.GLib-1.0/NDesk.DBus.GLib.dll failed     E: Installation of libndesk-dbus-glib1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libnotify0.4-cil into Mono     E: installing Assembly /usr/lib/cli/notify-sharp-0.4/notify-sharp.dll failed     E: Installation of libnotify0.4-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 2 assemblies from libtaglib2.0-cil into Mono     E: installing Assembly /usr/lib/cli/taglib-sharp-2.0/taglib-sharp.dll failed     E: Installation of libtaglib2.0-cil with /usr/share/cli-common/runtimes.d/mono failed     * Installing 1 assembly from libubuntuone1.0-cil into Mono     E: installing Assembly /usr/lib/cli/ubuntuone-sharp-1.0/ubuntuone-sharp.dll failed     E: Installation of libubuntuone1.0-cil with /usr/share/cli-common/runtimes.d/mono failed     dpkg: error processing mono-gac (--configure):      subprocess installed post-installation script returned error exit status 9     dpkg: dependency problems prevent configuration of mono-runtime:      mono-runtime depends on mono-gac (= 2.6.7-5ubuntu3.1); however:       Package mono-gac is not configured yet.     dpkg: error processing mono-runtime (--configure):      dependency problems - leaving unconfigured     (…)     dpkg: too many errors, stopping     Errors were encountered while processing:      mono-gac      mono-runtime      libmono-corlib2.0-cil     (…)      I have Linux Mint 11 x64.


Quoting within $(command substitution) in Bash

In my Bash environment I use variables containing spaces, and I use these variables within command substitution. Unfortunately I cannot find the answer on SE. What is the correct way to quote my variables? And how should I do it if these are nested?               DIRNAME=$(dirname "$FILE")      or do I quote outside the substitution?               DIRNAME="$(dirname $FILE)"      or both?               DIRNAME="$(dirname "$FILE")"      or do I use back-ticks?               DIRNAME=`dirname "$FILE"`      What is the right way to do this? And how can I easily check if the quotes are set right?


How to get only the unique results without having to sort data?

$ cat data.txt      aaaaaa     aaaaaa     cccccc     aaaaaa     aaaaaa     bbbbbb     $ cat data.txt | uniq     aaaaaa     cccccc     aaaaaa     bbbbbb     $ cat data.txt | sort | uniq     aaaaaa     bbbbbb     cccccc     $      The result that I need is to **display all the lines from the original file removing all the duplicates (not just the consecutive ones), while maintaining the original order of statements in the file**. Here, in this example, the result that I actually was looking for was               aaaaaa     cccccc     bbbbbb      How can I perform this generalized `uniq` operation in general?