Linux USB Boot results in black screen

I'm trying to install Linux alongside Windows 8 on my new Asus Zenbook UX32VD, which has both an Intel HD 4000 and a NVidia 620M I've been having quite a few problems booting up linux via USB so I can install it. So far, I've tried Linux Mint Debian edition, Crunchbang, Debian, and Ubuntu. What usually happens is that after the initial loading, I see the mouse cursor for a couple of seconds, and then the screen goes black, for good. The rest of the system seems to keep going, but I have no image whatsoever, and have to shutdown the hard way. However, in some of my attempts with Ubuntu and Mint, I managed to boot. What changed those times? I have no clue. In one of those attempts, I finished the instalation of Mint, but after rebooting to the installed system, the same problem occurred I also tried adding boot options, particularly `nomodeset`, and `i915.modeset=1 driver=intel`. The first time I tried each of them, Mint booted correctly, making me think it was the solution. But later attempts resulted in the same black screen But with Debian, it seems everything goes well, and I managed to install it. But I'm currently having some problems configuring the system, particularly the `Fn` keys (any tips on that?) So, my question is, how should I proceed in order to boot correctly, knowing that this is probably some kind of problem with detecting the graphics card? I realize that newer laptops are very likely to have problems like these, but if there's a solution for it already, I couldn't find it anywhere.


how to restore a logical partition to it's original ext4 format

This question is following Unable to mount /home/ partition after reinstalling grub after reinstalling windows 7 where the diagnostic was that installing windows 7 deleted my /home partion, lovingly call /dev/sda3. Since almost nothing have been done with this computer since the incident, we can expect that the content of the partition is still intact and that it is only unusable for the moment. The mission is to try to rescue the files that were inside this partition by restoring it to it's original ext4 format. Does anyone know how to proceed?


What does `*` mean using hexdump -C?

I've been doing an exersice in attempt to understanding some of what's going on under the hood of a program. I wrote a small C program, and compiled it on i386 Linux (Ubuntu 12.04) using `gcc`. I then did a `hexdump -C` on the output to text file. I noticed that there were some gaps on the offset with an `*`:               00000670  00 3f 1a 3b 2a 32 24 22  1c 00 00 00 40 00 00 00  |.?.;*2$"....@...|     00000680  94 fd ff ff 05 01 00 00  00 41 0e 08 85 02 42 0d  |.........A....B.|     00000690  05 03 01 01 c5 0c 04 04  38 00 00 00 60 00 00 00  |........8...`...|     000006a0  80 fe ff ff 61 00 00 00  00 41 0e 08 85 02 41 0e  |....a....A....A.|     000006b0  0c 87 03 41 0e 10 86 04  41 0e 14 83 05 4e 0e 30  |...A....A....N.0|     000006c0  02 4a 0e 14 41 0e 10 c3  41 0e 0c c6 41 0e 08 c7  |.J..A...A...A...|     000006d0  41 0e 04 c5 10 00 00 00  9c 00 00 00 b4 fe ff ff  |A...............|     000006e0  02 00 00 00 00 00 00 00  10 00 00 00 b0 00 00 00  |................|     000006f0  a2 fe ff ff 04 00 00 00  00 00 00 00 00 00 00 00  |................|     00000700  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|     *     00000f10  00 00 00 00 ff ff ff ff  00 00 00 00 ff ff ff ff  |................|     00000f20  00 00 00 00 00 00 00 00  01 00 00 00 10 00 00 00  |................|     00000f30  0c 00 00 00 d4 82 04 08  0d 00 00 00 cc 85 04 08  |................|     00000f40  f5 fe ff 6f ac 81 04 08  05 00 00 00 2c 82 04 08  |...o........,...|     00000f50  06 00 00 00 cc 81 04 08  0a 00 00 00 54 00 00 00  |............T...|     00000f60  0b 00 00 00 10 00 00 00  15 00 00 00 00 00 00 00  |................|     00000f70  03 00 00 00 f4 9f 04 08  02 00 00 00 20 00 00 00  |............ ...|     00000f80  14 00 00 00 11 00 00 00  17 00 00 00 b4 82 04 08  |................|     00000f90  11 00 00 00 ac 82 04 08  12 00 00 00 08 00 00 00  |................|     00000fa0  13 00 00 00 08 00 00 00  fe ff ff 6f 8c 82 04 08  |...........o....|     00000fb0  ff ff ff 6f 01 00 00 00  f0 ff ff 6f 80 82 04 08  |...o.......o....|     00000fc0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|     *     00000ff0  00 00 00 00 28 9f 04 08  00 00 00 00 00 00 00 00  |....(...........|     00001000  26 83 04 08 36 83 04 08  46 83 04 08 56 83 04 08  |&...6...F...V...|     00001010  00 00 00 00 00 00 00 00  47 43 43 3a 20 28 55 62  |........GCC: (Ub|     00001020  75 6e 74 75 2f 4c 69 6e  61 72 6f 20 34 2e 36 2e  |untu/Linaro 4.6.|     00001030  33 2d 31 75 62 75 6e 74  75 35 29 20 34 2e 36 2e  |3-1ubuntu5) 4.6.|     00001040  33 00 00 2e 73 79 6d 74  61 62 00 2e 73 74 72 74  |3...symtab..strt|     00001050  61 62 00 2e 73 68 73 74  72 74 61 62 00 2e 69 6e  |ab..shstrtab..in|     00001060  74 65 72 70 00 2e 6e 6f  74 65 2e 41 42 49 2d 74  |terp..note.ABI-t|     00001070  61 67 00 2e 6e 6f 74 65  2e 67 6e 75 2e 62 75 69  |ag..note.gnu.bui|     00001080  6c 64 2d 69 64 00 2e 67  6e 75 2e 68 61 73 68 00  |ld-id..gnu.hash.|     00001090  2e 64 79 6e 73 79 6d 00  2e 64 79 6e 73 74 72 00  |.dynsym..dynstr.|      My question is, how should I interpret the `*`? I assume it means there's a gap in the file, but then the question turns to why does a gap exist? Is this part of the standard format of an ELF file?


Can't read a file although it's in my group and permissions for group read are set

I encounter a strange problem on a unix/linux machine: I'm member of a group, let's call it group A and a certain file (which has a different owner) belongs to group A as well. The permissions of that file are               -rw-rw----      so I'd expect I should be able to open that file, but I am not: I'll get the "Permission denied" error message when I try to look at the file's content (using cat). Since the permissions seem to be correct, what else could be causing this? Are there "overriding" permission restrictions in place? If so, how would I find out?


Are the SSH manual pages wrong?

The ssh manual pages states the following:                -L [bind_address:]port:host:hostport              Specifies that the given port on the local (client) host is to be              forwarded to the given host and port on the remote side.            -R [bind_address:]port:host:hostport              Specifies that the given port on the remote (server) host is to              be forwarded to the given host and port on the local side.      Aren't those two descriptions mixed up? When I use `ssh -L` it takes a remote port and "binds" (or forwards) it to a port on my local machine so that I can talk to some remote machine by talking to myself (localhost:port). When I use `ssh -R` it takes a port from a computer on my local network and "binds" (or forwards) it to a port on the remote machine (ssh server). Then when I'm on the server, I can talk to the port of a computer on the same network as the computer that I just connected from using (localhost:port). This also explains the use of L for local and R for remote (wherever the port is being bound to). (I don't know if i'm using the word "bind" correctly. That't what I'm trying to imply with the quotes)


Keyboard combination to insert non keyboard characters

on windows one could with `Alt`+235 print ë into (any) textfield. I tried the same on linux and it seems to be not working. Depending on the application the result is different, but never the wanted one. Is there a similiar combination on linux available?


Sed : Delete between the first n lines the ones with a given string in them

I have given a string and a file. I have to delete between the first 30 lines the ones having the given string. Tried something like **`sed -i '/pattern/1,30d' filename`** Yet it gives errors. More specifically what I want is sed to analyze only the first 30 lines, and if it finds the pattern given, to delete the line.


FreeBSD ipfw keepstate vs setup keep-state

A lot of examples where people are using keep-state with setup together. For example:               ipfw add 1 allow tcp from any to me 22 setup keep-state      Because of setup, this rule will allow only SYN packets, which are first packets in TCP handshake. OK. But, why is this so necessary? Why not just using keep-state without setup? What's the profit?


I was asked to do it "Configure SSL Mutual (Two-way) Authentication" and I don't know where to start or how to test it .   server and many clients . they can access code on server only if they have a signed certificate from server . and server can generate those certificates and disable them here a tutorial but I'm so scared of losing connection with server I'm working on because it's the main server if I re-generate new keys .   do I have to be a root user ?   is there's any bash for this ?   any information would be appreciated .


Cannot connect to belkin router through linux mint

I recently installed Linux Mint 13 alongside windows 7. I have a Realtek RTL8191SEvB Wireless Card. This work's fine with any router. However when I try to connect to a Belkin G Wireless Router it constantly says the passwords or encryption type are incorrect. They are not. I can connect to the Belkin router when I start my laptop (a toshiba satelite) with windows. Any ideas?


Gnome Terminal---hide the tilde files produced by Emacs

Editing text file using Emacs will make Emacs make a companion file for its own purpose. For example, after first editing a file called `test.c`, Emacs will leave a file called `test.c~` in the same directory. This can be a little annoying when visualizing all files cluttered with the `~` files in a console Any way to get rid of seeing these `~` files in a console, like the Gnome Terminal? **Update** Thanks to @don_crisst's comment below: use `ls -B` to hide the ~ files when displaying file names. The command line switches, `-B` or `\--ignore-backups`, do not list implied entries ending with ~.


Quoted vs unquoted string expansion

1. `for i in $(xrandr); do echo "$i" ; done`   2. `for i in "$(xrandr)"; do echo "$i"; done`   3. `for i in "$(xrandr)"; do echo $i; done` I understand why 1 differs from 2. But why does 3 give a different output from 2? Please explain the output too. How do quotes work on newlines?


Booting encrypted root partion fails after system update

I have a problem booting my Debian Linux server. After a system update, GRUB loads the initrd and the system should ask for the password, but it doesn't. Instead, I get dropped to BusyBox. After trying to mount the encrypted volume manually with `cryptsetup luksOpen`, I get this error:               device-mapper: table: 254:0: crypt: Error allocating crypto tfm     device-mapper: reload ioctl failed: Invalid argument     Failed to setup dm-crypt key mapping for device /dev/sda3     Check that the kernel supports aes-cbc-essiv:sha256 cipher (check syslog for more info).      Images


