title: Check which network block devices are in use

text: How can I tell if a /dev/nbd* device is in use? Will "lsof" tell me? Or is there a better way? Is there an equivalent to "losetup -a" which will tell me the next free one?


title: Setting up surround sound with optical out

text: I have centos 6.3 running on this pc. the built in sound card is detected normally and is a 7.1 card with all speakers listed. It includes a optical out as well as hdmi for the built in video. It looks like pulse audio is automagicly miss configuring the optical out as it is listed as sterio digital out. the analog out is listed as analog sterio - analog surround 5.1 there are 4 or so different variations listed in the pulse audio sound applet. if i select the test sound it has left and right front. I get audio through the digital connection but is only those 2 channels. opening alsa mixer it appears that the surround is activated and detected. it defaults to pulseaudio for both input and output. if I select the hardware card instead it appears they are turned on properly. I need a way to specify that digital audio is more than 2 channels or create a specific profile for sound through the iec958 link with 8 channels.


title: How to create a testcolor.sh like the following screenshot?

text: I found this image on the internet, but don't know how was it made, ![enter image description here](http://i.stack.imgur.com/F8lsU.png) Can anyone provide a sample on that? I just would like to have a color table as well.


title: Output sound by writing to /dev/dsp

text: I know that it is possible to write arbitrary data into `/dev/dsp` and a noise will come up from the speakers. But whatever data I pass to this file the noise is the same. I wonder is it possible to generate some meaningful sound just by writing to `/dev/dsp`?


title: Caching write changes on SSD to avoid HDD spin-up? ZFS, but (probably) not L2ARC

text: I have a home server, which - between other things - stores my documents, mail archives etc.. It uses a ZFS RAIDZ, based on spinning hdds. The server also runs an off-line IMAP service, synchronizing my mail in 5 minutes intervals. The problem is, that frequently I do not need to access mail (e.g. during the night, or when I am away on weekends). Still the disks keep spinning, making noise and wasting electric power, and the only process that wakes them up is this mail checking. I can disable the sync process for the night, but I am looking for a more universal solution. I thought about putting the mail folders on an SSD, which holds the system anyway. However, I do want my mail to be safe. Storing it purely on an SSD while a safe RAIDZ storage is at hand is something I would not call wise. So, my idea is to synchronize the SSD mail storage with the RAIDZ array once or twice per day - **I think I need something like a very delayed write cache**. I thought about calling `rsync` between SSD and RAIDZ, but this has a drawback: if an old mail gets corrupted on the SSD, the error will propagate to the array. Perhaps `rsync --ignore-existing` will do the job, but maybe there is something that could work better?


title: Native and non-native support of thread/process programming in Linux?

text: 1. POSIX thread (pthread) and OpenMP are both libraries for thread programming. But is it right that they are not native to Linux, i.e. they have to be installed by user later? If yes, what are the native library or functions in Linux? Are they used to implement pthread and OpenMP?   2. To draw a parallel comparison to process programming, if I am correct, functions fork(), exec*(), waitpid() and pipe() are offered natively by Linux, while MPI is not. Is MPI implemented in those native functions for process programming?


title: Is there a keyboard shortcut to make a window occupy half the screen?

text: Is there a keyboard shortcut I can use to make a window occupy the left or right half of the screen? I'm using a modified version of Ubuntu. On Mac I just use Divvy but I'm not sure if there is a Linux tool to do the same thing.


title: How can I tell if a package is safe to update on CentOS?

text: I have a simple two-node CentOS cluster based on DRBD, Corosync and KVM.   When I try to update its packages via yum it lists something like               Updating:      clusterlib             x86_64    3.0.12.1-23.el6_2.1          updates     94 k      corosync               x86_64    1.4.1-4.el6_2.3              updates    188 k      corosynclib            x86_64    1.4.1-4.el6_2.3              updates    171 k      drbd83-utils           x86_64    8.3.13-1.el6.elrepo          elrepo     223 k      glibc                  x86_64    2.12-1.47.el6_2.12           updates    3.8 M      glibc-common           x86_64    2.12-1.47.el6_2.12           updates     14 M      kernel-firmware        noarch    2.6.32-220.23.1.el6          updates    6.3 M      kernel-headers         x86_64    2.6.32-220.23.1.el6          updates    1.6 M      kmod-drbd83            x86_64    8.3.13-1.el6.elrepo          elrepo     174 k      libvirt                x86_64    0.9.4-23.el6_2.9             updates    1.5 M      libvirt-client         x86_64    0.9.4-23.el6_2.9             updates    2.8 M      libvirt-python         x86_64    0.9.4-23.el6_2.9             updates    308 k      matahari               x86_64    0.4.4-12.el6_2               updates     18 k      matahari-agent-lib     x86_64    0.4.4-12.el6_2               updates     40 k      matahari-broker        x86_64    0.4.4-12.el6_2               updates     25 k      matahari-host          x86_64    0.4.4-12.el6_2               updates     43 k      matahari-lib           x86_64    0.4.4-12.el6_2               updates     43 k      matahari-network       x86_64    0.4.4-12.el6_2               updates     36 k      matahari-service       x86_64    0.4.4-12.el6_2               updates     51 k      matahari-sysconfig     x86_64    0.4.4-12.el6_2               updates     32 k      qemu-img               x86_64    2:0.12.1.2-2.209.el6_2.5     updates    338 k      qemu-kvm               x86_64    2:0.12.1.2-2.209.el6_2.5     updates    1.2 M      qpid-cpp-client        x86_64    0.14-14.el6_2                updates    996 k      qpid-cpp-client-ssl    x86_64    0.14-14.el6_2                updates    106 k      qpid-cpp-server        x86_64    0.14-14.el6_2                updates    990 k      qpid-cpp-server-ssl    x86_64    0.14-14.el6_2                updates     58 k      qpid-qmf               x86_64    0.14-7.el6_2                 updates    410 k      How can I tell if updating a particular package would imply some kind of downtime? (For example, requiring to reboot a VM or the whole machine)


title: Interactively deleting files from a list

text: I'd like to remove a list of files and be asked for confirmation. The list is in the `list.txt` file. Why the following command doesn't work properly?               while read i; do rm -i $i; done < list.txt      The previous command doesn't wait for me but fortunately no file is deleted. I'm using Bash.


title: How to bind "ß" to Meta-s?

text: I am using Carbon-Emacs on MacOS X 10.6 with the US-International keyboard layout. Usually, I can use `Alt+s` to print the letter "ß". However, Emacs interprets this as `Meta+s` and complains that there is no command bound to that shortcut. So my questions are:   1. How can I create such a shortcut?   2. Is there another way to print the character "ß"?


title: List files, directories and executables in current directory

text: I have php shell and I have function that do just that (but it give me error when I call `scandir($path)` function because of restriction in php), so I need to use my bash shell to do the same. It can be one command that list all 3 things separated by some delimiters or they can be 3 commands. What is the best way to do that? The only thing I can think of is `find` executed 3 times with `-maxdepth 1` and some options.


title: Who sets $USER and $USERNAME environment variables?

text: Also, will these variables always match currently logged-in username (they do on my Debian system)? Can I assume their availability in other Unix(-like) systems? I'm also curious why one would use `whoami` instead of just reading any of these variables.


title: Iptables in linux

text: Please explain me the use of bold character below iptables **-A** INPUT **-i** eth0 **-p** tcp --dport 443 **-m** **state** **\--state** NEW,ESTABLISHED **-j** ACCEPT **-A** **-i** **-p** **-m** **state** **\--state** **-j**


title: update PATH variable in .bashrc using sed

text: I've been trying to update my PATH variable permanently by putting it in my .bashrc file. However, I don't want to just append it to the file, but rather replace the current PATH=........ with the PATH variable I have for the session. Here's what I have so far:               sed 's/^PATH=.*/${PATH=$PATH}/' .bashrc > .bashrc      This is a hodpodge of commands I've seen on the web, and when I run this, the .bashrc PATH line is overwritten with nothing. I would appreciate a solution using sed, because I want to add to the knowledge of sed I've gained in the last hour, rather than abadoning my efforts to awk or something else.


title: Using FFMPEG to stream to Twitch.tv with desktop audio?

text: I've been trying for the last hour or so to stream to Twitch.tv with desktop audio in the stream. Currently, I'm able to use this to get a video to display on Twitch:               #! /bin/bash          INRES="1280x800"             # input resolution     OUTRES="640x480"             # Output resolution     FPS="30"                     # target FPS     QUAL="medium"                # one of the many FFMPEG presets     STREAM_KEY=$(cat ~/.twitch_key)          ffmpeg \         -f x11grab -s $INRES  -r "$FPS" -i :0.0 \         -f alsa -ac 2 -i pulse  \         -vcodec libx264 -s $OUTRES -preset $QUAL \         -acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b 712000  -bufsize 512k \         -f flv "rtmp://live.justin.tv/app/$STREAM_KEY"      What I want this to do is along with my microphone, I need the audio that my computer is playing (e.g. the audio from a YouTube video) to upload to the stream as well. I'm also open to other options, but I haven't been able to find any as of yet.


title: Automatic scheduled backup of website (/var/www and MySQL dump)

text: I've been trying to set up a scheduled backup for my server but i can't seem to get it working. I need to copy the contents of /var/www into a compressed file (tar?) in a folder in my home directory every 24 hours. I also want to perform a dump of all mysql databases every 24 hours and store it in another folder in my home directory. I want both backups to be named with the current date. The server is running Ubuntu 12.04.1, i only have access through SSH so no graphical interfaces. Is this possible to do? I've been looking into the TAR and rsync utility, but i'm not sure how to do it. If anyone can help me out if would be very appreciated.


title: Zorin OS 7 Kernel Panic and boot failure

