Error connecting to NX server

When trying to connect to NX server with a **NX CLient for Linux** (installed from `nxclient_3.5.0-7_amd64.deb`) I get the following error.               NX> 203 NXSSH running with pid: 8009     NX> 285 Enabling check on switch command     NX> 285 Enabling skip of SSH config files     NX> 285 Setting the preferred NX options     NX> 200 Connected to address: nnn.nnn.nnn.nnn on port: 22     NX> 202 Authenticating user: nx     NX> 208 Using auth method: publickey     Received disconnect from nnn.nnn.nnn.nnn: 2: Too many authentication failures for nx      However when I am trying to use NX plugin for **Remmina remote desktop client** (from `remmina-plugin-nx`) I get the following _different_ error:               NX> 536 ERROR: Reached the maximum number of allowed users on this server.      The Remmina diagnostic log states that it is NXSERVER - Version 3.5.0-11 - LFE. Is it a problem on my (client) side, or on server side?


What's the idea behind rm not removing non-writable file by default? Every time you want to remove a file that is non-writable file for current user but you have a write permission on directory get this warning and you need to pres `y' to confirm deletion:               rm: remove write-protected regular file       I wonder why are non-writable files treated in such special way? One thing that comes to my mind is that such files are usually user config files that contain user secret data such as encrypted password so rm warns before deleting them. Now, what is the real reason?


Getting the current path in .desktop EXEC command

Im trying to make a .desktop file run a .sh which is stored in the same directory as the .desktop. The whole directory needs to be portable and moved from machine to machine. my run script is `run.sh` I've tried:               [Desktop Entry]     Type=Application     Terminal=true     Name=RunMe     #Exec=sh -c "`dirname %k`/run.sh"     #Exec=bash -c "export PATH=$PATH:`dirname %k`; bash run.sh;"     #Exec=bash -c "export PATH=$PATH:`dirname %k`; sh run.sh;"     Exec=bash -c "export PATH=$PATH:`dirname %k`; run.sh;"      But nothing happens when I double click the .desktop file. If I double click 'run.sh' and choose 'run' the script runs fine. If I run the script from the command line with '`sh run.sh`' it works fine. Any ideas, even just how I could debug which path its actually trying to run from?


RHEL installed once but displayed thrice in GRUB bootloader menu

In my machine, I have installed 2 operating systems.   * Windows 7    * RHEL 5.6.  When I boot the machine, the grub presents me the screen with the list of operating systems available as,   * Red Hat Enterprise Linux Server (2.6.18-348.12.1.el5PAE)   * Red Hat Enterprise Linux Server (2.6.18-348.12.1.el5PAE)   * Red Hat Enterprise Linux Server (2.6.18-308.16.1.el5PAE)   * Windows 7 I get the same window/desktop when I boot using any of the three listed RHEL versions. I checked the /etc/grub.conf file and there I could see three listing of RHEL. The contents of that file are as below.               default=0     timeout=5     splashimage=(hd0,2)/grub/splash.xpm.gz     hiddenmenu     title Red Hat Enterprise Linux Server (2.6.18-348.12.1.el5PAE)             root (hd0,2)             kernel /vmlinuz-2.6.18-348.12.1.el5PAE ro root=LABEL=/ rhgb quiet             initrd /initrd-2.6.18-348.12.1.el5PAE.img     title Red Hat Enterprise Linux Server (2.6.18-308.20.1.el5PAE)             root (hd0,2)             kernel /vmlinuz-2.6.18-308.20.1.el5PAE ro root=LABEL=/ rhgb quiet             initrd /initrd-2.6.18-308.20.1.el5PAE.img     title Red Hat Enterprise Linux Server (2.6.18-308.16.1.el5PAE)             root (hd0,2)             kernel /vmlinuz-2.6.18-308.16.1.el5PAE ro root=LABEL=/ rhgb quiet             initrd /initrd-2.6.18-308.16.1.el5PAE.img     title Windows 7             rootnoverify (hd0,0)             chainloader +1      My question is, why do we have 3 RHEL listed in the menu while I installed RHEL only once?


What's the top-left Button in KDE Windows?

