title: what level of the network stack does tcpdump get its info from?

text: As I was trying in vain to fix a faulty ethernet controller here, one thing I tried was running tcpdump on the machine. I found it interesting that tcpdump was able to detect that some of the ICMP packets the ping application thought it was sending were not actually going out on the wire, even though it was running on the same machine. I have reproduced those tcpdump results here:               14:25:01.162331 IP debian.local > 74.125.224.80: ICMP echo request, id 2334, seq 1, length 64     14:25:02.168630 IP debian.local > 74.125.224.80: ICMP echo request, id 2334, seq 2, length 64     14:25:02.228192 IP 74.125.224.80 > debian.local: ICMP echo reply, id 2334, seq 2, length 64     14:25:07.236359 IP debian.local > 74.125.224.80: ICMP echo request, id 2334, seq 3, length 64     14:25:07.259431 IP 74.125.224.80 > debian.local: ICMP echo reply, id 2334, seq 3, length 64     14:25:31.307707 IP debian.local > 74.125.224.80: ICMP echo request, id 2334, seq 9, length 64     14:25:32.316628 IP debian.local > 74.125.224.80: ICMP echo request, id 2334, seq 10, length 64     14:25:33.324623 IP debian.local > 74.125.224.80: ICMP echo request, id 2334, seq 11, length 64     14:25:33.349896 IP 74.125.224.80 > debian.local: ICMP echo reply, id 2334, seq 11, length 64     14:25:43.368625 IP debian.local > 74.125.224.80: ICMP echo request, id 2334, seq 17, length 64     14:25:43.394590 IP 74.125.224.80 > debian.local: ICMP echo reply, id 2334, seq 17, length 64     14:26:18.518391 IP debian.local > 74.125.224.80: ICMP echo request, id 2334, seq 30, length 64     14:26:18.537866 IP 74.125.224.80 > debian.local: ICMP echo reply, id 2334, seq 30, length 64     14:26:19.519554 IP debian.local > 74.125.224.80: ICMP echo request, id 2334, seq 31, length 64     14:26:20.518588 IP debian.local > 74.125.224.80: ICMP echo request, id 2334, seq 32, length 64     14:26:21.518559 IP debian.local > 74.125.224.80: ICMP echo request, id 2334, seq 33, length 64     14:26:21.538623 IP 74.125.224.80 > debian.local: ICMP echo reply, id 2334, seq 33, length 64     14:26:37.573641 IP debian.local > 74.125.224.80: ICMP echo request, id 2334, seq 35, length 64     14:26:38.580648 IP debian.local > 74.125.224.80: ICMP echo request, id 2334, seq 36, length 64     14:26:38.602195 IP 74.125.224.80 > debian.local: ICMP echo reply, id 2334, seq 36, length 64      Notice how the seq number jumps several times... that indicates packets the ping application generates that are not actually leaving the box. Which brings me to my question: how was tcpdump able to detect that the ICMP packets weren't actually going out? Is it able to somehow directly monitor what is on the wire? If it does accomplish this, I assume it is by interfacing to some part of the kernel, which in turn interfaces to some hardware that is a standard part of a network controller. Even so, that's pretty cool! If that is not actually how tcpdump functions, can someone explain to me how it detected the missing packets in software?


title: How can I receive input through notifications in bash?

text: When I get a chat message in Empathy, I get a notification in GNOME Shell. This notification allows me to input a reply directly, instead of having to switch to Empathy. Is there any way I can get a similar prompt from a shell script?


title: How can I check what version of the VI editor I have?

text: How can I check what version of the `vi` editor I have? What's the best way to upgrade it or install `vim` on Solaris?


title: Sticky bit vs setgid for facilitating shared write access

text: Say two people with different primary unix GIDs share and need to frequently edit the same file. The users are not members of each others' primary unix GIDs, but they are both members of a common second group. The accepted answer (and other posted answers) to this question suggest setting the `sticky bit` on the file's parent directory so that such a file does not get the user's primary group ID whenever one of the users modifies the file (i.e. they claim it removes the need to call `newgrp` in every login session whenever one of the users wants to edit the shared file) However I thought that something like this could only be done with with the `setgid` bit. From Wikipedia: > Setting the setgid permission on a directory (chmod g+s) causes new files > and subdirectories created within it to inherit its group ID, rather than > the primary group ID of the user who created the file (the owner ID is never > affected, only the group ID). Why would the sticky bit help with this?


title: SSH host key keeps changing

text: I am trying to set up a web service (using the Play Framework) on an Ubuntu machine on the network. However, I am experiencing intermittent failures connecting to it, not being able to connect to it far more often than not. One strange symptom is that these network problems affect SSH as well, and in particular the SSH host key of the machine will change, whether I am connecting to it from another Linux machine or from Windows using PuTTY. One sequence of events seems to be something like:   * After a while, I am able to SSH into the machine again.   * I access one page on the web server. It works. I try to access another page. It fails.   * Shortly thereafter, I am kicked off of my SSH connection.   * I try to SSH in - the connection can't be established.   * A while later I try to SSH in - the host key has changed. I accept the change and try to log in but I get "Access denied" in response to my password.   * A while later, I am able to SSH into the machine again. And just now I accepted the key change, tried to log on, got disconnected before I could finish typing the password, and reconnected only to see that the key has changed again. What could be causing the SSH host key to change? If this is a normal feature of the SSH server in response to some sort of strange behaviour, what sort of problems does this imply?


title: How can a bash script detect support for window titling escape characters?

text: I have a debug trap that runs every time I enter a command in bash that sets the window title to indicate what command is running. I'm leaving out all the configuration details and boil it down to:               export PS1="\[\e]0;$GENERATED_WINDOW_TITLE\a\]$GENERATED_PROMPT"      This works incredibly well, with only one snag: if the bash shell is running in an environment that does not support this feature, the GENERATED_WINDOW_TITLE is printed on the screen with each prompt. This happens any time I'm running bash from a non-X terminal. How can bash tell if this escape sequence is supported?


title: Gnome 3 notification not working after switching back from XFCE 4

text: I'm using Archlinux. I've recently switched back from XFCE 4 to Gnome 3. So i reinstalled `notification-daemon` (since there was a conflict between it and XFCE 4 notification daemon)               pacman -S notification-daemon      .. and removed `xfce4-notifyd`               pacman -R xfce4-notifyd      But now, notification in Gnome 3 is not working at all. I don't know what else should i do. Thanks.


title: Compress memory on low Ram VM

text: Is there a way to get out more out of your limited Ram on a VM? I have a VM running on a cloud hoster and try to optimize a quite low on RAM mashine. I heard, there is a way to compress parts in the memory if all free memory is in use called zram How do I get this running?


title: How do I mount an NTFS partition in /etc/fstab and prevent files/directories from receiving exec permissions when they're created?

text: I have an NTFS partition that I want to mount using `/etc/fstab`. I don't want any files to have executable permissions on this drive, so I wrote the following rule:               /dev/sda2 /media/sharedfolder ntfs auto,user,noatime,noexec,rw,async 0 0      However, I don't believe this will prevent files from being created with executable permissions. It will simply prevent them from being executed. Perhaps this is fine, but is it possible to remove all executable permissions from newly created files on this partition using an `/etc/fstab` rule? Would using `umask` and `fmask` be enough, like this rule?               /dev/sda2 /media/sharedfolder ntfs auto,user,noatime,noexec,rw,async,umask=0111, 0 0      I'm unsure because Wikipedia lists `umask` as an option specific to the FAT filesystem.


title: Output shutdown messages to multiple consoles

text: I have configured my system to direct console output on boot to serial and vga using kernel parameters. Serial is the last argument in the kernel parameters and will be the default used for `/dev/console`. Also grub and a agetty is configured to use a serial console. When booting the kernel messages are displayed on both consoles, as well as the init scripts and, when init is finished, the agetty. When shutting down the system using `shutdown` the init stop scripts are only displayed in the serial console. I believe this is because the init scripts will only output to `/dev/console`. Although when the command is given the vga display will clear it screen and only kernel messages are displayed until the final reboot of the system. I'm also using Xen4CentOS but the results using this are the same as the stock kernel.   * Why can't I see init stop scripts on both consoles while I can see the start scripts?   * Is there a workaround?   * What issues the clear screen on the vga console? To complete my question my specs and settings:   * CentOS6 using stock kernel.   * Kernel options: `console=tty0 console=ttyS0,9600n8`   * When using Xen4CentOS added options to Xen Kernel: `com1=9600,8n1 console=com1,vga`   * Set `BOOTUP=serial` in `/etc/sysconfig/init`   * Added `serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1` to `/etc/grub.conf`


title: How to start a command upon login in GNOME?

text: I would like to run `xkbcomp` upon a user login in order to modify its keyboard. The command works fine from a terminal after login. The system is an unmodified Fedora 20 Desktop Edition. I tried to add the command (with full paths) to   * `gnome-session-properties`   * `$HOME/.xinitrc` I also added an additional entry to `/etc/xdg/autostart/`:               [Desktop Entry]     Type=Application     Name=Programmers on AZERTY     Exec=/usr/bin/xkbcomp /home/w/azerty_prog.xkb $DISPLAY     X-GNOME-Autostart-enabled=true      None of these work, the keyboard is not modified (I do not know where logs are located). Where should I add this entry?


title: Package installed as dependency is not removed with "apt-get autoremove"

