unable to remount filesystem back to read-only after package upgrade

On my Debian system, I have my `/` on separate partition and mounted `read- only`. Only `/home/`, `/var/` and `/tmp/` are writable. I have also created a `Pre-Invoke` and `Post-Invoke` `apt hook`, so that `apt` can automatically remount the system for write, when packages are installed or upgraded, and remount it back to `read-only` when finished:               DPkg::Pre-Invoke  {"mount -o remount,rw / ;};     DPkg::Post-Invoke {"mount -o remount    / ;};      This whole setup works well with one exception. Sometimes during the installation/upgrade process some services need to be restarted or new files opened during the short window when my `/` is mounted `read-write`, these files are opened with `write` permissions. After the installation/upgrade is complete, my `Post-Invoke` hook returns error because it cannot remount `/` back to `read-only`. Is there some way to solve this problem? This is very annoying, because in this situation I usually must restart the server, which is impractical. # EDIT Below is a log of my latest package upgrade, which resulted in the described error:               root@alpha# apt-get upgrade      Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages will be upgraded:       base-files curl libc-bin libc6 libcurl3 libcurl3-gnutls libmysqlclient18 libssl1.0.0 locales multiarch-support mysql-client mysql-client-5.5 mysql-common       nscd openssl tzdata wget whois     18 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.     Need to get 18.7 MB of archives.     After this operation, 264 kB of additional disk space will be used.     Do you want to continue [Y/n]?      Fetched 18.7 MB in 0s (33.2 MB/s)      Preconfiguring packages ...     (Reading database ... 20532 files and directories currently installed.)     Preparing to replace base-files 7.1wheezy3 (using .../base-files_7.1wheezy4_amd64.deb) ...     Unpacking replacement base-files ...     Processing triggers for man-db ...     Processing triggers for install-info ...     Setting up base-files (7.1wheezy4) ...     Installing new version of config file /etc/debian_version ...     (Reading database ... 20532 files and directories currently installed.)     Preparing to replace libc-bin 2.13-38 (using .../libc-bin_2.13-38+deb7u1_amd64.deb) ...     Unpacking replacement libc-bin ...     Processing triggers for man-db ...     Setting up libc-bin (2.13-38+deb7u1) ...     (Reading database ... 20532 files and directories currently installed.)     Preparing to replace libc6:amd64 2.13-38 (using .../libc6_2.13-38+deb7u1_amd64.deb) ...     Unpacking replacement libc6:amd64 ...     Setting up libc6:amd64 (2.13-38+deb7u1) ...     (Reading database ... 20532 files and directories currently installed.)     Preparing to replace libssl1.0.0:amd64 1.0.1e-2+deb7u1 (using .../libssl1.0.0_1.0.1e-2+deb7u4_amd64.deb) ...     Unpacking replacement libssl1.0.0:amd64 ...     Preparing to replace curl 7.26.0-1+wheezy7 (using .../curl_7.26.0-1+wheezy8_amd64.deb) ...     Unpacking replacement curl ...     Preparing to replace libcurl3:amd64 7.26.0-1+wheezy7 (using .../libcurl3_7.26.0-1+wheezy8_amd64.deb) ...     Unpacking replacement libcurl3:amd64 ...     Preparing to replace libcurl3-gnutls:amd64 7.26.0-1+wheezy7 (using .../libcurl3-gnutls_7.26.0-1+wheezy8_amd64.deb) ...     Unpacking replacement libcurl3-gnutls:amd64 ...     Preparing to replace mysql-common 5.5.33+dfsg-0+wheezy1 (using .../mysql-common_5.5.35+dfsg-0+wheezy1_all.deb) ...     Unpacking replacement mysql-common ...     Preparing to replace libmysqlclient18:amd64 5.5.33+dfsg-0+wheezy1 (using .../libmysqlclient18_5.5.35+dfsg-0+wheezy1_amd64.deb) ...     Unpacking replacement libmysqlclient18:amd64 ...     Preparing to replace multiarch-support 2.13-38 (using .../multiarch-support_2.13-38+deb7u1_amd64.deb) ...     Unpacking replacement multiarch-support ...     Processing triggers for man-db ...     Setting up multiarch-support (2.13-38+deb7u1) ...     (Reading database ... 20532 files and directories currently installed.)     Preparing to replace tzdata 2013h-0wheezy1 (using .../tzdata_2013i-0wheezy1_all.deb) ...     Unpacking replacement tzdata ...     Setting up tzdata (2013i-0wheezy1) ...          Current default time zone: 'Europe/London'     Local time is now:      Sat Feb 15 11:35:41 CET 2014.     Universal Time is now:  Sat Feb 15 11:35:41 UTC 2014.     Run 'dpkg-reconfigure tzdata' if you wish to change it.          (Reading database ... 20511 files and directories currently installed.)     Preparing to replace wget 1.13.4-3 (using .../wget_1.13.4-3+deb7u1_amd64.deb) ...     Unpacking replacement wget ...     Preparing to replace locales 2.13-38 (using .../locales_2.13-38+deb7u1_all.deb) ...     Unpacking replacement locales ...     Preparing to replace whois 5.0.23 (using .../whois_5.1.1~deb7u1_amd64.deb) ...     Unpacking replacement whois ...     Preparing to replace mysql-client 5.5.33+dfsg-0+wheezy1 (using .../mysql-client_5.5.35+dfsg-0+wheezy1_all.deb) ...     Unpacking replacement mysql-client ...     Preparing to replace mysql-client-5.5 5.5.33+dfsg-0+wheezy1 (using .../mysql-client-5.5_5.5.35+dfsg-0+wheezy1_amd64.deb) ...     Unpacking replacement mysql-client-5.5 ...     Preparing to replace nscd 2.13-38 (using .../nscd_2.13-38+deb7u1_amd64.deb) ...     [ ok ] Stopping Name Service Cache Daemon: nscd.     Unpacking replacement nscd ...     Preparing to replace openssl 1.0.1e-2+deb7u1 (using .../openssl_1.0.1e-2+deb7u4_amd64.deb) ...     Unpacking replacement openssl ...     Processing triggers for install-info ...     Processing triggers for man-db ...     Setting up libssl1.0.0:amd64 (1.0.1e-2+deb7u4) ...     Setting up libcurl3:amd64 (7.26.0-1+wheezy8) ...     Setting up curl (7.26.0-1+wheezy8) ...     Setting up libcurl3-gnutls:amd64 (7.26.0-1+wheezy8) ...     Setting up mysql-common (5.5.35+dfsg-0+wheezy1) ...     Setting up libmysqlclient18:amd64 (5.5.35+dfsg-0+wheezy1) ...     Setting up wget (1.13.4-3+deb7u1) ...     Setting up locales (2.13-38+deb7u1) ...     Generating locales (this might take a while)...       en_DK.UTF-8... done       en_US.UTF-8... done     Generation complete.     Setting up whois (5.1.1~deb7u1) ...     Setting up mysql-client-5.5 (5.5.35+dfsg-0+wheezy1) ...     Setting up mysql-client (5.5.35+dfsg-0+wheezy1) ...     Setting up nscd (2.13-38+deb7u1) ...     [ ok ] Starting Name Service Cache Daemon: nscd.     Setting up openssl (1.0.1e-2+deb7u4) ...     mount: / is busy      The last line (`mount: / is busy`) is the error returned by apt, when trying to remount `/` back to `read-only`. # UPDATE: the command suggested by `Graeme` does not show any files:               # lsof / | awk 'NR==1 || $4~/[0-9][uw]/'     COMMAND     PID       USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME


Do I need a support contract to test my web application on solaris 10

I need to install Solaris 10 and I'm wondering if I need a support contract, on the download page it says that you need a support contract for production use, but I'm not too sure what production use mean, I want to test out a website I'm developing on that platform, does that count as production use? I really wouldn't consider it to be production use, but I'm not sure.


No Space left on device - Debian

