Puppet, managing two depending file resources?

I cannot figure out, how to deal with case when I have 2 resources managed by puppet, depending on each other (one is parent of another), and both are set to be `absent`. Test case below. Directories doesn't exists already, but puppet complains about creating files there. How to fix this manifest?               $ find . -type f     ./modules/test/manifests/init.pp     ./modules/test/files/b/x     ./modules/test/files/b/z     ./modules/test/files/b/y     ./manifests/site.pp     ./test.pp     $ cat manifests/site.pp      ## site.pp          node default {         include test     }     $ cat modules/test/manifests/init.pp      ## init.pp          class test {         file { 'dir1':             ensure  => absent,             path    => '/tmp/a',             before  => File['dir2'],         }              file { 'dir2':             ensure  => absent,             path    => '/tmp/a/b',             source  => 'puppet:///modules/test/b',             force   => true,             purge   => true,             recurse => true,              }     }     $ puppet apply --modulepath ./modules manifests/site.pp     Notice: Compiled catalog for localhost in environment production in 0.11 seconds     Error: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/z20140523-14751-1qpqnds-9'     Error: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/z20140523-14751-1qpqnds-9'     Wrapped exception:     cannot generate tempfile `/tmp/a/b/z20140523-14751-1qpqnds-9'     Error: /Stage[main]/Test/File[/tmp/a/b/z]/ensure: change from absent to file failed: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/z20140523-14751-1qpqnds-9'     Error: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/y20140523-14751-1bxpkko-9'     Error: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/y20140523-14751-1bxpkko-9'     Wrapped exception:     cannot generate tempfile `/tmp/a/b/y20140523-14751-1bxpkko-9'     Error: /Stage[main]/Test/File[/tmp/a/b/y]/ensure: change from absent to file failed: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/y20140523-14751-1bxpkko-9'     Error: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/x20140523-14751-1u3y3dl-9'     Error: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/x20140523-14751-1u3y3dl-9'     Wrapped exception:     cannot generate tempfile `/tmp/a/b/x20140523-14751-1u3y3dl-9'     Error: /Stage[main]/Test/File[/tmp/a/b/x]/ensure: change from absent to file failed: Could not set 'file' on ensure: cannot generate tempfile `/tmp/a/b/x20140523-14751-1u3y3dl-9'     Notice: Finished catalog run in 0.14 seconds      EDIT: Full context:               ## init.pp          class test {              $is_master  = false              if $is_master {             $file_ensure        = present             $directory_ensure   = directory         } else {             $file_ensure        = absent             $directory_ensure   = absent         }              file { 'dir1':             ensure  => $directory_ensure,             path    => '/tmp/a',             before  => File['dir2'],         }              file { 'dir2':             ensure  => $directory_ensure,             path    => '/tmp/a/b',             source  => 'puppet:///modules/test/b',             force   => true,             purge   => true,             recurse => true,         }     }      You cannot remove dir1, because it'll fail on master, I need to make it works on master and slave.


How can I determine the cause of CF card corruption?

I installed qnx in my CF card and made it bootable and it was working well. However, yesterday it stopped working while my system was running. Checking the filesystem revealed that it was corrupted. I tried to view the log files but they are corrupted and inaccessible. How can I find out how it became corrupted and which files are corrupted with bit by bit. How can I view the hex file of cf card data. The card is using an ect2 filesystem.


File attributes does not exist in Linux?

There is no equivalent of Window's file attributes for Linux ?


Pass multiple commands to flock

flock -x -w 5 ~/counter.txt 'COUNTER=$(cat ~/counter.txt); echo $((COUNTER + 1)) > ~/counter.txt'      How would I pass multiple comands to `flock` as in the example above? As far as I understand, `flock` takes different flags (-x for exclusive, -w for timeout), then the file to lock, and then the command to run. I'm not sure how I would pass two commands into this function (set variable with locked file's contents, and then increment this file). My goal here is to create a somewhat atomic increment for a file, by locking it each time a script tries to access the `counter.txt` file.


Does tail read the whole file?

If I want to `tail` a 25 GB textfile, does the `tail` command read the whole file? Since a file might be scattered on a disk I imagine it has to, but I do not understand such internals well.


How to run a C program as a daemon?

I have a C program which I want to run as a daemon. How do I install it so it will run as a daemon on CentOS? Someone said to use `@reboot`, and some said to put it in `/etc/rc.d/rc.local`. Which is the right way?


Writing on NTFS drives (on Debian Wheezy)

I am currently setting up a personal server on Debian Wheezy. My machine is an ARM based architecture (Cubox). The problem appear when I want to mount and use my NTFS external hard drives. The mount point is correct, I can access files and folders, I can change owner but it is impossible to write files even as root. I mount my drives with "mount -o options source destination" The command mount gives rw option for this mounted drive.


How to copy the home directory in the home directory?