I run Linux Mint 15 with KDE 4+. Consider this screenshot: ![enter image description here](http://i.stack.imgur.com/WH0zI.png) Underneath the LM logo, or beside the Firefox icon, above "File" and "Edit", there's a little circular button with a dot in the middle. I don't know what it does, and haven't been able to figure it out yet. Can anyone tell me what it does?


How can I get yum and the internet browser to work after fresh Fedora 20 installation

I am my wits end. After happily using Fedora 12 for several years, I decided it was time to upgrade. So, I bought a new computer three weeks ago and have been trying to install Fedora 20 ever since, with always the same eventual result. The vendor installed Windows xp3 for me, and I am using it for this posting. I have no trouble at all with dual boot and the Windows installation, including Internet access, and my two laptops and Motorola Milestone 2 mobile phone are all ok with the 'net in my house, they are wireless, this computer is on a wired connection, to a BT Home Hub 3 router. I have just tried, yet again, to install Fedora 20 from a DVD (full not live). At the "installation complete" message I ejected the DVD ready to re-boot, but the screen went blank and in the end I powered it down and turned it on again. I re-booted again from the screen because everything was very slow at first. Then I encountered exactly the same problem as before, I try `su` then `yum install emacs`, which is my favourite editor, and got the result in the image. If Ihad left it running I would have got the usual streams (up to 200 or so) of the "trying other mirror" before it returns to the prompt.![Screenshot of terminal ](http://i.stack.imgur.com/O14JH.png) I have installation DVDs, from the same supplier, for F17 and F19, I have tried them all with the same result. My problems all seem to be with the Internet in Fedora. However, using the default internet browser in the installed Fedora, most searches work after I try them twice in succession. And, of course, no Internet problems at all with the dual boot Windows on the same machine. I saved the image attached from Linux to Windows with no trouble, using the graphics listing application (is it "Dolphin" -- brain fuzzy) in Fedora. Just to make it completely clear, the only problem I have with the Internet is in my newly installed Fedora 20: the Windows XP3 in its partition on the same computer is completely ok. All that is different from my old F12 set up is a new computer and my Fedora installation. Please, what am I doing wrong? I hope that this is a recognised problem with a straightforward answer. Added 16-03-2014 Thanks for the kind suggestions. I am now getting the error "Cannot retrieve metalink for repository: fedora/20/i386. Please verify its path and try again". A web search shows this to be very common, with as many different answers as questions. None of them, those I can make sense of anyway, work for me. What is really needed is a diagnostic procedure that will lead to the underlying fault, and to a solution. Where can I find such a procedure, does it exist?


Download package via apt for another architecture

I am currently in a architecture amd64, so when I try `apt-get download vlc`, it downloaded the appropriate architecture for my system, but how can I download the i386 version via apt? It's for export to another system that doesn't have internet connection, also is there is any way to download any dependencies that follow?


Restricting GNU‑Make to POSIX Make behaviour

Is there a known way to make Linux's `make` reject unintended use of GNU‑Make specific extensions in Makefile when editing or using other's Makefile in Linux? I mean, restricting GNU‑Make to behave as the `make` specified in POSIX and reject any GNU‑Make specific extensions? The `.POSIX` special target is not enough, according to “4.9 Special Built-in Target Names (gnu.org)”. The man page does not mention a command line option for this. Using another `make` utility may be an option.


What is the Execute Disable bit?

I read an article about the Execute Disable Bit (EDB) on x86 CPUs. This is more widely known as the NX bit; Intel also calls it XD. So Windows XP supports this hardware feature. Yay! But how do I know if my Linux distribution of choice supports it? What problems can occur, if this BIOS option is enabled? Where do I read more on how this feature is handled by Linux?


Download from dynamically changing urls via script

I want to write a script to download all Walter Lewin lectures from this page in wmv format: http://videolectures.net/mit801f99_physics_classical_mechanics/ However the links to the wmv file for example for the first lecture: http://videolectures.net/mit801f99_lewin_lec01/ change when one reloads the page. So is it possible to write a script which downloads the lectures one after the other automatically in wmv format. How can one do this? I tried `wget -A wmv -r http://videolectures.net/mit801f99_physics_classical_mechanics/` and `httrack "http://videolectures.net/mit801f99_physics_classical_mechanics/" -O ~/VideoLecture "-*" "+*.wmv"` both didn't work. Note: This question emerged from the following question on physics sx: http://physics.stackexchange.com/questions/38033/walter-lewin-lectures-in-hd


OSX: dd quits after a few minutes

I'm trying to diagnose a possible disk problem on my OSX machine: I heard some funny noises, so I decided to do a read test of the entire disk using dd. A few months ago this worked: dd would run for a couple of hours to read 750 GB, and then quit with a message saying 'N bytes transferred in M seconds' Today, dd runs for a couple of minutes, then terminates with the message 'Killed'. I can't find what causes this. I'm using this command: dd if=/dev/disk1s2 of=/dev/null bs=1024k which should keep going until it runs out of blocks to read. The system logs don't contain any information on this (no events recorded around the time that dd is killed). What can I do to solve this?


How to create a user account with specific permissions?

I want to create a unix user account with specific permissions: this user must be able to install software, but can't remove software. Furthermore, when the user logs in, root must receive a notification in the mail. It is possible? I'm running Debian.


Cleanest way to use a smartphone as a conventional linux workstation

I have a GT-S5830 Samsung smartphone with Android 2.xxx, that I am not using as a phone. It would be nice if the device could be used as a wifi repeater. Unfortunately, this is impossible or not easily achievable. Sadly, the device is not listed among the CyanogenMod supported devices. Here it is explained that complete replacement of the Android for Ubuntu is impossible, and there exists some app, that installs a limited version of Ubuntu to run besides the Android, at the same time. Unfortunately the internal RAM appers to be quite limited: > Card slot 2 GB included Internal   >  RAM 278 MB I need the CPU and the wifi radio. If the camera works and is accessible from OpenCV, it would be a bonus. Can I flash a generic Linux system on this phone - with the abovementioned drivers and optionally a standard repository?


Mail filtering with procmail in a postfix/dovecot system with virtual users

I had a postfix/dovecot system with mail users working. After unsuccessfully following a few tutorials online to enable procmail, now I have an unusable system. What I want is to enable procmail filtering for my user paulo @ mydomain.com : **/etc/postfix/main.cf** # See /usr/share/postfix/main.cf.dist for a commented, more complete version               # Debian specific:  Specifying a file name will cause the first     # line of that file to be used as the name.  The Debian default     # is /etc/mailname.     #myorigin = /etc/mailname          smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)     biff = no          # appending .domain is the MUA's job.     append_dot_mydomain = no          # Uncomment the next line to generate "delayed mail" warnings     #delay_warning_time = 4h          readme_directory = /usr/share/doc/postfix          # TLS parameters     smtpd_tls_cert_file = /etc/postfix/smtpd.cert     smtpd_tls_key_file = /etc/postfix/smtpd.key     smtpd_use_tls = yes     smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache     smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache          # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for     # information on enabling SSL in the smtp client.          myhostname = centauri.mydomain.com     alias_maps = hash:/etc/aliases     alias_database = hash:/etc/aliases     myorigin = /etc/mailname     mydestination = centauri.mydomain.com, localhost, localhost.localdomain     relayhost =      mynetworks = 127.0.0.0/8     mailbox_size_limit = 0     recipient_delimiter = +     inet_interfaces = all     html_directory = /usr/share/doc/postfix/html     message_size_limit = 40720000     virtual_alias_domains =      virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf     virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf     virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf     virtual_mailbox_base = /home/vmail     virtual_uid_maps = static:5000     virtual_gid_maps = static:5000          # Configuring submission port for auth through dovecot     # http://www.postfix.org/SASL_README.html#server_sasl_enable     smtpd_sasl_type = dovecot     smtpd_sasl_path = private/auth     smtpd_sasl_auth_enable = yes          # -----          broken_sasl_auth_clients = yes     smtpd_sasl_authenticated_header = yes     smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination     #virtual_create_maildirsize = yes     #virtual_maildir_extended = yes     proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps     #virtual_transport = dovecot     virtual_transport = virtual     #transport_maps = hash:/etc/postfix/transport     dovecot_destination_recipient_limit = 1     #content_filter = smtp-amavis:[127.0.0.1]:10024      **/etc/postfix/master.cf**               # Postfix master process configuration file.  For details on the format     # of the file, see the master(5) manual page (command: "man 5 master").     #     # Do not forget to execute "postfix reload" after editing this file.     #     # ==========================================================================     # service type  private unpriv  chroot  wakeup  maxproc command + args     #               (yes)   (yes)   (yes)   (never) (100)     # ==========================================================================     smtp      inet  n       -       -       -       -       smtpd     #smtp      inet  n       -       -       -       1       postscreen     #smtpd     pass  -       -       -       -       -       smtpd     #dnsblog   unix  -       -       -       -       0       dnsblog     #tlsproxy  unix  -       -       -       -       0       tlsproxy     submission inet n       -       -       -       -       smtpd       -o syslog_name=postfix/submission       -o smtpd_tls_security_level=encrypt       -o smtpd_sasl_auth_enable=yes       -o smtpd_client_restrictions=permit_sasl_authenticated,reject       -o milter_macro_daemon_name=ORIGINATING     #smtps     inet  n       -       -       -       -       smtpd     #  -o syslog_name=postfix/smtps     #  -o smtpd_tls_wrappermode=yes     #  -o smtpd_sasl_auth_enable=yes     #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject     #  -o milter_macro_daemon_name=ORIGINATING     #628       inet  n       -       -       -       -       qmqpd     pickup    fifo  n       -       -       60      1       pickup              -o content_filter=              -o receive_override_options=no_header_body_checks     cleanup   unix  n       -       -       -       0       cleanup     qmgr      fifo  n       -       n       300     1       qmgr     #qmgr     fifo  n       -       n       300     1       oqmgr     tlsmgr    unix  -       -       -       1000?   1       tlsmgr     rewrite   unix  -       -       -       -       -       trivial-rewrite     bounce    unix  -       -       -       -       0       bounce     defer     unix  -       -       -       -       0       bounce     trace     unix  -       -       -       -       0       bounce     verify    unix  -       -       -       -       1       verify     flush     unix  n       -       -       1000?   0       flush     proxymap  unix  -       -       n       -       -       proxymap     proxywrite unix -       -       n       -       1       proxymap     smtp      unix  -       -       -       -       -       smtp     relay     unix  -       -       -       -       -       smtp     #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5     showq     unix  n       -       -       -       -       showq     error     unix  -       -       -       -       -       error     retry     unix  -       -       -       -       -       error     discard   unix  -       -       -       -       -       discard     local     unix  -       n       n       -       -       local     virtual   unix  -       n       n       -       -       virtual     lmtp      unix  -       -       -       -       -       lmtp     anvil     unix  -       -       -       -       1       anvil     scache    unix  -       -       -       -       1       scache     #     # ====================================================================     # Interfaces to non-Postfix software. Be sure to examine the manual     # pages of the non-Postfix software to find out what options it wants.     #     # Many of the following services use the Postfix pipe(8) delivery     # agent.  See the pipe(8) man page for information about ${recipient}     # and other message envelope options.     # ====================================================================     #     # maildrop. See the Postfix MAILDROP_README file for details.     # Also specify in main.cf: maildrop_destination_recipient_limit=1     #     #maildrop  unix  -       n       n       -       -       pipe     #  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}     procmail  unix  -       n       n       -       -       pipe       flags=RO user=vmail argv=/usr/bin/procmail -t -m USER=${user} EXTENSION=${extension} DOMAIN=${domain} /etc/postfix/procmailrc.common     #     # ====================================================================     #     # Recent Cyrus versions can use the existing "lmtp" master.cf entry.     #     # Specify in cyrus.conf:     #   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4     #     # Specify in main.cf one or more of the following:     #  mailbox_transport = lmtp:inet:localhost     #  virtual_transport = lmtp:inet:localhost     #     # ====================================================================     #     # Cyrus 2.1.5 (Amos Gouaux)     # Also specify in main.cf: cyrus_destination_recipient_limit=1     #     #cyrus     unix  -       n       n       -       -       pipe     #  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}     #     # ====================================================================     # Old example of delivery via Cyrus.     #     #old-cyrus unix  -       n       n       -       -       pipe     #  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}     #     # ====================================================================     #     # See the Postfix UUCP_README file for configuration details.     #     uucp      unix  -       n       n       -       -       pipe       flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)     #     # Other external delivery methods.     #     ifmail    unix  -       n       n       -       -       pipe       flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)     bsmtp     unix  -       n       n       -       -       pipe       flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient     scalemail-backend unix  -       n       n       -       2       pipe       flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}     mailman   unix  -       n       n       -       -       pipe       flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py       ${nexthop} ${user}     dovecot   unix  -       n       n       -       -       pipe       flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}     postfixfilter unix - n n - - pipe            flags=Rq user=vmail argv=/etc/postfix/spamfilter -f ${sender} -- ${recipient}     # Options for the filter     #smtp-amavis     unix    -       -       -       -       2       smtp     #        -o smtp_data_done_timeout=1200     #        -o smtp_send_xforward_command=yes     #        -o disable_dns_lookups=yes     #        -o max_use=20          # Listener for filtered mail     127.0.0.1:10025 inet    n       -       -       -       -       smtpd             -o content_filter=             -o local_recipient_maps=             -o relay_recipient_maps=             -o smtpd_restriction_classes=             -o smtpd_delay_reject=no             -o smtpd_client_restrictions=permit_mynetworks,reject             -o smtpd_helo_restrictions=             -o smtpd_sender_restrictions=             -o smtpd_recipient_restrictions=permit_mynetworks,reject             -o smtpd_data_restrictions=reject_unauth_pipelining             -o smtpd_end_of_data_restrictions=             -o mynetworks=127.0.0.0/8             -o smtpd_error_sleep_time=0             -o smtpd_soft_error_limit=1001             -o smtpd_hard_error_limit=1000             -o smtpd_client_connection_count_limit=0             -o smtpd_client_connection_rate_limit=0             -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks      **/etc/postfix/procmailrc.common**               SHELL="/bin/bash"     SENDMAIL="/usr/sbin/sendmail -oi -t"     LOGFILE="/var/log/procmail.log"     DELIVER=/usr/lib/dovecot/deliver     # fallback:     DEFAULT="$HOME/Maildir/"     MAILDIR="$HOME/Maildir/"     :0 w     * ^X-Spam-Status: Yes     | $DELIVER -m spam     :0 w     | $DELIVER      Why is it that when I send an email to my self procmail.log is not even created. It seems mails currently just getting lost since not even dovecot is picking it up.


Reverse match in sed, replace opposite of what was found

Say I have this output from my syslog,               precalculated src_hash => 20 bytes @ 0x7f811c001e20     A6 2D E5 CD 2A BA F0 42 56 66 19 D4 61 1A E3 A0  .-..*..BVf..a...     C7 5E 5F 77                                      .^_w     precalculated dst_hash => 20 bytes @ 0x7f811c0020d0     15 EC 34 59 89 0F 4F F8 C5 68 3A DC BB 09 27 91  ..4Y..O..h:...'.     5D C1 E7 28                                      ]..(      My goal is to strip off the ascii junk on the right and be left with only the hex bytes of the hash, while still saving the lines starting starting with the variable names. The regular expression I'm using is `(^([a-zA-Z_]+\s+)+[=]{1}) | (^([a-zA-Z0-9]{2}[\s]{1})+)` Which correctly matches a line starting with either a variable name or a hex string containing its value. Is there any way I could invert what gets matched from sed to strip out sort of "the other" stuff in the stream? Can it be piped to a file somehow?


How can I know Hardware configuration required for DNS server:   1. What will be the expected QPS (Queries Per Second) on the server. > > 5/Sec and peak time 10-20/Sec >>   2. How many hosts will be querying to the server. 3-5? >>   3. How many domains will be hosted on the server. 10-15? >>


Remapping keys that generate multiple scan codes

I have a ThinkPad W540. On its keyboard there are four multimedia keys above the numpad. Two of those keys generate keycodes (and, apparently, scancodes) that correspond to combination of keys, `Win_L` + `L` and `Win_L` + `E`. In other words, for the key that generates `Win_L` + `L`,   `showkey --scancodes` returns this:               0xe0 0x5b 0x26 0xa6 0xe0 0xdb      The `setkeycodes` command requires either single byte unescaped or escaped two-byte sequences to denote scan codes, and `showkey` gives me way more than that, so I can't quite re-map that key to one of the free keycodes in my system with a straightforward "setkeycodes ". After few hours of googling I'm still at loss as to how I can remap that key to something else that doesn't simply duplicate one of the existing key combinations on my keyboard and I would really appreciate any hints on how I can achieve that.


PATH update does not stay after reboot

I have updated the PATH environmental variable on a Redhat distribution but after reboot, the path is gone. To add the path:               PATH=/opt/rh/mysql55/root/usr/bin     export  PATH            echo $PATH     /usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/rh/mysql55/root/usr/bin      reboot removes the path echoing after               /usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin


What is the difference between Unix, Linux, BSD and GNU?

What is the very fundamental difference between Unix, Linux, BSD and GNU? Unix was the earliest OS, so the term 'Unix like' is understandable, since they have kernel, file system structure, most of the commands, users etc are same as Unix. Still why are they different? What made them set apart? Is it the kernel?


Creating one-time cgroup

I would like to be able to create a one-time temporary group in hierarchy. For example:               #!/bin/sh     run_with_csubgroup /sys/fs/cgroup/group/subgroup/      Which creates group say `/sys/fs/cgroup/group/subgroup/5G7ds/` (5G7ds is one- time name - it might be ID or anything). I would like to delete the group automatically but I don't know how to do it easily and prone to say TERM signal (from actidental `C-c`). Is there a way to do it? I'm using Gentoo+systemd.


how to forbid a command without a permission

I intended to delete all the backup files in a directory, so I was going to type `rm *~` in the terminal. Unfortunately, I hit the _Enter_ before hitting the _tilde_ and unhappy things happened. Although, I've recovered all deleted files I really don't want it to happen again. Could I forbid the execution of such a command unless being granted a permission, like that of a superuser?


Removing supend and hibernate privileges

On OpenSUSE 12.1 x86_64, Gnome 3.2 . I want to remove the suspend and hibernate options from the Gnome (Shell) menu as   * suspend makes no sense IMO for a desktop   * hibernate has a slight tendency to lock up I've found that I should configure these privileges using polkit. I've dropped a file named `90-disable-suspend.conf` ( also tried `90-disable-suspend.pkla` ) in `/etc/polkit-1/localauthority.conf.d` with the following contents:               [Disable Suspend]     Identity=unix-user:*     Action=org.freedesktop.upower.hibernate;org.freedesktop.upower.suspend     ResultAny=no     ResultInactive=no     ResultActive=no      However, running `pkcheck --action-id org.freedesktop.upower.suspend --process $$` prints nothing and has an exit code of 0 , and the menu entries are still present. AFAICT these are provided by `gnome-shell-extension-alt-status-menu` package. How can I remove the suspend and hibernate entries from the Gnome Shell menu and leave only Power Off?


readline: unix-word-rubout, but backwards, is it possible?

I'm trying to set up my `.inputrc` to perform a backwards `unix-word-rubout` but I'm currently failing at doing so.   I have `M-w` mapped in my `.inputrc`. this does not work:               "\eu": universal-argument     "\ew":  "\eu-1\C-w"      nor does this:               "\ew":  "\e-1\C-w"      not even doing it interactively in the shell by pressing `M--` followed by `C-w` works, i.e. it keeps deleting words on the left of the cursor. PS I know there are other kill/rubout readline commands but i really would like to have the `C-w` behavior of killing words using space as separator, just backwards.


using watch with ssh

I have a script:               export TERM=xterm     watch -t -d -n 1 'netstat -veeantpo | grep 43597      when we run this script though ssh, it does not determine the monitor resolution. so lines are wrapped although there is space to show results. You can see the result in the picture.(I have removed the trailing space after `ESTABLISHED`). ![enter image description here](http://i.stack.imgur.com/UNFVK.jpg)


How to change permissions/owner or delete Downloads folder (owner: root wheel)?

Something strange happened with my Downloads directory on my Mac OSX v 10.7.5. All of a sudden I wasn't permitted to save anything to the directory. The directory is in users/kelly/ and is the only one in that directory which doesn't have myname as the owner and group, instead it's root wheel:               drwxr-xr-x  104 root        wheel        3.5K Jan  1 20:55 Downloads/      When I try to change permissions with chown, ie:               kelly@kellys-MacBook-Pro:~$ chown -R kelly:kelly Downloads/      I get this response:               chown: Downloads//ftp/incoming: Operation not permitted     chown: Downloads//ftp: Operation not permitted     chown: Downloads/: Operation not permitted      When I try to just delete the whole directory it says permission denied. My reasoning here was that I could just delete the whole thing and make a new downloads directory. What's the deal? That ftp thing seems scetchy but I really don't know where to go from here... Thanks so much for you time!


How can I change all of the contents inside of directory to what the default file ownership and permissions are?

I have moved contents of another drive into my home directory, but the permissions are not what they should be. First, I changed ownership by entering:                 ~$ sudo chown -R USERME /home/USERHOME/      Which I think works now. But now, I wanted to simply change all of the files and sub-directories into the default permissions, with files being read+write, and directories being r+w+x. I have not found a recursive way of handling this. I have run:                 ~$ sudo chmod 755 -R /home/USERHOME/      To make everything available to me. However, files appear as executables, and this is not what I want. There are plenty more sub-directories and files so I am looking for a simple recursive solution. Basically, I think I am looking for a recursive way to reapply the default umask parameter to a whole folder with (I think) chmod. * * * ## Update: I have posted a solution thanks to @SkyDan and "changing chmod for files but not directories"


Trying to set date on a Linux based machine from another machine

I am running busy box on an embedded platform. I would like to set the date on the box properly each time I reboot the hardware. I have no way to save the time persistently, so am reduced to setting the time each time. I have LAN connectivity for it, but no SSH. My current hack for this is to redirect the output of 'date' to a file on my PC, access that file from my hardware platform through tftp, and then somehow parse the file, use its contents and then to set the date. I have no idea how to get the string from the file and then set it using the 'date' command. Any help would be appreciated. Any other way to set the date would be get. I have tried using ntpd, but that fails due to lack of internet connectivity


What's the difference between modification date and inode's modification date?

I've just found some interesting information for me in `man stat`:               a, m, c, B     The time file was last accessed or modified, of when the inode was last changed, or the birth time of the inode.      But what's the difference between file last modified time and the inode's modified time? I'm writing a bakup-bash script which allows to copy only last modificated files from two almost equally directories so I need to know which value I will prefer to use :)