Run a command when system is idle and when is active again

I want to run a command when the user becomes inactive (the system is idle). For example:               echo "You started to be inactive."      Also, when the user becomes active again (the system is not idle anymore):               echo "You started to be active, again."      I need a shell script that will do this. Is this possible without a timer/interval? Maybe some system events?


How can I be sure that access to my home server from my home network is not done via Internet?

As advised in this question: Network file-sharing between Linux and Android, I have decided to use ownCloud to store files on my home cloud server. However, my needs have changed a bit. I want to be able to access my cloud from the Internet, not just my home network. For that, I need dynamic DNS software. I have that taken care of (domain name and everything) - I will be using DynDNS. However, when I'm at home, is it possible to configure the server/client so that when I try to access my files it is done through my home network (192.168. _._ ) and not via Internet (querying DynDNS and what not), without having to keep the system thinking that there are two different servers?


VLC - gapless cue support

Most of my music is ripped `flac`'s with `cue`'s. I listen to albums with `cue` mainly because of _last.fm_ scrobbling, but I want the same experience of gapless playback as listening to whole `flac` using VLC (I very like it's simplicity). Is there any solution for this?


Kill user processess on logout

I have a Ubuntu server that handles remote X sessions from users. However, I don't want to allow users to run any kind of background processes - so here is my question: How do I prevent users from having any background process or is there any simple way to kill processes of users that aren't logged in?


Using file system call

I'm trying to learn system calls for open,write and close a file. I use this sample and the result is:               gcc: error trying to exec 'cc1plus': execvp: No such file or directory      Here's my program:               #include <stdio.h>     #include <string.h>     #include <stdlib.h>     #include <fcntl.h>     #include <unistd.h>          int main (int argc, char *argv[])     {         int fd1;         char buf[128];         fd1 = open("Desktop/this.txt", O_WRONLY);         if (fd1 == -1) {             perror("File cannot be opened");             return EXIT_FAILURE;         }              /* Enter the data to be written into the file */         scanf("%127s", buf);              write(fd1, buf, strlen(buf)); /* fd1 is the file descriptor, buf is the character array used to      hold the data, strlen(buf) informs the function that the number of bytes equal to the length of the      string in the buffer need to be copied */              close(fdl);              return 0;     }


I'm getting the same error that other questions mention, such as:   * Installation Error: Kernel Panic - not syncing   * http://askubuntu.com/questions/41930/kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unknown-block0-0 However, I don't think their solutions would fit my scenario. This has started happening when I tried to install an Ubuntu 12.04 into a new partition (/dev/sda5). The system has two hard disks (sda and sdb), and both have already other two OSs: a Windows8 in sda, an Ubuntu 13.04 in sdb. So when I installed Ubuntu12.04 I told it to install the boot loader in sdb (thinking it would overwrite the existing one), but it failed. So I told it to use sda instead and then it apparently didn't fail. However, when starting up the computer, the previous boot I had from Ubuntu 13.04 starts, so then the entry for the new Ubuntu 12.04 was not there. Tried to start manually from the other HD (sda) and it starts Windows, so I guess the boot loader couldn't be installed anywhere in the end. So, to make the sdb bootloader recognize the new Ubuntu12.04 partition I started Ubuntu 13.04 and did `sudo update grub` from there, and this command found the new OS, and there's a new entry in grub now. But when I try to run it, I get:               error: no such device: 15ee4fac-ec5d-409b-88c2-7350e76d2e98     Press any key to continue...      Then I press a key, and then:               Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)      The solutions that others have provided in other questions I guess that don't really apply to me because I have many partitions with different OSs, and the other questions seemed to focus on just one Linux OS, so I'm not sure I can run `update-initramfs -u -k <version>` happily, or from where to run it (LiveCD?), or how to guess the proper kernel version.


Xen/KVM/LXC for testing packages

On Debian Stable, I would like to be able to create a new instance of the OS, use apt-get to install some Unstable packages with dependencies, then cleanly delete the whole thing when I'm done. VirtualBox or QEMU would work, but Xen/KVM/LXC seem to be lighter and faster. How do they compare for this use? Edit: To clarify, in this case, I want to set up to be able to install-use- remove dangerous things without messing up the base system. Looking for what would be most lightweight/fast.


qmake looking for lib files named *.pc

I'm trying to compile some software (FocusWriter) on openSUSE 11.3, (linux 2.6.34.7-0.5-desktop). (I can't find an actual download link to the alleged openSUSE RPM...just lots of metadata about the RPMs). So I unpacked the source from git, and, following instructions, ran `qmake`. I get this:               Package ao was not found in the pkg-config search path.     Perhaps you should add the directory containing `ao.pc'     to the PKG_CONFIG_PATH environment variable     No package 'ao' found     Package hunspell was not found in the pkg-config search path.     Perhaps you should add the directory containing `hunspell.pc'     to the PKG_CONFIG_PATH environment variable     No package 'hunspell' found     Package libzip was not found in the pkg-config search path.     Perhaps you should add the directory containing `libzip.pc'     to the PKG_CONFIG_PATH environment variable     No package 'libzip' found     Package ao was not found in the pkg-config search path.     Perhaps you should add the directory containing `ao.pc'     to the PKG_CONFIG_PATH environment variable     No package 'ao' found     Package hunspell was not found in the pkg-config search path.     Perhaps you should add the directory containing `hunspell.pc'     to the PKG_CONFIG_PATH environment variable     No package 'hunspell' found     Package libzip was not found in the pkg-config search path.     Perhaps you should add the directory containing `libzip.pc'     to the PKG_CONFIG_PATH environment variable     No package 'libzip' found I know that all those packages are in fact installed, according to both YaST and zypper. `/usr/lib64/` contains files such as libao.20.2 and libzip.so.1 and libzip.so.1.0.0 -- but nowhere on the harddrive can I find anything called ao.pc, hunspell.pc, or libzip.pc. Any suggestions what I'm missing here? Thanks.


iptables redirect outside requests to 127.0.0.1

I have a service running on 127.0.0.1 with port 2222. I need to forward all requests to 192.168.2.2:2222 (outside IP) **only from** subnet 192.168.1.0/24 to 127.0.0.1:2222. I'm trying to use this, but it's not working.               $ iptables -t nat -I PREROUTING -p tcp -d 192.168.1.0/24 --dport 2222 -j DNAT --to-destination 127.0.0.1:2222      How can I get this to work? UPD: Edit address scheme.


Ok I am back to where I started now red5 is working again but have since noticed the admin jar causes the service to fail on shutdown so have removed it until can find out why. I am using RC2 on Centos 6.4 linux vps Anyway I downloaded the admin panel demo and when I go to input new user I get the following error: Error in db setup Table/View 'APPUSER' does not exist.


Recommendation for kernel config UEVENT_HELPER_PATH?

I use Gentoo Linux. Historically the kernel configuration UEVENT_HELPER_PATH to `hotplug`, then later to `udevadm`. Mine has been set to `/path/to/udevadm`, but I've had problems in the past on Gentoo because the exact location changes from time to time. Now the lvm2 package recommends removing it (set it to empty string). I can't seem to find any good explanation as to what is the best recommendation for what to set this value to. I currently have it as `/bin/udevadm`, at least until that changes again. It works now, but what happens if it is empty? Is there any authoritative discussion on what is the best practice for this? Any recommendation?


What is the /dev/disk/by-uuid/ and why does it use all free space on the disk

I have the following Debian that works in Virtual Box:               $ uname -a     Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux      Recently I notice that I don't have any free space:               $ df     Filesystem                                             1K-blocks    Used Available Use% Mounted on     rootfs                                                   1922060 1921964         0 100% /     udev                                                       10240       0     10240   0% /dev     tmpfs                                                     206128     296    205832   1% /run     /dev/disk/by-uuid/ef55765f-dae5-426f-82c4-0d98265c5f21   1922060 1921964         0 100% /     tmpfs                                                       5120       0      5120   0% /run/lock     tmpfs                                                     511980       0    511980   0% /run/shm     /dev/sda3                                                5841936  163548   5381636   3% /home     tmpfs                                                     511980      12    511968   1% /tmp      What is the /dev/disk/by-uuid/ef55765f-dae5-426f-82c4-0d98265c5f21? Why does it use all free space on the disk?


Find out screen id

I want to start a program with SSH using PHP, which works fine, but now I want to kill the screen with PHP, but the only thing I know is the name of the screen. How do I find out the screen ID (automatically)?


Stuck process: is it a bad sign?

Sometimes a few process are in a stuck state. For example:               PID    COMMAND          %CPU TIME     #TH  #WQ  #POR #MREGS RPRVT  RSHRD  RSIZE  VPRVT  VSIZE  PGRP  PPID  STATE     99357  plugin-container 0.1  12:07.07 10   1    224  2097   40M    84M    66M    82M    2757M  91688 99346 sleeping     99346  firefox          0.4  48:54.20 29   1    265  16250  467M   172M   799M   538M   4210M  91688 1     sleeping      88029- Aquamacs       1.2  31:24.12 4    3    126  268    19M    49M    32M    36M    777M   88029 152   stuck      Is it part of the normal life cycle of process ? Why this process in particular ? What does it mean exactly ?


Why does Linux have poor battery life by default compared to Windows?

Is there something inherent to Linux operating systems that makes them poor managers of battery power by default? I would have thought a light distro like Lubuntu would have a clear battery life advantage over Windows, yet this doesn't seem to be the case. Is it a hardware vendor issue - are laptops just designed to work more power efficiently with Windows OSes? For example, in my experience on the same laptop, a given linux distribution always seems to have poor battery life compared to Windows. My old laptop (a Thinkpad X61) lasted nearly half as long when booted into Lubuntu than it did when using Windows XP. On a newer model, I get a similar poor performance using Fedora 20 vs Windows 8.1.


How to distribute my debian system?

I have a Debian (Wheezy) system that I have configured by installing/removing packages and editing some conf files. I would like to distribute an (almost) exact replica of my system to others programmer on my team. My first instinct is to create an iso but I'm willing to listen to other suggestions. What's the easiest way to create an installable image of my system to replicate across several computers? **Answers I'm looking for**   * On one hand, I would like to know if there're apps that do this automatically, but I think it'd be more interesting to have a step-by-step explanation on how to do this using native Unix tools (cp? dd? cat? fdisk?)   * Making the iso bootable as LiveCD would be cool addition, but isn't really an important step.   * Bonus points if the solution is not limited to Debian only. **What I found so far**   * remastersys claims to do this, but it looks a bit outdated and unmaintained.


