title: Fixing botched CentOS 5.9 Grub step

text: I installed CentOS 5.9 x64 on a fresh server with hardware RAID level 5. In my ignorance, I told it not to install Grub. The next reboot, I got a blinking cursor. So, I went back to the installer and without reinstalling everything got it to put Grub on /dev/cciss/c0d0. Now, whenever it boots, I get a `grub>` (0.9.7, I guess not Grub2) prompt. When I do this:               root (hd0,0)     setup (hd0,0)  (or "setup (hd0)")      Everything is done successfully, but the next boot brings me to the same place again. So I went to follow these directions, but when I get to `less menu.lst` it tells me that it doesn't exist. Doing `ls` shows me neither `menu.lst` nor `grub.conf` in `/boot/grub` after `chroot /mnt/sysimage`. Do I have to manually create grub.conf, or is there a better/more automated way that I'm less likely to botch, to get past this step? UPDATE: I just tried creating grub.conf myself using vi. Then I did `grub- install` again, at which point I noticed that `hd0` is my USB stick (from which I'm booting into the installer with `linux rescue` to do this) and `hd1` is the RAID. I guess that remains true even when I reboot without the USB stick. So maybe I should have done `root (hd1,0)` etc.? No, when I try that, it boots to an error `Selected disk does not exist`. But, at this point it gives me a handy grub.conf editor. So I try `(hd0,0)` and boot, and it finds the ext filesystem there okay, but now says `File not found`. I've tried the following lines and all yield `File not found`:               kernel /boot/vmlinuz-2.6.18-384.el5 root=/dev/cciss/c0d0     kernel /boot/grub/vmlinuz-2.6.18-384.el5 root=/dev/cciss/c0d0     kernel /grub/vmlinuz-2.6.18-384.el5 root=/dev/cciss/c0d0     kernel /dev/cciss/c0d0/vmlinuz-2.6.18-384.el5 root=/dev/cciss/c0d0      This one finally got it to boot, but then it gave me a kernel panic after it failed to mount /sys and then tried to unmount the old /sys:               default=0     timeout=2          title CentOS 5.9       root (hd0,0)       kernel /vmlinuz-2.6.18-384.el5 ro root=/dev/cciss/c0d0       initrd /initrd-2.6.18-384.el5.img      So I booted the stick again without doing `linux rescue`, and chose "Upgrade an existing installation", and to reinstall Grub. At first the option in `/dev/sda` for where to install it, but I tell it I want to modify/advanced. The next screen lets me choose between `/dev/sda` and `/dev/cciss/c0d0p1`. If I modify the boot order first to put the RAID array first (instead of matching how it currently is in the BIOS in order to boot to the stick), my choices become `/dev/cciss/c0d0p1` and `/dev/cciss/c0d0`. If I pick the latter, it says something went wrong installing packages, and no kernel image was loaded, and rebooting gets me back to my custom grub.conf fail (where if I modify it I can get it to kernel panic.) If I don't modify the boot order and pick `/dev/cciss/c0d0`, same thing.


title: How can I stop "Timed out waiting for forcewake old ack to clear"?

text: Running Arch Linux with Intel i915 and onboard Intel graphics. If I do a dmesg, I get line after line of "[drm:__gen6_gt_force_wake_mt_get] _ERROR_ Timed out waiting for forcewake old ack to clear". Literally there are loads of them! If I go into TTY2 using Ctrl Alt F2, they continuously appear there too and keep generating every few seconds - the same error. One fix I came across on the net was to revert commit 36ec8f8774 (drm/i915: unconditionally use mt forcewake on hsw/ivb). I have no idea how to do a "revert commit". Can someone please advise?


title: Slackware 14x86_64, gnome 3.6 and alps touchpad scrolling settings

text: I have a Dell Latitude E6510 with Slackware 14x86_64, gnome 3.6 (dropline), alps dualpoint touchpad and the latest 3.11.4 kernel.   My touchpad is being detected correctly and I have the touchpad settings in the gnome settings but unfortunately the scrolling works only with two fingers. I am quite used to doing that with one finger. Is it still possible to do that?


title: After upgrading to linux kernel 3.9, kde does not start correctly

text: I recently upgrade my debian from kernel 3.2 to 3.9. This leads to a strange problem. After booting to kernel 3.9, it directly goes to tty7 instead of kde login. I can identify that kdm is up and running from ps. Also, running               service kdm restart      no error message is present. Another noticeable thing is that now I cannot switch to "tty7" which ought to be the "tty" for graphic contents. Is there a direction that I can further investigate this problem and, maybe find a solution? Thank you so much!


title: MP3 to Audio converter under Fedora

text: I have a folder that has ~10 mp3 files. How can I convert them to "Audio format"? - I have an older CD player that doesn't handles MP3 files, only "Audio".... I need a simple, GUI app for it (extra would be that the app automatically burns the converted MP3 files to a CD-ROM) using Fedora 14/GNOME. thank you very much!


title: Opening links outside of broswer in kubuntu opens html from local kde cache only

text: I have this odd problem where whenever a link is opened from the shell, the cached html is opened locally, instead of through a browser. **to illustrate** : if I run the command `xdg-open http://www.google.com` in a bash prompt, this url opens in my browser bar: `file:///var/tmp/kdecache-seldon/krun/13954_0_`. Here is an image of how it loads in chromium (which is currently set as my default browser). ![weird error](https://s3.amazonaws.com/seldon_public_stuff/weird_issue.png). * * * This issue also happens when there is a call to open a link from (most) applications, for instance, clicking on an external link in the help documentation for Gwenview. Does anyone have any insight as to why this might be happening? Anything I can try to keep this from happening? * * * _Updating with some steps that I have tried:_   * launching a url with the application path works just fine (i.e. `chromium-browser http://www.google.com` or `firefox http://www.google.com`   * I checked `~/.local/share/applications/mimeapps.list` and thought I had actaully found the problem because `text/html` was pointed to an old, non-existent `.desktop` file. But fixing the entry to `chromium-browser.desktop` did not fix the problem  I am still at a loss for what this issue could be


title: Install a different version of Maven from the one provided by Ubuntu

text: I would like to install a package on Ubuntu 10.04.4 but would like to not use the one available in the one repository that I get when I do: > apt-cache policy ${package} I would actually like to use an older version. So in my search, I would like to exclude the repo that is returned when I run the above command, i.e. search all the other repos. Also, the above command returns only one option. I was wondering if it always returns just the first (latest) it finds or would it have returned more options from different repos.               >apt-cache policy maven3     maven3:       Installed: (none)       Candidate: 3.2.1-0~ppa1       Version table:          3.2.1-0~ppa1 0             500 http://ppa.launchpad.net/natecarlson/maven3/ubuntu/ lucid/main Packages      I want to install version 3.0.4


title: Arch Linux - Is it possible to instruct pacman to install certain packages into a specific directory?

text: I want to install a set of software organized into directories at the root level. Is there any method in which I can use pacman to install certain packages into a directory of my choosing?


title: Stop tab completion suggesting 'messagebus'

text: I've got a directory called `build`, which I `cd` into quite a bit. If there isn't any directory `bu*` in the current directory, `zsh` tab completion: `cd bu``TAB` suggests `messagebus/`, which isn't in `.`. If I accept that completion, I end up in `/private/var/empty`. I'm unsure which `zsh` option suggests this completion, but I'd love to turn it off. Any idea which setting does it? For what it's worth, this is on `OS X`. On `ubuntu`, I get the suggestions `libuuid messagebus` with identical `zsh` settings.


title: What does "0" mean in the owner and group permission lists of a file/folder?

text: The question is in the title. What does the number 0 signify?


title: SSH over Socks proxy without username or password

text: I have a list of SOCKS proxy servers from this site. I've read about creating a dynamic tunnels with `ssh -D` and to be honest i've tried that already. Unfortunately for some reason I cannot connect to any of the proxy servers from the list. I am using `OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k` on BackTrack. If anyone would be willing to help or point to step by step guide which will work for me I would be very grateful. What I want to achieve is Connect from Machine `A` through ssh tunnel on Machine `B` to Machine `C`. Lets say sshd on Machine `C` is listening on port 21 and Machine `B` proxy is listening on port 1080. Additional Question: I would also like to create a tunnel to socks proxy server which would allow me to setup localhost:8080 in firefox as a proxy and allow me to browse the net from the Machine `B` with Machine `B` IP address.


title: Can AIDE scan a directory inside a directory the user doesn't have read permissions for?

text: I would like to use AIDE to help me verify the integrity of my home directory on a shared Linux system. I am not an administrator of this system. I have built and installed AIDE in my home directory and it seems to work properly. The sysadmin has set permissions on `/home` to `0751`. This allows users to enter `/home`, but not list the contents of the directory (an ineffective security measure, in my opinion). For demonstration purposes, consider this overly simple aide.conf:               database=file:/home/kccricket/aide.db     database_out=file:aide.db.new     /home/kccricket R      Given this setup, running `aide -i` will output:               open_dir():Permission denied: /home          AIDE, version 0.15.1          ### AIDE database at aide.db.new initialized.      The resulting AIDE database will be empty. If I run the same command with `-V255` (highest verbosity), I can see that AIDE examines every directory in `/` and then attempts to do the same with `/home`. It chokes because it can't list the contents of `/home`. Is there a way to make this work, short of asking the sysadmin to change the perms on `/home`?


title: Colored Prompt in KornShell

text: According to this StackOverflow post, it is possible have a colored prompt in KornShell. I have not been able to figure out how to do this. I am able to use color:               echo -e "\033[34mLinux\033[00m"      gives a blue "Linux" output, as does:               printf "\033[34mLinux\033[00m"      However, when I incorporate the escape codes into my `PS1` prompt variable, they are not being escaped. What do I need to do to get a colored prompt? Besides being something of a sucker for eyecandy, I find that a colored prompt is useful when visually parsing output.


title: Can I get WCHAN from ps on Mac OS X 10.7.4?

text: From the manual it seems that `ps -AO wchan` should tell me what everything is sleeping on, but everything comes up as `-`. (And `nwchan` as `0`). Did they do away with the old `sleep()`/`tsleep()` interface in the kernel, or do I need to tweak some setting to get at the information? And if `p->p_wchan` is actually always zero in Darwin 11, is there another way find out what processes are waiting for? EDIT: Indeed, `p->p_wchan` isn't even defined in the internal `struct proc`, the `sysctl` interface just zeroes out the fields when exporting. There's `uu_wchan` and `uu_wmesg` members in `struct uthread`, set by the `_sleep` interface and through that by the emulated `tsleep` function, but I haven't found anything to make those available to userland. `ps -MAO wchan` doesn't, for one. (The whole `struct uthread` thing seems to be a very specific to XNU, a way of retrofitting FreeBSD interfaces onto Mach, so there's little hope of finding solutions from elsewhere).


title: RPM: failed jre dependency, even though that JRE version is installed

text: I am trying to install a package, and it fails reporting a missing dependency:               # rpm -ivh *     error: Failed dependencies:         jre >= 1.7.0 is needed by Tomcat-7.0.37-1.noarch      At the same time, when I check my java version, here is what I get:               # java -version     java version "1.7.0_40"     Java(TM) SE Runtime Environment (build 1.7.0_40-b43)     Java HotSpot(TM) Server VM (build 24.0-b56, mixed mode)      Isn't it the java that the rpm wants? Am I missing something? Does the rpm see a different java and how can I check that?


title: Move one file at a time based from specific number in the files

text: Based from this question, The HTML files date format has been changed. All of the HTML files have the date such like below:               20110730dateishere      `dateishere` is intentionally added by me in the files, so I can easily pinpoint those date location. And now, in the directory of the HTML files, I want to move one file at a time based on that date. If move one file at a time without care about which file moved first, I can simply use               for file in $(ls | tail -1);     do     mv $file /other/location     done      But how to move the oldest file first based on the date in `XXXXXXXXdateishere`? (this means, HTML file contains `20100110dateishere` moved first before `20100111dateishere`, and then next file; based on the date) (note: 20100111 means 11 January 2010)


title: Are there programs that work for Red Hat but not Ubuntu?

text: And vice versa? What about other distributions too?


title: Italics in Emacs on a text terminal (rxvt-unicode)

text: I am using Emacs running in an urxvt, and I cannot get italics to work in Emacs although the terminal supports it. Here’s my current setup:   * I haven’t set `$TERM`, so it is the default `rxvt-unicode-256color`.   * My `~/.Xdefaults` defines `URxvt.font: xft:Inconsolata:size=15` as the terminal font.   * Running `echo '\e[3mitalics\e[m'` in the shell indeed yields _`italics`_ , so italics in the terminal _do_ work, basically. When customizing the “Italic” face, it doesn’t make any difference whether I select `italic`, `oblique`, `normal`, or `roman` as the value for the `Slant` attribute, nor does it if I don’t set the `Slant` attribute at all. I also tried this in combination with explicitly defining `URxvt.italicFont` in my `~/.Xdefaults`, but to no avail. Bold works fine, italic doesn’t work at all. Any ideas?


title: Upgrade from Ubuntu to Crunchbang?

text: Is there a way to upgrade from Ubuntu 11.04 to Crunchbang without a full installation? I'd like to keep the files on the hard-drive intact.


title: Better way of accepting variations of ‘Yes’ from a shell prompt

text: Usability testing of a shell script I wrote found that people had different expectations on how to answer a question that expected ‘yes’ as the answer. See variations in the below code example. Surely there must be a better way that what I came up with? What is your _readable_ and _shorter form_ take on this?               read -p 'Answer this question with yes: ' answer     if [ "$answer" = 'Y'       -o "$answer" = 'YES'       -o "$answer" = 'Yes'       -o "$answer" = 'y'       -o "$answer" = 'yes'       -o some-alternate-condition ]; then            echo 'Surely this can be written better?'     fi


title: Really light weight linux for VM no extensions

text: I need to host a ssh server on a x86-64 Debian squeeze machine with no VT- extensions :( I am using virtlib with qemu (set up and working). I have tried a number of things and non have been perfect, so I was hoping to draw on your experience. I am used to using Debian-based Linux distros, so sticking with them is desirable but by no means critical. So far I have tried x86_64 squeeze with no desktop, X, ect. but it is painfully slow. If I `ps aux` at any one time, there are loads of processes running, most of which are idling, but still. I have also tried i386 damnsmalllinux in i686 qemu mode, once fluxbox and X had been terminated it was more than fast enough for my needs, but removing the desktop was a bad hack at best. I got it down to only handful of necessary processes which was good. So my question is what makes DSL faster, is that it is kernel 2.4 and would installing Woody (Debian 3.0) yield similar results? Or was it that it was running x86-32 (on a 64bit host) or something else altogether. If this were your system what would you do? Do you have any recommendations for a light distros that by default has no UI.


title: Fedora16, ekiga just works in superuser mode

text: I've got a fedora16 running and I'd like to use ekiga as a softphone. Now I'm running into some problems. Starting ekiga as a normal user gives me > could not register (globally not acceptable) So I was pretty stuck. Now I tried running ekiga with sudo and it worked. So I asume, that it is a problem with the rights-management about the network settings. I also have problems when I try running some server applications like apache and try to connect from a pc in the local network. So it would be nice if someone could explain me, what to do, to get ekiga running as a normal user.


title: copy a section of data from stdin

text: I am running a script that takes its input from stdin. This input can end up being very large so I want to extract the part I'm interested in to a temp file. The first line contains "[cics]" and I want to write everything from that point until the next "[" to a temp file. Never having really worked with stdin in scripts before I'm not sure how to do this.


title: Build complete Distro with LFS

text: I want to build distro from source with LFS. Which include default third party tools & tools from different Linux distro. I have following questions:   1. Can I build with LFS?   2. Using LFS can I make Live CD which must run on any Intel/AMD(x64) or I can distribute to my friends and they can install on there PCs.   3. Is LFS good way to do this or any alternative?   4. Any hints and suggestion are welcome to do this stuff.


title: Extended file globbing not working with cat inside bash script

text: When, in my terminal, I type               cat ~/my/+(a|b)/doc      It reads ok from both ~/my/a/doc and ~/my/b/doc, but when I put that command in a `bash` script:               #!/bin/bash     cat ~/my/'+(a|b)'/doc      I get the error:               cat: ~/my/+(a|b)/doc: No such file or directory      Is it not possible to use extended globbing inside a `bash` script?


title: Effect of entries in /etc/securetty

text: By default on RHEL 5.5 I have               [deuberger@saleen trunk]$ sudo cat /etc/securetty      console     vc/1     vc/2     vc/3     vc/4     vc/5     vc/6     vc/7     vc/8     vc/9     vc/10     vc/11     tty1     tty2     tty3     tty4     tty5     tty6     tty7     tty8     tty9     tty10     tty11      What is the difference between each of the entry types (console, vc/ _, and tty_ ). Specifically, what is the end result of adding and removing each entry type? My understanding is that they affect how and when you can login, but are there any other effects? And when can you and when can you not login depending on which entries are there? **EDIT 1** What I do know is that tty 1-6 correspond to whether you can login from the first 6 consoles that you reach using CTRL-ALT-F1 through CTRL- ALT-F6. I always thought those were virtual consoles, so I'm a bit confused. And what does console correspond too? Thanks. **EDIT 2** What is the effect if any in single user mode?


title: How to automatically add new path to $PATH variable after RPM packet installation?

text: I want to automatically add a new path to the $PATH variable each time when my RPM package is installed. I tried to use a post installation script in the my RPM. Here is the part of RPM spec file containing this post installation script:               %post     PATH=$PATH:/usr/app/mdg/bin     export PATH      But after successful installation the $PATH doesn't changed. Please help me with that issue.


title: Ask root for password when using su command

text: I'm trying to edit `/etc/sudoers` via `visudo`, but I don't know how to change the root rights. I want root to be prompted for the user1's password, when he tries to use `su user1`.


title: Identifying unused repositories in Yum

text: Is there a way to identify an unused repository in Centos/RHEL? I have quite a few repositories installed on a Centos machine and I'm not sure which ones are actually needed and which ones aren't. Is there a good way to generate a report that uses the installed package list and identifies which repositories that are still used and which ones aren't?


title: vim automatic substitution

text: I have the following lines:                   '0,         '1,         '2,         '3,      How to put quote before the comma? I've tried the following so far:               %s/[0-9],/&/g      so & here replaces the matched pattern...


title: find multiple conditions with multiple execs

text: I'm trying to build a find command with multiple conditions that lead to multiple actions. It was suggested to me that I should use only one find command for efficiency. Here is what I have:                   find $target \                 \( ! -group $project -exec chgrp $project "{}" \;       \) , \                 \( ! -user $owner -exec chown $owner "{}" \;            \) , \                 \( ! -perm "$perms" -exec chmod "$perms" "{}" \;        \) , \                 \( -type d -exec chmod g+s "{}" \; \)      It seems to actually do something, however I get: > find: invalid expression and > (: command not found in the script I am trying to execute


title: Who creates /etc/{group,gshadow,passwd,shadow}-?

text: In any linux system I have access to (a couple of Archlinuxes, an Ubuntu, a Debian Sid and a Gentoo) there are the following 4 files in `/etc/`, all ending with a dash:               /etc/group-     /etc/gshadow-     /etc/passwd-     /etc/shadow-      On the internet they say that these are just backup files, updated to the next to last change. Now I'm wondering: who's creating those files? Is it my editor? Is it the application editing those files (gpasswd, useradd, groupadd and so on)? Is it something at a lower level (maybe even a kernel module)?


title: Why there are two different shadow files preset in /etc

text: I am running ubuntu 12.04 on rackspace cloud. Somehow it has two shadow files               /etc/shadow     /etc/shadow-      I know about the first being used for password protection but where second came from ? Can it be planted by some hacker trying to break into system ?


title: /dev/md127 refuses to stop. No open files

text: So I'm trying to stop /dev/md127 on my Ubuntu 12.10 box. It was set up as RAID1, but I'm trying to move everything (well, rename) to md0. I read that renaming isn't possible, so I'm trying to remove the drives and put them into a new array as md0. I've been able to remove one drive (sdb) by using --fail and --remove, but sdc isn't responding, nor will md127 respond to --stop --force. I've run fuser and lsof, and neither show anything using md127. I was running LVM on top of md127, but I've umounted the LVs and I've done "{lv,vg}change -an vg_Name". I'm at a loss for what to try next. And for those who want to know why I want to rename/move, I'm a little OCD over things like that. If it's relevant, here are the exact commands I've used, though the stop/fail/remove commands have been tried multiple times:               mdadm --stop --force /dev/md127 # this failed with the error message "mdadm: Cannot get exclusive access to /dev/md127:Perhaps a running process, mounted filesystem or active volume group?"     fuser /dev/md127 # no output     lsof /dev/md127 # no output     mdadm --fail /dev/md127 /dev/sdb # succeeded     mdadm --remove /dev/md127 /dev/sdb # succeeded     mdadm --fail /dev/md127 /dev/sdc # this failed - "device or resource busy"     mdadm --remove /dev/md127 /dev/sdc # this failed - "device or resource busy"     lvchange -an vg_Name     vgchange -an vg_Name


title: What's the difference between sudo su - and sudo su --

text: When I am working on our RHEL machines, I use `sudo su -` to switch to being root. One day, a typo meant I typed `sudo su --` instead - it seems to me that everything was the same as with a single hyphen, except that I was in the same folder as before I issued the command (with a single hyphen I find myself in `/root`). Are there other differences? Is it safe to use this in scenarios where I know I want to work in the same directory?


title: Redirect mail adressed to specific address to individual mail servers - postfix

text: My current set up: mailserver1 mailserver2 (both serving the same domain) and user1 user2 I want do redirect all mails which are addressed to user1 to mailserver1 and the same for user2 to mailserver2. So, I was able to find a lot of tutorials, which describes how to redirect all messages regarding a domain to a different mail server but not for each individual user. Could someone help me which the configuration?


title: Why do Chromebooks no longer allow VPN connections in Guest Mode?

text: This is reproducible in stable, beta, and developer channels. It is also ticketed on their website:   * https://code.google.com/p/chromium/issues/detail?id=308811 Any ideas as to why VPN connections no longer appear to work in Guest Mode?


title: Look for a process with a given name

text: I am trying to convert the VMS command `show/system/process=processname` into an equivalent Linux command. I tried the following but it returned none of the processes:               ps -C /exeimages/processname.pl


title: Compiling Wine 1.7.1 in Gentoo

text: Trying to compile Wine 1.7.1 with the great new D3D and Opengl patches. I proceed like this:   1. Download the GIT source code from here: https://github.com/tpruzina/wine-1.7.1-d3dstream_patches-gentoo_compat_patches   2. Run the script the author made to build both 32 bit and 64 bit libs, which is basically creating 2 directories one for each arch and configure / make   3. The configure goes kind of well for what I see but then the make crashes badly here:              make[1]: Leaving directory `/home/cf/Downloads/wine-1.7.1-d3dstream_patches-gentoo_compat_patches-master/wine64/dlls/dxguid'     make: *** No rule to make target `dlls/ntoskrnl.exe/ntoskrnl.exe.spec', needed by `dlls/ntoskrnl.exe/libntoskrnl.exe.def'.  Stop.      Full configure and make logs here : http://pastebin.com/vRZpUVH1


title: Determine xinput device manufacturer and model?

text: I'm trying to find the device manufacturer and model of my keyboard and touch pad so I can write an XOrg configuration file targeting it via:               Section "InputClass"         Identifier "touchpad"         MatchIsTouchpad "on"         Driver "synaptics"         MatchProduct "Product Name"         MatchVendor "Vendor Name"     EndSection      How can I discover a device's product and vendor name using a CLI tool? I'd like to nail down my Bluetooth touchpad and keyboard so as to be able to tailor Xorg configuration.


title: bash commands don't seem to run in .xinitrc

text: I am trying to run some bash commands in my `.xinitrc` script, but the window manager starts without these commands running properly. I run Arch Linux with the window manager is called "awesome", and I start it with `startx`. This is the entirety of my `~/.xinitrc` file:               #!/bin/sh     #     # ~/.xinitrc     #     # Executed by startx (run your window manager from here)          if [ -d /etc/X11/xinit/xinitrc.d ]; then       for f in /etc/X11/xinit/xinitrc.d/*; do         [ -x "$f" ] && . "$f"       done       unset f     fi          xinput set-int-prop "TPPS/2 IBM Trackpoint" "Evdev Wheel Emulation" 8 1     xinput set-int-prop "TPPS/2 IBM Trackpoint" "Evdev Wheel Emulation Button" 8 2     xinput set-int-prop "TPPS/2 IBM Trackpoint" "Evdev Wheel Emulation Timeout" 8 200     xinput set-int-prop "TPPS/2 IBM Trackpoint" "Evdev Wheel Emulation Axes" 8 6 7 4 5          rfkill block bluetooth          # exec gnome-session     # exec startkde     # exec startxfce4     # ...or the Window Manager of your choice     exec awesome      As you may have noticed, I'm trying to shut down my Bluetooth and activate trackpoint scrolling on my laptop. Each of those `xinput` and `rfkill` commands work when entered manually, but nothing happens when I run `startx`. What on earth is the problem here? :(


title: Multi-line grep beween two tags, only show the last match

text: I'm having a program that intermingles data segments into log output:               log message     log message     ----BEGIN INLINE DATA----     data     data     data     -----END INLINE DATA-----     log messge      I'm looking for something like,               awk '/-BEGIN INLINE DATA-/,/-END INLINE DATA-/'      but it should only print the last data segment, and without the surrounding 'tags'.


title: 'Cannot open display' on restored GNU screen session

text: Using debian unstable with Gnome 3 but I think this has always happened. If I log out and then log back in again it seems the X session is restarted or in some way changed. In any case, when I start a terminal in the second session and re attach the screen, it's no longer possible to start X apps. (message is 'Cannot open display'). Is there an environment variable I can set or command I can run so that the screen session knows the new X details, or do I always have to start a new screen session?


title: How to run a specified codeblock with getopts when no options or arguments are supplied?

text: So I am writing a script that mixes options with arguments with options that don't. From research I have found that getopts is the best way to do this, and so far it has been simple to figure out and setup. The problem I am having is figuring out how to set this up so that if no options or arguments are supplied, for it to run a separate set of commands. This is what I have:               while getopts ":n:h" opt; do       case $opt in         n)           CODEBLOCK >&2           ;;         h)           echo "script [-h - help] [-n <node> - runs commands on specified node]" >&2           exit 1           ;;         \?)           echo "Invalid option: -$OPTARG" >&2           exit 1           ;;         :)           echo "Option -$OPTARG requires an argument." >&2           exit 1           ;;       esac     done      I have tried adding something like this to the top of the code to catch no arguments, but it then runs the same code even when options and arguments are supplied (something is probably wrong in my syntax here):               [[ -n "$1" ]] || {     CODEBLOCK1     }          while getopts ":n:h" opt; do       case $opt in         n)           CODEBLOCK2 >&2           ;;         h)           echo "script [-h - help] [-n <node> - runs commands on specified node]" >&2           exit 1           ;;         \?)           echo "Invalid option: -$OPTARG" >&2           exit 1           ;;         :)           echo "Option -$OPTARG requires an argument." >&2           exit 1           ;;       esac     done      The man page for getopts was sparse and I have found relatively few examples on searches that provide any insight into getopts, let alone all the various features of it.


title: What happens with /etc/fstab when using an initramfs?

text: I have a simple embedded setup as follows: x86 target, kernel and root file system built using buildroot. Syslinux is the bootloader configured to boot with an initramfs which points to a .cpio file generated from the buildroot generated root file system. My system boots and works as I am expecting, but I am confused as to what happens with the entries contained in /etc/fstab. I would like my system to be able to mount the /var directory as a partition on an attached compact flash device for various reasons (mainly because I want to be able to store and run an application on the compact flash and additionally store log data here). Is it possible to use an initramfs and yet mount /var on device outside of RAM? If that is the case, is /etc/fstab the correct place to configure this?


title: What does the Enlightenment desktop (E17) environment variable "PANTS=ON" do?

text: Installing the Enlightenment Window Manager (E17), results in an environment variable being set:               PANTS=ON      What does this environment variable do? What will happen if I set               PANTS=OFF


title: sed: replacing newline at a given line (or last line)

text: I have a file like the following:               a,b,c,d,e,f     1,2,3,4,5,6     7,8,9,0,1,2      I need to join the last two lines with a comma, like so:               a,b,c,d,e,f     1,2,3,4,5,6,7,8,9,0,1,2      The problem is that this is all inside a loop that will add two new lines to that file, say               a,b,c,d,e,f     1,2,3,4,5,6,7,8,9,0,1,2     0,9,8,7,6,5     4,3,2,1,0,9      And now I need to do the same to _that_ last line for the file to end like               a,b,c,d,e,f     1,2,3,4,5,6,7,8,9,0,1,2     0,9,8,7,6,5,4,3,2,1,0,9      So, in only a few words, I need to replace the _last_ new line of a text file with a comma, but only the last line, as lines are being added. I've tried several things but they don't work. The last one was `sed '$!N;s/\n/,/' dna.data`, but it applies to all lines with a newline. Any ideas?


title: Savings emails as individual files using Procmail

text: I installed Getmail to retrieve emails from another email server and Procmail to filter the incoming emails. (I am running Debian/Squeeze.) The recipe I created has this code:               :0:     * ^TO_myemailaddress@domain.com     Xyz      I thought this will make sure that all incoming emails will be saved in `~/Maildir/Xyz/` as individual files. Instead, it seems to be creating a file called `Xyz` (not a directory) inside `~/Maildir/` and appending new emails to the same file. How do I save incoming mails as individual files to a folder, instead of a single file?


title: No shutdown or reboot option in KDE4's menu

text: I obviously have the privilege to shutdown through dbus, cuz it works in XFCE4, but in KDE4, I only have an option to logout. Any thoughts? I start kde4 with `dbus-launch --exit-with-session startkde` **EDIT** Yes, I got `Active=yes` from systemctl, but removing the dbus-launch stopped docky from launching, and .. shutdown option still not available


title: Find command returns wrong files

text: I'm trying to find files in a folder using find command which are a day older than the day on which the command is run.. I use the following command:               FILES_dcn=($(find  $dir_dcn -maxdepth 1 -type f -name "*.pcap" -mtime +1 -print0 | xargs -0 ls -lt | tail -15 | awk '{print $9}'))      But the output seems to be like :               -rw-rw-rw- 1 nethawk nethawk  2097664 Mar 16 01:58 /mnt/md0/capture/dcn/dcn_2014_03_16_01_58_00_438.pcap     -rw-r--r-- 1 root    root    27935978 Mar 17 10:00 /mnt/md0/capture/dcn/dcn_2014_03_16_18_29_18_983.pcap     -rw-rw-rw- 1 nethawk nethawk  2097296 Mar 17 10:02 /mnt/md0/capture/dcn/dcn_2014_03_17_10_02_00_335.pcap     -rw-rw-rw- 1 nethawk nethawk  2097192 Mar 17 10:02 /mnt/md0/capture/dcn/dcn_2014_03_17_10_02_49_476.pcap     -rw-rw-rw- 1 nethawk nethawk  2097936 Mar 17 10:07 /mnt/md0/capture/dcn/dcn_2014_03_17_10_06_59_326.pcap     -rw-rw-rw- 1 nethawk nethawk  2097464 Mar 17 10:10 /mnt/md0/capture/dcn/dcn_2014_03_17_10_10_00_407.pcap     -rw-rw-rw- 1 nethawk nethawk  2097232 Mar 17 10:13 /mnt/md0/capture/dcn/dcn_2014_03_17_10_13_48_603.pcap     -rw-rw-rw- 1 nethawk nethawk   426800 Mar 17 10:14 /mnt/md0/capture/dcn/dcn_2014_03_17_10_13_58_428.pcap     -rw-rw-rw- 1 nethawk nethawk  2097544 Mar 17 10:14 /mnt/md0/capture/dcn/dcn_2014_03_17_10_14_10_259.pcap     -rw-rw-rw- 1 nethawk nethawk  2097600 Mar 17 10:14 /mnt/md0/capture/dcn/dcn_2014_03_17_10_14_49_609.pcap     -rw-rw-rw- 1 nethawk nethawk  2097472 Mar 17 10:17 /mnt/md0/capture/dcn/dcn_2014_03_17_10_16_59_503.pcap     -rw-rw-rw- 1 nethawk nethawk  2097696 Mar 17 10:17 /mnt/md0/capture/dcn/dcn_2014_03_17_10_17_48_698.pcap     -rw-rw-rw- 1 nethawk nethawk  2098048 Mar 17 10:18 /mnt/md0/capture/dcn/dcn_2014_03_17_10_18_29_981.pcap     -rw-rw-rw- 1 nethawk nethawk  2097352 Mar 17 10:20 /mnt/md0/capture/dcn/dcn_2014_03_17_10_20_10_320.pcap     -rw-rw-rw- 1 nethawk nethawk  2097416 Mar 17 10:20 /mnt/md0/capture/dcn/dcn_2014_03_17_10_20_49_703.pcap      Its should have been               -rw-rw-rw- 1 nethawk nethawk  2097296 2014-03-17 10:02 dcn_2014_03_17_10_02_00_335.pcap     -rw-rw-rw- 1 nethawk nethawk   443736 2014-03-17 10:02 dcn_2014_03_17_10_01_58_254.pcap     -rw-rw-rw- 1 nethawk nethawk  2098136 2014-03-17 10:01 dcn_2014_03_17_10_01_48_427.pcap     -rw-rw-rw- 1 nethawk nethawk  2097456 2014-03-17 10:01 dcn_2014_03_17_10_01_38_622.pcap     -rw-rw-rw- 1 nethawk nethawk  2097480 2014-03-17 10:01 dcn_2014_03_17_10_01_28_773.pcap     -rw-rw-rw- 1 nethawk nethawk  2097184 2014-03-17 10:01 dcn_2014_03_17_10_01_18_966.pcap     -rw-rw-rw- 1 nethawk nethawk  2097184 2014-03-17 10:01 dcn_2014_03_17_10_01_09_127.pcap     -rw-rw-rw- 1 nethawk nethawk  2097272 2014-03-17 10:01 dcn_2014_03_17_10_00_59_280.pcap     -rw-rw-rw- 1 nethawk nethawk  2097896 2014-03-17 10:00 dcn_2014_03_17_10_00_49_462.pcap     -rw-rw-rw- 1 nethawk nethawk  2097376 2014-03-17 10:00 dcn_2014_03_17_10_00_39_653.pcap     -rw-rw-rw- 1 nethawk nethawk  2097344 2014-03-17 10:00 dcn_2014_03_17_10_00_29_816.pcap     -rw-rw-rw- 1 nethawk nethawk  2097656 2014-03-17 10:00 dcn_2014_03_17_10_00_19_977.pcap     -rw-rw-rw- 1 nethawk nethawk  2097232 2014-03-17 10:00 dcn_2014_03_17_10_00_10_172.pcap     -rw-rw-rw- 1 nethawk nethawk  2097656 2014-03-17 10:00 dcn_2014_03_17_10_00_00_323.pcap     -rw-rw-rw- 1 nethawk nethawk   435544 2014-03-17 10:00 dcn_2014_03_17_09_59_58_280.pcap      And the current time Fri Mar 21 16:10:42 UTC 2014. Why is this happening ? The files are stored in a samba share drive.


title: Citrix XenServer, all packages appear to be 32bit

text: I'm hoping to use Citrix XenServer for a group of 4/5 machines. One of these machines has 18TB of storage (after RAID5 is taken into account). I've installed XenServer and mkfs.ext3 is the only option. After looking through packages using yum, everything is i386. I downloaded the ISO from here; http://www.xenserver.org/overview-xenserver-open-source- virtualization/download.html Has anyone else noticed this?


title: Bash in php exec in webpage don't colors for png and mp3 files on Linux

text: I have code like this in php:               header("Content-Type: text/plain");     exec("/bin/bash -c 'ls --color=always'", $result);     echo implode("\n", $result);      and I've got result (escape is not visible)               Makefile     README     Yann Tiersen - Comptine d'un autre ete L'apres midi.mp3     bush-src.js     bush.js     bush.min.js     [0m[01;34mcgi-bin[0m     config.json     [01;34mcss[0m     favicon.ico     foo.png     index.php     [01;34mlib[0m     ls.txt     test.php     test.php~     [01;32mtest.txt[0m      It show ANSI escape codes for directories and executable files, but when I call from command line               php -r "exec('bash -c \"ls --color=always\"', \$result);echo implode(\"\\n\", \$result);" | less      I've got this:               bush.js     bush.min.js     bush-src.js     ESC[0mESC[01;34mcgi-binESC[0m     config.json     ESC[01;34mcssESC[0m     favicon.ico     ESC[01;35mfoo.pngESC[0m     index.php     ESC[01;34mlibESC[0m     ls.txt     Makefile     README     test.php     test.php~     ESC[01;32mtest.txtESC[0m     ESC[00;36mYann Tiersen - Comptine d'un autre ete L'apres midi.mp3ESC[0m      png and mp3 have ANSI escapes codes, why php exec from webpage don't give that as return?


title: How do I tail a log file and keep tailing it when the latest one changes date?

text: I'm using RHEL 4. The normal `tail -F file_name*.log` doesn't update when the time flips over to 0000. Here's what I've tried so far from searching the web, both of which try to use nested `tail`: `tail -F $(ls -tr file_name*.log | tail -n 1)` `tail -F $(fine . -maxdepth 1 -type f -printf "%T@ %p\n" | sort -n | tail n 1 | cut -d' ' -f 2-)` None of these flip over to new files. Plain old `tail -F file_name*.log` works in my small test cases (while the 2 above don't), but it doesn't work when I'm tailing a real log file.


title: Is there a faster alternative to pkg-config?

text: Our build system uses pkg-config to build the software, but the linking can take very long (sometimes up to 20 minutes). We identified pkg-config as the guilty tool. So, is there a faster alternative to pkg-config? Or, are there some settings to use to speed up the linking? PS I am not sure if this question is relevant for this question.


title: Disable trackpad click in Yellowdog linux

text: I just installed yellowdog linux 6.2 on an old PowerPC laptop. By default, it's interpreting trackpad taps as clicks, which I want to disable. I followed the directions here, and put `TRACKPAD_OPT=notap` in my `/etc/sysconfig/mouse-emulation` and rebooted, but taps are still interpreted as clicks. Putting the setting in `/etc/sysconfig/mouse` instead (which I had to create) and rebooting didn't fix the problem either. I also tried               % sudo trackpad notap     Password:     writing /dev/adb: No such device or address      So that didn't seem to work. What should I do?


title: Max Open Files, clarification needed

text: On my machine, `ulimit -n` returns 2560 Given that `-n` returns > The maximum number of open file descriptors. Does it mean that system won't allow more then 2560 open files to be out there at any given time? If not, how can i find out what is a hard limit system imposes on open files?


title: Is there any sort of online kernel repository or sharing sites (possibly for laptops)

text: It just seems there should reasonably be something like this considering so many folks run *nix on laptops and laptops have such consistent hardware sets. At a guess I'd imagine there's likely in the ~1000-2000 range of hardware combinations making up ~85% of laptops in current use (this is completely random guess off the top of my head). That said, does anyone know of any sites where people share their precompiled kernels or .configs? I used to meddle them up myself; but that was ~10 years ago and I don't frankly want the headache of getting my hardware working myself. Would be awesome if I could just go to a website, start selecting hardware my machine has and it filters down to other peoples shared .config files, or I could just put in my laptop's model number and it finds someone elses posted .config who had the same. On a side note, yes the common default kernels distros come with seem to work fine on my laptop, but I'm struggling to get the ATI drivers working correctly (I understand I need to remove DRI/KMS and stand on my head while doing some other things; so far I've managed to boot to a black screen in my latest kernel recompile attempt) but it seems somebody else has probably wrestled this into submission on their machine, and their should be a site they can share it in a more concrete form than tutorial.


title: Bash tab completion fails inside of command substitution

text: I've been using kill $(pidof ) to terminate programs for a while, and since last night, every time I try to use tab completion inside the `$()` it throws an error,               bash: unexpected EOF while looking for matching `)'     bash: syntax error: unexpected end of file      Tab-completion works fine outside of command substitution. I guess my question is where are the configuration files for tab-completion located on an Ubuntu system? If anyone has had this specific problem, or can see plainly what I cannot, how to fix this, and/or why this would occur? (I always want to know why.) and if not that, even where and how I should begin my investigation into this problem, would be greatly appreciated. **UPDATE** tab completion following `$(pidof` is no longer throwing an error, but is now not working at all. I've never really messed with any bash internals before, but am not afraid to get my hands dirty. Any guidance greatly appreciated.


title: EBtales not working

text: I wanted to go a little bit further and install EBtables (the 2-layer filtering and routing table). The purpose of it was to only allow the minimal necessary(IPv4 and ARP). To test it I ran:               ebtables -P INPUT DROP     ebtables -P FORWARD DROP     ebtables -P OUTPUT DROP      Then, I tested it, `ping 8.8.8.8`, and surely enough, I got a reply. I tried a couple of other combinations, checked there are no other tables, but ping still worked. If EBtables can't block/filter, it is pointless. I am **_NOT_** trying to block ICMP, I am trying to block everything except IPv4. To test EBtables, I **tried** using ICMP, but it was not blocked (meaning EBtables don't work). What am I doing wrong? (Debian Squeeze, iptables and whatnot, EBtables v2.0.9-2)


title: Is there a way to intercept interprocess communication in Unix/Linux?

text: For intercepting/analyzing network traffic, we have a utility called Wireshark. **Do we have a similar utility for intercepting all the interprocess communication between any two processes in Unix/Linux?** I have created some processes in memory and I need to profile how they communicate with each other.


title: PXE boot via off-site TFTP server

text: I would like to PXE boot from a TFTP server that is not on my local network. The server is running in a cloud VM. Is it possible to specify the remote server's IP without utilizing DHCP? If not, what would the simplest pass-through method be to proxy requests via another working PC on the local subnet?


title: How can I ensure my cronjob will run at specified time?

text: I'd like to know how I can check to see if my cronjob will run at the specified time I set it at. Is there anyway I can test this without having to wait for that time? Here are my crontab -l results:               root@work:~$ crontab -l     3 */23 * * * /opt/lampp/bin/php /opt/lampp/htdocs/site/cron/my_script.php > /dev/null      If I did the values right, will my cronjob run at exactly 11pm every night and log any output to /dev/null for cleanliness? Thanks.


title: Can grep return true/false or are there alternative methods

text: I'm trying to write this script for an assignment - it's only the second one I've written so bear with me. As a part of this script, I need to be able to check if the first argument given matches the first word of file. If it does, exit with an error message, if it doesn't, append the arguments to the file. I understand how to write the if statement, but not how to use grep within a script. I understand that grep will look something like this grep ^$1 schemas.txt I feel like this should be much easier than I am making it. Any help appreciated. Update: I'm getting an error too many arguments on the if statement. I got rid of the space between grep-q and then got an error binary operator expected. I've been poking around at it, but I don't see what it sees.               if [ grep -q ^$1 schemas.txt ]     then             echo "Schema already exists. Please try again"             exit 1     else             echo "$@" >> schemas.txt     fi


title: How to adjust charging thresholds of laptop battery?

text: My laptop is Lenovo T400, and OS is Ubuntu 12.04. I have not been able to adjust the thresholds for battery starting charging and stopping charging. I observed that its current starting charging threshold is about 40%, and stopping charging threshold is about 60%. I forgot if it was me and which program I used to control the battery to stop charging at 60% and start charging at 40%. I followed my previous post http://askubuntu.com/questions/58789/how-to-check- charged-percentage-of-battery-and-to-adjust-its-thresholds, but I don't find `/sys/devices/platform/smapi`. Also I have `/proc/acpi/battery/BAT0/`, but I have only three files `alarm`, `info` and `state`. I want to adjust the thresholds. So I wonder how to do that? Thanks!


title: Local servers (behind NAT) on vpn with email servers and sync with a central email server open to internet

text: **What I have** I have a number of Linux (Ubuntu) servers (20 as of now but may grow over time to hundreds) connected to each other via private VPN (OpenVPN) which serve intranet web application (Apache and PHP) in their respective local network. Users in these local networks do not have internet and they use these servers for few services. A lot of such servers can be behind NAT, or dial up internet. Users of the servers are not connected to VPN or Internet. Their only access within the local network is that server. There is one central server in the VPN which also have a public static IP and a domain name pointed to it. The same application is also served by the central server for those users (road warriors) who wish to connect from public internet. In case of my web application I sync the changes between a local server and the central server, whenever possible. I am using MongoDB for data storage. I have a unique name for every server which can be used for making FQDN, but I don't have a DNS system in place as of now. * * * **What I need** I also wish to add an email service [collaborative suite if possible] to these servers, in such a way that a local server can facilitate email communication within the local network and also sync with the central server [current VPN host] so that a user of a local server connecting via internet (road warrior) is still able to exchange emails. some amount of delay will be acceptable for sync to complete across servers. The service should be transparent. I do not wish my users to use different email addresses or have different IMAP inbox. * * * **Constraints** I have user's credentials in MongoDB databases in local servers and synced to central server. These credentials can be accessed via a PHP REST API. If required I can put hooks on the API create/update events to update the credentials in any required format (LDAP, MySQL, Memcache or something else), But I don't know about replicating in reverse direction. * * * **Answers I seek**   1. Such a system possible with email replication along with IMAP inbox? [Yes/No]   2. will I need a DNS setup? [Yes/No -- Details if possible]   3. is there a suite/software (which integrates, mail transfer agent, mail delivery agent and webmail) for such multi tier scenario, which I can use for such a setup? such as Zimbra? [Which suite/software]   4. or i have to use a stack of Mail Transfer Agent (Postfix/sendmail/Exim), Mail Delivery Agent (sendmail/Dovecot/Cyrus/Courier) and Webmail (Squirrel/OpenWebMail)? [Yes/No and which combination will work for such a system - details if possible] * **Note** \- I am not asking how to setup. I am just asking what's possible and which tools to use.  * * * **A different but Related question** Right now i have users in every server in MongoDB. At central server I keep a database for every server (I have unique names for every server which can be used to make FQDN). I identify users at central server like this > unique_userid_at_local@local_server_name can i have a multi tier LDAP setup where i can keep the users in both local and central server and keep both in sync? is yes which software/stack will work best?


title: cp -L vs. cp -H

text: **Problem** When copying files with `cp -H` or `cp -L`, I get the same results:               $ ls -l fileA       fileA -> fileB     $ cp fileA somewhere/ -H     $ ls -l somewhere/       fileA     # fileA is a copy of fileB, only renamed, with same properties!      This answer here describes both options as similar UNLESS used in combination with `-R`. Not for me. Soft- as hardlinked files become renamed copies of the files they point to at the source.   ## **Question** : What is the proper use of `cp -H` and `cp -L`? Is this the expected behavior?      **My attempt to solve** : `man cp` tells me quite the same for both options,     but `info cp`'s _wording_ makes it even more confusing for me. Maybe one     can help me break this down a bit: > `-H` If a command line argument specifies a symbolic link, then **copy the > file it points to rather than the symbolic link** itself. However, **copy > (preserving its nature) any symbolic link** that is encountered via > recursive traversal. This sounds like a contradiction to me: I guess that » _a symbolic link's nature_ « is that it points somewhere… > `-L, --dereference` Follow symbolic links when copying from them. With this > option, `cp` cannot create a symbolic link. For example, a symlink (to > regular file) in the source tree will be copied to a regular file in the > destination tree. I do know that a symlink isn't a regular file, but… I admit I'm overchallenged with this explanation here.


title: Why date output X-3 instead X-2 days when I am doing arithmetic operations

text: In one of my script, I need to find a 2 days back date from a given date. I have been using the below without any issue since long time, but it's just the first time I got a error which drilled down to wrong value by date command.               $ date -d 20140331" - 2 days" +%Y%m%d      Expected output               20140329      Actual output               20140328      Using "- 2 days" gives expected output, but still struggling to find why subtracting seconds didn't work? ![unix date output](http://i.stack.imgur.com/SwM7U.png) **Note:** My process runs in middle of the day, and hence I don't see any extreme boundary condition like 1 sec got dwindled here and there. **Some more info**               $ date --version     date (GNU coreutils) 5.97     Copyright (C) 2006 Free Software Foundation, Inc.


title: exit shell script from a subshell

text: Consider this snippet:               stop () {         echo "${1}" 1>&2         exit 1     }          func () {         if false; then             echo "foo"         else             stop "something went wrong"         fi     }      Normally when `func` is called it will cause the script to terminate, which is the intended behaviour. However, if it's executed in a sub-shell, such as in               result=`func`      it will not exit the script. This means the calling code has to check the exit status of the function every time. Is there a way to avoid this? Is this what `set -e` is for?


title: Can't sudo after lock password, can I recover from that?

text: After setup ubuntu with default settings, It allows user to login with password, so I use passwd -l [username] to forbid password login both in ssh and console. But when I use sudo to execute commands, it needs password so I can't use sudo any more. Is there any solution that I can use sudo again, another question is how to forbid password login both in ssh and console but keep sudo password auth available?


title: How to inline expand wildcard in bash?

text: I remembered bash can do the following: Suppose there are 3 files: a,b,c in the current directory, when I input:               $> somecommand *      and then press a key or key combinations or a key sequence, the wildcard * online expanded as:               $> somecommand a b c      but I cannot remember and cannot google out the key sequence! help!


title: EPUB reader for *BSD/Linux

text: What are the best native EPUB readers for *BSD/Linux. Browser add-ons are not an option. I prefer non-Qt applications but you can share Qt applications if you want. If possible, I want a program that remembers the page I was last viewing.


title: Managing unofficial repositories on a Debian system

text: A few years ago I added this repository to my sources.list: http://www.deb-multimedia.org/ because it contained packages like acroread or flash player, which were either missing or out of date in the official repos. However, now I have just realized that some of the packages from that repository are broken, e.g. mencoder. Hence a few questions:   1. How can I find out which packages are installed from this particular repository?   2. How can I make this repository lower priority, so that only the packages I want are automatically installed/upgraded from there? EDIT: I edited `/etc/apt/preferences' file as someone suggested:               grzes:/home/ga# cat /etc/apt/preferences     Package: *     Pin: release a=testing     Pin-Priority: 700          Package: *     Pin: release a=stable     Pin-Priority: 600          Package: *     Pin: release a=unstable     Pin-Priority: 50          Package: *     Pin: origin deb-multimedia.org/     Pin-Priority: 50      but it didn't seem to work (note that I downgraded this package manually):               grzes:/home/ga# apt-cache policy mencoder     mencoder:       Installed: 2:1.0~rc4.dfsg1+svn34540-1+b2       Candidate: 3:1.1-dmo5       Version table:          3:1.1-dmo5 0              50 http://www.deb-multimedia.org/ unstable/main i386 Packages             700 http://www.deb-multimedia.org/ testing/main i386 Packages      *** 2:1.0~rc4.dfsg1+svn34540-1+b2 0              50 http://ftp.uk.debian.org/debian/ unstable/main i386 Packages             700 http://ftp.uk.debian.org/debian/ testing/main i386 Packages             100 /var/lib/dpkg/status          2:1.0~rc3++final.dfsg1-1 0             600 http://ftp.uk.debian.org/debian/ stable/main i386 Packages


title: Make thunar mount drives into /media rather than /run/media/username?

text: It's pretty annoying that thunar mounts a drive to `/run/media/user_name/XX` instead of `/media/XX`, can I change that behavior ? I'm running latest arch linux


title: Tmux, change window pane by mouse click

text: Is it possible to use the mouse to navigate between different window panes which are split vertically or horizontally?


title: Replace every odd or even occurance of a pattern in a file

text: I want to replace either every odd or even occurrence of a pattern. Look at the following example:               $ echo aaaaa | sed -e 's/a/b/' -e 's/a/c/' -e 's/a/b/' -e 's/a/c/' -e 's/a/b/'     bcbcb      Is there some command that can do this more concisely? What I'm actually doing is converting `*`s into BBCode `[i]` and `[/i]` tags, so if there's a markdown-to-BBCode converter out there, I'd like to hear about it too.


title: Console download accelerator that downloads *multiple* files simultaneously

text: The download accelerators I've found thus far only let me specify a single file to download. This is useful for single large files, but I'm looking for a tool that lets me hand over a _list_ of multiple files to download simultaneously. In some cases I would want to download the entire list in the traditional accelerated fashion, but sometimes I wouldn't want acceleration - for example, when I was fetching script-generated content. **EDIT** : `lftp` is quite a good program (!), but has no way to show live information about **_all_** running downloads, only one (via `wait all`). I _can_ write a script which watches `lftp`'s file descriptors and displays statistics off of that, but that's decidedly inelegant... and thinking about it, I don't know how big the downloaded file is (since I have no access to the `lftp` process) so I can't calculate percentages anyway. :(


title: Why does the substitution of newlines using g/re/p only apply to every other line in Vim?

text: Consider:               foo     bar     ....     bar     baz      Then:               :g/bar/s/\n/\r\r/g      unexpectedly returns:               foo     bar          bar     bar          bar     bar          ...     baz      when I want newlines after every `bar`. Yet:               :g/bar/p      returns:               bar     bar     ...     bar      as expected and if there are newlines between all the `bar`s I get what I expect--an extra newline after every line containing `bar`. I solved the problem by via:               :%s/\(bar.*\)\n/\1\r\r/g      but I'd really like to have a better understanding on what's going on.


title: Please enter PIN (Ubuntu, Desktop, 3G Modem) turn off

text: Upon having booted to my Ubuntu on my notebook which has an internal dial-up device for 3G network, which I don't use anymore, Ubuntu asks for my PIN for the sim card. How can I disable this pin request?


title: Why ls -lrth and ls -ltch gives different results

text: I was trying to find the time of database backup. Normally i use > >     ls -ltch >   But this time i used > >     ls -lrth >   It gave me different result for One file and all date-stamps were same for both commands               -rw-r----- 1 oracle dba  41M Dec  7 23:59 ctrl_071223     -rw-r----- 1 oracle dba  42M Dec  7 20:52 c-4249173797-20121207-00     -rw-r----- 1 oracle dba 202M Dec  7 20:52 ALG_OSLPRD_jens9rfr.alg     -rw-r----- 1 oracle dba 189M Dec  7 20:52 ALG_OSLPRD_jfns9rfr.alg     -rw-r----- 1 oracle dba 140M Dec  7 20:52 ALG_OSLPRD_jgns9rfr.alg     -rw-r----- 1 oracle dba 3.0G Dec  7 20:51 BKPOSLPRD_jbns9p1f.F_bkp     -rw-r----- 1 oracle dba 4.2G Dec  7 20:46 BKPOSLPRD_jdns9p1f.F_bkp     -rw-r----- 1 oracle dba 3.8G Dec  7 20:43 BKPOSLPRD_jcns9p1f.F_bkp     [root@pdbosl02 daily]# ls -lrth     total 12G     -rw-r----- 1 oracle dba 3.8G Dec  7 20:43 BKPOSLPRD_jcns9p1f.F_bkp     -rw-r----- 1 oracle dba 4.2G Dec  7 20:46 BKPOSLPRD_jdns9p1f.F_bkp     -rw-r----- 1 oracle dba 3.0G Dec  7 20:51 BKPOSLPRD_jbns9p1f.F_bkp     -rw-r----- 1 oracle dba 140M Dec  7 20:52 ALG_OSLPRD_jgns9rfr.alg     -rw-r----- 1 oracle dba 189M Dec  7 20:52 ALG_OSLPRD_jfns9rfr.alg     -rw-r----- 1 oracle dba 202M Dec  7 20:52 ALG_OSLPRD_jens9rfr.alg     -rw-r----- 1 oracle dba  42M Dec  7 20:52 c-4249173797-20121207-00     -rw-r----- 1 oracle dba  41M Dec  7 20:52 ctrl_071223      What I'm missing


title: Symbolic link and hard link questions

text: Let's say /A/B/c.sh is symbolic linked to /X/Y/c.sh.   * If c.sh has the command "./SOMETHING", '.' means /A/B/ or /X/Y/?   * How about the hard link?


title: OS X: how to keep the computer from sleeping during a ssh session

text: When I _ssh_ into a **OS X** computer on my network the session lasts until the **OS X** goes into **sleep** mode. Is there a way to prevent this from happening during my _SSH_ session, apart from physically bumping the mouse or typing keys, or manually disabling the sleep function? EDIT: The ssh session would normally be a simple sshfs mount.


title: Is it impossible to run as `root` if the machine isn't rooted?

text: By default, the user of the device does not have access to certain `root` objects (e.g. the `/data` directory). Even though these objects are off- limits, however, it would seem to me that these objects are there for a reason; some process that runs as `root` eventually to access these objects, or else why would they exist. But I have little experience with UNIX and Android and wanted to ask to make sure: Can the `root` user run on an Android device which hasn't been "rooted"? In which cases can a process initiate a `root`-level action? (e.g. OS updates?). Must the `root` password be provided in all cases? Although I would try to answer this question myself, all things "UNIX" and "Android" looks like a lot to read, and I am not sure where I would find the answer to my specific question.


title: Picking a random file from each subfolder

text: Inspired by the accepted answer to this thread: List X random files from a directory, I tried to put together two lines that would pick one file from each subfolder of my current directory, with no success:               rand() REPLY=$RANDOM     for x in *; do y=$($x/*(o+rand[1])); print ${y:r}; done      It looks like the expansion of `y` is not working properly. Why? What's wrong with the code above?


title: Can I use pmap to find out Memory utilization?

text: I want to measure memory utilization of my Apache Server. Can I use the `pmap` command and pass all the process IDs of `httpd` and take that as total utilization?               pmap PID1 PID2 ....      It seems that `pmap` gives more info than just RAM utilization. Is there any command in Unix/Perl with which I can get the correct info for memory use?


title: Block Internet Connection through Terminal on OSX

text: Even though I don't have administrative privileges, can I block Internet connection on my Mac OS 10.8 machine, through the terminal? I want to do this because I am too lazy to disconnect ethernet cable from my machine to check one of my apps in offline mode. I have found that for Windows we have: `ipconfig release` and `ipconfig renew` commands for the same task. Do we have any alternatives for those in Mac or any better solution to achieve it?


title: How to prevent user applications from knowing about network failure?

text: I have a very unreliable connection which disconnects quite frequently and becomes a massive problem when downloading, as the option to resume is not always available. The solution that comes to my mind is to _prevent_ processes to know about the disconnection while I am reconnecting so that downloads do not fail. How can I do this? (I am running Linux)


title: Can we use symbolic link and hard link for directories?

text: I know we can do that for files. What about directories? It seems that cpanel uses that a lot.


title: Prompt user for sentence and store it without being disturbed by spaces

text: I have a bash function that prompts user to input certain data. I tried it with first name, last name, birthday etc. Data that is mostly represented in one sentence. When I ask for street + no. the function breaks, because it can't handle spaces.               askForData 'Please enter your street and number' STREET      I get following error.               Please enter your street and number: ExampleStreet 123     func_askForData: line 21: 123: command not found      How can I extend my function to accept sentences? file: func_askForData               #!/bin/bash          # Usage askForData "Prompt for value" VARIABLE     # Prints out prompt and stores input in VARIABLE     #      # Prompt is printed till non-empty input is made.          function askForData()     {     local PROMPT=${1}     eval local VAR_NAME=${2}          local CONTINUE=true     while ${CONTINUE}         do             read -p "${PROMPT}: " VAR_VALUE             if [ -z "$VAR_VALUE" ]; then                 CONTINUE=true             else                 CONTINUE=false                 eval ${VAR_NAME}="${VAR_VALUE}"             fi         done     }      **Additional info**               bash --version     GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)     Copyright (C) 2007 Free Software Foundation, Inc.


title: Why index files?

text: I installed Linux on something like 3 or 4 different machines last year, and in two cases, I had a serious urge to vomit after noting that file indexers such as `virtuoso` (Debian testing with the latest KDE) and `libtracker-miner` were installed by default. I simply don't see the point of these programs. They hog CPU and slow everything down. My life was fine without them. And I'm not the only one complaining. So please, can someone tell me what the point of them is? I really don't even know what they do! Can someone explain to me, why index files? People are so surprised by these indexers, they sometimes think their computer is infected with a virus. If it's about finding files: whenever I needed to find a file, I just do `ls -R > filelist.tmp` on my entire filesystem and opened the resulting file in `nano`. Not only do I find the file I need, but I remember where things are. I'm sure there are other solutions. But a program that needs to run all the time just to facilitate... whatever it facilitates... doesn't that contradict the Unix philosophy on a number of counts?


title: What means warning: rpmts_HdrFromFdno when installing from rpmfusion?

text: Installing a media player from rpmfusion (via `yum`) yields following output:               Transaction Summary     ================================================================================     Install  3 Packages (+32 Dependent packages)          Total download size: 21 M     Installed size: 68 M     Is this ok [y/N]: y     Downloading Packages:     warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature,                                 key ID 8296fa0f: NOKEY     Public key for a52dec-0.7.4-16.fc17.x86_64.rpm is not installed     (1/35): a52dec-0.7.4-16.fc17.x86_64.rpm                  |  50 kB     (2/35): faad2-libs-2.7-2.fc17.x86_64.rpm                 | 145 kB      What is that supposed to mean? I've enabled rpmfusion via:                yum localinstall rpmfusion-free-release-stable.noarch.rpm      (downloaded the rpm from the rpmfusion site) I have `/etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-17-primary` (and symlinks) which has the right key id:               # gpg --with-fingerprint RPM-GPG-KEY-rpmfusion-free-fedora-17-primary     pub  4096R/8296FA0F  [...]      But `rpm -qa gpg-pubkey*` does not display an entry for 8296FA0F. I am not really sure how `/etc/pki/rpm-gpg` and `rpmkeys --import` and friends work together. And btw, why is `yum` just issuing a warning and not an error that the key is not available?


title: Upgrade swig 2.0 or newer

text: I'm using `Fedora 13` and I have `swig 1.3` installed:               $ swig -version     SWIG Version 1.3.40      I need to upgrade it to `swig 2.0`. How is this done?.


title: How to detect and delete lines containing ˆ@

text: I have a simple problem: In my file, the are lines containing the string `ˆ@ˆ@ˆ@ˆ@ˆ@ˆ@`. I just want to delete all lines with this string, using for example the `sed` or `grep` commands. And I would like to know why there is such string occurred in my file. What is it meaning for in Linux/Unix world?


title: is there a way to get newer packages when using a debian distribution?

text: I'm using a debian distribution (crunchbang). I like the distribution a lot, and as far as I know, it's not available in ubuntu form. However, I run into some issues with the package-manager lagging several years behind the latest versions, as I do a lot of work in research where I need the latest versions (examples - R, gcc). I know the debian philosophy about stability being more important than the latest version, but for some things, the I can get through apt-get just lag too much. Short of manually installing software off the web and compiling / working out the dependencies by hand, is there a way to use apt-get (or another package manager) to get more recent packages for debian distributions?


title: Adobe Air version > 2.6 port

text: I just want to know if anybody is aware of a port of Adobe Air Runtime > 2.6. Adobe officially discontinued support of air technology for Linux desktop after releasing 2.6 and I got some .air app updates that require version 2.7 or 3.0.


title: Can anyone please explain me below AWK script

text: format of flat file :               ;metier_code              ;     ;-------------------------;          (0 rows affected)     ;CRDS_Ptf_No;          ;                                ;                         ;          ;                                ; ;                         ;                         ;               ;               ;               ;                         ;                         ;     ;Status;     ;-----------;----------;--------------------------------;-------------------------;----------;--------------------------------;-;-------------------------;-------------------------;---------------;---------------;---------------;-------------------------;-------------------------;-----;------;     ;       NULL;ABCD      ;ABHJARS                         ;                         ;ABCD      ;ABCD                            ;Y;                         ;                         ;               ;               ;               ;                         ;                         ;     ;A     ;     ;       1234;XEU-ANKD  ;XEU-AJKD                        ;                         ;ABCD      ;ABCD                            ;Y;                         ;                         ;               ;               ;               ;                         ;                         ;     ;A     ;     .     .     ;      11745;ANJLDMAOKD;AMKDJ AN DJ JAHF AS CPFVH ACCR  ;NONE                     ;AN DJ JAHA;AN DJ JAHA                      ;Y;NO ANKIO GAP             ;YES AMK SCF              ;               ;               ;               ;                         ;                         ;     ;I     ;     ;      11744;AMKDIONSKH;AMKDJ AN DJ JAHF AS CPFVH MTM   ;NONE                     ;AN DJ JAHA;AN DJ JAHA                      ;Y;NO ANKIO GAP             ;YES AMK SCF              ;               ;               ;               ;                         ;                         ;     ;I     ;          (5436 rows affected)     (return status = 0)          Return parameters:          ;           ;     ;-----------;     ;       5436;               (1 row affected)     ;       ;           ;     ;-------;-----------;     ;grepkey;       5436;          (1 row affected)      Below script is used to format the flat file.               awk -F ';' '/^;-----------;/ {start=1;next;}; start==0 {next;}; /^[^;]|^$/ { exit;}; { line_nr++; gsub(" +",""); print line_nr "" $0;}' temp_file > test      Below is the correct output that i am getting by using the above script .               1;NULL;ABCD;ABHJARS;;ABCD;ABCD;Y;;;;;;;;;A;     2;NULL;XEU-ANKD;XEU-AJKD;;ABCD;ABCD;Y;;;;;;;;;A;     3;NULL;SWAPOLEIL;SWAPOLEIL;;QWERDF;QWERDF;Y;;;;;;;;;A;     .     .     5436;11744;AMKDIONSKH;AMKDJ AN DJ JAHF AS CPFVH MTM;;QWERDF;QWERDF;Y;;;;;;;;;A;      CAN ANYONE PLEASE EXPLAIN ME THE BELOW AWK SCRIPT, which is used to format the file               awk -F ';' '/^;-----------;/ {start=1;next;}; start==0 {next;}; /^[^;]|^$/ { exit;}; { line_nr++; gsub(" +",""); print line_nr "" $0;}' temp_file > test      i am new to scripting world. i was able to understand few things from the above script : 1) /^[^;]|^$/ { exit;}; stops the processing if a line occurs which does not start with ; 2) it is ignoring the leading lines please help me understand the script and let me know if the script needs to be modified inorder to be more generic, if so. Thanks in Advance!


title: Ubuntu 14.04 LTS desktop manager

text: How do I activate the desktop manager? I'm getting the error message "desktop manager inactive" after installing, then removing Cairo. When looking for alternative desktop pictures, I installed something called "Cairo" or maybe "Cairo Desktop". I didn't like the way it took over the desktop so I tried to uninstall it, but this didn't work. Eventually I ran `purge` in terminal, I don't have the details. I got rid of the nuisance program, with all the buttons at the bottom of the screen, but an icon "Cairo-Dock" remains. Now when I try to install alternative "desktop" programs, I get the error message "desktop manager inactive" and the install fails. Sorry if I'm using Windows terms, relatively new to Linux.


title: What is the default or most commonly used multiprocessing model in Linux? Symmetric or Asymmetric?

text: What the multiprocessing model for Linux? Is there a default or most commonly used model? Is it similar or very different from say BSD or even the MS Windows kernel? If SMP is used normally, can assymetric be used instead if desired?


title: How to change "Number Format" in Gnome 2

text: I require to change my Number format in my CentOS 6.0 box. I am using "gnome desktop environment" version 2.28.2. I want to know from where can I change the default Number Format of the system. I want to change this because in my system the number values are automatically changing as per default number format and I don't know what is that format. In windows it is possible from control panel:   ![enter image description here](http://i.stack.imgur.com/lY2w1.png) I tried searching into   1\. System-> Administration-> Language   2\. System-> Preferences-> Keyboard   3\. System-> Preferences-> Input Method   But the required settings are not there. If it is not possible by GUI then how to do it with command-line? **Update:** Being specific, I want `Digit grouping: 123456789` i.e. NOT including any comma, which is shown in above windows numbering format.


title: What happens to RPM transaction when it is interrupted in the middle?

text: Let's imagine that I'm installing with RPM packages A, B and C. They are installed in the same order. And suddenly in the middle of installing B there is a power cut. 1) regarding state after turning on: What happens to this transaction? Will it be resumed? Or maybe RPM will remove all packages and files from that transaction? 2) regarding user actions: does RPM require user action to do above things or it checks it automatically at computer start? RPM transctions are described mainly in terms of dependency error or error when computer is still running...


title: watch perldoc output preserving formatting

text: When I use `watch` to follow a `perlpod` documentation i am writing, the formatting gets mangeled (see `NAME` and `Synopsis` sections):               Every 2,0s: perldoc lib/Uki/Handlers/SOS.pm                                                   Tue Apr  8 10:42:43 2014          Uki::Handlers::SOS(3) User Contributed Perl DocumentationUki::Handlers::SOS(3)                    N NA AM ME E            Uki::Handlers::SOS - Studenten-Handler          S Sy yn no op ps si is s            SOS-spezifische Spezialisierung des Uki::Handlers::Person-Handlers.      I think this is due to `nroff` thinking the output terminal is not a TTY, but I don't know how to tell it that, infact, it _is_ a TTY.


title: Including a date in a filename

text: Inside a directory, there are 150 files named like `ABLIMITS.TXT`. How do I rename them to `ABLIMITS_date.txt` prompting the user for date?


title: How to understand the command awk '{for(x=1;$x;++x)print $x}'?

text: I know this command               awk '{for(x=1;$x;++x)print $x}'       will print out all columns in a line. wouldn't this `++x` change `x` to 2, and thus print `$2` first? As I understood based on this: http://stackoverflow.com/questions/1812990/incrementing-in-c-when-to-use-x- or-x And what does the `$x` do in `for(x=1;$x;++x)` ?


title: How to make Arabic appear properly in linux terminal?

text: In Linux Mint 13, when using the Arabic language, text is shown backwards. I found a possible answer that says I should do:               sudo apt-get install libfribidi0 libfribidi-dev      then install bicon, and then put               Terminal=true     Exec=/usr/bin/bicon.bin      in `/usr/share/applications/gnome-terminal.desktop`. After doing this, I restart my computer and enter terminal, but my language is still shown backwards, so then I type in `bicon` and it fix it. How can I make terminal work properly without having to type `bicon` every time?


title: Can't run executable file on Ubuntu, terminal expects sudo, or gives errors like “Invalid or incomplete multibyte or wide character”

text: I'm trying to run executable files on Ubuntu, but it's not working, although the exact same executable file works fine on others' machines, which are also running Ubuntu 12.04 like me. Based on this, I asked a question here: Executing compiled file on Ubuntu But now I realize the issue isn't in my compiled file. Because I wrote a very simple .cpp file and tested it, but Ubuntu still didn't run it. This is my simple test.cpp:               #include <stdio.h>     #include <stdlib.h>          int main( int argc, char **argv )      {      printf ("Hello, this test worked!");     return 0;     }      Then I compiled it:               g++ `pkg-config --cflags opencv` -o test test.cpp      And then tried to run it:               ./test      But I get an error:               bash: ./test: Permission denied      So I try with sudo: sudo ./test which asks me for my user password, which I give, but then it says:               sudo: ./test: command not found      So how can I run executable files at all? ## Edit I've got this Ubuntu installed on top of Windows, using the Wubi installer. When I run:               pkg-config --cflags opencv      I get this:               -I/usr/local/include/opencv -I/usr/local/include        When I run               df .      It says:               Filesystem     1K-blocks    Used Available Use% Mounted on     /dev/loop0      17596475 6112377  11484098  35% /      And when I run:               cat /proc/mounts      Then this is the output:               rootfs / rootfs rw 0 0     sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0     proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0     udev /dev devtmpfs rw,relatime,size=1944900k,nr_inodes=486225,mode=755 0 0     devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0     tmpfs /run tmpfs rw,nosuid,relatime,size=781788k,mode=755 0 0     /dev/sda4 /host fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096 0 0     /dev/loop0 / ext3 rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0     none /sys/fs/fuse/connections fusectl rw,relatime 0 0     none /sys/kernel/debug debugfs rw,relatime 0 0     none /sys/kernel/security securityfs rw,relatime 0 0     none /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0     none /run/shm tmpfs rw,nosuid,nodev,relatime 0 0     gvfs-fuse-daemon /home/asaaki/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0


title: look up the device from its tty file?

text: Here is from my Ubuntu               $ ls /dev/*tty*     /dev/tty    /dev/tty17  /dev/tty26  /dev/tty35  /dev/tty44  /dev/tty53  /dev/tty62      /dev/ttyS12  /dev/ttyS21  /dev/ttyS30     /dev/tty0   /dev/tty18  /dev/tty27  /dev/tty36  /dev/tty45  /dev/tty54  /dev/tty63      /dev/ttyS13  /dev/ttyS22  /dev/ttyS31     /dev/tty1   /dev/tty19  /dev/tty28  /dev/tty37  /dev/tty46  /dev/tty55  /dev/tty7       /dev/ttyS14  /dev/ttyS23  /dev/ttyS4     /dev/tty10  /dev/tty2   /dev/tty29  /dev/tty38  /dev/tty47  /dev/tty56  /dev/tty8       /dev/ttyS15  /dev/ttyS24  /dev/ttyS5     /dev/tty11  /dev/tty20  /dev/tty3   /dev/tty39  /dev/tty48  /dev/tty57  /dev/tty9       /dev/ttyS16  /dev/ttyS25  /dev/ttyS6     /dev/tty12  /dev/tty21  /dev/tty30  /dev/tty4   /dev/tty49  /dev/tty58  /dev/ttyprintk  /dev/ttyS17  /dev/ttyS26  /dev/ttyS7     /dev/tty13  /dev/tty22  /dev/tty31  /dev/tty40  /dev/tty5   /dev/tty59  /dev/ttyS0      /dev/ttyS18  /dev/ttyS27  /dev/ttyS8     /dev/tty14  /dev/tty23  /dev/tty32  /dev/tty41  /dev/tty50  /dev/tty6   /dev/ttyS1      /dev/ttyS19  /dev/ttyS28  /dev/ttyS9     /dev/tty15  /dev/tty24  /dev/tty33  /dev/tty42  /dev/tty51  /dev/tty60  /dev/ttyS10     /dev/ttyS2   /dev/ttyS29     /dev/tty16  /dev/tty25  /dev/tty34  /dev/tty43  /dev/tty52  /dev/tty61  /dev/ttyS11     /dev/ttyS20  /dev/ttyS3      I have 7 virtual consoles. I have also opened some tabs inside gnome terminal, and several emacs (some running shell, but I have probably closed them all), and screen sessions (but now closed).   1. what is the difference between `/dev/tty`, `/dev/tty[[:digit:]]+`, `/dev/ttyprintk`, and `/dev/ttyS[[:digit:]]+`?   2. How can I find out which device each tty file corresponds to?   3. Some said the device files for pseudo tty is /dev/ _pty_ , but why is there no pty file or dir here:              $ ls /dev/*pty*     ls: cannot access /dev/*pty*: No such file or directory        4. Not sure what `/dev/*pts*` means:              $ ls /dev/*pts*      0  1  10  11  12  13  14  15  16  17  18  2  20  21  22  23  24  26  3  4  5  6  7  8  9  ptmx      Thanks and regards!


title: Attachment missing in Unix mail when multiple files were attached

text: I am trying to attach multiple files in Unix, which are the result of a `find` command. When I try to send the mail, the attachments are missing.               dir=$path     echo "Entered into $spr/sum_master"     for fil in `find $dir -ctime -2 -type f -name "Sum*pdf*"`     do       uFiles=`echo "$uFiles ; uuencode $fil  $fil"`     done     \($uFiles\) | mailx -s "subject" abc@gmail.com      What is wrong with this code?


title: Bash restricted Shell using rbash

text: I am using `/bin/rbash` for some users. It's working as expected but there is some hack like when users run `bash` or `dash`, then they got unrestricted shells, so to avoid these commands, I have added below functions in their `.bashrc` files.               bash() {     echo "WARNING: NOT ALLOW!!"     }          sh() {     echo "WARNING: NOT ALLOW!!"     }      So my question is: 1# can we use functions with multiple names as below               func1,func2 () {      # do stuff     }      2# I also tried:               case $BASH_COMMAND in # check each command`             bash|dash|sh)              echo "WARNING: NOT ALLOW!!"              ;;     esac      3# `/bin/rbash -> bash` it's just a soft link of bash, then how does it work as restricted? Also there is some command to avoid users to execute that like `unset HISTFILE` and `kill -9 $$` Is there any alternate way to achieve the same?