when Im new to linux and try to run this below code               apt-get -f install      getting below error: ![enter image description here](http://i.stack.imgur.com/GiaGw.jpg) Checking the available space               df      Tho output ![enter image description here](http://i.stack.imgur.com/C75P7.jpg) How to increase the available space in /usr path?


Netstat shows programs running on different ports then they should

I have some code I'm testing. Program A listens on a predefined socket for program B to connect to and for my testing I'm running 32 instances of the programs A and B. I've written my script to tell program A to listen to port 9001-9032 and put in the configuration files for each instance of program B the corrosponding port to connect to. When I run the script which starts up program A and B and run Netstat -tnap I find that of all the ports 9001-9032 the only port actually used is 9001 which is used by another program (my bad lol). When I grep for program A I find each instance is listening on a semingly completely random ports that have no relationship to the ports 90** they should be listening on. However, my program B, which should be connecting to ports 9001-9032, is able to find and connect to each instance of program A despite A aparntly not listening on the ports it's B should be trying to connect to. I'm rather confused as to how that's possible. If that isn't confusing enough my 32 program and _only_ the 32 one (listening on 9032) dies at startup with an error that the address was refused when it tries to bind to the port. I tried changing the programs to listen on ports 15001-15032 just to see what would happen and I still got the exact same behavior; all programs seem to be listening on random ports and the 32 program can't establish a connection. Can anyone explain why my ports are behaving the way the are? Am I misunderstanding some part of netstat or linux ports?


Why am I gettting errors about unpackaged files while trying to build an rpm?

Trying to package up wget-1.13.tar.gz into a rpm (I am re-learning this process) and I'm running into these errors when I do a dry run.               error: Installed (but unpackaged) file(s) found:     /etc/wgetrc     /usr/bin/wget     /usr/share/info/dir     /usr/share/info/wget.info.gz     /usr/share/locale/be/LC_MESSAGES/wget.mo     RPM build errors:     Installed (but unpackaged) file(s) found:     /etc/wgetrc     /usr/bin/wget     /usr/share/info/dir     /usr/share/info/wget.info.gz     /usr/share/locale/be/LC_MESSAGES/wget.mo     /usr/share/locale/bg/LC_MESSAGES/wget.mo     /usr/share/locale/ca/LC_MESSAGES/wget.mo      There are more paths it complains about so this just a snippet but you should get the idea. My Spec file is as follows:               Name:       wget     Version:    1.13         Release:    1%{?dist}     Summary:    wget to get wget things          Group:      System Environment/Base     License:    GPL     #URL:            Source0:    %{name}-%{version}.tar.gz     BuildRoot:  /tmp/%{name}-%{version}-%{release}-root           #BuildRequires:      #Requires:            %description     Wget is a free software package for retrieving files using HTTP, HTTPS ... GNU   Wget        has many features to make retrieving large files          %prep     %setup -q               %build     %configure     make %{?_smp_mflags}               %install     rm -rf $RPM_BUILD_ROOT     make install DESTDIR=$RPM_BUILD_ROOT               %clean     rm -rf $RPM_BUILD_ROOT               %files     %defattr(-,root,root,-)     %doc                    %changelog      So a basic spec file, where am I going wrong? Also, the file structure my RPMS is $HOME/rpms/{BUILD,RPMS,SOURCES,SPECS,SRPMS} Thanks


Column mismatch and substituting

### input.txt (tab-delimted)               TTTTOTTT00000000008  RTTTT899      5.00E-28     TTTTOTTT00000000046  RTTTWRR       3.00E-31     TTTTOTTT00000000051  2.00E-11     TTTTOTTT00000000051  7.00E-12     TTTTOTTT00000000054  5.00E-22     TTTTOTTT00000000061  YTRYR         1.00E-11     TTTTOTTT00000000078  ETNRR8        6.00E-17     TTTTOTTT00000000174  TYTYT         1.00E-11     TTTTOTTT00000000203  UUUE          9.00E-20      I have file with column mixed up. In this file (input.txt). Column 3 has blank space, column should fill with column2 rows and column 2 rows should be substituted as none ### output.txt (tab-delimted)               TTTTOTTT00000000008  RTTTT899      5.00E-28     TTTTOTTT00000000046  RTTTWRR       3.00E-31     TTTTOTTT00000000051  none          2.00E-11     TTTTOTTT00000000051  none          7.00E-12     TTTTOTTT00000000054  none          5.00E-22     TTTTOTTT00000000061  YTRYR         1.00E-11     TTTTOTTT00000000078  ETNRR8        6.00E-17     TTTTOTTT00000000174  TYTYT         1.00E-11     TTTTOTTT00000000203  UUUE          9.00E-20


Permissions with writing NTFS partition from Windows

I mounted my NTFS external hard disk to my Pi this afternoon, my /etc/fstab currently looks like this (I encourage any recommendations or queries made on the properties made, especially the umask - I'm fairly new):               pi@CodaAmok ~ $ sudo nano /etc/fstab     GNU nano 2.2.6              File: /etc/fstab     proc            /proc           proc    defaults          0       0      /dev/mmcblk0p1  /boot           vfat    defaults          0       2     /dev/mmcblk0p2  /               ext4    defaults,noatime  0       1     UUID=01CE2B23B81B9C30   /mnt/disk1      ntfs   defaults,auto,umask=002,uid=1000,gid=1000       0       0     # a swapfile is not a swap partition, so no using swapon|off from here on, use $      I'm unable to write to the attached drive from Windows. It's complaining I do not have sufficient permissions. What am I missing here? I try mapping the drive in Windows and logging in as the user "pi", however it doesn't allow me to. It does, however, allow me to access the drive (obviously read-only) without logging in as Pi. So therefore I'm accessing the system as a different user, thus a different UID and GUID. If I find out what group my Windows machines falls under in a Samba share and add that to the /etc/fstab file, that should will do the trick. Question: How do I find out my GUID/UID of my Windows machine within my Pi? I assume it has got a default value for samba-accesing users? Here is my Samba config (it's huge o.o):               #     # Sample configuration file for the Samba suite for Debian GNU/Linux.     #     #     # This is the main Samba configuration file. You should read the     # smb.conf(5) manual page in order to understand the options listed     # here. Samba has a huge number of configurable options most of which      # are not shown in this example     #     # Some options that are often worth tuning have been included as     # commented-out examples in this file.     #  - When such options are commented with ";", the proposed setting     #    differs from the default Samba behaviour     #  - When commented with "#", the proposed setting is the default     #    behaviour of Samba but the option is considered important     #    enough to be mentioned here     #     # NOTE: Whenever you modify this file you should run the command     # "testparm" to check that you have not made any basic syntactic      # errors.      # A well-established practice is to name the original file     # "smb.conf.master" and create the "real" config file with     # testparm -s smb.conf.master >smb.conf     # This minimizes the size of the really used smb.conf file     # which, according to the Samba Team, impacts performance     # However, use this with caution if your smb.conf file contains nested     # "include" statements. See Debian bug #483187 for a case     # where using a master file is not a good idea.     #          #======================= Global Settings =======================          [global]          ## Browsing/Identification ###          # Change this to the workgroup/NT-domain name your Samba server will part of        workgroup = WORKGROUP          # server string is the equivalent of the NT Description field        server string = %h server          # Windows Internet Name Serving Support Section:     # WINS Support - Tells the NMBD component of Samba to enable its WINS Server     #   wins support = no          # WINS Server - Tells the NMBD components of Samba to be a WINS Client     # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both     ;   wins server = w.x.y.z          # This will prevent nmbd to search for NetBIOS names through DNS.        dns proxy = no          # What naming service and in what order should we use to resolve host names     # to IP addresses     ;   name resolve order = lmhosts host wins bcast          #### Networking ####          # The specific set of interfaces / networks to bind to     # This can be either the interface name or an IP address/netmask;     # interface names are normally preferred     ;   interfaces = 127.0.0.0/8 eth0          # Only bind to the named interfaces and/or networks; you must use the     # 'interfaces' option above to use this.     # It is recommended that you enable this feature if your Samba machine is     # not protected by a firewall or is a firewall itself.  However, this     # option cannot handle dynamic or non-broadcast interfaces correctly.     ;   bind interfaces only = yes                    #### Debugging/Accounting ####          # This tells Samba to use a separate log file for each machine     # that connects        log file = /var/log/samba/log.%m          # Cap the size of the individual log files (in KiB).        max log size = 1000          # If you want Samba to only log through syslog then set the following     # parameter to 'yes'.     #   syslog only = no          # We want Samba to log a minimum amount of information to syslog. Everything     # should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log     # through syslog you should set the following parameter to something higher.        syslog = 0          # Do something sensible when Samba crashes: mail the admin a backtrace        panic action = /usr/share/samba/panic-action %d               ####### Authentication #######          # "security = user" is always a good idea. This will require a Unix account     # in this server for every user accessing the server. See     # /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html     # in the samba-doc package for details.        security = user          # You may wish to use password encryption.  See the section on     # 'encrypt passwords' in the smb.conf(5) manpage before enabling.        encrypt passwords = true          # If you are using encrypted passwords, Samba will need to know what     # password database type you are using.          passdb backend = tdbsam             obey pam restrictions = yes          # This boolean parameter controls whether Samba attempts to sync the Unix     # password with the SMB password when the encrypted SMB password in the     # passdb is changed.        unix password sync = yes          # For Unix password sync to work on a Debian GNU/Linux system, the following     # parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for     # sending the correct chat script for the passwd program in Debian Sarge).        passwd program = /usr/bin/passwd %u        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .          # This boolean controls whether PAM will be used for password changes     # when requested by an SMB client instead of the program listed in     # 'passwd program'. The default is 'no'.        pam password change = yes          # This option controls how unsuccessful authentication attempts are mapped     # to anonymous connections        map to guest = bad user          ########## Domains ###########          # Is this machine able to authenticate users. Both PDC and BDC     # must have this setting enabled. If you are the BDC you must     # change the 'domain master' setting to no     #     ;   domain logons = yes     #     # The following setting only takes effect if 'domain logons' is set     # It specifies the location of the user's profile directory     # from the client point of view)     # The following required a [profiles] share to be setup on the     # samba server (see below)     ;   logon path = \\%N\profiles\%U     # Another common choice is storing the profile in the user's home directory     # (this is Samba's default)     #   logon path = \\%N\%U\profile          # The following setting only takes effect if 'domain logons' is set     # It specifies the location of a user's home directory (from the client     # point of view)     ;   logon drive = H:     #   logon home = \\%N\%U          # The following setting only takes effect if 'domain logons' is set     # It specifies the script to run during logon. The script must be stored     # in the [netlogon] share     # NOTE: Must be store in 'DOS' file format convention     ;   logon script = logon.cmd          # This allows Unix users to be created on the domain controller via the SAMR     # RPC pipe.  The example command creates a user account with a disabled Unix     # password; please adapt to your needs     ; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u          # This allows machine accounts to be created on the domain controller via the      # SAMR RPC pipe.       # The following assumes a "machines" group exists on the system     ; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u          # This allows Unix groups to be created on the domain controller via the SAMR     # RPC pipe.       ; add group script = /usr/sbin/addgroup --force-badname %g          ########## Printing ##########          # If you want to automatically load your printer list rather     # than setting them up individually then you'll need this     #   load printers = yes          # lpr(ng) printing. You may wish to override the location of the     # printcap file     ;   printing = bsd     ;   printcap name = /etc/printcap          # CUPS printing.  See also the cupsaddsmb(8) manpage in the     # cupsys-client package.     ;   printing = cups     ;   printcap name = cups          ############ Misc ############          # Using the following line enables you to customise your configuration     # on a per machine basis. The %m gets replaced with the netbios name     # of the machine that is connecting     ;   include = /home/samba/etc/smb.conf.%m          # Most people will find that this option gives better performance.     # See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html     # for details     # You may want to add the following on a Linux system:     #         SO_RCVBUF=8192 SO_SNDBUF=8192     #   socket options = TCP_NODELAY          # The following parameter is useful only if you have the linpopup package     # installed. The samba maintainer and the linpopup maintainer are     # working to ease installation and configuration of linpopup and samba.     ;   message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &          # Domain Master specifies Samba to be the Domain Master Browser. If this     # machine will be configured as a BDC (a secondary logon server), you     # must set this to 'no'; otherwise, the default behavior is recommended.     #   domain master = auto          # Some defaults for winbind (make sure you're not using the ranges     # for something else.)     ;   idmap uid = 10000-20000     ;   idmap gid = 10000-20000     ;   template shell = /bin/bash          # The following was the default behaviour in sarge,     # but samba upstream reverted the default because it might induce     # performance issues in large organizations.     # See Debian bug #368251 for some of the consequences of *not*     # having this setting and smb.conf(5) for details.     ;   winbind enum groups = yes     ;   winbind enum users = yes          # Setup usershare options to enable non-root users to share folders     # with the net usershare command.          # Maximum number of usershare. 0 (default) means that usershare is disabled.     ;   usershare max shares = 100          # Allow users who've been granted usershare privileges to create     # public shares, not just authenticated ones        usershare allow guests = yes          #======================= Share Definitions =======================          [homes]        comment = Home Directories        browseable = no          # By default, the home directories are exported read-only. Change the     # next parameter to 'no' if you want to be able to write to them.        read only = no          # File creation mask is set to 0700 for security reasons. If you want to     # create files with group=rw permissions, set next parameter to 0775.        create mask = 0700          # Directory creation mask is set to 0700 for security reasons. If you want to     # create dirs. with group=rw permissions, set next parameter to 0775.        directory mask = 0700          # By default, \\server\username shares can be connected to by anyone     # with access to the samba server.     # The following parameter makes sure that only "username" can connect     # to \\server\username     # This might need tweaking when using external authentication schemes        valid users = %S          # Un-comment the following and create the netlogon directory for Domain Logons     # (you need to configure Samba to act as a domain controller too.)     [netlogon]        comment = Network Logon Service        path = /home/samba/netlogon        guest ok = yes        read only = no          # Un-comment the following and create the profiles directory to store     # users profiles (see the "logon path" option above)     # (you need to configure Samba to act as a domain controller too.)     # The path below should be writable by all users so that their     # profile directory may be created the first time they log on     [profiles]        comment = Users profiles        path = /home/samba/profiles        guest ok = no        browseable = no        create mask = 0600        directory mask = 0700          [printers]        comment = All Printers        browseable = no        path = /var/spool/samba        printable = yes        guest ok = no        read only = yes        create mask = 0700          # Windows clients look for this share name as a source of downloadable     # printer drivers     [print$]        comment = Printer Drivers        path = /var/lib/samba/printers        browseable = yes        read only = yes        guest ok = no     # Uncomment to allow remote administration of Windows print drivers.     # You may need to replace 'lpadmin' with the name of the group your     # admin users are members of.     # Please note that you also need to set appropriate Unix permissions     # to the drivers directory for these users to have write rights in it     ;   write list = root, @lpadmin          # A sample share for sharing your CD-ROM with others.     ;[cdrom]     ;   comment = Samba server's CD-ROM     ;   read only = yes     ;   locking = no     ;   path = /cdrom     ;   guest ok = yes          # The next two parameters show how to auto-mount a CD-ROM when the     #   cdrom share is accesed. For this to work /etc/fstab must contain     #   an entry like this:     #     #       /dev/scd0   /cdrom  iso9660 defaults,noauto,ro,user   0 0     #     # The CD-ROM gets unmounted automatically after the connection to the     #     # If you don't want to use auto-mounting/unmounting make sure the CD     #   is mounted on /cdrom     #     ;   preexec = /bin/mount /cdrom     ;   postexec = /bin/umount /cdrom          [Backup]     comment = USB Share     path = /mnt/disk1     writeable = Yes     only guest = Yes     create mask = 0777     directory mask = 0777     browseable = Yes     public = Yes      Here is a screenshot image of what feedback I receive once I try and drop a file within that drive (from Windows); ![enter image description here](http://i.stack.imgur.com/xxfUz.png) If I were to hazard a guess at solving this, would it be something to do with these configurations (I would play around and see, but the octal numbering doesn't apply here(or does it?)):               # File creation mask is set to 0700 for security reasons. If you want to     # create files with group=rw permissions, set next parameter to 0775.        create mask = 0700          # Directory creation mask is set to 0700 for security reasons. If you want to     # create dirs. with group=rw permissions, set next parameter to 0775.        directory mask = 0700      I appreciate I may be on different tracks here, and not be theoretically correct so any correction of my knowledge would be great, too. Thanks for reading!


Merge several files with maximum 1 line difference

Suppose I have the following files: file0.c:               int b=NULL;     int a=NULL;      file1.c:               int b;     int a=NULL;      file2.c:               int b;     int a=NULL;      I am looking to merge the files file1 and file2 to generate the following result.c:               int b;     int a;      I can use : `diff input0 input1` and `diff input0 input2` to get the line+column combinations, however I don't know what to do next in order to achieve the above results.


SELinux httpd write access to a directory

I am new to SELinux. came from debian. I want to give `httpd` access to a directory. **SELinux Alert Browser** suggests:               # grep httpd /var/log/audit/audit.log | audit2allow -M mypol     # semodule -i mypol.pp       I couldn't understand how does this command work. I don't specify a directory path anywhere. how does it know which directory to allow for httpd ? Previously I've used grep to extract text from output or file. But here grep is being used on a process. That I didn't get. Also what is the actual solution. If I want to give httpd write access to a directory ?


How to optimize this oneliner? (if second column empty, put the line in another file)

I have a little "oneliner":               while read ONELINE; do       if [[ -n "`echo $ONELINE | awk '{print $2}'`" ]]; then         echo "$ONELINE" >> LIST-ok.txt       else         echo "$ONELINE" >> LIST-notok.txt       fi     done < ORIGINALLIST.txt      but it's extremely slow.. How can I optimize it to do the same thing but much- much faster? If the second column is empty then put the given line in another file.


How come lvextend allocates less than the specified amount of space?

I am trying to extend a volume, let's call it `/dev/vol1`. I see the initial volume size is 500MB when I call: `df --block-size=M /dev/vol1` then to extend it 100MB more I call:               lvextend -L+100M /dev/vol1     resize2fs /dev/vol1      but when I check the size again with `df --block-size=M /dev/vol1` I get back 595, indicating only 95 MB were gained. What accounts for this discrepancy? I think it has to do with a MB being 1024 vs 1000 KB, but I'm not sure how where the problem is.


Using VI keys to edit shell commands in UNIX

I used to have a co-worker who was really good at UNIX. He showed me how to use Vi key bindings to edit my shell commands. He placed the command in a file that ran every time I logged in. Since then, I've moved to a different project. Unfortunately I don't remember how to set this up. Is there anyone here who knows how to use Vi key bindings to edit commands in the terminal? How can I make that setting permanent?


Shell script running two Perl scripts based on input

I am new to shell script. I have two Perl scripts for text processing based on two different input files. I would like to have one shell script that runs based on conditions. If (input file) matches word `/extraction_reversed/` run `perlscript1.pl` otherwise run `perlscript2.pl`. Shell script to compile in terminal:               sh run.sh inputfile > outputfile


File sharing with Windows

I have a small home network consisting of two computers. One is running Windows 7 and the other Ubuntu 10.04. Neither computer is permanently on. I am trying to set up file sharing between the two. Ideally the Windows files will be mounted whenever the Windows machine is on, and unmounted when it is not. Currently I have added an entry to /etc/fstab to mount the share. This appears to vaguely work. However, I have noticed that it takes considerably longer to login to the Ubuntu computer if the Windows computer is not turned on. It exhibits bizarre behaviours if the Windows machine is not turned on, including not being able to interact with the desktop. Is there a way to remove this delay, or should I set up the share in a different way?


Go up one level from a nonexistent path

I have some code like this in a script (bash) file:               if [ ! -d $dir ]; then         cd $dir/..         git clone http://...     fi      Of course as written this doesn't work since `$dir` does not exist. Is there a good way to strip out the top-level directory here?


Private VLAN's under Linux?

http://blog.ine.com/2008/07/14/private-vlans-revisited/ Has anyone tried private vlan's under Linux? Any experiences with them? My real question is does anybody have howtos regarding this?


how to convert ^I character

I have a text file like this:               info  Some info here      In which when I use cat -A display this:               info^I Some info here      How do I edit this so I'll get something like this instead:               info<space>-<space>Some info here


feh: maintain zoom setting

When browsing through the images in a directory with `feh`, the magnification can be changed by use of the up/down arrow keys, but the setting is lost as soon as the next image in the series is loaded. Is there a way to apply the magnification setting selected for image i to image i+1? If not, is this possible in another lightweight image viewer?


How to switch PulseAudio inputs and outputs from command line?

At work I use to use an USB headset which gets detected as separate audio output and input (for the mic) devices. At home I use conventional analogue headset which is plugged into my laptop built-in sound system with headphone/mic jacks. Every time I want to switch between the USB headset and my laptop built-in sound system I have to open PulseAudio control panel and select the device. Can't I just make a couple of command line shortcuts to do the switch? UPDATE: I've just came to even more interesting idea than using CLI-based shortcuts manually - I think It is possible to trigger their launching on the USB headset attachment/detachment detection.


Can I set my local machine's terminal colors to use those of the machine I ssh into?

I have a color scheme that I like for when I'm in a terminal, but I ssh into the machine I work on from multiple sources (locally, PuTTY, my netbook, etc.) and I want to maintain the same color scheme throughout. Is this possible? I especially want it in PuTTY; it's difficult to change PuTTY colors.


How can I get mod_perl running in Arch Linux?

I've installed mod_perl, and even tried enabling it, unfortunately it seems to be preventing apache from starting.               LoadModule perl_module modules/mod_perl.so      here's the error.               /usr/sbin/apachectl: line 84: 25312 Segmentation fault      $HTTPD -k $ARGV      I switched httpd to run httpd.itk instead of worker.


Installing Debian without GUI for a web server

I'm unfamiliar with Debian (obviously), so I downloaded the live ISO thinking it might help me out. From the live GUI, I doubled click on the install icon on the desktop and proceeded - it gave me a install with GNOME and a bunch of other software that has no business being on a web server. Generally, I'm a Linux noob, but I'm more familiar with Ubuntu and since this server is more for learning, Ubuntu is basically a variation of Debian and Debian is now the most popular OS for web servers, I figured I'd use it. So the first part of my question is,can I install the base/non-GUI version from the Live disc? If so, how? If not, can someone point me to the correct download for the amd64 bit version? A side question - is going with Debian over Ubuntu really going to yield that much of a performance increase? I'd like to warm up to Debian because there is a strong likelihood that I'll encounter it professionally, so it will be a good learning experience. If there isn't much difference between it and Ubuntu's server edition, I may just go with that because I know that distro better. Since this is a learning exercise for me, would anyone have any additional or other suggestions or considerations for me? I basically want what would be the Debian equivalent to Ubuntu Server - a simple, bare-bones, non-GUI OS. I'd prefer to install my http server as well - I'm not yet sure if I'll be going with Apache or Nginx or handling http requests my self in node.js...


Ubuntu networking: can't connect to LAN

I have a server with Zentyal 3.03 (Ubuntu 12.04) LTS. It has 3 network devices:   * eth0 - dhcp fast internet (I pay for it)   * eth1 - static slow internet (it's free for the school)   * eth2 - LAN I can reach the server with SSH, but I can't reach a LAN server from outside. I have set up portforwarding for port 80, it made no sense. I used:               sudo iptables -A FORWARD -p tcp -i eth1 --sport 8888 -o eth2 -d 192.168.1.90 -dport 8888 -j ALLOW I don't know what can help, please ask what to show you. Please help me and do not send me to an another stackexchange website. (this wolud be the 4th time)


For what purpose would perl* be excluded in yum.conf?

I am **not** an Unix/Linux admin. I was attempting to install git on our server, and after much googling and trial and error, I discovered that perl* is excluded in our yum.conf file, preventing perl-Git from installing, which is a dependency of git-core. I understand what this does, but I'm not sure _why_ it has been done. There are a lot of things excluded in this file, and I just want to understand the reasons one might want to exclude something, whether it's a security issue, or what. Our original server administrator was killed in a boating accident. We are using CentOS 5.4, and I am using yum for my attempts at installing git.


pacman and powerpill not working

Both pacman and powerpill don't seem to be working on my Arch installation. I'm sure my Internet connection is working. The download just starts in powerpill but speed remains zero. In pacman, there's an error saying 'No file address found'.


How to fix my llvm installation?

So I am a new linux user and new to programming, and I wanted to learn some of the C style languages. One of the online courses that I'm taking provides me a vm environment with clang istalled and configured to help students such as myself. Since I already have a Linux Mint 17 installation I thought I'd go ahead and install the llvm infrastructure myself using apt. **So I followed the instructions here** http://llvm.org/apt/ I added these lines to /etc/apt/sources.list               deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty main     deb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty main     # 3.4     deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.4 main     deb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.4 main      The I opened a terminal and executed these commands to install the 3.4 stable channel packages:               wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add -     apt-get install clang-3.4 clang-3.4-doc libclang-common-3.4-dev libclang-3.4-dev libclang1-3.4 libclang1-3.4-dbg libllvm-3.4-ocaml-dev libllvm3.4 libllvm3.4-dbg lldb-3.4 llvm-3.4 llvm-3.4-dev llvm-3.4-doc llvm-3.4-examples llvm-3.4-runtime clang-modernize-3.4 clang-format-3.4 python-clang-3.4 lldb-3.4-dev       Immediately after these I got alerted by "update manager" that some of my packages need to be updated. I did this and my packages were upgraded to the development branch (3.5 release). The development branch gets upgraded every few hours, and I probably don't need something this "cutting edge", what with my crappy internet and low datacap. **So my questions are** :   1. Have I done the installation correctly and are there any steps that I missed/messed up?   2. How can I revert back to the stable branch of llvm, and not have the 3.5 release packages show up every time I call "sudo apt-get update"? Any help will be appreciated. Edit: Thanks for your response @Faheem. I installed the packages a few hours ago, so I dont have the terminal copy, but here is upgrade entry from /var/log/apt/history.log:               Start-Date: 2014-07-18  16:10:20     Commandline: apt-get upgrade     Upgrade: libllvm3.5-dbg:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), lldb-3.5-dev:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), libclang-3.5-dev:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), clang-3.5-doc:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), libclang1-3.5:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), libllvm3.4:amd64 (3.4-1ubuntu3, 3.4.2+svn209031-1~exp1), libllvm3.5:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), libclang1-3.5-dbg:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), lldb-3.5:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), clang-modernize-3.5:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), libclang-common-3.5-dev:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), llvm-3.5:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), llvm-3.5-examples:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), llvm-3.5-dev:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), python-clang-3.5:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), clang-3.5:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), clang-format-3.5:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), libllvm-3.5-ocaml-dev:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), llvm-3.5-doc:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1), llvm-3.5-runtime:amd64 (3.5~svn201651-1ubuntu1, 3.5~svn213346-1~exp1)      End-Date: 2014-07-18 16:11:00


I installed Ubuntu 10.04 (LTS) to a VPS server I'm renting and get this critical error when booting:               Filesystem type is ext2fs, partition type 0x83      This prevents the rest of the boot process to continue. When "Googling", I found no answers besides "re-install". I already tried that 3 times, and am still experiencing the same problem.


No usb 3 Arch linux 3.15.1

Up until my last reboot, I had the ability to use my usb 3 port. I just got the system installed not that long ago, so up until then I'd been configuring and installing drivers, but that was the session that I had actually been doing work in. I did install the xf86-input-synaptics driver, but I just removed it and booted again to see if that was messing it up, since it didn't come back, it didn't. Now I'm stuck. I have seen on many forums that people are having problems with it, but the port usually shows up in lsusb, dmesg, or lspci. lsusb:               Bus 002 Device 005: ID 047b:0011 Silitek Corp. SK-1688U Keyboard     Bus 002 Device 004: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical     Bus 002 Device 003: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB     Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 001 Device 004: ID 0bda:0139 Realtek Semiconductor Corp. RTS5139 Card Reader Controller     Bus 001 Device 003: ID 13d3:5134 IMC Networks      Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub      lspci | grep -i usb               00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)     00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)      dmesg | grep -i usb               [    1.278138] ACPI: bus type USB registered     [    1.278159] usbcore: registered new interface driver usbfs     [    1.278167] usbcore: registered new interface driver hub     [    1.278268] usbcore: registered new device driver usb     [    1.278630] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver     [    1.278904] ehci-pci 0000:00:1a.0: new USB bus registered, assigned bus number 1     [    1.291224] ehci-pci 0000:00:1a.0: USB 2.0 started, EHCI 1.00     [    1.291408] hub 1-0:1.0: USB hub found     [    1.291716] ehci-pci 0000:00:1d.0: new USB bus registered, assigned bus number 2     [    1.304530] ehci-pci 0000:00:1d.0: USB 2.0 started, EHCI 1.00     [    1.304982] hub 2-0:1.0: USB hub found     [    1.597732] usb 1-1: new high-speed USB device number 2 using ehci-pci     [    1.721971] hub 1-1:1.0: USB hub found     [    1.830738] usb 2-1: new high-speed USB device number 2 using ehci-pci     [    1.955115] hub 2-1:1.0: USB hub found     [    2.037276] usb 1-1.2: new high-speed USB device number 3 using ehci-pci     [    2.240377] usb 1-1.4: new high-speed USB device number 4 using ehci-pci     [    2.390210] usb 2-1.2: new high-speed USB device number 3 using ehci-pci     [    2.476044] hub 2-1.2:1.0: USB hub found     [    2.743395] usb 2-1.2.3: new low-speed USB device number 4 using ehci-pci     [    2.899768] usb 2-1.2.4: new low-speed USB device number 5 using ehci-pci     [    6.531535] scsi6 : SCSI emulation for RTS5139 USB card reader     [    6.531790] usbcore: registered new interface driver rts5139     [    6.632207] uvcvideo: Found UVC 1.00 device USB2.0 UVC 1M WebCam (13d3:5134)     [    6.636268] input: USB2.0 UVC 1M WebCam as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input15     [    6.636452] usbcore: registered new interface driver uvcvideo     [    6.636456] USB Video Class driver (1.1.1)     [    7.114946] usbcore: registered new interface driver usbhid     [    7.114954] usbhid: USB HID core driver     [    7.125179] input: Microsoft Microsoft 3-Button Mouse with IntelliEye(TM) as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.3/2-1.2.3:1.0/0003:045E:0040.0001/input/input18     [    7.125756    ] hid-generic 0003:045E:0040.0001: input,hidraw0: USB HID v1.10 Mouse [Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)] on usb-0000:00:1d.0-1.2.3/input0     [    7.126179] input: Silitek Standard USB Keyboard  as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2.4/2-1.2.4:1.0/0003:047B:0011.0002/input/input19     [    7.126612] hid-generic 0003:047B:0011.0002: input,hidraw1: USB HID v1.00 Keyboard [Silitek Standard USB Keyboard ] on usb-0000:00:1d.0-1.2.4/input0      lshw -short -class bus               H/W path           Device  Class          Description     =====================================================     /0                         bus            G74Sx     /0/100/1a                  bus            6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2     /0/100/1a/1        usb1    bus            EHCI Host Controller     /0/100/1a/1/1              bus            Integrated Rate Matching Hub     /0/100/1d                  bus            6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1     /0/100/1d/1        usb2    bus            EHCI Host Controller     /0/100/1d/1/1              bus            Integrated Rate Matching Hub     /0/100/1d/1/1/2            bus            USB2.0 Hub     /0/100/1f.3                bus            6 Series/C200 Series Chipset Family SMBus Controller      Up until now, I've simply been told the device is broken, since it doesn't show up on any of these. Now that I've seen it work, I know that it isn't and that it is just a configuration issue. When it was working the ouput of lsusb included a fesco driver (I think). I don't see fesco anywere when using grep. The computer is an Asus G74sx laptop. Any and all information is appreciated. Thank you. Edit:   Okay, so I don't know how much this helps, but I have another machine (running linux) with a working usb3 port. I started checking for differences between the two in xhci_hcd and ehci_hcd (just in case) and found that in /sys/bus/pci/drivers/ the working system has a folder "xhci_hcd", whereas the non-working system does not. At first I thought to myself, "hey, maybe I can copy it over from the one system to the other. Even as root, I can't even copy those files. So clearly something somewhere else in the system is going haywire. Don't know if this helps or obfuscates, but it is a detail. Edit 2: The error message   The issue seems to be related to putting the system into suspend mode. I'm booting from a live-disk so I can quickly erase any changes. When I pt the machine into suspend mode it usually goes down without an issue. When it comes back up the usb 3 works fine. Sometimes, rather out of the blue, there is an error. Once the error occurs, I have to pull the plug on the machine and reset my live disk to get the port back. The message doesn't last very long, only a few milliseconds but I got it on my camera. The error message:               xhci_hcd 0000:04:00.0: PCI post-resume error -110!     xhci_hcd 0000:04:00.0: HC died; cleaning up     xhci_hcd 0000:04:00.0: HC died; cleaning up     dpm_run_callback(): pci_pm_resume+0x0/0xb0 returns -110     PM: Device 0000:04:00.0 failed to resume async: error -110     dpm_run_callback(): usb_dev_resume+0x0/0x20 [usbcore] returns -5     PM: Device 4-1.4 failed to resume async: error -5      Edit 3: Possible answer? (needs testing) Reading this, I found that if I manually unbind the usb3 then call `systemctl suspend`, then when I wake it up and manually bind the usb3 device, it works. I ran this 150 times, which if you consider that it will usually fail between 2 and 10 times, that is enough standard deviations from the mean, so I'm going to assume that it works. I put the bind and unbind into into "/etc/pm/sleep.d/20_custom-xhci_hcd". Then checked to make sure that it was executable.               #!/bin/sh     #File: "/etc/pm/sleep.d/20_custom-xhci_hcd"          case "${1}" in         hibernate|sleep)             #unbind             echo "Unbinding xhci device"             echo -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/unbind         ;;         resume|thaw)             # bind             echo "Binding xhci device"             ehco -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/bind         ;;     esac      I don't think this file ever gets called because I never saw the echo outputs. And thinking about it, it makes sense since this machine doesn't have pm- utils, and uses systemd instead. So I moved it to /usr/lib/systemd/system- sleep/ as per this site and adjusted it to:               #!/bin/sh     #File: "/usr/lib/systemd/system-sleep/xhci_hcd.sleep"          case $1/$2 in         pre/*)             #unbind             echo "Unbinding xhci device"             echo -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/unbind         ;;         post/*)             # bind             echo "Binding xhci device"             ehco -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/bind         ;;     esac      as stated in the same site. Then set it to executable. I'm going to test this but I think I'm feeling the love. If it works I'll post this to the answers part.