Modify /etc/xdg/lxsession/LXDE/autostart before boot

I have some parameters that I would like to change in `/etc/xdg/lxsession/LXDE/autostart`, before it is run. I get the parameters from a grep command. I would like to feed them to the `autostart` file but am not sure how. Currently, what I have is `grep "stuff" /file/one` which outputs 1234. I want to put 1234 in the `autostart` file like               ....     @program 1234     ....


CMake Error "Cannot open options file specified with @"

I am having trouble OpenCV with the installation of OpenCV on my machine. I run Ubuntu 12.04. When I run the `make` command, the computer returns at some point this error:               moc: Cannot open options file specified with @      and then terminates. I have also installed all the required dependencies. I know that it has to do with CMake which is used to generate the build files for OpenCV but I haven't found a way to solve it. I use an 64-bit system.


Moving a folder to a NAS mount

I currently have a small Centos VPS which has some local SSD disk - I am getting close to my storage limit as I am storing a lot of flat files which are accessed very infrequently so I am looking at getting some NAS disk and moving the files to it as it is much cheaper than getting more SSD and will still perform just as well. The challenge is I don't want to have to update all my application references to point to a new location - is there any way I can have the current folder (lets call it /home/user/public_html/folder) pointing to a new location (for example /mnt/new_folder) without having to update anything so /folder/file.doc, ../folder/file.doc or www.example.com/folder/file.doc etc will still point to the files in question? Will a symlink allow me to do that?


can't wget rpm oracle on centos linux

Forgotten how I did this last time. Tried the following 2 methods that I thought had worked for me in the past: _method #1_               $ wget \         http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm      _method #2_               $ wget --no-cookies \         --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" \         "yourversion.rpm" \         -O /opt/jdk-7u51-linux-i586.rpm --no-check-certificate      But neither worked. For the time being I'll just download it the old fashion way but I'd like to be able to download it using `wget` as well.


Timezone setting in Linux

I'm setting the timezone to GMT+6 on my Linux machine by copying the zoneinfo file to `/etc/localtime`, but the `date` command is still showing the time as `UTCtime-6`. Can any one explain to me this behavior? I'm assuming the `date` command should display `UTCtime+6` time. Here are steps I'm following:               date     Wed Jan 22 17:29:01 IST 2014          date -u     Wed Jan 22 11:59:01 UTC 2014          cp /usr/share/zoneinfo/Etc/GMT+6 /etc/localtime          date     Wed Jan 22 05:59:21 GMT+6 2014          date -u     Wed Jan 22 11:59:01 UTC 2014


iptables rule for local network with free internet blocking unrequested connection from internet to server?

I have a home server (with slackware 13) with a eth0 for the local network and a eth1 for the internet (cable modem with dynamic ip). While I do want to learn more about iptables I am still on the proccess and I need some rules done and can't until a learn to do it as I dont wish my server to get compromised at this stage. I currently have a vm where I play with my rules and everything and would appreciate if some one could wrap me a firewall rule for iptables to do the below:   1. Allow all users from my dhcp server on eth0 to have full access to internet and server, in other words eth0 should have no restrictions within the network and server.   2. Allow all users to be able to create a server, for example if they are playing a game such as for example warcraft, and they create a game, the firewall should allow the negotiation of those connections to go thru.   3. Block any requests from internet to server unless it was initiated by the server or an users from the network.


What priorities can be used in cgroups net_prio module?

Cgroups has a module called `net_prio`, and by using this module I can set the priority of network traffic generated by various applications. As you can read here, this can be achieved by setting something similar to the following:               echo "eth0 5" > /sys/fs/cgroups/net_prio/iscsi/net_prio.ifpriomap      But there's no info as to what range of priorities I can use. Let's say there's a program in my system that should have the lowest network priority. What should I use in the pace of 5 ? Are the priorities similar to `nice` priorities?


kill process in script while writing file behavior

in my php script which runs as a cron job, I have               foreach($sites as $site)     {         exec('./wkhtmltoimage-amd64 ' . $site . ' somefile.png');         exec('./zopflipng -y somefile.png somefile.png');     }      to generate screenshots monthly for each site. Now, this cron job runs once a month, and in the unlikely event that someone wanted to delete the image while this job ran, I'm not too sure what would happen. Would the image just not get deleted since it's in use? If that's the case, then how do I make it delete after it's no longer in use? I've thought of a solution where I could just kill the process, but I am unsure of the outcome too. If I use               lsof -t somefile.png      that will give me the PID of the process. With that, I can kill the process within the delete function of the site using               exec('lsof -t somefile.png | kill -15');      After killing, will the original script near the top of this post still go on? Will the job be canceled? Does the cron job error out? I'd like for it to just be able to move on to the next site.


How to get back a lost session in RHEL : Using NoMachine

I logged in remotely to RHEL using NoMachine. Suddenly it got stuck and I have to close the NoMachine client. When I logged in again using NoMachine I can't see the old session (I can't see same application opened in desktop) Now I want to get it back so that I can close all the application. One more thing, since Eclipse workspace is opened in the lost session I cannot open the same workspace from another session. How can I: A. Either get the lost session(interactive).   B. Or close the eclipse from different session. Note: Just to clarify, NoMachine is a remote desktop tool. I use it to connect with RHEL from Windows laptop.


ssh fails for an unix server due to dual layer of authentication

I have a server which has dual authentication layer. Meaning first a user has to login to the box using his userid and then use a group id to access the development folder (say). Now I have a script which uses ssh to copy a file to the development folder. What should be the command for this? Normal ssh commands such as as `ssh $user@host $cmd` where `$cmd` is something like `cp ~user/Test.txt ~grp/` won't work because we are using user's id to copy to group's directory which is not allowed. And if we use group id to login it will be denied permission. Any suggestions?


How to investigate cause of total hang?

My Arch machine sometimes hangs, suddenly not responding in any way to the mouse or the keyboard. The cursor is frozen. Ctrl-Alt-Backsp won't stop X11, and ctrl-alt-del does exactly nothing. The cpu, network, and disk activity plots in conky and icewm stop updating. In a few minutes the fan turns on. The only way to make the computer do anything at all is to turn off power. When it boots up, the CPU temperature monitors show 70 to 80C. Before the hang, I was usually doing low-intensity activity like web surfing getting around 50C. The logs show nothing special compared to a normal shutdown. Memory checker runs fine with zero defects. How can I investigate why it hung up? Is there extra information I can find for a clue? Is there anything less drastic than power-off to get some kind of action, if only some limited shell or just beeps, but might give a clue? The machine is a Gateway P6860 17" laptop (bulky but powerful) and it's running Arch 64bit, up to date (as of March 2011). I had Arch for a long time w/o this problem, switched to Ubuntu for about a week then retreated back to a fresh install of Arch. That's when the hangings started. UPDATE: Yeah, for sure it's overheating. At one temperature, the mouse and keyboard stop working, sometimes becoming functional after several minutes of cooling off. At a higher temperature, worse things happen, like total nonresponsiveness including ignoring SysRq. This condition is shortly followed by a sudden power-off. I have solved the problem by buying a new computer 8D


Which version of X introduced feature Y?

A big part of my daily job is developing software for use on machines with different versions of the same software, like `bash`, `find`, and `grep`. When encountering a feature which would be useful for example to simplify code, it is important to know whether this feature is available in the oldest installed tools. For critical stuff, it would also be useful to know whether this feature was new or has existed for years in the oldest installed tools. What are quick ways to answer this **authoritatively** for Linux tools, especially the GNU Core Utils? Some possibilities in order of decreasing accuracy:   * **Binary binary search** (sic) by running the different versions is of course the ultimate answer, but is by far the most time consuming. Older installations are often not available for security reasons.   * **Reading the code** is almost as good, but it can be prohibitively time consuming if the feature is vaguely named, the name doesn't correspond directly to variable/function/object names, or it was implemented before it was enabled.   * **Change logs** , when available, usually connect feature changes to software versions.   * **Commit logs** can provide hints, but do not know which version they will be included in.   * **man pages** rarely mention dates.   * The same applies to **Googling** , and you'd also have a hard time excluding all the non-authoritative sources.


Disable XDMCP on Linux

I am trying to disable XDMCP and I have edited `/etc/gdm/custom.conf` and set xdmcp `Enable=false`. However, I do not see a service for `gdm` to restart and turn off listening on port 177. What do I need to restart in order to turn off listening on port 177?


Rsync over SSH with authorized keys..but run 2 rsync commands

I just figured out how to automate my rsync backups using `authorized_keys` and the `command=` parameter so that my rsync script can't be modified by the user. So my authorized key file looks like this:               command="rsync --server -vlogDtprze.iLsf . /mybackupfolder/Pictures" ssh-rsa AAAAB3Nz…      The rsync script I run from the computer being backed up is:               rsync -avz -e ssh /home/me/Pictures tester@192.168.1.100:/mybackupfolder/Pictures </b>      What I want to do is back up `/home/me/Pictures` and `/home/me/Documents`. Just those two directories. How do I accomplish this but keep it secure? The thing I like about the authorized keys file setting is that the user can't change where the backup is going...just what is being backed up.


Installing mpd 0.17 or 0.16 on debian squeeze