text: I'm using LXDE and when I installed `gnome-screensaver`, it had a bunch of dependencies including `pulseaudio`. I then immediately uninstalled it with `autoremove` (no intermediate steps), but nothing of the dependencies was removed. Why is that? This my from `/var/log/apt/history.log`:               Start-Date: 2014-07-05  18:49:28     Commandline: apt-get install gnome-screensaver     Install: gnome-sushi:amd64 (0.4.1-3, automatic), python-packagekit:amd64 (0.7.6-3, automatic), gnome-power-manager:amd64 (3.4.0-2, automatic), libcogl9:amd64 (1.10.2-7, automatic), python-aptdaemon.pkcompat:amd64 (0.45-2, automatic), libgtksourceview-3.0-0:amd64 (3.4.2-1, automatic), libao-common:amd64 (1.1.0-2, automatic), libcogl-pango0:amd64 (1.10.2-7, automatic), nautilus:amd64 (3.4.2-1+build1, automatic), libgmime-2.6-0:amd64 (2.6.10-1, automatic), libgnome-desktop-3-2:amd64 (3.4.2-1, automatic), gnome-session-bin:amd64 (3.4.2.1-4, automatic), gir1.2-clutter-gst-1.0:amd64 (1.5.4-1+build0, automatic), pulseaudio:amd64 (2.0-6.1, automatic), gnome-settings-daemon:amd64 (3.4.2+git20121218.7c1322-3+deb7u3, automatic), gir1.2-json-1.0:amd64 (0.14.2-1, automatic), libburn4:amd64 (1.2.2-2, automatic), pulseaudio-module-x11:amd64 (2.0-6.1, automatic), libmozjs185-1.0:amd64 (1.8.5-1.0.0+dfsg-4, automatic), gnome-desktop3-data:amd64 (3.4.2-1, automatic), gir1.2-coglpango-1.0:amd64 (1.10.2-7, automatic), libexempi3:amd64 (2.2.0-1, automatic), libclutter-1.0-common:amd64 (1.10.8-2, automatic), gir1.2-gtksource-3.0:amd64 (3.4.2-1, automatic), libgtksourceview-3.0-common:amd64 (3.4.2-1, automatic), libclutter-1.0-0:amd64 (1.10.8-2, automatic), libao4:amd64 (1.1.0-2, automatic), libgnomekbd7:amd64 (3.4.0.2-1, automatic), nautilus-data:amd64 (3.4.2-1+build1, automatic), cdrdao:amd64 (1.2.3-0.3, automatic), libtotem-plparser17:amd64 (3.4.2-1, automatic), libquvi7:amd64 (0.4.1-1, automatic), libwacom2:amd64 (0.6-1, automatic), gnome-screensaver:amd64 (3.4.1-1), libpackagekit-glib2-14:amd64 (0.7.6-3, automatic), brasero-common:amd64 (3.4.1-4, automatic), libclutter-gst-1.0-0:amd64 (1.5.4-1+build0, automatic), libquvi-scripts:amd64 (0.4.21-1~deb7u1, automatic), brasero:amd64 (3.4.1-4, automatic), libwacom-common:amd64 (0.6-1, automatic), libmusicbrainz5-0:amd64 (5.0.1-2, automatic), libjte1:amd64 (1.19-1, automatic), libisofs6:amd64 (1.2.2-1, automatic), libtracker-sparql-0.14-0:amd64 (0.14.1-3, automatic), libjson-glib-1.0-0:amd64 (0.14.2-1, automatic), libcogl-common:amd64 (1.10.2-7, automatic), gir1.2-evince-3.0:amd64 (3.4.0-3.1, automatic), libgjs0b:amd64 (1.32.0-5, automatic), libbrasero-media3-1:amd64 (3.4.1-4, automatic), gir1.2-cogl-1.0:amd64 (1.10.2-7, automatic), libclutter-gtk-1.0-0:amd64 (1.2.0-2, automatic), gir1.2-clutter-1.0:amd64 (1.10.8-2, automatic), hwdata:amd64 (0.234-1, automatic), gir1.2-gtkclutter-1.0:amd64 (1.2.0-2, automatic), libgnomekbd-common:amd64 (3.4.0.2-1, automatic)     End-Date: 2014-07-05  18:49:45          Start-Date: 2014-07-05  18:49:59     Commandline: apt-get autoremove gnome-screensaver     Remove: gnome-screensaver:amd64 (3.4.1-1)     End-Date: 2014-07-05  18:50:01


title: Is there a simple way to copy system settings from an EOL install to a new version?

text: Here's my scenario: I'm currently running Mint 12 as my open source development platform. Currently, I'm running it as a VM through VirtualBox. Since 12 is near it's end of life, and because running it as a VM isn't as efficient as I originally thought, the plan is to ditch it completely, then dual boot with Mint 14. With that in mind, is there a way for me to transfer my settings from 12 to 14? Not just packages (which, in my case, is just a matter of me grabbing things from dotdeb), but various server settings and program settings as well? Put another way, is there anything can I automate or pre-package? Are there any built-in ghosting tools or anything that could work?


title: Utilize a different user's vimrc as well as vim folder

text: First of all, to prevent an X/Y Problem, I'll just state that what I really want is:   1. Run vim as the root user.   2. Instruct vim to use my nice pretty color scheme and all my plugins.   3. Do all this without contaminating the `/root/.vimrc` or the `/root/.vim` folder.   4. Do all this without running `sudo vim` hopefully... I have my own account on each linux server with the following two files.   * `/home/b/.vim`     * My folder with my plugins etc.   * `/home/b/.vimrc`     * My dot vimrc file Here is my first try running with my custom vim settings:               vim -u ~b/.vimrc     Error detected while processing /root/.vimrc:     line   33:     E185: Cannot find color scheme railscasts     line   82:     E117: Unknown function: ...     Press ENTER or type command to continue      However, my .vimrc file is searching for a plugin which only exists in my /home/b/.vim folder. Up until now I have always copied my own /home/b/.vim folder to the root user's area like so:               cp -r /home/b/.vim /root      But unfortunately this contaminates the root account's home folder, and I want to stop doing that (if possible). Can anyone tell me an environment variable, or any trick at all, to run with my own COMPLETE vim environment (including my plugins, etc.) without contaminating root? Any help is greatly appreciated. PS - I have gone through the `info vim` documentation and tried setting VIMRUNTIME VIMRC and other environment variables. They didn't help me, perhaps I was doing something wrong...?


title: Declare a new modifier key with XKB

text: I'm trying to create a one handed keyboard layout and want to use `Hyper` to produce special keys when I press some keys. For example, when I press `Hyper_L` and `B`, I want XKB to produce `XF86AudioRaiseVolume`. Relevant parts from `custom_2.kbd` (full code at http://pastebin.com/gm8cggn3) :               xkb_keycodes {         <K_36> = 54;        // b B XF86AudioRaiseVolume         <K_85> = 133;       // Hyper_L     };          xkb_symbols {         key <K_36> { type = "HYPER_LEVEL", [ b, B, XF86AudioRaiseVolume ] };         key <K_85> { type = "ONE_LEVEL", [ Hyper_L ] };     };          xkb_compatibility {         interpret Hyper_L { action = SetMods(modifiers=Hyper); };     };               xkb_types {     type "HYPER_LEVEL" {         modifiers= Shift+Hyper;         map[Shift]= Level2;         map[Hyper]= Level3;         map[Shift+Hyper]= Level3;     };     };      It seems fine to me, but when I try it:               ~$ xkbcomp custom_2.kbd $DISPLAY     Error:            Identifier "Hyper" of type int is unknown     Error:            Key type mask field must be a modifier mask                       Key type definition ignored     Warning:          Map entry for unused modifiers in HYPER_LEVEL                       Using none instead of Shift     Error:            Identifier "Hyper" of type int is unknown     Error:            The key type map entry field must be a modifier mask                       Ignoring illegal assignment in HYPER_LEVEL     Error:            Identifier "Hyper" of type int is unknown     Error:            The key type map entry field must be a modifier mask                       Ignoring illegal assignment in HYPER_LEVEL      -> 1      (error code is 1) And now I'm stuck. Does anyone have an idea how to make this work? A solution without `Hyper` is OK. # Edit By changing `Super` and `Hyper` to `Mod4` and `Mod5`, that error goes away:               ~$ xkbcomp custom_3.kbd     ( no output )          ~$ diff custom_{2,3}.kbd     188,190c188,190     <         interpret Super_L { action = SetMods(modifiers=Super); };     <         interpret Hyper_L { action = SetMods(modifiers=Hyper); };     <     }c;     ---     >         interpret Super_L { action = SetMods(modifiers=Mod4); };     >         interpret Hyper_L { action = SetMods(modifiers=Mod5); };     >     };     204c204     <             modifiers= Shift+Hyper;     ---     >             modifiers= Shift+Mod5;     206,207c206,207     <             map[Hyper]= Level3;     <             map[Shift+Hyper]= Level3;     ---     >             map[Mod5]= Level3;     >             map[Shift+Mod5]= Level3;      However, it still doesn't work:               ~$ xkbcomp custom_3.kbd $DISPLAY      Error:            success in unknown                       Couldn't write keyboard description to :0.0     X Error of failed request:  BadValue (integer parameter out of range for operation)       Major opcode of failed request:  135 (XKEYBOARD)       Minor opcode of failed request:  9 (XkbSetMap)       Value in failed request:  0x8010202       Serial number of failed request:  12       Current serial number in output stream:  14      -> 1


title: Server inbound email forwarding