Questions regarding mounting CD-ROM on linux

I am trying to mount the dvd+rw drives in my Debian 7 PC. There are two drives and I can see that these exist in `/dev`:               $ ls -la /dev/dvd*     lrwxrwxrwx 1 root root 3 Oct 26 07:47 dvd -> sr1     lrwxrwxrwx 1 root root 3 Oct 26 12:41 dvd1 -> sr0     lrwxrwxrwx 1 root root 3 Oct 26 07:47 dvdrw -> sr1     lrwxrwxrwx 1 root root 3 Oct 26 12:41 dvdrw1 -> sr0      The following lines exist in my `/etc/fstab` file and were not put there by me:               /dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0     /dev/sr1 /media/cdrom1 udf,iso9660 user,noauto 0 0      Nobody else has used this PC - I only recently installed debian7 and so, I assume that the installation process created these mount-points automatically. If I run `sudo mount -a` the drives do not mount, though:               $ mount | grep cd     # no results returned     $ df | grep cd     # no results returned      I tried changing `/etc/fsab` to:               /dev/sr0 /media/cdrom0 defaults 0 0     /dev/sr1 /media/cdrom1 defaults 0 0      But there were still no results from `mount` or `df`. As suggested by jordanm, i have tried to mount one of the drives manually:               $ sudo mount -t iso9660 -o defaults /dev/sr0 /media/cdrom0     mount: block device /dev/sr0 is write-protected, mounting read-only     mount: wrong fs type, bad option, bad superblock on /dev/sr0,        missing codepage or helper program, or other error        In some cases useful info is found in syslog - try        dmesg | tail  or so


