Error when trying to mount Xen LVM2 volumes

I have a hard drive which used to be part of a server running Citrix XenServer 5.6.100 SP2 with a Software RAID1 (I only have one of both hard drives). This hard drive is now physically attached to a computer running Ubuntu and I want to mount the LVM2 volumes to be able to recover the data stored on the VDIs. I got the RAID setup recognized using `mdadm` and then I was able to activate all the logical volumes with `vgchange -ay`. My volume group is named 'test' and I can see all my logical volumes under `/dev/test`. I then ran `kpartx -a` on each of these volumes. Only the last step fails, when I actually try to mount a volume :               root@web:/dev# mount /dev/test/VHD-ea41e612-dce1-4198-a079-091b2ba67c26 /mnt     mount: you must specify the filesystem type      Does someone know how to solve this ? Here is some more information:               root@web:/dev# lvscan       ACTIVE            '/dev/test/MGT' [4,00 MiB] inherit       ACTIVE            '/dev/test/VHD-964f83dc-1eeb-4c8d-9e19-1895ba41ae8e' [16,00 MiB] inherit       ACTIVE            '/dev/test/VHD-1d4f63e6-edcc-4b60-99b3-32fe83fedec6' [26,91 GiB] inherit       ACTIVE            '/dev/test/VHD-98835c17-5356-41a0-8b78-46fa0e6fbc55' [47,98 GiB] inherit       ACTIVE            '/dev/test/VHD-aab989a2-3020-4c0a-8af6-f22018af5ae6' [105,07 GiB] inherit       ACTIVE            '/dev/test/VHD-b0859a30-59c5-47fb-a9a6-2599a37aac29' [180,68 GiB] inherit       ACTIVE            '/dev/test/VHD-9e2d89bc-9ffa-4641-a438-bfee3b478819' [342,47 GiB] inherit       ACTIVE            '/dev/test/VHD-be174334-9df7-4c8c-9172-a0578c418909' [121,30 GiB] inherit       ACTIVE            '/dev/test/VHD-4167a41d-12a3-4e1d-b161-66cc44eccbcd' [1,30 GiB] inherit       ACTIVE            '/dev/test/VHD-134f8221-28ca-42f2-80c0-6266d1288d85' [1,23 GiB] inherit       ACTIVE            '/dev/test/VHD-a9203142-6d98-423f-841f-f4d6ab2ca2bc' [904,00 MiB] inherit       ACTIVE            '/dev/test/VHD-6e403a8c-9b39-4a62-be11-2833a75e03ce' [3,82 GiB] inherit       ACTIVE            '/dev/test/VHD-a38dba14-0cd5-4d73-9eaa-b996a12474be' [119,20 GiB] inherit       ACTIVE            '/dev/test/VHD-8abb0101-e3b6-4ba6-9f34-7fa59e16604d' [3,64 GiB] inherit       ACTIVE            '/dev/test/VHD-a8ce4d2d-9c2d-49ef-8a0a-aa172a9a5d99' [48,93 GiB] inherit       ACTIVE            '/dev/test/relink_134f8221-28ca-42f2-80c0-6266d1288d85_1' [4,00 MiB] inherit       ACTIVE            '/dev/test/VHD-ea41e612-dce1-4198-a079-091b2ba67c26' [370,73 GiB] inherit       ACTIVE            '/dev/test/coalesce_134f8221-28ca-42f2-80c0-6266d1288d85_1' [4,00 MiB] inherit                         web# guestfish --ro -a /dev/md2              Welcome to guestfish, the libguestfs filesystem interactive shell for         editing virtual machine filesystems.         ><fs> run          100% ⟦▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓⟧ 00:00         ><fs> list-filesystems         /dev/test/MGT: unknown         /dev/test/VHD-134f8221-28ca-42f2-80c0-6266d1288d85: unknown         /dev/test/VHD-1d4f63e6-edcc-4b60-99b3-32fe83fedec6: unknown         ....         /dev/test/VHD-964f83dc-1eeb-4c8d-9e19-1895ba41ae8e: unknown         ...         /dev/test/VHD-ea41e612-dce1-4198-a079-091b2ba67c26: unknown         /dev/test/coalesce_134f8221-28ca-42f2-80c0-6266d1288d85_1: unknown         /dev/test/relink_134f8221-28ca-42f2-80c0-6266d1288d85_1: unknown                    root@web:/dev# file -Ls /dev/test/VHD-ea41e612-dce1-4198-a079-091b2ba67c26     /dev/test/VHD-ea41e612-dce1-4198-a079-091b2ba67c26: Microsoft Disk Image, Virtual Server or Virtual PC          root@web:/dev# kpartx -av /dev/test/VHD-ea41e612-dce1-4198-a079-091b2ba67c26     root@web:/dev#     root@web:/dev# kpartx -l /dev/test/VHD-ea41e612-dce1-4198-a079-091b2ba67c26     root@web:/dev#


CPU usage monitoring in AIX servers

In order to monitor the CPU usage in an AIX server I'm using the following script that is executed every 10 mins.               lparstat 2 10 > cpu     usage=$(tail -10 cpu | awk 'BEGIN {sum=0;} {sum+=$4} END{print int(100-sum/10)}')               if [[ $usage -ge 90 ]]; then     # mail the error and cpu file to admin     # displaying this for testing purposes     echo "CPU usage off the charts!!!"     cat cpu     fi      However, incase the CPU usage is above 90% I need to list the top 5 Processes that are using the CPU. How do I achieve this?


run shell scripts in a sequencing way?

I have 4 shell scripts and I want to run them in a sequencing way: script1 -> script2 -> script3 ->script4 in a local machine can I ensure this by make the scripts executable and creating a new shell script like this:               #!/bin/bash     . script1.sh     . script2.sh     . script3.sh     . script4.sh      and if one of the scripts is in a remote machine, (for example script2.sh) how can I:   1. run the shell script remotely   2. ensure the sequencing.  Note : all of the scripts have an infinite loop.


Why does exec file generate 4 processes in Linux?

I build my RTAI-model-source（generated by simulink） in CygWin with gcc- linux-4.1 (cross-compiler of CygWin) on Windows, and generate ELF successfully. and the ELF runs correctly on Ubuntu. After the ELF is running correctly on Ubuntu, there are four processes with the same name but different process-id in the system monitor. But if I build my source with `gcc` on Linux, it generates only 1 process, so I think `fork()` or `exec()` may not be called. How can one exec file make four processes? The `ps -elF` shows:               F S UID        PID  PPID  C PRI  NI ADDR SZ WCHAN  STIME TTY          TIME CMD     4 S root      3679  3314  0  57   - -  4362 hrtime 17:44 pts/1    00:00:00 /root/Test/test     5 S root      3680  3679  0  57   - -  4362 poll_s 17:44 pts/1    00:00:00 /root/Test/test     5 S root      3681  3680  0  56   - -  4362 rt_sch 17:44 pts/1    00:00:00 /root/Test/test     5 S root      3682  3680  0 -40   - -  4362 rt_sch 17:44 pts/1    00:00:00 /root/Test/test


Set Ubuntu System Proxy Settings without Restart from commandline

I am using `Ubuntu 14.04` . I want to change the `http proxy` settings from the command line. This should be equivalent to changing in the GUI(All Settings->Network->Network Proxy) and clicking the button `Apply System Wide`. I don't want to restart/logout the system as I am planning to change the settings dynamically from a script(`bash`).


vsftpd for virtual users: login directory isn't world readable. Then what's the use?

