title: dialog or zenity?

text: I am working on a project. I have two options for the GUI part. Either use **dialog** or **zenity**. I never used any of these tools before. I have to learn one of them. Suggest me which one should I learn and which will be more beneficial to learn? Which one is old and which one is new? Which one will you prefer?


title: Red Hat cannot boot after clone with dd

text: I used `dd` to clone a x4100 server with Linux Red Hat. The hardware is identical for old and new servers. Disks are `sda`, `sdb` and `sdc`(`sdc1` and `sdc2`). But newly restored server gives following errors and Linux can only be started in maintenance mode (read-only):               Red Hat nash version is starting:     shpchp: shpc_init: cannot reserve MMIO region.     shpchp: shpc_init: cannot reserve MMIO region.     shpchp: shpc_init: cannot reserve MMIO region.     shpchp: shpc_init: cannot reserve MMIO region.     Reading all physical volumes. This may take a while     (...)     /boot: ext3 recovery flag is clear but journal has data.     /boot: Run journal anyway         /boot: Unexpected inconsistency RUN fsck manually.      What might be the reason? Did I miss something during backup/restore? How can I fix the new system?


title: Compiling sample SFML program problems

text: I'm trying to compile the first sample program that comes with sfml on Fedora. First it told me that I needed to link all of the libraries properly but then I got it all configured and now I'm stuck on this error:               [jdorsey@fedora-josh sfml_test]$ g++ test.o -o test-app -lsfml-graphics -lsfml-window -lsfml-system     /usr/bin/ld: warning: libGLEW.so.1.5, needed by /usr/local/lib/libsfmlgraphics.so, not found (try using -rpath or -rpath-link)     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniform1fARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_shader_objects'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGetObjectParameterivARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_vertex_shader'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewFramebufferTexture2DEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniformMatrix4fvARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGenFramebuffersEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniform3fARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewRenderbufferStorageEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_fragment_shader'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewActiveTextureARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewShaderSourceARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `glewInit'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewBindFramebufferEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewFramebufferRenderbufferEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewLinkProgramARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUseProgramObjectARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewBlendFuncSeparateEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGenRenderbuffersEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniform2fARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniform4fARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewCreateProgramObjectARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `glewGetErrorString'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewCompileShaderARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewDeleteRenderbuffersEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewDeleteObjectARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGetUniformLocationARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGetInfoLogARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_EXT_blend_func_separate'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewDeleteFramebuffersEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewCheckFramebufferStatusEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewUniform1iARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_texture_non_power_of_two'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_shading_language_100'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewCreateShaderObjectARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewBindRenderbufferEXT'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__GLEW_EXT_framebuffer_object'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewAttachObjectARB'     /usr/local/lib/libsfml-graphics.so: undefined reference to `__glewGetHandleARB'     collect2: error: ld returned 1 exit status      I've got all of the glew libraries and include files in the include and lib folders in /usr/local, and I made sure to grab version 1.5, but it just isn't working. I tried adding a config file in ld.so.conf.d but I'm not sure if I'm doing everything right. The main pieces of information that I need are: Am I doing something wrong? Will adding a conf file and doing ldconfig help? How can I fix this? I ran into another question about this but none of the fixes there worked for mine.


title: RPM dependencies with localinstall

text: I need to install an rpm package on a system which has no internet access. So, let's say I already have needed dependencies. How do I install them only by running the main `rpm` package? Do they need to be in same directory as main rpm?


title: Why do I need GRUB_DISABLE_LINUX_UUID=true

text: I just switched from lilo to grub2 and my first attempt failed with `kernel panic - not syncing vfs unable to mount root fs on unknown block(0 0)`. It turned out that the problem was that the root partition was specified in terms of a UUID instead of a device name. The solution was to uncomment `GRUB_DISABLE_LINUX_UUID=true` in `/etc/default/grub`. The original auto-generated `/boot/grub/grub.conf` contained some UUID entries and some /dev entries.   * How does update-grub choose between UUID and /dev rootfs, i.e. why is it sometimes a UUID and sometimes not?   * What keeps UUIDs from working? I didn't find a kernel parameter which could be set wrongly (kernel 3.8.2)   * Do I need UUIDs in my fstab when grub uses UUIDs?


title: Is there a way to get apt-get to install from different distributions in one single command?

text: I'm building a package from source in Debian Wheezy, which has a few build- deps that cannot be satisfied by stable. Therefore, I use a few packages from unstable, testing and wheezy-backports. The best way to do these until now has been to combine the commands using "&&" and using the "-y" switch, like this:               apt-get -y -t testing install pkg1 && apt-get -y -t wheezy-backports install pkg2 && apt-get -y install pkg3      But this still makes apt-get read the package list and check for dependencies for every apt-get separated with "&&". My build-machine is quite slow, and every step takes a lot of time, and I hoped I could shave of a few minutes by saving the redundant package-list reading and dependency checking and get apt- get to do it all at once, something like this:               apt-get -t testing install pkg1, -t wheezy-backports install pkg2, install pkg3          I haven't been able to find anything about the topic, and am not too optimistic, but maybe someone knows a way?


title: Shell, bash, linux : after variable declaration, why semi-colon and what does it do?

text: Here is the line.                   variable=`ls -A $1 | grep '[abc]'; ls -1 $1`      I understand the line before the semi-colon but I do not understand how this line works after semi-colon. Does it                 after the command(variable assignment)        and then run the command after semi-colon?      Then the following line would be same?                   variable=`ls -A $1 | grep '[abc]' | ls -1 $1`      Thanks,


title: targeting a specific block with e2fsck to shorten wait

text: Recently had a LVM'd CentOS 6.5 install get accidentally cold-shutdown. On bootup, it says that the home partition need fscking:               /dev/mapper/vg_myserver-lv_home: Block bitmap for group 3072 is not in group.  (block 3335668205)          /dev/mapper/vg_myserver-lv_home: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.      ...but I guess the root partition is OK, since it gives me a shell there. So we run `e2fsck -b 32768 /dev/mapper/vg_myserver/lv_home` and after saying Yes to various fixes, on Pass 5 it just prints endless numbers to the screen, very fast. Once in a while it will print them in neat columns, and if these are block numbers, after a couple hours we are still nowhere near the first 2% being done of our 1.2 TB LV. I read that you can use `cleap_mmp` with `tune2fs`, but upon trying that, it doesn't accept cleap_mmp nor list it among valid options. My question is, how does everyone deal with a corrupt ext4 fs without weeks of downtime? Does everyone have this dilemma, or weeks of downtime vs rebuilding your server / lost data? If so why does anyone use or recommend the use of ext4? Is there some trick I'm missing that would **let me target the specific block/group it's complaining about** , so we can get on with it and mount the home fs again?


title: How shadow a file to point to something else?