Embedded linux LCD not calibrated

I have attached a new LCD to my embedded Linux device and when I run the system I found that it is shifted to the right. (the display starts from the middle of the LCD) I found 2 frame buffer drivers under Linux kernel driver and modify in following areas:               #ifdef CONFIG_TOPPOLY_TD035TTEA3_320X240             hsync_len   :  64,              vsync_len    :  6,             left_margin :  125,              upper_margin :  70,             right_margin:  115,               lower_margin :  36,             sync:        0,                     cmap_static:    0,             #endif      But the problem is still there. What should I do?


How do I hibernate my PC when I press the power button

Is there any way to make my PC hibernate when I press the power button? By power button I meant my CPU's power button. Obviously when I press this button somewhere some signal is sent which I don't know about since I am new to Linux. Can it be intercepted to enable my PC to hibernate?


How is FireFox running on a virtual machine that has no display?

I am using a Red Hat virtual machine, accessible only remotely. However when I use the `top` command, one of the displayed processes taking up the most memory is firefox, located at `/usr/lib64/firefox-3.0.18/firefox`. How could such a process be launched without a display, and could it be actually used by some processes? Is there a way to check which processes are using it?


Remove given parts of a string with sed?

$ echo 'NA'     NA     $ echo 'NA' | sed 's/SOMEMAGIC/NA/g'     NA      **My question** : how can I remove the string in the "echo" with SOMEMAGIC? The delimiter could be > I think


What does the tilde (~) mean at the end of a filename?

What is the file with the `~` at the end of the filename for?               $ ls # aliased to add flags     -rwxrwxr-x  1 durrantm  2741 May 16 09:28 strip_out_rspec_prep_cmds.sh~*     drwxrwxr-x 13 durrantm  4096 May 16 14:21 ../     -rwxrwxr-x  1 durrantm  2221 May 16 14:58 strip_out_rspec_prep_cmds.sh*      This is not the same as `.swp` files which are there while editing. The two files have quite a few differences and the newer file ( **no** `~` at the end) has the most recent changes and those changes are not in the older (~) file. Looks like I can delete it?


What does *~ mean?

At the end of a makefile I saw               rm -f *~ *.class      I understand the `*.class`, but what's `*~`?


What does ~ mean at the end of a file name (e.g. httpd.conf~)?

I edited a fresh apache config file in CentOS 5 using gedit. When I looked at the directory I saw now two files:               httpd.conf       and               httpd.conf~      What does the ~ signify?


Location of user passwords in FreeBSD

I am in a system administration course in college in which I have my own FreeBSD server set up, so I obviously can login as the root user. I need to figure out where the actual passwords for users are stored, where they are not encrypted, if they are even stored in such a way. I know that all user account information as well as process information is stored in the /etc/passwd directory but there are only "*" in the password fields. I just need to know the directory and file where they are stored.


Cloning USB drive in VMware with partclone

I created a virtual machine in VMware as follows:   1. SCSI HDD 1 GB (Main for short)   2. SCSI HDD 0.8 GB (UClone for short)   3. SCSI HDD 4 GB as a physically plugged UFD (Uphys for short)   4. Arch Linux ISO as virtual CD Where the UFD is a live USB created with YUMI. After booting Arch via the ISO with `fdisl -l`, I get this mapping:   1. Main is sda   2. UClone is sdb    3. Uphys is sdc and is reported as W95 FAT32 (LBA).  Now I want to clone Uphys to UClone, note that Uphys used space is about 600 Mega. If I issue:               partclone.fat32 -b -s /dev/sdc -o /dev/sdb      I get:               fatclone.c: Unknown fat type!!      Is it referred to source or output? The former is reported as W95 FAT32, the latter is unallocated. UPDATE With `/dev/sdc1` as source, instead of `/dev/sdc`, I can go a bit further. But it seems that `partclone` is unable to get the actual used block size: http://s24.postimg.org/vwzhkhzcl/partclone1.png If I set the `-C` option as suggested, I get a `clone seek error` and the destination device gets messed: http://postimg.org/image/51xaywn6r/


How to get LIRC Remote working with Fedora 19