How to list groups with gid in redhat?

I first listed the groups using :               groups       I added group using               groupadd -g 300 oinstall     groupadd –g 500 dba      and then when I do               groups      root bin daemon sys adm disk wheel sfcb      I am unable to find groups I added. How to list groups with group id? Also, if I try to add it again it says groups is already present.


Finding a char device in /sys using a Bash script?

I have one of these and I am trying to write a Bash script for finding the device path in `/sys`. My approach goes something like this:   * start in `/sys/modules/usbled` since this is the name of the kernel module loaded when the device is plugged in   * `cd` to `drivers/usb:usbled`, which appears to be the bus and name of the driver for the device (according to usbled.c:229)   * ??? I get stuck on the last step since the directory contains:               $ ls     1-1.2:1.0  bind  module  new_id  remove_id  uevent  unbind      Now, I happen to know in this case that the `1-1.2:1.0` directory contains the char devices necessary to control the LEDs. However, how does my script know this? Is there any particular naming convention behind the directory? What if there are multiple devices of the same type plugged in?


Python error after installing libboost-all-dev on debian

A friend of mine wanted the libboost libraries installed on our shared computer so after installing libboost-all-dev 1.49.0.1 (a Debian wheezy machine), I get this error when using the "pydoc modules" command on the commandline. It spits out the following error --               root@debian:/usr/include/c++/4.7# pydoc modules          Please wait a moment while I gather a list of all available modules...          **[debian:49065] [[INVALID],INVALID] ORTE_ERROR_LOG: A system-required executable either could not be found or was not executable by this user in file ../../../../../../orte/mca/ess/singleton/ess_singleton_module.c at line 357     [debian:49065] [[INVALID],INVALID] ORTE_ERROR_LOG: A system-required executable either could not be found or was not executable by this user in file ../../../../../../orte/mca/ess/singleton/ess_singleton_module.c at line 230     [debian:49065] [[INVALID],INVALID] ORTE_ERROR_LOG: A system-required executable either could not be found or was not executable by this user in file ../../../orte/runtime/orte_init.c at line 132     --------------------------------------------------------------------------     It looks like orte_init failed for some reason; your parallel process is     likely to abort.  There are many reasons that a parallel process can     fail during orte_init; some of which are due to configuration or     environment problems.  This failure appears to be an internal failure;     here's some additional information (which may only be relevant to an     Open MPI developer):       orte_ess_set_name failed       --> Returned value A system-required executable either could not be found or was not executable by this user (-127) instead of ORTE_SUCCESS     --------------------------------------------------------------------------     --------------------------------------------------------------------------     It looks like MPI_INIT failed for some reason; your parallel process is     likely to abort.  There are many reasons that a parallel process can     fail during MPI_INIT; some of which are due to configuration or environment     problems.  This failure appears to be an internal failure; here's some     additional information (which may only be relevant to an Open MPI     developer):       ompi_mpi_init: orte_init failed       --> Returned "A system-required executable either could not be found or was not executable by this user" (-127) instead of "Success" (0)     --------------------------------------------------------------------------     *** The MPI_Init() function was called before MPI_INIT was invoked.     *** This is disallowed by the MPI standard.     *** Your MPI job will now abort.     [debian:49065] Abort before MPI_INIT completed successfully; not able to guarantee that all other processes were killed!**     root@debian:/usr/include/c++/4.7#       I tried looking into the problem and ended up uninstalling the following to get it to work again.               openmpi common all 1.4.5-1     libibverbs-dev amd64 1.1.6-1                                        libopenmpi-dev amd64 1.4.5-1                                        mpi-default-dev amd64 1.0.1     libboost-mpi-python1.49.0      Although pydoc works again, I'm assuming the packages I removed are going to hurt something else down the track? As you guessed I'm not a C/C++ programmer. So I guess my question is, will this hurt something later? Is there a way to install those packages without hurting Python?