How could I install mpd 0.17 or even 0.16 on debian squeeze? It's been suggested to me that I should use backports, but I did not quite understand what I should do in case of unmet dependencies. For instance, mpd 0.17 exists on wheezy-backports but it depends on libraries that are a greater version than what is available in the squeeze repos. Should I install every dependency one-by-one from the ready packages on the backports (if they exist)? Or should I install them from the wheezy repos? My sources.list file is:               #          # deb cdrom:[Debian GNU/Linux 6.0.0 _Squeeze_ - Official Snapshot amd64 LIVE/INSTALL Binary 20130824-13:07]/ squeeze main non-free          # deb cdrom:[Debian GNU/Linux 6.0.0 _Squeeze_ - Official Snapshot amd64 LIVE/INSTALL Binary 20130824-13:07]/ squeeze main non-free          deb http://ftp.gr.debian.org/debian/ squeeze main     deb-src http://ftp.gr.debian.org/debian/ squeeze main          deb http://security.debian.org/ squeeze/updates main non-free     deb-src http://security.debian.org/ squeeze/updates main non-free          # squeeze-updates, previously known as 'volatile'     deb http://ftp.gr.debian.org/debian/ squeeze-updates main non-free     deb-src http://ftp.gr.debian.org/debian/ squeeze-updates main non-free          # backports     deb http://ftp.gr.debian.org/debian wheezy-backports main contrib non-free     deb http://ftp.gr.debian.org/debian wheezy main contrib non-free     deb http://backports.debian.org/debian-backports/ squeeze-backports main contrib non-free      EDIT: I couldn't get the sources with `apt-get source mpd=0.17.6-1~bpo70+1`. apt was giving me this error:               E: Ignore unavailable version '0.17.6-1~bpo70+1' of package 'mpd'      E: Unable to find a source package for mpd      `apt-cache showsrc mpd` returned the only the squeeze version. EDIT 2: Trying to install version 0.16 from wheezy. I got the sources but when I ran `debuild -uc -us` it gave me errors about unmet dependecies. Building the deps with `apt-get build-deps mpd=0.16.7-2` returned that it required `libmp3lame0 (= 1:3.99.5)`, and I have `3.98.4+repack2-3~bpo60+1`.


How to run a script from another path, and know the script's path?

I need to run a script that access a file in the same path it is located. For example: I have the script in `/home/me/folder/script.sh`, and this script will access the file `/home/me/folder/myfile`. As the file is in the same path of the script, I just use the name `myfile`, not the full path. But if I run it from `/tmp/`, like:               /tmp$ /home/me/folder/script.sh      it gives me:               myfile: No such file or directory      So, how can I say in the script that the file is in the same path as the script itself?


Need to remove - (Minus) sign at the end in number from many columns and insert it on columns removed

I have a huge csv file which has - (Minus) sign at the end of numbers. Now I need to move these - minus signs to begin of the numbers, i.e I need to remove the last character if it has '-' sign and put the '-' sign to the front.               0.00,70440.19-,18.31-,0.00,451.59-,13788.77-,44.19-,6289.29-     1.03-,39.24-,0.11-,16.96-,0.00,72377.70-,0.00,146673.67-,59.11-,0.00      I tried the below one but if there is decimal value '.' character, then it adds the minus sign before that:               perl -pe 's#(\d{1,})(-)#$2$1#'g  file      output is below:               0.00,70440.-19,18.-31,0.00,451.-59,13788.-77,44.-19,6289.-29     1.-03,39.-24,0.-11,16.-96,0.00,72377.-70,0.00,146673.-67,59.-11,0.00      Please suggest any awk / sed / perl one liner to do this job? Regards, Vino.


"blocks" column in output of fdisk

On my machine, `fdisk -lu /dev/sda` displays following output:                  Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048    73947135    36972544   83  Linux     /dev/sda2        73949182    78139391     2095105    5  Extended     /dev/sda5        73949184    78139391     2095104   82  Linux swap / Solaris      What is this "blocks" unit? Is one "fdisk block" a 1KiB? Where does this unit come from?


Parsing process command-line arguments from pargs in a shell script

I get list of PIDs in my bash scripts (Java processes) and have to analyze their command-line arguments to determine which instance of server each PID corresponds to. At the moment I do it that way using sed/cut:                 PARGS=$(pargs -l $PID)       PARGS_ARR=($PARGS)       NODE='UNKNOWN'       for ARG in ${PARGS_ARR[@]}       do         # trim single quotes          ARG=$(echo $ARG | sed "s/'//g")              # split by equals sign         ARGL=$(echo $ARG | cut -f1 -d=)         ARGR=$(echo $ARG | cut -f2 -d=)              if [ "$ARGL" == "-DnodeId" ]; then           NODE=$ARGR         fi       done      But it works EXTREMELLY SLOW due to large number of command-line parameters (about 20-30 per each PID). Is there a way to somehow parse command-line parameters and get key=>value parse with a single command?


VIM Executing a key command in a function

I have a function, and I want to execute a key command, but I get the error Trailing characters:               function! MyFunction()       if condition         <C-W><C-W>       else         :some_other_command       endif     endfunction      It doesn't like the <C-W><C-W> What can I use instead?


How do I change the PCI device ID of my graphics card in the system? (to install Quadro driver on a GeForce)

I have a consumer GeForce GTX680. It's professional equivalent is Quadro K5000. Both cards have exactly the same chip inside (GK104), the hardware is nearly identical. The official driver for GTX680 can't do Quad-buffered stereo, but the one for K5000 can. One can unlock these "professional" features on the GTX680 by installing the K5000 driver on it. It has been successfully done on Windows. http://www.techarp.com/showarticle.aspx?artno=539&pgno=3 **How do I change the PCI device ID of the card in my system, so the installer thinks it's K5000, not GTX680?** I need to change the value of register 02 from 1180 to 11BA.               lspci | grep VGA     01:00.0 VGA compatible controller: NVIDIA Corporation GK104 [GeForce GTX 680] (rev a1)      Tells me the graphics card is on "01:00.0"               setpci --dumpregs         cap pos w name              00 W VENDOR_ID              02 W DEVICE_ID      Tells me 02 corresponds to device ID. To read the register I do:               sudo setpci -s 01:00.0 02.w         1180      "1180" Means "GTX680", I need to change it to "11BA" which means "K5000" so I'm changing 1180 to 11BA:               sudo setpci -s 01:00.0 02.w=11BA      **Goes through with no errors but when I try to read the value I just changed it's still showing 1180**               sudo setpci -s 01:00.0 02.w     1180      Also tried the same thing as sudo su (as sometimes sudo doesn't work)               [aaa@bbb ~]$ sudo su     [sudo] password for aaa:      [root@bbb aaa]# setpci -v -s 01:00.0 DEVICE_ID=11BA     0000:01:00.0 @02 11ba     [root@bbb aaa]# setpci -v -s 01:00.0 DEVICE_ID     0000:01:00.0 @02 = 1180      I understand this memory can't be really written into so this might be just something being done in the system and therefore not showing. I tried installing the Quadro driver and it's still installs the one for GTX680 (no quad-buffering features)


How do I email root?

I am on Debian squeeze and I'd like to forward my root emails to my real email. I setup exim to use gmail so when I write `mail myname@myemail.com` it sends to my email. However, now I'd like to email root and have it forward my emails to my real email address. `mail root` does not send an email to root. If I create a different user and use the root email to that person it works. But that person or root emailing root does not. Did I break root emails? How do i fix this? I am using exim4, which was the default.


Unable to import packages from debian iso to apt-cacher-ng