I am using Fedora 19 with KDE. I want to control it using my LIRC Remote. How can I configure the remote in my system? It only sends ASCII values and I want to map it with real-time standard values.


Is running GUI apps on server a security issue?

To edit system files for example `/etc/named/named.conf`, I use:               su -     Password:     gedit      And then opens and edit above like files, instead of:               nano /etc/named/named.conf       or:               vi /etc/named/named.conf      Can this habit of using GUI tools every now and again cause a security problem, especially in **server** environment?


Gnome 3: open and resize application at startup

I need to open a couple of terminal windows and watch the output of a couple of programs. Currently I open them in `~/.profile`, then once in Gnome I click them to bring them to the front, then resize them, then select "Always on top", then move them to a specific spot on my screen. Can this all be done automatically? Similar question, but I am not very familiar with X, and maybe Gnome offers an easier solution.


Couldn't fill logical volume maps

So I have a big problem here. On our server, there is an LVM raid with one volume group called `raid`. It contained two volumes, `secured` and `unsecured` and some unallocated space. Today I tried to remove `unsecured` and recreate it with using all of the remaining free space. I ran the following commands               lvremove unsecured raid     lvcreate -l 100%FREE -n unsecured raid      and it said               logical volumes cannot contain more than 65534 extents.       logical extent (0) already mapped.       Couldn't fill logical volume maps.       logical extent (0) already mapped.       Couldn't fill logical volume maps.       logical extent (0) already mapped.       Couldn't fill logical volume maps.       logical extent (0) already mapped.       Couldn't fill logical volume maps.       Volume group for uuid not found: GC3toI0uhKos5KLH0OJ6uMFppc9pSSyl00000000000000000000000000000001       Failed to activate new LV.      After that, I cannot use any lvm command anymore, e.g., `lvdisplay`, `vgdisplay` etc. It always says something like this:               # vgdisplay       logical extent (0) already mapped.       Couldn't fill logical volume maps.       logical extent (0) already mapped.       Couldn't fill logical volume maps.       Volume group "raid" not found      Right now, `secured` is still mounted and I can access the data. I am very worried that data may be lost when I reboot. What is going on here? What did I do wrong and can I somehow fix this?


How do you empty the buffers and cache on a Linux system?

Prior to doing some benchmarking work how would one free up the memory (RAM) that the Linux Kernel is consuming for its buffers and cache?


How can I delete a word backward at the command line (bash and zsh)?

How can I delete a word backward at the command line? I'm truly used to some editors deleting the last 'word' using ctrl+backspace, and I'd like that functionality at the command line too. I am using Bash at the moment and although I could jump backward a word and then delete forward a word, I'd rather have this as a quick-key, or event as ctrl+backspace. How can accomplish this?


How do I remove the 'split lines' error in Bluefish?

How can I stop this error from occurring **every time** I start Bluefish editor? _Of course, apart from shortening long lines..._ ![error](http://i.stack.imgur.com/74aSo.png) Bluefish 2.2.4, running on Fedora 19. **Edit:** I have done this in settings: ![editor](http://i.stack.imgur.com/hEGz1.png) Which annoyingly, had no effect at all...


Bash:  why isn't "set" behaving like I expect it to?

I have observed that only the values of exported variables are appended to the my PATH variable via my Mac OS X .bash_profile. Whereas, the values of locally set variables cannot. Why can't local variables be appended to the path? * * * “You've misinterpreted something, but what? Post the code that puzzles you. – Gilles yesterday” Please consider this snippet, where I set the MONGODB variable as:               set MONGODB="/usr/local/mongodb/bin"         export PATH=${PATH}:${MONGODB}      I source .bash_profile in terminal. I see the following echo ... PATH=~/bin:/usr/bin:/usr/local/bin:/usr/local/sbin: Whereas, if I export MONGODB instead, and source my .bash_profile, I see the following echo ... PATH=~/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mongodb/bin Perhaps, using "set" is improper?


What packages are installed by default in Debian? Is there a term for that set? Why some of those packages are `automatically installed` and some not?

It's a very simple question, but I wonder, is there a term to refer to the subset of packages that is automatically installed by Debian distribution? I though that it had something to do with packages priorities, but it doesn't seem to be the case, cause there are packages of all the priority levels among the packages installed by default. Also, some of those packages of initial subset have `automatically installed` flag, e.g. `wireless-tools`. So they will be automatically removed if packages of the initial subset, depending on them, are manually removed. I wonder, does the installation tool keep only a list of packages to be considered manually installed and installs their dependencies automatically? **Answer to the first two questions:** After installing the core Debian utilities, Debian installer seems to invoke `tasksel` to carry out installation "tasks". Among the typical tasks are "standard" task and "laptop" task. From tasksel page: > "standard" task > > The standard task is a special task used by Debian Installer. It actually > relies on the packages' priority. What does the "standard system" task > include? > > `tasksel --task-packages standard` > > which is an aptitude search string that equates to > > `aptitude search ~pstandard ~prequired ~pimportant -F%p` So `tasksel` installs `standard`, `required` and `important` packages. > "laptop" task > > The laptop task is a special task use by Debian Installer, to pull the > packages useful on a laptop:   * wireless-tools    * acpi-support   * cpufrequtils   * acpi   * wpasupplicant    * powertop   * acpid   * apmd   * pcmciautils    * pm-utils   * anacron   * avahi-autoipd    * bluetooth > Desktop See https://wiki.debian.org/DebianDesktop/Tasks


Vino on Gnome DE Fedora 18 listening on 0.0.0.0

Listening IPv4://0.0.0.0:5900      After a bit of searching I found this in an error log somewhere. I appreciate the vagueness of this but how do I configure the ip vino should be listening on? also I cannot find the location of the vino binary either. It's not in `/usr/bin/` where the client vinagre is. edit: once a session is created locally on the machine in question vino does start listening on 5900, which i guess is the whole point of remote desktop as opposed to remote x window tunnelling (ie you want someone to log in remotely to an existing session). But I still cannot create a remote desktop session using vino from a remote client (I use remmina on the client machine) over the lan. Client-wise Remmina just reports               [VNC]ConnectClientToTcpAddr6: connect     [VNC]ConnectToTcpAddr: connect     [VNC]Unable to connect to VNC server      and I can create a remote x window ssh tunnel so there is no problem connecting to the box.


setting up ssh public key

Okay, so I'm trying to setup a login for logging in with ssh, using a public key. First, I am using puttygen to generate a rsa-ssh2 public key using a passphrase. I followed the directions and generated the key. I saved the private key in its own file for putty and puttygen also generated the public key. In putty I set it up to use the private key file and use rsa-ssh2 etc... So I c/p'd my houtput ssh2 public key stuff from puttygen and on the server, I put that into               username/.ssh/authorized_keys      So I tried to then login through putty and first it prompted me for my username instead of asking for passphrase, and then when I entered it in (I tried both username and passphrase) it said my public key was invalid. I thought maybe I somehow c/p'd or formatted the info into authorized_keys wrong, so I went back and double checked. I made sure it was all on one line, properly spaced etc... I also checked in the following file `/etc/ssh/ssh_config` and I have the following:               IdentityFile ~/.ssh/id_rsa      I tried renaming my authorized_keys file to id_rsa and no joy. I tried changing that line in ssh_config to               IdentityFile ~/.ssh/authorized_keys      ...and no joy. I went back to thinking maybe my public key was malformed or that putty wasn't configured properly so I asked a friend to make a temp account for me on his server and add my public key and I was able to login through putty just fine...when I connected to his server, it prompted me for the passphrase for my key and logged me in just fine. So he suggested I look at that stuff above but no joy and he doesn't know what else to check soo...I guess I'm appealing to the experts here :P thoughts?


mplayer not sending the correct user-agent

I am trying to play a stream through mplayer. Here is the command I execute:               mplayer -user-agent "PS4 libhttp/1.60" -cache 8192 -v ffmpeg://http://the_stream_url.m3u8      The stream does not play due to a `403 - Forbidden error`. This is expected if the user-agent is not correctly set. What makes me think the user-agent is not read correctly is that every HTTP request shows this user-agent instead:               User-Agent: Lavf/55.33.100      Is there anything I did not understand or do correctly? Also note that I can correctly play the stream through VLC by using the same URL and `:http-user-agent=PS4 libhttp/1.60` as the edit options. Here is the full log, if needed.


encrypted ext3 damaged; how to proceed?

My home partition on a Debian wheezy install is an encrypted LVM volume. It is ext3. Earlier today, I had a weird message in a terminal window about an attempt to write to a file in my `/home` tree failing due to having a read only file system. I rebooted and ended up with an error message saying `/dev/sda1 is reported as clean. fsck.ext3`, which runs automatically and reports that there is no such device as `/dev/mapper/sda1_crypt` and reports exit code 8. I get dropped to a maintenance shell and told there was an attempt to write a log to `/var/log/fsck/checkfs`. That log reads:               [Timestamp]          fsck from util-linux 2.20.1     /dev/mapper/sda1_crypt: Super blocks need_recovery flag is clear, but journal has data.     /dev/mapper/sda1_crypt: Run journal anyway          /dev/mapper/sda1_crypt: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY          (i.e., without -a or -p options)     fsck died with exit status 4      I ran               $ fsck -vnM /dev/mapper/sda1      A bunch of `illegal block #nnnn (mmmmmmmmm) in inode ppppppp IGNORED` messages blew past, followed by               too many blocks in Inode somenumberhere      Then running additional passes to resolve blocks claimed by more than one inode It then output               Pass 1B: Rescanning for multiply claimed blocks      After a bit, I got a wall of               Illegal block number passed to ext2fs_test_block_bitmap somenumberhere for multiply claimed block map      These were followed by 2 Multiply claimed blocks in I node anothernumber: [lists of 5 and 8 block numbers] Then I got a number of stanzas like               [ 3828.181915] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0     [ 3828.182462] ata1.01 BMDMA stat 0x64     [ 3828.183810] ata1.01 failed command: READ DMA EXT     [ 3828.185889] ata1.01 cmd 25/00:08:08:10:9c/00:00:29:00:00/f0 tag dma 4096 in     [ 3828.185891] res 51/40:00:09:10:9c/40:00:29:00:00/f0 Emask 0x9 (media error)     [ 3828.190071] ata1.01 status: { DRDY ERR }     [ 3828.192153] ata1.01 status: { UNC }      These were followed by               [ 3830.509338] end_request: I/O error, deb SDA, sector 698093577     [ 3830.509841] Buffer I/O error on device dm-3, logical block 87261184     Error reading block 87261184 (Attempt to read block from filesystem resulted in short read) while reading I node and block bitmaps. Ignore error? no          fsck.ext3: Can't read an block bitmap while retrying to read bitmaps for /dev/mappersfa1_crypt          /dev/mapper/sda1_crypt: ******* WARNING: Filesystem still has errors *******          e2fsck: aborted          /dev/mapper/sda1_crypt: ******* WARNING: Filesystem still has errors *******      And the it aborted with a warning that the filesystem still had errors. My questions are:   1. Is my data toasted? (My rigorous backup policy hasn't been rigorously followed of late; I am being punished by the universe, I am sure.)   2. What can/ought I to do now?   3. Did I do the wrong thing already?   4. Will someone hold me until the shaking stops? EDIT I also asked on my local LUG mailing list. The advice I got there was to take an image of the drive with ddrescue and run fsck on a copy of that image. That seems sound and unlikely to make things worse. So, that is the present plan of attack, pending any better suggestions.