text: **Case:**   * VirtualBox doesn't support Windows' symlink to be shared with host (Linux).   * actually a physical folder which contains the link is share. Everything except the symlink can be accessed.   * Have a symlink in that folder is currently the easiest for my purpose (describing the situation is not feasible). Other options are too length and chances of error are high.   * when the VB shared folder is mounted (`sudo mount -t vboxsf foo /home/apache/foo -o rw`) the symlink (`bar`) it contains is listed but it's content can't be viewed. `file /home/apache/foo/bar` returns an error saying something like > /home/apache/foo/bar: broken symbolic link to `X:\foo\bar' > > ## > > What I can do is VB share the link to which `bar` links to and mount it at > say `~/mounts/bar`. **Question:** How can I shadow `~/foo/bar` so that it actually acts as a proxy to `~/mounts/bar`? In essence shadowing `~/foo/bar`. That way if the host (Windows) shares `foo` on it's network, it's clients will be able to access the content of `foo/bar` and the host VB machine would indirectly read/write to `~/mounts/bar` while pointing at `~/foo/bar`. Actually the application expects one base data directory not multiple.


title: What C library version does my system use?

text: How can I tell for sure what userland C library my system uses? Possible reasons to need this information include:   * There's a gigantic source package I am considering downloading which I'm sure will do proper checks and lists a mininum library version, but I'd rather save myself a potential hassle by checking first if it will work.   * I am concerned about ABI compatibility with some third party binaries I want to try and install outside the system's package management system.   * I have a source package who's documentation mentions the need for a minimum version of my system's library, but the build process does not perform any checks.   * I am building a cross-compiler targeting a specific system and do not want to risk forward compatibility problems.


title: Environment auto-install script

text: When I work, I often have to switch computers or virtual machines which means that every time I switch, I have to set up my (Linux) environment again. Is there a tool (in contrast to a simple bash script) that I could use, that would automatically set up my environment? The setup would consist of installing Debian packages, importing `.bash_profile` (aliases, functions), environment variables, add lines/fill-in config files, etc...


title: Script ends abruptly with a Terminated message

text: This is my bash script. All it does is to check whether a service has started and whether some processes are running as expected. It ends abruptly with a Terminated message. I tried debugging it with the `set -x` flag, and I still dont know what is going wrong. SO and Google dont show me any other people with a similar problem. The script has permissions of 755. Some commands are obfuscated, for obvious reasons.               #!/bin/bash          set -x           DAEMON_BIN=/etc/init.d/init-god     DAEMON_BIN_START="${DAEMON_BIN} start"     DAEMON_BIN_STOP="${DAEMON_BIN} stop"     SOME_VARIABLE="foo"          CHEF_CONFIG_FILE_PATH="/path/to/file"     NODE_INFO_FILE="/mnt/node_info/properties"          function get_key_value (){         value=$(grep -Po "(?<=^${1}:).*" ${NODE_INFO_FILE})         echo $value;     }          eval $DAEMON_BIN_STOP          nohup pkill DAEMON &> /dev/null          nohup pkill -f resque &> /dev/null          eval $DAEMON_BIN_START          sleep 15          PROCESS_COUNT=`ps aux | awk '/[p]rocess-name/' | wc -l`          NODE_NAME=`get_key_value node_name`          if [[ $NODE_NAME -eq $SOME_VARIABLE  && $PROCESS_COUNT -eq 1 ]]; then          echo "DAEMON and scheduler are running fine." ;     else         echo "A problem with DAEMON has occured." ;     fi          EXPECTED_PROCESS_COUNT=`get_key_value no_of_workers`     ACTUAL_WORKER_COUNT=`ps ax | grep [r]esque-[0-9]`          if [[ $EXPECTED_PROCESS_COUNT -eq $ACTUAL_WORKER_COUNT ]]; then          echo "Correct Number of workers initialized." ;     else         echo "More workers exist than are permitted." ;     fi          for (( i=0; i<${EXPECTED_PROCESS_COUNT}; i++ )); do         WORKER_NAME=`get_key_value worker_${i}`         COUNT=`ps ax | grep ${WORKER_NAME} | grep -v grep | wc -l`         if [[ $COUNT -eq 1 ]]; then             #statements             echo "${WORKER_NAME} is running."         else             echo "${WORKER_NAME} may not be running or might have more than 1 copies."         fi     done      The debug output of the script is as follows:               + DAEMON_BIN=/etc/init.d/init-god     + DAEMON_BIN_START='/etc/init.d/init-god start'     + DAEMON_BIN_STOP='/etc/init.d/init-god stop'     + SOME_VARIABLE=foo     + CHEF_CONFIG_FILE_PATH=/path/to/file     + NODE_INFO_FILE=/mnt/node_info/properties     + eval /etc/init.d/init-god stop     ++ /etc/init.d/init-god stop     .     Stopped all watches     Stopped god     + nohup pkill DAEMON     + nohup pkill -f resque     Terminated      Why does this script exit with a Terminated message? What should I do to prevent this from happening?


title: KMS Terminal: How to disable second screen, or how to force a certaion resolution?

text: I have two screens with different native resolution connected to my Gentoo/systemd machine. since the VTs try to mirror the outputs, they do not use the whole size of the higher resolution screen. I never use virtual terminals on the lower resolution screen, so I'd like to have them use the whole high resolution monitor. If I disable the lower resolution screen with the video kernel command line parameter, I cannot switch it on in X11, since the kernel thinks the output is not connected. Nevertheless, on X11 I want to be able to enable the second monitor whenever I need it. Is there an option on the kernel command line, in systemd, or somewhere I can't think of at them moment, to disable the virtual terminals on one output, to have different virtual terminals on different outputs (kind of multiseat), to force the vts to use the whole size of one connected screen, or to disable an output on virtual terminals in such a way that xrandr can reenable it?


title: How to use filename arguments or default to stdin, stdout (brief)

text: I want to handle filenames as arguments in a bash script in a cleaner, more flexible way, taking 0, 1, or 2 arguments for input and output filenames.   * when args = 0, read from stdin, write to stdout   * when args = 1, read from $1, write to stdout   * when args = 2, read from $1, write to $2 _**How can I make the bash script version cleaner, shorter?_** Here is what I have now, which works, but is not clean,               #!/bin/bash     if [ $# -eq 0 ] ; then #echo "args 0"         fgrep -v "stuff"     elif [ $# -eq 1 ] ; then #echo "args 1"         f1=${1:-"null"}         if [ ! -f $f1 ]; then echo "file $f1 dne"; exit 1; fi         fgrep -v "stuff" $f1      elif [ $# -eq 2 ]; then #echo "args 2"         f1=${1:-"null"}         if [ ! -f $f1 ]; then echo "file $f1 dne"; exit 1; fi         f2=${2:-"null"}         fgrep -v "stuff" $f1 > $f2     fi      The perl version is cleaner,               #!/bin/env perl     use strict;      use warnings;     my $f1=$ARGV[0]||"-";     my $f2=$ARGV[1]||"-";     my ($fh, $ofh);     open($fh,"<$f1") or die "file $f1 failed";     open($ofh,">$f2") or die "file $f2 failed";     while(<$fh>) { if( !($_ =~ /stuff/) ) { print $ofh "$_"; } }


title: $1 means for .... ? without any input?

text: I have one program that starts with this line. What does this mean? I am having trouble googling because of the dollar sign. How come $1 without any parameters? And what does it mean by -d here?                 if [ -d $1 ]; then      And does semi-colon come even if the if-condition does not even start? I thought semi-colon comes only at the end of statement or at the end of condition like                  if () {  };


title: What is the use of "&>>" in bash?

text: I was studying a bash script code where I encountered operator "&>>". I didn't understand its use. So, I referred to http://www.gnu.org/software/bash/manual/html_node/Redirections.html . It is semantically equivalent to `>> file 2>&1` . Following is the output from my shell :-               # echo $SHELL     /bin/bash     # echo "hello" &>> file1     bash: syntax error near unexpected token `>'      and               # echo "hello" >> file1 2>&1          # cat file1           hello      Question :- Why am I getting error `bash: syntax error near unexpected token '>'` ? **[EDIT]** :- Bash version 3.2.25(1)-release (x86_64-redhat-linux-gnu)


title: Running GUI application as another (non-root) user

text: Let's say I have 2 user accounts `user1` and `user2`. When I login as `user1`, and then switch to `user2` using `su`, I can execute command-line programs, but GUI programs fail. Example:               user1@laptop:~$ su - user2     user2@laptop:~$ leafpad ~/somefile.txt     No protocol specified     leafpad: Cannot open display:       So how can I run a GUI application?


title: How use `rsync -R` with multiple subdirs or install -D with multiple files?