text: I have been struggling to get this to work for a little while now so I have come in the hope of getting a wee bit of help. I am running redhat 6.3, and using the machine as a webserver. My question is the following: Say my domain name is domain.com. How do I get an email sent to "webmaster@domain.com" to "myRegularEmail@gmail.com". I am comfortable with web-programming, unfortunately not so much with Linux setups. I have managed to get internal mails sent to my email using the file "/etc/aliases", but this does not seem to deal with external emails coming to the server. Many thanks for any and all help offered. Ronan p.s: My apologies if (and I am pretty sure it has been) this question has already been asked; I simply cannot for the life of me find an answer to this issue...               # Global Postfix configuration file. This file lists only a subset     # of all parameters. For the syntax, and for a complete parameter     # list, see the postconf(5) manual page (command: "man 5 postconf").     #     # For common configuration examples, see BASIC_CONFIGURATION_README     # and STANDARD_CONFIGURATION_README. To find these documents, use     # the command "postconf html_directory readme_directory", or go to     # http://www.postfix.org/.     #     # For best results, change no more than 2-3 parameters at a time,     # and test if Postfix still works after every change.          # SOFT BOUNCE     #     # The soft_bounce parameter provides a limited safety net for     # testing.  When soft_bounce is enabled, mail will remain queued that     # would otherwise bounce. This parameter disables locally-generated     # bounces, and prevents the SMTP server from rejecting mail permanently     # (by changing 5xx replies into 4xx replies). However, soft_bounce     # is no cure for address rewriting mistakes or mail routing mistakes.     #     #soft_bounce = no          # LOCAL PATHNAME INFORMATION     #     # The queue_directory specifies the location of the Postfix queue.     # This is also the root directory of Postfix daemons that run chrooted.     # See the files in examples/chroot-setup for setting up Postfix chroot     # environments on different UNIX systems.     #     queue_directory = /var/spool/postfix          # The command_directory parameter specifies the location of all     # postXXX commands.     #     command_directory = /usr/sbin          # The daemon_directory parameter specifies the location of all Postfix     # daemon programs (i.e. programs listed in the master.cf file). This     # directory must be owned by root.     #     daemon_directory = /usr/libexec/postfix          # The data_directory parameter specifies the location of Postfix-writable     # data files (caches, random numbers). This directory must be owned     # by the mail_owner account (see below).     #     data_directory = /var/lib/postfix          # QUEUE AND PROCESS OWNERSHIP     #     # The mail_owner parameter specifies the owner of the Postfix queue     # and of most Postfix daemon processes.  Specify the name of a user     # account THAT DOES NOT SHARE ITS USER OR GROUP ID WITH OTHER ACCOUNTS     # AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM.  In     # particular, don't specify nobody or daemon. PLEASE USE A DEDICATED     # USER.     #     mail_owner = postfix          # The default_privs parameter specifies the default rights used by     # the local delivery agent for delivery to external file or command.     # These rights are used in the absence of a recipient user context.     # DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.     #     #default_privs = nobody          # INTERNET HOST AND DOMAIN NAMES     #      # The myhostname parameter specifies the internet hostname of this     # mail system. The default is to use the fully-qualified domain name     # from gethostname(). $myhostname is used as a default value for many     # other configuration parameters.     #     #myhostname = host.domain.tld     #myhostname = virtual.domain.tld          # The mydomain parameter specifies the local internet domain name.     # The default is to use $myhostname minus the first component.     # $mydomain is used as a default value for many other configuration     # parameters.     #     #mydomain = domain.tld          # SENDING MAIL     #      # The myorigin parameter specifies the domain that locally-posted     # mail appears to come from. The default is to append $myhostname,     # which is fine for small sites.  If you run a domain with multiple     # machines, you should (1) change this to $mydomain and (2) set up     # a domain-wide alias database that aliases each user to     # user@that.users.mailhost.     #     # For the sake of consistency between sender and recipient addresses,     # myorigin also specifies the default domain name that is appended     # to recipient addresses that have no @domain part.     #     #myorigin = $myhostname     #myorigin = $mydomain          # RECEIVING MAIL          # The inet_interfaces parameter specifies the network interface     # addresses that this mail system receives mail on.  By default,     # the software claims all active interfaces on the machine. The     # parameter also controls delivery of mail to user@[ip.address].     #     # See also the proxy_interfaces parameter, for network addresses that     # are forwarded to us via a proxy or network address translator.     #     # Note: you need to stop/start Postfix when this parameter changes.     #     #inet_interfaces = all     #inet_interfaces = $myhostname     #inet_interfaces = $myhostname, localhost     inet_interfaces = localhost          # Enable IPv4, and IPv6 if supported     inet_protocols = all          # The proxy_interfaces parameter specifies the network interface     # addresses that this mail system receives mail on by way of a     # proxy or network address translation unit. This setting extends     # the address list specified with the inet_interfaces parameter.     #     # You must specify your proxy/NAT addresses when your system is a     # backup MX host for other domains, otherwise mail delivery loops     # will happen when the primary MX host is down.     #     #proxy_interfaces =     #proxy_interfaces = 1.2.3.4          # The mydestination parameter specifies the list of domains that this     # machine considers itself the final destination for.     #     # These domains are routed to the delivery agent specified with the     # local_transport parameter setting. By default, that is the UNIX     # compatible delivery agent that lookups all recipients in /etc/passwd     # and /etc/aliases or their equivalent.     #     # The default is $myhostname + localhost.$mydomain.  On a mail domain     # gateway, you should also include $mydomain.     #     # Do not specify the names of virtual domains - those domains are     # specified elsewhere (see VIRTUAL_README).     #     # Do not specify the names of domains that this machine is backup MX     # host for. Specify those names via the relay_domains settings for     # the SMTP server, or use permit_mx_backup if you are lazy (see     # STANDARD_CONFIGURATION_README).     #     # The local machine is always the final destination for mail addressed     # to user@[the.net.work.address] of an interface that the mail system     # receives mail on (see the inet_interfaces parameter).     #     # Specify a list of host or domain names, /file/name or type:table     # patterns, separated by commas and/or whitespace. A /file/name     # pattern is replaced by its contents; a type:table is matched when     # a name matches a lookup key (the right-hand side is ignored).     # Continue long lines by starting the next line with whitespace.     #     # See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS".     #     mydestination = $myhostname, localhost.$mydomain, localhost     #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain     #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,     #   mail.$mydomain, www.$mydomain, ftp.$mydomain          # REJECTING MAIL FOR UNKNOWN LOCAL USERS     #     # The local_recipient_maps parameter specifies optional lookup tables     # with all names or addresses of users that are local with respect     # to $mydestination, $inet_interfaces or $proxy_interfaces.     #     # If this parameter is defined, then the SMTP server will reject     # mail for unknown local users. This parameter is defined by default.     #     # To turn off local recipient checking in the SMTP server, specify     # local_recipient_maps = (i.e. empty).     #     # The default setting assumes that you use the default Postfix local     # delivery agent for local delivery. You need to update the     # local_recipient_maps setting if:     #     # - You define $mydestination domain recipients in files other than     #   /etc/passwd, /etc/aliases, or the $virtual_alias_maps files.     #   For example, you define $mydestination domain recipients in         #   the $virtual_mailbox_maps files.     #     # - You redefine the local delivery agent in master.cf.     #     # - You redefine the "local_transport" setting in main.cf.     #     # - You use the "luser_relay", "mailbox_transport", or "fallback_transport"     #   feature of the Postfix local delivery agent (see local(8)).     #     # Details are described in the LOCAL_RECIPIENT_README file.     #     # Beware: if the Postfix SMTP server runs chrooted, you probably have     # to access the passwd file via the proxymap service, in order to     # overcome chroot restrictions. The alternative, having a copy of     # the system passwd file in the chroot jail is just not practical.     #     # The right-hand side of the lookup tables is conveniently ignored.     # In the left-hand side, specify a bare username, an @domain.tld     # wild-card, or specify a user@domain.tld address.     #      #local_recipient_maps = unix:passwd.byname $alias_maps     #local_recipient_maps = proxy:unix:passwd.byname $alias_maps     #local_recipient_maps =          # The unknown_local_recipient_reject_code specifies the SMTP server     # response code when a recipient domain matches $mydestination or     # ${proxy,inet}_interfaces, while $local_recipient_maps is non-empty     # and the recipient address or address local-part is not found.     #     # The default setting is 550 (reject mail) but it is safer to start     # with 450 (try again later) until you are certain that your     # local_recipient_maps settings are OK.     #     unknown_local_recipient_reject_code = 550          # TRUST AND RELAY CONTROL          # The mynetworks parameter specifies the list of "trusted" SMTP     # clients that have more privileges than "strangers".     #     # In particular, "trusted" SMTP clients are allowed to relay mail     # through Postfix.  See the smtpd_recipient_restrictions parameter     # in postconf(5).     #     # You can specify the list of "trusted" network addresses by hand     # or you can let Postfix do it for you (which is the default).     #     # By default (mynetworks_style = subnet), Postfix "trusts" SMTP     # clients in the same IP subnetworks as the local machine.     # On Linux, this does works correctly only with interfaces specified     # with the "ifconfig" command.     #      # Specify "mynetworks_style = class" when Postfix should "trust" SMTP     # clients in the same IP class A/B/C networks as the local machine.     # Don't do this with a dialup site - it would cause Postfix to "trust"     # your entire provider's network.  Instead, specify an explicit     # mynetworks list by hand, as described below.     #       # Specify "mynetworks_style = host" when Postfix should "trust"     # only the local machine.     #      #mynetworks_style = class     #mynetworks_style = subnet     #mynetworks_style = host          # Alternatively, you can specify the mynetworks list by hand, in     # which case Postfix ignores the mynetworks_style setting.     #     # Specify an explicit list of network/netmask patterns, where the     # mask specifies the number of bits in the network part of a host     # address.     #     # You can also specify the absolute pathname of a pattern file instead     # of listing the patterns here. Specify type:table for table-based lookups     # (the value on the table right-hand side is not used).     #     #mynetworks = 168.100.189.0/28, 127.0.0.0/8     #mynetworks = $config_directory/mynetworks     #mynetworks = hash:/etc/postfix/network_table          # The relay_domains parameter restricts what destinations this system will     # relay mail to.  See the smtpd_recipient_restrictions description in     # postconf(5) for detailed information.     #     # By default, Postfix relays mail     # - from "trusted" clients (IP address matches $mynetworks) to any destination,     # - from "untrusted" clients to destinations that match $relay_domains or     #   subdomains thereof, except addresses with sender-specified routing.     # The default relay_domains value is $mydestination.     #      # In addition to the above, the Postfix SMTP server by default accepts mail     # that Postfix is final destination for:     # - destinations that match $inet_interfaces or $proxy_interfaces,     # - destinations that match $mydestination     # - destinations that match $virtual_alias_domains,     # - destinations that match $virtual_mailbox_domains.     # These destinations do not need to be listed in $relay_domains.     #      # Specify a list of hosts or domains, /file/name patterns or type:name     # lookup tables, separated by commas and/or whitespace.  Continue     # long lines by starting the next line with whitespace. A file name     # is replaced by its contents; a type:name table is matched when a     # (parent) domain appears as lookup key.     #     # NOTE: Postfix will not automatically forward mail for domains that     # list this system as their primary or backup MX host. See the     # permit_mx_backup restriction description in postconf(5).     #     #relay_domains = $mydestination          # INTERNET OR INTRANET          # The relayhost parameter specifies the default host to send mail to     # when no entry is matched in the optional transport(5) table. When     # no relayhost is given, mail is routed directly to the destination.     #     # On an intranet, specify the organizational domain name. If your     # internal DNS uses no MX records, specify the name of the intranet     # gateway host instead.     #     # In the case of SMTP, specify a domain, host, host:port, [host]:port,     # [address] or [address]:port; the form [host] turns off MX lookups.     #     # If you're connected via UUCP, see also the default_transport parameter.     #     #relayhost = $mydomain     #relayhost = [gateway.my.domain]     #relayhost = [mailserver.isp.tld]     #relayhost = uucphost     #relayhost = [an.ip.add.ress]          # REJECTING UNKNOWN RELAY USERS     #     # The relay_recipient_maps parameter specifies optional lookup tables     # with all addresses in the domains that match $relay_domains.     #     # If this parameter is defined, then the SMTP server will reject     # mail for unknown relay users. This feature is off by default.     #     # The right-hand side of the lookup tables is conveniently ignored.     # In the left-hand side, specify an @domain.tld wild-card, or specify     # a user@domain.tld address.     #      #relay_recipient_maps = hash:/etc/postfix/relay_recipients          # INPUT RATE CONTROL     #     # The in_flow_delay configuration parameter implements mail input     # flow control. This feature is turned on by default, although it     # still needs further development (it's disabled on SCO UNIX due     # to an SCO bug).     #      # A Postfix process will pause for $in_flow_delay seconds before     # accepting a new message, when the message arrival rate exceeds the     # message delivery rate. With the default 100 SMTP server process     # limit, this limits the mail inflow to 100 messages a second more     # than the number of messages delivered per second.     #      # Specify 0 to disable the feature. Valid delays are 0..10.     #      #in_flow_delay = 1s          # ADDRESS REWRITING     #     # The ADDRESS_REWRITING_README document gives information about     # address masquerading or other forms of address rewriting including     # username->Firstname.Lastname mapping.          # ADDRESS REDIRECTION (VIRTUAL DOMAIN)     #     # The VIRTUAL_README document gives information about the many forms     # of domain hosting that Postfix supports.          # "USER HAS MOVED" BOUNCE MESSAGES     #     # See the discussion in the ADDRESS_REWRITING_README document.          # TRANSPORT MAP     #     # See the discussion in the ADDRESS_REWRITING_README document.          # ALIAS DATABASE     #     # The alias_maps parameter specifies the list of alias databases used     # by the local delivery agent. The default list is system dependent.     #     # On systems with NIS, the default is to search the local alias     # database, then the NIS alias database. See aliases(5) for syntax     # details.     #      # If you change the alias database, run "postalias /etc/aliases" (or     # wherever your system stores the mail alias file), or simply run     # "newaliases" to build the necessary DBM or DB file.     #     # It will take a minute or so before changes become visible.  Use     # "postfix reload" to eliminate the delay.     #     #alias_maps = dbm:/etc/aliases     alias_maps = hash:/etc/aliases     #alias_maps = hash:/etc/aliases, nis:mail.aliases     #alias_maps = netinfo:/aliases          # The alias_database parameter specifies the alias database(s) that     # are built with "newaliases" or "sendmail -bi".  This is a separate     # configuration parameter, because alias_maps (see above) may specify     # tables that are not necessarily all under control by Postfix.     #     #alias_database = dbm:/etc/aliases     #alias_database = dbm:/etc/mail/aliases     alias_database = hash:/etc/aliases     #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases          # ADDRESS EXTENSIONS (e.g., user+foo)     #     # The recipient_delimiter parameter specifies the separator between     # user names and address extensions (user+foo). See canonical(5),     # local(8), relocated(5) and virtual(5) for the effects this has on     # aliases, canonical, virtual, relocated and .forward file lookups.     # Basically, the software tries user+foo and .forward+foo before     # trying user and .forward.     #     #recipient_delimiter = +          # DELIVERY TO MAILBOX     #     # The home_mailbox parameter specifies the optional pathname of a     # mailbox file relative to a user's home directory. The default     # mailbox file is /var/spool/mail/user or /var/mail/user.  Specify     # "Maildir/" for qmail-style delivery (the / is required).     #     #home_mailbox = Mailbox     #home_mailbox = Maildir/          # The mail_spool_directory parameter specifies the directory where     # UNIX-style mailboxes are kept. The default setting depends on the     # system type.     #     #mail_spool_directory = /var/mail     #mail_spool_directory = /var/spool/mail          # The mailbox_command parameter specifies the optional external     # command to use instead of mailbox delivery. The command is run as     # the recipient with proper HOME, SHELL and LOGNAME environment settings.     # Exception:  delivery for root is done as $default_user.     #     # Other environment variables of interest: USER (recipient username),     # EXTENSION (address extension), DOMAIN (domain part of address),     # and LOCAL (the address localpart).     #     # Unlike other Postfix configuration parameters, the mailbox_command     # parameter is not subjected to $parameter substitutions. This is to     # make it easier to specify shell syntax (see example below).     #     # Avoid shell meta characters because they will force Postfix to run     # an expensive shell process. Procmail alone is expensive enough.     #     # IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN     # ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.     #     #mailbox_command = /some/where/procmail     #mailbox_command = /some/where/procmail -a "$EXTENSION"          # The mailbox_transport specifies the optional transport in master.cf     # to use after processing aliases and .forward files. This parameter     # has precedence over the mailbox_command, fallback_transport and     # luser_relay parameters.     #     # Specify a string of the form transport:nexthop, where transport is     # the name of a mail delivery transport defined in master.cf.  The     # :nexthop part is optional. For more details see the sample transport     # configuration file.     #     # NOTE: if you use this feature for accounts not in the UNIX password     # file, then you must update the "local_recipient_maps" setting in     # the main.cf file, otherwise the SMTP server will reject mail for         # non-UNIX accounts with "User unknown in local recipient table".     #     #mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp          # If using the cyrus-imapd IMAP server deliver local mail to the IMAP     # server using LMTP (Local Mail Transport Protocol), this is prefered     # over the older cyrus deliver program by setting the     # mailbox_transport as below:     #     # mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp     #     # The efficiency of LMTP delivery for cyrus-imapd can be enhanced via     # these settings.     #     # local_destination_recipient_limit = 300     # local_destination_concurrency_limit = 5     #     # Of course you should adjust these settings as appropriate for the     # capacity of the hardware you are using. The recipient limit setting     # can be used to take advantage of the single instance message store     # capability of Cyrus. The concurrency limit can be used to control     # how many simultaneous LMTP sessions will be permitted to the Cyrus     # message store.      #     # To use the old cyrus deliver program you have to set:     #mailbox_transport = cyrus          # The fallback_transport specifies the optional transport in master.cf     # to use for recipients that are not found in the UNIX passwd database.     # This parameter has precedence over the luser_relay parameter.     #     # Specify a string of the form transport:nexthop, where transport is     # the name of a mail delivery transport defined in master.cf.  The     # :nexthop part is optional. For more details see the sample transport     # configuration file.     #     # NOTE: if you use this feature for accounts not in the UNIX password     # file, then you must update the "local_recipient_maps" setting in     # the main.cf file, otherwise the SMTP server will reject mail for         # non-UNIX accounts with "User unknown in local recipient table".     #     #fallback_transport = lmtp:unix:/var/lib/imap/socket/lmtp     #fallback_transport =          # The luser_relay parameter specifies an optional destination address     # for unknown recipients.  By default, mail for unknown@$mydestination,     # unknown@[$inet_interfaces] or unknown@[$proxy_interfaces] is returned     # as undeliverable.     #     # The following expansions are done on luser_relay: $user (recipient     # username), $shell (recipient shell), $home (recipient home directory),     # $recipient (full recipient address), $extension (recipient address     # extension), $domain (recipient domain), $local (entire recipient     # localpart), $recipient_delimiter. Specify ${name?value} or     # ${name:value} to expand value only when $name does (does not) exist.     #     # luser_relay works only for the default Postfix local delivery agent.     #     # NOTE: if you use this feature for accounts not in the UNIX password     # file, then you must specify "local_recipient_maps =" (i.e. empty) in     # the main.cf file, otherwise the SMTP server will reject mail for         # non-UNIX accounts with "User unknown in local recipient table".     #     #luser_relay = $user@other.host     #luser_relay = $local@other.host     #luser_relay = admin+$local          # JUNK MAIL CONTROLS     #      # The controls listed here are only a very small subset. The file     # SMTPD_ACCESS_README provides an overview.          # The header_checks parameter specifies an optional table with patterns     # that each logical message header is matched against, including     # headers that span multiple physical lines.     #     # By default, these patterns also apply to MIME headers and to the     # headers of attached messages. With older Postfix versions, MIME and     # attached message headers were treated as body text.     #     # For details, see "man header_checks".     #     #header_checks = regexp:/etc/postfix/header_checks          # FAST ETRN SERVICE     #     # Postfix maintains per-destination logfiles with information about     # deferred mail, so that mail can be flushed quickly with the SMTP     # "ETRN domain.tld" command, or by executing "sendmail -qRdomain.tld".     # See the ETRN_README document for a detailed description.     #      # The fast_flush_domains parameter controls what destinations are     # eligible for this service. By default, they are all domains that     # this server is willing to relay mail to.     #      #fast_flush_domains = $relay_domains          # SHOW SOFTWARE VERSION OR NOT     #     # The smtpd_banner parameter specifies the text that follows the 220     # code in the SMTP server's greeting banner. Some people like to see     # the mail version advertised. By default, Postfix shows no version.     #     # You MUST specify $myhostname at the start of the text. That is an     # RFC requirement. Postfix itself does not care.     #     #smtpd_banner = $myhostname ESMTP $mail_name     #smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)          # PARALLEL DELIVERY TO THE SAME DESTINATION     #     # How many parallel deliveries to the same user or domain? With local     # delivery, it does not make sense to do massively parallel delivery     # to the same user, because mailbox updates must happen sequentially,     # and expensive pipelines in .forward files can cause disasters when     # too many are run at the same time. With SMTP deliveries, 10     # simultaneous connections to the same domain could be sufficient to     # raise eyebrows.     #      # Each message delivery transport has its XXX_destination_concurrency_limit     # parameter.  The default is $default_destination_concurrency_limit for     # most delivery transports. For the local delivery agent the default is 2.          #local_destination_concurrency_limit = 2     #default_destination_concurrency_limit = 20          # DEBUGGING CONTROL     #     # The debug_peer_level parameter specifies the increment in verbose     # logging level when an SMTP client or server host name or address     # matches a pattern in the debug_peer_list parameter.     #     debug_peer_level = 2          # The debug_peer_list parameter specifies an optional list of domain     # or network patterns, /file/name patterns or type:name tables. When     # an SMTP client or server host name or address matches a pattern,     # increase the verbose logging level by the amount specified in the     # debug_peer_level parameter.     #     #debug_peer_list = 127.0.0.1     #debug_peer_list = some.domain          # The debugger_command specifies the external command that is executed     # when a Postfix daemon program is run with the -D option.     #     # Use "command .. & sleep 5" so that the debugger can attach before     # the process marches on. If you use an X-based debugger, be sure to     # set up your XAUTHORITY environment variable before starting Postfix.     #     debugger_command =          PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin          ddd $daemon_directory/$process_name $process_id & sleep 5          # If you can't use X, use this to capture the call stack when a     # daemon crashes. The result is in a file in the configuration     # directory, and is named after the process name and the process ID.     #     # debugger_command =     #   PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont;     #   echo where) | gdb $daemon_directory/$process_name $process_id 2>&1     #   >$config_directory/$process_name.$process_id.log & sleep 5     #     # Another possibility is to run gdb under a detached screen session.     # To attach to the screen sesssion, su root and run "screen -r     # " where  uniquely matches one of the detached     # sessions (from "screen -list").     #     # debugger_command =     #   PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH; screen     #   -dmS $process_name gdb $daemon_directory/$process_name     #   $process_id & sleep 1          # INSTALL-TIME CONFIGURATION INFORMATION     #     # The following parameters are used when installing a new Postfix version.     #      # sendmail_path: The full pathname of the Postfix sendmail command.     # This is the Sendmail-compatible mail posting interface.     #      sendmail_path = /usr/sbin/sendmail.postfix          # newaliases_path: The full pathname of the Postfix newaliases command.     # This is the Sendmail-compatible command to build alias databases.     #     newaliases_path = /usr/bin/newaliases.postfix          # mailq_path: The full pathname of the Postfix mailq command.  This     # is the Sendmail-compatible mail queue listing command.     #      mailq_path = /usr/bin/mailq.postfix          # setgid_group: The group for mail submission and queue management     # commands.  This must be a group name with a numerical group ID that     # is not shared with other accounts, not even with the Postfix account.     #     setgid_group = postdrop          # html_directory: The location of the Postfix HTML documentation.     #     html_directory = no          # manpage_directory: The location of the Postfix on-line manual pages.     #     manpage_directory = /usr/share/man          # sample_directory: The location of the Postfix sample configuration files.     # This parameter is obsolete as of Postfix 2.1.     #     sample_directory = /usr/share/doc/postfix-2.6.6/samples          # readme_directory: The location of the Postfix README files.     #     readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES     message_size_limit = 300000000     mailbox_size_limit = 300000000