Repackaging RPMs

We're using HP DataProtector for our backup environment. The installation method leaves something to be desired, and we're attempting to automate it in such a way that it makes our Unix admins cringe less often. We're a SLES/OpenSUSE shop, so we're attempting to make up a YUM repository with the DP patches. I can make the repo just fine, it's just that the patch RPMs aren't configured right. The 'Revision' field in the RPM is not set correctly, they're all "1" even though the master RPM I pulled them out of is correctly incrementing. I would really like to be able to rebuild these RPMs with the correct Revision, as that would allow the normal update process to deal with these patches instead of the strange way HP wants to handle these. * * * The strange way HP wants to handle these requires:   * Setting up an Installation Server with all of the software. No problem.   * Allowing `root` to ssh into client stations to install software that affects xinitd config      * Which in turn requires a passwordless SSH public-key to be placed on all target machines so the install process can remote in w/o prompting.     * Before any deployments can be made, each client must be manually SSHed to by root on the repo server in order to populate known_hosts Since we don't allow `root` logins via SSH, every time we get a patch we have to touch each server's sshd_config to allow them temporarily. We've also proven that after the initial install, subsequent patches can just be installed via `rpm` just peachy. So, we'd like to get that into a YUM repo if at all possible.


How to change ALL the postfixes of files in a single directory, single command

> **Possible Duplicate:**   >  How to clean up file extensions? have a directory full of files ending with .JPG I need to change them all to .jpg   How?


Multiple renaming files

> **Possible Duplicate:**   >  How to clean up file extensions? I'd like to rename files with extension .flac.mp3 to extension .mp3. I used the following command               $ for i in *; do mv $i `echo $i | sed 's/.flac//g'`; done      This writes for every file the following error message.               mv: target `file.mp3' is not a directory      Where am I doing mistake? thank you


File extension case sensitivity on CentOS

> **Possible Duplicate:**   >  How to clean up file extensions? I'm using CentOS. There are >10M images in one of my folders, which are furthur grouped into subdirectories. The issue is that some of my images are named as abc. **jpg** and others are named as xyz. **JPG**. So, when i try to access xyz.jpg, it says "File not found" as the extension is case-sensitive. Is there any way to rename all `JPG` to `jpg`, or a httpd config which works around this issue.


How to rename multiple files in single command or script in Unix?

I have the below list of files               aro_tty-mIF-45875564pmo_opt     aro_tty-mIF-45875664pmo_opt     aro_tty-mIF-45875964pmo_opt     aro_tty-mIF-45875514pmo_opt     aro_tty-mIF-45875524pmo_opt      that I need to rename to               aro_tty-mImpFRA-45875564pmo_opt     aro_tty-mImpFRA-45875664pmo_opt     aro_tty-mImpFRA-45875964pmo_opt     aro_tty-mImpFRA-45875514pmo_opt     aro_tty-mImpFRA-45875524pmo_opt      Please help me out.


Rename files in directory

How to rename files in a directory such as the following file: `PMC21375.pdf.txt`, I need to be renamed to `21375.txt`. i.e, I need to remove both `PMC` and `pdf` from each file name.


How to find files not of a certain type?

I'm trying to find out all of the different types of files in my unorganized music folder. I've been trying this command (to list files of types besides the ones I know are in there):               find zUnorganized/ -not -iname "*.mp3" -and -not -iname "*.flac" -and -not -iname "*.MP3" -and -not -iname "*.wav" -or -not -iname "*.m4a" -and -not -iname "*.jpg"      But it's not working. How would I get that command work? Is there a way to do it using -regex? Thanks!


Could the Kernel stack of a process be empty, when a process is swapped out to a disk?

I am just curious to know whether the Kernel stack could be empty when a process is swapped out to a disk or not?


child process does not inherit the pending signals from the parent after a fork system call, why?

Could anybody please tell me the reason to why pending signals are not inherited by the child process? On the other hand, the child process inherits the signal handlers and signal mask from the parent, why is this done? An example would be very helpful, so that i could understand the concept much better.


replace xen kernel with non xen kernel