text: Is possible with `rsync` to copy multiple files from a source directory to a dest directory with multiple subdirectories that don't exist? Or use `install -D` with multiples files to a directory that doesn't exist? Also I looked at `cp --parents` but used the name of the source directory. Is it possible that `cp` can select a destination directory that doesn't exist and copy all files to it after it makes it? I have this question: Copy a file to a directory that doesn't exist with only one command (Linux) Merge with: How can I copy a file and create the target directories at the same time? But the solutions for copying one file, I looking at something like:               cp /etc/*.conf ~/mytest/       where mytest doesn't exist and `/etc/*.conf` is more than one file. Is it possible with `cp` and with only one command is better?


title: How to remove text matching specific patterns from a file

text: I want to compare two files to check for differences between them, fileA and fileB. fileA is like a template file and fileB is the file which I want to compare to it. Anytime I find a difference I want to output that difference to fileC. The difficulty is that fileA and fileB contain certain (not all) lines which have some data which will always be different - time, date and a randomnly generated id code. However, I do not want to output lines to fileC where the only difference is time, date and id code. So what I would like to do is to remove the time, date and id code from any lines where they occur in fileB (I can do this manually in fileA) and then do a comparison against fileB, outputting the different lines to fileC. Note that the text to remove always follows specific patterns. So I can find the text using grep with those patterns, but I don't know how to remove it... Here is an example of the two files to show what I mean:   * fileB              qaqa rara     abc 10:12:25 08/20/2014 123456 def     ghi fff ddd     jkl 09:20:40 08/20/2014 978645 dfdf gggg        * fileA              qaqa rara     abc 10:32:15 07/15/2014 121456 xxx     ghi eee ddd     jkl 10:01:22 07/15/2014 971645 dfdf gggg      I want to find the difference between the above two files, disregarding the time (e.g 10:12:25), date (e.g. 08/20/2014) or id code (e.g. 123456) and output the differences to fileC The two lines which are different, therefore are lines 2 and 3. Line 1 is the same for both files. Line 4 is the same for both files when the time, date and id info has been removed.


title: Dual boot install (Windows after Linux)

text: Most of the faqs/how-to for dual booting assume windows is installed with 'nix being installed in unpartitioned space. I need to go the other way, i have wheezy installed and need to install xp, so, i'm going to resize a partion, format fat, install windows, and then ...? does windows install over-write the MBR? Can that be fixed (Back to grub) I guess I don't mind reinstalling wheezy after installing xp, but that seems like a sledgehammer references/thoughts?


title: Unable to force passphraseless ssh authentication while port forwarding

text: I'm completely at a loss as to what is preventing my local machine from authenticating the connection that is being forwarded from the remote server. I've read a ton of the posts on here regarding this and man, I swear I've tried damn near everything. The guide I've been following can be found here: http://www.zeespencer.com/articles/building-a-remote-pairing-setup/ Basically where I'm stuck at is in forcing passwordless authentication. If I allow passwords in sshd_config, when I connect to pair@pair-server I am prompted for my local user password and am able to login remotely, so I am being forwarded. But, as soon as I turn it off, I get the following                  λ   ssh pair@pair-server      Permission denied (publickey).     Connection to pair-server closed.      Verbose output here: https://gist.github.com/anonymous/0c2b3892596d5ded6abb I currently have my local user key.pub in pair@pair-server's .ssh/authorized_keys which are command directed to ssh back to localhost. pair@pair-server has it's own key, on my computer I've added pair@pair- server's key.pub to .ssh/authorized_keys. Seemingly relevant lines in sshd_config:               RSAAuthentication yes     PubkeyAuthentication yes     AuthorizedKeysFile  %h/.ssh/authorized_keys     PermitEmptyPasswords no     PasswordAuthentication no     UseLogin no      account and session settings in /etc/pam.d/sshd on pair-server:               account    required     pam_nologin.so     account    include      password-auth     # pam_selinux.so close should be the first session rule     session    required     pam_selinux.so close     session    required     pam_loginuid.so     # pam_selinux.so open should only be followed by sessions to be executed in the user context     session    required     pam_selinux.so open env_params     session    optional     pam_keyinit.so force revoke     session    include      password-auth      password-auth configuration:               #%PAM-1.0     # This file is auto-generated.     # User changes will be destroyed the next time authconfig is run.     auth        required      pam_env.so     auth        sufficient    pam_unix.so nullok try_first_pass     auth        requisite     pam_succeed_if.so uid >= 500 quiet     auth        required      pam_deny.so          account     required      pam_unix.so     account     sufficient    pam_localuser.so     account     sufficient    pam_succeed_if.so uid < 500 quiet     account     required      pam_permit.so          password    requisite     pam_cracklib.so try_first_pass retry=3 type=     password    sufficient    pam_unix.so sha512 shadow nullok try_first_pass use_authtok     password    required      pam_deny.so          session     optional      pam_keyinit.so revoke     session     required      pam_limits.so     session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid     session     required      pam_unix.so      .ssh permissions:               node-v0.8.25|ruby-1.9.3-p392|~|        λ   ls -lhd .ssh     drwx------ 2 dan dan 4.0K Jul 10 19:49 .ssh      OS:                  λ   lsb_release -a     No LSB modules are available.     Distributor ID: Ubuntu     Description:    Ubuntu 13.04     Release:    13.04     Codename:   raring      OpenSSH Client Version:                  λ   ssh -V     OpenSSH_6.1p1 Debian-4, OpenSSL 1.0.1c 10 May 2012


title: Which distribution is usually chosen in an enterprise environment - Debian or RHEL (CentOS)?

text: I would like to apologize for the (slightly) off-topic and non-technical question, but I recently started to emerge myself into the wonderful world of Linux, and started studying some distributions in depth, the last of which, was **Debian**. So my question is (to those who could enlighten me): **_Which distribution is usually preferred and why?_** _I know that each distribution has its own merits and strengths, and would not like to see this be turned into a flamewar, for any possible reason. The answers I am expecting regard under what circumstances might one select one against the other, or what was the "killer" feature for users that chose one distribution instead of another distribution._


title: Is there such a scheduler and is it feasible?

text: I read about a scheduling algorithm called EDD which always works on the next deadline and that is feasible. Would it also be feasible to within each time windows or slice, work on all processor or all of a set of processor so that it is guaranteed that all of the processos have gotten some work within some certain time winfowd? And would that be a feasible scheduler?


title: Permission denied when Ubuntu is attempting to mount to a remote Windows share folder

text: Fellow guys, I encountered the error when I's mounting my Ubuntu server to a remote Windows share folder, the following is the error on terminal after I typed command line 'mount -a':               mount error(13): Permission denied     Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)      The version of our Ubuntu server is Ubuntu 12.04.2 LTS, and the following is my /etc/fstab config:               //192.168.1.100/Development_Server /mnt/Development_Server cifs credentials=/home/developer/.smbcredentials,iocharset=utf8,sec=ntlm 0 0      And .smbcredentials is of:               username=Developer     password=password      Actually I was following offical document from https://wiki.ubuntu.com/MountWindowsSharesPermanently to do this. I don't know how to fix it. What permission do I lack of?


title: How can I create cron jobs in specific files?

text: I want to have a separate folders for `cron` jobs like: `/mydata/cronjobs` Now in that folder I want to have files like `backup_server` which will have the content like:               30 3 * * 1-5 /home/user/scripts/backup.sh      30 3 * * 1-5 /home/user/scripts/backup2.sh       Similarly, I want to have more files in that directory for each separate `cron` job so that I can centralize and separate the `cron` jobs from one folder. How can I make root run those jobs for all files in that folder?


title: How do I run Gnome from a systemd-nspawn container in a second X server?

text: I'm using systemd-nspawn to "boot" a second Linux OS from a USB hard disk. I'd like to launch that OS's Gnome Desktop in a second X server running on the same machine on a different tty than the Desktop that is already running on tty1. e.g. I have Gnome on tty1 running on the host machine. I'd like to launch the USB drive's KDE desktop in tty2 (in a 2nd X server I'm assuming). It seems possible somehow. How can it be done?


title: Why I got a strange result for fdisk -l

text: root@host [~]# fdisk -l          Disk /dev/sdc: 128.0 GB, 128035676160 bytes     255 heads, 63 sectors/track, 15566 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x2444c1ab             Device Boot      Start         End      Blocks   Id  System     /dev/sdc1               1       15566   125033863+  83  Linux          Disk /dev/sdb: 300.1 GB, 300069052416 bytes     255 heads, 63 sectors/track, 36481 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00063841             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1               1       36481   293033601   83  Linux          Disk /dev/sda: 256.1 GB, 256060514304 bytes     255 heads, 63 sectors/track, 31130 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x0004af28             Device Boot      Start         End      Blocks   Id  System     /dev/sda1               1       31130   250051693+  83  Linux          Disk /dev/sdd: 128.0 GB, 128035676160 bytes     255 heads, 63 sectors/track, 15566 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0xc33adbf6             Device Boot      Start         End      Blocks   Id  System     /dev/sdd1   *           1          14      103424   83  Linux     Partition 1 does not end on cylinder boundary.     /dev/sdd2              14         536     4194304   82  Linux swap / Solaris     Partition 2 does not end on cylinder boundary.     /dev/sdd3             536       15567   120735744   83  Linux          Disk /dev/md127: 128.0 GB, 128033553408 bytes     2 heads, 4 sectors/track, 31258191 cylinders     Units = cylinders of 8 * 512 = 4096 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x27dd27dc      what is /dev/md127? I usually have /dev/sda, /dev/sdb, etc. What is /dev/md127? Also why /dev/sdc is listed first?


title: Cannot execute binary file on Mac OS X Lion 10.7.5

text: I want to execute phylocon on a mac OS X lion but after changing the path and making the file executable, I get the error 'cannot execute binary file'. But the steps that I took to running the command worked fine on ubuntu 12.04 which is why i am confused. command: PhyloCon-v3.linux http://stormo.wustl.edu/PhyloCon/ Can someone please tell me how to fix this?


title: How to consistently start Vim's command line to make a mapping work in any mode?

text: I try to normalize access to Vim's command line mode from any other mode in order to simplify my actual mappings. For example to make the `<f6>` key work from anywhere I define the following mappings:               noremap <script> <unique> <silent> <f6> <sid>:echomsg 'Hello World!'<cr>     noremap! <script> <unique> <silent> <f6> <sid>:echomsg 'Hello World!'<cr>      The above mappings remap to the `<sid>:` key mapping given below before they get down to work:               noremap <unique> <expr> <sid>: <sid>StartCmdLineMode()     noremap! <unique> <expr> <sid>: <sid>StartCmdLineMode()     function! s:StartCmdLineMode()       let a=mode()       if a ==# 'n'          return ':'       " Type <c-v><c-v> to insert ^V.        elseif a =~ '[vV^V]'         return ":\<c-u>"       elseif a ==# 'no'         return "\<c-c>:"       elseif a ==# 'i'          return "\<c-o>:"       elseif a ==# 'c'          let b=getcmdtype()         if b ==# ':'            return "\<c-e>\<c-u>"         else           return "\<c-c>:"         endif       else         return ''       endif     endfunction      Is there a staightforward way instead of my obfuscated approach?


title: How to kill a process which can't be killed without rebooting?

text: There are 5 processes which can't be killed by `kill -9 $PID` and executing `cat /proc/$PID/cmdline` will hang the current session. Maybe they're zombie processes. Executing `ps -ef or htop` will also hang the current session. But `top` and `ps -e` are working fine. So it seems that there are two problems the filesystem not responding. This is a production machine running virtual machines, so rebooting isn't an option. The following processes ids aren't working: 16181 16765 5985 7427 7547 The parent of these processes is init                       ├─collectd(16765)─┬─{collectd}(16776)             │                 ├─{collectd}(16777)             │                 ├─{collectd}(16778)             │                 ├─{collectd}(16779)             │                 ├─{collectd}(16780)             │                 └─{collectd}(16781)             ├─collectd(28642)───{collectd}(28650)             ├─collectd(29868)─┬─{collectd}(29873)             │                 ├─{collectd}(29874)             │                 ├─{collectd}(29875)             │                 └─{collectd}(29876)      And one of the qemu processes not working               |-qemu-system-x86(16181)-+-{qemu-system-x86}(16232)     |                        |-{qemu-system-x86}(16238)     |                        |-{qemu-system-x86}(16803)     |                        |-{qemu-system-x86}(17990)     |                        |-{qemu-system-x86}(17991)     |                        |-{qemu-system-x86}(17992)     |                        |-{qemu-system-x86}(18062)     |                        |-{qemu-system-x86}(18066)     |                        |-{qemu-system-x86}(18072)     |                        |-{qemu-system-x86}(18073)     |                        |-{qemu-system-x86}(18074)     |                        |-{qemu-system-x86}(18078)     |                        |-{qemu-system-x86}(18079)     |                        |-{qemu-system-x86}(18086)     |                        |-{qemu-system-x86}(18088)     |                        |-{qemu-system-x86}(18092)     |                        |-{qemu-system-x86}(18107)     |                        |-{qemu-system-x86}(18108)     |                        |-{qemu-system-x86}(18111)     |                        |-{qemu-system-x86}(18113)     |                        |-{qemu-system-x86}(18114)     |                        |-{qemu-system-x86}(18119)     |                        |-{qemu-system-x86}(23147)     |                        `-{qemu-system-x86}(27051)


title: Search and replacing a string on specific file extensions

text: I have this bash:                 replace="s/AAAA/BBBB/g";       find myDirectory/. -type f -print0 | xargs -0 sed -i $replace;      that will recursively scan `myDirectory` tree and replace all occurrences of `AAAA` with `BBBB` on the files there. But I want to limit this to happen on files of specific extensions, for example, `.txt`, `.read`, `.po` How do I impose this limit?


title: Can XBMC play Blu-Ray disks?

text: Can XBMC play Blu-Ray disks without other steps (e.g. manually decrypting it - if I buy a Blu-ray movie, can it be played out of the box)?


title: Why is sort changing the order of lines with identical sort keys?

text: Here is the data:               D 2     B 2     A 2      When I run this command:               sort -k2,2 file      it outputs:               A 2     B 2     D 2      My question is that when I specify only the second column `-k2,2`, why is it that it sorts by the first column as well? Since all of the values of the second column are the same, it should leave it as it is.


title: SD card not accessible (works in an old Nokia though)

text: ## Background I have two visually same 2GB microSD cards, both labeled "SD-C02G JAPAN", under the "2GB microSD" logo. My problem is that I can't read one of them in any device except an old Nokia 5310 "XpressMusic". The phone is dying, by which I mean it's very hard to operate (dysfunctional keys, display going nuts), but the fact that it can read/write the card leads me to believe that the card is not broken (whatever that means). (I'd like to believe that the card is dead and just toss it into the garbage, but then I would have to live with questions like: why the old Nokia still could read it?) I should also mention that the card has probably been previously encrypted by some technology in the Nokia phone (not the very same machine, but another piece of the same model, which is dead now as well.). ("Probably", because there are more cards in the house and I know one of them has been encrypted, and since all other work everywhere, I assume it was this one). ## Methods / Outputs Now other methods I tried with both cards (I'll mostly describe the "bad" card behavior):   * (A) two different Android phones, both telling that the card is not inserted at all, therefore not offering option to format   * (B) A PC with Ubuntu 12.04 LTS (kernel 3.2.0-37-generic, x86_64) using a small Kingston USB-stick-sized microSD card reader   * a laptop with Debian Wheezy (kernel 3.0.0.1-amd64), using     * (C) same method as (B); lsusb tells me:                          Bus 001 Device 005: ID 14cd:121c Super Top microSD card reader              * (D) a built-in, i.e. PCI SD reader (with help of microSD to SD adapter since the reader lacks a slot small enough); lspci tells me:                          15:00.2 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 21)          (A) does not give me any useful info, and as far as I can see (B) and (C) behave the same. Therefore I will compare (C) and (D) with the "good" and the "bad" card: ### mkdosfs With method (C) and "bad" card, mkdosfs says `/dev/sdb: No medium found`. I did not try it with method (D); I find it pointless since the device file does not exist at all. And I did not try with the "good" card since I do not want to lose the data... ### fdisk   * When the "bad" card is mounted, (C) `sudo fdisk -l /dev/sdb` or (D) `sudo fdisk -l /dev/mmcblk0` return nothing; in the latter case /dev/mmcblk0 does not exist.   * For the "good" card, both outputs are as expected, after all the card is auto-mounted. ### kern.log   * method (C) and the "bad" card:              usb 1-1: new high speed USB device number 7 using ehci_hcd     usb 1-1: New USB device found, idVendor=14cd, idProduct=121c     usb 1-1: New USB device strings: Mfr=1, Product=3, SerialNumber=2     usb 1-1: Product: Mass Storage Device     usb 1-1: Manufacturer: Generic     usb 1-1: SerialNumber: 812320090519     scsi9 : usb-storage 1-1:1.0     scsi 9:0:0:0: Direct-Access     USB Mass Storage Device        PQ: 0 ANSI: 0 CCS     sd 9:0:0:0: Attached scsi generic sg2 type 0     sd 9:0:0:0: [sdb] Attached SCSI removable disk        * method (C) and the "good" card:              usb 1-1: new high speed USB device number 8 using ehci_hcd     usb 1-1: New USB device found, idVendor=14cd, idProduct=121c     usb 1-1: New USB device strings: Mfr=1, Product=3, SerialNumber=2     usb 1-1: Product: Mass Storage Device     usb 1-1: Manufacturer: Generic     usb 1-1: SerialNumber: 812320090519     scsi10 : usb-storage 1-1:1.0     scsi 10:0:0:0: Direct-Access     USB Mass Storage Device        PQ: 0 ANSI: 0 CCS     sd 10:0:0:0: Attached scsi generic sg2 type 0     sd 10:0:0:0: [sdb] 3842048 512-byte logical blocks: (1.96 GB/1.83 GiB)     sd 10:0:0:0: [sdb] Write Protect is off     sd 10:0:0:0: [sdb] Mode Sense: 03 00 00 00     sd 10:0:0:0: [sdb] No Caching mode page present     sd 10:0:0:0: [sdb] Assuming drive cache: write through     sd 10:0:0:0: [sdb] No Caching mode page present     sd 10:0:0:0: [sdb] Assuming drive cache: write through      sdb:     sd 10:0:0:0: [sdb] No Caching mode page present     sd 10:0:0:0: [sdb] Assuming drive cache: write through     sd 10:0:0:0: [sdb] Attached SCSI removable disk     FAT-fs (sdb): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!        * method (D) and the "bad" card:              mmc0: error -110 whilst initialising SD card     [...10 secs later...]     mmc0: Timeout waiting for hardware interrupt.     sdhci: =========== REGISTER DUMP (mmc0)===========     sdhci: Sys addr: 0x00000000 | Version:  0x00000400     sdhci: Blk size: 0x00000000 | Blk cnt:  0x00000000     sdhci: Argument: 0x00000000 | Trn mode: 0x00000000     sdhci: Present:  0x01ff0001 | Host ctl: 0x00000001     sdhci: Power:    0x00000000 | Blk gap:  0x00000000     sdhci: Wake-up:  0x00000000 | Clock:    0x00000000     sdhci: Timeout:  0x00000009 | Int stat: 0x00000000     sdhci: Int enab: 0x00ff00c3 | Sig enab: 0x00ff00c3     sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000     sdhci: Caps:     0x01e021a1 | Caps_1:   0x00000000     sdhci: Cmd:      0x00000102 | Max curr: 0x00000040     sdhci: Host ctl2: 0x00000000     sdhci: ===========================================     mmc0: Got command interrupt 0x00030000 even though no command operation was in progress.     sdhci: =========== REGISTER DUMP (mmc0)===========     sdhci: Sys addr: 0x00000000 | Version:  0x00000400     sdhci: Blk size: 0x00000000 | Blk cnt:  0x00000000     sdhci: Argument: 0x00000000 | Trn mode: 0x00000000     sdhci: Present:  0x01ff0000 | Host ctl: 0x00000001     sdhci: Power:    0x00000000 | Blk gap:  0x00000000     sdhci: Wake-up:  0x00000000 | Clock:    0x00000000     sdhci: Timeout:  0x00000009 | Int stat: 0x00000000     sdhci: Int enab: 0x00ff00c3 | Sig enab: 0x00ff00c3     sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000     sdhci: Caps:     0x01e021a1 | Caps_1:   0x00000000     sdhci: Cmd:      0x00000102 | Max curr: 0x00000040     sdhci: Host ctl2: 0x00000000     sdhci: ===========================================      This repeats 4 times (including the 10s delay).   * method (D) and the "good" card:              mmc0: new high speed SD card at address ef87     mmcblk0: mmc0:ef87 SD02G 1.83 GiB       mmcblk0:     FAT-fs (mmcblk0): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!      ## Question Can anybody explain what is wrong with this card? Or at least what kern.log is showing? Could the encryption corrupt the card? If so, why can't I simply re-format it? (I'm OK with blasting the content.) Or, what other methods of debugging would you suggest?


title: What does vim consider to be a word?

text: > **Possible Duplicate:**   >  Match word containing characters beyond a-zA-Z I do not understand `vim`s definition of a word. From the help for the motion `w` (`:h w`): > w [count] words forward. |exclusive| motion. These commands move over words > or WORDS. >   >   >        *word* >   > > A word consists of a sequence of letters, digits and underscores, or a > sequence of other non-blank characters, separated with white space (spaces, > tabs, ). This can be changed with the 'iskeyword' option. This means when I invoke the `w` motion, vim needs to check which characters can make up a word with the help of the `iskeyword` option. So let's check, what characters a word may be comprised of:               :set iskeyword?     iskeyword=@,48-57,_,192-255      Let's test this with characters not included in the characters listed in the `iskeyword` option, e.g. `U+015B LATIN SMALL LETTER S WITH ACUTE`. Pressing `ga` on `ś` tells us that it has the decimal value 347, which is larger than 255 and thus outside the range of `iskeyword`. The cursor is placed on the `t` of treść and I press `w`:               treść bar     ^ (cursor)      The result:               treść bar           ^ (cursor)      If a word can be comprised of _letters, digits, underscores and other_ characters, the only possibility is that vim treats the `ś` as a _letter_ , since it's obviously not a digit or an underscore. Let's check how to find out if a character is a letter. From `:h :alpha:`: > The following character classes are supported: _[:alpha:]_ [:alpha:] letters A test with               /[[:alpha]]      shows that `ś` is not considered to be a letter. Why did the cursor jump to the `b` if `ś` is neither a letter, nor a digit, nor an underscore and not listed in `iskeyword`? Tested on VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Dec 27 2012 21:21:18) Included patches: 1-762 on Debian GNU/Linux with locale set to `en_GB.UTF-8`.


title: Extract specific set lines matching a rule

text: I have a large file with the logs as shown below. There are about 30000 instance of such events logged. I need to extract those lines beginning with `RINGING` and `CLOSE` (included) and which does NOT contain `30 30`. The requirement is : Of the two instances seen below, I need only Instance 2 retained. Instance 1 needs to be deleted entirely (they form the large chunk of the file) Instance 1:               313782 Aug 19 18:37:04.925: <DATA>  RINGING|254|01136097645|5950|$hostIp|$size  |$data     313783 Aug 19 18:37:05.262: <DATA>  TRAINING|254|01136097645|5950|$hostIp|$size  |$data     313784 Aug 19 18:37:09.028: <DATA>  OUT  |254|01136097645|5950|$hostIp|2 bytes  |30 93     313785 Aug 19 18:37:09.705: <DATA>  IN   |254|01136097645|5950|$hostIp|4 bytes  |30 73 F9 F8     313786 Aug 19 18:37:18.532: <DATA>  IN   |254|01136097645|5950|$hostIp|336 bytes  |30 10 60 00 06 00 00 6F 12 00                                                                                ...     313787 Aug 19 18:37:19.485: <DATA>  OUT  |254|01136097645|5950|$hostIp|133 bytes  |30 30 60 00 00 00 06 6F 12 10                                                                                ...     313788 Aug 19 18:37:20.898: <DATA>  TRAINING|254|01136097645|5950|$hostIp|$size  |$data     313789 Aug 19 18:37:22.006: <DATA>  CLOSE|254|01136097645|5950|$hostIp|$size  |$data      Instance 2: (Line with 30 30 is not present)               313782 Aug 19 18:37:04.925: <DATA>  RINGING|254|01136097645|5950|$hostIp|$size  |$data     313783 Aug 19 18:37:05.262: <DATA>  TRAINING|254|01136097645|5950|$hostIp|$size  |$data     313784 Aug 19 18:37:09.028: <DATA>  OUT  |254|01136097645|5950|$hostIp|2 bytes  |30 93     313785 Aug 19 18:37:09.705: <DATA>  IN   |254|01136097645|5950|$hostIp|4 bytes  |30 73 F9 F8     313786 Aug 19 18:37:18.532: <DATA>  IN   |254|01136097645|5950|$hostIp|336 bytes  |30 10 60 00 06 00 00 6F 12 00                                                                                ...     313788 Aug 19 18:37:20.898: <DATA>  TRAINING|254|01136097645|5950|$hostIp|$size  |$data     313789 Aug 19 18:37:22.006: <DATA>  CLOSE|254|01136097645|5950|$hostIp|$size  |$data


title: How to find orphan directory entries in a ext4 disk

text: This comes from a long story of trying to recovering a TrueCrypt volume from a hardware failure (thanks, WD). I ended up with an unencrypted 3TB image that had the files that I want to recover. Unfortunately, after using `testdisk` and `extundelete`, I guessed the directory entry that leads to the descriptors (of the additional directories) that I want to recover has been overwritten. However, I think that its subdirectories may have their entries still intact. I would like to know how can I search throughout the disk image for directory entries in unallocated blocks, in order to recover their files (with their proper names, which would be much better than using `foremost`, `photorec` and the like). I know that `extundelete` with a default `\--recover-all` doesn't look further than the tree that spawns from the root directory. Okay, what if one of the branches is broken but I know that the subfolders entries are somewhere? Just in case I didn't express myself clearly, imagine that the entry lost is [root]/information. The root directory has the 'information' entry, but it points to overwritten data. Its directory entry is gone, but I want to scan for its subdirectories, [root]/information/personal, and [root]/information/business, and so on. (the name of those subdirectories was in the 'information' entry- I don't care about that name but their whole structure)


title: Incremental file back up by date

text: Is there any backup tool that supports partial back up by date? What I mean is that I have some small drives such as on a laptop that can't hold a full copy of all the files on an external 2TB drive. I want to keep the latest files, which are usually the ones I'm working with, on the laptop. But at the same time I want to be able to synchronize other drives with limited storage space. So each small drive should contain files that have been created or modified beyond a certain date, such as 3 months ago. Say I have 2 laptops and each has a different disk size. For the laptop with a smaller drive, I may only want files from the last month to be present. All files on both laptops should be backed up on the large external drive, along with all the other archived files that are greater than 3 months old. So the external drive should mirror both smaller drives and keep them in sync. I've tried using `unison` but it doesn't seem to support back up by date. Maybe `rsync` with a few shell scripts could work, but I want to check first if a solution exists before implementing a new one.


title: Confused by different output from iptables -L

text: I keep following this tutorial using a bash shell on ubuntu 12.04 as I open more and more ports on my server. I usually open up ports like this               sudo iptables -A INPUT -p tcp --dport PortNumberToOpen -j ACCEPT      Then I use this rule to close off remaining traffic               sudo iptables -P INPUT DROP      Normally if I then do `sudo iptables -L` it show a rule at the end of Input like this                DROP       all  --  anywhere             anywhere       But this time when I do `sudo iptables -P INPUT DROP; sudo iptables -L` it is not showing this DROP rule. I am following the exact same steps. What is going on?


title: sudo and fish: no credential caching

text: I use `fish` as my standard shell. And I use `sudo` sometimes. But I'm having problems with credential caching. On an Ubuntu system, this works:               niklas@Niklas-Mobil~> sudo true     [sudo] password for niklas:     niklas@Niklas-Mobil~> sudo true     niklas@Niklas-Mobil~>      On a Debian system, this doesn't work:               niklas@ThinServer ~> sudo true     [sudo] password for niklas:     niklas@ThinServer ~> sudo true     [sudo] password for niklas:     niklas@ThinServer ~>      But on the same system as the same user with `bash`:               niklas@ThinServer:~$ sudo true     [sudo] password for niklas:     niklas@ThinServer:~$ sudo true     niklas@ThinServer:~$      It works using `dash`, too. Why aren't the credentials cached when I'm using fish? (And what can I do to solve this problem?)


title: Grub not Recognizing XEN Kernel on Boot

text: We are able to successfully install and boot to a XEN kernel on 5 of our 7 eucalyptus node controllers. The last two are having the same problems despite running an identical installation process. I've installed _eucalyptus-nc_ and am able to start the service using the kvm hypervisor. I then configure eucalyptus to use _xen_ as the hypervisor and install xen with the following packages:               yum install -y centos-release-xen xen libvirt python-virtinst libvirt-daemon-xen      I run this command twice, since it doesn't pull the xen package through the first time. The packages install successfully. I've also updated `/boot/grub/grub.conf` to include a new entry for our xen kernel:               # grub.conf generated by anaconda     #     # Note that you do not have to rerun grub after making changes to this file     # NOTICE:  You have a /boot partition.  This means that     #          all kernel and initrd paths are relative to /boot/, eg.     #          root (hd0,0)     #          kernel /vmlinuz-version ro root=/dev/mapper/vg_erams7-lv_root     #          initrd /initrd-[generic-]version.img     #boot=/dev/sda     default=0     timeout=15     splashimage=(hd0,0)/grub/splash.xpm.gz          title CentOS-XEN (XEN-4.2.4-33.el6.centos.alt.x86_64)         root (hd0,0)         kernel /xen.gz dom0_mem=1024M,max:1024M loglvl=all guest_loglvl=all         module /vmlinuz-3.10.43-11.el6.centos.alt.x86_64 ro root=/dev/mapper/vg_erams7-lv_root rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=vg_erams7/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=vg_erams7/lv_root rd_NO_DM rhgb quiet         module /initramfs-3.10.43-11.el6.centos.alt.x86_64.img     title CentOS (3.10.43-11.el6.centos.alt.x86_64)         root (hd0,0)         kernel /vmlinuz-3.10.43-11.el6.centos.alt.x86_64 ro root=/dev/mapper/vg_erams7-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_erams7/lv_swap rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg_erams7/lv_root rd_NO_DM rhgb quiet         initrd /initramfs-3.10.43-11.el6.centos.alt.x86_64.img     title CentOS (2.6.32-431.20.5.el6.x86_64)         root (hd0,0)         kernel /vmlinuz-2.6.32-431.20.5.el6.x86_64 ro root=/dev/mapper/vg_erams7-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_erams7/lv_swap rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg_erams7/lv_root rd_NO_DM rhgb quiet         initrd /initramfs-2.6.32-431.20.5.el6.x86_64.img     title CentOS (2.6.32-431.el6.x86_64)         root (hd0,0)         kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/vg_erams7-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_erams7/lv_swap rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg_erams7/lv_root rd_NO_DM rhgb quiet         initrd /initramfs-2.6.32-431.el6.x86_64.img      I then flash the MBR using the grub shell:               $ grub     Probing devices to guess BIOS drives. This may take a long time.                GNU GRUB  version 0.97  (640K lower / 3072K upper memory)           [ Minimal BASH-like line editing is supported.  For the first word, TAB        lists possible command completions.  Anywhere else TAB lists the possible        completions of a device/filename.]     grub> find /grub/grub.conf     find /grub/grub.conf      (hd0,0)     grub> root (hd0,0)     root (hd0,0)      Filesystem type is ext2fs, partition type 0x83     grub> setup (hd0)     setup (hd0)      Checking if "/boot/grub/stage1" exists... no      Checking if "/grub/stage1" exists... yes      Checking if "/grub/stage2" exists... yes      Checking if "/grub/e2fs_stage1_5" exists... yes      Running "embed /grub/e2fs_stage1_5 (hd0)"...  27 sectors are embedded.     succeeded      Running "install /grub/stage1 (hd0) (hd0)1+27 p (hd0,0)/grub/stage2 /grub/grub.conf"... succeeded     Done.      I am able to reboot but the grub menu only displays the three existing kernels, not the newly-added XEN kernel above: ![enter image description here](http://i.stack.imgur.com/HzCB7.png) Once I login, running `virsh list` displays nothing, when it should display something like this:               Id    Name                           State     ----------------------------------------------------      0     Domain-0                       running      The eucalyptus-nc service also fails to start, since the XEN kernel is not booting. My question - what could be causing the grub entry above from being recognized on boot?


title: Configuring SSTP client on Debian

text: I would need to connect my Debian (stable) server to a Windows Server 2008R2 server, which is acting as a SSTP VPN server. I have managed to install sstp- client on my Debian server, but I do not know how to configure the connection so that I can run it in the background. Furthermore, there are quite many things that I do not understand about the whole configuration process. Following some advice I found on the Internet, I disabled authentication of remote server by adding `noauth` to `/etc/ppp/options`. Furthermore, I added there the options `refuse-pap`, `refuse-eap`, `refuse-chap`, `refuse-mschap` and `require mppe` to force MS-CHAP-v2 authentication (the Windows server is configured to accept that and not the others). If I run from terminal `sstpc --log-level 4 --log-stderr --user USERNAME --password PASSWORD SERVER_IP` the connection works, and opening another terminal, I can access a web page that can only be accessed over the VPN. I have tried to create the file `etc/ppp/peers/sstp-1` with the contents               remotename sstp-1     linkname sstp-1     ipparam sstp-1     pty "sstpc --ipparam sstp-1 --log-level 4 --save-server-route --nolaunchpppd --user USERNAME --password PASSWORD SERVER_IP"     name USERNAME     plugin sstp-pppd-plugin.so     sstp-sock /var/run/sstpc/sstpc-sstp-1     usepeerdns     refuse-pap     refuse-eap     refuse-chap     refuse-mschap     require-mppe     noauth      and then running from the command line `sudo pon sstp-1`. The connection fails, and `sudo plog` shows               pppd[4813]: Plugin sstp-pppd-plugin.so loaded.     pppd[4814]: pppd 2.4.5 started by root, uid 0     pppd[4814]: Using interface ppp0     pppd[4814]: Connect: ppp0 <--> /dev/pts/1     pppd[4814]: Could not connect to sstp-client (/var/run/sstpc/sstpc-sstp-1), Connection refused (111)     pppd[4814]: Exit.      I have couple of questions regarding all this:   1. How to set up the `/etc/ppp/peers/sstp-1` so that I can connect/disconnect to the VPN in background (to be used in a script)?   2. The Windows server encrypts the VPN traffic using a self-signed certificate. Why, using the above connection configuration, I do not need to install the certificate on the client machine? Is the traffic encrypted at all? Thank you already in advance, Joel Lehikoinen


title: awk - read program AND input from the standard input?

text: Is it possible for awk to read the program and the input from the standard input? I would like to be able to pipe a file to the following function.               process_data () {       awk -f - <<EOF     {print}     EOF     }      Note: the actual program is longer, it can't be passed as a command line argument, and I'd rather not use temporary files. Currently it doesn't output anything.               $ yes | head | process_data      $


title: Loop through binary data chunks from stdin in Bash

text: I'm looking for something like `while IFS= read -r -n $length str; do ... done` but for binary data. Is it possible to do this using `dd` or other tools? Is there some technique to make these tools able to see when pipe -which stdin is actually read from it- is closed and terminate loop? Currently I encode and decode binary data and use `read` but It's so slow.. (`base64 | while read -r -n77 str; do echo $str | base64 -d; ... done`)


title: Debian stucks at formatting 33%

text: I'm trying to install Debian Squeeze 6.0.5 on a new HP Proliant Microserver N40L with 4 GB RAM and 1.5 GHZ and 2 new Seagate BARRACUDA 2TB HDD (delivered yesterday). The installation stuck at the point of formatting the 2 TB HDD at 33%. I gave him 16 hours, then I aborted the formatting and started the SEATOOLS HDD Utility to check for errors. The HDD passed the check and I freshly ereased both hdd with zero's by the SEATOOLS Utility. Now I restarted the installation and it got stuck again at 33%. How long I need to wait for this formatting? Partitions of Software-Raid 1: /boot 500MB ext2 / 1995.9 GB ext3 swap 4 GB With Alt + F4 I can't see any errors in the terminal, because the whole time my USB-Devices appear..., Swichting back to Alt + F1, it keep staying at 33%. Is there any way to speed up this formatting? The hdd are new, so there is no need of secure deleting etc... **Update:** I found now out, that resync is incredible slow: http://up.picr.de/11594927qr.jpg writing with 700 k/sec. How could this happen? -> Estimated time: 30 Days! I set already echo 50000 >/proc/sys/dev/raid/speed_limit_min without any change... Thank you very much!


title: Windows domain account can't create files via samba share, but can do this in linux shell, why?

text: I'm migrating tomcat server from windows to linux (CentOS 6.3 64bit), and want to use samba to share tomcat directory to technical department staffs (windows domain users) with read+write rights. I've setup kerberos & winbind & samba successfully, and did the following permission settings:               # add some domain users to local 'tech' group     group add --gid 777 tech     groupmems --group tech --add liu.yan     groupmems --group tech --add MY-DOMAIN\\liu.yan          # change owner & mode of tomcat directory     chown tomcat:tomcat /var/lib/apache-tomcat-6.0.35     chmod 6755 /var/lib/apache-tomcat-6.0.35     cd /var/lib     ln -s apache-tomcat-6.0.35 tomcat6          # add ACL entry     setfacl --modify group:tech:rwx /var/lib/apache-tomcat-6.0.35      **Check permission setting, and use windows domain user account create file/directory -- successfully**               [root@webserver apache-tomcat-6.0.35]# pwd     /var/lib/apache-tomcat-6.0.35          [root@webserver apache-tomcat-6.0.35]# getfacl /var/lib/apache-tomcat-6.0.35/     getfacl: Removing leading '/' from absolute path names     # file: var/lib/apache-tomcat-6.0.35/     # owner: tomcat     # group: tomcat     # flags: ss-     user::rwx     group::r-x     group:tech:rwx     mask::rwx     other::r-x          [root@webserver apache-tomcat-6.0.35]# su liu.yan     [liu.yan@webserver apache-tomcat-6.0.35]$ mkdir temp-dir     [liu.yan@webserver apache-tomcat-6.0.35]$ touch temp-file.txt     [liu.yan@webserver apache-tomcat-6.0.35]$ getfacl temp-*     # file: temp-dir     # owner: liu.yan     # group: tomcat     # flags: -s-     user::rwx     group::r-x     other::r-x          # file: temp-file.txt     # owner: liu.yan     # group: tomcat     user::rw-     group::r--     other::r--      **Create file/directory via samba share -- failed**               [root@webserver apache-tomcat-6.0.35]# smbclient -U liu.yan //localhost/tomcat6     Enter liu.yan's password:     Domain=[MY-DOMAIN] OS=[Unix] Server=[Samba 3.5.10-125.el6]          smb: \> mkdir temp-dir2-via-samba-share     NT_STATUS_MEDIA_WRITE_PROTECTED making remote directory \temp-dir2-via-samba-share      If I changed the mode of /var/lib/apache-tomcat-6.0.35/ directory to `777`, then I CAN create file/directory in samba share on Windows clients, but CAN NOT do this via `smbclient` tool. Why ? **[tomcat6] share setting in smb.conf**               [tomcat6]         comment = Tomcat 6         path = /var/lib/tomcat6         public =yes         write list = root,@tomcat,@tech


title: where to find unhide-tcp for centos 6?

text: I've got a centOS 6 64 bit server, and have installed rkhunter. I spent some time running scans and tweaking things so that rkhunter throws up no warnings (e.g setting the PermitRootLogin var in /etc/rkhunter.conf to the same value as in my sshd.conf, and running `rkhunter --propupd`), however I still have one thing popping up in the logs:               872059-[10:57:36] Info: Starting test name 'hidden_ports'     872110:[10:57:36] Checking for hidden ports                         [ Skipped ]     872183-[10:57:36] Info: Unable to find the 'unhide-tcp' command      After a bit of googling, it seems I need to install the `unhide` package so rkhunter can check for hidden ports. But I haven't been able to figure out where to get it - I've added the `rpmforge` repo which apparently did have it at some point, but when I try to install or search for it:               $ sudo yum install unhide unhide-tcp     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile      * base: mirror.as29550.net      * extras: mirror.as29550.net      * rpmforge: nl.mirror.eurid.eu      * updates: centosn4.centos.org     Setting up Install Process     No package unhide available.     No package unhide-tcp available.     Error: Nothing to do      Anyone know what repo I need to add, or even if `unhide` is still in existence?


title: Where to find explanation of kernel processes?

text: I want to know about kernel processes, like `[migration]`, `[kswapd]`, etc. Where are kernel processes like these documented?


title: Why unix mv program doesn't need -R (recursive) option for directories but cp does need it?

text: This is a kind of "wtf?" question, so I'm sorry if I will disturb someone's vision of how things should be or if I will just annoy you with the "stupid" question. I always get messed up when need to use `cp` or `mv`: "do I need `-R` option when working with dir?" In GNU coreutils `cp` does need `-R` and `mv` doesn't. I didn't check *BSD, Solaris, HPUX because I don't have any. I just can not find any reason why `cp` needs `-R` option for copying dirs and `mv` doesn't. I think that `cp`ing dirs without `-R` (but behaving recursively like there's `-R` and like `mv` does) wouldn't cause any problems except breaking someone's habits on using the tool. Do you know any explanation? May be it had a reason long time ago? * * * Additional question: **why don't coreutils developers make`cp` copy dirs recursively by default?**


title: TMUX under Gentoo TTY artifacts

text: Problem: Tmux.conf (included below) generates a statusbar... with a light gray background (the config says '#000000', so black). This background ends up replacing what would normally be the normal black background in (tested) Vim and Weechat. My .bashrc says, to try making 256 colors work:               alias tmux='tmux -2'      When SSHing in to the computer from another machine (Ubuntu), no artifacting (the background being wrong) was observed, and the colours of the statusbar were correct. When SSHing from the troubled computer to the machine that has no such problems, no artifacting was observed at all, and everything was correct. Same with xterm on the troubled computer, no problems at all. Only in the virtual terminals is there a problem. The troubled machine is a Gentoo computer, recently installed. ~/.tmux.conf:               # inprove colors Commenting this out had no effect.     # set -g default-terminal "screen-256color"          # soften status bar from harsh green to other colors     set  -g status-bg '#000000'     set  -g status-fg '#0077FF'          # administrative debris (I miss having a clock like on my mac)     set -g status-left '%a, %F'     set -g status-right '%H:%M:%S'          # Due to the accuracy of our time, update every second.     set -g status-interval 1          # Get the left side longer, to see the FULL date.     set -g status-left-length 16          # Center our status line     set -g status-justify centre          # Move our status line to the top.     set -g status-position top          # A new keybind, for reloading the config.     bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."          # monitor activity     setw -g monitor-activity on      set -g visual-activity off          bind m setw monitor-activity off     bind M setw monitor-activity on      The $TERM variable inside a normal TTY (no tmux): `linux` Inside TMUX: `screen-256color` Obviously something is messed up. Any advice would be nice.


title: Can AutoFS keep a share permanently mounted on Solaris?

text: I have a share mounted on an Oracle Solaris application server that read/writes data onto the share periodically. I have automounted it with a timeout of over several minutes but is there a way to ensure it never unmounts the share? Looking at the man pages on the Solaris box and the reference docs, it seems there is no such option unless I missed it somewhere. On Linux, it seems automount offers such a facility - we need to set the timeout as 0, to disable unmounting of the share.


title: How to send HDMI sound to OTHER HDMI port?

text: I am running _XBMC_ on a **Debian Testing** system on my **HTPC**. I want to switch between my monitor for browsing and my tv for _XBMC_. This is no problem. But the sound only seems to reach my television when ONLY the television is connected. Otherwise my monitor will steal the sound like a seagull stealing bread from ducks. HTPC:HDMI -> TV:HDMI = Sound on tv HTPC:DVI -> TV:HDMI = No sound on tv HTPC:HDMI -> Monitor:HDMI = Sound on monitor HTPC:DVI -> Monitor:HDMI = No sound on monitor (not a typo, no sound when solo) HTPC:HDMI -> Monitor:HDMI AND   HTPC:DVI -> TV:HDMI = Sound on monitor (what? On DVI?) HTPC:HDMI -> TV:HDMI AND   HTPC:DVI -> Monitor:HDMI = Also sound on monitor only It doesn't even seem to matter which screen I define as primary. How can I have both connected, yet send the HDMI sound through the HDMI port? I didn't even know the DVI port could transmit sound when HDMI-converter-plug is used. Preferably I'd have a command line trick to switch the port where the audio is going. This answer has some interesting commands, but I cannot 'port' that to my situation. This HTPC also has DisplayPort, but I don't use that output. The XBMC part of this question is irrelevant, you can immitate the problem using:   `speaker-test -D hdmi -c 2` (both my monitor and my TV have only 2 channels (stereo))


title: Emacs 24 and linux distributions

text: I just downloaded Ubuntu 12.04 LTS and was very disappointed that emacs 24 was not yet supported for it. I found some links where you could build it from source, but regardless I am looking for a Linux distribution that has terrific support for emacs.   1. What Linux distribution would you recommend for emacs?   2. Which Linux distribution will be good with package managers? I want package management to support a wide variety of packages and to be minimally time consuming. (For example MacPorts for OS X has treated me well so far)


title: Separate workspaces on each monitor

text: I recently switched to a new PC at work, one with two (identical, Dell 23") monitors. I'm running Linux Mint 15 64bit / Cinnamon. Is there a way to set it up in such a way that, instead of both monitors sharing the same huge workspace, they are on separate smaller ones? E.g. left monitor on workspace 1, right monitor on workspace 2, and I could switch either monitor to workspace 3 if needed? Failing that, is there a way to duplicate the bottom panel onto the second monitor? Currently it is only displayed on the left one.


title: Text processing - Find text before/after given word

text: I would like to extract contents between `Station Name` and `Data End` of the file: Structure of text file for clarification:               ---- Huge text -- not interested     Station Name      100 - 200 lines     Data End     ---- Again text ---       How would I easily extract the data? To ask in general, how can we find the data in particular section and then process over it (delete/replace ... etc) i.e. before a specific word? or after a specific word? or between them? ### Desired Output **Case 1:** From beginning to given word/pattern   **Case 2:** Between 2 given words/pattern   **Case 3:** From the given word/pattern to end of file.


title: IFS change not coming into effect

text: I was trying to change the `IFS`(Internal Field Separator) character to comma for a file processing, but to my surprise the `IFS` was un-changed. Here's the order of commands and output :               mtk4@mtk-laptop:~$ echo .$IFS.     . .                                    # A space     mtk4@mtk-laptop:~$ IFS=","             # No error was thrown, no message     mtk4@mtk-laptop:~$ echo .$IFS.     . .                                    # Again echo'd it, but no change      Please let me know, what is wrong here?


title: Cli verification of digitally signed email

text: I am Alice and I've received signed email from Bob. I use Web e-Mail client (e.g. GMail) and I see that one of attachements is `smime.p7s`. I've found option "show original message" and saved contents into `message.orig`. Assuming Bob signed email, how can I verify it from command line ? (Let's assume Bob uses certified key signed by some of respected authorities - I do not know which, but I suppose that) (Alice don't want to install email client with appropriate feature, just for just one message)


title: Bash script to hide/show files

text: I prepared a little bash script to toggle the visibility of my hidden OS X files.               if (defaults write com.apple.finder AppleShowAllFiles FALSE); then         defaults write com.apple.finder AppleShowAllFiles TRUE     elif (defaults write com.apple.finder AppleShowAllFiles TRUE); then         defaults write com.apple.finder AppleShowAllFiles FALSE     fi          killall Finder      When hidden files are invisible, the script successfully makes them visible but afterwards, when I re-run the script to make the hidden files invisible again, it fails and does nothing. Where am I going wrong?


title: How do I hook into Tar with BASH?

text: ### Long Story Short I'm working with Tar archives that contain PNG images in base64 encoding. I would like to use BASH (or whatever else works) to hook into the extraction function of Tar to decode PNG images from base64 encoding to standard PNG encoding after the files are unpacked. A simple `cat $input_file | base64 -d >$output_file` will successfully decode the images. Is there a way I can hook into tar -xf so that users do not have to do any (or minimal) extra work to decode the images? In the GNU Tar documentation I found that there are in fact variables reserved to hold the names of functions I desire to be hooked into various moments in Tar program execution. However, the documentation explains that these variables, along with other variables that can be set to configure Tar, are located in a file named backup-specs. Unfortunately, the path to this file is not given. Further, running `sudo find / -name backup-specs` tells me that this file is not present on my Ubuntu version 13.04 system. ### Background Information not included in the Long Story Short I've been working on a browser-based (WebGL) particle effect creation application (http://www.particleeffect.org), (https://github.com/cgrabowski/webgl-particle-effect-editor), (https://github.com/cgrabowski/webgl-particle-effect). I've begun to write a client-side-only solution for saving and loading effect data as a tar archive. However, since client-side JavaScript has limited capability to process binary data, the images used as textures in the effect are saved with base64 encoding. I've been able to implement saving effect data as a Tar archive (haven't pushed that to Github yet). However, the images present in said Tar archive cannot be manipulated unless they are decoded from base64 encoding.


title: How to replicate installed package selection from one Fedora instance to another?

text: I have a Fedora 17 system (A) where I have installed some packages over the time. Now I want to install Fedora 19 on another computer (B) and I want to install the same packages on it. In Debian terms I want to accomplish something like this:               $ dpkg --get-selections > pkg_sel_host_a  # on host_a     $ dpkg --set-selections < pkg_sel_host_a  # on host_b      But to be honest, I really want a better method to select the same packages on the new Fedora 19 system (B): I just want to install the packages from system A that were explicitly mentioned on a `yum install` command line - and not those that were installed as dependencies! Why? Because perhaps dependencies have changed - and I don't want to install outdated dependencies on the new system. Plus, when I remove packages I want to remove the (possibly) then unneeded automatically installed dependencies (i.e. orphans) as well. I've found `yum list installed` - but it does not display if a package was explicitly selected or just installed because of a dependency. How do I get that information on Fedora? What is the Fedora/yum way to replicate package selections?


title: What to do after cancelled "rm -rf /usr/" on Arch?

text: So I just did this on my up-to-date Arch system:               [anna@home ~]$ sudo rm -rf /usr/     ^C[anna@home ~]$ ^C     [anna@home ~]$ ^C      I terminated the `rm` very quickly. I can't find anything wrong with `/usr/` by eye. What options are there to see if any damage was done? Is there some pacman integrity check that I should run? Any specific files I should check to make sure that the system can start again? From now on, I'll keep backups of the _entire_ system.


title: rsync list of files in sub-directories to remote server and delete extraneous

text: I haven't been able to find the answer to this one. I have tried all kinds of combinations of `\--include`, `\--exclude`, `-r`, `\--delete-excluded`, and source directory. This is what I'm trying to accomplish:   * Source directory:              Dir1/File1-1     Dir1/File1-2     Dir2/File2-1     Dir2/File2-2     Dir2/File2-3     Dir3/File3-1     Dir3/File3-2     Dir3/File3-3     ...        * Destination directory:   (state unknown) What I would like to do is to provide a pre-defined subset of files from the source directory with the relative path and rsync them to the remote destination, deleting anything on the destination (including directories) that wasn't in the subset of files. For example, given the above Source Directory:   * My Pre-defined File List:              Dir1/File1-2     Dir3/File3-3        * Destination directory:              Dir1/File1-1     Dir1/File1-2     Dir2/File2-1     Dir3/File3-1      I would expect to have only Dir1/File1-2, Dir3/File3-3, and no Dir2 in the destination when I'm done. I will also NOT have expected Dir1/File1-2 to be copied over again. Things to Note:   * These are very large files and I'm trying to prevent having to remotely copy them again if not needed.   * The contents of the source sub-directories changes everyday   * The pre-defined list changes everyday, but may/will include files in yesterday's list   * There are 0 files in the Source Directory. It only contains sub-directories which contain the files needed to sync   * The Sub-directories in the Source are pretty static. i.e. Dir1, Dir2 and Dir3 will always be there I will keep plugging away to see if I can come up with the solution I'm looking for. **Update** : First of all, I want to thank **jw013** for the formatting changes. I followed the help guideline, but didn't understand why is wasn't formatting correctly (first time poster). Using the suggestions from **Serge** , I came up with the following command, but it still does not remove the extraneous files from the destination that are NOT in the File List.   * Command              rsync -avRP --prune-empty-dirs --delete-delay --ignore-existing $FILE_LIST destination/


title: Getting specific line from terminal output

text: "Hmm, I need to edit `file-i-must-edit-2`, but I cannot remember where it is."               locate file-i-must-edit     /home/user/file-i-must-edit-1     /home/user/file-i-must-edit-2     /home/user/file-i-must-edit-3      "Great! I wish there was a way to avoid typing `/home/user/file-i-must-edit-2` again..." Is there a way to avoid typing `nano /home/user/file-i-must-edit-2` by typing something like `nano <output line 2>`?


title: How to remember window location metacity (Always on visible workspace)

text: I need to have some applications running on specific workspaces on gnome and have the option (Always on visible workspace) ticked and remembered each time I'm loggin out. Is this possible?


title: iptables to block https websites

text: I wish to block a few websites that also run upon https, like facebook, twitter, and gmail, in my organization. Squid is not supposed to be used here as per the orders from higher management. We can use Untangle Lite Package and `iptables`. Is there any option other than Squid to do this? Also some `iptables` rule to block this kind of traffic would be really helpful. I found this               iptables -t filter -I INPUT -m string --string facebook.com -j LOG --algo bm     iptables -t filter -I INPUT -m string --string facebook.com -j REJECT --algo bm      but https still works on machines except the local machine.


title: How can I synchronize all PDFs from one directory with Dropbox?

text: I want to synchronize all the PDFs from one directory (my Zotero library) to Dropbox. Finally, I want to have a list of all the PDFs, not the directory names. I successfully synchronized all my PDFs with the following command:               rsync -az --include="*/" --include="*.pdf" --exclude="*" \      --prune-empty-dirs /zotero /dropbox      I think I can easily set up a `cron` job to redo that task every day, but haven't tried that yet. But now my folder on Dropbox still has all the directories with the PDFs in it (e.g. `6NVTACJH > xyz.pdf`) **My problem:** I would love to only have all the pdfs listed in one directory. Following an advice from the web, I tried to `find` all pdfs and create a hardlink. But this command does not work yet.               ln $( find -name="*.pdf" -type f - links 1 ) /dropbox      Can you please help me with that last command?