C++ compile in Arch Linux with no g++ package in repositories

I wanna compile a C++ program in Arch Linux, but there's no "g++" package as there is in Ubuntu repositories for example. Using `-x` too won't work. like this:               gcc -x c++ -o myprog myprog.cpp


How can I delete the first dot before the first number?

How to remove the first dot before the first number? For example I have the following file                 more file                 Version …………2.465.76.8.332      I want to get only the version number - 2.465768.332


How to detect global key presses

I have an Asus laptop that has a special key that can be configured to launch any software (at least on Windows). > ![](http://i.stack.imgur.com/bDzMA.png) The general question is: how can I detect any key press (globally)? Then, how can I detect when the user press this key?


How to fix boot into initramfs prompt and "mount: can't read '/etc/fstab': No such file or directory" and "No init found"?

Installing a new system using a **GPT** partitioned disk dedicated to a single partition, **ext4** formatted, **extlinux** (version 4.05) as bootloader, Ubuntu Core version 13.10 amd64 as rootfs, and Ubuntu linux- image-3.11.0-18-generic as kernel, and extlinux-update to generate bootloader configuration. The result after reboot (still inside a KVM based virtual machine) is an (initramfs) prompt and these messages:               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.      BusyBox is v1.20.2. Regression:   * the file system has been checked with `fsck.ext4` ### Check for root existence               (initramfs) ls -l /dev/[hs]da*     ls: /dev/[hs]da*: No such file or directory      ### Root boot argument               (initramfs) cat /proc/cmdline     initrd=/boot/initrd.img-3.11.0-18-generic ro quiet BOOT_IMAGE=/boot/vmlinuz-3.11.0-18-generic      ### Check loaded modules               (initramfs) cat /proc/modules     e1000 145368 0 - Live 0xffffffffa0000000      ### /boot folder content               $ sudo ls -l boot     -rw------- 1 root root 3296162 Feb 18 22:37 System.map-3.11.0-18-generic     -rw-r--r-- 1 root root 1007681 Feb 18 22:37 abi-3.11.0-18-generic     -rw-r--r-- 1 root root  163258 Feb 18 22:37 config-3.11.0-18-generic     drwxr-xr-x 2 root root    4096 Mar 17 20:13 extlinux     -rw-r--r-- 1 root root 4995000 Mar 16 23:35 initrd.img-3.11.0-18-generic     -rw------- 1 root root 5634192 Feb 18 22:37 vmlinuz-3.11.0-18-generic      How to make this system boot to the expected default bash prompt?


why have programs like su access to /etc/shadow

Normally only root can access `/etc/shadow`. But programs like `su` and `sudo` can check passwords without running as root. So the question is: Why can these programs access `/etc/shadow` without privileges? I tried to access it without privileges via python with the `spwd` module, but I didn't get access (like expected). Which mechanism do these programs use?


Error While Booting GRML

I'm dropped the 32-bit GRML ISO onto a 1GB thumb drive with the usual command:               dd if=grml_2010.12.iso of=/dev/USB_STICK      (of course, with the correct device). But, when I try to boot from it, it produces this error:               0AAD Loading ...bad magic error     ...bad magic      And then proceeds to restart. What would cause that?


2 distros/1 PC: can I suspend one of them, then boot into the second one?

There are 2 linux distros on my pc: an ubuntu 10.04 and a fedora 14. If I suspend e.g.: the ubuntu are there any chances that I can boot into Fedora? Or that's impossible because the suspend uses the memory? What about hibernation?


md5sum check fails for git-man-pages.tar.gz package

When I try to verify the integrity of git-man-pages package I downloaded from "http://code.google.com/p/git-core/downloads/detail?name=git- manpages-1.8.4.tar.gz&can=2&q=" it fails with error. **Command which i ran:** `md5sum -c git-manpages-1.8.4.tar.gz` **Error displayed:**               md5sum: git-manpages-1.8.4.tar.gz: no properly formatted MD5 checksum lines found      I also tried entering the checksum value of git-manpages that i found in site in a file called checksum in the following format               8c67a7bc442d6191bc17633c7f2846c71bda71cf  git-manpages-1.8.4.tar.gz      and then running the **Command:** `md5sum -c checksum` **Error displayed:**               md5sum: checksum: no properly formatted MD5 checksum lines found


Apticron notifying about uninstalled packages

I'm using apticron to notify myself about available updates. However, I've got an installation on a VPN that seems to notify about packages I DON'T have installed. For example, it keeps (daily) suggesting that I upgrade sysvinit - I have upstart installed, not sysvinit. I used to have it for a number of other packages (basic libraries that weren't installed in my original Debian- wheezy image), so I've shut up those warnings just by installing the libraries. However, I don't really want to ditch upstart for sysvinit just to make apticron play more nicely. Any ideas how to make it stop?