I have a virtual appliance in Xen format (XVA) that I wish run to on another hypervisor (MS Hyper-V). What have I done so far: I have converted the XVA to OVF using XenConvert, this resulted in a vhd file. I created a new VM and attached the vhd to it. The VM fails to boot, I think this happens because it runs a xen dom0 kernel. This is the error: ![Error 13: Invalid or unsupported executable format](http://i.stack.imgur.com/B7i5s.png) I think I need to replace the xen kernel with a non xen kernel. Can I simply download a pre-compiled kernel (where?), boot with live cd, place it on disk and change grub.conf? **EDIT:** Trying Doug O'Neal's answer, I needed to install lvm2 (apt-get install lvm2) and mount VolGroup00. After that I installed the kernel with yum and copied it over to the boot partition. I edited grub.conf and tried to boot. System hangs after booting kernel. Any suggestions? ![hanging on boot](http://i.stack.imgur.com/MOKVJ.jpg) EDIT2: changed grub to use tty0 as console (was xvc0), now getting a little further, will troubleshoot that first. EDIT3: I have changed several references to XEN ad per @Nils answer. It is still needed to replace the kernel and I think this is currently my problem: When I run yum install kernel I am observing the following error: error opening /sys/block: No such file or directory error opening /sys/block: No such file or directory WARNING: No module xenblk found for kernel 2.6.18-348.18.1.el5 I found that error in the CentOS bug tracker: http://bugs.centos.org/view.php?id=2083 as suggested in there I tried: mkinitrd -v --with=xenblk --omit-scsi-modules --omit-raid-modules /boot/initrd-2.6.18-348.18.1.el5.img 2.6.18-348.18.1.el5 but that fails with: No module xenblk found for kernel 2.6.18-348.18.1.el5, aborting


How to query installed packages with specific use flag?

I want to query a installed package, and it must have specified use flag: > e.g. eix -I curl: _use flag_ Currently I am using `grep` to filter the output. I want to know if it is possible to do it in one command line.


Problem understanding 'hash' command in a .sh file

So I wanted to install etherpad lite on a linux machine. If I try to run it, I will get the Error "Please install node.js ( http://nodejs.org )" the command 'which node' gives me the correct path to node js. So I went into the .sh File of Etherpad Lite and found this:                   #Is node installed?       hash node > /dev/null 2>&1 || {        echo "Please install node.js ( http://nodejs.org )" >&2       exit 1      }      I guess it means: check for node --> if not available print line and exit. But what exactly does this code do? what does hash do? What's with all these & and > ? Anybody who can explain to me this 3 lines would be really appreciated.


How different is I/O handling of hard disk in AIX and Redhat Linux?

I am running a hadoop I/O workload in redhat linux and have ran that in IBM AIX as well with same underlying hardware, disk and disk configuration. With the default settings on the os redhat linux is giving more I/O throuhput compared to IBM AIX. So how different is the device drivers configurations in redhat linux from IBM AIX for handling I/O from the hard disk ? I know Redhat Linux has a disk scheduling algorithm namely by default as CFQ(Completely Fair Queue), Noop scheduler, anticipatory scheduler,deadline scheduler. does these also effect the I/O throughput of the disk. and as far as i know AIX does not have these kind of scheduling algorithm. we can increase the depth of the queue in AIX but that is also not increasing the throuhput of the disk much. The device driver implementation are different in both the cases as i know is the device driver implementation of redhat linux is more efficient in handling the I/O that is why am i seeing this kind of difference ? Or is it that AIX can be optimized to get more throuhput as that of Redhat Linux ?


What does which's --tty-only option do?

I just realized that my sysadmin has created a global alias for `which`:               alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'      The `which` manpage just says: > Stop processing options on the right if not on tty. What does this mean?


How to get output from Nagios in a file

I have configured Nagios monitoring tool for a linux server m/c to monitor another linux host m/c(till now I am monitoring a single m/c only). I have followed the official documentation and installed nagios server on server side and NRPE daemon on client side. As per documentation the nagios is working successfully and maintaining its periodic checks for all the services that I have made it to monitor and also installed some additional plugins too. But I want to know the procedure how to get output of the monitoring hostory in a particular file in a proper format. As I have not installed the web interface through Apache, yet is there any solution for my problem Following is the log file I am getting for nagios monitoring:               [1349064000] LOG ROTATION: DAILY     [1349064000] LOG VERSION: 2.0     [1349064000] CURRENT HOST STATE: localhost;UP;HARD;1;PING OK - Packet loss = 0%, RTA = 0.03 ms     [1349064000] CURRENT HOST STATE: remotehost;UP;HARD;1;PING OK - Packet loss = 0%, RTA = 0.17 ms     [1349064000] CURRENT SERVICE STATE: localhost;Current Load;OK;HARD;1;OK - load average: 0.00, 0.00, 0.00     [1349064000] CURRENT SERVICE STATE: localhost;Current Users;OK;HARD;1;USERS OK - 7 users currently logged in     [1349064000] CURRENT SERVICE STATE: localhost;HTTP;OK;HARD;1;HTTP OK HTTP/1.1 200 OK - 1889 bytes in 0.001 seconds     [1349064000] CURRENT SERVICE STATE: localhost;PING;OK;HARD;1;PING OK - Packet loss = 0%, RTA = 0.04 ms     [1349064000] CURRENT SERVICE STATE: localhost;Root Partition;CRITICAL;HARD;100;DISK CRITICAL - free space: / 108 MB (1% inode=61%):     [1349064000] CURRENT SERVICE STATE: localhost;SSH;OK;HARD;1;SSH OK - OpenSSH_5.1 (protocol 2.0)     [1349064000] CURRENT SERVICE STATE: localhost;Swap Usage;OK;HARD;1;SWAP OK - 97% free (841 MB out of 870 MB)     [1349064000] CURRENT SERVICE STATE: localhost;Total Processes;OK;HARD;1;PROCS OK: 79 processes with STATE = RSZDT     [1349064000] CURRENT SERVICE STATE: remotehost;CPU Load;OK;HARD;1;OK - load average: 0.08, 0.02, 0.01     [1349064000] CURRENT SERVICE STATE: remotehost;Current Users;WARNING;HARD;3;USERS WARNING - 3 users currently logged in     [1349064000] CURRENT SERVICE STATE: remotehost;File Size;WARNING;HARD;3;WARN: /home/new/ctags.1p has size 13864 Byte. Warn at 13000. :     [1349064000] CURRENT SERVICE STATE: remotehost;Swap Usage;OK;HARD;1;SWAP OK - 100% free (869 MB out of 870 MB)     [1349064000] CURRENT SERVICE STATE: remotehost;Total Processes;OK;HARD;1;PROCS OK: 106 processes     [1349064000] CURRENT SERVICE STATE: remotehost;Zombie Processes;OK;HARD;1;PROCS OK: 0 processes with STATE = Z     [1349064028] SERVICE NOTIFICATION: nagiosadmin;remotehost;Current Users;WARNING;notify-service-by-email;USERS WARNING - 3 users currently logged in     [1349064988] Auto-save of retention data completed successfully.     [1349065258] SERVICE NOTIFICATION: nagiosadmin;remotehost;File Size;WARNING;notify-service-by-email;WARN: /home/new/ctags.1p has size 13864 Byte. Warn at 13000. :     [1349065938] SERVICE NOTIFICATION: nagiosadmin;localhost;Root Partition;CRITICAL;notify-service-by-email;DISK CRITICAL - free space: / 109 MB (1% inode=61%):     [1349067628] SERVICE NOTIFICATION: nagiosadmin;remotehost;Current Users;WARNING;notify-service-by-email;USERS WARNING - 3 users currently logged in     [1349068588] Auto-save of retention data completed successfully.     [1349068858] SERVICE NOTIFICATION: nagiosadmin;remotehost;File Size;WARNING;notify-service-by-email;WARN: /home/new/ctags.1p has size 13864 Byte. Warn at 13000. :     [1349069538] SERVICE NOTIFICATION: nagiosadmin;localhost;Root Partition;CRITICAL;notify-service-by-email;DISK CRITICAL - free space: / 109 MB (1% inode=61%)      Tell me please if I am wrong at something regarding this. If any more nagios info is required for this problem, let me know I will share that surely. Thanks in advance.


Install package pacemaker-mgmt on debian wheezy

I want to install a GUI for Pacemaker on Debian Wheezy. I've seen that it is available only in the unstable branch. However I've added unstable branch to apt get sources.list               deb http://ftp.de.debian.org/debian/ unstable main non-free contrib     deb-src http://ftp.de.debian.org/debian/ unstable main non-free contrib      I'm not able to install the packet because of unresolved dependencies:               apt-get install pacemaker-mgmt      Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      pacemaker-mgmt : Depends: libcib1 (>= 1.1.7) but it is not going to be installed                       Depends: libcrmcluster1 (>= 1.1.7) but it is not going to be installed                       Depends: libcrmcommon2 (>= 1.1.7) but it is not going to be installed                       Depends: libpe-status3 (>= 1.1.7) but it is not going to be installed     E: Unable to correct problems, you have held broken packages.      How can I solve this? Is there another GUI for pacemaker available which also runs on Debian Wheezy?


ksh, perform action when reaching loop maximal value

I am looking to write a small korn shell script doing 5 tests (by waiting some time before each one) and then, if they all fail, performing an action. I was looking at doing something like :                   for i in {1..5}         do            "doMyTest"             #it fills a variables "status" (but can unfortunately fails)            if [ "$status" ]; then #if status is filled then we can leave the loop               break            fi            sleep 3                #else wait some time before doing another try         done              if [ -z "$status" ]; then            exit 1         fi          ... then the rest of my program      Do you have any idea how could I do this in a better way ? It sounds a bit redundant ...


Moving /var, /home to separate partition

I am attempting to move some folders (such as `/var` and `/home`) to a separate partition after reading this guide: 3.2.1 Choose an intelligent partition scheme I was able to move one folder successfully following this guide. However, it doesn't seem to work for multiple folders and all my folders are dumped into the partition without proper folders. I would like to mount `/var`, `/home`, `/tmp` onto the seperate partition, can someone guide me on this?


Add $HOME/bin to PATH for a single user in Debian Wheezy with LXDE

In Ubuntu, if $HOME/bin exists, it will be automagically added to PATH, but this doesn't happen in Debian. How do I permanently add it to PATH for a given user, but only for him, not for all users? I want it to be valid for GUI programs also, not just for the terminal. **Edit:** To clarify, I use LXDE, and from a login manager, i.e. not `startx`. `.bashrc` does not work for programs I start outside a terminal.


How to make sure that Thinkpad discharges external slice battery first?

The thing is that when an external slice battery pack is connected, the laptop first discharges the internal one. This is a problem because then it is impossible to switch between multiple external battery packs without powering off the laptop. It is also not possible to just disconnect the external battery pack when you e.g. need to insert it into a docking station. Thus, my question: how to change the discharge order under Linux? For my use cases following order would make much more sense: when an external slice battery is connected, first discharge it completely before using power from the internal battery. Background: For some Thinkpad models (e.g. X220) there are slice battery packs (example) available that you can connect to the bottom of the laptop (similar to a docking station). They seem to be supported well on Linux - e.g. the Gnome Shell battery applet includes both batteries (internal and external) when connected - including displaying the current capacity for each.


Ubuntu recognize my hard drive as “ FREE Disk ”

I'm newbie in Linux world but I'm a big fan of Ubuntu. I've bought a new laptop ( TOSHIBA C55D-A-13Q ) and it had Windows 8 64-bit pre-installed . I tried to install Ubuntu alongside it but it doesnt work so i've installed windows 7 64-bit instead of it in LEGACY MODE ( as I want to keep a Windows version alongside Ubuntu and I heard that EFI is quite difficult to get linux through it ) However, when I try to install Ubuntu now it doesn't recognize my existing Windows 7 OS !! It shows that i have a "FREE DISK of 100% unallocated space". So the only option is to use ubuntu all over the disk but I don't want that ... Also, when I try the LiveCD version , it doesn't recognize my WIFI card ( it seems that there is no driver installed for it ) .. I am trying to install Ubuntu version 13.10 ![Screenshot](http://i.stack.imgur.com/FELcJ.jpg)


Yum update problems on CentOS 6.5 minimal as VMware guest

**INFO:** I am using Windows 7 Pro (64bit) with VMware Workstation version 10.0.1 . I am using CentOS(64bit) 6.5 minimal, for the first time. I am running this from my workplace network, which may use a proxy server. **Background:** I have been following this tutorial (http://1stopit.blogspot.com/2013/11/creating-centos-64-minimal-vm-with.html) As recommended in the tutorial, I configured the VM to used bridged networking, rather than NAT (which is the default). At first, when trying to run `yum update` I received a PYCURL ERROR 6, it looked like this:               Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile     could not retreive mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was      14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"     Error: Cannot find a valid baseurl for repo: base      Then I tried to run `ping mirrorlist.centos.org`, which resulted in `ping:unknown host mirrorlist.centos.org` Then I tried: `ifdown eth0` then `ifup eth0`, which yielded: `Determining IP information for eth0... failed.` This below is the current contents of my file at `/etc/sysconfig/network- scripts/ifcfg-eth0`:               DEVICE=eth0     HWADDR=xx:xx:xx:xx:xx:xx     TYPE=Ethernet     UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx     ONBOOT=yes     NM_CONTROLLED=no     BOOTPROTO=dhcp      (I didn't know if I should be showing my HWADDR and UUID, so I left it anonymous) Since I am trying to run this from my workplace(which may use a proxy server), I thought I would try the recommendations here http://unix.stackexchange.com/a/93428/60724, and edit `/etc/yum.conf`, I added `proxy=http://xxx.xxx.xx.xx:8080`, here is the full file of yum.conf:               [main]     cachedir=/var/cache/yum/$basearch/$releasever     keepcache=0     debuglevel=2     logfile=/var/log/yum.log     exactarch=1     obsoletes=1     gpgcheck=1     plugins=1     installonly_limit=5     bugtracker_url=http://bugs.centos.org/set_project.php?     project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum     distroverpkg=centos-release     proxy=http://xxx.xxx.xx.xx:8080          #comments     #metadata_expire=90      Then after that when I tried to run `yum update`, I started to receive PYCURL Error 5, rather than PYCURL Error 6, see this:               running yum update results in:     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile     4&repo=os error was     14: PYCURL ERROR 5 - "Couldn't resolve proxy 'xxx.xxx.xx.xx'"     Error: Cannot find a valid baseurl for repo:base


Best secure way to update back-end servers?

Our back-end servers (Redhat 5,6 mostly) are very outdated, and are not connected to the Internet for security reasons. I'm looking for the best strategy to update them, without connecting them to the Internet.


Shell script to work on files in some directory

I am a noob in Linux hence this might come as a silly question. I have a Windows system, so I downloaded cygwin to help me execute Linux/unix commands. I need to execute a shell script on a bunch of apks stored inside a folder (got the script here). This is the script:               #!/bin/bash     cd $1          for filename in *.apk     do         unzip -d $filename.extract $filename META-INF/CERT.RSA         if [ -f $filename.extract/META-INF/CERT.RSA ]             then             mkdir `keytool -printcert -v -file $filename.extract/META-INF/CERT.RSA|grep SerialNumber| cut -c 19-23`             mv $filename `keytool -printcert -v -file $filename.extract/META-INF/CERT.RSA|grep SerialNumber| cut -c 19-23`/$filename             mv `echo $filename | sed 's/\(.*\.\)apk/\1odex/'` `keytool -printcert -v -file $filename.extract/META-INF/CERT.RSA|grep SerialNumber| cut -c 19-23`/`echo $filename | sed 's/\(.*\.\)apk/\1odex/'`             rm -rf $filename.extract         else             mkdir none             mv $filename none             mv `echo $filename | sed 's/\(.*\.\)apk/\1odex/'` none             rm -rf $filename.extract         fi     done;          mkdir other     mv * other     mv other/b399 platform     mv other/f2a7 shared     mv other/f2b9 media     mv other/936e test      In the terminal I execute the command `sh cert.sh`,but I get the below error: ![enter image description here](http://i.stack.imgur.com/wl0bV.png) Strangely,when I execute `cert.sh -` the script runs and separates my apks into different folders,but I am not sure if it runs correctly as the proper command to run a shell script is `sh cert.sh`.


Multiple monitor with Linux

I' m installing Arch Linux with OpenBox, at the moment I've only downloaded OpenBox and tint2, but I have to install all the necessary. Before doing everything I'd like to know how to use my two monitor, showing two different desktops (desktop1 and desktop2) and if is there a way to keep on a monitor always the same desktop and instead having the possibility to have on the other monitor more than one desktop.


Rotating a file

I have an application which write to a file. Before I run the application, I would like to rotate the file. In others move file.n to file.n+1 file to file.1. I can write a script to do this, but I was wondering if there is a simpler way to do this?


How to fix Fontconfig error

Whenever Fontconfig is run by an application (in my specific case, Civ V in steam), it outputs this error:               Fontconfig error: "/usr/local/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element     Fontconfig error: "/usr/local/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element     Fontconfig warning: "/usr/local/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 78: saw unknown, expected number      Though the application doesn't crash entirely, the video freezes when this error is printed and the audio continues without error.   * Is the Fontconfig error causing the problem?   * How do I fix it? **Edit:** The computer is Ubuntu 14.04 32 bit. I suspect the problem is associated with fontconfig, because the video (Aspyr intro) freezes when this error is printed, exactly when the shift-tab steam community message shows. That text is malformed and bloated instead of inconspicuous. Here is the file created by `steam 2> error.txt`, which I killed after the problem.                   rm: cannot remove ‘/home/seth/.steam/steam’: Is a directory         rm: cannot remove ‘/home/seth/.steam/bin’: Is a directory         Installing breakpad exception handler for appid(steam)/version(1404163764_client)         Installing breakpad exception handler for appid(steam)/version(1404163764_client)         Installing breakpad exception handler for appid(steam)/version(1404163764_client)         Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element         Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element         Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 78: saw unknown, expected number         [0705/210154:WARNING:proxy_service.cc(958)] PAC support disabled because there is no system implementation         Installing breakpad exception handler for appid(steam)/version(1404163764_client)         Installing breakpad exception handler for appid(steam)/version(1404163764_client)         [HTTP Remote Control] HTTP server listening on port 27037.         Installing breakpad exception handler for appid(steam)/version(1404163764_client)         Installing breakpad exception handler for appid(steam)/version(1404163764_client)         Installing breakpad exception handler for appid(steam)/version(1404163764_client)         Installing breakpad exception handler for appid(steam)/version(1404163764_client)         Generating new string page texture 2: 48x256, total string texture memory is 49.15 KB         Generating new string page texture 3: 256x256, total string texture memory is 311.30 KB         Installing breakpad exception handler for appid(steam)/version(1404163764_client)         Installing breakpad exception handler for appid(steam)/version(1404163764_client)         Adding licenses for the following package(s): 0, 11092, 11707, 14631, 28756, 29136         roaming config store loaded successfully - 716 bytes.         migrating temporary roaming config store         Installing breakpad exception handler for appid(steam)/version(1404163764_client)         Failed to init SteamVR because it isn't installed         ExecCommandLine: "/home/seth/.steam/ubuntu12_32/steam"         System startup time: 6.84 seconds         Generating new string page texture 73: 1024x256, total string texture memory is 1.36 MB         Generating new string page texture 74: 128x256, total string texture memory is 131.07 KB         Generating new string page texture 75: 128x256, total string texture memory is 1.49 MB         Generating new string page texture 76: 64x256, total string texture memory is 1.56 MB         Generating new string page texture 77: 32x256, total string texture memory is 1.59 MB              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.         Generating new string page texture 82: 128x256, total string texture memory is 1.72 MB         Generating new string page texture 83: 384x256, total string texture memory is 2.11 MB         ExecCommandLine: "/home/seth/.steam/root/ubuntu12_32/steam steam://open/driverhelperready"         ExecSteamURL: "steam://open/driverhelperready"         Game update: AppID 8930 "Sid Meier's Civilization V", ProcID 4526, IP 0.0.0.0:0         ERROR: ld.so: object '/home/seth/.steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.              (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent.         ERROR: ld.so: object '/home/seth/.steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.         Setting breakpad minidump AppID = 8930         Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198080162579 [API loaded no]         Installing breakpad exception handler for appid(gameoverlayui)/version(20140630132217_client)         Installing breakpad exception handler for appid(gameoverlayui)/version(1.0_client)         Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: Installing breakpad exception handler for appid(gameoverlayui)/version(1.0_client)         non-double matrix element         Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element         Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 78: saw unknown, expected number         [0705/210210:WARNING:proxy_service.cc(958)] PAC support disabled because there is no system implementation         Installing breakpad exception handler for appid(gameoverlayui)/version(1.0_client)


Securely tunnel port through intermediate host

I'm looking to route a port for VNC back to my house here. I have to jump over a single host to then hop to my actual work machine.   * `sittinghere` will be my local home machine   * `hopper` will by the intermediate hop I need to make   * `overthere` will be the remote work machine I can do this to SSH into my work machine:               ssh -t hopper "ssh -t overthere"      I'd like to use port forwarding to forward remote port 5900 on `overthere` to local port 5900 on `sittinghere`. However, I'd prefer to be able to do it without binding to a port openly on `hopper` as anyone on that machine would be able to attach to my VNC connection. Is there any way for me to forward that port to my local machine securely with no one being able to get access to it on `hopper`?


How can I see when package has been upgraded?

Is there a way to see the upgrade history with date with some program e.g. apt? I want to know when exactly I upgraded security relevant packages the last time and the time before that... Thanks a lot! **Edit:** My bad. Forgot to mention that I am using Crunchbang waldorf. Sorry.


How do I break up a file like split to stdout for piping to a command?

I have a large .sql file full of SELECT statements that contain data I want to insert into my SQL Server database. I'm looking for how I could basically take the file's contents, 100 lines at a time, and pass it to the commands I have set to do the rest. Basically, I'm looking for `split` that will output to stdout, not files. I'm also using CygWin on Windows, so I don't have access to the full suite of tools.


What does it mean exactly when a processes "Time" has stopped in top?

I'll be looking into why we're getting critical swap alerts, and I'll find something like:                 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  SWAP COMMAND     14683 user1     30  10 16.0g 772m  744 S  0.3  0.3 277:24.87 6.5g MATLAB     14576 user1     30  10 8125m 1.1g  736 S  0.3  0.4 261:16.73 4.1g MATLAB      where the TIME+ column is frozen for those processes. My question is, in the above, what does this imply? As I understand it, stopped time means that it's a dormant process/not being processed by the CPU. However the above example shows 0.3% CPU use, so despite the fact that it's very small, shouldn't the time column continue incrementing? Are these processes "finished"? In which case, how are they cleaned up? Does the user who started them need to acknowledge them or something for those resources to be freed up?


Get TMux scroll buffer contents

With TMux, is there any way to programmatically retrieve scroll buffer content from above the current command line? I'm basically looking to write a bash script to iterate upwards until I find a matching string. To be clear, I don't want to go through history of typed commands; I want to go through everything that appeared on the console.


Setting up HDMI output from Linux console

I am currently running Debian Wheezy on a HP Microserver N54L with an AMD Radeon 5450 video card. I would like to be able to play audio from the console through the HDMI port of my video card and into my receiver, a Panasonic SA-XR57. I previously achieved this on a Raspberry Pi running raspbian by setting the HDMI output to "safe mode" (the default mode was incompatible with my aging receiver), but I am not sure how to replicate these settings in Debian. Any ideas on how I could get started would be appreciated, because I'm not sure how to even start with this problem. EDIT: I should make it clear that my problem is getting my receiver to handle the HDMI signal by working out how to change the HDMI settings to a more compatible mode, rather than anything specifically audio related. EDIT2: I've discovered a few facts in the last couple of hours which I thought I should put up here. The error I get on my receiver is "U70-1-2", of which in the manual says "the unit has received a signal for a picture format that is incompatible with the HDMI connection. Check the settings of the connected equipment". I get this error in the Linux console, the bios, and in grub menus. I also had this error with my Raspberry Pi, but it was solved by enabling "safe mode" in the rpi's config.txt file. EDIT3: Okay, I've worked out how to change the resolution to something low and compatible (I believe this is the resolution in the rpi safe mode) in the console by adding video=HDMI-A-1:640x480@60 to my kernel parameters. This changes my resolution when I'm plugged into a tv, but if I plug into my receiver I get the same error on the receiver side. I think my next step is to disable EDID, which is also a feature of rpi's safe mode. I've googled a bit to no avail, so at the moment my question is: How do I disable EDID during the boot process? EDIT4: Today I've tried recompiling the kernel with CONFIG_DRM_LOAD_EDID_FIRMWARE enabled and booting with the kernel parameter drm_kms_helper.edid_firmware=HDMI-A-1:edid/1024x768.bin - which I believe should load a fixed EDID file in (although I'm not sure, because I've read conflicting things on whether or not the sample EDID files are hardwired into the kernel). On booting the receiver sends the same error and in dmesg I have the errors: [ 346.374275] platform HDMI-A-1: firmware: agent aborted loading edid/1024x768.bin (not found?) [ 346.374483] [drm] Got built-in EDID base block and 0 extensions from "edid/1024x768.bin" for connector "HDMI-A-1" EDIT5: ~~I have also tried getting the EDID file in Windows and loading that in to the kernel - which works, except still gives an error on my receiver. When I extracted the EDID file I used the same receiver but a different computer with a different graphics card - as far as I'm aware the EDID file is only dependent on the monitor (in this case receiver) so it shouldn't matter on the graphics card, is this correct?~~ Turns out that Windows cannot read an EDID file for my receiver and I was scraping the one from my monitor. EDIT6: Okay, I got it. It turns out that I needed audio enabled (radeon.audio=1 in kernel parameters) in order for my receiver to get signal. Makes sense, but very annoying that my receiver manual told me that it was a video error, I was planning on worrying about the audio afterwards!


How can I use an "alias" for the destination directory when copying?

I frequently edit startup files such as my `.bashrc` file   Then I copy them to another direction such as `~/Dropnot/level1/setups/bash1` Is there any way I can `cp` such files to the above location with something like an alias?   I currently have an alias to cd to it with `alias n='cd ~/Dropnot/level1/setups/bash1'` I'd like something that would handle any file I pass into it.


How to see the commands executed in another shell?

Is there a way to watch what commands are being executed in another shell, as they're being executed? Both shells are bash, and I have root access, if that matters. I can't install any extra software, and I don't want the other shell to have to do anything special like run screen. Situation: I'm remotely logged into a Linux machine, and so is a coworker. I would like to see the commands she is running in her shell. I know that I could use some combination of `watch` and `ps` to see any commands that take longer than a second to run, but I don't believe that would help with very short commands.


PCI passthrough with Xen

I am trying to run Windows XP in a Xen DomU virtual machine with a PCIe device, for which there are no Linux drivers, being passed through from a Debian Squeeze Dom0. My hardware supports virtualization and it is active in the bios. If I run               grep -E "(vmx|svm)" --color=always /proc/cpuinfo      when I boot from the standard kernel I can see my processor supports vmx, although when I boot the Xen kernel, vmx doesn't show up. I have followed the setup in http://wiki.xen.org/wiki/Xen_Beginners_Guide. The guide basically creates a minimal Debain Squeeze install as Dom0, a PV Debian Squeeze DomU and a HVM Windows DomU running on an LVM volume. I have followed the guide essentially to the letter with the only differences being network bridge is different and I didn't install a Debian PV DomU. I currently have a DomU on an LVM volume that is running a fully updated version of Windows XP with the GPLPV drivers. I am now trying to pass the PCI device, but am running into problems. If I compare the output of `lspci` with and without the PCIe card that I am trying to pass I see the following two new entries: 05:00.0 PCI bridge: PLX Technology, Inc. PEX 8111 PCI Express-to-PCI Bridge (rev 21) 06:04.0 Bridge: Device 4550:9054 (rev 01) I also see that another entry has changed its address from 06:00.0 IDE interface: Marvell Technology Group Ltd. 88SE6121 SATA II Controller (rev b2) to 07:00.0 IDE interface: Marvell Technology Group Ltd. 88SE6121 SATA II Controller (rev b2) I modified `/etc/default/grub` to include either               GRUB_CMDLINE_XEN="xen-pciback.hide=(05:00.0)(06:04.0)"      or               GRUB_CMDLINE_XEN="pciback.hide=(05:00.0)(06:04.0)"      and run `update-grub` and `update-grub2` after making the change and then fully powered down and rebooted. This doesn't appear to do anything and nothing shows up with               xm pci-list-assignable-devices      Looking at the Xen wiki guide http://wiki.xen.org/wiki/Xen_PCI_Passthrough I have tried things like               echo 0000:05:00.0 > /sys/bus/pci/devices/0000:05:00.0/driver/unbind     echo 0000:05:00.0 > /sys/bus/pci/drivers/pciback/new_slot     echo 0000:05:00.0 > /sys/bus/pci/drivers/pciback/bind      and some other stuff related to pci-stub. Sometimes my random fiddling results in               xm pci-list-assignable-devices      listing 05:00.0 and 06:04.0. If I modify my .cfg file to include               pci = ['05:00.0', '06:04.0']      I get an error about pci-stub not owning the 05:00.0 device. If I only try and pass 06:04.0 the DomU won't boot. Any ideas how to get pci passthrough working.


mdadm - exclude drive from monitor

I have created a RAID 1 array with a single drive (in order to add a second drive later). `# mdadm --create /dev/md5 --level=1 --raid-devices=2 /dev/sdc1 missing` But, I execute `/sbin/mdadm --monitor --scan --oneshot`, it sends me a `DegradedArray event` e-mail. Even if this is true, I would like to know if it's possible to exclude `/dev/md5` from this check ?


bash does not autocomplete my command when using sudo?

I'm using SaltStack. I would like to auto-complete the minion name when calling `salt` command. The following line has been added into `~/.bashrc`:               complete -o default -o nospace -W "$(sudo ls -1 /var/cache/salt/master/minions)" salt      Then typing `salt in<tab>` --> `salt integration-<tab>`, I can see it works as expected:               $ salt integration-     integration-c   integration-u   integration-u2      To use with `sudo`, I have added `complete -cf sudo` into `~/.bashrc`, but it didn't work: `sudo salt in<tab` returned nothing. I also have tried to install `bash_completion` and added the following lines to `~/.bash_profile`:               if [ -f $(brew --prefix)/etc/bash_completion ]; then         . $(brew --prefix)/etc/bash_completion     fi      but no luck. Did I miss something? * * * **UPDATE Sat Jul 12 08:51:23 ICT 2014** Oh, the first thing I would like to say is sometime it works:               $ sudo salt integration-     integration-c   integration-u   integration-u2       sometime it doesn't. > So first, let's see how much your bash_completion package does. How can I check that? Here's my function:               # a wrapper method for the next one, when the offset is unknown     _command()     {         local offset i              # find actual offset, as position of the first non-option         offset=1         for (( i=1; i <= COMP_CWORD; i++ )); do             if [[ "${COMP_WORDS[i]}" != -* ]]; then                 offset=$i                 break             fi         done         _command_offset $offset     }          # A meta-command completion function for commands like sudo(8), which need to     # first complete on a command, then complete according to that command's own     # completion definition - currently not quite foolproof (e.g. mount and umount     # don't work properly), but still quite useful.     #     _command_offset()     {         local cur func cline cspec noglob cmd i char_offset word_offset \             _COMMAND_FUNC _COMMAND_FUNC_ARGS              word_offset=$1              # rewrite current completion context before invoking         # actual command completion              # find new first word position, then         # rewrite COMP_LINE and adjust COMP_POINT         local first_word=${COMP_WORDS[$word_offset]}         for (( i=0; i <= ${#COMP_LINE}; i++ )); do             if [[ "${COMP_LINE:$i:${#first_word}}" == "$first_word" ]]; then                 char_offset=$i                 break             fi         done         COMP_LINE=${COMP_LINE:$char_offset}         COMP_POINT=$(( COMP_POINT - $char_offset ))              # shift COMP_WORDS elements and adjust COMP_CWORD         for (( i=0; i <= COMP_CWORD - $word_offset; i++ )); do             COMP_WORDS[i]=${COMP_WORDS[i+$word_offset]}         done         for (( i; i <= COMP_CWORD; i++ )); do             unset COMP_WORDS[i];         done         COMP_CWORD=$(( $COMP_CWORD - $word_offset ))              COMPREPLY=()         _get_comp_words_by_ref cur              if [[ $COMP_CWORD -eq 0 ]]; then             _compopt_o_filenames             COMPREPLY=( $( compgen -c -- "$cur" ) )         else             cmd=${COMP_WORDS[0]}             if complete -p ${cmd##*/} &>/dev/null; then                 cspec=$( complete -p ${cmd##*/} )                 if [ "${cspec#* -F }" != "$cspec" ]; then                     # complete -F <function>                          # get function name                     func=${cspec#*-F }                     func=${func%% *}                          if [[ ${#COMP_WORDS[@]} -ge 2 ]]; then                         $func $cmd "${COMP_WORDS[${#COMP_WORDS[@]}-1]}" "${COMP_WORDS[${#COMP_WORDS[@]}-2]}"                     else                         $func $cmd "${COMP_WORDS[${#COMP_WORDS[@]}-1]}"                     fi                          # remove any \: generated by a command that doesn't                     # default to filenames or dirnames (e.g. sudo chown)                     # FIXME: I'm pretty sure this does not work!                     if [ "${cspec#*-o }" != "$cspec" ]; then                         cspec=${cspec#*-o }                         cspec=${cspec%% *}                         if [[ "$cspec" != @(dir|file)names ]]; then                             COMPREPLY=("${COMPREPLY[@]//\\\\:/:}")                         else                             _compopt_o_filenames                         fi                     fi                 elif [ -n "$cspec" ]; then                     cspec=${cspec#complete};                     cspec=${cspec%%${cmd##*/}};                     COMPREPLY=( $( eval compgen "$cspec" -- "$cur" ) );                 fi             elif [ ${#COMPREPLY[@]} -eq 0 ]; then                 _filedir             fi         fi     }      > if you type sudo `mkdir <tab><tab>`, does it show a list of directories? Yes:               $ sudo mkdir      .FontForge/        .djangopypi2/      .ievms/            .ssh/              .wireshark-etc/


Extracting a string from fdisk command

I want to write a shell script, which will run `fdisk -l` and extract a string `/dev/sdbn` from the output of `fdisk -l`. Using extracted word I want to mount it to `/mnt`. For Example:               Disk identifier: 0x00000000          Device     Boot    Start    End    Blocks    Id    System     /dev/sdb1    *         1    493    3956672    6     FAT16      How do I only extract the string `/dev/sdb1`?


annotate "include" file for grep with comments?

I do a `grep` sort that includes certain strings. That is, give me the lines in a file that DO contain certain strings. As in               grep -fv include file  > out      That command looks in `file` and sends to `out` every line that matches what is in the file `include`. No problem with that. Works fine. BUT How do I put comments in my `include` file? For example, I'd like to annotate that file with some (e.g. `#`) comments that explain what I'm including. So I'd like for `grep` to ignore any lines in the `include` file that start with `#`. How do I do that?


Change filename from lowercase to uppercase recursively

I have 1,000,000 files in some folders and subfolders. I want to rename them from lowercase to uppercase using shell commands. I don't want to modify the extension. only filename part. I have found this one:               rename 's/^([^.]*)\.(.*)$/\U$1\E.$2/' *      but it is not recursive and only works on files in current folder. Then I tried this one:               find . -depth  -execdir rename 's/^([^.]*)\.(.*)$/\U$1\E.$2/' {} \;      But no files changed. How can I use it recursively?


change date format and store in variable using awk

I have date in format YYYY-MM-DD in variable 'a'. I want to convert it in format YYYYMMDD and store in variable 'b'. The variable is in an awk variable. How can I do the same ?