I installed a 32 bit Debian Wheezy on a PC (One PC in a lab of 24 computers).   I made it a dhcp PXE server with netboot images of Debian 7 32 bits.   It worked perfectly and all the 20 computers booted from network with the debian installer. The only problem was that all the packages had to be retrieved from the internet and bandwidth was a problem. So only one computer could be properly installed. So I tried to look for solutions on how to completely boot the 4.3 GB iso from the network, bypassing the internet mirrors completely. I asked a question on the debian user lists and was greeted with many solutions, among them was the apt-cacher-ng. So now I wanted to install 64 bit machines on the same lab, and the 32 bit server being the PXE server. So I installed the apt-cacher-ng package. All was set up. I mounted my iso file to a location, and created a symlink of the `/pool` folder to `/var/cache/apt-cacher-ng/_import` folder. Next I went to `localhost:3142/acng-report.html` and ran `import` and it gave me the following error:               Maintenance task (File Import), apt-cacher-ng version: 0.7.11 (Cancel)     Importing from /var/cache/apt-cacher-ng/_import directory.     Scanning local files...     Scanning, found 1 file...     Scanning, found 2 files...     Scanning, found 4 files...     Scanning, found 8 files...     Scanning, found 16 files...     Scanning, found 32 files...     Scanning, found 64 files...     Scanning, found 128 files...     Scanning, found 256 files...     Scanning, found 512 files...     Scanning, found 1024 files...     Scanning, found 2048 files...     No index files detected. Unable to continue, cannot map files to internal locations.       So I went ahead and tried to grasp the HOWTO for importing from iso, and it mentioned that you need to run apt-get update before importing the packages. Now since I wanted to cache all the 64 bits packages from the iso, I tweaked my `sources.list` to point to iso (The hyperlink is a method given by me on how to use iso's as apt-get repository). Now when I ran `apt-get update` it gave me an error that no i386 packages found (made sense since I was running it on 32 bits server, and looking for amd64 packages). So as a test, I installed apt-cacher-ng on my laptop running 64 bits debian, and it gave me the same index error. I even tried manually copying *deb packages from `/var/cache/apt/archives` to `/var/cache/apt-cacher-ng/_import` folder, but again same error! I am no champion of linux, nor of networking. I am just a student, trying to learn linux as much as he can, by asking his college to shift from windows to linux, and in the process learning the fundamentals of networking and linux. Any ideas?


On Unix how do I get the output from the diff command to look like a man page? Where I can press 'b' or 'f' to read further or back?

You know how when you use the man command to read the manual (e.g. `man ls`) and you get output that is paginated that you can read from top to bottom by pressing 'f' to go read further down and 'b' to read further up (assuming you're reading from top to bottom left to right) and you press 'q' to quit. I want the output from diff to behave the same way because sometimes I have a long list of differences to read but I find myself having to scroll all the way up in the terminal to read the beginning of the output. The Git diff command does this and I've come to like it (e.g. `git diff` ) but I don't always have the luxury of having all my files under version control. The best I can think off is piping the out put of the diff command to some other command but I'm not sure which. Can anyone help? Does this sort of output behavior provided (like man pages) have a name for future reference?


Skype connects to the internet but all my web browsers can't on Fedora 15

I've recently taken the plunge and gone from Ubuntu to Fedora. When connected to my wireless network my web browsers can't access any sites although skype works fine. I don't have the problem when connected to a network by a wire. I'm guessing it is some sort of DNS problem but I don't know how to fix it. Any suggestions?


Make some virtual MAC address

I want to make some virtual MAC addresses for my network adapter or wireless adapter, so I can connect to network with more than one IP address from one computer or laptop. How can I do it? (I know it's possible ,because one of my friends done it in university and have more than one - sometimes up to 255 - IP addresses on a network).


Filetype not detected

I'm using vim to try a template system named handlebars, and I installed a vim plugin to get some syntax-highlighting for *.handlebars. I can get coloration if I do this : `:set filetype=handlebars`, but when I open a template, it is monochrome. My .vim folder looks like this:               .     |-- autoload     |   `-- pathogen.vim     |-- bundle     |   |-- handlebars     |   |   |-- example.handlebars     |   |   |-- ftdetect     |   |   |   `-- handlebars.vim     |   |   |-- ftplugin     |   |   |   `-- handlebars.vim     |   |   |-- indent     |   |   |   `-- handlebars.vim     |   |   |-- MIT-LICENSE     |   |   |-- README.md     |   |   `-- syntax     |   |       `-- handlebars.vim      What can I try to get automatic filetype detection? Here is the content of handlebars.vim :               if has("autocmd")       au BufNewFile,BufRead *.handlebars,*.hbs set filetype=handlebars     endif      I think I have autocmd, because :autocmd outputs something. **UPDATE** Here is the content of my .vimrc :               call pathogen#runtime_append_all_bundles()     call pathogen#helptags()     syntax on     set softtabstop=2      set shiftwidth=2     set tabstop=2     set expandtab     set number     set background=dark     set laststatus=2      set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P     colorscheme solarized     filetype on     filetype plugin on      Here is my .vim folder if someone wants to take a look at it : https://github.com/greg0ire/dotvim


Does delimiter parameter on cut command, always expects it to be in between a string?

I noticed something with the `cut` command today, which somehow I had never noticed before, even though I have been using and working with them for a long time. From string `/users/developer/`, I wanted to extract `users`. So, what I did was,               echo `pwd` | cut -d '/' -f1      This was not returning me anything. My assumption was, since I had specified `/` as a delimiter, it should have returned me the first field after the delimiter is found. After a bit of tweaking, I realized that I can get my desired output, when I change my command to retrieve `f2`               echo `pwd` | cut -d '/' -f2      It led me thinking, that delimiter always expects _something_ to be on the left side of it, and that is why, on trying to retrieve the first field, it was not returning me anything, and when I tried to retrieve second field, I got what I was expecting. Logically, it makes sense for a `delimiter`. I just wanted to know, is that really how the delimiter parameter works in cut command? In other words, is my inference correct (that delimiter always expects something to be on the left of delimiter)


Deleting lots of files

I accidentally created 8 million files and every time I'm trying to delete them the server almost dies because of the rm process eating all disk IO (the server is remote without console). Should something like this work i.e. invoking ionice?               sudo find /var/lib/php5/ -type f -exec ionice -c3 rm -f {} \;


How do I stop PuTTY becoming unresponsive to input when displaying large amounts of text?

I use a windows 7 machine to `ssh` into a remote Linux machine using `PuTTY 0.62`. When I accidentally forget to stream the output to a file and run a program that prints a lot of data to the screen I find that putty becomes unresponsive to `Ctrl`+`C` and I just have to wait 5 minutes before my keystroke to be registered. Is there any way to limit the incoming data rate so I can still send keystrokes to the remote machine in the event that I get myself in this situation again? I should add that it's not really `PuTTY` _per se_ becoming unresponsive, but it's just not sending keystrokes, presumably because network throughput is being gobbled up by millions of lines of text being displayed on the screen. I am using `tmux`, and the session is equally slow to respond to `Ctrl`+`b` as to any other command.


How do I delete all files with a given name in all subdirectories?

I want to delete all files with a given name in all the subdirectories of my home directory. I tried:               rm -r file      in my home directory, but it didn't work because that file doesn't exist in that directory.


So, apparently i toasted this USB Thumbdrive, but is there still hope?

I'm having trouble with a USB thumbdrive which isn't recognizable under OSX Disk Utility. Device is not popping up, nor any partitions. Needless to say this is occuring on all USB ports and even on a different machine. What happened was that i accidently plugged it into my XBOX360 and saved a file on it, i guess the partition table got screwed over, or worse. But there is hope because the device is still popping up when running system_profiler SPUSBDataType ![2](http://i.imgur.com/HGvN1cc.png) running 'diskutil list' does not return the device, how am i going to mount this little bugger? ![1](http://i.imgur.com/Bg801sJ.png) Only possible drives to mount are my internal and other external USB drive, not the problemchild. It's technically breathing (as of first screenshot), but what surgery could be applied.


Connect Windows 7 domain member notebook to Samba 3.6

I have a Windows 7 notebook from work, using which I would like to map a file share on my samba NAS when at home. The NAS is meant to be fully open, and not require authentication at all:               security = user     client signing = auto     server signing = auto     map to guest = bad user     guest ok = yes      smbclient works fine. But when I map a network drive from the Win 7 notebook, I get messages such as "The specified server can not perform the requested operation." From googling, it seems that this message means that Windows requires signing but the server does not support it (even though it is configured to do so, above). Indeed, the Windows settings include these, and I can't change them:               Microsoft network client: Digitally sign communications (always)     Microsoft network server: Digitally sign communications (always)      Is there any way to get it to map a share on my machine, or configure samba to work? (If necessary and samba can't do it, I'm even willing to spin up a Windows VM to mount my NAS, and then share it out again to my workplace's Windows notebook... but I'd prefer to do it within samba if possible). Does samba need to be in a domain because it will perform server signing? Does samba need to be in the same domain before it will work? Or can it be in a different domain from my workplace?


SSH screen (CentOS) crashes

I use the screen command to run a Minecraft server on my CentOS 6.4 machine. However, once I end the SSH session, the Minecraft server and the screen will eventually simply stop such that when I come back to check on the server a few hours later and I try to resume the screen sessiom, there is "no screen to be resumed". I am unsure if this the screen will stop while the SSH session is active or if it is just a Minecraft/Java issue.


How can I get a base64 encoded shaX on the cli?

`sha1sum` outputs a hex encoded format of the actual sha. I would like to see a base64 encoded variant. possibly some command that outputs the binary version that I can pipe, like so: `echo -n "message" | <some command> | base64` or if it outputs it directly that's fine too.


grep to ignore patterns

I am extracting URLs from a website using cURL as below.               curl www.somesite.com | grep " new.txt      My new.txt file is as below.                                         However, I need to extract only the below information.                          I am trying to ignore the `<a href` which have **information** in them and whose title end with **NOTNEEDED**. How can I modify my grep statement?


grep command in curl

I am trying to extract some URLs from a web page using cURL command. Initially, I use the cURL command as below.               curl www.website.com/      Now, the website contains links to some other websites which am interested in extracting. So, I do a grep on the cURL command as below.               curl www.website.com/ | grep "<a href=" > new1.txt      It is extracting all lines which have `<a href=` in them. But am particularly interested only in lines which start with `<a href=` and end with `title=` How can I modify the grep command?


pulseaudio sink always suspended

I am on Debian Pulseaudio 2.0-6.1. Up to now never had any issues with sound. I made some experiments with remote sinks and now it seems pulse it totally messed up. I have only one sink. When I restart pulseaudio pactl shows the sink as IDLE. As soon as an application tries to output sound the state changes to SUSPENDED and stays that way. "pactl suspend-sink 0 0" does not change the state. I can only get it to IDLE by restarting pulse and the cycle starts again. After a reboot the problem persists.


What's the difference between a hard links and copied files?

RHEL 6 My understanding is that hard links include a copy of the original file and that I could delete a hard-linked file in one directory, and it would still exist in the other directory. If that's the case, why would I want to use hard links at all? Why not just have two separate files?


Crontab not triggered

I have a program written in C with OpenCV. It captures an image from the webcam and saves on the disk with the name given as an argument. I want to trigger it every minute, thus I inserted the following line to crontab.               * * * * * /home/mustafa/Desktop/capture2/capture2 `date +\%y\%m\%d\%H\%M` >> /home/mustafa/Desktop/webcam.log      This command runs as expected when I run it from the console. But it is not triggered by crontab. Are there any errors in my crontab syntax? Edit: it's Angström Linux


Drop TCP packets and prevent TCP retransmission

I have an application that sends TCP data to a server. My server is made to intentionally drop the packets sent by the application, and as a result the client retransmits the packets. I need to prevent the client from retransmitting them. Is there any setting that I can do on the client to prevent retransmits. Maybe some iptables rule? Or with some `net.ipv4.tcp` variables? I understand that TCP inherently has to retransmit packets, but I actually need to test out a functionality on my server, where I have to observe how the server behaves when it drops a TCP packet and it does not get retransmitted. So I cannot use UDP here. The client is able to complete the TCP handshake, and only the packets sent after that are dropped, for which the retransmission is happening. This is the retransmission that I need to prevent. I am using Fedora :               [root@test sipp.svn]# uname -r     2.6.23.1-42.fc8     [root@test sipp.svn]#


Significance of arrows symbols in duplicating/closing file descriptors under bash

I'm reading a book about Linux command line where author doesn't seem to follow the conventions in bash manual regarding arrows symbols used in redirection operations. Namely, he always uses left arrow `<` in duplicating and closing file descriptors regardless of whether the descriptors are input or output ones. Here is an example:               exec 3<&0 4<&1 #shouldn't be 4>&1 ?     #...     exec 3<&- 4<&- #shouldn't be 4>&- ?      Bash man page is vague in this point, according to it, the duplicating/closing and moving file descriptors have the following syntaxes:               #Duplicating and closing (in case word expands to -):     [n]<&word      [n]>&word          #Moving:     [n]<&digit-     [n]>&digit-      They are described to have different behaviour only if we don't explicitly supply the `n`. But when we do, does it mean that we can use these forms interchangeably?


How to create an ISO file out of 2.5M files?

So I have a good number of files (based on current node count in the filesystem, 2498329) and when I try to make an .iso out of it, mkisofs runs out of memory, pushes the machine into swap and then runs out of that too. Is there something to make mkisofs less memory hungry? The reason I am creating an ISO because I would like to distribute these files but I can't just drop 2.5M files on people via an archive they extract onto existing filesystems (there would be serious risk of inode exhaustion for ext3, at least) so I thought ISO files are easy to mount on Linux, Windows, Mac OS X. EDIT: tried --no-cache-inodes - it may or may not have helped, but memory usage still spiked back up past 1G during the initial scan.


How do you mount an ext2 formatted qemu disk image?

I am having issues mounting an image I created with the `qemu-img` program. Every time I attempt to invoke mount upon the subsequent file, it responds with `failed to setup loop device: No such file or directory`. It does not matter which user I invoke the following commands under, it continuously fails (su - or not).               $ qemu-img create flash.img 512M     $ mkfs.ext2 -L "FLASH001" flash.img     $ mount -t ext2 -o loop,rw flash.img /mnt/dfs/      * * * Is there anything that I am missing? I have a typical Arch Linux install with all of the above commands installed from the Arch Linux repositories.


Why would someone want to change the last access date of a file without making actual changes within the file itself?

CentOS 6 I'm studying RHEL / Centos and recently learned that the `touch` command can be used to change the last access date of a file. I'm struggling to understand a practical reason why anyone would want to do this (without actually making any changes to a file). Can someone please elaborate?


Output ls -l size field with digits grouped by thousands?

It is possible to make ls -l output the size field with digits grouped by thousands? If so, how? For instance:               $ ls -l     -rw-rw---- 1 dahl dahl 43,210,052 2012-01-01 21:52 test.py      (Note the commas in the size). Maybe by modifying the LC_NUMERIC setting inside the locale I'm using (en_US.utf8)? I'm on Kubuntu 12.04 LTS.


Disable xscreensaver when program is running?

I find it very annoying that xscreensaver sometimes helpfully starts while I'm playing Urban Terror, and was wondering if there is a better way to solve this than making some script to run Urban Terror which kills xscreensaver first. My system is Arch Linux, with xscreensaver 5.22.


Log out a user and delete the account

I am having a problem on the server (CentOS 6, Plesk 11.5) where a particular user is using a mass mailer and is blacklisting our IP address. I have tried to delete this user using:               /usr/sbin/userdel test      but it returns a message saying that the user is currently logged in. I thought ok, kill the process. So I tried:               pkill -u test      and also locked the account using:               passwd -l test      which will hopefully stop him logging into the system in future. Still saying user is logged in. How can I log this user out to enable me to delete him off the system?


How to add tmux confirm prompt when I kill a window?

I see in `tmux`'s list-keys:               bind-key & confirm-before -p "kill-window #W? (y/n)" kill-window      I use `tmuxinator`, and will often go overboard on the `Ctrl`-`D`, where I accidentally close a window. Is there a way to add this prompt to any window/pane I close, but only for those created by `tmuxinator`? I don't want this for temporary or new windows, but just those that were created on my new session.


How to rename files with sed and csv

I'm new with Linux, `sed`, and `awk` but I don't mind challenging myself on new ideas. That being said, I understand the purpose and how to use `rename` and `sed` for a common event such as adding a `$date` or removing a `_1234` from all the files. However, I want to figure out how to rename 100's of files that have no relation to one another other than the file type. Renaming example:   * old name alpha.ai renamed to omega.ai    * old name pie32.ai renamed to apple.ai   * old name xmas.ai renamed to santa.ai I originally used a bash script to pull all the names to a .csv file and placed them in column A. In column B I wrote in the new names. Now since there is not a common event occurring how could you write `sed` or the like to do this??               #!/bin/bash     for i in *.ai     do             mv $i $(echo $i | sed "a1,b1")          done


Where is max process size specified?

I've got a RHEL4 machine with 1TB of memory and have discovered that malloc and mmap refuse to allocate any memory above 512GB. Meanwhile, I don't seem to have a problem with RHEL5 machines. I'm presuming, then, that it's just a matter of kernel configuration. Does anyone know what controls the maximum process size (assuming a fixed page size)?


I have a script that works well when I ssh to the server to execute it myself, but has problems when Hudson, a continuous integration server, runs it. I am automating tests on an embedded linux system (the target). The target is connected to Server A (RHEL 5) via serial and operated over minicom. Server B (FC 12) builds the tests that actually run on the target, and can ssh to Server A. Server C (RH) hosts Hudson, with Server B as a slave. I've written a runscript (http://linux.die.net/man/1/runscript) script to do everything needed on the actual target; it boots the image, mounts a directory from Server B and executes the tests. A bash script on Server B invokes minicom with the runscript script along with some companion actions. I have a bash script on Server B which uses               ssh -t -t ServerA bashScript.sh      to get those tests run on the target. I am on Server C, I can get those tests run by ssh'ing to Server B and executing the script that ssh's to Server A which executes minicom with runscript. _Whew._ To review: Server A: Hudson uses its slave mechanism to ssh to Server B. Server B: `kickOffTests.sh` has the line `ssh -t -t ServerA runTests.sh` Server A: `runTests.sh` calls a perl script which invokes `minicom -S my.script ttyE1` Target, after booting: Mounts a directory from Server B, where the tests are, and enters that directory. It invokes yet another bash script, which runs the tests, which are compiled C executables. Now, when _I_ execute any of these scripts myself, they do what they should. However, when Hudson tries to do the same thing, over in the minicom session it complains about a line in the "yet another bash script" that invokes the C executable, `./executable`, with `./executable: cannot execute binary file` I still have a lot to learn about linux, but I surmise this problem is a result of Hudson not connecting with a console. I don't know exactly what Hudson does to control its slave. I tried using the line `export TERM=console` in the configuration just before running kickOffTests.sh, but the problem remains. Can anyone explain to me what is happening and how I can fix it? I cannot remove any of the servers from this equation. It may be possible to take minicom out of the equation but that would add an unknown amount of time to this project, so I'd much prefer a solution that uses what I already have.


Old laptop won't boot from live CDs

I've got an old Pentium III based Dell Laptop, the originally shipped with Windows 2K and has had Windows XP installed on it. I though I could get something useful out of it if I run Puppy, Lubuntu, or CrunchBang on it. I've created live CDs for each of the distros. I've test the CDs in other machines and the CDs are fine. But when I put them in the laptop, it won't boot. The machine powers on and runs the self test. At that point, I can tell that it is reading the CD, but nothing ever happens. As far as I know the CD drive is fine. I have confirmed that in the BIOS, the machine will boot from the optical drive. ### Questions   * Is there anything else I should check in the BIOS?   * Are there other distributions that are better for older laptops?


Double-Ended USB Unrecognized Alfa AWUS036NHR

I have a wonderful little wireless adapter that works perfectly well on Windows, but drops the connection regularly in Arch. As far as I can tell, it's not getting enough power to function properly. It has a USB cable that has two male ends, in order to double power input, but for whichever reason, Arch refuses to recognize that anything is in the other USB slot. This is the output from lsusb:               Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 001 Device 003: ID 0bda:817f Realtek Semiconductor Corp. RTL8188RU 802.11n WLAN Adapter     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 002 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub      The adapter is at Bus 001. Any thoughts?


How to unpack libc6 source on Hardy using debian/rules?

How do I unpack the libc6 source code on Hardy without building everything? I run               apt-get source libc6      and I get               $ ls -1d glibc-2.7/*     glibc-2.7/debian     glibc-2.7/glibc-2.7.tar.bz2     glibc-2.7/glibc-libidn-2.7.tar.bz2     glibc-2.7/glibc-linuxthreads-20071023.tar.bz2     glibc-2.7/glibc-ports-2.7.tar.bz2     glibc-2.7/stamp-dir      What I want is the unpacked and patched source code. Using google find this obsolete blog: Which says to run:               ./debian/rules configure_i686       But that gives me:               $ ./debian/rules configure_i686     make: *** No rule to make target `configure_i686'.  Stop.      Besides I want to unpack for amd64 (x86_64) not i686 anyway. So what is the super-secret target for unpacking libc6 via debian/rules? I do not want to start the build process. I not have the space for that. Thanks


How to script this task?

First of all, I can make basic use of the linux command line, but have slim to none experience with shell scripting. What I want to do: I have a router running OpenWRT, a destop pc and an Android phone. When the phone connects to the wifi, I want the router to wake-on-lan my pc. I have a vague idea on how to do this but need a little help on putting the pieces together:   * run a script with crontabs every 10 seconds to check if the phone is connected   * script does: `iwinfo wlan0 assoclist` to check if my phone's MAC is connected   * if my phone is connected, send wake-on-lan packet   * keep a boolean pcHasBeenWokenUp so the script doesn't send WOL packets all the time (because the phone is connected )   * when the phone disappeared for > 10 minutes: set pcHasBeenWokenUp to false a. Is this the right direction? b. Should the script be a bash script or rather something like perl? c. How can I maintain my pcHasBeenWokenUp variable between the starts of my script? Some hints would be highly appreciated :)


macro: mutt freezes

I am experiencing a strange problem with my new macro in mutt. The following macro works OK. `s` moves message to my archive folder immediately               macro index s ":set confirmappend=no delete=yes auto_tag=yes\n<save-message>=archive\n<sync-mailbox>:set confirmappend=yes delete=ask-yes\n"      however, when I remove `confirmappend=no` at the beginning and `confirmappend=yes` at the end:               macro index s ":set delete=yes auto_tag=yes\n<save-message>=archive\n<sync-mailbox>:set delete=ask-yes\n"      the macro does not work, and moreover mutt freezes so that I have to kill it with `pkill` Can somebody please explain what is wrong? Why doeas the macro cause mutt to freeze? If I want the macro to ask me confirmation for the append (but not for deleting), how can I do it?


Can I change an unmounted partition's type from another partition on the drive?

On my hard drive I have a largish unused partition that I would like to use. Trouble is, it's an old Windows partition and I'd prefer to make it a proper Linux partition (I intend using it via LVM if that makes a difference). So what I'd like to do is re-jig the partition type and reformat it then add it to my already-existing LVM group. But what I'd really like to do is do this from within my existing Linux distribution running on the same drive. I'd rather not have to go through the hassle of making/finding a live CD. So to be clear: the partition that I want to change is _not_ mounted, but is on the same drive as my Linux distribution. Is there a partitioning tool that will do that, and do it safely?


How to install 64 Bit snort on 64 Bit openSUSE 13.1?

My question is simple: I would like to install 64 Bit snort on my 64 Bit openSUSE 13.1. There is an unstable package available here:http://software.opensuse.org/package/snort I got everything but where can I get libpcre.so.0(64bit) that is missing on my system? The same question was on official openSUSE forum, but without any answer. It would be useful if someone can help me.


Put the XFCE extended dektop on the right-side monitor

Is it possible to make an aoutput showing extended desktop to the left of the primary? I'm using xfce.               $ xrandr --output VGA1 --primary --right-of LVDS1      The above command makes VGA1 as extended desktop to the right of LVDS1 but the primary part of the desktop (the part showing the apps menu button, the desktops, apps instances, applets, time and date ...) is on LVDS1. I want it on VGA1.


Is there some memory leak in Mint 16? Or else what is this?

So this has happened to me 3 times now: I have left my computer on over night and when I come back in the morning all of my ram is being used and about a third to a half of my swap space is full. Here's some information that may or may not be pertinent:   * I have 7.8GiB ram and 8GiB swap.   * I am running Linux Mint Petra with cinnamon 2.   * When I look at system monitor while this is happening no process is using an inordinate of memory and all 8 cores of my CPU are running sub 10%   * Aside from my start-up applications, the only thing I have running overnight is firefox idling on my open tabs. I have only added Guake and Cairo Dock to my start-up apps in addition to the default Mint start-up applications.   * I have installed jack and therefore some of my memory limits may have been changed. This is the output from `ulimit -a`:              core file size          (blocks, -c) 0      data seg size           (kbytes, -d) unlimited     scheduling priority             (-e) 0     file size               (blocks, -f) unlimited     pending signals                 (-i) 61806     max locked memory       (kbytes, -l) 64     max memory size         (kbytes, -m) unlimited     open files                      (-n) 1024     pipe size            (512 bytes, -p) 8     POSIX message queues     (bytes, -q) 819200     real-time priority              (-r) 0     stack size              (kbytes, -s) 8192     cpu time               (seconds, -t) unlimited     max user processes              (-u) 61806     virtual memory          (kbytes, -v) unlimited     file locks                      (-x) unlimited      (I think that I had not installed jack the first time this happened, though I am not positive)   * I have done some anti-virus things including, but not limited to, completely reinstalling my system between incident 2 and 3. Also incident 3 came on night 2 after reinstall. All anti-virus things seem to indicate that my computer is clean.   * I had to leave in the middle of writing this question. I was gone for 12 hours. Aside from my start-up apps, firefox, system monitor, and my Downloads folder were still open: my memory usage has gone from about 1.1-1.2 Gib when I left to 1.6 GiB now.  So my questions are: (a) Is this indicative of a memory leak? I don't quite know what a memory leak looks like. (b) If yes, how do I ferret out the culprit? (c) If no, is there anything else I could start looking at?


Apache Virtual Host pointing to wrong DocumentRoot

I operate a VPS on Digital Ocean running Ubuntu 12.04.3, with virtual hosts. I was able to set things up following this tutorial here: https://www.digitalocean.com/community/articles/how-to-set-up-apache-virtual- hosts-on-ubuntu-12-04-lts However, after a few days I navigated to my main domain (noelforte.com) to check and see if everything was running smoothly, but instead of seeing the landing page that I had temporarily set up, I instead was greeted with a directory listing. Oddly enough, the subdomain I had configured with VHosts was still pointed to the right directory, however my main domain reverted to pointing at the default document root of `/var/www`. Deleting the config files in `/etc/apache2/sites-available` and setting everything up again yielded the same results: any subdomain will point to the right location, however the root TLD remains stuck pointing to `/var/www`. What might cause a situation like this, and why then did it initially work properly?


how to get user's last login including the year in C

I'm trying to write a program that can get the user's last login time. Then i want to do something with the data. eg. check which user havent login for 90 days. So I tried using `last` command. This works great. Just that it doesnt display the year. So if I would do the checking on January 2014, how would I know the last login is actually would be on Dec 2013 or Dec 2012? This is an example of the code:               FILE *file1;     extern FILE *popen();     char command[1024];     char *username;     char result[1024];     char buff[1024];          username = "fikrie";     sprintf(command,"last %s",username);     file1 = popen(command, "r");     while(fgets(result, sizeof(result), file1)!=NULL){        sprintf(buff,"%s",result);     }     pclose(file1);      After some googling, I found out there's a -F flag to display the year. Unfortunately, it doesn't work on HP-UX or Solaris. These platform doesn't recognize that flag. I've also tested to used utmp based from this link here .The problem is this code will fail on Solaris and HP-UX. Seems like ut_tv doesn't exist in utmp struct.               #include <stdio.h>     #include <utmp.h>     #include <string.h>     #include <time.h>          int main(void) {         struct utmp *line;         time_t timestamp;         utmpname("/var/log/wtmp");         setutent();         while( (line = getutent()) != NULL) {                 if (line->ut_type == USER_PROCESS ) {                         timestamp = line->ut_tv.tv_sec;                         printf("%s %s", line->ut_user, asctime(localtime(&timestamp)));                 }         }         endutent();         return 0;     }      So, is there a way to do a C code that can generally get the last login for all the Unix platform. (Solaris, Redhat/Linux/CentOS, AIX, HP-UX, Ubuntu). Seems like when I manage to get it on 1 platform, then it fails on the others.


Why there is no Linux Handbook?

Look e.g. onto the BSD's family: FreeBSD Handbook: http://www.freebsd.org/doc/en/books/developers- handbook/debugging.html OpenBSD FAQ, nearby FreeBSD's Handbook: http://www.openbsd.org/faq/index.html I'm really discouraged what can be called official Linux documentation. Information scattered around the network. Where is the core? Is it `ii linux-doc 3.11.0-14.21 all Linux kernel specific documentation for version 3.11.0` of my Ubuntu?


Can't mkdir /root (btrfs)

I performed a standard Debian install using wheezy/testing netinst iso for amd64. After the install completed I booted into a live environment so that I could snapshot the root as a btrfs subvolume named 'root'. To do so I renamed the /root directory to /rootuser temporarily however I am not able to move /rootuser back to /root in the new subvolume. I've seen other posts where people rename and move around the /root directory without any appearent issue. Is this a bug with btrfs? Here are the steps to replicate: Install Debian on btrfs (/dev/sda3, /dev/sda1=/boot (ext4), /dev/sda2=swap), reboot into live environment (Linux Mint Debian Ediiton 2012-04 in my case) then from a terminal:               $ sudo su -      # btrfs filesystem label /dev/sda3 root     # mkdir /media/root     # mount /dev/sda3 /media/root     # cd /media/root     # mv /root /rootuser     # btrfs subvolume snapshot . root     # btrfs subvolume list . # get the subvolume id as $SUBVOLID     # btrfs subvolume set-default $SUBVOLID root     # rm -rf bin boot etc ... # everything except the root subvolume.     # mv root/rootuser root/root      The result is a 'not permitted' error.               # mkdir root/root      results ins an 'already exists' message. I've also tried the equivelent from inside a chroot environment via:               # mount /dev/sda1 boot     # mount --rbind /dev dev     # mount --rbind /proc proc     # mount --rbind /sys sys     # chroot /media/root/root /bin/bash      but I got the same results. Am I doing something wrong? Any pointers would be helpful. I know I shouldn't have messed with he /root folder in the first place, but it's too late now.


Identifying kernel modules

How do I get more information about a kernel module, like a long description? For example, I can see kernel modules like `lp` or `hid`, but those short codes do not mean anything useful to me.


Asynchronous and parallel algorithms in the Linux kernel

In the Linux kernel configuration, I see these options:               config CRYPTO_PCRYPT             tristate "Parallel crypto engine"             depends on SMP             select PADATA             select CRYPTO_MANAGER             select CRYPTO_AEAD             help               This converts an arbitrary crypto algorithm into a parallel               algorithm that executes in kernel threads.          config CRYPTO_CRYPTD             tristate "Software async crypto daemon"             select CRYPTO_BLKCIPHER             select CRYPTO_HASH             select CRYPTO_MANAGER             select CRYPTO_WORKQUEUE             help               This is a generic software asynchronous crypto daemon that               converts an arbitrary synchronous software crypto algorithm               into an asynchronous algorithm that executes in a kernel thread.      What is the difference between arbitrary algorithms, asynchronous algorithms, and parallel algorithms in cryptography?


Can I split a avi file into 2 valid (watchable) files with only standard unix commands?

The question is self explanatory. I have a very big movie file, I want to split it in 2. How can I do this?


How does the server find out what client port to send to?

As I understand it this is what happens when a client makes a connection request:   1. The server will be bound to a particular port number. The port number is always bound to a listening process. Since only the server is listening for incoming connections, we don't need to bind on the client side   2. The server will keep on listeninig on that port number.   3. The client will send a `connect()` request.   4. The server will accept the request using `accept()`. As soon as the server accepts the client request, the kernel allocates a random port number for the server for further `send()` and `receive()`, since the same port number on the server can't be used for sending as well as listening, and the previous port is still listening for new connections Given all that, how does the server find out what port the client is receiving on? I know the client will send TCP segments with a source port and destination port, so the server will use the source port of that segment as its destination port, but what function does the server call to find out about that port? Is it `accept()`?


Draw On Screen Live

I'd like to have functionality like this in Linux, Xorg, whereby I can sketch on the desktop as in the example image below. Anybody have suggestions? ![enter image description here](http://i.stack.imgur.com/GvwXH.jpg)


How to "combine" lines printed by multiple programs safely?

Suppose I want to execute multiple programs in parallel and combine their outputs to one pipe:               sh -c '         (echo qqq; echo qqq2; echo qqq3)&         (echo www; echo www2; echo www3)&          (echo eee; echo eee2; echo eee3)&        wait; wait; wait'      This shell approach works well for this simple case, but I expect it to fail if programs output more and longer lines in buffered way, like this (constructed):               qqq     qqwww     q2     qqq3www2          wwweee3          eee2     eee3      One of the solution I was hinted to use was `tail -f`:               tail -n +0 -q -f <(echo qqq; echo qqq2; echo qqq3) <(echo www; echo www2; echo www3) <(echo eee; echo eee2; echo eee3)      , but this is sub-optimal option: it outputs data sluggishly, it does not terminate; I see outputs not in "sleep" order, but in arguments order in this case:               tail -n +0 -q -f <(sleep 1; echo qqq; sleep 1; echo qqq2; echo qqq3) <(echo www; echo www2; sleep 10; echo www3) <(echo eee; sleep 4; echo eee2; echo eee3) | cat      I've implemented a special little program for this, but believe that there should be some standard good way to do it. How to do it using standard tools (and without `tail -f` disadvantage)?


public key authentification doesn't pass, why?

I'm trying to connect to Server with ssh and id_rsa key. That key is only key in authorized_keys (just added with ssh-copy-id) When i do connect, server ask doesnt end with keys but always ask for user pass there is output any suggestion? I suppose is Q of sshd config tunning? [SOLVED] - was question of permissions set on .ssh and authorized_keys output with debug level: >> **ssh-add id_rsa;ssh -vv vps**               Enter passphrase for id_rsa:      Identity added: id_rsa (id_rsa)     OpenSSH_5.5p1, OpenSSL 1.0.0i-fips 19 Apr 2012     debug1: Reading configuration data /home/yurij/.ssh/config     debug1: Applying options for vps     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to 78.47.XX.XX [78.47.XX.XX] port 22     debug1: Connection established.     debug2: key_type_from_name: unknown key type '-----BEGIN'     debug2: key_type_from_name: unknown key type 'Proc-Type:'     debug2: key_type_from_name: unknown key type 'DEK-Info:'     debug2: key_type_from_name: unknown key type '-----END'     debug1: identity file /home/yurij/.ssh/id_rsa type 1     debug1: identity file /home/yurij/.ssh/id_rsa-cert type -1     debug1: identity file /home/yurij/.ssh/id_dsa type -1     debug1: identity file /home/yurij/.ssh/id_dsa-cert type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3     debug1: match: OpenSSH_4.3 pat OpenSSH_4*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.5     debug2: fd 3 setting O_NONBLOCK     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-rsa,ssh-dss     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit: first_kex_follows 0      debug2: kex_parse_kexinit: reserved 0      debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib@openssh.com     debug2: kex_parse_kexinit: none,zlib@openssh.com     debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit: first_kex_follows 0      debug2: kex_parse_kexinit: reserved 0      debug2: mac_setup: found hmac-md5     debug1: kex: server->client aes128-ctr hmac-md5 none     debug2: mac_setup: found hmac-md5     debug1: kex: client->server aes128-ctr hmac-md5 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug2: dh_gen_key: priv key bits set: 119/256     debug2: bits set: 515/1024     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug1: checking without port identifier     debug1: Host '78.47.184.37' is known and matches the RSA host key.     debug1: Found key in /home/yurij/.ssh/known_hosts:9     debug1: found matching key w/out port     debug2: bits set: 487/1024     debug1: ssh_rsa_verify: signature correct     debug2: kex_derive_keys     debug2: set_newkeys: mode 1     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug2: set_newkeys: mode 0     debug1: SSH2_MSG_NEWKEYS received     debug1: Roaming not allowed by server     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug2: service_accept: ssh-userauth     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug2: key: /home/yurij/.ssh/id_rsa (0xb9608568)     debug2: key: id_rsa (0xb9609890)     debug2: key: /home/yurij/.ssh/id_dsa ((nil))     debug1: Authentications that can continue: publickey,password     debug1: Next authentication method: publickey     debug1: Offering public key: /home/yurij/.ssh/id_rsa     debug2: we sent a publickey packet, wait for reply     debug1: Authentications that can continue: publickey,password     debug1: Offering public key: id_rsa     debug2: we sent a publickey packet, wait for reply     debug1: Authentications that can continue: publickey,password     debug1: Trying private key: /home/yurij/.ssh/id_dsa     debug2: we did not send a packet, disable method     debug1: Next authentication method: password      **sudo tail -F /var/log/secure when i tried to connect with keys and then logged with pass**               Nov  8 10:18:50 sshd[3892]: pam_unix(sshd:session): session opened for user yurij by (uid=0)     Nov  8 10:20:23 sshd[3892]: pam_unix(sshd:session): session closed for user yurij     ^Z


IOMMU causing freezes, disabling causes USB to not work

I'm somewhat new to linux, but I'm running a Xubuntu machine that I recently built. Since I started it up, I had noticed frequent freezes, where both the screen (if plugged in) and any SSH session would become unresponsive. After some searching around, I was told to check kern.log for any errors. Every time the computer because unresponsive, there would be a long line of                   AMDvi: completion-wait loop timed out      entries. At the top of them, some string of errors, starting with a reference to a problem in .../drivers/AMD-iommu. After some more googling around, I was able to edit the grub config to force iommu=off at boot time, which I believed would solve my problems. Now I'm not getting any response from any IO on my motherboard, except for the PS/2 port. I've also checked my BIOS (It's the MSI Touch BIOS II), and have no options regarding disabling/modifying iommu settings. Any advice?


How to set awesome's wibox visible only for certain tags?

I'd like to have special wiboxes for certain tags like multimedia, development. I couldn't find any option in wibox for that and I'm newbie to awesome. I think it can be done using some event handlers and show/hide it manually, but isn't it implemented in some module and if not what's the best way to do it?


Is there any reason to escape a dot in a bash filename expansion?

I am working with a bash script that someone else wrote and I see the following line:               cp -v  ${LOG_DIR}/${APPLICATION}\.*.log ${ARCHIVED_LOG_DIR}      The files with which it's working are all named like: `EXAMPLE.command1.log` `EXAMPLE.command2.log` Is there any reason for the backslash escaping the dot since a dot isn't treated specially in filename expansions? What are the implications of doing this vs without the backslash as such?:               cp -v  ${LOG_DIR}/${APPLICATION}.*.log ${ARCHIVED_LOG_DIR}


How to configure SELinux using samba? Scientific Linux?

when I'm trying to mount a read-only samba share, then I get this messages on the samba server (and timeout on client side)               Nov  5 18:45:49 localhost kernel: type=1400 audit(1352137549.469:17): avc:  denied  { module_request } for  pid=3046 comm="smbd" kmod="net-pf-10" scontext=unconfined_u:system_r:smbd_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system      I already tried:               setsebool -P samba_export_all_ro 1     getsebool -a | egrep -i 'smb|samba'     yum install policycoreutils-python     semanage fcontext -a -t samba_share_t '/PATH/TO/SAMBASHARE(/.*)?'     restorecon -R /PATH/TO/SAMBASHARE     /etc/init.d/smb restart      How can I configure SELinux to allow the read-only samba share? Turning off SELinux is just idiotic. UPDATE:               [root@SERVER ~]# getsebool -a|grep -i smbd     allow_smbd_anon_write --> off     [root@SERVER ~]# setsebool -P smbd_disable_trans 1     libsemanage.dbase_llist_set: record not found in the database     libsemanage.dbase_llist_set: could not set record value     Could not change boolean smbd_disable_trans     Could not change policy booleans


How to generate SELinux policies based on logs?

Afaik there is a solution/software that can automatically generate SELinux policies based on logfiles. I just don't know the name of the software/method that can do this..


Enable 9p filesystem type in Centos 6 virtual guest?

My question is linked to this one : http://stackoverflow.com/questions/17880460/mounting-shared-folder-in-kvm-vm- error-mount-unknown-filesystem-type-9p (but can't comment it) I have apparently the same settings. Here is my problem : I want to create a shared folder between host and guest using 9p virtio. I'm following http://www.linux-kvm.org/page/9p_virtio :               # mount -t 9p [...]          mount: unknown filesystem type '9p'      According to http://wiki.qemu.org/Documentation/9psetup this line in my `/boot/confg-$(uname -r)` is not correct (and quite obviously) : `               # egrep 'CONFIG_(NET_)?_9P' /boot/config-$(uname -r)          CONFIG_NET_9P=m      CONFIG_NET_9P_VIRTIO=m     CONFIG_NET_9P_RDMA=m     # CONFIG_NET_9P_DEBUG is not set     # CONFIG_9P is not set      <------------      ` the doc tells me to enable it, ok, but how ? I'm not at ease with linux kernel settings... at the beginning of the config file there is : > automaticaly generated make config - do not modify meaning I can't just add the line. My questions : Should I recompile the kernel with some option? Can't I simply enable that on boot, e.g. by changing something in grub settings ? Can I automaticaly enable that on CentOS installation ? (since this will be some kind of template that should be repeatedly done)


How are the services exactly starting in (K)Ubuntu?

I have latest Kubuntu. I have installed mysql.   I was looking into the /etc/init.   I see the following:               In /etc/init/mysql.conf          description     "MySQL Server"                                                                                [18/40]       author          "Mario Limonciello <superm1@ubuntu.com>"            start on runlevel [2345]       stop on starting rc RUNLEVEL=[016]          If I understand this correctly mysql should start on level 2 and be up in all levels 2 up to 5.   Then I did the following:               Linux:/etc$ ls rc0.d/       K10unattended-upgrades  K20kerneloops  README  S20sendsigs  S30urandom  S31umountnfs.sh  S40umountfs  S48cryptdisks  S59cryptdisks-early  S60umountroot  S90halt       Linux:/etc$ ls rc1.d/       K20kerneloops  K20saned  README  S30killprocs  S70dns-clean  S70pppd-dns  S90single       Linux:/etc$ ls rc2.d/       README  S20kerneloops  S50rsync  S50saned  S70dns-clean  S70pppd-dns  S75sudo  S99grub-common  S99ondemand  S99rc.local       Linux:/etc$ ls rc3.d/       README  S20kerneloops  S50rsync  S50saned  S70dns-clean  S70pppd-dns  S75sudo  S99grub-common  S99ondemand  S99rc.local       Linux:/etc$ ls rc4.d/       README  S20kerneloops  S50rsync  S50saned  S70dns-clean  S70pppd-dns  S75sudo  S99grub-common  S99ondemand  S99rc.local       Linux:/etc$ ls rc5.d/         README  S20kerneloops  S50rsync  S50saned  S70dns-clean  S70pppd-dns  S75sudo  S99grub-common  S99ondemand  S99rc.local        I was expecting that the mysqld would be listed in one of those directories.   I mean the services have the .conf files in the /etc/init and for each runtime level there is a link to the service executable to start/stop.   But why there is nothing for mysql?   Please note that mysql is up and running:               Linux:/etc$ ps -ef|grep mysql       mysql      994     1  0 21:24 ?        00:00:08 /usr/sbin/mysqld       jim      4396  4223  0 23:44 pts/8    00:00:00 grep --color=auto mysql


Using expect to send Ctrl+D to a telnet connection

I want to use expect file for connecting to telnet session automatically, the flow is:   * when we connect to some IP & port, it will show `escape character is ]`   * after that we have to give `Ctrl`+`D` I wrote one expect file that sends `\x04` for `Ctrl`+`D`. When I run that file it is fine for connecting but expecting me to give `Ctrl`+`D` from keyboard. But I want it to automatically enter `Ctrl`+`D` from the script itself. Nothing should be done manually. Can you please explain the way?


Installing JDK 7 on debian

So I just rented a dedicated server running Debian, and I know nothing about Linux. Anyway, I want to install the JDK 7, first I connected through SSH and granted myself administrator rights by typing `su -`. Then I typed `apt-get install openjdk-7-jdk`, however I get a message saying that the package `openjdk-7-jdk` cannot be found Am I doing something wrong?