title: Piping nothing to xargs

text: I have a script that may in some circumstances have nothing on stdout. At the end of the script, I pass the lines I have to another command using xargs. My problem is, when there is nothing on stdout, I get the typical "Usage: program arg1 arg2" error message. How can I avoid this?


title: Copy file from Windows shared folder to Unix

text: I am totally new to Unix. I am writting a script which will copy files from a Windows shared folder to Unix. In Windows, when I type `\\\Servername.com\testfolder` in Run command I am able to see `testfolder`. The directory `testfolder` is a shared folder through the whole network. Now I want to copy some files from that `testfolder` to a Unix machine. Which command should I use? I know the IP Address of server but I don't know the username.


title: What are the main differences between BSD- and linux-based operating systems?

text: I am a long time linux user and have recently become interested in playing about with BSD-based operating systems. What are the differences between linux and BSD-based systems. I am interested in learning about the functional, practical and also historical differences.


title: Partitioning and installing Voyage Linux

text: I am trying to install Voyage Linux 0.8.0 (a distribution based off Debian) on a Soekris Net4801. I would like to have two partitions, one for the operating system and another one for data. I have been following the instructions on the Voyage website for installing Voyage with PXE boot but instead of running `/usr/local/sbin/format-cf.sh /dev/hda` because that only makes 1 partition, I have manually done the following things before running `voyage.update`. **1.** Used `fdisk` to partition the disk as so:                  Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *           1         199     1598436   83  Linux     /dev/sda2             200         242      345397+  83  Linux      **2.** Created ext2 filesystems on both partitions:               mkfs.ext2 /dev/sda1     mkfs.ext2 /dev/sda2      **3.** Run `tune2fs` on each filesystem as is done in `format-cf.sh`:               tune2fs -i 0 -c 0 /dev/sda1 ROOT_FS     tune2fs -i 0 -c 0 /dev/sda2 DATA_FS      I then ran `voyage.update` and installed Voyage to `/dev/sda1` yet when I rebooted, just after starting SSHd, the whole thing rebooted and seems to be stuck in an endless loop. How do I fix this? Did I do something wrong installing Voyage like this?