How do I find the inode of any directory?

There is literally nothing on google that I can find that will help me answer this question. I presume it is passing some other parameter to `ls -i`?


Steam-OS installation asks for DVD media change halfway through installation

I'm trying to install the latest Steam OS. I've downloaded the ISO March 25th: SteamOSDVD.iso 25-Mar-2014 12:07 Installation works great up to the point when in "Select and Install software" after already having installed 200 or so packages, a screen pops up saying: "/cdrom/:Please insert the disc labeled: 'SteamOS GNU/Linux-1.0_Alchemist_- Unofficial Multi-architecture/i386/amd64 DVD #1 20140325-19:06' in the drive '/cdrom/' and press enter". However, that disk is already in the DVD drive! Pressing continue does nothing. There is no box to cancel the installation either, so all that's left to do here is Press ctrl+alt+del. The system is an i7-based Notebook with an AMD graphics chip and it is connected to the internet by means of an ethernet cable during installation.


How to check if Samba is installed

I don't know if Samba is pre-installed in my Linux system. I have the `/etc/samba/` directory, with `smb.conf` file. But if I try one of these commands               sudo service smb start     sudo service samba start     sudo service smbd start      the answer is always `unrecognized service`. In `/etc/init.d` there is no file like `smb`, `samba` or `smbd`. How could I check anymore? Thank you anyway!


Installing a light table(editor) in debian

I want to install lighttable programming editor in kali Linux(debian).I have downloaded the `tar.gz` version from here. But I am unable to install the light table .Please help in regarding this.   `./ltbin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./ltbin) ./ltbin: /lib/x86_64-linux-gnu/libc.so.6: version`GLIBC_2.15' not found (required by ./ltbin)`


Acer c7 Chromeos problem: the bootloader was replaced

My model is `Acer c710-2487`. Son changed the bootloader to `grub 2` but it can't find the o/s (if he put one there) on `ahci0` (No known filesystem detected). How do I resolve? I would like to put back to state it started (`chromeos bootloader, etc`).


Dual monitors on dual video cards on Ubuntu

I have been trying this to no avail. I am new to Linux, so a step by step explanation would be greatly appreciated. I have two NVIDIA GeForce 8600 GT video cards. I want a monitor to run on each card, so Twinview cannot be used because my understanding that is only for single video cards. I went to the system monitors tab and my second display is detected but disabled. So I enabled it by clicking configure. It says switch to XScreen (requires restart of x server) and I set up my settings so that the new monitor is to the left of the main one. I apply the changes by updating the xorg.conf file which is what it says to do after you click apply. When I reboot I cant even login to the desktop. The GUI is all messed up and goes to the command line. It has to do apparently with the new changes made to the xorg.conf file so I have a back up and just put the old one back and then I can get back to the GUI. I have done this several times with several different variations of setting up the monitor and I run into the same problem. I even tried to restart gdm without rebooting and it actually does nothing or resets all the monitor configurations that I made. Please help. I would like to use dual monitors in Ubuntu.


Why bash time is more precise then GNU time?

The buitin bash command `time` gives milisecond precision of execution and GNU `time` (usually /usr/bin/time) gives centisecond precision. The `times(2)` syscall gives times in clocks, and 100 clocks = 1 second (usually), so the precision is like GNU `time`. So the question is what is bash `time` using so that it's more precise?


What causes swap files to be created?

As part of the program I wrote, I constantly read and write data from files. I noticed that as part of doing so, I am inadvertently creating swap `.swp` files. What do you think is going on? What would cause swap files to appear if you had to reproduce the problem?


Prompt user on Linux security denial

Is it possible to make a Linux security module (eg. AppArmor, SELinux etc.) prompt the user, when an application wants to access classified files or folders (digital signatures, SSH keys, credit card information and other sensitive stuff) instead of just denying the application's action, which could be desired (eg. an email client wanting to sign an email on the user's request). It will be beneficial to set up strict default security policies for vulnerable applications (especially web browsers and email clients) and let the user decide, whether a given action is desired or not, so vulnerability of the system can be avoided without worsening the user-friendliness.


Ubuntu Could not purge package