To configure vsftpd for virtual users, I followed this link. Though I succeeded in making the virtual users log into the system but it didn't work exactly the way mentioned in the document I followed. The last section (i.e. comments) of the document mentioned in the link (I am posting it below for your ease) says that the login directory is not world readable and it's expected that way. My question is: if it's expected that way only, then what is the use as no user can read any directory and find if a file is there or not to download? The login directory is as below: drwx------ 3 virtual virtual 4096 Jul 30 00:39 /home/ftpsite               This example shows how to set up vsftpd / PAM with "virtual users". A virtual user is a user login which does not exist as a real login on the system. Virtual users can therefore be more secure than real users, beacuse a compromised account can only use the FTP server.          Virtual users are often used to serve content that should be accessible to untrusted users, but not generally accessible to the public.          Step 1) Create the virtual users database. We are going to use pam_userdb to authenticate the virtual users. This needs a username / password file in "db" format - a common database format. To create a "db" format file, first create a plain text files with the usernames and password on alternating lines. See example file "logins.txt" - this specifies "tom" with password "foo" and "fred" with password "bar". Whilst logged in as root, create the actual database file like this:          db_load -T -t hash -f logins.txt /etc/vsftpd_login.db (Requires the Berkeley db program installed). NOTE: Many systems have multiple versions of "db" installed, so you may need to use e.g. db3_load for correct operation. This is known to affect some Debian systems. The core issue is that pam_userdb expects its login database to be a specific db version (often db3, whereas db4 may be installed on your system).          This will create /etc/vsftpd_login.db. Obviously, you may want to make sure the permissions are restricted:          chmod 600 /etc/vsftpd_login.db          For more information on maintaing your login database, look around for documentation on "Berkeley DB", e.g. http://www.sleepycat.com/docs/utility/index.html               Step 2) Create a PAM file which uses your new database.          See the example file vsftpd.pam. It contains two lines:          auth required /lib/security/pam_userdb.so db=/etc/vsftpd_login account required /lib/security/pam_userdb.so db=/etc/vsftpd_login          This tells PAM to authenticate users using our new database. Copy this PAM file to the PAM directory - typically /etc/pam.d/          cp vsftpd.pam /etc/pam.d/ftp          (Note - if you set pam_service_name to e.g. vsftpd instead, you'll need to copy to /etc/pam.d/vsftpd).               Step 3) Set up the location of the files for the virtual users.          useradd -d /home/ftpsite virtual ls -ld /home/ftpsite (which should give): drwx------    3 virtual  virtual      4096 Jul 30 00:39 /home/ftpsite          We have created a user called "virtual" with a home directory "/home/ftpsite". Let's add some content to this download area:          cp /etc/hosts /home/ftpsite chown virtual.virtual /home/ftpsite/hosts               Step 4) Create your vsftpd.conf config file.          See the example in this directory. Let's go through it line by line:          anonymous_enable=NO local_enable=YES          This disables anonymous FTP for security, and enables non-anonymous FTP (which is what virtual users use).          write_enable=NO anon_upload_enable=NO anon_mkdir_write_enable=NO anon_other_write_enable=NO          These ensure that for security purposes, no write commands are allowed.          chroot_local_user=YES          This makes sure that the virtual user is restricted to the virtual FTP area /home/ftpsite we set up above.          guest_enable=YES guest_username=virtual          The guest_enable is very important - it activates virtual users! And guest_username says that all virtual users are mapped to the real user "virtual" that we set up above. This will also determine where on the filesystem the virtual users end up - the home directory of the user "virtual", /home/ftpsite.          listen=YES listen_port=10021          This puts vsftpd in "standalone" mode - i.e. not running from an inetd. This means you just run the vsftpd executable and it will start up. This also makes vsftpd listen for FTP requests on the non-standard port of 10021 (FTP is usually 21).          pasv_min_port=30000 pasv_max_port=30999          These put a port range on passive FTP incoming requests - very useful if you are configuring a firewall.          Copy the example vsftpd.conf file to /etc:          cp vsftpd.conf /etc/               Step 5) Start up vsftpd.          Go to the directory with the vsftpd binary in it, and:          ./vsftpd          If all is well, the command will sit there. If all is not well, you will likely see some error message.               Step 6) Test.          Launch another shell session (or background vsftpd with CTRL-Z and then "bg"). Here is an example of an FTP session:          ftp localhost 10021 Connected to localhost (127.0.0.1). 220 ready, dude (vsFTPd 1.1.0: beat me, break me) Name (localhost:chris): tom 331 Please specify the password. Password: 230 Login successful. Have fun. Remote system type is UNIX. Using binary mode to transfer files. ftp> pwd 257 "/" ftp> ls 227 Entering Passive Mode (127,0,0,1,117,135) 150 Here comes the directory listing. 226 Transfer done (but failed to open directory). ftp> size hosts 213 147 ftp>          Comments: The password we gave was "foo". Do not be alarmed by the "failed to open directory". That is because the directory /home/ftpsite is not world readable (we could change this behaviour if we wanted using anon_world_readable_only=NO but maybe we want it this way for security. We can see that we have access to the "hosts" file we copied into the virtual FTP area, via the size command.


"w | tail" chops text at right margin (78 characters)

**Summary:** `w | tail` chops rows after 78th column. When I run the "w" command, it works as expected. However, when I pipe the output to "tail", it chops the output to **78** columns wide (truncates anything after right margin). I've checked `set` and `env` for any values of 78 (or 79 or 80), as well as `TERM` (xterm|ansi|vt100), and `stty -a` settings, as well as `tail` and `w` (they look OK). `$COLUMNS` is set to 209 (but this doesn't matter...I set it to 100 with the same results). I'm running CentOS 5 (kernel - 2.6.18). The `tail` and `w` binaries look OK to me. > /usr/bin/w: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for > GNU/Linux 2.6.9, dynamically linked (uses shared libs), stripped               CentOS$ cat 80.txt               1         2         3         4         5         6         7         8     012345678901234567890123456789012345678901234567890123456789012345678901234567890     ----------+---------+---------+---------+---------+---------+---------+---------+     CentOS$ export COLUMNS=100     CentOS$ w | tail -5 | sed 's/./\./g'     .....................................................................     ...............................................................................     ...............................................................................     ...............................................................................     ...............................................................................


mutt: define which headers are displayed (in compose)

When composing a message in `mutt`, I see the following headers:                   From:            To:            Cc:          Bcc:      Subject:     Reply-To:          Fcc: ~/.mail/sent          Mix: <no chain defined>     Security: None      I don't know what the `Mix:` header is for, and I don't think I will ever need it. Similarly, I will not need to edit the `Reply-To:` header. These two useless lines are taking up valuable space. Is it possible to remove these headers entirely? Can I specify which headers are displayed in the compose menu?


Replace a word after a significant line and white spaces (inline) using sed?

I have the following text:                 A       Hello       world       B       Hello       world       C       Hello       world      I know that I can replace `Hello` by `Hi` using `sed`:               sed 's/Hello/Hi/g' -i test      but this replace each `Hello` with `Hi`:                 A       Hi       world       B       Hi       world       C       Hi       world      what I really want is to replace only the `Hello` after `B`:                 A       Hello       world       B       Hi       world       C       Hello       world      so I have tried this:               sed 's/"B\nHello"/"B\nHi"/g' -i test      but nothing happened, How can I do this? Note: There are some white-spaces on the beginning of each line of the file.


How do I install plugins for collectd