text: So I decided to try out Zorin OS 7 x64. Everything was fine during the installation. After a few minutes of browsing the internet with Chrome I got this error: ![ss #1](http://i.stack.imgur.com/LculX.jpg) `Ctrl``Alt``Del` didn't work, so I hit 'reset' button and got this message: ![ss #2](http://i.stack.imgur.com/cuwNn.jpg)


title: Sending attachments with mailx and uuencode

text: I am in the process of trying to run a script which usually sits on an AIX machine on its new host Linux node. The code I am running looks like this:                  (uuencode $path/info.dat info.csv; uuencode $RESULTS results.log) | mail -s "Info" $MAIL_RECIPIENTS      So normally what this does is take the .dat file and standard outs it in a csv format - and sends the mail with no body but just the info.csv and results.log attached. What is actually happening is the encoded output that uuencode produces (if you were to just run it independently) is being sent in the message body and there are no attachments. The email body looks like this:               begin 775 info.csv          M+3`U+C`S+C4S+C(Q-#`W."(L(D%55$]314Y$("`B+")!551/4T5.1"`@(BPB     etc..     etc...     end          begin 775 results.log     M+3`U+C`S+C4S+C(Q-#`W."(L(D%55$]314Y$("`B+")!551/4T5.1"`@(BPB     etc...     etc...     end      The version of uuencode on the new machine:               uuencode (GNU sharutils) 4.7     Copyright (C) 1994, 1995, 1996, 2002, 2005, 2007 Free Software Foundation, Inc.     This is free software; see the source for copying conditions.  There is NO     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


title: Why does fstab use UUID instead of the actual file system name?

text: For example, this is the first line of my `/etc/fstab`:               UUID=050e1e34-39e6-4072-a03e-ae0bf90ba13a    /    ext4    errors=remount-ro    0    1      And here's the output of `df -h` command (reporting free disk space):               honey@bunny:~$ df -T          Filesystem     Type     1K-blocks    Used Available Use% Mounted on     /dev/vda       ext4      30832636 4884200  24359188  17% /     none           tmpfs            4       0         4   0% /sys/fs/cgroup     udev           devtmpfs    498172      12    498160   1% /dev     tmpfs          tmpfs       101796     320    101476   1% /run     none           tmpfs         5120       0      5120   0% /run/lock     none           tmpfs       508972       0    508972   0% /run/shm     none           tmpfs       102400       0    102400   0% /run/user        1. From the two is it okay to deduce that `UUID=050e1e34-39e6-4072-a03e-ae0bf90ba13a` represents `/dev/vda` given that the first column in `fstab` is `<file system>`?   2. So, would it be okay if I modified `/etc/fstab` to this?              /dev/vda    /    ext4    errors=remount-ro    0    1        3. **EDIT:** If yes (to above question), why does the `sudo blkid` command show a different UUID for `/dev/vda`?              $ sudo blkid          /dev/vda: LABEL="DOROOT" UUID="6f469437-4935-44c5-8ac6-53eb54a9af26" TYPE="ext4"      What am I missing here? **Answer:** I'd conclude (3) to be a bug in the cloud of my host. So yes, the UUID reported by `blkid` (or `ls -l /dev/disk/by-uuid`) should be the same as the one used in `/etc/fstab`.


title: Formating hdd to ext3 fails?

text: maybe i'm too stupid, but what's the command to format my external 2.5tb usb hdd to ext3? using `mkfs.ext3 /dev/sdc1` works, but only gives me 300gb of space allocated... where am i failing? thanks in advance.


title: Process is eating all of the CPU time

text: Is there any magic command to track down which process is starting this perl task that is eating 100% of CPU time? I have this problem on several machines where JBoss AS is installed. ![enter image description here](http://i.stack.imgur.com/sz8F3.png)


title: Can the ~/.john/john.pot file be used forever?

text: If I use john for getting weak passwords in ex.: 2010, then can I use the john.pot file later or there could be situations when the hash is the same, but the passwords differ?


title: Traffic Control user permission

text: My users need to emulate packet loss on RTP video streams to achieve visual effects. We are in a artistic environment and don't worry about security. The application works only as super user. I inserted a NOPASSWD entry for my user on sudoers file but it always says:               % tc qdisc del dev eth0 root     RTNETLINK answers: No such file or directory      I also traced `open` system calls to detect which files `tc` need write permission but I failed to find something usefull.


title: cp does not copy new files of source location (files created after firing cp command)

text: I am using the following command to copy contents from a source directory to a destination directory:               cp src/* dest      However, after evoking this command and while when contents are getting copied, if I create some more files in the src directory , these newly created files are not copied to the dest directory. Could you please explain the reason behind it? Does `cp` work on something like making account of contents while `cp` is fired and then copying the contents based in that account keeping and thus ignoring the newly created contents?


title: grep for text that may or may not be present

text: Lets say I have a file               batman;     robin;     superman;     password = "";     wonderwoman     green lantern      if I want to check if there is a `password` present, i.e there is something entered in the `""` . here is an example for that               ironman;     hulk;     spiderman;     password = "tonyStark";     black widow     hawkeye      How would I check if the file has a password between the `""`? This is what I have so far               x=$(grep -icE "password=\"[a-zA-Z0-9]\"" file.txt)     if [ x -gt 0 ]; then       echo "There is a password"     fi


title: Renaming file which got a quote mark ' in its name

text: I got a little bit of a problem. One client tasked me with the migration of sites from a really old server. Don't know how they got there, but there are files with `'` in their names. Is there any way to rename the file? `mv` doesn't seem to do the trick. `ls` shows it as `90843_O\\'ConnorPaul_GeneralManager.jpg` When I try                mv 90843_O\\'ConnorPaul_GeneralManager.jpg 90843_O_ConnorPaul_GeneralManager.jpg      it does nothing with the `>` in the new line as if waiting for more input. If I try               mv 90843_O\'ConnorPaul_GeneralManager.jpg 90843_O_ConnorPaul_GeneralManager.jpg      I get the error > mv: cannot stat '90843_O\'ConnorPaul_GeneralManager.jpg': No such file or > directory Also, is there simple way to change `\'` to `_`in all files in certain folder?


title: command condition sometimes integer sometimes string

text: I want to execute this condition               while [ $(cat /path_of a file/) -eq 1 ]      The condition is only correct if               $(cat /path_of a file/)       is an integer and not a string ! How can I overcome this problem ?


title: How to source correct startup scripts on interactive, non-login shell

text: I'm trying to set up a sane/usable environment in a barebones OpenSolaris- derivative (OmniOS, a distribution of Illumos/OpenIndiana). I have all the plumbing code I need in .profile, .inputrc, and .bashrc files ready to promote to system-wide use, but no system-wide scripts are being sourced for non-login shells. Bash attempts to load the user's .bashrc file on su, but $HOME (and any other environment variables) remains configured for the previous user. Output from a direct (SSH) login:               login as: myuser     Using keyboard-interactive authentication.     Password:     /etc/profile run     myuser's .bashrc run     myuser's .profile run     myuser@Helios:~$ echo ~     /home/myuser     myuser@Helios:~$      Output switching user:               root@Helios:/etc# su myuser     bash: /root/.bashrc: Permission denied     bash-4.2$ id     uid=1001(myuser) gid=100(users) groups=100(users),27(sudo)     bash-4.2$ echo ~     /root     bash-4.2$      Note in particular the attempt to source root's .bashrc instead of myuser's .bashrc. su (without additional arguments) has always worked seamlessly in Ubuntu, Fedora, etc. and I intend to replicate that experience, but what can I do when no system-wide scripts run and the user's scripts cannot be found? I'm inclined to blame OmniOS's version of bash and/or su for missing something, but what exactly is the correct behavior? Can I configure/access/script additional plumbing somewhere which addresses the failure to update $HOME and other envvars? Further notes:   * there is no man bash in OmniOS (at least not using MANPATH=/opt/omni/share/man:/opt/mysql55/man:/opt/gcc-4.4.4/man:/usr/gnu/share/man:/usr/local/man:/usr/local/share/man:/usr/man:/usr/share/man)   * /etc/bashrc and /etc/bash.bashrc never get sourced (which is expected as this is apparently a distribution-specific convention, but Ubuntu does appear to be loading these without reference from .bashrc)


title: Understanding environmental variables in different contexts

text: Trying to understand the behaviour of the environment in Linux (Ubuntu 13.04 concretely), I've find different situations where setting envirionment variables are used or defined for/in different contexts. For example, if I check, `locale`, I get:               $ locale     LANG=en_US.UTF-8     LANGUAGE=es_ES:es_HN:es_EC:en     LC_CTYPE="en_US.UTF-8"     LC_NUMERIC=es_ES.UTF-8     // more output      But, if I find, for example, `LC_CTYPE` using `env | grep "LC_CTYPE"`, it sends no output. In general, `locale` shows me 13 `LC_*` variables and `env` only nine:               $ locale | grep "LC_*" | wc -l     13     $ env | grep "LC_*" | wc -l     9      Other variable with different "nature" is `PS1`. For example:               $ env | grep "PS1" # No output, but...     $ set | grep "PS1" | head -n 1     PS1=$'\\[\\033[1;33m\\][\\t][\\W]\342\230\233\\[\\033[0m\\] '      and of course, `PS1` is a well-defined variable in my current environment, since I see my prompt changed accordingly. Other way of _viewing_ environment variables in other context is by means of `strace`. It is a program which allows you to see what's going on when you execute a program. Sample:               $ strace -v ./a.out # a.out is a common Hello World, made in C.     execve("./a.out", ["./a.out"], ["LC_PAPER=es_ES.UTF-8", ...]) = 0     brk(0)     access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)     # etc, etc     write(1, "Hello World\n", 12Hello World     )           = 12     exit_group(0)                           = ?      The first thing the shell makes when executing a program, is call to `execve`, which does really call a program. Its first argument is the program being called, the second is the `argv` params of the called program, and the third parameter is the environment variables. In that 3rd parameter, for example, doesn't appear either `PS1` or `LC_TYPE`. In general, variables appearing in `env` or `set` appear in the list of environment variables sent to `execve`. Some `locale` variables appear in `env` or `set` but others not (`LC_TYPE`, `LC_COLLATE` and `LC_MESSAGE`, as well as `LC_ALL` but with an empty value). Lastly, other variables are not defined in `env` although they have a visible effect (`PS1`), as reflected by `set`. What's going on here? What are the differences between `env`, `set` (without arguments), `locale` (obviously respect to locale variables only)?


title: Centos 6 stuck at loading splash screen after successful installation

text: I'm trying to dual-boot CentOS with Windows 7. My current disk layout are as follow:-               /dev/sda1 - Windows 7     /dev/sda3 - NTFS partition      I created a standard partition for `/boot` and that was assigned as `/dev/sda2`. When I create LVM Physical Volume, it automatically creates an **Extended Partition** (`/dev/sda4`) and the LVM Physical Volume (`/dev/sda5`) was created under the Extended Partition. I then created 2 volume group for `/` and `swap`. Upon complete installation, I'm unable to login to Centos at all. It is stuck at the loading splash screen. Does this have anything to do with the disk layout? If so, how can I fix this? EDITED Instead of dual-booting it, I installed it as a VM on my Windows Machine. I started off with a blank disk layout, create /boot partition followed by the LVM Physical Volume. It installed fine and was able to boot up normally. I presume the issue was due to the LVM Physical Volume sitting in the Extended Partition that ruined the boot-up. Could be wrong through. Should I mount the extended partition first or something?


title: Can't install mintupdate 4.5.6-1 (Linux Mint 16)

text: I can't install mintupdate 4.5.6-1 under Linux Mint 16. When mintupdate tries to upgrade version 4.5.6 to version 4.5.6-1 the following error pops up:               E: Could not open lock file /var/cache/apt/archives/lock - open (21: Is a directory)     E: Could not open file descriptor -1     E: Unable to lock the download directory      What can I do to fix this?


title: How dbus calculates machine id?

text: How DBus calculates machine id? (/etc/machine-id, /var/lib/dbus/machine-id). Which way is more correct to determine it?


title: Restarting X in CentOS 5

text: I went to a CentOS terminal, and someone was logged in doing work. I hit `Ctrl`+`Alt`+`F2` to try to get to my own session so I could check something. When I hit `Ctrl`+`Alt`+`F1` to get back, X did not come back up and gave a bunch of error messages. Is this a bug? Did that other user just lose all the work they had running? It seems like if I had to kill all X and do a `startx` again, he would lose everything running in the terminals and other GUI apps, right?


title: Why I was able to fix a broken package with aptitude but I could not with either apt-get or synaptic?

text: Yesterday I upgraded my Debian Testing and Audacious stopped to work. Troubleshooting I found that the problem was that it was updated to a recent version but the needed plugins were not. I tried to manually install the plugins from its website but I couldn't, missing a lot of packages, and every time I installed one it requires other and so on. So my solution was to change my repositories to wheezy and go back to the old version. After this, audacious was broken and I couldn't fix it. I tried `apt- get clean`, `apt-get install -f` and the Fix broken packages at Synaptic. Neither worked. However, I installed it using aptitude and it was installed after automatically fix the dependencies. My question is, why neither apt-get nor Synaptic weren't able to fix the dependencies, and aptitude was?


title: Problem with network interface

text: I had a problem with eth0 interface.   I installed linux distribution version 11.10 and I want to set static IP address to my linux computer. When I run `ifconfig`, it didn't print the eth0 interface. It seems it isn't detected by the system, even if I edit the file `/etc/network/interfaces` this way :               auto eth0      iface eth0 inet static     address = x.x.x.x     netmask = x.x.x.x     getway = x.x.x.x      Is there any solution to set static ip address to my computer or any solution to enable eth0 interface when I run ifconfig command in terminal ?


title: Can less invoke vim instead of the default vi when I hit the 'v' key?

text: I want to launch `vim` instead of the default `vi` editor when I hit `v` in `less`. Are there any settings I can modify to allow me to do this?


title: Testing whether a file is local

text: I need to test in a script, whether a file is from a network mount or truly local. To be more clear: I need to test, whether parsing the contents will be fast or slow, but for my case local vs network is a reliable indicator. The best attempt I've come up with is `stat -c %m [path]` to get the mount point for the path, which gives `/` for files on my local disk and the mounting point for a CIFS mount. But I suspect that this isn't a reliable diagnostic beyond my very simple config (one local drive, one big partition, a couple of network mounts) so I'd like a robust/canonical approach. Searching hasn't given any useful leads; terms like “network” and “path” are just too overloaded.


title: What is 'ls quote'?

text: Today I happened to press `'` after `ls`   So the command is `ls'` After I issued this command: ![enter image description here](http://i.stack.imgur.com/5NwCN.png) [edit]Seems the image can't display properly               > ls'     quote> ls'     zsh: command not found: ls\nls     >      Can someone tell me, what is the `ls quote` thing?


title: How do I make Vim behave like "tail -f"?

text: I would like to know if there is a way to make Vim behave like `tail -f`.   Even the best Vim plugin I've found so far doesn't do what I expect. I really want to see the file update in **real-time**. Even I'm away from keyboard, I want Vim to constantly reload the buffer and jump to the last line. How to do this?   (I don't want to reload the whole file, since some log files are very big. The best is to only load the last lines, like `tail -f` does.)


title: How to match a particular form of optional sequence from a manual synopsis, including variations?

text: In this Q&A there is a reference to the manpages synopses being based "loosely" on the _Extended Backus–Naur Form_ of metasyntax notation. It's interesting and serves as background. That being said, using related terminology, one of the most common type of element you will find in a command synopsis from a manual is the _optional sequence_ ; made of a _definitions- list_ enclosed between a _start-option-symbol_ and an _end-option-symbol_. In so many words, something we often associate with the likes of `[ option ]` which, for instance, could be a single dash or a longer double dash form followed one or more characters, such as in `ps --help`. * * * So I'd like to match a common optional sequence pattern we often see in the manuals which indeed:   * Starts with `[` and ends with `]`   * Contains an optional sequence in the _form_ of `-option` or `--option`   * Is not necessarily centered inside a bracket i.e. `[-a]`, `[ -ab]`, `[-abc ]` all match   * Allows for a list containing an option and its optional element/specifier i.e. `[-a foo -b bar -c=biz end]`   * Allows other brackets to appear inside the outside brackets i.e. `[--a [-b[-c]] -d foo]` (would match the whole input here) ... but **doesn't** allow:   * Three dashes `---` under any circumstance   * To be more clear, things like `[option]`(no dash) and `[]`, `[-]`, `[--]` or `[foo-bar=a]` alone shouldn't match. * * * The data doesn't contain too many unusual cases such as the examples presented above(I wouldn't know how to deal with unmatched brackets either but that's beyond the scope of this). Trying to address the requirements with `grep` like I did was maybe not the best idea in hindsight but I tried:               grep -E '\[{1,}([[:space:]]{0,}[[:punct:]]{0,}[[:alnum:]]{0,}){0,}(-{1,2}[[:alpha:]]{1,}){1,}([[:alnum:]]{0,}[[:punct:]]{0,}[[:space:]]{0,}){0,}\]{1,}'      It's matching some patterns1, along the lines of what I want, but it has shortcomings, is hard to manage and reuse. Using arbitry sets(3) of parentheses to group items in order to manage matching repetitions to create "blocks" doesn't help in that regard either(but helps with debugging). Playing with characters classes to cater to the input seems quite unpredictable. So how do you do this using either a better expression and/or a different tool/approach? How do you manage such long regular expressions if you use them - in this case should you have to use a command many times over to filter down the content? Do I need to manipulate the content differently beforehand to help me with that? * * * 1\. The output from iterating through the manpages files affords a good opportunity for testing. With grep here I used: `for i in /usr/share/man/man1/*.gz; do basename "${i//.1.gz}"; my_grep_command_above <<< "$(man -l "$i")"; done` using he entirety of the manpages output. Otherwise `man man` or `man as` provides a good variation of optional sequences for testing.


title: Considerations when hosting an outgoing email server

text: I want to host an email server on my VPS so I can send automated emails from my application. Reading about the different ways of hosting email servers (involving ISPs blocking ports, open relay issues, authenticated SMTP, SSL, etc.) has left me very confused. Most tutorials advise to use a smart host as a relay. I don't want to do this because I don't want to depend on an outside service. So my question is what are the things I need to think about to send email to the Internet? A link to a simple clear tutorial would be appreciated because I was not able to find one.


title: redirection to file issues with nohup and pipe

text: For the following command:               ssh -t esolve@hostname 'sudo nohup bash -c "ls > log 2>&1 &"'      I always got error information:                      nohup: ignoring input and appending output to `nohup.out'      why does this happend and how to avoid this error information? Besides, in the following (I use it to enable output to both screen and file),                  stdbuf -o 0 command|& tee logfile      what is the `&` used for?


title: screen + vim -- Any way to automatically set screen window name to open vim filename?

text: I have a pretty nice screen rc file that shows me the open screen windows almost like tabs at the bottom of the terminal. Currently the windows are named according to my prompt which is not so useful. Is there a way to automatically name the windows based on the filename of an open vim session currently in the window? I think this would make a supreme multi window editor if it were possible.


title: How do I execute a command on login for a system user with no home folder and no personal .bashrc file?

text: I set these users' home folders through the /etc/passwd file, but when they log in I would like them to activate a python virtualenv. If they had a personal `.bashrc` file, I'd just include the `activate` command there, and the directory change as a post-activate hook with virtualenv. However these users don't have home folders, and don't have personal `.bashrc` files. How can I execute a different command on login for each of these users? (Only one command needs to be executed.) These users are only logged into using `su`, never SSH. The machine is a VPS running Ubuntu 12.04.3 LTS.


title: How to fix up fonts displaying only in bold or italic after copying Windows/Fonts?

text: In order to fix up the broken display of some Word (Windows) files in LibreOffice, I copied over the entire `/windows/Fonts` path to `file://` (using dolphin via `kdesu`). The file displays better, but now many system fonts seem to display either in bold or italic, but rarely they the way they used to. What did I screw up and how can I revert this?


title: How to pipe text for a Mutt email body, then edit the email interactively?

text: I've been trying to figure out how to start Mutt in such a way that it's just like starting up an interactive Mutt and creating a new email, then copying the output of `git request-pull` into the body (to be able to edit it manually). `git request-pull HEAD https://... | mutt -i- invalid@example.org` doesn't work - It just exits with exit code 0 and no message at all, and I'm not even sure if anything was sent, because there's no copy of the email in the standard sent folder.


title: How to split the terminal into more than one "view"?

text: From `vi`, if you issue the command `:sp`, the screen splits into two "views", allowing you to edit more than one file from the same terminal. Along those same lines, is there a way to have multiple shells open in the same terminal?


title: Disable a monitor from multi head

text: I have a multi head config. I wish do disable one of the screen from cli. My multi head is configure as a one virtual monitor and the monitors shows the segments of it. Xrandr --off messes up the this layout. Is there a way to disable a screen and keep the xrandr config of the screen? Edit: lack of information


title: Open terminal from emacs

text: Is there a fast way (keyboard shortcut) to open a terminal emulator (in my case urxvt) in the _same directory_ as the file in the current emacs buffer?


title: ext4 flags to specify "extents" mode?

text: I've formatted a new filesystem with and without `extents` feature just to understand how this feature works. However, when I look at the inode field `i_flags` I see that this field always has zero value (for "used" inodes 2, 7 and 11). Documentation (from Kernel.org) about extents says, that this flag should have 0x80000 bit set for inodes which use extents - but it looks like it's not accurate. Can I have inodes with and without extents in the same filesystem? Should I rely on the `i_flags` to determine the way, how the `i_block` field is used? Or it is just one filesystem-wide flag in the superblock which dictates extents usage for all inodes?


title: Mounting /dev/sda3 but /etc/fstab not found?

text: I am currently trying to install Arch Linux and have run into a multitude of problems but my latest has really stumped me. I am currently trying to mount /dev/sda3 using the command:               $ mount /dev/sda3       When I execute above command, output says `there is no /etc/fstab.` I attempted to do `genfstab -p /mnt >> /mnt/etc/fstab` Output says: `no such file or directory: /mnt/etc/fstab.` What do you believe I did wrong?


title: Can't ping broadcast

text: We're running four computers connected to a hub (yes a hub not a switch) on Fedora 13. They were installed using images from a colleague that has recently left us to go back to school, they may have been set to somehow block the use of the broadcast, but we'd like to continue using this image. We've setup the static IPs for each computer using ifconfig (we've also tried ip addr add) to 10.0.1.11/24 through 10.0.1.14/24, using these settings we can't seem to ping the broadcast which is indeed set correctly to 10.0.1.255, using tcpdump we see nothing except outgoing ping requests from the computer that calls the ping request. Does anyone have any ideas or am I missing something entirely?


title: MAC Address changes after dirty shutdown

text: I'm having a strange issue which I originally thought was tied to the fact that I created an Ubuntu system from an image of another. However, after reinstalling Ubuntu from scratch I am getting the same behaviour. Basically whenever there is a dirty shutdown (power gets yanked) the MAC address gets set to a new value, and the `/etc/network/interfaces` gets updated with the new address and an incremented `ethX`. This is causing all kinds of problems and I really have no idea why this is happening. I've set up many systems just like this one and never had this happen. I'm running Ubuntu 12.04 32 bit with all updates installed. Any thoughts?


title: Chromium CPU usage 100%

text: If I visit loungefm in Chromium, my CPU usage goes up to 106%. If I start the player, it goes down to 50-60%. The output of Chromium if I start it via a terminal is: > ATTENTION: default value of option force_s3tc_enable overridden by > environment. What could cause that problem? I'm on Arch-Linux, Laptop is a Thinkpad T420s


title: Is there a standards-specified location for user configuration files?

text: I'm talking about files like `~/.foo` found on a user's home dir. I'm working on a program that reads from such a file, and I'd also like to clean up my user root directory if I can. Is there a POSIX-specified variable, such as `~/$(conf)` where config like `.emacs` can be found?


title: What Linux distro is best to be used as a media server for remotely storing and accessing movies and music on a network

text: I have a spare computer laying around and about 10TBs of movies and music on various hard drives. I have my self and 4 other people in my home. I am interested in setting up some form of file/media server with this spare PC that everyone in the house and on the LAN can access. My goal is to set up the pc so that anyone on the network can access the files on the PC. Either move files to the PC, from the PC, or stream movies directly from the PC. I am not new to linux but also not a Linux expert. Should I use a normal linux distro or a Linux server? What is the most efficient way to do this? Also I'd like for the interface to be user friendly as some of the people on the network are not familiar with linux. Also all other PCs on the network are windows machines.


title: Different routing for each address on an interface

text: I know I can add several IP addresses to an interface **without** using interface aliases (ex.: eth0:0). **My question** : but how can I create different routing decisions for the different IP addresses on one interface? Can someone provide a small example for this? UPDATE: IP addresses that I got:               $ ip -6 addr show     31: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000         inet6 2001:XXXX::16:3eff:fe76:13c6/64 scope global dynamic            valid_lft 85692sec preferred_lft 13692sec         inet6 2001:XXXX::XXXX:XXXX/64 scope global            valid_lft forever preferred_lft forever         inet6 fe80::216:3eff:fe76:13c6/64 scope link            valid_lft forever preferred_lft forever      **So I got a static IP (2001:XXXX::XXXX:XXXX/64) and a dinamically assigned (2001:XXXX::16:3eff:fe76:13c6/64).** The routing:               $ ip -6 route     2001:XXXX::/64 dev eth0  proto kernel  metric 256     fe80::/64 dev eth0  proto kernel  metric 256     default via fe80::XXXX:XXff:feXX:XXXX dev eth0  proto ra  metric 1024  expires 423sec      Outside the host I tried to ping the dinamic IP. I got ping replies. I tried to ping the static IP, I didn't got replies. ps.: "default via fe80::XXXX:XXff:feXX:XXXX" -> the "fe80::XXXX:XXff:feXX:XXXX" is the IP address of the IPv6 router.


title: Supply additional ssh options in config file

text: How can I supply additional options in .ssh/config? I know that information like Host, Port, User etc. may be used in the ssh-configuration file to abbreviate ssh commands. I frequently create ssh-tunnels using the options "-Nf" to fork to the background. Is it possible to provide such options within the configuration file as well, and how?


title: Edit apt.conf in Debian 7.1 for Intel 64 bit

text: Question: Does an end user need to edit `apt.conf`, if it does not exist? If so, how does one express the following fields in an Intel 64 bit architecture?               Architecture       Architectures         as shown in the example at: `/usr/share/doc/apt/examples/apt.conf`. In the computer science i386 corresponds to Intel 32 bit. What does amd64 correspond to? Do the Debian developers just use amd64 designation? And have the code further in do a, if else to probe deeper for hardware id?


title: Ubuntu12.04/KDE4 - Panel issue Switching between 4 and 2 monitor workstations

text: Overview: The environment I work in currently has two different style of workstations. The first is a 4 monitor setup and the second is a two monitor setup. Both are running Ubuntu 12.04 with KDE4. The user accounts are accessible between workstations via LDAP/Kerberos/NFS. Issue: The issue is that when a worker goes from a 4 monitor workstation to a 2 monitor workstation and then back to a 4 monitor workstation, all the panels are now overlapped and need to be dragged back into place. This also affects some applications if they configure them to load on the 3rd monitor, but then sit on a 2 monitor workstation, they can't get the application due to it being told to load on the 3rd. (hope this makes sense). Question: I'm wondering if there is an easy, non-scripted, solution to this issue. I know I can do fancy stuff like use different .kde4 directories based off the workstation they log into, or write a script to move things around when they log in (or click on a button). But I'm looking for an easy supportable solution. PS: I have seen other posts similar to this issue, but slightly different, with no resolution. These posts are also older, so I'm hoping that something has come along since then.


title: kernel: disabling /dev/kmem and /dev/mem

text: I understand that `/dev/kmem` and `/dev/mem` provide access to the memory (i.e. raw RAM) of the system. I am also aware, that `/dev/kmem` can be completely disabled in kernel and that access can be restricted for `/dev/mem`. It seems to me, having raw access to memory can be useful for developers and hackers, but why should I need access to memory through `/dev/mem`. AFAIK it cannot be disabled in kernel (unlike `/dev/kmem`). Having access to raw memory that can be potentially abused/exploited seems to me to be just asking for trouble. Is there some practical use for it? Do any user programs require it to work properly?


title: 4G hostless modem and rndis_host problem

text: I'm trying to connect 4G modem Quanta 1k6e to my wl500g router with OpenWRT BARRIER BREAKER (14.07-rc2, r41815), but I have a trouble. When I attach device in log happen:               Thu Aug 14 21:58:06 2014 kern.info kernel: [  161.580000] usb 2-2: new full-speed USB device number 5 using uhci_hcd     Thu Aug 14 21:58:07 2014 kern.info kernel: [  161.800000] rndis_host 2-2:1.0 eth1: register 'rndis_host' at usb-0000:00:03.0-2, RNDIS device, 00:16:36:9c:4f:b5      00:16:36:9c:4f:b5 - I get this mac on Windows machine, where my modem works fine. Next in log:               Thu Aug 14 21:58:07 2014 daemon.notice netifd: Interface 'cdc' is enabled     Thu Aug 14 21:58:07 2014 kern.info kernel: [  161.850000] usb-storage 2-2:1.2: USB Mass Storage device detected     Thu Aug 14 21:58:07 2014 kern.info kernel: [  161.850000] scsi5 : usb-storage 2-2:1.2     Thu Aug 14 21:58:07 2014 daemon.notice netifd: Network device 'eth1' link is up     Thu Aug 14 21:58:07 2014 daemon.notice netifd: Interface 'cdc' has link connectivity     Thu Aug 14 21:58:07 2014 daemon.notice netifd: Interface 'cdc' is setting up now     Thu Aug 14 21:58:07 2014 kern.info kernel: [  162.040000] usb 2-2: USB disconnect, device number 5     Thu Aug 14 21:58:07 2014 kern.info kernel: [  162.040000] rndis_host 2-2:1.0 eth1: unregister 'rndis_host' usb-0000:00:03.0-2, RNDIS device     Thu Aug 14 21:58:07 2014 daemon.notice netifd: Network device 'eth1' link is down     Thu Aug 14 21:58:07 2014 daemon.notice netifd: Interface 'cdc' has link connectivity loss     Thu Aug 14 21:58:07 2014 kern.info kernel: [  162.390000] usb 2-2: new full-speed USB device number 6 using uhci_hcd     Thu Aug 14 21:58:07 2014 daemon.notice netifd: Interface 'cdc' is now down     Thu Aug 14 21:58:07 2014 kern.info kernel: [  162.620000] cdc_ether 2-2:1.0 eth1: register 'cdc_ether' at usb-0000:00:03.0-2, CDC Ethernet Device, 00:16:36:51:54:57     Thu Aug 14 21:58:07 2014 daemon.notice netifd: Interface 'cdc' is disabled     Thu Aug 14 21:58:07 2014 kern.info kernel: [  162.650000] usb-storage 2-2:1.2: USB Mass Storage device detected     Thu Aug 14 21:58:07 2014 daemon.notice netifd: Interface 'cdc' is enabled     Thu Aug 14 21:58:07 2014 daemon.notice netifd: Network device 'eth1' link is up     Thu Aug 14 21:58:07 2014 kern.info kernel: [  162.660000] scsi6 : usb-storage 2-2:1.2     Thu Aug 14 21:58:07 2014 daemon.notice netifd: Interface 'cdc' has link connectivity     Thu Aug 14 21:58:07 2014 daemon.notice netifd: Interface 'cdc' is setting up now     Thu Aug 14 21:58:07 2014 daemon.notice netifd: Network device 'eth1' link is down     Thu Aug 14 21:58:07 2014 daemon.notice netifd: Interface 'cdc' has link connectivity loss     Thu Aug 14 21:58:08 2014 daemon.notice netifd: cdc (1614): udhcpc (v1.22.1) started     Thu Aug 14 21:58:08 2014 kern.notice kernel: [  163.730000] scsi 6:0:0:0: Direct-Access     Virtual  Mass-Storage     0000 PQ: 0 ANSI: 2     Thu Aug 14 21:58:09 2014 kern.notice kernel: [  163.800000] sd 6:0:0:0: Attached scsi generic sg2 type 0     Thu Aug 14 21:58:09 2014 kern.notice kernel: [  163.850000] sd 6:0:0:0: [sdb] Attached SCSI removable disk     Thu Aug 14 21:58:09 2014 daemon.notice netifd: cdc (1614): Sending discover...     Thu Aug 14 21:58:12 2014 daemon.notice netifd: cdc (1614): Sending discover...     Thu Aug 14 21:58:15 2014 daemon.notice netifd: cdc (1614): Sending discover...      After that I get cdc interface, but without assigned ip address. Even if I assign ip manually (192.168.225.38 - which one assign at windows machine) 192.168.225.1 (which assigned at WEB UI of modem as address of modem) doesn't reply. I tried to successfully unbind cdc_ether (echo -n 2-2:1.0 > /sys/bus/usb/drivers/cdc_ether/unbind) :               T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  6 Spd=12   MxCh= 0     D:  Ver= 2.00 Cls=02(comm.) Sub=06 Prot=00 MxPS=64 #Cfgs=  1     P:  Vendor=0408 ProdID=ea45 Rev= 0.00     S:  Manufacturer=QUANTA     S:  Product=Mobile Broadband     S:  SerialNumber=357264046968757     C:* #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=500mA     I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=(none)     E:  Ad=83(I) Atr=03(Int.) MxPS=  16 Ivl=32ms     I:* If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=(none)     I:  If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=(none)     E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms     E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms     I:* If#= 2 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage     E:  Ad=82(I) Atr=02(Bulk) MxPS=   8 Ivl=0ms     E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms      But when I try to bind rndis_host driver ( echo -n 2-2:1.0 > /sys/bus/usb/drivers/rndis_host/b ind ), I get an error: write error: No such device Help me please to solve my problem.


title: How does the colon sign and dollar question mark combine in sh?

text: The "colon sign" and the "dollar question mark" can be combined to check if a `sh` script does have an argument and assigns it directly to a variable of interest:               cmd=${1:? "Usage: $0 {build|upload|log}"}      Can someone explain step for step how this works, and where I can find the details on its implementation? For example I would like to be able to call a function instead of printing to `stderr`.               help() {       echo $"Usage: $0 {build|upload|log}"       exit 1     }     cmd=${1:? help}      Why is this not possible?


title: Multiple Linux or Unix Distributions, Same Home Partition or Data?

text: To avoid conflicts I have always installed multiple Linux and Unix distributions each with it's own home partion or directory, and in the era of 3TB hard drives this is often very practical; I also do make heavy use of virtualization on some of my machines. I even use version control with Git to synchronize certain important documents and programming projects across multiple machines, however this is still not the most efficient way to do things, moreover I am still occasionally hunting for data across machines and distributions that I know I saved on one of them. How do I set up multiple Linux (and occasionally more traditional Unix such as BSD or Solaris) distributions with a single home partion or if problematic with a single "data" partition? I do realize that various distributions often plant config files and "dot" files in your home directory, and occasionally other directories and there occasionally will be conflicts between them. Is it possible to create links to my data on a separate partition. Presumably these would be symbolic links since I don't believe I can create hard links across partitions. What about directory hard links which I know some filesystems support but I know very little about them? If I do save my data in a single "data" partition, which I presumably will be regularly backing up, how do I make sure that the links in the various distributions are regularly updated to reflect the new material saved? Any suggestions or schemes that people find practical and workable are welcome.


title: Setting fbcon to use a specfic frame buffer device

text: I am trying to display the output from and SDL based application on to a framebuffer device /dev/fb1. Fb1 is associated with a SM750 based card. When I run my application, the output always appears on fb0 (which overwrites the ubuntu desktop whilst running.) I know that fb1 is active, when I type in the following               sudo fbset -fb /dev/fb1 640x480-60      The display connected to the corresponding port is activated. To run my application I have used the following command line:               SDL_FBDEV=/dev/fb1 SDL_VIDEODRIVER=xxx sudo ./SDLTimeOutput      Where xxx is directfb, fbcon, or svgalib. I have tried all 3, and get the same result each time. Could some one please advise me on how I can set my application to display on fb1 rather than fb0. Andrew


title: How do I get pkg_add to look in the correct directory on the remote ftp repository when installing vim?

text: I have a brand new clean installation of FreeBSD 9.1 on Virtualbox. Running `pkg_add -r -v vim`, the terminal runs an ftp script to: `ftp://ftp.freebsd.org/pub/FreeBSD/pub/i386/packages-9.1-release/Latest/vim.tbz` and gets `No such file or directory` That makes sense, considering that if you navigate to `ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/` there is no 9.1 releases folder. Other answers online seem to point you to your `PACKAGEROOT` environment variable, but those generally only point to the server, and I'm not having trouble accessing the server. I've also tried to build Vim from the source that came with the installation in `/usr/ports/editors/` but after two hours of compiling, it ended up failing.


title: Endless data loop from dev/ttyUSB while sending AT commands

text: I have problem sending AT commands to my USB modem. At first I tried php- serial class, but when i was reading data, I got endless loop with strange data. Then I tried to debug problem and opened putty terminal, made command               cat /dev/ttyUSB0      and then sent command `echo "AT" > /dev/ttyUSB0` after that I always got never ending loop from `cat /dev/ttyUSB0` like this:               AT     AT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^      and this loop never ends. On windows all works just fine. I can connect to USB modem via virtual COM port and send command / get answer. Question is why cant I just receive "OK" message from console, but instead of this I got this data loop? Tried different huawei USB modems, and different stty settings and also default settings for huawei modems:               Baud rate: 9600 / 115200     Parity: none     Data bits = 8     Stop bits = 1     Flow control = none               test dev # uname -a     Linux test 3.5.7-gentoo #3 SMP Sun Feb 17 04:58:22 EET 2013 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 5200+ AuthenticAMD GNU/Linux      **EDIT:** compiled newer kernel: 3.6.11-gentoo and now when sending command:               echo "AT" > /dev/ttyUSB0      got result like:               OK     AT     OK     AT     OK     AT      it never ended, I terminated cat command, then sent other ( make call command ):               echo "ATDT 27789388;" > /dev/ttyUSB0      and got answer from cat without loop.               systest ~ # cat /dev/ttyUSB0     ATDT 27789388;               OK      so why tty terminal is acting so strange ? maybe I don't know something about sending/reading data on serial ports ? **EDIT2** if it can help then output of stty -a -F /dev/ttyUSB0 command is:               speed 9600 baud; rows 0; columns 0; line = 0;     intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;     -parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts     -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8     opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0     isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke      bump.


title: Linux mint 17 cinnamon freezes after installing nvidia drivers?

text: I Have **Linux Mint 17 Cinnamon** installed in my Laptop. I Have **Nvidia** **GForce** **610M** Graphic. After installing Nvidia Drivers my Linux 17 Frequently Freezes Lot of Time. Every time it Freezes , I must Press `CTRL`+`ALT`+`F1` and must do: > sudo service mdm restart To Work Again. Any suggestion to solve these Frequent Freezing problem ?


title: Running Darktable under Xfce using specific color style/theme

text: I tried running Darktable (version 1.0.4-1~bpo60+1 from Debian Squeeze- backports) under Xfce, but I am using a fairly light "Style" theme in Xfce which Darktable didn't work too well with. It seems to do some magic to set specific colors in GTK/GNOME dialogs (the file open dialog for "import" being one example), and the two clash resulting in nearly unreadable file listings. When I switched to a darker theme (I tried `Xfce-dusk`, but others worked similarly well), the colors aligned and usage was much smoother. However, I'd rather not switch to a dark color theme just for this one application, and I don't see any obvious way of switching Darktable to a lighter color theme. I did find mention of the `GTK2_RC_FILES` environment variable (set it to the full path to a `gtkrc`), which seems to work for e.g. gedit (`GTK2_RC_FILES=/usr/share/themes/HighContrastLargePrintInverse/gtk-2.0/gtkrc gedit` works quite nicely and only affects that instance) but it does not seem to have any effect for Darktable. Since changing the global theme _does_ work, there's obviously some way to make this work. So **what other magic is needed?**


title: Stuck at Grub command line after boot repair

text: After updating Windows 8 to Windows 8.1 I lost access to Grub and my Linux Partition (running Elementary OS) so I tried using boot repair from a Live USB and now I can't access either. It drops me out at some grub command line which I don't know what to do with. All I was wanting was the usual menu of OS's to boot into. First time round I didn't rename the Windows efi file and when that didn't work I tried renaming it but to no avail. The outputs from the boot repair are here: "not renamed" and here: "renamed" but I don't know what any of it means. Even if I can just get Windows back I'd be happy but both would be fantastic.


title: Debian, nonroot, cron, bash script and rebooting at specific time

text: As nonroot user, how can I schedule a reboot every day at 4:30am? 30 04 * * * /home/user/scripts/reboot.sh As a nonroot normal user, I'm sure the system won't allow me to use the reboot command. What settings do I need to change in Debian order to make this scheduled reboot work? (without asking for sudo password)


title: How can I set up Apache to use port 1 and other ports below 80?

text: The mysql user cannot use ports below 1024 because these are reserved for the root user. Apache, on the other hand, can use port 80. Apache runs as root before it runs as Apache and thus it can use port 80. It can even listen to port 81 and any other port. However, when I tried to get Apache to listen on port 79, it did not work. I tried to listen on port 1 too, and that did not work either. When I change the Apache settings, Apache restarts just fine, but it doesn’t actually work on the web. Can I use port 1 on the web?


title: Directory sync with automatic peer discovery

text: I'm working with a cluster of Linux servers sitting behind the Amazon cloud autoscaling feature (documentation). There are files that accumulate on each server, they are cache files for the application. I am searching for an automated way to have the servers sync that folder amongst themselves.   * `Rsync` would work if someone had a clever way to do peer detection.   * Same goes for `Unison`.   * We have also considered using a SaaS such as Dropbox.   * Gluster seems like overkill, and I'm not sure how easy it is to have a new computer auto-join the cluster. Ideally what would happen is when a new server is launched, it discovers it's peers and begins syncing the folder. From that point on it's a latest filestamp wins P2P synchronization. Anything out there that does this?


title: How to examine POST request over HTTPS?

text: I'm trying to automate access to a website via scraping, and I'm trying to determine what parameters are being sent to the server in a POST request. I've currently got Wireshark open, but is there a better way to do this? Will I be able to see my POST request in plaintext, since the connection is HTTPS?


title: KDE CIFS mount. Can copy files with mc but dolphin won't

text: I have a samba/cifs mount that is accessible r/w from the commandline (mc). The KDE filemanager dolphin shows the content of the samba share, but gives me a "no space left on device" when I try to copy files on it. The mount line in /etc/fstab contains the uid and gid ( uid=1000,gid=100 ). Could this be the problem. Any ideas? thanks!


title: Where do files go when the rm command is issued?

text: Recently I accidentally did `rm` on a set of files and it got me thinking where exactly these files end up? That is to say, when working with a GUI, deleted files go to the Trash. What's the equivalent for `rm` and is there a way of undoing an `rm` command?


title: Change chkconfig used by Centos 6.3 to print "on" in bright green (like Ubuntu's chkconfig)?

text: `chkconfig` on Ubuntu will highlight services that are **on** in green when using list mode. http://i.stack.imgur.com/Jx1jW.png This does not occur on CentOS 6.3. I'd like that highlighting on the CentOS `chkconfig`. Does anyone know how to do that? ### Man entry on Ubuntu describing green highlighting               root@console:~# man chkconfig | grep -C 2 "green"      > LIST MODE > > List mode prints for each specified service a line that consists of the > service name and for runlevels zero to six on or off depending if the > service will be started or not. on will be printed in bright green if the > output is written to a terminal. If the --deps option is given, the names of > the services that must be started before this service is appended to each > line. The inetd/xinetd services are listed in extra sections. ### Centos 6.3 chkconfig package info               [root@centos:/]$ rpm -qa | grep "chkconfig"     chkconfig-1.3.49.3-2.el6.x86_64      ### Debian chkconfig package info               root@ubuntu:~# dpkg -s chkconfig     Package: chkconfig     Status: install ok installed     Priority: optional     Section: admin     Installed-Size: 68     Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>     Architecture: all     Version: 11.0-79.1-2     Depends: perl     Recommends: insserv


title: Archlinux & openbox - greyish win 95 applications

text: I have just installed Archlinux & openbox but i have to say i am a bit dissapointed that the applications have this dull greyish (win 95) look: ![enter image description here](http://i.stack.imgur.com/w5RUu.jpg) On the picture there are two programs open which are `gedit` and `gcalc` which they both use GTK themes. I fixed those to look better by installing `lxappearance` and setting Adwaita theme. The calculator now looks way better while gedit doesn't: ![enter image description here](http://i.stack.imgur.com/y4oBo.jpg) I mean they both use GTK themes. Why don't both look better? * * * Then there is another side to this topic. I am using `Kile` and this one uses QT theme. How can i make it look like a real QT application - like the ones on KDE desktop? If this is impossible how can i at least make it look like a GTK app? It looks dull atm: ![enter image description here](http://i.stack.imgur.com/7LnaV.png) * * * **EDIT 1** After applying the solution my Archlinux with openbox desktop manager looks like this: ![enter image description here](http://i.stack.imgur.com/QYC5o.png) **EDIT 2** The only problem I've had with the look of applications from this point on was with the propietary software like VLC and Eagle. Look of the first one can be corrected by opening VLC and in /tools/perefferences/interface choosing GTK+. I haven't found the solution for the later one yet...


title: Unix: How to Test Ip Address is resolved to name

text: Unix: How to Test ip Address is resolved to name. I need to check whether ip address can be resolved to name using DNS entry via shell script. Code:               DNS_Lookup()     {             LOOKUP=$(nslookup $1)             FAIL_COUNT=$(echo $LOOKUP | grep "** server can't find " | wc -l);             if [ $FAIL_COUNT -eq 1 ];then                 echo "Unable to resolve DNS for $1"              else                 echo "IP:$1 DNS Name:$(echo $LOOKUP | grep -v nameserver | cut -f 2 | grep name | cut -f 2 -d "=" | sed 's/ //')"                  return 0             fi     }           DNS_Lookup 192.168.27.191      The above code is not working in all possible cases. OS:CentOS


title: Does time window still exist when the signal is not blocked

text: Many books say that a time window exists between the generation and delivery of the signal when the signal is not blocked. So I wonder whether the time window still exists when the signal is not blocked or the generation and delivery of the signal are a atomic operation? If the time window still exists, what will happen when some other sigals (same or not the same to the signal geneated) are also generated during the time window?


title: Booting Linux (Mint 17) on MacBook Pro when OSX doesn't work– pretty weird

text: Hardware: 15" MacBook Pro 8,2 (early 2011) with 2 HDD (no optical drive) and broken AMD GPU – which is the reason for using Linux Mint because it handles the Intel GPU better without missing the AMD. The laptop had a SSD in the former optical drive bay. I switched it for an HDD which now has Linux Mint installed on it. Data is on the other HDD (HFS+J formatted) Installation of Linux Mint: I used the image (linuxmint-17-qiana-64bit- mbp-8.2.iso) and NetBootIn to prepare a USB flash drive I then installed Mint on the new HDD When booting with alt key pressed the new system doesn't show Now Magic happens: When I boot with the Linux Live USB drive Grub boots fine showing ONLY the mint live cd on the drive. I then go to grub command line mode. At the command I enter "exit". Now I'm back in the Grub GUI. BUT: this time it's the list with the systems on the HDD Linux Mint and an old boot part of OSX that was left on the other drive. How can I get it to boot directly from the HDD without the weird jump start by flash drive? I know about rEFIt and rEFInd but got scared about the instructions installing it on Apple hardware within Linux. Because due to the broken GPU, OSX is only bootable in single user mode.


title: Bash tab completion stop searching

text: When I am typing into bash and I press the "tab" key to auto complete, sometimes it takes a significant time. E.g., file IO to read directories takes >5 seconds, and thus I am hung waiting for IO to complete before I can continue typing. I get frustrated and Ctrl-C so that I can redo what I was typing. Ctrl-C is unfortunate, since I must retype everything again. How can I tell bash to stop trying to fulfill my auto complete request.               $ /long/path/to/some/d     # once I've typed this, I press <TAB>. I now will be                                # stuck waiting for perhaps 10 seconds. The only thing I                                # know to do is Ctrl-C. When I press Ctrl-C, I am forced                                # to retype the original command string.     $


title: rootfs.jffs2 files system won't fit in mtd3

text: I have a files system that I am trying to put in flash memory mtd3 partition. I first boot using uboot and then do `run sdboot` to boot using SD card as shown below:               U-Boot-PetaLinux>     U-Boot-PetaLinux> printenv mtdparts     mtdparts=mtdparts=0:5M(boot),128K(bootenv),10752K(image),4M(spare)     U-Boot-PetaLinux>run sdboot      Now I have a running linux system.               .     .     .     .     root@Xilinx-ZC702-14_7:/mnt/flashboot# nandwrite -p /dev/mtd3 rootfs.jffs2     Image 3513340 bytes, NAND page 1 bytes, OOB area 0 bytes, device size 393216 bytes     nandwrite: error!: Input file does not fit into device                error 0 (Success)     nandwrite: error!: Data was only partially written due to error                error 0 (Success)      So why it shows: > nandwrite: error!: Input file does not fit into device You can see my environmental variables in first line, I have given sufficient space of 4MB, so why an image of size 3513340 bytes (3.35 MB) won't fit in a device ? And from where this > device size 393216 bytes coming? **Additional info**               #cat /proc/cmdline     console=ttyPS0,115200      **mtdinfo:**               Count of MTD devices:           4     Present MTD devices:            mtd0, mtd1, mtd2, mtd3     Sysfs interface supported:      yes      **partitions**               root@Xilinx-ZC702-14_7:/# cat /proc/mtd     dev: size erasesize name     mtd0: 00500000 00010000 "boot"     mtd1: 00020000 00010000 "bootenv"     mtd2: 00a80000 00010000 "image"     mtd3: 00060000 00010000 "spare"      also it can be seen that:               root@Xilinx-ZC702-14_7:/mnt/flash# mtdinfo /dev/mtd0     mtd0     Name:                           boot     Type:                           nor     Eraseblock size:                65536 bytes, 64.0 KiB     Amount of eraseblocks:          80 (5242880 bytes, 5.0 MiB)     Minimum input/output unit size: 1 byte     Sub-page size:                  1 byte     Character device major/minor:   90:0     Bad blocks are allowed:         false     Device is writable:             true          root@Xilinx-ZC702-14_7:/mnt/flash# mtdinfo /dev/mtd1     mtd1     Name:                           bootenv     Type:                           nor     Eraseblock size:                65536 bytes, 64.0 KiB     Amount of eraseblocks:          2 (131072 bytes, 128.0 KiB)     Minimum input/output unit size: 1 byte     Sub-page size:                  1 byte     Character device major/minor:   90:2     Bad blocks are allowed:         false     Device is writable:             true          root@Xilinx-ZC702-14_7:/mnt/flash# mtdinfo /dev/mtd2     mtd2     Name:                           image     Type:                           nor     Eraseblock size:                65536 bytes, 64.0 KiB     Amount of eraseblocks:          168 (11010048 bytes, 10.5 MiB)     Minimum input/output unit size: 1 byte     Sub-page size:                  1 byte     Character device major/minor:   90:4     Bad blocks are allowed:         false     Device is writable:             true          root@Xilinx-ZC702-14_7:/mnt/flash# mtdinfo /dev/mtd3     mtd3     Name:                           spare     Type:                           nor     Eraseblock size:                65536 bytes, 64.0 KiB     Amount of eraseblocks:          6 (393216 bytes, 384.0 KiB)     Minimum input/output unit size: 1 byte     Sub-page size:                  1 byte     Character device major/minor:   90:6     Bad blocks are allowed:         false     Device is writable:             true      **System** petalinux running on ARM cortex A9 http://www.wiki.xilinx.com/Linux https://github.com/Xilinx **Device Tree** http://git.yoctoproject.org/cgit/cgit.cgi/meta- xilinx/plain/conf/machine/boards/zedboard/zedboard-zynq7-board.dtsi **Partition in Configuration Tool** This is the tool for configuration I use prior to building image.ub. See the size of jffs2 which is greater than the actual size of rootfs.jffs2 file. ![enter image description here](http://i.stack.imgur.com/AGijB.png) **/sys/class/mtd**               root@Xilinx-ZC702-14_7:/sys/class/mtd# ls -ld *     lrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd0 -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd0     lrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd0ro -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd0ro     lrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd1 -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd1     lrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd1ro -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd1ro     lrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd2 -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd2     lrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd2ro -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd2ro     lrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd3 -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd3     lrwxrwxrwx    1 root     root             0 Jan  1 00:00 mtd3ro -> ../../devices/amba.0/e000d000.ps7-qspi/spi_master/spi32766/spi32766.0/mtd/mtd3ro     root@Xilinx-ZC702-14_7:/sys/class/mtd#      **Drivers**               root@Xilinx-ZC702-14_7:~# ls /sys/bus/*/drivers          /sys/bus/amba/drivers:          /sys/bus/clocksource/drivers:          /sys/bus/cpu/drivers:          /sys/bus/hid/drivers:     hid-generic          /sys/bus/i2c/drivers:     at24     dummy    pca954x          /sys/bus/mdio_bus/drivers:     Generic PHY          /sys/bus/mmc/drivers:     mmcblk          /sys/bus/platform/drivers:     alarmtimer       vexpress-sysreg  xilinx-gpio      xusbps-dr     of-flash         xadcps           xilinx_emaclite  xusbps-ehci     physmap-flash    xdevcfg          xqspips          xusbps-otg     sdhci-zynq       xemacps          xslcr            xusbps-udc     uio_pdrv_genirq  xgpiops          xsmcps           xwdtps     vexpress-reset   xi2cps           xuartps          zynq_remoteproc          /sys/bus/rpmsg/drivers:     rpmsg_proto          rpmsg_server_sample          /sys/bus/scsi/drivers:     ch    osst  sd    sr    st          /sys/bus/sdio/drivers:          /sys/bus/serio/drivers:          /sys/bus/spi/drivers:     m25p80          /sys/bus/usb/drivers:     hub          usb          usb-storage  usbfs        usbhid          /sys/bus/virtio/drivers:     virtio_rpmsg_bus     root@Xilinx-ZC702-14_7:~#      **mmc drivers**               root@Xilinx-ZC702-14_7:/# cd /sys/bus/mmc/drivers/mmcblk/     root@Xilinx-ZC702-14_7:/sys/bus/mmc/drivers/mmcblk# ls     bind       mmc0:1234  uevent     unbind     root@Xilinx-ZC702-14_7:/sys/bus/mmc/drivers/mmcblk# cd mmc0\:1234/     root@Xilinx-ZC702-14_7:/sys/devices/amba.0/e0100000.ps7-sdio/mmc_host/mmc0/mmc0:1234# ls     cid                   hwrev                 scr     csd                   manfid                serial     date                  name                  subsystem     driver                oemid                 type     erase_size            power                 uevent     fwr      **Solution** I solved it by using configuration tool , and by making the following selections which were unslected earlier.               File systems  --->      -*- Native language support  --->         <*>   Codepage 437 (United States, Canada)         ...         <*>   NLS ISO 8859-1  (Latin 1; Western European Languages)         ...


title: C# project not building. Error says mono is not configured correctly. On a rhel 6.5 Workstation

text: I'm using Eclipse, and I installed the emonic plugin for C# and the .net. When it autobuilds a project I get this error:               BUILD FAILED          Mono 3.5 Profile (mono-3.5) is not installed, or not correctly configured.          Framework directory '/usr/lib64/pkgconfig/../../lib/mono/3.5' does not exist.      Also the "build all" and "build project" buttons a greyed out. > mono --version output:               Mono JIT compiler version 2.10.8 (tarball Tue Mar 18 23:26:30 GMT 2014)     Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com     TLS:           __thread     SIGSEGV:       altstack     Notifications: epoll     Architecture:  amd64     Disabled:      none     Misc:          softdebug      LLVM:          supported, not enabled.     GC:            Included Boehm (with typed GC and Parallel Mark)      ls /usr/lib/mono               output:          gac                      gtk-sharp-2.0             rsvg2-sharp-2.0     gnomedesktop-sharp-2.20  gtksourceview2-sharp-2.0  vte-sharp-0.16     gnome-print-sharp-2.18   mono-addins                     ls /usr/local/lib/mono     2.0  4.0         gac                        monodoc  xbuild-frameworks     3.5  compat-2.0  mono-configuration-crypto  xbuild


title: Real time processes scheduling in Linux

text: I have been learning some scheduling concepts. Currently my understanding so far is as below.   * There are real time processes and non real time processes.   * Non real time processes can have `nice` values for their priority in the range of **-20** to **+20**. The higher positive value indicates that the process has lower priority.   * The real time processes will have a niceness value listed as `-` as explained in this answer here. This is mainly because the real time processes have higher priorities than the non real time processes and niceness value do not apply to them.    * Now, I can use `chrt` to see the real time attributes of a process.  For a real time process, the `chrt` gives output as,               chrt -p 5     pid 5's current scheduling policy: SCHED_FIFO     pid 5's current scheduling priority: 99      As we can see for process _5_ , the priority is 99 which is the highest. Also, the scheduling policy is `SCHED_FIFO` Now, for a non real time process, the `chrt` gives output as,               chrt -p 22383     pid 22383's current scheduling policy: SCHED_OTHER     pid 22383's current scheduling priority: 0      As we can see for process _22383_ , the priority is 0 and the scheduling policy is `SCHED_OTHER`. **Questions**   1. Is it possible for me to make any process as real time process?   2. Is it possible for me to set some other scheduling algorithm other than `SCHED_OTHER` for a non real time process?   3. From here, I also see that I could modify the attribute for a running process as,              chrt -p prio pid      Also, I see `chrt -m` gives me the list of scheduling algorithms. The command gives me the output as,              SCHED_OTHER min/max priority    : 0/0     SCHED_FIFO min/max priority     : 1/99     SCHED_RR min/max priority       : 1/99     SCHED_BATCH min/max priority    : 0/0     SCHED_IDLE min/max priority     : 0/0      Now, as suggested above, if I set `chrt -p 55 22383` which algorithm will be used?


title: Too many levels of symbolic links

text: I created this file structure:               test/src     test/firefox      When I run this command:               ln -s test/src test/firefox      I would expect a symbolic link `test/firefox/src` to be created pointing to `test/src`, however I get this error instead:               -bash: cd: src: Too many levels of symbolic links        * What am I doing wrong?   * Can you not create a symbolic link to one folder which is stored in a sibling of that folder?   * What's the point of this?


title: Why does "tail -f ... | tail" fail to produce any output?

text: Why does the following command not produce any output?               $ tail -f /etc/passwd | tail      After reading about buffering, I tried the following to no avail:               $ tail -f /etc/passwd | stdbuf -oL tail      Note that the following does produce output:               $ tail /etc/passwd | tail      So does this:               $ tail -f /etc/passwd | head      I am using tail version 8.21 (GNU coreutils).


title: Will purging GNOME remove gedit?

text: If I remove the GNOME desktop environment from my Debian 7 installation, will that also remove additional applications like gedit or will they remain installed and usable?


title: Intel Centrino Wirelsess-N 1030 not getting connected on generic mode in ubuntu 14.04

text: I upgraded Ubuntu from 12.04 to 14.04. After upgrading neither WLAN and ethernet work and also does not work in recovery mode (enable networking) or root shell. When booting the previous version from boot menu, the Ubuntu version is again 14.04. But the wireless and LAN works (show SSID) but does not get connected no matter. For a wireless to get connected I have to go to recovery mode of previous version and then go to recovery mode (enable networking). But then the desktop graphics are all stretched. I tried millions of command as suggested from other site for my wireless network but nothing worked for me. Truly speaking I do not really know about any command line. Aren't there any methods to make changes from recovery mode (with connected network) that take effect in generic mode? As I can't run apt-get command from generic mode.


title: How do you track memory usage in a ksh93 script

text: We have a number of ksh scripts that run forever (inside a while loop), or at least until a shutdown event is delivered to them. We had a project where these scripts where converted to ksh93 (and functionality was added) and the O/S was upgraded from AIX 5.3 to 6.1. The ksh scripts ran without issue on AIX 5.1. Now that we've converted to ksh93, AIX 6.1, and added functionality, we're finding the memory of the processes continues to grow until it has exceeded its limit. We've had to add logic to kill and restart the processes when they reach a memory threshold. We're assuming, maybe incorrectly, that there's a memory leak in some ksh93 function. I'm trying to determine if there's a particular function that's not releasing memory. To get process memory I've been using `svmon -P $$ | grep $$ | awk '{ print $3 }'`. Maybe there's a better way to do that. Here's the output of the svmon command at various points in the script. I've added an "End-Of-Loop" to show the bottom of the outer 'while' loop. You'll notice that memory use keeps climbing, except for the occasional reading where is back down to near the starting value. I'm guessing these low values are erroneous because the very next reading after the low value seems to follow the reading just before the low value. If you remove the low values, the memory usage continues to climb. This script is a watchdog script which checks on the existence of our other processes. The scripts for our other processes exhibit the same type of behaviour. Is there a better way to determine memory use? Is anyone aware of common ksh93 functions that don't release memory properly? IBM suggested we upgrade to AIX 7.x but that's not a possibility at this time. I should warn you now. I'm a DBA, not a ksh script developer.               28721        Start-Of-Loop        28435   <--- low value       28733        28737        28740        28745        28747        28435   <--- low value        28755        28759        28762        28767        28770        28774        28777        28780        28783        28787        28791        28806        28809        28813        28817        28822        28825        28828        28831        28833        28835        28835        28838        28839        28843        28843        28843        28435   <--- low value        28843        28843        28846        28846        28847        28408   <--- low value        28853        28853        28853        28408   <--- low value       28854        28854        28857        28857        28859        28860        28863        28863        28864        28865        28867        28869        28871        28874        28878        28878        28879        28879        28882        28882        28883        28884        28887        28888        28891        28891        28435   <--- low value       28894        28897        28898        28901        28436   <--- low value       28904        28904        28906        28906        28910        28910        28914        28407   <--- low value       28917        28435   <--- low value       28921        28923        28927        28927        28930        28436   <--- low value       28935        28935        28935        28938        28942        28942        28435   <--- low value       28946        28948        28950        28953        28953        28953        28953        28953        28953        28957        28957        28958        28958        28959        28959        28961        28962        28965        28408   <--- low value       28966        28966        28967        28968        28970        28971        28974        28974        28975        28975        28976        28976        28408   <--- low value       28978        28978        End-Of-Loop       28436   <--- low value       28982        28982        28983        28408   <--- low value       28984        28984        28985        28440   <--- low value       28989        28990        28436   <--- low value       28991        28991        28991        28991        28991        28994        28995        28995        28995        28995        28997        29001        29004        29008        28435   <--- low value       29008        29008        28408   <--- low value       29011        29011        29011        29015        29015        29019        29019        29019        29019        29020        28435   <--- low value       29025        29026        29028        29030        29033        29033        28435   <--- low value       29035        29039        28436   <--- low value       29039        29039        29041        29043        28408   <--- low value       29047        29050        29050        29052        29052        29055        29055        29057        29057        29058        28408   <--- low value       29061        29062        29067        29067        29068        28408   <--- low value       29069        29070        29075        28408   <--- low value       29076        29076        29076        28408   <--- low value       28408   <--- low value       28435   <--- low value       29080        29083        28408   <--- low value       29087        29089        29089        29092        29094        28430   <--- low value       29097        29100        29101        29103        28408   <--- low value       29103        29103        29104        29104        28435   <--- low value       29107        28408   <--- low value       29111        29113        29114        29117        29117        29120        29120        29122        29122        29124        29124        29127        29127        29129        29129        28408   <--- low value       29134        29135        29135        29135        29135        29139        29139        29139        29139        28440   <--- low value       29139        28435   <--- low value       28408   <--- low value       29139        End-Of-Loop       29141        29145        29145        29147        28435   <--- low value       29150        29150        29153        29153        29155        29157        29157        29157        29157        29157        29159        29159        29159        29159        29163        29163        29167        29169        29172        29172        29175        29175        29177        29177        29177        29179        28435   <--- low value       29181        29186        29186        29189        29189        29191        29193        29196        29196        29198        29198        29199        29200        29202        29202        29205        29205        28435   <--- low value       29209        29211        28435   <--- low value       29216        29217        29220        28435   <--- low value       29225        29225        28433   <--- low value       29227        28433   <--- low value       29229        29230        29231        29233        29233        29235        29237        29238        29239        29244        29247        29250        29252        29258        29260        29263        29264        29268        29269        29271        29271        29274        29274        28435   <--- low value       28408   <--- low value       29283        29286        29287        29291        29291        29295        29295        29295        29299        29303        29303        29306        29306        29308        29310        29312        28440   <--- low value       29312        29312        29317        29318        29322        29322        29323        29323        28408   <--- low value       28407   <--- low value       29327        29327        29329        29329        28435   <--- low value       29329        29330        29331        28437   <--- low value       29333        29336        29336        29336        29336        29336        29336        29336        29336        29336        End-Of-Loop       29338        29342        29343        29343        29345        29347        28435   <--- low value       28435   <--- low value       29349        29349        29351        29353        29353        29354        29354        29354        29354        29354        28436   <--- low value       28408   <--- low value       29356        29357        29357        29361        29361        28435   <--- low value       29361        29363        29363        29366        29367        29373        28408   <--- low value       29376        29376        29380        28407   <--- low value       28435   <--- low value       29381        28440   <--- low value       29387        29387        29390        29394        29394        28436   <--- low value       29396        29398        29399        29401        29401        29402        29402        29403        29404        29406        28436   <--- low value       29411        28408   <--- low value       29417        29417        29418        29419        29421        29421        29423        29424        29426        29426        28408   <--- low value       29431        29435        29435        28435   <--- low value       29439        29442        29444        28435   <--- low value       29447        29449        29449        29451        29451        29455        29455        28435   <--- low value       29458        29461        29462        29465        29467        28408   <--- low value       29470        29473        29475        29478        29479        29483        29483        29485        29485        29488        29488        29489        29489        29489        29489        29491        29492        29493        29493        29495        29497        29501        29503        29504        29504        29506        29508        29509        29511        29515        29515        29519        29519        28436   <--- low value       29521        28408   <--- low value       29522        29523        28435   <--- low value       29523        29523        29523        End-Of-Loop


title: Have rights during shell but not in a script (unless I sudo it)

text: I have a really basic confusion. How does `sudo` work? I noticed that when I ran a script it failed, since it tried to write a file in a directory that the following permissions:               $ ls -l thedir     drwxr--r-- usr grp      But when I run the script as `sudo -u usr` it worked. If I am able to do run the script successfully with sudo, why did the script fail in the first place? I mean if I have enough rights to run as that user I should be able to run the script succesully in the first place, I guess.


title: Samba shares - Cannot access with users

text: I have installed a Samba server on Ubuntu Server 12.04 so I can store files there from my desktop or laptop or whatever. `/etc/samba/smb.conf`:               #======================= Global Settings =====================================     [global]     workgroup = WORKGROUP     server string = Samba Server %v     netbios name = xxx     security = user     map to guest = bad user     dns proxy = no          #============================ Share Definitions ==============================     [Public]     path = xxx     browsable = yes     writable = yes     guest ok = yes     read only = no     create mask = 0660     directory mode = 0770          [Jochem]     path = xxx     browsable = yes     writable = yes     guest ok = no     valid users = jochem     read only = no     create mask = 0660     directory mode = 0770      I added a user: `sudo adduser jochem`, `sudo addgroup smbgrp`, `sudo adduser jochem smbgrp`, `sudo smbpasswd -a jochem` Then restarted the service: `sudo service smbd restart`. When I open Windows Explorer and go to `\\xxx\` I can see 2 folders: `Public` and `Jochem`. I can access `Public` without any problem, can write files to it, read, etc. Then when I want to access `Jochem`, I get this window: ![credentials window](http://i.stack.imgur.com/9tXi9.png) I then fill in my username and password as entered via `smbpasswd -a jochem`, but then I get an error message. What is wrong here? I think it might be because I am logging in via my PC's domain `JOCHEM-PC`, but I've tried `xxx\jochem` and it doesn't work either.. Any ideas?


title: LFTP: Mirror to remote except particular file present on remote

text: I usually edit my website locally and push it with this command:               lftp -u user,password host -e "mirror -c -e -R -x ^\.git/$ my /my; exit"      But now, my website dynamically appends data to the `/my/data` file. I don't have this `/my/data` file locally. **QUESTION:** How to push without deleting `/my/data` and its content? Notes:   * I could download `/my/data` and then run the command above, but data added in the few seconds before the download and the upload would get lost.   * For the other files/folders, local deletion should be mirrored by a remote deletion.   * I don't want to use `--only-newer`-like operations because clocks might not be adjusted.


title: Is there a way to print to a preset location for print-to-file?

text: I would like to add a "printer" under Linux that would automatically print-to- file to a specific folder and default to PDF. The idea being that I could one- click-print documents for printing later in the day when I had access to a printer. File names don't matter in this case. Is this possible to do? I am willing to write some code to make this happen.


title: Always getting "not a symbolic link" message, while installing any package

text: When I am installing any package in my centos 6.0 system, by yum or rpm, I always getting `/sbin/ldconfig: /usr/lib64/libreadXMLnew.so.1 is not a symbolic link` message. There is never a problem in installation, but what is a need of softlink for this file, which I have manually copied? Is there any problem to the system with this?   The files I have copied was:               [root@localhost Downloads]# ls -l /usr/lib64/libreadXMLnew*     -rwxr-xr-x. 1 root root 291414 Mar  5 16:31 /usr/lib64/libreadXMLnew.so.1     -rwxrwxr-x. 1 root root 291414 Mar  5 15:28 /usr/lib64/libreadXMLnew.so.1.0     [root@localhost Downloads]#


title: Anyway to save Boot Prompt PassPhrase in local file for fedora20

text: fedora20 is installed with harddrive encrypted. it is installed by the kickstart file. but it is still asking for Pass Phrase before booting. Is there anyway that pass phrase can be saved in local pc, so we do not have to enter ourself. it will be just booted and ready. thanks.


title: How to disable the boot log daemon by editing the init script?

text: I understand that boot log daemon (see this question Starting Bootlog daemon: bootlogd is a part of the init script. But I don't know how to edit this script to disable this daemon. Can some one explain the complete procedure to disable it? **Update** Unfortunately in my linux flavour (petalinux running on arm cortexA 9 based zynq chip) I could not find the file /etc/default.bootlogd:               root@Xilinx-ZC702-14_7:/etc# grep -r "BOOTLOGD_ENABLE" *     init.d/stop-bootlogd:case "$BOOTLOGD_ENABLE" in     init.d/bootlogd:case "$BOOTLOGD_ENABLE" in     rc2.d/S99stop-bootlogd:case "$BOOTLOGD_ENABLE" in     rc3.d/S99stop-bootlogd:case "$BOOTLOGD_ENABLE" in     rc4.d/S99stop-bootlogd:case "$BOOTLOGD_ENABLE" in     rc5.d/S99stop-bootlogd:case "$BOOTLOGD_ENABLE" in     rcS.d/S07bootlogd:case "$BOOTLOGD_ENABLE" in      Now I am unable to understand where should I make change? Here is the out put of **vi init.d/bootlogd**               ! /bin/sh     #     # bootlogd      One of the first scripts to be executed. Starts or stops     #               the bootlogd log program. If this script is called as     #               "stop-bootlogd", it will stop the daemon instead of     #               starting it even when called with the "start" argument.     #     # Version:      @(#)bootlogd  2.85-12  21-Mar-2004  miquels@cistron.nl     #          PATH=/sbin:/bin:/usr/sbin:/usr/bin     DAEMON=/sbin/bootlogd     NAME=bootlogd     DESC="Bootlog daemon"          test -f $DAEMON || exit 0          [ -r /etc/default/bootlogd ] && . /etc/default/bootlogd          ## set -e # not needed     case "$BOOTLOGD_ENABLE" in             [Nn]*)                     exit 0                     ;;     esac          STOPPER=     ACTION="$1"     case "$0" in             *stop-bootlog*)                     STOPPER=Y                     if [ "$ACTION" = start ]                     then                             ACTION=stop                     fi                     ;;     esac          case "$ACTION" in             start)                     echo -n "Starting $DESC: "                     if [ -d /proc/1/. ]                     then                             umask 027                             start-stop-daemon --start --quiet \                                     --exec $DAEMON -- -r                     else                             $DAEMON -r                     fi                     echo "$NAME."                     ;;             stop)                     echo -n "Stopping $DESC: "                     start-stop-daemon --stop --quiet --exec $DAEMON          if [ "$STOPPER" ] && [ -f /var/log/boot ] && \                        [ -f /var/log/boot~ ]                     then                             cd /var/log                             chgrp adm boot                             savelog -p -c 5 boot > /dev/null 2>&1                             mv boot.0 boot                             mv boot~ boot.0                     fi                          echo "$NAME."                     ;;              restart|force-reload)                     echo -n "Restarting $DESC: "                     start-stop-daemon --stop --quiet --exec $DAEMON                     sleep 1                     start-stop-daemon --start --quiet --exec $DAEMON                     echo "$NAME."                     ;;             *)                     N=${0##*/}      N=${N#[SK]??}                     echo "Usage: $N {start|stop|restart|force-reload}" >&2                     exit 1                     ;;     esac          exit 0


title: Get power consumption of a USB device

text: Is there a way to check how much power a USB device requires? _Why do I need this?_ I need to connect an LTE USB stick to my Raspberry pi, and don't know how much power it needs. We got it quite easily on Windows, but haven't found a way to do it on Linux.