title: Restart USB (ehci) in Fedora 14

text: I am looking for a way in Fedora 14 to restart the USB system so that all USB devices disconnect and reconnect to the OS (due to some slightly dubious USB peripherals that I have no choice but to use). I found that one way is to use `modprobe` on ehci_hcd, but in Fedora ehci is built in. I found how to stop ehci by doing:               echo -n "0000:00:xx.x" > /sys/bus/pci/drivers/ehci_hcd/unbind      Where xx.x corresponds to the results of:               lspci|grep -i ehci      But I am not sure how to get it back up and running again. What should I do?


title: How to load Linux PC to make it warm?

text: I have erratic working linux box and I suspect that it have some issues with either thermal monitoring modules, or even hardware. I think about logging for some time temperature other things to see what's wrong. However I have no idea how to load pc without running X server (easier to relaunch or stop, less things that can go wrong). Is there any ideas for custom script for loading up pc, (i.e. what built-in utilities could load up pc (xz, gzip similar resource heavy operations)) or there exists any kind benchmarks that could load up pc. I just need load nothing more. Any ideas?


title: What is the connection between jiffies and IPS? How to convert jiffies to IPS?

text: Reading from `/proc/PID/stat` a lot of information can be processed. I would like to see how many percentages has been used of CPU power by this process. There are a lot of variable around here (utime, stime, cutime, cstime, gtime, cgtime) but they are in jiffies. The problem with this that jiffy depends on speed of the current CPU. However IPS (Instructions Per Second) depends on inctructions set, and which program do we run but maybe this is more accurete. I would like to use this information in embedded systems where I could pick a CPU that just satisfies the features. In this way I don't have to spend a lot for a largly oversized system. Here is the contents of the stat file (as of 2.6.30-rc7):                Field          Content       pid           process id       tcomm         filename of the executable       state         state (R is running, S is sleeping, D is sleeping in an                     uninterruptible wait, Z is zombie, T is traced or stopped)       ppid          process id of the parent process       pgrp          pgrp of the process       sid           session id       tty_nr        tty the process uses       tty_pgrp      pgrp of the tty       flags         task flags       min_flt       number of minor faults       cmin_flt      number of minor faults with child's       maj_flt       number of major faults       cmaj_flt      number of major faults with child's       utime         user mode jiffies       stime         kernel mode jiffies       cutime        user mode jiffies with child's       cstime        kernel mode jiffies with child's       priority      priority level       nice          nice level       num_threads   number of threads       it_real_value (obsolete, always 0)       start_time    time the process started after system boot       vsize         virtual memory size       rss           resident set memory size       rsslim        current limit in bytes on the rss       start_code    address above which program text can run       end_code      address below which program text can run       start_stack   address of the start of the stack       esp           current value of ESP       eip           current value of EIP       pending       bitmap of pending signals       blocked       bitmap of blocked signals       sigign        bitmap of ignored signals       sigcatch      bitmap of catched signals       wchan         address where process went to sleep       0             (place holder)       0             (place holder)       exit_signal   signal to send to parent thread on exit       task_cpu      which CPU the task is scheduled on       rt_priority   realtime priority       policy        scheduling policy (man sched_setscheduler)       blkio_ticks   time spent waiting for block IO       gtime         guest time of the task in jiffies       cgtime        guest time of the task children in jiffies


title: How do I display contents of a file where PATH environment changes are made?

text: Say I change the `$PATH` environment variable. If I'm asked to display the contents of the file where this change happened, how would I do this?


title: Why does this variable have no value even though it is set in .bashrc?

text: If I append this:               hi=11     export hi      to the .bashrc and then I su to this user with:               su - bela      then I:               echo $hi     11      Then it's working, the "hi" variable has the value of "11". But. When I:               su -c "echo $hi" bela      the variable "hi" has no value. Why? (running on CentOS 6)


title: What's the difference between /sbin/nologin and /bin/false

text: Technically, unless `pam` is set up to check your shell with `pam_shells` neither of these can actually prevent your login, if you're not on the shell. On my system they are even different sizes, so I suspect they actually do something. So what's the difference? why do they both exist? Why would I use one over the other?               -rwxr-xr-x 1 root root  21K Feb  4 17:01 /bin/false     -rwxr-xr-x 1 root root 4.7K Mar  2 14:59 /sbin/nologin


title: ksh cannot cp from location with space in it?