I've tried to install **oracle-java7-installer** package from custom repository onto Ubuntu 12. It was failed during executing some post- installation script. So. I want just to rollback it and proceed with another solutions (to install java 7 jdk). I've tried to make UPDATED with **set -x**                >  sudo aptitude remove oracle-java7-installer     The following packages will be REMOVED:       oracle-java7-installer     0 packages upgraded, 0 newly installed, 1 to remove and 47 not upgraded.     Need to get 0 B of archives. After unpacking 82.9 kB will be freed.     (Reading database ... 61748 files and directories currently installed.)     Removing oracle-java7-installer ...     + uname -m     + arch=amd64     + dld=x64     + J_INSTALL_DIR=/usr/lib/jvm/java-7-oracle     + [ remove = remove ]     + [ -d /usr/lib/jvm/java-7-oracle/man/man1 ]     + basename /usr/lib/jvm/java-7-oracle/bin/*     + name=*     + [ ! -f /usr/bin/* -o -L /usr/bin/* ]     + update-alternatives --remove bin boot dev etc home initrd.img lib lib64 lost+found media mnt opt proc raid root run sbin selinux srv sys tmp usr var vmlinuz /usr/lib/jvm/java-7-oracle/bin/*     update-alternatives: error: unknown argument `dev'     dpkg: error processing oracle-java7-installer (--remove):      subprocess installed pre-removal script returned error exit status 2     No apport report written because MaxReports is reached already                                                                   Downloading...     --2012-10-24 17:53:33--  http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz     Resolving download.oracle.com (download.oracle.com)... 80.239.148.219, 80.239.148.216     Connecting to download.oracle.com (download.oracle.com)|80.239.148.219|:80... connected.     HTTP request sent, awaiting response... 302 Moved Temporarily     Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz [following]     --2012-10-24 17:53:33--  https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz     Resolving edelivery.oracle.com (edelivery.oracle.com)... 2.22.42.174     Connecting to edelivery.oracle.com (edelivery.oracle.com)|2.22.42.174|:443... connected.     HTTP request sent, awaiting response... 302 Moved Temporarily     Location: http://download.oracle.com/errors/download-fail-1505220.html [following]     --2012-10-24 17:53:33--  http://download.oracle.com/errors/download-fail-1505220.html     Connecting to download.oracle.com (download.oracle.com)|80.239.148.219|:80... connected.     HTTP request sent, awaiting response... 200 OK     Length: 5307 (5.2K) [text/html]     Saving to: `./jdk-7u3-linux-x64.tar.gz'               0K .....                                                 100%  466M=0s          2012-10-24 17:53:33 (466 MB/s) - `./jdk-7u3-linux-x64.tar.gz' saved [5307/5307]          Download done.     sha256sum mismatch jdk-7u3-linux-x64.tar.gz     Oracle JDK 7 is NOT installed.     dpkg: error while cleaning up:      subprocess installed post-installation script returned error exit status 1     Errors were encountered while processing:      oracle-java7-installer     E: Sub-process /usr/bin/dpkg returned an error code (1)     A package failed to install.  Trying to recover:                    > sudo aptitude search oracle-java7-installer        Cd  oracle-java7-installer                                                 - Sun Java(TM) Development Kit (JDK) 7      What I can do with that? Is it possible to rollback to the previous state without trying to deinstall broken package?? So. I understand from output that scripts inside package are wrong. they failed to download tar.gz from Oracle site and failed to install due to that. Also it does not handle properly **remove** commande and trying to install it again when I want to remove package. The basic question - is it possible to just rollback that package without running scripts? F.e. like in windows "System restore"? Or I should do this manually? P.S. > lsb_release -a   >  No LSB modules are available.   >  Distributor ID: Ubuntu   >  Description: Ubuntu 12.04.1 LTS   >  Release: 12.04   >  Codename: precise P.P.S > sh -x /var/lib/dpkg/info/oracle-java7-installer.prerm   >  + set -e   >  + uname -m   >  + arch=amd64   >  + dld=x64   >  + J_INSTALL_DIR=/usr/lib/jvm/java-7-oracle   >  + [ = remove ]   >  + [ = deconfigure ]   >  + exit 0


Is it possible to configure ctrl-w (delete word)?

Normally, `Ctrl-w` deletes back to the last whitespace. Is it possible to configure it to use additional characters, such as `/`? Edit: To be more clear: I don't want to configure the key for it, I want to have the deletion stop on `/` aswell. Example:               vim /foo/bar^W     vim /foo/


GRUB installed with every OS. Which one is actually in use?

When you have multiple Linux OS's on the same computer, each installation has its own installation of GRUB, and the most recent installation is usually the one that is used when booting up. The issue comes up when I can no longer remember which is the most recent installation and I want to make modifications to the GRUB menu. How do I figure out which one is in use short of checking each installation individually? Is there a cleaner setup which avoids the problem in the first place by only having one installation of GRUB?


VMware mouse occasionally held down (cannot "unclick", left mouse stops working, grab ungrab)

I have Debian 6.0.6 on vmware player. I notice once in a while the mouse just selects everything - like starting from some point to wherever my mouse is currently at. I can't unselect or press any buttons, except right click. And then I still can't select anything, but if I right click the context menu goes away. I know this is really localized, but if someone has seen this issue and can point out where it's from I can make the title more general. After a while the selection goes away and I can click again. I can send signals via VMware but it doesn't seem to help (just got to wait). Any idea what's causing this? * * * Finally, I noticed that the this was applying to any click when my mouse was held down over the scrollbar and I couldn't click anything else.


How to let rsync additionally store an differential changelog in another directory?

I'm using `rsync --link-dir` to obtain daily snapshots with little space usage due to the hardlinking. It would however be nice to also have a directory that, while mirroring the original structure, only contains (hardlinks to the full backup of) the files that have actually changed. As an example, here's the directory structure before:               source/        <- contains the original data     backup/current <- symlink to the most recent snapshot     backup/12102?  <- recent daily snapshots (irrelevant)      and here the desired structure after:               source/     backup/current <- symlink to the _updated_ snapshot     backup/previous<- symlink to the snapshot that was was "current" before     backup/12102?  <- ...     backup/current.changes  <- (symlink to) directory containing _only_ the files that                                have changed between "current" and "previous"


Upgrade zsh on red hat 5 x86_64

My machine is running RHEL 5 x86_64 I'm facing a problem with `oh-my-zsh` The `zsh` version on my machine is               zsh --version     zsh 4.2.6 (x86_64-redhat-linux-gnu)      There are no upgrades available via `yum`. How can I install a newer version of `zsh`? I've tried to look for `rpms` on the internet but they're for fedora or other distros.               ➜  src  sudo rpm -ivh zsh-5.0.2-1.fc18.x86_64.rpm       warning: zsh-5.0.2-1.fc18.x86_64.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID de7f38bd     error: Failed dependencies:         libc.so.6(GLIBC_2.11)(64bit) is needed by zsh-5.0.2-1.fc18.x86_64         libc.so.6(GLIBC_2.14)(64bit) is needed by zsh-5.0.2-1.fc18.x86_64         libc.so.6(GLIBC_2.15)(64bit) is needed by zsh-5.0.2-1.fc18.x86_64         libc.so.6(GLIBC_2.7)(64bit) is needed by zsh-5.0.2-1.fc18.x86_64         libtinfo.so.5()(64bit) is needed by zsh-5.0.2-1.fc18.x86_64         rpmlib(FileDigests) <= 4.6.0-1 is needed by zsh-5.0.2-1.fc18.x86_64         rpmlib(PayloadIsXz) <= 5.2-1 is needed by zsh-5.0.2-1.fc18.x86_64     ➜  src  sudo rpm -ivh zsh-4.3.17-1.fu2012.x86_64.rpm      warning: zsh-4.3.17-1.fu2012.x86_64.rpm: Header V4 DSA signature: NOKEY, key ID 42d68235     error: Failed dependencies:         libc.so.6(GLIBC_2.11)(64bit) is needed by zsh-4.3.17-1.fu2012.x86_64         libc.so.6(GLIBC_2.14)(64bit) is needed by zsh-4.3.17-1.fu2012.x86_64         libc.so.6(GLIBC_2.15)(64bit) is needed by zsh-4.3.17-1.fu2012.x86_64         libc.so.6(GLIBC_2.7)(64bit) is needed by zsh-4.3.17-1.fu2012.x86_64         libgdbm.so.3()(64bit) is needed by zsh-4.3.17-1.fu2012.x86_64         libtinfo.so.5()(64bit) is needed by zsh-4.3.17-1.fu2012.x86_64         rpmlib(FileDigests) <= 4.6.0-1 is needed by zsh-4.3.17-1.fu2012.x86_64         rpmlib(PayloadIsXz) <= 5.2-1 is needed by zsh-4.3.17-1.fu2012.x86_64      It appears that I can't install the latest version of glibc either :|


NICE a process and set it to RT

I have a Fedora system with sopcast running two streams. When I watch the stream locally it looks perfectly. But after being processed through my Fedora-box its a bit choppy. I want to set the streams to realtime and prioritize it over everything. As you can see below I've tried setting it to NICE -20 and the other consuming processes to something higher. It seems like it got worse after. How do I make it realtime? Could it be better after setting it for RT? The user running my streams is operate. And everything running on my init 5 + root should be prioritized lowest.               top - 02:09:54 up  1:25,  3 users,  load average: 0.11, 0.10, 0.09     Tasks: 185 total,   2 running, 183 sleeping,   0 stopped,   0 zombie     Cpu(s):  0.3%us,  0.9%sy,  1.2%ni, 96.7%id,  0.4%wa,  0.2%hi,  0.2%si,  0.0%st     Mem:   5914932k total,  2456904k used,  3458028k free,    68296k buffers     Swap:  8028156k total,        0k used,  8028156k free,  1557048k cached            PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                  3775 deluge    39  19  572m  42m  10m S  3.0  0.7   0:50.89 deluged                  1826 root      20   0  148m  20m 8544 S  1.0  0.4   0:21.69 Xorg                     2436 administ  25   5  225m 2520 1764 S  1.0  0.0   0:07.44 synergyc                 1716 operate    0 -20 19596 8244 1884 S  0.7  0.1   0:40.56 sp-so-auth               2367 administ  25   5  572m  15m 9.8m S  0.7  0.3   0:04.47 gnome-terminal             24 root      RT   0     0    0    0 S  0.3  0.0   0:00.24 migration/3               824 deluge    39  19  245m  30m 4236 S  0.3  0.5   0:16.45 deluge            Any other sugestions for getting the stream better? Doesn't seem like the processor is struggling processing it, but still. Deluge seems like it takes quite a lot. That one should be NICED positive? Edit: As a sidenote. My internet-connection is not maxing out. I'm running a BW monitor on the router (DD-WRT). And it shows a upload average of 2Mbit out of 10 Mbit and an average of 0,4 download out of 100Mbit. But the graph itself is behaving really strange. See attached picture. I've been wondering what this could be. Also talked with my provider about MTU and such, but they told everything looked good. As you can see, it's acting strange kind of falling down every other second. Almost as if it hits an maximum window-sizing somewhere. The streams are RTP / HTTP based and is in total 350Kbits + 20Kbits sound. ![Bandwidth monitor graph](http://i.stack.imgur.com/cri3u.png)


How to allow access to only one NTFS folder of already mounted partition for specific user?

I have two users: userA and userB. I have also NTFS formatted parition. Whole parition is only accessible to userA thanks to this in /etc/fstab:               /dev/sda3 /home/userA/data ntfs-3g defaults,rw,nouser,uid=userA,umask=077,exec 0 0      . I want to allow ONE folder (for example /home/userA/data/movies) to be accessible for userB, but not whole drive. How can I do this? If I allow all users in fstab, both users have access to whole drive, regardless if it is mounted in /home/userA/ folder. userB can simply do               ls /home/userA/data      even if he can't do               ls /home/userA      If I leave fstab as I have it set now and I use symlink, symlink respects permissions to folder it's linked to and userB won't be allowed to use this symlink. I also tried to use remount option, but only thing it can change is ro/rw option, it can't change uid, guid or similar for ntfs partitions. I guess policy below (from man mount) applies to ntfs too: > The -o remount may not be able to change mount parameters (all ext2fs- > specific parameters, except sb, are changeable with a remount, for example, > but you can't change gid or umask for the fatfs).


How to set & retrieve a cookie via an executable bash script that is on the web

A simple bash script that can set a cookie when executed via web :               #!/bin/bash     echo "Set-Cookie: eee=1"     echo "Content-type: text/html"     echo ""     echo "test"      I replaced the entire codes above with the following:               #!/usr/bin/env python     import os          print 'Set-Cookie: eee=1'     print 'Content-Type: text\n'          print ''          a = os.environ.get('HTTP_COOKIE')     print a          print ''      this one can now both set and retrieve a cookie. but it is no longer a bash script. it is a python script. the question is.. how to retrieve the cookie via bash script itself.. ?


How to change terminal character encoding

Today I uninstalled the GUI packages on my home CentOS installation. Now, when the machine starts, I get the login prompt. It acts finicky. Sometimes pressing enter just once after answering each prompt works. Other times, no. When I manage to get logged in, I can only enter commands in `bash` by entering one character at a time -- that is:               l, enter     o, enter     c, enter     a, enter     l, enter     e, enter     enter      Does anyone have some insight for this? UPDATE: This is the result of `stty -a`:               speed 38400 baud; rows 64; columns 160; line = 0;     intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;     eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;     werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;     -parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts cdtrdsr     -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff     -iuclc -ixany -imaxbel iutf8     opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0     isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt     echoctl echoke      None of the settings that differ from `stty sane` make a difference, though.


System boots only with CD inserted

I have a weird problem lately: My system only boots if either a CD is inserted (any CD, not a specific CD(*)) or if I enter UEFI-BIOS before boot. Otherwise, `grub2` would start but afterwards the screen stays black. The last thing I did before this problem occured (at least I think this was the last thing) was adding partitions on `/dev/sdb` and `/dev/sdc`, generating a raid-1 out of these two partitions and adding the RAID to `/etc/mdadm/mdadm.conf` and `/etc/fstab`. My boot-device however is `/dev/sda` (I have a EFI-partition on `/dev/sda1`) If that helps: I run Debian Wheezy (but also have some packages from experimental). How can I locate the error and solve it? (*) I tried the following CDs:   1. A Debian Wheezy Live DVD (actually a DVD, not a CD) => System booted   2. A Mini CD which came with my WiFi-Router (so to say a driver CD) => System booted   3. Another driver CD that came with my printer ages ago => System booted   4. A music CD (Vive la Fête - République Populaire, but I'm quite convinced that doesn't matter) => System _didn't_ boot It looks like all data CDs work... [edit] here's my dmesg file (with inserted CD)   http://pastebin.com/cxvv0Hqe   maybe that helps!?


How can I grep contents of files with bash only without using find or grep -r?

would like to write a bash program which if I type in the following:               -bash-4.1$ ./sample.sh path regex keyword      that will result something like that:               path/sample.txt:12          path/sample.txt:34          path/dir/sample1.txt:56          path/dir/sample2.txt:78      I have absolutely no idea how can I achieve this without using find or grep -r (but I can use grep/ sed/ awk) in bash... Please help... Thank you very much!!


why kjournald uses writes so much?

Total DISK READ: 1056.26 K/s | Total DISK WRITE: 9.20 M/s       TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND      1055 be/4 root          0.00 B     11.64 M  0.00 %  1.99 % [kjournald]      1054 be/4 root          0.00 B      9.72 M  0.00 %  1.70 % [kjournald]      1053 be/4 root          0.00 B      5.21 M  0.00 %  0.73 % [kjournald]      1056 be/4 root          4.00 K      2.77 M  0.00 %  0.39 % [kjournald]      1082 be/4 root          0.00 B      0.00 B  0.00 %  0.34 % [flush-8:48]      1078 be/4 root          0.00 B      0.00 B  0.00 %  0.33 % [flush-8:32]      1080 be/4 root          0.00 B      0.00 B  0.00 %  0.09 % [flush-8:16]       493 be/3 root          0.00 B   1128.00 K  0.00 %  0.04 % [jbd2/sda3-8]      1081 be/4 root          0.00 B      0.00 B  0.00 %  0.01 % [flush-8:64]      1079 be/4 root         16.00 K    228.00 K  0.00 %  0.01 % [flush-8:0]      1126 be/4 root          0.00 B      0.00 B  0.00 %  0.00 % [kjournald]      1125 be/0 root          0.00 B     56.00 K  0.00 %  0.00 % [loop0]      2974 be/4 nobody        4.00 K     12.00 K  0.00 %  0.00 % httpd -k start -DSSL      5506 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       301 be/4 nobody        0.00 B      8.00 K  0.00 %  0.00 % httpd -k start -DSSL       311 be/4 nobody        0.00 B      8.00 K  0.00 %  0.00 % httpd -k start -DSSL       314 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       332 be/4 nobody        0.00 B      8.00 K  0.00 %  0.00 % httpd -k start -DSSL     24916 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       347 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       348 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL     16741 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       367 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       368 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       384 be/4 nobody        0.00 B     12.00 K  0.00 %  0.00 % httpd -k start -DSSL       394 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       414 be/4 nobody        0.00 B     12.00 K  0.00 %  0.00 % httpd -k start -DSSL       421 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       422 be/4 nobody        0.00 B      8.00 K  0.00 %  0.00 % httpd -k start -DSSL     21049 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL     29281 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL     29289 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL      3517 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL     29389 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL     29390 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL     29398 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL     32207 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       874 be/4 nobody        0.00 B      8.00 K  0.00 %  0.00 % httpd -k start -DSSL     29562 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL      kjournald writes 11.64 mb data and stuff. THe sum of ALL other writes are not that much. Also what is jbd2/sda3-8


Difference between >> and >\> operators?

RHEL 6 Is there a difference between the `>>` and `>\>` operators? I read the following blurb in a RHEL training book: > "You can add standard output to the end of an existing file with a double > redirection arrow with a command such as `ls >\> filelist` I'm more accustomed to the `>>` operator and when I try both, I get different results.   * Using `>>` seems to append output to the file that follows it (as expected).   * Using `>\>` seems to append output to a file literally called **>** Is this a error in the book I'm reading? Or am I missing the author's point?


Intro to shell scripts with basic application: how do I set my computer to make an archive of a particular folder every day?

I've got a situation where I need to give some people access to my dropbox folder. Already so far they have deleted huge folders full of important data. Their computer skills could use a bit of work, apparently. Thankfully there is a restore function on the dropbox website. But the gui doesn't seem super- powerful, and I'm afraid that these people are going to permanently delete something. I've been making a zip archive of the folder, and saving it every day on my local machine. I've already restored files on it that I couldn't find on the dropbox restore gui. But I'm afraid that I'll get busy or lazy and forget to make the archive. So I figure that this is a good opportunity to learn basic automated shell scripting. How can I design a script that will   1. Run on startup   2. Prompt me (I don't know how) to see if I want to make a zip archive of a specific directory   3. Do so, and save it as `/path/to/archives/<date>` ?? I know only minimal bash at present (`cd`, `ls`, `ssh`, etc), so a working example of how to do such a thing would be a springboard to doing other useful similar things in the future. I'm running Ubuntu on a thinkpad x230.


24gb files removed but no changes to the available space. What could have happened?

We have this virtual machine that has Apache2 installed, we forgot to install a log rotate and we got 24gb of logs from Apache2, We removed those 24gb of log files but no changes occurred to the disk whatsoever, It was like I didn't removed the logs at all. Does any one understand what may have happened?               root@Web:~# cat /etc/*-release     DISTRIB_ID=Ubuntu     DISTRIB_RELEASE=10.04     DISTRIB_CODENAME=lucid     DISTRIB_DESCRIPTION="Ubuntu 10.04.4 LTS"          root@Web:~# df -kh     Filesystem            Size  Used Avail Use% Mounted on     /dev/sda1              29G   27G  675M  98% /     none                  744M  176K  744M   1% /dev     none                  748M     0  748M   0% /dev/shm     none                  748M  568K  748M   1% /var/run     none                  748M     0  748M   0% /var/lock     none                  748M     0  748M   0% /lib/init/rw     none                   29G   27G  675M  98% /var/lib/ureadahead/debugfs          root@Web:~# du -kh /var/log/apache2     24G     /var/log/apache2          root@Web:~# rm /var/log/apache2/*          root@Web:~# du -kh /var/log/apache2     4.0K    /var/log/apache2          root@Web:~# df -kh     Filesystem            Size  Used Avail Use% Mounted on     /dev/sda1              29G   27G  673M  98% /     none                  744M  176K  744M   1% /dev     none                  748M     0  748M   0% /dev/shm     none                  748M  568K  748M   1% /var/run     none                  748M     0  748M   0% /var/lock     none                  748M     0  748M   0% /lib/init/rw     none                   29G   27G  673M  98% /var/lib/ureadahead/debugfs


Which kind of additional cleanup may be required after removing manually added entries from /etc/hosts?

My system is "Unable to resolve" removed entry from /etc/hosts. During development, I needed to add the custom domain entry to /etc/hosts, stating it resolves to 127.0.0.1. This mapping worked fine. After I have finished with it and removed the entry, now I see error messages from different tools that claim this my custom name cannot be resolved any longer. Seems that every Java program that attempts to get the local host address is now crashing. I tried to reboot the machine, did not help. To make possible to work again, I have returned my custom naming to /etc/hosts. Which cleanup is required to get rid of it completely?


chmod + silent mode + how force exit code 0 in spite of error

Is it possible execute chmod and ignore error from command Example ( remark file.txt not exsist to show the example ) When I type               chmod 777 file.txt      I get error on the output                 chmod: cannot access file.txt : no such file or directory      So I add the-f flag to the command as the following: ( file.txt not exist in order to show the case )                 chmod -f 777 file.txt       echo $?       1      But from the example chmod return 1 Please advice how to force the chmod command to give exit code 0 in spite of error


if/then/else man page

I would like to know if there is any man page documenting the construction of the most basic script commands like `if/then/else`, `while`, `for each`, and all the relative switches, like `-eq`, `-e`, `-ge`, and so on.


How to execute Netscaler commands through a remote machine via SSH connection

I have been trying to execute some NetScaler commands like "bind" & "unbind" through a Linux Box via an SSH Connection. Now the Problem is, Manually we are able to enter & execute commands on NetScalar, but through SSH we are not. Netscaler is a hardware device (or network appliance) manufactured by Citrix, which primary role is to provide Level 4 Load Balancing. It also supports Firewall, proxy and VPN functions. if we log on to the Machine (in which NetScaler is configured), through a connection manager(Putty) we get a different prompt other than the shell. & Here we need to execute the commands like ... unbind lb vserver VS_Netbanking_443_26 -policyName manual_checkSession & bind lb vserver VS_Netbanking_443_26 -policyname manual_checkSession -priority 155 which we are able to execute, But when we try to execute the same through script (as given below), we are not able to. ./rem_expect_con.sh $SERVER $PASSWORD ``unbind lb vserver VS_Netbanking_443_26 -policyName manual_checkSession` ` & ./rem_expect_con.sh $SERVER $PASSWORD ``bind lb vserver VS_Netbanking_443_26 -policyname manual_checkSession -priority 155` ` Above "rem_expect_con" is a script built for Password less connection. i have tried giving above arguments as ./rem_expect_con.sh $SERVER $PASSWORD 'bind lb vserver VS_Netbanking_443_26 -policyname manual_checkSession -priority 155' ./rem_expect_con.sh $SERVER $PASSWORD "bind lb vserver VS_Netbanking_443_26 -policyname manual_checkSession -priority 155" ``./rem_expect_con.sh $SERVER $PASSWORD "bind lb vserver VS_Netbanking_443_26 -policyname manual_checkSession -priority 155"` ` But none of them are working. None of them are executing on the Netscaler. Please help.


Korn Shell: End, pgup, pgdown, and delete key not working

So basically my `End`, `Pageup`/`Pagedown`, and `Delete` key are not working in ksh93. I'm running FreeBSD by the way. My arrow keys are working, and so is my home key. Those keys work when I put this in my `.kshrc`               set -o emacs      I have tried doing THIS, by putting this in my `.kshrc`. To make the `End` key work.               alias __Y=`echo "\005"`     # end = ^e = end of line      I opened up vim, and pressed `Ctrl``v`, and typed `0``0``5`. And the `^E` showed up. Still, nothing worked. Anyone know anyway to get those key to work? Also, When ever I press those keys it prints out a `~`. I also know that I could use `Ctrl``d`, or `Ctrl``a`, I do NOT want to use these.


rsync hardlink attempt copies

I've tried setting up a script to hardlink my files to my box.com account (as it's a backup of my music library). As I want to run it automatically to sync my music across several devices, I wanted to use rsync as I'm on Mac OS X 10.7.4 (if anyone cares). The script I came up with however only copies the files instead of hardlinking them (the available disc space lowers when I start the script). What I'm trying to achieve is the box.com app syncing something outside its actual folder. I already RTFMed and googled but I can't come up with a proper solution so I hope you guys could help me. This is the script I use:               rsync -azluPhmt --progress --link-dest=./iTunes ./iTunes/Users/admin/Box.com/iTunes --delete-during --exclude="*Album Artwork*"


luakit + awesome wm: make youtube fullscreen work

I'm running Arch Linux on my box. I use the awesome window manager, which is a tiling WM, but allows floating windows too. The ArchWiki's _Awesome_ entry tells me to put the following in my awesome `rc.lua` to make youtube's fullscreen floating by default:               { rule = { instance = "plugin-container" },       properties = { floating = true } },      Yet this doesn't seem to be working. I've tried the rule they suggested for the `chromium` browser and this worked, which is leading me too believe that the approach is correct. I'm guessing that the `"plugin-container"` is not the correct specifier for the browser I'm am using: `luakit`. So here's the question: what is the correct `instance` specifier to make `luakit` youtube videos be recognized by the `awesome` rules?


How to install/setup psftp in open suse linux?

I'm a newbie in linux. we need to do a file transfer from an open SUSE Linux server to a Windows server and vice versa. We are required to use `psftp` for the file transfer. Can anyone tell me how to setup/install `psftp` in our Linux server and the steps to do a transfer? and please tell me how to know if `psftp` is already installed in my server (both OpenSUSE Linux and Windows).