title: Files bigger than max(off64_t) on Solaris, eg "/proc/../as"

text: How do I read or seek from a file that's bigger than the maximum off64_t? The problem arises because the address space of a process is represented in the `/proc/.../as` file, which is a _huge_ sparse file for 64-bit processes. It's really very big: on a sample process on Solaris x86-64, argv's address is 0xFFFFFD7FFFxxxxxx, that is, the very top of the address space is used. Pointers are unsigned, but an off64_t is signed, so can't reach anything in the top half of the address space file. This obviously depends on the layout of the address space. On 32-bit systems, this isn't a problem (a `long` offset isn't big enough, but an `off64_t` easily works), and on x86-64 on linux (for example), the top of the process is 0x7fffxxxxxxxx (48 bits), so again an off64_t can refer to anything in the process's address space. So, it's a shame that Solaris on x86-64 seems to use the whole 64-bit address space, when 50 bits is more than enough. Sun's examples of using psinfo_t.pr_argv just don't seem to work except on SPARC and x86. Is there any way around this problem?


title: How to move the /var/www directory to a USB HDD?

text: I have a default OpenBSD 5.1 install. How Can I enabled httpd, OK. QUESTION: How can I use the               /dev/sd0a on /mnt/usbhdd type ffs (local, nodev)      instead of the default "/var/www" directory? What are the most secure mount options (for a webservers that only servers static html/files)?