I need to make a copy of my home directory and place that copy in the same home directory. The exit code of the command must be `0`. Currently, my home directory does not contain any other directories. Is there a better way than the following? (pwd is the home directory)               mkdir /tmp/temp && cp * /tmp/temp && mv /tmp/temp .


Tab spacing in VIM

I want to change tab key spacing to 4 spaces in VIM editor on CVS server. I know the `:set tabstop=4` command is used for that but it does not have a permanent effect. After restarting VIM it changes to 8 spaces by default. I want to change it permanently. Thanks in advance.


MySQL aborting during initial db installation

Linux version:               shell> cat /proc/version     Linux version 3.2.0-4-686-pae (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.2.46-1+deb7u1      Installing MySQL 5.6.14 32-bit. I mostly followed the installation instructions from http://dev.mysql.com/doc/refman/5.6/en/unix-postinstallation.html:               shell> dpkg -i /home/user/mysql-5.6.14-debian6.0-i686.deb     shell> groupadd mysql     shell> useradd -r -g mysql mysql     shell> cd /usr/local     shell> ln -s  /opt/mysql/server-5.6/mysql     shell> cd mysql     shell> chown -R mysql .     shell> chgrp -R mysql .      When I run the installation script:               shell> scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/var/lib/mysql      I get this Error:               Installing MySQL system tables...2013-09-26 11:14:20 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.     2013-09-26 11:14:20 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).     2013-09-26 11:14:20 24642 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys'     2013-09-26 11:14:20 24642 [Note] InnoDB: The InnoDB memory heap is disabled     2013-09-26 11:14:20 24642 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins     2013-09-26 11:14:20 24642 [Note] InnoDB: Compressed tables use zlib 1.2.3     2013-09-26 11:14:20 24642 [Note] InnoDB: Using Linux native AIO     2013-09-26 11:14:20 24642 [Note] InnoDB: Not using CPU crc32 instructions     2013-09-26 11:14:20 24642 [Note] InnoDB: Initializing buffer pool, size = 128.0M     2013-09-26 11:14:20 24642 [Note] InnoDB: Completed initialization of buffer pool     2013-09-26 11:14:20 24642 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!     2013-09-26 11:14:20 24642 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB     2013-09-26 11:14:20 24642 [Note] InnoDB: Database physically writes the file full: wait...     2013-09-26 11:14:20 24642 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB     2013-09-26 11:14:21 24642 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB     2013-09-26 11:14:21 24642 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0     2013-09-26 11:14:21 24642 [Warning] InnoDB: New log files created, LSN=45781     2013-09-26 11:14:21 24642 [Note] InnoDB: Doublewrite buffer not found: creating new     2013-09-26 11:14:21 24642 [Note] InnoDB: Doublewrite buffer created     2013-09-26 11:14:21 24642 [Note] InnoDB: 128 rollback segment(s) are active.     2013-09-26 11:14:21 24642 [Warning] InnoDB: Creating foreign key constraint system tables.     2013-09-26 11:14:21 24642 [Note] InnoDB: Foreign key constraint system tables created     2013-09-26 11:14:21 24642 [Note] InnoDB: Creating tablespace and datafile system tables.     2013-09-26 11:14:21 24642 [Note] InnoDB: Tablespace and datafile system tables created.     2013-09-26 11:14:21 24642 [Note] InnoDB: Waiting for purge to start     2013-09-26 11:14:21 24642 [Note] InnoDB: 5.6.14 started; log sequence number 0     2013-09-26 11:14:21 24642 [ERROR] Aborting          2013-09-26 11:14:21 24642 [Note] Binlog end     2013-09-26 11:14:21 24642 [Note] InnoDB: FTS optimize thread exiting.     2013-09-26 11:14:21 24642 [Note] InnoDB: Starting shutdown...     2013-09-26 11:14:23 24642 [Note] InnoDB: Shutdown completed; log sequence number 1600607     2013-09-26 11:14:23 24642 [Note]      I've tried `touch /usr/share/mysql/errmsg.sys` with mysql ownership but that doesn't change anything. I can see that it is writing something to `/var/lib/mysql`               shell> ll /var/lib/mysql     total 110600     -rw-rw---- 1 mysql mysql 12582912 Sep 26 11:14 ibdata1     -rw-rw---- 1 mysql mysql 50331648 Sep 26 11:14 ib_logfile0     -rw-rw---- 1 mysql mysql 50331648 Sep 26 11:14 ib_logfile1     drwx------ 2 mysql mysql     4096 Sep 26 11:14 mysql     drwx------ 2 mysql mysql     4096 Sep 26 11:14 test      When I try:               shell> bin/mysqld_safe --user=mysql &      I get the exact same error output. I just dunno. Thanks for the help in advance.


Set alignment of numeric columns when columnating data

I use `column -t` to format data for easy viewing in the shell, but there seems to be no option to specify column alignment (e.g. align to the right). Any Bash one-liners to do it? I have arbitrary number of columns.


Using sed to match multiple possible environments in a file

I have some files numbered 01 to 24 that contain things like               \begin{thm}       blah blah blah     \end{thm}     \begin{lem}       blah blah blah     \end{lem}     \begin{prop}       blah blah blah     \end{prop}      inside of them and I want to extract every one of these matches from the file (together with the 'blah blah blah' of course). So I was happily using               sed -n '/\\begin{FOO}/,/\\end{FOO}/p' ./*.tex >> newfile.txt      and running the above with `FOO` replaced by `thm` then `lem` then `prop`. But I realised I am stupid because the order is all mixed up now in `newfile.txt` in the sense that all the `\begin{thm}...\end{thm}` precede all the `begin{lem}...\end{lem}` precede all the `begin{prop}...\end{prop}` even if they follow one another in one of the files say, but I want to keep them in the order that they appear in the files. > **Question:** How can I get `sed` to extract all of these case at once, and > thus preserve the order that they appear in the files?


error using yum in centos 6

my yum command used to work fine , but now , when I try to use it , it gives me an error :               file:///home/user/repo/repodata/repomd.xml: [Errno 14]      Could not open/read file:///home/user/repo/repodata/repomd.xml      I don't know what to do , please help me.


Patching a file (in this case dwm) and failed hunks

I'm trying to add the `transparency` patch to `dwm`. I downloaded the `.diff` file and in my dwm directory ran this:               max@linux-vwzy:~/misc/dwm/dwm-5.9> patch < dwm-transparency.diff      patching file config.def.h     patching file dwm.c     Hunk #1 FAILED at 58.     Hunk #5 succeeded at 306 (offset 1 line).     Hunk #6 succeeded at 847 (offset 27 lines).     Hunk #7 succeeded at 882 (offset 27 lines).     Hunk #8 FAILED at 1125.     Hunk #9 succeeded at 1558 with fuzz 1 (offset 2 lines).     2 out of 9 hunks FAILED -- saving rejects to file dwm.c.rej      I've patched `dwm` before to add a couple other patches. Is it possible that they are conflicting? Or is this another error?


zsh/Prezto: difficulties with right prompt alignment

This may be stupidly simple, but... I am trying to make my own prompt for Prezto. I have been using numerous prompts for reference (I can post a list if necessary). My RPROMPT and cursor are refusing to align correctly. I have done lots of Googling, and have found solutions such as zsh prompt not escaped properly and ZSH RPROMPT weird space. I have been through my code over and over again, making sure all literal escape sequences are surrounded by `%{ ... %}` and anything that takes up space is not. I have also used shellcheck.net to check for other kinds of errors. I suspect it has something to do with `prompt_segment` or `prompt_end`, because the misalignment occurs both when I enter a git branch and when log in as root (see screenshots). I've been working on this for ~~hours~~ ~~DAYS~~ **WEEKS** , and it's driving me nutsy!! The code is way too long to paste here, but is available on github. Screenshots are available in a gist.


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

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?


How can I receive input through notifications in bash?

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?


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

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?


Sticky bit vs setgid for facilitating shared write access

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?


SSH host key keeps changing

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?


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

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?


Gnome 3 notification not working after switching back from XFCE 4

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.


Compress memory on low Ram VM

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?


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

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.


Output shutdown messages to multiple consoles

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`


How to start a command upon login in GNOME?

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?


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

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


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

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?


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

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...?


Declare a new modifier key with XKB

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


Server inbound email forwarding

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


Piping nothing to xargs

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?


Copy file from Windows shared folder to Unix

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.


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

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.


Partitioning and installing Voyage Linux

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?


Restart USB (ehci) in Fedora 14

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?


How to load Linux PC to make it warm?

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?


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

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


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

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?


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

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)


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

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


ksh cannot cp from location with space in it?

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.


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

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?


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

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?


Execute command through SSH

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.


How can I use man without less?

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.


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

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?


Why FreeBsd is using man word for various functions?

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?


Updating Debian on an IMX6 SOC

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.


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

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


Kipmi0 eating up to 99.8% cpu on centos 6.4

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?


SSH locking up: suspect local problem, not remote

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.


Turn off Caps lock when Escape is pressed

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.


How to verify if the Language is installed

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


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

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.


cpu time measurement with wait4 vs. cpuacct cgroup

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.


Configurable tab-bar, or rich-featured terminal emulator

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`?


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

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?


Where can PATH to Thunderbird be set in Ubuntu 10.04

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?


Spoofing or removing DHCP client hostname in response to DHCP server

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.


what is inode for, in FreeBSD or Solaris

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."


How to insert tab character in "dialog"?

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?


Is there a Terminal Services gateway for Linux?

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)


Asking curl to skip missing files

**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.


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

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?


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

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?


BASH reading txt file and storing in array

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?


davmail systemd launcher on headless server

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?


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

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


How to replace setuid with file-system capabilities

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?


linux-sunxi - make failed, undefined references clk_*

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?


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

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.


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

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?


Physical Terminal (DEC VT220) issues with ZSH

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?


Linux Operating system-NOT A KERNEL CHANGE

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.