I have installed collectd and got it running but also wanted to use the Ping plugin ( https://collectd.org/wiki/index.php/Plugin:Ping ) but it's not actually installed by default (i.e. not in the list of plugins in /opt/collectd/lib/collectd How do I install a plugin that doesn't come with collectd and where do I get the plugin itself? I have been Googling in circles for this but can't find anything. Thanks,


Block TTY echo to display

I have a minimal Ubuntu as a Linux server. It starts many scripts on startup that is ok but I want to disable tty1 to echo everything to display When I start this server a login promt is presented on tty1 and I want the display to be clear so nobody can see what is being typed into.


How can we rename a file with semi-colon as part of the filename?

I tried to rename all file with extension "XLS;1" to "XLS" but it just didn't work. I tried the following in cygwin in windows xp and they don't work:               mv *.XLS;1 *.XLS          mv *.XLS\;1 *.XLS          mv "*.XLS;1" *.XLS


Why does this ssh command not work? (cat ./file | ssh <user@host> "cat | sudo -t -t 'cat > /root/location/file'")

I'm trying to do the following but it's not quite right.               cat ~/Desktop/blah.png | ssh -t -t trusktr@50.116.4.56 "cat | sudo -i 'cat | /path/to/blah.png'"      I have my public ssh key in the trusktr@50.116.4.56 user's .ssh folder, so no initial password is needed. When the `sudo -i` command finally starts, it prompts me for the root password, but immediately fails as if I had pressed enter but I didn't even touch the keyboard. I have a feeling maybe the `cat` command is being catted into the password prompt. The output looks like this:               trusktr@LENOVO-PC ~     $ cat ~/Desktop/win-8.1-missing-lockscreen-setting.png | ssh -t -t trusktr@50.116.4.56 "cat | sudo -i 'cat > /srv/http/default/htdocs/~/img/win-8.1-missing-lockscreen-setting.png'"     tcgetattr: Not a character device     [sudo] password for root:     You type like i drive.     [sudo] password for root:     Your mind just hasn't been the same since the electro-shock, has it?     [sudo] password for root:     Maybe if you used more than just two fingers...     sudo: 3 incorrect password attempts     Connection to 50.116.4.56 closed.      I don't have direct ssh access through the root user, only through a normal user with access to sudo using the root password. How might I cat the image through ssh, through the non-root user, into the root location all in a single command?


USB 3G Modem for embedded Linux?

I am fairly new to Linux world, I have to develop an application on embedded Linux which sends data over internet. I have to choose a USB 3G modem with a SIM card holder. I would appreciate if anyone can help me choosing a USB 3G modem which works successfully or is supported on embedded Linux.


Is it okay to disable requiretty?

I'm trying to set up a deploy script using Capistrano At a step `cap deploy:setup` script is connecting to my server and trying to run commands that create directories. Then I see an error: `msudo: sorry, you must have a tty to run sudo` There is a suggested solution to disable requiretty on my server. http://unix.stackexchange.com/a/49078/26271 I'm wondering if it is safe to do?


Why $PATH variable different between two directories?

When I'm in one directory and echo path               pwd     /Users/me/src/some_proj          echo $PATH     /Users/me/.gem/ruby/2.0.0/bin:/opt/boxen/chruby/versions/2.0.0-     p353/lib/ruby/gems/2.0.0/bin:/opt/boxen/chruby/versions/2.0.0-     p353/bin:bin:/opt/boxen/chruby/bin:/opt/boxen/ruby-     build/bin:node_modules/.bin:/opt/boxen/nodenv/shims:/opt/boxen/nodenv/bin:     /opt/boxen/bin:/opt/boxen/homebrew/bin:/opt/boxen/homebrew/sbin:     /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin      When I'm in a different directory and echo path               pwd     /Users/me/src_personal/my_gems/som_gem          echo $PATH     bin:/opt/boxen/chruby/bin:/opt/boxen/ruby-build/bin:     node_modules/.bin:/opt/boxen/nodenv/shims:/opt/boxen/nodenv/bin:     /opt/boxen/bin:/opt/boxen/homebrew/bin:/opt/boxen/homebrew/sbin:     bin:/opt/boxen/chruby/bin:/opt/boxen/ruby-build/bin:     node_modules/.bin:/opt/boxen/nodenv/shims:/opt/boxen/nodenv/bin:     /opt/boxen/bin:/opt/boxen/homebrew/bin:/opt/boxen/homebrew/sbin:     bin:/opt/boxen/chruby/bin:/opt/boxen/ruby-build/bin:     node_modules/.bin:/opt/boxen/nodenv/shims:/opt/boxen/nodenv/bin:     /opt/boxen/bin:/opt/boxen/homebrew/bin:/opt/boxen/homebrew/sbin:     /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin      I get a different $PATH. I thought $PATH was a global variable in the shell that doesn't change. Why are these paths different in different directories?


How to write a systemd .service file running systemd-tmpfiles

I need to run `systemd-tmpfiles --create` during the boot process with a systemd distro. So I need to create a systemd .service file doing this job. In this question you can read all the details about what I need and why: How does systemd-tmpfiles work? I have read some docs about it and I am writing the following test:               [Unit]     Description=Execute tmpfiles to disable usb-wakeup # see details in the link above     Requires=multi-user.target # see details in the link above     After=multi-user.target    # see details in the link above          [Service]     Type=oneshot     ExecStart=/usr/bin/systemd-tmpfiles --create          [Install]     WantedBy=multi-user.target      But I'm not sure, because `systemd-tmpfiles` is not a simple program but a piece of systemd itself. I wouldn't like to break my system. Any tips about a correct .service file?


How do I apply this revert commit patch from git?

I have found a patch applicable to my system to fix a problem but I have no idea how to get this patch and then apply it. Can anybody help me please? Patch: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c11e5f35ab490bd30591563816fbc83526521777


comm fails on bash variable input

I have a script that's supposed to get the list of files of two directories, get differences and execute some code for certain files. These are the commands to get the file lists:               list_in=$(find input/ -maxdepth 1 - type f | sed 's/input\///' | sort -u);     list_out=$(find output/ -maxdepth 1 - type f | sed 's/output\///' | sort -u);      I execute the script in the correct directory, so this shouldn't fail. The unprocessed files are determined by               list_todo=$(comm -23 <(echo "$list_in") <(echo "$list_out"));      since the option `-23` for `comm` only prints lines of the first argument, that don't appear in both arguments and doesn't print lines that uniquely appear in the second argument. However, only occasionally I get an error saying               command substitution: line 3: syntax error near unexpected token `('     command substitution: line 3: `comm -23 <(echo "$list_in") <(echo "$list_out")'      This really puzzles me, since the exact same script worked fine for the last 3 weeks. I'm using this on a cluster, so several processes might execute the script simultaneously. May the error be caused by this? **Update**. The script is called with `./script` and I've obviously set `chmod +x script` before. (Disclaimer: Even though I'm working on a cluster and these first three lines of my script don't include any locking mechanisms: Of course, no file is ever processed twice)


What is wrong with my JDK installation?

I tried to compile a Hello world example in java and got a gcc error. As far as I understand it, gcc is trying to compile my java class (and for some reason failing to find the main method, but that's beside the point). I have openSUSE 12.1 64 bit and JDK 1.7 (installed from Oracle's rpm). I have `/usr/java/jdk1.7.0_04/bin/:/usr/java/jdk1.7.0_04/` in my $PATH. When I try to compile a java file, I get:               rumtscho@bradbury:/tmp> javac Hello.java     /usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../lib64/crt1.o:      In function `_start':     /home/abuild/rpmbuild/BUILD/glibc-2.14.1/csu/../sysdeps/x86_64     /elf/start.S:109: undefined reference to `main'      Why is this happening and how can I correct the problem? **Edit** my complete $PATH is: > rumtscho@bradbury:/tmp> echo $PATH > /home/rumtscho/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:.:/home/rumtscho/bin:/home/rumtscho/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/home/rumtscho/android- > sdk-linux/tools:/home/rumtscho/android-sdk-linux/platform- > tools:/usr/java/jdk1.7.0_04/bin/:/usr/java/jdk1.7.0_04/:/home/rumtscho/bin:/home/rumtscho/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/home/rumtscho/android- > sdk-linux/tools:/home/rumtscho/android-sdk-linux/platform- > tools:/usr/java/jdk1.7.0_04/bin/:/usr/java/jdk1.7.0_04/


How to make dual boot live dvd

Can we make a live dvd with a dual boot option between Ubuntu and Linux mint? I have both the iso's. They both are larger than 800mb. If I will burn 2 dvd's, Then a lot of space will be wasted. So I wanted to make one live cd that can boot both of them. I have searched the net but did not find any result.


How do I know if acct is running? (The Linux user accounting system)

I have installed the `acct` package and it is running because I can see file activity in the log file. I know there is the command `accton on` to turn it on, but how do I determine that its running short of checking that there is activity in the log file? I believe from my reading that there is no daemon running as the accounting is managed as part of the kernel and this program simply enables the activity to be logged. PS: There is no process called "acct"


Skype webcam upside down but v4l1compat missing

I am running Linux Mint, but i think this issue will be mutual with Ubuntu. My webcam in Skype is upside down (in Cheese it's ok). There are a lot of topics dealing with this coming up with fix like this:               $ LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so skype      or similar modifications. Unfortunately, I don't have this file.               $ locate v4l1compat.so      outputs only:               /usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so      which doesn't work:               $ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so skype     ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so' from LD_PRELOAD cannot be preloaded: ignored.      Skype loads, but the webcam is still upside down. I remember I've read somewhere that I should use 32bit libraries because of skype. But how can I get those? I tried simple copy from another Linux machine, but that unsurprisingly did not help.


How to disable swap file after install or during Kubuntu install?

My computer has more than 64KB of RAM (8GB), if I run out of memory I want things to crash so I know I'm out of RAM so I'll buy some instead of say wandering why my computer is running slowly when I can just spend another $40 for another 8GB of RAM. I'm running Kubuntu in VirtualBox. I'm not sure if there is any way to permanently disable the swap file after the installation has finished. As with previous Linux installs I've found that the newer GUI installers do NOT provide an option to have a single partition without a swap forcing me to use the old DOS/Console styled installers which do. If I have to reinstall from scratch (not a huge ordeal for me) are there multiple installers or does the regular Kubuntu installer provide a manner to install without a swap file?   * I'm absolutely sure I want to do this, I have not run a pagefile in years in both XP and other Linux distros I've tried and enjoy my systems being responsive.   * I'm semi-capable in the console though please do not ask me to type a hundred lines to do a simple copy/paste or text edit, I'm interested in Linux for production not a hobby.   * I'll be happy to both accept and up-vote whatever answer works as well as clarify anything.


Extend my LVM After Upgrading SSD

So, I have a 120 GB SSD (/dev/sdb) that I have a dual boot of Windows 7 and Fedora 17. When I first started I only have a 60 GB SSD so my space was very limited. I have a partition on my SSD (dev/sdb4) which I created with gparted, that shows a "Partition 5 LVM2" (dev/sdb5) below it which I believe is what the LVM is stored on(?). Anyways, using gparted I extened my /dev/sdb4 to 27GB, which then created a "Free Space" of 17GB within /dev/sdb4. Now I need to combine /dev/sdb5 and the free space into one. I've tried: `lvextend -L+16G /dev/vg_mine/lv_root` which results in:               Extending logical volume lv_root to 20.97 GiB     Insufficient free space: 512 extends needed, but only 0 available      I then used a `resize2fs /dev/vg_mine/lv_root` which results in: `The filesystem is already 1302528 blocks long, nothing to do!` Anybody point me in the right direction? Am I on the right track so far?


Do the "play" utility in Linux really have a "delay" to stop it's process with really small files?

I have a wav file, Duration: 00:00:00.17 (less than a second!) When I call `play` to execute it, `play` executes it fine, but my terminal becomes idle for ~4s until play process is done. Is this by design? Is it possible to just play the sound and be done in less than a second? **EDIT** : Running `time` as suggested by @jsbillings:                File Size: 1.89k     Bit Rate: 90.3k       Encoding: Unsigned PCM         Channels: 1 @ 8-bit         Samplerate: 11025Hz           Replaygain: off                Duration: 00:00:00.17            In:100%  00:00:00.17 [00:00:00.00] Out:1.85k [!=====|=====!]        Clip:0         Done.          real    0m2.912s     user    0m0.004s     sys         0m0.008s


Executing a shared library

Some shared libraries provide an output when called from the command line as if they were executables. For example:               $ /lib/libc.so.6      GNU C Library stable release version 2.13, by Roland McGrath et al.     Copyright (C) 2011 Free Software Foundation, Inc.     This is free software; see the source for copying conditions.     There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A     PARTICULAR PURPOSE.     Compiled by GNU CC version 4.5.2.     Compiled on a Linux 2.6.37 system on 2011-01-18.     [...]      In a shared library of my own written in C, how can I provide this output? I've executed now a library I just made and I get a `segment fault`.


How can I run my own scripts in kate 3.8.2? "External tools" isn't available in the plugins section

I am using Kubuntu 12.04 LTS. How can I run my own scripts in `kate` 3.8.2? It appears that the plugin named _External tools_ is no longer available. I would like to run Python or shell scripts in kate and invoke them using a keyboard shortcut, such as `F4`. As an example, this simple script would ideally change to a specific window when I press `F4`.               #!\bin\sh     wmctrl -a "<Window name>"


Can I redirect logfiles to syslog?

I have a Node.js server that is being monitored by forever. Forever generates three logfiles: the server STDOUT, STDERR and the log of forever itself.               $ forever -l forever.log -o out.log -e err.log app.js      But instead of logging to logfiles I would like to log everything to syslog, optionally with adding a prefix of some sorts so my syslog processing servers can sort everything out. On StackOverflow, someone suggested that this can be handled using some bash wrapper and suggested I ask here. So, how would I get those logs into syslog instead of into files?


SSH Bash Jail Session

I've seen some game tunneling service providers that jails the customer's account to a Information screen upon login and any input is ignored. Ctrl+C closes the SSH session, and disconnecting. This basically jails the user, but maintains the Tunnel. This made me very curious how it's done. Does anyone knows how this could be done?


How to remove URI encoding in file names

I realise this might be quite a simple question, but I'm still quite new to the command line and only have a grasp of basic commands. I've downloaded some lecture presentations (~25 or so) from my University however on doing so they've been named things like...               L2%20Development%20of%20immune%20system.pptx     L4%20Molecular%20Recognition.pdf      As you can see they've downloaded with the URL encoding `%20` instead of a space. My question is how to batch rename all of these files so that the `%20` is removed and replaced with a space instead?


Is it possible to generate a separate file list when creating a tarball?

When using `tar` for backups I'd like to create a separate list of the files that is included in the archive for storing alongside the backup tarball. I also want to be able to store the error messages from tar in a log. Solutions that's not so good:   * `tar --verbose` ... `&> filelist.txt` But this would give errors + file list in one file.   * `tar --list` after the tarball has been created. But this takes a long time. Is there some way to get the file list and store it in a separate file at the same time as I'm rolling the ball for the first time?


Red Hat Enterprise Linux 6 wakes up spontaneously after sleeping

I have a Lenovo ThinkPad T430 running Red Hat Enterprise Linux 6.5. Today I put my computer to sleep, double checked 10 seconds later, only to find out after arriving to my office that my computer woke up inside my backpack. If ThinkPads weren't made of adamantium it would be probably fried. What's happening?


Create partition aligned using parted

I'm partitioning a non-SSD hard disk with _parted_ because I want a GPT partition table.               parted /dev/sda mklabel gpt      Now, I'm trying to create partitions correctly aligned so I use the next command to know where begins the first sector:               parted /dev/sda unit s p free          Disk /dev/sda: 488397168s     Sector size (logical/physical): 512B/512B     Partition Table: gpt          Number  Start  End         Size        File system  Name      Flags             34s    488397134s  488397101s  Free Space      We can see that it starts in the sector 34 (it's by default when this partition table is used). So, to create the first partition I tried:               parted /dev/sda mkpart primary 63s 127s      to align it in the sector 64 since it's multiple of 8 but it shows: **Warning: The resulting partition is not properly aligned for best performance.** The sector size logical and physical in my hard disk are both of 512 bytes:               cat /sys/block/sda/queue/physical_block_size     512          cat /sys/block/sda/queue/logical_block_size      512      How to create partitions correctly aligned? What I'm doing wrong?


Where can I find documentation about the "sudo !!" command

I just learned that Linux has a `sudo !!` command which literally applies `sudo` to the last entered command. I had never heard about it. Is that a common control? Where can I find documentation about it?


CentOS vs RedHat on hp DL 380 G5

hp lists downloads for:               »   Red Hat Enterprise Linux 5 Server (x86)     »   Red Hat Enterprise Linux 5 Server (x86-64)     »   Red Hat Enterprise Linux 6 Server (x86)     »   Red Hat Enterprise Linux 6 Server (x86-64)      but only               »   CentOS 5      Since, as I understand it, CentOS is basically repackaged RHEL, is there any reason I shouldn't be able to run CentOS 6.4 x86_64 on an hp DL 380 G5, including running the management rpms meant for EL 6? (I've come across threads about CentOS 6.2 having some issues, but not 6.4.) (The management rpms are somewhat key since they would allow me to keep tabs on how the RAID array is functioning via a script, which is what I'm used to.) Can anyone confirm success/trouble with 6.4 64-bit on a G5?


delete line in vi

How can I delete a line in VI? Here what I am doing right now:   1. Open up the terminal `alt` + `ctrl` + `t`   2. `vi a.txt`   3. I move my cursor to the line which I wan to delete, then **what key-combination is should use to delete line in vi editor**?


Getting "A hard disk may be failing" on startup

![Error](http://i.stack.imgur.com/KQ8Qx.png) I keep getting this error message each time I start GNOME, even though I created a new partition table on this drive, I formatted all the partitions, and created them again, and this just won't go away. Any suggestions? **Edit:** I ran badblocks, and this is what I got > badblocks -svw /dev/sdb Checking for bad blocks in read-write mode From > block 0 to 80042206 Testing with pattern 0xaa: done   >  Reading and comparing: done   >  Testing with pattern 0x55: done   >  Reading and comparing: done   >  Testing with pattern 0xff: done   >  Reading and comparing: done   >  Testing with pattern 0x00: done   >  Reading and comparing: done   >  Pass completed, 0 bad blocks found


I can open a Debian installation DVD but I can't boot the laptop from it

I recently download a DVD from http://cdimage.debian.org/debian- cd/7.6.0/amd64/iso-dvd/debian-7.6.0-amd64-DVD-1.iso and I have an old Toshiba laptop which is running old Debian system on it. After I burn a DVD for above ISO, I try to open it from the target laptop and it works fine. But after I set the laptop to boot from CD/DVD, it can never boot up and fallback to the original GRUB in the laptop. Does anyone know if it is due to I burned this DVD with a tool from Microsoft which originally used to burn Windows installation disk? Thanks!


Compiling sample SFML program problems

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.


targeting a specific block with e2fsck to shorten wait

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?


Running GUI application as another (non-root) user

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?


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

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?


Can XBMC play Blu-Ray disks?

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


Confused by different output from iptables -L

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?


Debian stucks at formatting 33%

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!


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

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


Text processing - Find text before/after given word

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.


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

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.


iptables to block https websites

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.


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

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


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

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?


How often does Debian update its Stable repository?

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


Looking for a distro with GUI fit for Windows 98 PCs

I have a Windows 98 computer that we still use (the hardware works just fine, but Windows is becoming a bit flaky and I'd rather go problem hunting and solving with Linux rather than Win98). I'm looking for a _very_ lightweight distribution (with a GUI, not command line) that is able to run the following:   * An email client which supports POP3    * A "more up to date" web browser (the banking website refuses to show up in the old Internet Explorer version it's running)   * An app able to open and modify Word and Excel documents   * FTP, DropBox, or some way to share and sync files with another computer That is ALL the software that's needed (though, having Skype support would be helpful, but not required) It uses a Pentium II Processor, which means it's CPU is between 233 MHz and 450 MHz (I can't seem to find the exact number from within Windows), and 256 MB RAM.


Why are files in my home dir being created as world-writable despite a more-restrictive umask?

I've realized that the permissions for new files and directories behave a bit strangely. First of all, umask seems to return the right answer:               $ umask     0002      This means full access for my user and my group, no write access for the rest of the world, no suid. But if I create a file in my $HOME, this is how it looks:               $ ls -l testfile      -rw-rw-rw- 1 robe robe 0 mar 16 12:58 testfile      i.e. , giving write access to everyone. The same happens with directories:               $ ls -ld testdir     drwxrwxrwx 2 robe robe 6 mar 16 13:00 testdir      I think this is the same as having umask 0000, not 0002. I've searched all /etc for some instance of umask that changes the default 0002 or 0022, but found none. This is a default CentOS 5.5 install. Any hint of why is this happening?


How to partition an OpenBSD if it's used as a static HTTPD server?

So mount options can be useful because it can afaik increase the security of a webserver that is only serving static html files. What are the best mount options/partition schemes for az OpenBSD 5.2 that is used only for static HTTPD server?


Running bzImage in QEMU

I compiled the kernel by doing `make menuconfig` and `make`. I was trying to run the bzImage in qemu, by doing `qemu -kernel bzImage` but it didn't work out: ![Linux kernel error](http://i.stack.imgur.com/eMx7o.png) How can I fix it? How can I run the bzImage in qemu?


SSH config file + shell script help

Well, what I want to do seems a bit convoluted but its the only way I can think of to get the result I want. So here goes. I want to automate ssh to my Pi, in the following fashion:   1. My Pi boots up and auto-starts 4 separate instances of screen running bfgminer.   2. Have a shell script on my laptop to ssh into the Pi and open 4 terminals. 1 per screen instance. So I can monitor them all AND control the terminals. I have looked into tmux, but at this point I'm lost. So I'm thinking something along these lines:   1. Pi boots and runs 4 screen instances named USB0, USB1, USB2, USB3 (This is already completed)   2. On my laptop, open terminal and start my shell script. Something like this:              gnome-terminal -e <ssh into pi and open 'screen -d -r USB0'>     gnome-terminal -e <ssh into pi and open 'screen -d -r USB1'>     gnome-terminal -e <ssh into pi and open 'screen -d -r USB2'>     gnome-terminal -e <ssh into pi and open 'screen -d -r USB3'>        3. This will then open 4 terminal windows each automatically connecting to a separate screen instance.  I think this is possible with ssh config file. But I don't know how to do it. I know it should be possible to get ssh to auto login with username and password, and make it call up screen. Maybe have ssh autologin and run a script on the pi to begin screen? I have tried using screen's split screen but its not what I want. And tmux scares me.


Postfix unable to send mail from mydomain only

My domain DNS is served by the domain registrar. I am able to send mail successfully from any address with postfix but not from mydomain.com From this machine - I only want to be able to send mail. I know it must have something to do with DNS and my domain registrar. When postfix main.cf configuration has               mydestination = localhost, localhost.localdomain      I am getting:               status=bounced (mail for mydomain.com loops back to myself)      When I add mydomain.com to the mydestination (as suggested on the internet)               mydestination = mydomain.com, localhost, localhost.localdomain      I get               status=bounced (unknown user: )      Now I know I am missing something very obvious here, I just can't figure what that is.


couldn't update git via git clone comand

I am just a beginner in Git. Was following through the documentation and installed Git using source code package. Now, after installing Git, I want to update it (Though it might be unnecessary at this time, I simply want to try and make sure it works). I ran the command `git clone git://git.kernel.org/pub/scm/git/git.git` and it returned error `-bash: /usr/bin/git: No such file or directory`. Reason might be obvious, since for installing git, I used the command `make prefix=/usr/local install` which installed Git in `/usr/local/bin/git` Now, how to fix this? I tried the same git clone command with `\--git-dir=/usr/local/bin/git` which returned the same error `-bash: /usr/bin/git: No such file or directory`


Installing a new OpenBSD kernel "safely": why does `make install` go through these extra hoops?

After building a new OpenBSD kernel, the `install` target of the kernel `Makefile` does the following:               rm -f /obsd     ln /bsd /obsd     cp bsd /nbsd     mv /nbsd /bsd      I understand that the first two lines remove the old backup kernel `/obsd` and create a hard link `/obsd` pointing to the currently running kernel `/bsd`. In particular, the running kernel is not moved at all. This makes sense to me. However, what is the purpose of moving the newly built kernel `./bsd` first to `/nbsd` and then renaming it to `/bsd`? Why not replace the third and fourth line by the apparently simpler `cp bsd /bsd`? If this should matter: the default partitioning scheme of OpenBSD places the kernel build tree in a different filesystem (disklabel) than the root filesystem.


kill a group of processes with negative PID

kill -TERM -PID       is supposed to kill PID and all its child processes.   but this doesn't work on openSUSE, it always tell me that no such process -PID no matter what PID i use.   So if the negative PID option is not supported by this particular version of kill, what is the best way to kill a group of processes? background:   I have a shell script running. inside the script, I use wget to download things. So the script is the parent process, wget is the child process. I want to kill them both using kill -TERM -PID_OF_SCRIPT


Using Ctrl+[0-9] to cycle between windows using tmux

I have started using `tmux` but I feel that using `Ctrl``b``0-9` is very annoying, because it's used so often. How do I bind the keyboard so I only need to do `Ctrl``0-9` for changing windows (like in Chrome)? I have tried to configure it in the `.tmux.conf`, but without any success. this is my current .tmux.conf file               bind C select-pane -t :.+     set -g status-bg black     set -g status-fg white


Using a differencing, aka overlay, aka union, file-system with commit capability

I work in two PCs and I sync all my files from my primary PC to a USB flash memory. In my second PC, I mount the USB flash memory to the same path to work on my files as I were on my primary PC. Now for the sake of performance and flash memory lifetime, I need to use any type of differencing, aka overlay, aka union, file-system (like unionfs or aufs) to let me use the USB flash disk as read-only and write changes to a temp directory and at the end allows me to write the changes back to the USB flash at once. Any help? Any hope? **Update:** Thanks for all your answers and comments. I am interested in Linux and my question is: **Does any of the above file-systems allow committing the writes to the lower file-systems when required? If yes, how?**


Debian 6 VM server - network connectivity problem

I'm having a problem with a Debian 6 VM server where it looses network connectivity and doesn't come back (server does not respond to pings, and can't connect to any services). This is a wired network connection in a data center where the network is up when the problem occurs. When logged into the console, I confirm that the server doesn't seem to have network conectivity (can't ping ip 8.8.8.8 for example). All services are running though (mysql, Apache, SSH, etc). There are some errors in /var/log/kern.log, but not sure these are related to the problem:               Jan  5 01:43:41 vm2 kernel: [12179513.252191] INFO: task mysqld:1369 blocked for more than 120 seconds.     Jan  5 01:43:41 vm2 kernel: [12179513.253230] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.     Jan  5 01:43:41 vm2 kernel: [12179513.254237] mysqld        D ffff8801b46de9f0     0  1369   1179 0x00000000     Jan  5 01:43:41 vm2 kernel: [12179513.254243]  ffff8801b46de9f0 0000000000000286 ffff8801fd105e18 000000010000000e     Jan  5 01:43:41 vm2 kernel: [12179513.254250]  ffff8801f750f478 ffff8801fd105e18 000000000000f9e0 ffff8801fd105fd8     Jan  5 01:43:41 vm2 kernel: [12179513.254253]  00000000000157c0 00000000000157c0 ffff8801fd1c5bd0 ffff8801fd1c5ec8     Jan  5 01:43:41 vm2 kernel: [12179513.254259] Call Trace:     Jan  5 01:43:41 vm2 kernel: [12179513.254270]  [<ffffffff810b61e1>] ? wait_on_page_writeback_range+0xce/0x11b     Jan  5 01:43:41 vm2 kernel: [12179513.254282]  [<ffffffffa001fe20>] ? log_wait_commit+0xbf/0x112 [jbd]     Jan  5 01:43:41 vm2 kernel: [12179513.254288]  [<ffffffff81066332>] ? autoremove_wake_function+0x0/0x2e     Jan  5 01:43:41 vm2 kernel: [12179513.254296]  [<ffffffff8130f142>] ? _spin_unlock_irqrestore+0xd/0xe     Jan  5 01:43:41 vm2 kernel: [12179513.254303]  [<ffffffffa00303f8>] ? ext3_sync_file+0x94/0xc8 [ext3]     Jan  5 01:43:41 vm2 kernel: [12179513.254309]  [<ffffffff8110d6e0>] ? vfs_fsync_range+0x73/0x9e     Jan  5 01:43:41 vm2 kernel: [12179513.254312]  [<ffffffff8110d78a>] ? do_fsync+0x28/0x39     Jan  5 01:43:41 vm2 kernel: [12179513.254316]  [<ffffffff8110d7b9>] ? sys_fsync+0xb/0x10     Jan  5 01:43:41 vm2 kernel: [12179513.254319]  [<ffffffff8130f6fa>] ? error_exit+0x2a/0x60     Jan  5 01:43:41 vm2 kernel: [12179513.254323]  [<ffffffff81011b42>] ? system_call_fastpath+0x16/0x1b       When the problem happens, the network interfaces are up (I checked ifconfig, all interfaces looked normal). I also check iptables, and verify there were no rules that would block anything. I also try running /etc/init.d/networking/restart, but that does not fix the problem. The only thing I've found that fixes the problem is rebooting. Hoping for some advice on things I can check to help troubleshoot this problem.


How can I send stdout to multiple commands?

There are some commands which filter or act on input, and then pass it along as output, I think usually to `stdout` - but some commands will just take the `stdin` and do whatever they do with it, and output nothing. I'm most familiar with OS X and so there are two that come to mind immediately are `pbcopy` and `pbpaste`- which are means of accessing the system clipboard. Anyhow, I know that if I want to take stdout and spit the output to go to both `stdout` and a file then I can use the `tee` command. And I know a little about `xargs`, but I don't think that's what I'm looking for. I want to know how I can split `stdout` to go between two (or more) commands. For example:               cat file.txt | stdout-split -c1 pbcopy -c2 grep -i errors      There is probably a better example than that one, but I really am interested in knowing how I can send stdout to a command that does not relay it and while keeping `stdout` from being "muted" - I'm not asking about how to `cat` a file and `grep` part of it and copy it to the clipboard - the specific commands are not that important. Also - I'm not asking how to send this to a file and `stdout` - this may be a "duplicate" question (sorry) but I did some looking and could only find similar ones that were asking about how to split between stdout and a file - and the answers to those questions seemed to be `tee`, which I don't think will work for me. Finally, you may ask "why not just make pbcopy the last thing in the pipe chain?" and my response is 1) what if I want to use it and still see the output in the console? 2) what if I want to use two commands which do not output `stdout` after they process the input? Oh, and one more thing - I realize I could use `tee` and a named pipe (`mkfifo`) but I was hoping for a way this could be done inline, concisely, without a prior setup :)


User logged in by sftp does not show up in `w`

My server is Centos 5. I have a chroot environment set up with the following in my sshd_config               Match group sftponly         ForceCommand internal-sftp         ChrootDirectory %h         AllowTcpForwarding no         PasswordAuthentication yes     Match      When a user connects by sftp, a line is added to /var/log/secure:               Sep  3 15:30:20 servername sshd[26548]: pam_unix(sshd:session): session opened for user test by (uid=0)      However they are not present when executing `w`:               [root@servername home]# w      15:30:47 up 156 days,  1:00,  3 users,  load average: 0.05, 0.18, 0.32     USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT     mike     pts/1    12.34.56.78      Fri16    0.00s  0.10s  0.03s sshd: mike [priv]      But when users connect by SSH (like the user above), they are present. Is this standard behavior?


Debian - install missing man pages?

I run RaspBMC - a distro based on Raspbian, that's a custom minimal Debian for the Raspberry Pi. If I recall correctly, the `man` utility is NOT installed by default with RaspBMC (although I may be mistaken). The problem is, packages installed prior to installing the actual `man` utility do not install their man pages. This includes the packages that come pre-installed with the system. Example: I tried with udisks-glue (which comes pre-installed)               $ man udisks-glue     No manual entry for udisks-glue      After re-installing that package, the man page is there.               $ apt-get remove udisks-glue     $ apt-get install udisks-glue     $ man udisks-glue     [Man page gets displayed]      **The question is: can I somehow install _all_ the missing man pages easily?** From what I can see, installing the man pages is a step that's run for each `apt-get install` command:               Unpacking udisks-glue (from .../udisks-glue_1.3.4-1_armhf.deb) ...     Processing triggers for man-db ...     [...]      Using divide-and-conquer, I assume this could be obtained by:   1. getting a list of all installed packages ( `dpkg -l | grep ??? | cut ??? | ???` )   2. finding a way to tell apt-get to re-install a package without messing with the config (a `remove + install` kinda fits the bill, but I don't think it plays nice with dependencies)   EDIT: this should do it:   `sudo apt-get install --reinstall packagename`   3. run 2. over each item in 1. Is this the (simplest) way to go? **Update** I remembered I bricked RaspBMC once doing `apt-get upgrade`, so I want to make sure the packages are NOT upgraded to newer versions when reinstalling (which seems to be the case with `apt-get install --reinstall` by default.


Executing user defined function in a find -exec call

I'm on Solaris 10 and I have tested the following with ksh (88), bash (3.00) and zsh (4.2.1). The following code doesn't yield any result:               function foo {         echo "Hello World"     }          find somedir -exec foo \;      The find does match several files (as shown by replacing `-exec ...` with `-print`), and the function works perfectly when called outside from the `find` call. Here's what the `man find` page say about `-exec`:                -exec command       True if the executed command  returns  a                          zero  value  as  exit status. The end of                          command must be punctuated by an escaped                          semicolon (;).  A command argument {} is                          replaced by the current pathname. If the                          last  argument  to  -exec  is {} and you                          specify + rather than the semicolon (;),                          the command is invoked fewer times, with                          {} replaced by groups of  pathnames.  If                          any  invocation of the command returns a                          non-zero  value  as  exit  status,  find                          returns a non-zero exit status.      I could probably get away doing something like this:               for f in $(find somedir); do         foo     done      But I'm afraid of dealing with field separator issues. Is it possible to call a shell function (defined in the same script, let's not bother with scoping issues) from a `find ... -exec ...` call? I tried it with both `/usr/bin/find` and `/bin/find` and got the same result.


How to test DNS speed?

I am using google open DNS now. I want to test it's speed. How can I? I can ping and see that it gets faster. I need some faster way.


Cannot login to KDE

Last time I booted and logged into my Kubuntu account, I was surprised not to end up on my desktop but in XBMC, which I already installed some months ago. I repeated this several times with the same result. I was able to switch to a virtual terminal, where I uninstalled xbmc, but this did not help. After I enter my login data, I end up seeing nothing but the background of my login screen and my mouse cursor. What can I do? I am completely stuck...


X goes black when using SimpleScreenRecorder

When using `SimpleScreenRecorder`, `X` goes black all the time when I do anything more trivial than typing in a terminal session. I have to switch to another `tty` and back to `X` for it to show again. Does someone know a fix for this, or at least what is causing it? EDIT: System info               Linux localhost 3.12.9-1-t520 #1 SMP PREEMPT Fri Jan 31 14:38:45 CET 2014 x86_64 GNU/Linux     X.Org X Server 1.15.0     i3 version 4.7.2     SimpleScreenRecorder 0.1.2


Cannot rotate screen with xrandr

OS: Linux Mint The output of `inxi -xG`:               Graphics:  Card: NVIDIA GF108 [GeForce GT 440] bus-ID: 02:00.0                X.Org: 1.13.0 drivers: vesa (unloaded: fbdev) Resolution:      800x600@0.0hz               GLX Renderer: Gallium 0.4 on llvmpipe (LLVM 3.3, 128 bits) GLX     Version: 2.1 Mesa 9.2.0 Direct Rendering: Yes      Intend to flip the PC's screen. Above information about current graphics card and operating system.               $ xrandr     xrandr: Failed to get size of gamma for output default     Screen 0: minimum 320 x 400, current 800 x 600, maximum 800 x 600     default connected 800x600+0+0 0mm x 0mm       800x600         0.0*        640x480        60.0         640x400         0.0         320x400         0.0       So far, I've tried to follow the available tips on the internet, unsuccessfully. My main suspicion is about the Nvidia driver. Can anyone shed light over this issue? This command: `xrandr -o rotate` doesn't work.


How to format a CF card by a terminal command?

I want to know the command for formatting a compact flash card from the terminal.


Detach a process from Sh (not Bash) or “disown” for Sh (not Bash)

Consider a shell script executed by Sh, not Bash (and I can't change it, and can't use a shebang, it's ignored). The `&` operator works, but `disown $!` does not and makes Sh complains “ _disown: not found_ ”. How do I detach a background process from specifically Sh? I mean, doing from Sh the same as `disown` do from Bash.


Whenever I type some wrong command, my terminal tries to run that command in the background

Something strange started happening to my terminal. Whenever I type some wrong command it tries to run that command in the background.               hegeek@colinux: ~# l        [9]+  Stopped   l       thegeek@colinux: ~# fdsl            [10]+  Stopped                 fdsl        What could be the issue? * * * EDIT: After restarting the system the issue is solved. But I am still curious what caused this issue. I think it has to do something with `command_not_found_handle` shell function. While trying to find the command, it was doing something weird.


how to merge pdf files so that each file begins on an odd page number?

I need to merge a few dozed pdfs, and i want all of the input pdfs to start on an odd page in the output pdf. Example: A.pdf has 3 pages, B.pdf has 4 pages. I _don't want_ my output to have 7 pages. What i want is an 8-page pdf in which pages 1-3 are from A.pdf, page 4 is empty, and pages 5-8 are from B.pdf. How can i do this? I know about pdftk, but i didin't find such an option in the man page.


Linux 3.x: what wireless chipsets will support a bridged connection?

I have asked a similar question on the Ubuntu pages but this is likely a generic Linux issue: what variety of wireless cards/drivers will support being placed in a bridged connection? I have been using very old Prism II hardware as it worked while I believe more recent cards did not, but the old hardware died, killing the bridge.


using tops command to update NSLog statements in cocoa code

In my objective-c code base I have several NSLog statements. eg.               NSLog(@"Here is the message without arguments");     NSLog(@"Here is the message with arguments: %s, %s","argument1","argument2");      Now I want to do two things: First to do: **updating NSLog statements with NSLocalizedString( <#key#>, <#comment#>)** eg.               NSLog(NSLocalizedString(@"Here is the message without arguments", @""));     NSLog(NSLocalizedString(@"Here is the message with arguments: %s, %s", @""), "argument1", "argument2");       Second to do: **obtaining format strings from NSLog statements and adding it to localizable.strings file** eg.               "Here is the message without arguments" = "Here is the message without arguments";     "Here is the message with arguments: %s, %s" = "Here is the message with arguments: %s, %s";      Is there any way to do so through `tops` command, please suggest. Note: wanted to add tops as one of the tags but since it is not an existing tag and I don't have enough reputation, could not add the one :-(


i2b2 VM: Copy VM won't give me a valid IP address (CentOS 6.5 running with VMWare Player in Windows)

Posting on here as well in case this was the incorrect site to post the question. http://serverfault.com/questions/595337/i2b2-vm-copy-vm-wont-give-me-a-valid- ip-address


Having problem using sed | Trying to replace a line

Contents of gaurav.txt file               $generalNetPath = "/net";     $generalNetPath = "/glbusers4/glb/aimsys/apxwrk48";      I trying to replace `/glbusers4/glb/aimsys/apxwrk48` by `pwd` as follows               qaz=`pwd`     sed '/apxwrk/c\$generalNetPath = "$qaz";' gaurav.txt      I am getting the output as               $generalNetPath = "/net";     $generalNetPath = "$qaz";      I was expecting `$qaz` be replaced by my present working directory.As far as my knowledge this is happening because of `'` (single quotes) that I am using.I have tried using `\` before `"` but that didn't help.Is there any anyway can I do this.I mean can I use anything other than `'` so that I can have value of `$pwd` replaced by using any character other than `'` .I tried using `|` but didn't work.Please help me out with this.


How to send mail?

I'm trying to send mail from shell(GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)) using;               mail foo@bar.com      After I complete the command, the mail won't show up in the mailbox. What could be wrong, how can I check is my configuration is correct. Thanks.


Get raw input from command line (ignore shell meta characters)

Is there any way to read raw text from `stdin` before it is expanded or before the shell does anything to it? Say I wanted to run a script where a user enters a string which is then printed out, how can I get the following behavior:               $ sh test.sh     Please enter a string:     ***<><><||&&*&$PATH          You entered:     ***<><><||&&*&$PATH      Is there any way to implicitly surround the text with `''` or escape all meta characters even if the user does not?


How is paid software distributed and updated in Linux?

I am developing a cross-platform Java app for OS X, Windows, and Linux. It runs fine on Linux (currently packaged into a .sh file), but now I'm wondering how to distribute it after payment and update it when I make changes. I'm aware that FOSS is typically distributed in a .rpm and .deb package, which provides a convenient way to update the app as well (in Linux mint, for instance, there is a unified software updater that makes use of these). But I don't know if these would be appropriate for paid software that I don't want users to install without paying for. I know that paid software on Linux is somewhat rare, but It certainly does exist. So how is paid software typically distributed and updated on Linux?


Partitionning disk for installation, what size should I give to filesystem?

I am planning to install debian on dual boot, I have 250GB free for that, but I d prefer answer for any size. I want to separate filesystem on different partition (`/`, `/boot`, `/root`, `/home`, `/var`), but I m wondering about what size should I allow to each one. On relative, how much space should I allow to each one? What is the vital minimum for each?


I get the Error "mysqld dead but pid file exists"

I get the Error `mysqld dead but pid file exists` This happens every couple of hours. If I restart it works fine and then goes down again.               [root@ip-10-0-0-149 log]# df -h     Filesystem Size Used Avail Use% Mounted on     /dev/xvda1 7.8G 1.5G  6.3G   19% /       devtmpfs 486M  56K  486M    1% /dev          tmpfs 499M    0  499M    0% /dev/shm      `tail` gives:               140717 18:28:43 [ERROR] Got an error from thread_id=4432, /builddir/build/BUILD/ mysql-5.5.38/storage/myisam/mi_delete.c:121      140717 18:28:43 [ERROR] MySQL thread id 4432, OS thread handle 0x7ff640688700, q uery id 269080 localhost root updating DELETE FROM wp_statistics_useronline WHERE timestamp < '1405621693'      140717 18:28:43 [ERROR] Got error 134 when reading table './blog/wp_statistics_u seronline'      140717 18:28:43 [ERROR] Got error 134 when reading table './blog/wp_statistics_u seronline'      140717 18:28:43 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './blo g/wp_statistics_useronline.MYI'; try to repair it      140717 18:28:43 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './blo g/wp_statistics_useronline.MYI'; try to repair it      140717 18:28:43 [ERROR] Got an error from thread_id=4433, /builddir/build/BUILD/ mysql-5.5.38/storage/myisam/mi_delete.c:121      140717 18:28:43 [ERROR] MySQL thread id 4433, OS thread handle 0x7ff64074b700, q uery id 269144 localhost root updating DELETE FROM wp_statistics_useronline WHERE timestamp < '1405621693'


Which command to use to find all files/folders with non-default permissions?

Suppose I have a folder, containing other files and folders, and I'd like to find out recursively which subfiles and subfolders have non-default permissions (i.e., not 644 or 755). Which command can be used to do that? The command should output a list of the relevant files and folders, and their permissions.


Using an already established SSH channel

I have an already established ssh connection between two machines. Is there a way to send commands to the remote machine from a shell script that is run on the local machine, using the already open connection, and without starting another ssh session?


Copy over ssh and execute commands in one session

> **Possible Duplicate:**   >  Using an already established SSH channel Here is my sync script:               ssh user@remote.host /etc/init.d/some_service stop     scp user@remote.host:/var/some_service/events ./events     scp ./new_data user@remote.host:/var/some_service/new_data     ssh user@remote.host /etc/init.d/some_service start      As You can see, it stops service, perform some copies with scp and starts service back. The problem: it "costs" 4 "similar" ssh connections in a row. Is there any way to make all the work, using one physical ssh connection?


How to remove root password on Debian?

I'm running Debian in a virtual machine and for convenience I would like to remove the password on root (since it doesn't really matter what happens to this box). Internet hasn't been too helpful on this one, which I suppose is OK because this is not normally something you'd want to do! I tried passwd -d root, but su won't accept the empty password. I assume there is some sort of PAM policy blocking me, but I haven't been able to find a working solution. Any help appreciated! (Just to clarify: I don't want to always run as root. I'd like a little bit of accident proofing in case I spaz out and `rm -rf /`. Just, when I'm ready to run as root, I don't want to be second guessed.) Edit: I also know about the sudoers hack. I'm just curious to find out what in Debian is blocking this.


How to close all apps before X-server goes down?

I'm using debian testing OS and openbox WM. Moreover, I start X-server via the `.xinitrc` file, which has the following content:               xrdb /home/morfik/.Xresources     exec ck-launch-session dbus-launch --sh-syntax --exit-with-session openbox-session      I notices bunch of errors while rebooting my system. All of them were logged into the file `.xsession-errors.old`. I added               if [[ $(tty) = /dev/tty4 ]]; then         mv ~/.xsession-errors ~/.xsession-errors.old         exec startx &> ~/.xsession-errors     fi      and that's why I have the `.xsession-errors` and `.xsession-errors.old` files and can read theirs content. For instance, the essential part of the file looks like this:               xinit: connection to X server lost          waiting for X server to shut down urxvt: X connection to ':0' broken, unable to recover, exiting.     XIO:  fatal IO error 4 (Interrupted system call) on X server ":0"           after 5353 requests (5353 known processed) with 0 events remaining.     real transparency on... depth: 32     xRandr: Found crtc's: 2     xRandr: Linking output DVI-I-2 with crtc 0     NO XSETTINGS manager, tint2 use config 'launcher_icon_theme'.     XIO:  fatal IO error 4 (Interrupted system call) on X server ":0"           after 13565 requests (13565 known processed) with 0 events remaining.     real transparency on... depth: 32     xRandr: Found crtc's: 2     xRandr: Linking output DVI-I-2 with crtc 0          (kglobalaccel:1707): GConf-WARNING **: Got Disconnected from DBus.          firefox: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.     kdeinit4: Fatal IO error: client killed     kglobalaccel: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.     xscreensaver: 11:27:38: SIGHUP received: restarting...     xscreensaver: 11:27:38: running as morfik/morfik (1000/1000)          klauncher: Exiting on signal 15     kdeinit4: Fatal IO error: client killed     kdeinit4: kded4 [kdeinit]: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.     g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.     .Terminated     .claws-mail: Fatal IO error 2 (No such file or directory) on X server :0.     xscreensaver: 11:27:41: Can't open display: :0     xscreensaver: 11:27:41: running as morfik/morfik (1000/1000)          xscreensaver: 11:27:41: Errors at startup are usually authorization problems.                   But you're not logging in as root (good!) so something                   else must be wrong.  Did you read the manual and the FAQ?                        http://www.jwz.org/xscreensaver/faq.html                   http://www.jwz.org/xscreensaver/man.html          .(EE) Server terminated successfully (0). Closing log file.     (EE)      (EE) Backtrace:     (EE) 0: /usr/bin/X (xorg_backtrace+0x48) [0x7fc1bbd38c58]     (EE) 1: /usr/bin/X (0x7fc1bbb91000+0x1ab949) [0x7fc1bbd3c949]     (EE) 2: /lib/x86_64-linux-gnu/libpthread.so.0 (0x7fc1ba913000+0xf210) [0x7fc1ba922210]     (EE) 3: /lib/x86_64-linux-gnu/libc.so.6 (malloc_usable_size+0x26) [0x7fc1b93d1d36]     (EE) 4: /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x7fc1bab2f000+0xab6f3) [0x7fc1babda6f3]     (EE)      (EE) Segmentation fault at address 0x0     (EE)      Fatal server error:     (EE) Caught signal 11 (Segmentation fault). Server aborting     (EE)      (EE)      Please consult the The X.Org Foundation support           at http://wiki.x.org      for help.      (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.     (EE)      I'm getting this kind of message every time I type `openbox --exit` in a terminal. I found some similar topics on the subject, and people were saying that the errors appear because of SIGTERM signal which was sent to X-server, and all the other applications just can't connect to it anymore, so they crash. How to solve this issue? How to close all the GUI apps before X-server will be terminated? **UPDATE#1** I tried the aecolley's solution, but unfortunately I couldn't even start the graphical environment -- it just hanged, no errors in the `/var/log/Xorg.0.log` or `.xsession-errors` files. I could restart X-server via `ctrl+alt+del`, but I just had a black screen, and that's all. The other thing with the solution is that it installs many dependencies. In order to have `openbox-gnome-session`, I had to install the packages: `openbox-gnome-session` , `gnome-settings-daemon` , `packagekit` , `libpam- systemd`. And they install this stuff:               # aptitude install openbox-gnome-session gnome-settings-daemon packagekit libpam-systemd     The following NEW packages will be installed:       gdebi-core{a} gnome-desktop3-data{a} gnome-session-bin{a} gnome-settings-daemon libelfg0{a} libglib2.0-bin{a} libglib2.0-data{a}       libgnome-desktop-3-7{a} libibus-1.0-5{a} libimobiledevice4{a} libjson-glib-1.0-0{a} libjson-glib-1.0-common{a} libpackagekit-glib2-16{a}       libpam-systemd libplist1{a} libupower-glib1{a} libusbmuxd2{a} libwacom-common{a} libwacom2{a} nautilus-data{a} openbox-gnome-session       packagekit packagekit-backend-aptcc{a} python3-dbus{a} python3-packagekit{a} systemd{a} upower{a} usbmuxd{a}     The following packages are RECOMMENDED but will NOT be installed:       nautilus packagekit-tools     0 packages upgraded, 28 newly installed, 0 to remove and 0 not upgraded.     Need to get 0 B/12.7 MB of archives. After unpacking 52.6 MB will be used.     Do you want to continue? [Y/n/?]      I installed it and added:               exec ck-launch-session dbus-launch --sh-syntax --exit-with-session openbox-gnome-session      or               exec openbox-gnome-session      to the .xinitrc file. Even if the solution worked, I wouldn't do this to my system. :) There's got to be another way to fix this.


"client denied by server configuration" with "AllowOverride All"

I've installed CentOS 6.3 with Apache 2.2 on a VM. I'm trying to set up a LAMP stack with these VirtualHosts:   * `localhost` loads the path `/var/www/html/`   * `lcl.mydomain.com` loads the path `/var/www/html/dev_lcl/` In `httpd.conf` I added:               NameVirtualHost XXX.XXX.XXX.XXX:80      Then I added the `virtualhosts.conf` file:               <VirtualHost XXX.XXX.XXX.XXX:80>         DocumentRoot /var/www/html/         ServerName localhost         <Directory "/var/www/html/">             Options Indexes FollowSymLinks             AllowOverride All             Order allow,deny             Allow from all         </Directory>         ErrorLog /var/log/httpd/error_log_localhost         CustomLog /var/log/httpd/access_log_localhost "combined"     </VirtualHost>          <VirtualHost XXX.XXX.XXX.XXX:80>         DocumentRoot /var/www/html/dev_lcl/         ServerName lcl.mydomain.com         <Directory "/var/www/html/dev_lcl/">             Options Indexes FollowSymLinks             AllowOverride All             Order allow,deny             Allow from all         </Directory>         ErrorLog /var/log/httpd/error_log_dev_lcl         CustomLog /var/log/httpd/access_log_dev_lcl "combined"     </VirtualHost>      This gives me the error: > client denied by server configuration When I remove `AllowOverride All` both `ServerNames` load, but `mod_rewrite` doesn't work and I need it. How can I resolve this?


"Merging" two input device drivers/nodes to one device node

Okay, I have two joysticks attached to my linux box and they show up as `/dev/js0` and `/dev/js1`. My problem is, I have a third party application, (that I cannot change), that uses a joystick, and it can only listen to one node, (so only one joystick at a time). I can determine which node the application will "listen" to, (e.g. `/dev/js0`), but I can only specify one node. This means I can determine which joystick the application will use, but that also means it can only use one joystick at a time. I have been tasked to come up with a way that this application can use both joysticks at the same time in an either/or scenario and not one or the other. Is there a way to redirect the outputs of the two joystick nodes into a third node to which I could then point the application? Is there another way that comes to mind to somehow "merge" these two drivers/nodes into one? I tried creating a new third node, (`dev/js2`) using `mknod`, but I couldn't figure out how to redirect the output of `js0` and `js1` to `js2`. I'm also not opposed to doing this using a small program and `udev`, but I'm not sure how to go about it.


How to automatically record all your terminal sessions with script utility

What I want to achieve is be able to record my terminal sessions to file automatically whenever I use Yakuake/Konsole. It's easy to achieve if at the start of my session I do:               script -f /home/$USER/bin/shell_logs/$(date +"%d-%b-%y_%H-%M-%S")_shell.log      But I want to run the above automatically whenever I start Yakuake or open a new tab. Using .bashrc does not work because it creates endless loop as 'script' opens a new session, which in turn reads .bashrc and starts another 'script' and so on. So presumably I need to script Yakuake/Konsole somehow to run 'script' once as a new tab gets opened. The question is how?


how obtain directory files info

I have the need to get information about a specific directory, basically I need to know the correlation between small, medium and big files. I came up with this:               for i in K M G; do       printf $i       du -h /usr/opt |         awk '{print $1}' |         grep ${i}$ |         wc -l     done | tee /stat.out      from the result then I add all numbers and subtract the total to obtain the number of files under 1k. ( I presume we have a lot of them since it's source files) Anyway, this way is good for small directories, I actually have a very big one (expecting over 1Tera) and no idea of the files distribution. I need to copy all these files to a private storage and need to give a estimate time on the copy. I was thinking on the line of doing something as this:               find pwd |xargs ls -lph |awk '{print $5}'       But I miss what I should put after or if I should take another approach. Any help would be most welcome.


apt-get : no installation candidate for libxul-dev

When I'm installing `libxul-dev` I end with this error message:               $ sudo apt-get install libxul-dev     Reading package lists... Done     Building dependency tree           Reading state information... Done     Package libxul-dev is not available, but is referred to by another package.     This may mean that the package is missing, has been obsoleted, or     is only available from another source     E: Package libxul-dev has no installation candidate      How can I solve this? sources.list


Bad substitution error in zsh shell

Hi in my previous question I got clarity on how to use associative arrays in zsh shell. But whenever I trigger the following command in my script `for KEY in ${!array[@]}` to iterate amongst the keys in my array I get a `bad substitution` error. even `echo ${!array[@]}` gives the same. NB: `array` is the name of my associative array


An efficient filter for .sql files with just "INSERT INTO"

Several times I've found myself working on data that has been exported to `.sql` files that I want to process rather than import into a database. I'm only talking about "pure data" sql files. Ones that have nothing other than `INSERT INTO` statements. (They may have some prolog at the top that I can ignore.) Generally the files will have many lines beginning with `INSERT INTO` and ending with `;` between will be a variable number of "records" beginning with `(`, ending with `)`, and separated with `,`. Each "record" will be made up of a fixed number of "fields" which are also separated by `,`. The filter should strip out all the SQL statements, separators, terminators, etc. It should output just one "record" per line with each "field" separated by say a comma or tab. In my mind it should be totally trivial and common enough that it must've been implemented many times. But I never seem to be able to find existing tools or scripts. I usually try to tackle it in Perl by treating `),(` as the record separator instead of `\n` but I always get stuck in annoying details. Has anyone got (or can make) a really simple script that does this? I don't care whether it's in bash, sed, awk, Perl, Python, etc. Here's some real example data. I have altered it to have only a few records per line. The actualy files have about a million characters per line /statement before they reach the `;` and begin the next one.               > INSERT INTO `categorylinks` VALUES     > (0,'Wikisaurus','RunJobs.php','2008-01-27     > 03:10:30','','','page'),(8,'Wiktionary','TEXT OF THE GNU FREE     > DOCUMENTATION LICENSE','2011-01-26     > 23:50:34','','uppercase','page'),(12,'Wiktionary','WHAT WIKTIONARY IS     > NOT\nWHAT WIKTIONARY IS NOT','2011-04-10 18:22:23','What Wiktionary is     > not','uppercase','page'),(12,'Wiktionary:Help','WHAT WIKTIONARY IS     > NOT\nWHAT WIKTIONARY IS NOT','2011-04-10 18:22:23','What Wiktionary is     > not','uppercase','page'); INSERT INTO `categorylinks` VALUES     > (2184,'Swedish_nouns','RELIGION','2011-01-06     > 00:04:41','','uppercase','page'),(2184,'Translations_to_be_checked_(Albanian)','RELIGION','2007-01-27     > 08:16:34','','uppercase','page'),(2184,'Translations_to_be_checked_(Bulgarian)','RELIGION','2007-01-27     > 08:16:34','','uppercase','page');      Output would be something like this. Whether fields are quoted or not probably doesn't matter. Comma or tab separated doesn't matter. Correct escaping of commas would be needed though. > >     0,'Wikisaurus','RunJobs.php','2008-01-27 03:10:30','','','page' >     8,'Wiktionary','TEXT OF THE GNU FREE DOCUMENTATION LICENSE','2011-01-26 > 23:50:34','','uppercase','page' >     12,'Wiktionary','WHAT WIKTIONARY IS NOT\nWHAT WIKTIONARY IS > NOT','2011-04-10 18:22:23','What Wiktionary is not','uppercase','page' >     12,'Wiktionary:Help','WHAT WIKTIONARY IS NOT\nWHAT WIKTIONARY IS > NOT','2011-04-10 18:22:23','What Wiktionary is not','uppercase','page' >     2184,'Swedish_nouns','RELIGION','2011-01-06 > 00:04:41','','uppercase','page' >     2184,'Translations_to_be_checked_(Albanian)','RELIGION','2007-01-27 > 08:16:34','','uppercase','page' >     2184,'Translations_to_be_checked_(Bulgarian)','RELIGION','2007-01-27 > 08:16:34','','uppercase','page' >   (The data I'm usually working with is part of the dumps of Wikipedia and Wiktionary.)


Most Efficient way to back up/sync large directories over SSH

I'm looking to back up some large directories on a Dedicated Server to another Server on a daily basis using minimal bandwidth RSync looks like its up to the task but I'm unsure of the best command switches I would like to do multiple selected directories to one "backup" directory on another machine over SSH Any ideas?


How to use command line arguments in a shell script

I have a shell script and when invoking it `./test` it asks for an input.I 've seen a quicker way just by writing at once `./test myInput` ,how is that achievable?


Replacing a pattern with another between first and second occurrence of a pattern in file

Want the comma's (,) replaced by the alphabet u between the first occurrence of y till the second occurrence of y. Given below is the sample input file.               100y00893225900,008932259,06,2013,NOKIA Q PHONE,TXS000000287356,PDF,Text,MEOB,1.4,00 00,DoD,07/07/2013,06/01/2013,06/30/2013,07/10/2024,trueyr=56734,d=199y     56734_199_0.pdf     100y00893225900,008932259,06,2013,SAMSUNG T PHONE,TXS000000287356,PDF,Text,MEOB,1.4,00 00,DoD,07/07/2013,06/01/2013,06/30/2013,07/10/2024,trueyr=56734,d=199y     56734_199_0.pdf           100y00893225900,008932259,06,2013,APPLE S PHONE,TXS000000287356,PDF,Text,MEOB,1.4,00 00,DoD,07/07/2013,06/01/2013,06/30/2013,07/10/2024,trueyr=56734,d=199y     56734_199_0.pdf     ~     ~     ~      Actually speaking each line has 3 "y" occurrences. **Desired Output:**               100y00893225900u008932259u06u2013uNOKIA Q PHONEuTXS000000287356uPDFuTextuMEOBu1.4u00 00uDoDu07/07/2013u06/01/2013u06/30/2013u07/10/2024utrueyr=56734,d=199y     56734_199_0.pdf     100y00893225900u008932259u06u2013uSAMSUNG T PHONEuTXS000000287356uPDFuTextuMEOBu1.4u00 00uDoDu07/07/2013u06/01/2013u06/30/2013u07/10/2024utrueyr=56734,d=199y     56734_199_0.pdf     100y00893225900u008932259u06u2013uAPPLE S PHONEuTXS000000287356uPDFuTextuMEOBu1.4u00 00uDoDu07/07/2013u06/01/2013u06/30/2013u07/10/2024utrueyr=56734,d=199y     56734_199_0.pdf     ~     ~     ~