title: Fast encryption for home directory with Scientific Linux (ala' RedHat)

text: I have a T61 with C2D T7300 CPU/4 GByte RAM. I has SL 6.3 on it, and I ticked the encrypt VG during install. If I start a "normal" windows xp on it, its ~slow.. so.. I need a little performance boost :) Loud thinking/QUESTION: kcryptd could take ~20% (!) of CPU, but encryption is needed.. soo I was thinking that how can I encrypt **only the home directory of that 1 user** (and AES256 isn't needed, just a **very-very light encryption** , so that a burglar can't access the data on the notebook, I'm not defending against the "CIA" :D or at least a lighter encryption) UPDATE: I'm voting for:               aes-ecb-null -s 128      So before the install I have to manually create the partitions. AFAIK using this and not using the default could really increase performance. UPDATE2: https://access.redhat.com/knowledge/docs/en- US/Red_Hat_Enterprise_Linux/6/html/Security_Guide/sect-Security_Guide- LUKS_Disk_Encryption.html - so looks like they are using 512 bits aes-xts- plain64.


title: update rwtab file on read-only stateless linux without rebbot

text: I have some statless read-only root file linux systems where I have added a new file entry on /etc/rwtab file. rwtab is a configuration file for the list of files and directories that should be mounted in the temporary read-write filesystem. src I need to make that file writeable. Is there a way to do this without rebooting the server?


title: C-u leaves ghost characters at command prompt in xterm

text: I am using bash (v3.2.25) on linux, through xterm, through exceed. When using `Ctrl``u` the cursor is moved next to the bash character prompt (`$`) but the rest of the line remains and is not erased as expected. Where is the issue, xterm or bash? How to resove that issue please?


title: stopping ubuntu to offer update

text: I installed an ubuntu 10.4 and I don't want to update to version 12.xx, but the system offering me to update everysome times. Is there any way that I can stop Ubuntu to offer me the update?


title: Use find + sed + cp to find files and copy them to a directory with a different name

text: I'm trying to copy a bunch of files named folder.jpg into a folder. The problem is because all the files are named the same thing, I need to rename them in the process. I know I can probably do it with sed but I'd like to rename them to the name of part of the parent folder. Here is what I got just to find and copy the files               cp $(find . -iname "folder.jpg") .albumart/      The folder structure is ./artist/artist.year.album/folder.jpg and what I'd like to use the parent folder (or just part of it) to name the file. Can someone help me with a one liner to accomplish the task? To make things even trickier, some folders have one more level of CD1 and CD2 that I would like to ignore if they are present (e.g. ./artist/artist.year.album/CD1/folder.jpg)


title: What does 'Invalid module format' mean?

text: After executing...               sudo modprobe rt3572sta      I get... > Invalid module format What does it mean? I'm trying to get Wusb600n v2 working on Lucid Lynx. Does it mean that kernel versions aren't compatible?


title: Directory is not opening with cd command

text: I have a directory in Desktop named Project. I tried opening it using the `cd` command but it is not opening. What's the reason? Check the screenshot. The directory has all the required permissions. I tried with the root user also, but facing the same problem. ![Screenshot](http://i.stack.imgur.com/VlJeU.jpg)


title: Alternatives to TrueCrypt in compliance with Fedora 15 guidelines

text: Due to licensing issues TrueCrypt is not included in Fedora 15 (source here). Although not address by Fedora itself there's also concerns regarding the developers identities and related issues (source here). I'm looking for possible alternatives that matches the following requisites:   * Compliance with Fedora licensing guidelines   * Able to encrypt a partition   * Allows me to mount the encrypted partition both on Windows and Linux (I'm using a dual boot system)   * Peer reviewed by the cryptography community Is there any package that meet those guidelines?


title: What happens when Ctrl + Alt + F<Num> is pressed?

text: I am looking for an explanation of what happens in Linux when this key combination is pressed to change the current terminal. In particular, what software component intercepts this key combination and changes the terminal? Is it the kernel? If it is the kernel, could you provide the location of the source file which handles this? Edit: I want to understand how this works in both a graphical (X11) and text- based environment.


title: Check if Keyboard and Mouse are plugged in

text: Is there a way to detect if a keyboard and a mouse is plugged in (and working) in Linux? This will be embedded in a PXE setup, so I only have Kernel + Modules and Busybox available. Bonus question: Is there a way to check if a display is properly connected?


title: special character in filename (\#033OA)

text: I've got a slight problem with a very stubborn error during an rsync. It's caused by a file with a special character in its filename. There's been others but I could sort that out by doing some conversion in the encoding of the filename. However this one file I can't even find. So here's what rsync says:               ../.\#033OA.tex.pyD0MB" failed: No such file or directory (2)      First thing one notices is that the character code can't be hex or octal so I've googled it and only found this. So it may be a `CURSOR UP` character (or not). I've tried               ls -la *`printf '\033OA'`*      to no avail. I've also tried piping the output of ls of that directory to `od` to no avail. What else can I do? Or what character am I looking for anyway? Thanks


title: Which Distro/Virtual Machine combination is fast and stable?

text: For numerous good reasons (you know them best ;-) ) I am willing to switch my Notebook's OS from Windows 7 to Linux very soon. However since I am an absolute Linux beginner I am not committed to any distribution in particular yet (I use Debian at the moment). I will have to work in a corporate Windows-environment so a reliable virtual machine is vital for my daily work. My work includes GPU-intense tasks on the windows system. I would like to run Windows 7 64 Bit inside a VM on Linux preferrably with gnome desktop. What would be the best choice when it comes to the distribution and the VM application?


title: making vim fold also hide newline after function

text: How can one make vim's fold function - when using foldmethod=syntax - also hide one newline after each function, if-else and struct (using Go).


title: How to unfreeze after accidentally pressing Ctrl-S in a terminal?

text: It's a situation that has happened quite often to me: after I press (with a different intention) `Ctrl-S` in a terminal, the interaction (input or output) with it is frozen. It's probably a kind of "scroll lock" or whatever... How do I unfreeze the terminal after this? (This time, I have been working with `apt-shell` inside a `bash` inside `urxvt`--not sure which of them is responsible for the special handling of `Ctrl-S`: I was searching the history of commands backwards with `C-r`, as usual for readline, but then I wanted to go "back" forwards through the history with the usual--at least in Emacs--`C-s` (1, 2, 3), but that caused the terminal to freeze. Well, scrolling/paging to view past things still works in the terminal, but no interaction with the processes run there.)


title: gnome-screensaver-command --lock, hide password

text: If I lock the screen using gnome-screensaver (gnome-screensaver-command --lock) and enter the password, a big dot is shown instead of each character. Is it possible to change this behaviour such that no place-holders are shown if I type in my password (like normally in the shell)?


title: Pass my credentials from a ssh session to another ssh session

text: I want to ssh from A to B, using a particular private key that I have in A. Then I want to ssh from B to C using the same credentials that I used to ssh into B. Is it possible to "pass" the credentials from a ssh session to another ssh session started inside the first session?


title: Varing speed when reading sequentially from a HDD

text: I have just got a new HDD and I wanted to test the sequential read speed (the whole disk). I used:               pv /dev/sda > /dev/null      The disk is 500GB WD VelociRaptor (WD5000HHTZ). At the beginning the read spead is 194 MB/s but gradually it drops. At the end it was reading only about 118 MB/s. I am wondering if this is normal, and perhaps has something to do with the disk internal geometry. I did not expect such great variation. Besides, 118 MB/s is really slow, even for a normal HDD. The VelociRaptor is supposed to be a high end HDD for desktops.


title: Why do people dislike PulseAudio?

text: I've heard a ton of crap about PulseAudio on the internet. People even discriminate against `systemd` simply because it was created by Lennart Poettering. Are there any technical reasons why PulseAudio is disliked? Preferably, answers would include references.


title: Issues with grub badram

text: I have a stick of bad memory (the computer randomly segfaults an it gives memtest86+ errors, picture of output at bottom). As I would like this computer to be working while I work on getting new ram, I would like to use the functionality on grub2 to mask off bad memory. (How to blacklist a correct bad RAM sector according to MemTest86+ error imdocation? uses a different method which involves passing arguments to the kernel to do the same thing) Following the directions from the bottom of this page and the comment in `/etc/defaults/grub` I added the following line to `/etc/defaults/grub`               GRUB_BADRAM="0xbfc90044,0xffff80c4,0xb0490444,0xf77f84ec,0xb2490444,0xf27facc4,0xb0492864,0xf07faef4,0xb0490044,0xfd7f91e4,0xb0492144,0xff7fa1c4,0xb0490244,0xf37fe2c4,0xb0494044,0xf3ffc0e4,0xb0493464,0xf17fb4e4,0xb0490044,0xff7fa0c4"      which after running `update-grub` added               badram 0xbfc90044,0xffff80c4,0xb0490444,0xf77f84ec,0xb2490444,0xf27facc4,0xb0492864,0xf07faef4,0xb0490044,0xfd7f91e4,0xb0492144,0xff7fa1c4,0xb0490244,0xf37fe2c4,0xb0494044,0xf3ffc0e4,0xb0493464,0xf17fb4e4,0xb0490044,0xff7fa0c4      to `/boot/grub/grub.cfg` which seems to correctly match the command line arguments specified here. However, when I re-boot grub does not load, there is just a blank screen. Booting with a live-disc, commenting out the `badram` line in `/boot/grub/grub.cfg` allowed me to boot again (but I still have the bad memory un-masked). I am pretty sure I copied the addresses and masks correctly (had an office mate read the picture to me after I copied it and then I read the file back to them while they were looking at the picture) so I assume I have done something wrong with the formatting, but I do not know what. ![memtest86+ output](http://i.stack.imgur.com/0l8uO.jpg)


title: Can I change the output format of the "last" command to display the year?

text: I'm trying to find a way to report on the most recent login for all users on my Solaris 10 server. I'm starting with the output of the `last` command. Using that command, I get output like this:               bd9439    pts/1        vpn-xxx-xx-xxx-x Fri Oct 25 10:46   still logged in     vf7854    pts/1        vpn-xxx-xx-xxx-x Fri Oct 25 10:23 - 10:38  (00:15)      According to the man page, the date and time formats are controlled by locale. I've very rarely used locale settings. Is there something I can use that will change the display to include the "year" portion of the date? I'm hoping to get an output line similar to this:               bd9439    pts/1        vpn-xxx-xx-xxx-x Fri Oct 25 2013 10:46   still logged in     vf7854    pts/1        vpn-xxx-xx-xxx-x Fri Oct 25 2013 10:23 - 10:38  (00:15)      It's not clear to me if the man page was referring to the output of the `last` command itself or how the data is actually stored in /var/adm/wtmpx. If there is another way to get this "last login" attribute, I'd be happy to learn it.


title: Squid: how can I block plus.google.com, allowing access to google.com

text: 1.I have the following block.acl file in squid:               .*      It disallows access to everything by default. 2.white.acl allows access to google:               google\..*      I wanted to disallow access to `plus.google.com` by adding it to block.acl:               plus\.google\.com      3.The order of files inclusion in squid.conf is this:               acl good_url url_regex "/etc/squid/white.acl"     http_access allow good_url          acl bad_url url_regex "/etc/squid/block.acl"     http_access deny bad_url      Bad is included after good. But I still can access`plus.google.com`. How can I block it, keeping access to main google domain?


title: How often does Debian update its Stable repository?

text: Ever since release day (early Feb 2011), I haven't got any updates (`apt-get update && apt-get upgrade`). I've tried another repository (`ftp://ftp.de.debian.org/debian`), and it's the same thing. Here's the relevant line from my **/etc/apt/sources.list** :               deb ftp://ftp.is.co.za/debian stable main non-free contrib


title: Extract text from source code website

text:
I need extract text with a bash script from a website in HTML, I used this solution but doesn't work fine for me, because I must edit and format the output text. I need the text between the tag:

      Example I am surf in `https://apps.ubuntu.com/cat/applications/clementine/` In Firefox displayed the next tag in your source code:

Clementine is a multiplatform music player focusing on a fast and easy-to-use interface for searching and playing your music.

Summary of included features :

Search and play your local music library.

Listen to internet radio from Last.fm, SomaFM and Magnatune.

Tabbed playlists, import and export M3U, XSPF, PLS and ASX.

Visualisations from projectM.

Transcode music into MP3, Ogg Vorbis, Ogg Speex, FLAC or AAC

Edit tags on MP3 and OGG files, organise your music.

Download missing album cover art from Last.fm.

Native desktop notifications using libnotify.

Supports MPRIS, or remote control using the command-line.

Remote control using a Wii Remote, MPRIS or the command-line.

Copy music to your iPod, iPhone, MTP or mass-storage USB player.

Queue manager. It is largely a port of Amarok 1.4, with some features rewritten to take advantage of Qt4.

      How to extract the above text, after `<p><p tabindex="0">` ? remember is only a example, the website and tag could change. > Output='Clementine is a multiplatform music player focusing on a fast and > easy-to-use interface for searching and playing your music.' * * * thanks to $John1024 your solution work fine with ubuntu site, but with opensuse doesn't display correctly. this is the variable with OpenSuse site: `output="$(wget -q http://software.opensuse.org/package/clementine -O - | sed -n 's/.*<p id="pkg-desc">\\([^<]*\\).*/\1/p')"`. echo $output `Clementine is a modern music player and library organiser. Clementine is a` (doesn't display completaly the text) I tried also: `output="$(wget -q http://software.opensuse.org/package/clementine/ -O - | sed -ne '/<p id="pkg-desc">/, /[.</p>]$/p')"` echo $output `<p id="pkg-desc">Clementine is a modern music player and library organiser. Clementine is a port of Amarok 1.4, with some features rewritten to take advantage of Qt4.` `(it displays with '<p id="pkg-desc">')`