text: I am trying to do the following in `ksh` but keep getting `cannot stat` message for the `cp` command:               JMX_ROOT=/bfs-build/build-info/mep_mainline-Linux.latest/core/mainline/automation          SMOKE_JMX_LOCATION=$JMX_ROOT/"Smoke Set"/*.*          cp $SMOKE_JMX_LOCATION /var/tmp/tempor      Any ideas? I have tried putting quotes around the various variables but with no luck.


title: Is an SSH connection faster if I lower the RSA key size?

text: I have a very slow connection, and I need to use SSH on it. How can I increase "the speed"? I mean is using big RSA keypairs a large overhead? Would lowering the key size increase the effective bandwidth a little?


title: How to backup and restore Oracle 10G Express in Linux VPS?

text: I have installed Oracle 10g Express in two Centos VPS server. How can I generate an Oracle backup from server one, so that I can restore the database on server two? Can anyone help on this?


title: Execute command through SSH

text: I am writing a script to check whether all the servers in my organization are functioning properly. One of those is Zimbra mail server. I am trying to send a mail through sendmail provided by zimbra package using the following command               ssh Jarvice@someip echo "Hello" | /opt/zimbra/postfix-2.7.4.2z/sbin/sendmail someuser@gmail.com      But I am unable to do so. I think I am making some mistake in the               echo "Hello" | /opt/zimbra/postfix-2.7.4.2z/sbin/sendmail someuser@gmail.com      part. But I don't know what it is. Can someone tell me the correct way to do so? Since I am doing this through a script, I have made sure that I can `ssh` without providing the password. I wish to fully automate the process.


title: How can I use man without less?

text: By default, `man` uses `less` to output text. How can I tell it to just output to stdout? My terminal emulator has a scroll bar and search function and I want to use those instead of the arrow keys.


title: `du` get different results on different machines for the same folder

text: I have a folder(which contains a lot of sub-folders and files) on a machine, I used                  du -m       and it shows the disk usage of all sub-folders and files, anyway, the overall disk usage is 78M I used `scp -r` to copy the folder into another machine, this time, `du -m` get the overall disk usage: 12M, very different. Why does this happen? I'm afraid some of the files or sub-folders are not copied fully, so are there any other ways to check the total number of bytes?


Could anyone please tell me how to find out the memory allocated for a particular process in ubuntu?


title: Why FreeBsd is using man word for various functions?

text: Ok, I'm a newbie in FreeBsd and for your info I only know MS windows before this. I wonder why FreeBsd love to use **man** in various places, for example: FreeBsd Man Pages - This interface will allow you to browse through 10,500+ Unix related topics Even in that page description, it says: > This interface will allow you to browse through 10,500+ Unix related topics. > Each **man page** is translated by using **manServer**. You can also view > these man pages in a unix shell by using the **man program**. Many of these > utilities are available online for our customers to use. Those using the > Solaris platform can find online man pages at docs.sun.com. Notice the words **man page** , **manServer** and **man program**. What are those **man** actually mean?


title: Updating Debian on an IMX6 SOC

text: I'm thinking of updating my debian version from squeeze to wheezy on my imx6 soc. http://compulab.co.il/products/computer-on-modules/cm-fx6/ Just wondering if it really is as easy as doing this:               1) Mounting the debian-7.6.0-armel-dvd-1.iso     2) I have apt-get configured to read from the image     3) apt-get update     4) apt-get dist-upgrade      Frankly I'm a bit scared to try. I have no idea whether the version of squeeze has to be especially catered for imx6 soc. Just wondering if this is the "standard" way.


title: Explain EV in /proc/bus/input/devices data

text: Can anybody explain to me what the `EV` value in `/proc/bus/input/devices` is? The keyboard always has value `120013`. Why?


title: Kipmi0 eating up to 99.8% cpu on centos 6.4

text: We have CentOS 6.4 and the `kipmi0` is showing as 99.8%cpu and 0.0% memory and load average is 1.00. What should we do to rectify on this?


title: SSH locking up: suspect local problem, not remote

text: On my work computer, I regularly SSH into two unrelated servers. Sometimes the SSH session locks up (does not respond to keyboard input). When locked up, I can SSH in via a second open terminal, that works but does not unfreeze the frozen terminal. Pressing `~.` takes some time before the terminal disconnects and gives me a local CLI. I regularly SSH into both those servers from home with no problems, so I suspect that the issue is on my local work computer. Does the problem occur with other terminals? Yes, the problem occurs with both Konqueror and with Terminator. Does the problem occur to both remote servers at the same time? No Does the problem occur with any particular application running on the server? Both with and without GNU Screen, both on the CLI and in VIM. To test, I just opened four terminals: two Konqueror terminals, one to each server; and two Terminator terminals, one to each server. After about an hour, only one (Terminator) terminal locked up. The other terminal to the same server did not lock up, and neither terminal to the other server locked up. Of course, I tried Ctrl-Q in the locked up terminal to see if an errant Ctrl-S had been sent, but that did not resolve the issue. Screen was not running in the terminal that locked up (neither in the native session that is running the SSH, nor the SSH session itself). **UPDATE:** An hour later the server locked up in Terminator has finally disconnected with "Write failed: Broken pipe" and I have a working local CLI, and the two servers in Konsole are also locked up.


title: Turn off Caps lock when Escape is pressed

text: Is there any way to disable `CapsLock` whenever `Esc` is pressed. Yes, I use VIM! I actually have an alternative all-caps keyboard layout on `Ctrl-6` but I find it cumbersome and would prefer to just have the OS disable CapsLock whenever `Esc` is pressed. Also, I often SSH into other servers for a few hours so I'm on a stock VIM there. Note that I happen to already have swapped the `CapsLock` and `Esc` keys. However, when the `Esc` key is pressed (which happens to be labeled `CapsLock` on the keyboard and is next to `A`), I need it to perform both `Escape` and `Disable-CapsLock-If-It-Is-Enabled`. This is on Kubuntu 12.10. Thanks.


title: How to verify if the Language is installed

text: Is there some command for Redhat Linux that can tell me whether the Arabic Language is installed on Redhat 5.6 Server.


title: Showing all open apps in all workspaces on the desktop panel for Linux Mint

text: I'm using Linux Mint 14 with XFCE. The bottom panel that always shows below the screen which shows an icon for each instance of application that is open is a very handy item as it allows one to switch from one app to another very quickly. The problem is that, with more than one workspace being used, one can see on the panel only the applications that are open in that one workspace they are in at the moment but not the open apps in the other workspace. So the problem I am finding is this: If I am in one workspace, and want to switch to an app that I know I opened before, I have to change workspaces one by one, looking at the panel in each to find that app. This is time consuming. It would be much better if the panel displays all open apps in all workspaces. One can configure the panel to have more than one row and to make the icon sizes small. So it is not a problem to have many icons there if needed. I looked at preferences for panel, but it does not have such an option. ![enter image description here](http://i.stack.imgur.com/cpA1y.png) Is it possible to configure this on Mint 14 with XFCE? If not, which other distribution do you recommend that would support this? I know Mint has other types of distros with different desktop managers.


title: cpu time measurement with wait4 vs. cpuacct cgroup

text: I want to start a process and measure the cpu time (user+sys) it needs until it terminates. I know I can use the `wait4` system call, which returns a struct with user and system time (I use the sum of both times). I can also use the `cpuacct` cgroup subsystem, put the process into a new cgroup, and read the `cpuacct.usage` file (which contains the combined user and system time). I know the former has problems when the process spawns subprocesses (sometimes their time does not get counted). However, I thought that for a single-process case the two measurements should be almost equal. I expected the cpuacct value to be a little bit smaller, because I can only put the process into the cgroup after it has been created (but I do this immediately after fork, so the difference should be minimal). Now for processes that take a few seconds, I see the expected results. Examples:               wait4:   8.292518s     cpuacct: 8.299105444s          wait4:   13.788861s     cpuacct: 13.796484557s          wait4:   24.229514s     cpuacct: 24.234132965s          wait4:   84.101255s     cpuacct: 84.104336222s      However, for processes that take longer, I get a different result:               wait4:   155.309706s     cpuacct: 155.306291274s          wait4:   505.547594s     cpuacct: 505.526723631s          wait4:   897.180069s     cpuacct: 897.131232685s      Now the cpuacct value is a little bit lower, which I would never expect to happen. Does somebody have an idea why this happens? I do not care about 0.1s accuracy, and I have never experienced a higher difference. Can I be confident, that the difference will always be that small? Or are there possible scenarios where the difference will be larger? The `cpuacct` documentation states that the value may be imprecise in 2 cases. However, both cases do not apply here, as I am on a 64bit machine, and I can wait an arbitrary amount of time after the process finishes, the reading of `cpuacct.usage` will stay constant (so I strongly believe it is not an outdated value). Precise setup:   My starting process is a Python process. I use `subprocess.Popen()` to spawn the task and `os.wait4()` to get the time. For using the cgroups I pass a function to the `preexec_fn` parameter of `Popen` that adds the new process to the cgroup (so this is done between the `fork` and `exec` system calls). The started process is a Java VM. I don't think this is relevant, but I wanted to provide this information just in case.


title: Configurable tab-bar, or rich-featured terminal emulator

text: Is there any terminal emulator where the user can choose the position of the tab bar? I want to have the tab bar on the left, with vertically aligned tabs, or configure the tab-bar to be multi-line. I often have many (>20) tabs open in my terminal, and the information on the tabs becomes completely unreadable. I would like to configure the tab-bar to either be vertically aligned on the left, or be multi-row (a bit like the configurability of Tab Mix Plus in Firefox) Can this be done in gnome-terminal, or in konsole, or in any other terminal emulator? Another feature I'm missing dearly is the 'monitor for silence' and 'monitor for activity' pair, with timeouts that can be configured. Also, I'd like the terminal to do pseudo-transparency like gnome-terminal can do in gnome. So in summary, I'm looking for a rich-featured terminal emulator. Who can recommend one? Related question:   * Is there a (light-weight) replacement for `rxvt-unicode`?


title: Difference between `ls -c` and `ls -t`

text: What is the difference between `-c` and `-t` options for the `ls` Unix command? And how can I sort by date of creation with the `ls` command?


title: Where can PATH to Thunderbird be set in Ubuntu 10.04

text: I'd like to migrate to `Thunderbird 11` from `Thunderbird 3`. I installed `Thunderbird 3` using apt-get (the newer versions are not available in binary form, unfortunately, at least not in main, universe or multiverse repositories, don't like PPA's when not really necessary). So I downloaded tar.bz2 of the newest version and uncompressed into /usr/lib, next to where the old version lives. Now, I'd like the system to find `thunderbird` inside `Thunderbird 11` folder rather than the old one. How to I achieve that? I know there must be some sort of a `PATH` to `/usr/lib/thunderbird-3.1.20` set on my system, but just cannot find where it is. Checked all common places already, like:   * `/etc/environment`   * `/etc/profile`   * `/etc/profile.d/*`   * `~/.profile`   * `~/.bashrc` (though it shouldn't be here as `PATH` is also visible by GNOME)   * probably some other places I don't recall now. Any clues?


title: Spoofing or removing DHCP client hostname in response to DHCP server

text: In linux, when my machine requests an IP address it also sends the hostname back to the DHCP server. How can I stop my machine from sending back this hostname? I use `dhclient`, possibly via NetworkManager.


title: what is inode for, in FreeBSD or Solaris

text: I know a little about linux kernel. BUt for Freebsd, the "vnode" actually is similar to the "inode" in Linux kernel. And there is a "inode" concept in FreeBSD or Solaris. So my question is: what is "inode" in FreeBSD for? Below is good to read. Thank you. http://hub.opensolaris.org/bin/view/Community+Group+advocacy/solaris-linux- freebsd > All three operating systems use a data abstraction layer to hide file system > implementation details from applications. In all three OSes, you use open, > close, read, write, stat, etc. system calls to access files, regardless of > the underlying implementation and organization of file data. Solaris and > FreeBSD call this mechanism VFS ("virtual file system") and the principle > data structure is the vnode, or "virtual node." Every file being accessed in > Solaris or FreeBSD has a vnode assigned to it. In addition to generic file > information, the vnode contains pointers to file-system-specific > information. Linux also uses a similar mechanism, also called VFS (for > "virtual file switch"). In Linux, the file-system-independent data structure > is an inode. This structure is similar to the vnode on Solaris/FreeBSD. > (Note that there is an inode structure in Solaris/FreeBSD, but this is file- > system-dependent data for UFS file systems). Linux has two different > structures, one for file operations and the other for inode operations. > Solaris and FreeBSD combine these as "vnode operations."


title: How to insert tab character in "dialog"?

text: I'm using the linux "dialog" utility to create a simple UI. However, there is a text in infobox and I want to insert tab characters in order to properly align the text. But it seems, that dialog does not accept tab character. Also, the --tab- correct option did not help. If I write \t, it apperas at \t in the infobox.               dialog --title "Hello" --tab-correct --infobox "tab \t test" 20 100      If I insert a tab in the command string:               dialog --title "Hello" --tab-correct --infobox "tab         test" 20 100      it appears as a single space. Is there a way to insert tab in the infobox text?


title: Is there a Terminal Services gateway for Linux?

text: I need to route RDP connections to an available XP virtual machine through linux. Is there such a software? I have a pool of Windows Machines (VM) all with different IP addresses and I want the proxy   1. hide all these different IP addreses. Someone connecting will have only the proxy address   2. the proxy will route to an available Windows VM (no one is using)


title: Asking curl to skip missing files

text: **Is there any way to tell`curl` not to download a file when it does not exist on the server?** I am using my Mac OS X shell to download a few files with `curl`. The command goes:               curl -s -# "http://URL/session[1-12].pdf" -o "Slides/session#1.pdf";      Is there any way I can tell `curl` to skip, say, `session4.pdf`, when that file does not actually exist? It downloads empty 2KB files instead by default. P.S. I hope I am posting this at the right place, apologies if it should go to the Apple StackExchange branch. Since it's shell, I though this would be more appropriate.


title: Wait for Linux Mint 13 or install Linux Mint Debian version?

text: I have been using Linux Mint 12 with Gnome 3 and I'm very happy with it except about the fact that it get very slow software updates, hoping that Linux Mint 13 will have Gnome 3.4 and Linux kernel 3.2 shall wait for it?   Or shall I install Debian based Linux Mint which gets rolling updates?   What would be a better option?


title: What's the currently recommended way to install node.js on Debian?

text: I've found a few different methods on the web, but some of the articles are quite old, and I'm concerned that the methods they describe have been superceded. Can anyone tell me what the currently recommended method, to best utilise package management etc?


title: BASH reading txt file and storing in array

text: I'm writing my first BASH script , I have some experience with c and c# so I think the logic of the program is correct..it's just the syntax is so complicated because apparently there are billions of ways to write the same thing! Anyway here is the script: it simply checks if the argument (string) is contained in a certain file . If so it stores each line of the file in an array and writes an item of the array in a file. I'm sure there must be easier ways to achieve that but I want to do some practice with bash loops                   #!/bin/bash          NOME=$1     c=0               #IF NAME IS FOUND IN THE PHONEBOOK THANK STORE EACH LINE OF THE FILE INTO ARRAY     #ONCE THE ARRAY IS DONE GET THE INDEX OF MATCHING NAME AND RETURN ARRAY[INDEX+1]          if grep  "$NOME" /root/phonebook.txt ; then             echo "CREATING ARRAY"             while read line             do                     myArray[$c]=$line # store line                     c=$(expr $c + 1) # increase counter by 1             done < /root/phonebook.txt          else             echo "Name not found"     fi          c=0     for i in myArray;             do                   if   myArray[$i]="$NOME" ;  then                      echo ${myArray[i+1]} >> /root/numbertocall.txt                   fi          done      This code does returns the only the second item of myArray (`myArray[2]` or the second line of the file)..why?


title: davmail systemd launcher on headless server

text: I'm trying to follow the ArchWiki guide for writing a custom service file to launch DavMail as a system-wide daemon. Previously I had a line in my ~/.xinitrc that read               nohup /usr/bin/davmail /etc/conf.d/davmail.properties      as per the DavMail instructions (where `/usr/bin/davmail` is a symlink to `/usr/share/java/davmail/davmail.sh`). Now that I've made the computer into a headless server, I'd like the auto-launcher to be independent of an X session. All the guides I've seen online for a DavMail initscript assume that the distro is using sysvinit, not systemd. My attempt at a custom systemd service file is               [Unit]     Description=DavMail Exchange Gateway     Requires=network.target     After=network.target          [Service]     Type=forking     RemainAfterExit=yes     ExecStart=/usr/bin/davmail /etc/conf.d/davmail.properties     ExecStop=killall davmail          [Install]     WantedBy=multi-user.target      which fails to fork properly. Prepending the `ExecStart` command with `/usr/bin/nohup` is no help, because systemd complains about an invalid argument (preferring to take control of the daemonization itself, if I'm correctly understanding previous forum answers). Changing the Service Type to `oneshot` or `simple` also fails. I think an issue here is that DavMail requires a Java interpreter to run, and systemd service files aren't as flexible as shell scripts in handing off the job to a Java interpreter. But maybe there's a much simpler explanation. Has anyone successfully written a systemd service file for DavMail that they'd be willing to share?


title: How to insert the content of a file into another file (if regexp) in shell/perl

text: File1 Contents:          line1-file1      "1"      line2-file1      "2"     line3-file1      "3"      line4-file1      "4"           File2 Contents:          line1-file2     "25"       line2-file2     "24"       Pointer-file2   "23"       line4-file2     "22"      line5-file2     "21"      After the execution of perl/shell script,               File 2 content should become          line1-file2     "25"       line2-file2     "24"      line1-file1      "1"      line2-file1      "2"     line3-file1      "3"      line4-file1      "4"      Pointer-file2   "23"      line4-file2     "22"      line5-file2     "21"      i.e Paste the contents of file 1 in file 2 before that "Pointer" containing line. Thanks


title: How to replace setuid with file-system capabilities

text: Inspired by this question here is the follow-up: As some of you may know setuid-binaries are dangerous, since some exploits use these to escalate their rights up to root. Now it seems that there has been an interesting idea to replace setuid with different, more secure means. How?


title: linux-sunxi - make failed, undefined references clk_*

text: I try to build uImage for linux-sunxi on a Debian box, which is prepared like this (How To Build Debian From Source Code for Mele):               apt-get install emdebian-archive-keyring     apt-get install gcc-4.4-arm-linux-gnueabi     apt-get build-essential git     apt-get uboot-mkimage     apt-get libusb-1.0-0-dev      I am following the guide at FirstSteps and have done all instructions without errors. `make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- defconfig` works, but `make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j5 uImage` fails:                 LD      .tmp_vmlinux1     arch/arm/common/built-in.o: In function `sp804_get_clock_rate':     timer-sp.c:(.init.text+0x31c): undefined reference to `clk_get_sys'     timer-sp.c:(.init.text+0x364): undefined reference to `clk_put'     timer-sp.c:(.init.text+0x398): undefined reference to `clk_put'     arch/arm/mach-versatile/built-in.o: In function `versatile_init_early':     versatile_ab.c:(.init.text+0x134): undefined reference to `clkdev_add_table'     drivers/built-in.o: In function `clcdfb_remove':     hid-input.c:(.text+0xd790): undefined reference to `clk_put'     drivers/built-in.o: In function `clcdfb_probe':     hid-input.c:(.text+0xdc70): undefined reference to `clk_get'     hid-input.c:(.text+0xde04): undefined reference to `clk_put'     drivers/built-in.o: In function `amba_get_enable_pclk':     hid-input.c:(.text+0xe448): undefined reference to `clk_get'     hid-input.c:(.text+0xe470): undefined reference to `clk_put'     drivers/built-in.o: In function `amba_put_disable_pclk':     hid-input.c:(.text+0xe49c): undefined reference to `clk_put'     drivers/built-in.o: In function `pl011_remove':     hid-input.c:(.text+0x2b6c4): undefined reference to `clk_put'     drivers/built-in.o: In function `pl011_probe':     hid-input.c:(.text+0x2c234): undefined reference to `clk_get'     hid-input.c:(.text+0x2c318): undefined reference to `clk_put'     drivers/built-in.o: In function `enable_clock':     hid-input.c:(.text+0x3a004): undefined reference to `clk_get'     hid-input.c:(.text+0x3a01c): undefined reference to `clk_put'     drivers/built-in.o: In function `disable_clock':     hid-input.c:(.text+0x3a044): undefined reference to `clk_get'     hid-input.c:(.text+0x3a05c): undefined reference to `clk_put'     drivers/built-in.o: In function `__pm_clk_remove':     hid-input.c:(.text+0x3a1b8): undefined reference to `clk_put'     drivers/built-in.o: In function `pm_clk_add':     hid-input.c:(.text+0x3a424): undefined reference to `clk_get'     drivers/built-in.o: In function `mmc_io_rw_extended':     hid-input.c:(.text+0x6d9ac): undefined reference to `sunximmc_check_r1_ready'     drivers/built-in.o: In function `amba_kmi_probe':     hid-input.c:(.devinit.text+0x8bc): undefined reference to `clk_get'     drivers/built-in.o: In function `amba_kmi_remove':     hid-input.c:(.devexit.text+0xd4): undefined reference to `clk_put'     make: *** [.tmp_vmlinux1] Fel 1      Here is a complete dump: http://pastie.org/5351582 I have tried google the errors codes, but I cannot find anything about the several references to `clk_*`, what are these functions and how do I install them on Debian?


title: How do I restore authentication for Debian Lenny synaptic package manager?

text: My neighbor calls me to fix things when his cats walk on his keyboard and cause problems that he can't fix. This time it happened while he was running synaptic package manager. After the reload, when we mark the updates, everything is unauthenticated. I have never encountered this before and have no idea how to recover. Is there a config file I can tweak to fix this? Edit: I've added a bounty to encourage some solutions.


title: What characters do I need to escape when using sed in a sh script?

text: Take the following script:               #!/bin/sh     sed 's/(127\.0\.1\.1)\s/\1/' [some file]      If I try to run this in `sh` (`dash` here), it'll fail because of the parentheses, which need to be escaped. But I _don't_ need to escape the backslashes themselves (between the octets, or in the `\s` or `\1`). What's the rule here? What about when I need to use `{...}` or `[...]`? Is there a list of what I do and don't need to escape?


title: Physical Terminal (DEC VT220) issues with ZSH

text: I recently purchased a VT220 and all the hardware necessary to hook it to my macbook pro. After several hours of fiddling I got it working with a shell - my only problem is my shell of choice, ZSH, behaves weirdly. `Backspace` and Arrow keys, as well as `Ctrl`-`a` and `Ctrl`-`e` do not actually move the cursor and while they do delete it is kind of awkward. Using BASH on the other hand, the device works flawlessly. Is there an issue with some control character or something that ZSH is using?


title: Linux Operating system-NOT A KERNEL CHANGE

text: I tried to make an operating system with my on custom built kernel. It didn't work out to well. I am using ubuntu and have downloaded linux 3.2.7 from kernel.org . I am not trying to change the kernel in my ubuntu system. I want to make my own os with Grub, the linux kernel and i want to be able to have this homebrew os in a file type (such as iso) that I can put on a cd and boot on another computer. My question is : what exactly do I do to make this os? Any comments or tutorials would be helpful.


title: How to make accessible folder/file to other user

text: How is it possible to make a folder under $HOME accessible to other users? I thought that's the case why we have softlinks but apparently I am missing some bits here. Can someone please shed a light on that? Details: User Hadoop runs hadoop installaion and that contain bin folder with awailable commands to execute.               [hadoop@A1n1 hadoop-1.0.4]$ ls -al     total 7648     drwxr-xr-x. 14 hadoop hadoop    4096 Apr 22  2013 .     drwx------. 11 hadoop hadoop    4096 Oct 30 13:51 ..     drwxr-xr-x.  2 hadoop hadoop    4096 Feb 27  2013 bin          [hadoop@A1n1 bin]$ ls -al     total 152     drwxr-xr-x.  2 hadoop hadoop  4096 Feb 27  2013 .     drwxr-xr-x. 14 hadoop hadoop  4096 Apr 22  2013 ..     -rwxr-xr-x.  1 hadoop hadoop 14137 Oct  3  2012 hadoop     -rwxr-xr-x.  1 hadoop hadoop  2642 Oct  3  2012 hadoop-config.sh      I created a softlink pointing to bin folder:               [root@A1n1 /usr/local]# ls -l     total 44     drwxr-xr-x. 2 root   root        4096 Sep 23  2011 bin     lrwxrwxrwx. 1 root   root          29 Nov  1 08:16 hadoop.bin -> /home/hadoop/hadoop-1.0.4/bin      However when I switch to a different user and try to execute a command I get permission denied:               [bdst@A1n1 local]$ cd /usr/local/hadoop.bin     bash: cd: /usr/local/hadoop.bin: Permission denied      I am not sure what I am missing here as to me it seems that file permissions should be ok.


title: Resizing of partitions taking too long in Debian 6 installer

text: I had a Windows 7 PC, with three partitions on it:   1. The default Windows partition (~300GB in size, primary)   2. Some system stuff Windows 7 needs (100MB in size, primary)   3. A partition called `Shared`, that I saved all my media and data to (487.5GB in size, logical). I wanted to dual boot Debian 6 (for programming) and Windows 7 (for video games). I have intended for the `Shared` partition to be used both by Debian 6 and Windows 7, so I have formatted it with NTFS prior to moving files on it and trying to install Debian 6. Now, with all of my files in place, I thought it was time to install Debian 6, from the 600MB CD image. I put the disc in, and rebooted my computer from it. Then, I chose the graphical install; there were some error messages about missing network firmware, a problem which I chose to solve once the whole system is running, but all in all everything went smoothly up to the disk partitioning point. I chose to shrink the `Shared` partition by 50GB, in order to create a new partition on which I would install Debian 6 on. **However, it has been over half an hour since the resize of the (logical) partition was started, and the progress bar is still displaying "Please wait".** What is going on?   Is this normal?   How much longer will I need to wait?   Am I at risk of losing parts of my HDD?


title: What is the difference between [[ $a == z* ]] and [ $a == z* ]?

text: Is there is any difference between these two.               [[ $a == z* ]]      and               [ $a == z* ]       Can I have an example where they would have different outputs? Furthermore, how does the working of `[[ ]]` differs from `[ ]`?


title: Can only access my webserver from my computer?

text: I am learning Apache2, and I just attempted to make my local web server live to the internet. When I type my IP 86.207.14.136 on the browser's address bar and access it, I see the index.html stored in /var/www. And that's exactly what is supposed to happen. Problem is, when I try to access it from an anonymous web proxy such as webproxy.ca or any other, I can't see my webpage. Can anyone please tell if I'm doing something wrong? My IP address is 186.207.14.136/               traceroute 200.228.244.6 output:     traceroute to 200.228.244.6 (200.228.244.6), 30 hops max, 60 byte packets      1  192.168.0.1 (192.168.0.1)  3.123 ms  4.779 ms  5.353 ms      2  10.14.0.1 (10.14.0.1)  13.232 ms  17.436 ms  17.788 ms      3  bb160001.virtua.com.br (187.22.0.1)  18.179 ms * *


title: How to have a chroot system mount shared with its host?

text: Say I `chroot`ed into `~/myroot` with its `/mnt` being bind-mounted from the host's `/mnt`. Now (from _within_ the `chroot` environment) I want to e.g. `mount /dev/something /mnt/something` such that not only the host's `~/myroot/mnt/something` but also _its_ `/mnt/something` contains this mount. How can this be achieved? Unfortunately, the `mount` command of `busybox` doesn't seem to implement `\--make-shared` mentioned here, which should make `mount --make-shared --bind /mnt ~/myroot/mnt` run on the host make this work (untested though!), so how can this be achieved with `busybox`?


title: dpkg --configure -a not working

text: ![enter image description here](http://i.stack.imgur.com/OlJF7.png) This command has been running for 1 hour and it is still not repaired. I use Debian 7.


title: Why Mac applications never get "closed"?

text: I'm a Linux/Windows/Mac user. I like all systems, *nixes more than Windows, but I like all nonethless. I started using a Mac this year, and a difference between Linux and Windows that I can't understand is: why applications never get closes when I hit the "x" button, since this is the way Linux and Windows behave? I need to hit cmd+q or quit by the up menu. I mean, is that only to be different from all of them, or there's a reason for this behavior? I can't see any advantage. If I want to close, I want to close. Period. Anyone knows the reason for that?


title: Map a network share folder in Debian with read-write permission

text: I want to mapped a folder on samba server at Debian Squeeze startup. I found a guidance by google as following: Open file `/etc/fstab` and add line               //server/share /mnt/dir smbfs username=user,password=xxx 0 0      After startup, the share folder is mapped on my computer with read-only permission. My account have both read and write permissions. How to auto map that share folder with write permission? Can you explain two last arguments (double number 0) meaning? Thanks!


title: Implementing a multicast server

text: On Ubuntu 12.04, due to a corporate firewall, UDP packets heading for the 224.0.x.x range get filtered out. However, as a developer, I have two applications that do discovery by listening to a multicast address, so I would like to persuade them to discover each other behind the firewall. Fortunately, I have the source code for one, and the other is Java (running on Windows) so I can hack the class file if needed. So, how do I implement a multicast server? Google doesn't seem to discuss this.


title: On Gentoo, what is loading up my network interfaces?

text: I have 2 networking interfaces `eth0` (wired) and `wlan0` (wireless). Every time the computer boots it tries to bring up both. Most often when there is a LAN cable I don't need `wlan0`, and vice versa, so this looks like a waste. I want to stop the interfaces from being brought up automatically so that I can bring up the one that I need, if at all. According to the Gentoo Handbook I need to run               # rc-update add net.eth0 default      to have `eth0` up every time the system boots and I assume the same thing goes for `wlan0`. However the result of               # rc-update show      does not contain either `eth0` or `wlan0`. So the question is, who is bringing up the 2 interfaces? How can I stop that?


title: How can I chase a program who is rising up my laptop's temperature?

text: After 40 days of non-upgrading I came back from a trip and I decided to dist- upgrade my Debian Sid box. Everything went fine but after rebooting I noticed that the temperature was 15°C over its average. There isn't any process eating more CPU than normal but something is clearly going on. Seeing my system monitor applet for Processor load, when the machine is idle, I can see little blue peaks from time to time which I don't remember having them, maybe that could be a clue. Anyway, I cannot see anything strange in my top command output. So, how can I trace the origin of this heater process?


title: Set ls color listings based on regex instead of globbing

text: Is it possible to set regex patterns for color matching in the LS_COLORS variable? So instead of just `*.jpg=38;5;220` Can I do `\\.(jpg|gif)=38;5;220` That's just an example, I'd like to get more complicated than that. Am I asking too much from this? Is there another way to do terminal color schemes that I can get fancier? I'm using zsh btw, so if I can do it there but not bash, that's fine.


title: How to cd open / autocomplete a folder that ends in a specific phrase

text: I have a folder with subfolders named like this:               1122334 important things     1122335 less important things     1122336 notes     1122337 pictures of kittens      etc The numbers at the beginning are date codes. If it was up to me, I would put the date codes at the end, but it isn't. In bash, I'd like to do something like this:               $ cd *pictu<tab>      and get this               $ cd 1122337\ pictures\ of\ kittens/      Is there a simple way to do this, or something I can put in my `.bashrc` to make this possible?


title: Capturing the name of the file pointed by a symbolic link in a variable

text: Say I have a symbolic link:               /path/to/foo->/path/to/some_file.txt      Say I have a shell variable `x=/path/to/foo`, how can I get `some_file.txt` in a shell variable `y`?


title: How can I right-justify variable length output?

text: So I don't want this:               echo "9"     9      Rather I need this, with e.g.: 4 spaces before it:               MAGICK "9"         9      So if I try it with 10:               MAGICK "10"        10      then it will just have 3 spaces before it. How can I format my output this way?


title: Disable Cinnamon volume applet's sound when changing volume

text: I recently updated my Linux Mint Debian Edition to update pack 7. Since then, every time I change the volume by scrolling on the volume applet that is on my panel, an annoying beep is played. Similar to the behavior of OSX when changing volume. I have never understood the point of this, it means I cannot change volume silently and it is extremely annoying. I have checked Cinnamon's sound preferences (and Gnome's, just in case since there is some overlap) and also the pulse audio settings. I have notifications set to off in Cinnamon's sound preferences. I also checked volume applets tab in Cinnamon's settings but the volume applet has no options. So, how can I remove this annoying beep and get my silent system back?


title: How to pkill by "command name"?

text: So I'm executing a command like:                COMMANDNAME -PARAMETERS      But..why can't I kill it with "pkill"? I'm trying with:                pkill -9 "COMMANDNAME -PARAMETERS"      but it doesn't kills the "COMMANDNAME -PARAMETERS" process. Why?


title: Gentoo/mdadm: Remove 1 disk from RAID 0 array

text: The server has a 7-disk `RAID 0` array, and `sdf` is starting to die. **Is there a way to remove`sdf` while keeping the array intact?**               # df -h     Filesystem  Size  Used Avail Use% Mounted on     /dev/md1     14T  6.6T  7.0T  49% /var     [...]          # cat /proc/mdstat     Personalities : [raid0]     md1 : active raid0 sda4[0] sdf1[5] sdd1[3] sdb1[1] sde1[4] sdg1[6] sdc1[2]           14482788352 blocks 512k chunks      Looking to keep downtime to a minimum. * * * **Clarification:** I understand there is no redundancy, and I've made a backup of important data. But **is it possible to move the "stripes" off`sdf` and onto the other drives?** Just to get it into a stable condition without having to wipe everything. So far, it's just a few bad sectors I could forcefully repair. _If it is possible,_ afterwards I would plan to do the same for 3 healthy drives, and mirror them. Ultimately I need to convert this into `RAID1`. I do not believe it is possible to add another hard disk to this Hetzner server. Also, they cannot mirror the defective drive and replace it: > > "Please note that we can only exchange your defective hard disk for an > empty hard disk. We do not carry out any data exchange or backups."   >  -- Hetzner


title: How can I disable the shutter sound of gnome-screenshot?

text: After a recent update of my LMDE, the `gnome-screenshot` tool started making an annoying camera shutter noise every time a screenshot is taken. This is both annoying and startling (especially if you happen to be wearing earphones when taking the screenshot). I checked the `man` page of gnome-screenshot` but there were no relevant options. How can I take silent screenshots?


title: Good detailed explanation of /etc/network/interfaces syntax?

text: I understood the very basic concept of how to use `/etc/network/interfaces`, but all I find online are examples, example after example, which I can copy- paste from. What I miss is an explanation of the syntax, an explanation of the meaning of the commands and which order the commands require. I want to understand, because most of the time copy-paste is not enough, because I'm not working on a fresh machine, so I can't just overwrite existing configurations because it would break a lot of stuff. `man interfaces` was not very helpful since it is written very complicated. Example questions I have: what does `inet` in an `iface` line mean exactly (I could not even find it in the manpage), what does `manual` in an `iface` line mean exactly (many examples use it, but according to manpage it needs an extra config file then, which the examples don't present), when do I use or need them? When not? When I create a bridge, what exactly happens to the interfaces?


title: How to set the number of commands history recalls

text: I am using bash. To browse my command history I am calling the `history` command which I believe is calling the Gnu program of the same name. (I don't know if there's a better bash specific way). In my .bashrc I currently have a line `export PROMPT_COMMAND='history -a'` to preserve history from my multiple bash sessions I am running. If I do history I currently only see 524 entries. Is this configurable? I would like to increase this to a much larger number say 2000.