title: How to capture the standard output of a script that depends on the user for some input?

text: There is a script that requires me to enter the password before it continues:               bash-3.2$ ./script.sh <parameter_list>     Enter the password for the Database:      ..     ..      I am interested in capturing the standard output of the script into a log file, while securely passing the password to the script. I tried to pass the password into standard input as follows:               bash-3.2$ echo "<password>" > /secure/path/password.txt     bash-3.2$ ./script.sh <parameter_list> < /secure/path/password.txt      But this doesn't seem to work. If it did, I could simply use `tee` to redirect the output to a log file. Could someone kindly point me in the right direction?


title: Can I change tmux status bar color when I hit C-b

text: I use tmux on the local computer then ssh and use tmux too. I can easily use them both (C-b twice for modifying the second tmux) but for more readability I'd like to highlight the status bar of the tmux I'm on What I'd like to achieve is when I hit C-b once the first status bar change and when I hit it twice the second one change (I don't really care if the first one stay change or not). I didn't found anything helpfull concerning color change when C-b is hit so I'm wondering if this even possible.


title: How to display “human-readable” file sizes in find results?

text: I'm trying to find all large files on my Centos server. To do that I'm using:               find / -maxdepth 10 -size +100000 -ls      I tried changing `-ls` to `-lsh` but it is not allowed. How can I display these results with human-readable sizes (using suffixes k, M, …)?


title: How do I use find when the filename contains spaces?

text: I want to pipe file names to other programs, but they all choke when the names contain spaces. Let's say I have a file called.               foo bar      How can I get `find` to return the correct name? Obviously I want:               foo\ bar      or:               "foo bar"      **EDIT** : I don't want to go through `xargs`, I want to get a correctly formatted string out of `find` so that I can pipe the string of file names directly to another program.


title: 184 environment variables too many?

text: I am trying to find the cause of some OS wonkiness, and am concerned about environment variables. The software I have been handed puts an incredibly high amount of environment variables into the user's `.profile`. When I type `set | wc` the result is **9571 bytes long!** There are 184 entries. To me, this seems inordinately large, but I don't have anything explicit to point at and say "this is wrong because xyz". I see nothing in the ulimit documentation that speaks about environment variable total size, but am concerned. I'm not worried about overall memory utilization (there's enough to do what I need), but I am worried about overrunning some internal limit and causing odd behavior in the OS ( _probably not germane to the question I'm asking, but the "odd behavior" is that shared memory queues are not giving me back all the data I put in on the other end. I'm getting around 5% out_ ). Every single script that starts up, every single shell that is run, and every single binary that runs gets a full, individual copy of the environment variables, and I think 9k is too big. **Should this be a worry, or am I concerned over nothing?** I'm running on an embedded x86 QNX 6.4.1 Neutrino system with half a gig of RAM.


title: Perl-Minimum & Maximum value

text: input file               Xm_ABL1 Geneious    extracted region    1   168 .   +   .   Name=Extracted region from gi|371443098|gb|JH556762.1|;Extracted interval="3512970000000 -> 3514640000000"     Xm_ABL1 Geneious    extracted region    169 334 .   +   .   Name=Extracted region from gi|371443098|gb|JH556762.1|;Extracted interval="3717850000000 -> 3719500000000"      part of perl code                if ($array[1] =~ /extracted region/){                 die "No CDS record for $key!\n" unless $metadata->{$key};         (my $label = $array[7]) =~ s/.*region from (.*)\|;.*/$1/;         $label =~ s/\|/_/g;         $group->{$label} ||= {                  pos1 => 1e10,                 pos2 => 0,                 metadata => $metadata->{$key},                 sequences => [],         };         (my $pos1, my $arr, my $pos2) = ($array[7]=~/.*interval=\"(\d+) (<?->?) (\d+)\"$/gm);         # capture hi/lo values for group         $group->{$label}->{pos1} = $pos1 if $pos1 < $group->{$label}->{pos1};         $group->{$label}->{pos2} = $pos2 if $pos2 > $group->{$label}->{pos2};         # push this sequence onto the group's array         push(@{ $group->{$label}->{sequences} }, [ $pos1, $pos2, $arrow->{$arr} ]);     }      In the code $pos1=3512970000000,3717850000000 & $pos2=3514640000000,3719500000000. My code prints new line finding minimum and maximum value (if $pos1 is less than 10,000), but if the value is greater than 10,0000 it gives error in printing minimum value of pos1. Any help is appreciated in debugging for finding minimum value of $pos1 and maximum value of $pos2


title: FreeBSD 9.0 install NOT configuring ports

text: We have a new FreeBSD 9.0-RELEASE with a ports tree generated via portsnap and none of the ports perform `make config`. To some degree it is behaving as though `BATCH=yes` was set. However, that variable does not appear in `/etc/make.conf` (which is actually blank); nor is it set in the environment. `make -V BATCH` returns blank. `make config` pulls up the dialog screens and then happily writes options out to `/var/db/ports/[whatever]/options`; but simply running `make` (or using `portmaster`) skips the config process and writes nothing out to `/var/db/ports`. What on earth is happening?


title: How to disallow GNU screen from making change to my putty window title

text: Currently whenever I open a screen session from within PuTTY, the window title of the PuTTY window changes to "screen". I would like to prevent this from happening. Please let me know what is the way to do it. Apologies if this is a duplicate question. Please note that I'm **NOT** asking about title of various sessions within screen (which can be set with `Ctrl`-`a``Shift`+ `A`). I'm asking about PuTTY's window title.


title: Optimize performance for encrypted disk

text: Recently I tried to copy 200GB to a 1TB external / USB2 / encrypted disk and it took 36 hours. The same copy when the disk was not encrypted took no longer than 1 hour. I am using dm-crypt (LUKS) with the default cipher and ext4 filesystem. I would like to know what I can do to optimize the performance.


title: Recommended partition size of SD card for Ubuntu for BeagleBone black

text: I am using 16GB SD card for building Ubuntu from scratch for BeagleBone Black. So, I have to make two partition of my SD card, one for Rootfs and second one for Zimage and other stuff. Initially I was providing 1GB for Rootfs and 15GB for Zimage, but Ubuntu was not working with this partition. So I provide 6GB for Rootfs and 10GB for Zimage. Now Ubuntu is working fine, but I think 6GB is too much for Rootfs. What should be the size of partition for Rootfs for best utilization of memory of SD card?


title: How can I set the TTY font size manually in Lubuntu?

text: I'm configuring some minimal Lubuntu installs, which will run within VMs. They do not have window managers, and I do not intend to install any. I would like to increase the TTY font size so that 4 of these VMs can be tiled on a single display, and yet still be usable, but I can't figure out how to do this. I assume there's just a conf file somewhere (/etc/....?) where this can be set. If someone could point me at that, it would be much appreciated!


title: Letters tty terminal text mode are very small in debian. How to increase?

text: My Debian 7 is with letters tty terminal text mode are very small. How to increase? I know that Fedora 20 is possible to install in a troubleshooting installation. Thanks!


title: Matching two different lines that are at least N lines distant from each other

text: I would like to match files that contain `try` (in one line) and consecutive `catch` (in another line) **at least N lines later** (to find very long try- catches and try to get rid of them). I mean, the _first_ `catch` after `try` should be be N lines later. Is there a good way to do this with standard UNIX tools like `grep`, `sed`, `awk`? I experimented with doing twice `grep -A <number> -B <number>` but it's good at the reverse thing, i.e. finding the try-catches that are not longer than N lines.


title: Samba 4.1.9 returning "access denied" trying to change share perms from Win client

text: UPDATE: version mismatch seemed to stop happening for some reason, although not sure why/at what point. Have a "public" (within LAN...like this) read-write share on a CentOS 6.4 box running, according to `/var/log/samba/log.samba`, "samba version 4.1.9-SerNet- RedHat-8.el6." If I go to a Win7 or Windows Server 2003 box, right-click the share (from Computer Management connected to servername) it already says under the second tab (Share Permissions) that Everyone has Full (all three boxes checked). Under the third tab (Security), it has all boxes NOT checked for any of the three users listed, Everyone, and these two S-### entries for 1128 and 513 which are the user and group unix owners of most of the files on the share. Anyway, if I, a domain admins member, try to grant Full Control to Everyone in the Security tab, and hit OK, I get right away an error popup: * * * ## Security Unable to save permission changes on Shared on Samba 4.1.9-SerNet-RedHat-8.el6 (G5). Access is denied. * * * ## Retry Cancel So...how can access be denied to a domain admin? All files on the *nix side have 777 perms. For the most part the share does actually function with full read/write to everyone, but one (large, complicated, and not at all verbose in its error messages) is complaining about not having permissions somewhere on the tens of thousands of files it uses on the shared drive (it's a program that is designed to be used off a shared drive for its data--"ATP Navigator".) Hence trying to give full control to everyone to see if it solves that. FS on which share folder lives is ext4, and has acl and user_xattr enabled on some level. Domain admins do have SeDiskOperator privilege, I checked using the command- line from centos. So, why is access denied?


title: Move / to a new partition

text: I have Windows 7 and Debian dual-booted on my laptop. I'm getting cramped for space on the Debian side, so I want to remove the Windows partition and use the whole computer for Debian. I'm currently using a single partition for Debian (plus a swap partition), but would like to split /home into its own partition in the new arrangement. Since the Windows partition is larger than all the Debian partitions, there's space enough for the whole linux installation in the current windows partition. So I'm thinking what I'd do is:   1. reformat the 60GB windows 7 partition /sda2 to an extended partition with two two ext4 partitions, one 15 GB for /, the other 45 GB for /home   2. move/clone my current / and /home directories to the new partitions   3. reformat the partitions where the debian install was, freeing up 50GB of space   4. resizing the new extended partition, and the /home partition in it, to incorporate the 50GB freed in step 3   5. leave a 2 GB at the end for swap I've posted my `fdisk -l` below. My questions:   1. Is this a sensible approach?    2. How do I do step 2? Can I move the / directory without having to reinstall it?   3. I'm assuming that 4 will be straightforward, since I'll be resizing by moving the end of the partition, not the beginning - is that correct?                     fdisk -l          Disk /dev/sda: 120.0 GB, 120034123776 bytes     255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x45689f01             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048      616447      307200    7  HPFS/NTFS/exFAT     /dev/sda2          616448   127768575    63576064    7  HPFS/NTFS/exFAT     /dev/sda3       127770622   234440703    53335041    5  Extended     /dev/sda5       127770624   230021119    51125248   83  Linux     /dev/sda6       230023168   234440703     2208768   82  Linux swap / Solaris


title: What is the command for listing all users who are members of the admin group?

text: I am looking for the name of the superusers list on Fedora. (On Ubuntu is seems to be "sudo".) I want to add one of the users to the superusers list. The `groups` command only lists the groups of the current user.


title: How to make apr available for subversion install?

text: I try to install subversion from source, but on ./configure receive:               configure: error: no suitable apr found      I have download apr source and installed:               libraries have been installed in:     /usr/local/apr/lib      So I returned to configure of subversion but receive the same error. What I should do? Thanks.


title: Is there a vanilla kernel configuration?

text: A question on Ask Ubuntu asks if there's a vanilla kernel for Ubuntu. Its answer is there is a "Mainline" series of kernels for Ubuntu that use vanilla files with Ubuntu configurations. But how important is the configuration? Is there such a thing as a distribution-agnostic, official vanilla kernel configuration?


title: Netdiscover packages for Fedora?

text: Ubuntu has a program called netdiscover. > Netdiscover is an active/passive address reconnaissance tool, mainly > developed for those wireless networks without dhcp server, when you are > wardriving. It can be also used on hub/switched networks.   >  Built on top of libnet and libpcap, it can passively detect online hosts, > or search for them, by actively sending arp requests, it can also be used to > inspect your network arp traffic, or find network addresses using auto scan > mode, which will scan for common local networks. Are there Fedora packages for this or a similar application?


title: Difference between `info` and `pinfo`

text: What's the difference between `info` and `pinfo` besides color? `pinfo` is: > a program for viewing info files while `info` is: > Read documentation in Info format I tried to search the web for the difference between these two command, but found no useful information.


title: How to get mount point of filesystem containing given file

text: I am looking for a quick way to find the mount point of the file system containing a given FILE. Is there anything simpler or more direct than my solution below?               df -h FILE |tail -1 | awk -F% '{print $NF}' | tr -d ' '      A similar question "Is there a command to see where a disk is mounted?" uses the current disk's device node as input, and not an arbitrary file from the disk ...


title: Cannot find libgmp when compiling GCC 4.5.2

text: I'm attempting to compile GCC 4.5.2 as part of the Linux from Scratch book (http://www.linuxfromscratch.org/lfs/view/stable/chapter05/gcc-pass1.html). My configure is as follows:               ./configure \         --target=$LFS_TGT --prefix=/tools \         --disable-nls --disable-shared --disable-multilib \         --disable-decimal-float --disable-threads \         --disable-libmudflap --disable-libssp \         --disable-libgomp --enable-languages=c \         --with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs \         --without-ppl --without-cloog      When I attempt to **make** I get the error (after digging around in config.logs): _error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory_ I have _gmp_ in a subdirectory and got to this point after successfully compiling it. How can I point GCC to use this library? I'm going through LFS in an attempt to get myself more familiar with Linux behaviour. I've jumped over a fair few hurdles but this particular case is stumping me. If it's relevant: I'm using an Ubuntu 11 host. Any ideas? With thanks.


title: CentOS bridge not passing traffic to eth1?

text: I'm setting up a network bridge on CentOS 6.4 and I'm not able to pass icmp or tcp traffic via eth1. UDP traffic looks fine. I'm sure that my test host is cabled to eth1 correctly. My config files look like the following and iptables are disabled. I've done this dozens of times before without issues; I'm at a loss. What am I missing? _/etc/sysctl.conf_               ...     net.ipv4.ip_forward = 1     net.ipv4.conf.proxy_arp =  1     ...      _/etc/sysconfig/ifcfg-br0_               DEVICE=br0     TYPE=Bridge     ONBOOT=YES     BOOTPROTO=static     IPADDR=192.168.20.254     NETMASK=255.255.255.0     GATEWAY=192.168.20.1     DNS1=192.168.100.80      _/etc/sysconfig/ifcfg-eth0_               DEVICE=eth0     TYPE=Ethernet     NM_CONTROLLED=yes     ONBOOT=yes     BRIDGE=br0     HWADDR=00:0C:29:ED:C7:71      _/etc/sysconfig/ifcfg-eth1_               DEVICE=eth1     TYPE=Ethernet     NM_CONTROLLED=yes     ONBOOT=yes     BRIDGE=br0     HWADDR=00:0C:29:ED:C7:7B


title: How to check how long a process ran after it finished?

text: Currently I'm using the following to check how long a process is actually running:               ps -eo uid,pid,etime | egrep '^ *MY_ID' | egrep 'PID_OF_PROCESS'      And that outputs the following:               MY_ID PID_OF_PROCESS       00:16      However, after the process ends I want to find out how long it actually ran for but I can't seem to find that information.


title: alsa and 5.1 surround through three front stereo jacks on the Dell Studio XPS 13

text: I know this is not a tech support forum, but I am not etting an answer from alsa people and have tried much, if not everything. I can upload the alsa-info output if needed, but here is the info probably most relevant. Two codecs (one HDA, one NVIDIA HDMI)               Codec: IDT 92HD73C1X5     Codec: Nvidia MCP79/7A HDMI     Driver version:     1.0.23     Library version:    1.0.24.1     Utilities version:  1.0.24.2      I have tried setting all models supported for this codec (variants of the chip) in modprobe.conf, but only the one with auto gives sound, but only 4.0 output through the stereo jacks. It seems alsa is unable to switch the third (which is Mic/Line in) to output an additional 2 channels. I noticed tons of other Codecs here with 3 jack output, but these are probably desktop chips. What should I do? Install a dev version of alsa? Pester the extremely quiet mailing list? Is there some hack/workaround I'm missing? Thanks for any help, I really need this if I'm to switch to Arch as my main OS.


title: Find files with same name but different extensions, send to tgz

text: I have a large archive of edited images from my camera, each image is actually a pair of files - *.nef & *.xmp. I would like to go through all the folders and then zip these pairs into single tgz files. Each of the filenames in a directory is unique, so it would be sufficient to move the file names from output of `ls *.nef` to the command `tar -czf {filename}.tgz {filename}.*`, but I'm afraid I've no idea where to start. Thanks in advance.


title: Is it possible to trace Linux source from initial bootup to desktop-GUI userland code?

text: I am wondering if, since Linux is 100% open-source, it is possible to follow line-by-line instructions of Linux to observe how the OS works entirely, so that one may get a better knowledge of how OSes boot, load processes, manage timesliced processes/multitasking, load drivers, make system calls, operate via APIs, user mode threads accessing drivers, GUI/X Window System connections, and driver-to-driver interactions. Is it possible to do this from the source, i.e. how feasible is it to linearly trace the source, and is it linear at all?


title: Writing a USB driver from scratch

text: I have an FPGA that I'm going to be connecting to a Raspberry Pi running Raspbian 3.6.11+. I've been reading up on how to write a USB2.0 HS driver for linux and how to reverse engineer USB functionality, but having never written a driver before, most of it is latin to me. Does anyone know of a simple tutorial about writing USB drivers?


title: Can I safely disable abrtd on CentOS 6?

text: There is this nice new daemon called **abrtd** running on CentOS6. This was inherited from upstream RHEL6. There this can be used (for instance) to automatically generate service-requests. In an environment where we have `logwatch` and full monitoring of our servers active - is there any benefit in having this daemon up and running?


title: Removing blank lines from a file

text: I want to remove all empty lines from a file. Even if the line contains spaces or tabs it should also be removed.


title: How to troubleshooting failing ping to router on a linux box?

text: I have a home network 192.168.0.x from which I am posting this message, on this network I have a CentOS7 host 192.168.0.3 which is running a DNS server for the network. I can `ssh` into 192.168.0.3 I can do `nslookup` to get the IP addresses of remote machines, but I can not ping my router.               [root@san ~]# ping -c3 192.168.0.1     PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.          --- 192.168.0.1 ping statistics ---     3 packets transmitted, 0 received, 100% packet loss, time 1999ms      Here is what `arp` reports               [root@san ~]# arp     Address                  HWtype  HWaddress           Flags Mask            Iface     192.168.0.8              ether   b8:8d:12:20:36:6c   C                     eno1     192.168.0.13             ether   c0:3f:d5:63:4e:1a   C                     eno1     192.168.0.10             ether   c0:3f:d5:63:52:06   C                     eno1     192.168.0.11             ether   c0:3f:d5:61:e8:54   C                     eno1     192.168.0.7              ether   00:50:56:61:2b:75   C                     eno1     192.168.0.12             ether   c0:3f:d5:63:19:71   C                     eno1     192.168.0.1              ether   c0:a0:bb:f8:1f:d4   C                     eno1      I can ping other machines on the network               [root@san ~]# ping -c3 192.168.0.13     PING 192.168.0.13 (192.168.0.13) 56(84) bytes of data.     64 bytes from 192.168.0.13: icmp_seq=1 ttl=64 time=0.248 ms     64 bytes from 192.168.0.13: icmp_seq=2 ttl=64 time=0.377 ms     64 bytes from 192.168.0.13: icmp_seq=3 ttl=64 time=0.366 ms          --- 192.168.0.13 ping statistics ---     3 packets transmitted, 3 received, 0% packet loss, time 2000ms     rtt min/avg/max/mdev = 0.248/0.330/0.377/0.060 ms      Here is what `route` prints               [root@san ~]# route     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     default         192.168.0.1     0.0.0.0         UG    1024   0        0 eno1     192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eno1     192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 enp0s20u4      here is the `ifconfig` output               [root@san ~]# ifconfig     eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500             inet 192.168.0.3  netmask 255.255.255.0  broadcast 192.168.0.255             inet6 fe80::c23f:d5ff:fe63:d1dd  prefixlen 64  scopeid 0x20<link>             ether c0:3f:d5:63:d1:dd  txqueuelen 1000  (Ethernet)             RX packets 6513  bytes 1321730 (1.2 MiB)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 15991  bytes 18326750 (17.4 MiB)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0             device interrupt 20  memory 0xf7c00000-f7c20000            enp0s20u4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500             inet 192.168.0.4  netmask 255.255.255.0  broadcast 192.168.0.255             inet6 fe80::224:9bff:fe0b:ddf2  prefixlen 64  scopeid 0x20<link>             ether 00:24:9b:0b:dd:f2  txqueuelen 1000  (Ethernet)             RX packets 469  bytes 36166 (35.3 KiB)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 21  bytes 4155 (4.0 KiB)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0          lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536             inet 127.0.0.1  netmask 255.0.0.0             loop  txqueuelen 0  (Local Loopback)             RX packets 2122  bytes 642922 (627.8 KiB)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 2122  bytes 642922 (627.8 KiB)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0      Trying to ping google.com also fails even though the name resolution works.               [root@san ~]# ping -c3 google.com     PING google.com (74.125.226.134) 56(84) bytes of data.          --- google.com ping statistics ---     3 packets transmitted, 0 received, 100% packet loss, time 1999ms      The router can be pinged from other machines on the network output below is from my mac book pro 192.168.0.8               ping -c3 192.168.0.1     PING 192.168.0.1 (192.168.0.1): 56 data bytes     64 bytes from 192.168.0.1: icmp_seq=0 ttl=64 time=1.794 ms     64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=2.000 ms     64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=1.986 ms          --- 192.168.0.1 ping statistics ---     3 packets transmitted, 3 packets received, 0.0% packet loss     round-trip min/avg/max/stddev = 1.794/1.927/2.000/0.094 ms      The router in my network is a D-Link DIR-850L and I have it configured to point at 192.168.0.3 as the DNS server for 192.168.0.x network. I also have the DNS server on 192.168.0.3 configured to forward to the google DNS servers 8.8.8.8. Why can't I ping 192.168.0.1 from 192.168.0.3 even though 192.168.0.3 is the primary DNS server I am using to post this question from my mac 192.168.0.8 which can browse anywhere on the net going through 192.168.0.3 as the DNS but when I am logged into 192.168.0.3 I can't ping 192.168.0.1 and can't go anywhere on the internet?


title: Compiled a Kernel (2.6.39-rc1), where is the corresponding initramfs?

text: as I've already wrote in the topic, I compiled a new Kernel with `make defconfig`, the `bzImage` is where it there, so is `vmlinux.bin`. I've installed modules with `make modules_install`. Now, what is the next step? should I rename `bzImage` to my liking and put it into `/boot`? And how do I create an initramfs? `vmlinux.bin` is executable, is that my Kernel? I'm using GRUB, and I'm quite familiar with using and configuring it. But I'm having a hard time putting the kernel together.


title: Best filesystem format for Samba between Linux and Windows

text: I've made some researches but I don't find what I need. I have a Linux based server (under Debian 7.1) and several Windows computers. On my server I have some HD which I want to use as external hard drive. My question is: What is the best filesystem format for this exchange NTFS or EXT on the exchange hard drive for best performances and security?


title: What's the meaning of NP and UP in the password field of the shadow file

text: I found some entries in a shadow file whose meaning I don't understand.               user:UP:::::::     user1:NP:::::::      What does UP and NP mean? In addition to those 2, the same shadow file has the normal hashed entry and the _LK_ that indicates a locked account. The machine is a Solaris 10 VM.


title: A tee >( process ) is truncating its stdout when writing a file

text: When I use `tee` to pipe stdout directly to a "specific block of code" (which then writes the modified data to a file), I always get the full complement of exptected output lines in the file. However, when I `tee` the same data to a process `>("same block of code")`, it can drop up to 4 lines from the output. This number varies; sometimes it writes all the lines. How can I get around this issue, and _why_ is it only happening in the `>( process )` ? More info: I am 'tee'-ing to 2 process-substitutions and also to normal stdout pipe when this line dropping occurs. using GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu) on Ubuntu 10.04.2 LTS. Here is the actual script. The second process-substitution is the one in question, the one beginning with `>(tr $'\x60' $X01`               #       # Run 'locate' and direct the output to a temp file       errflag=""       locitmct=0  # Count of located items        columns=4  # The number of columns in the main dialog       colmnb=0  # Column number (NB: columns 1 and 2 are processed together)        X01=$'\x01'       eval locate $zenargs |tee \           >(zenity --progress --pulsate --auto-close) \           >(tr $'\x60' $X01 \              |sed -n "s/^\(.*\/\)\(.*\)/\1\2\n\2\n\1/p" \                 |while IFS= read -r line ; do \                   #                   #                   # process the data                   #                   #                 done > "$listf" )\           >/dev/null     #     cat "$listf"     #


title: How can bad OpenGL calls cause whole system crash?

text: I'm developing OpenGL game and I've copied portion of code with similar function code was partially modified for it's new function, but there was still some bugs. This code was calling OpenGL rendering functions with wrong data, parameters. After calling OpenGL functions with wrong data/arguments whole system freezes and I'm not even able to switch to console `Ctrl``Alt``F1`. This disappoints me, because Linux should be stable software/OS. Then, **why can bugged OpenGL program crash whole system?**


title: need help in making script

text: I want to automate one task in UNIX and make one script. There is directory in which everyday 2 files comes and that files come anytime in between 10 pm to 1 am. file name is `batm53_20131025_BARC5300001201310240000000200004233.221341696408` If u see filename has 3 part   1. batm53 which is constant   2. date when file arrive in directory   3. this part is BARC5300001201310170000000200004233.221341696408 in which BAR5300001 is constant and then after date of file .  suppose today is 24th Oct and file come after 1 am then second part of file name shows 25th Oct but in third part after BAR5300001 it shows 24th Oct date ( 20131024) i am facing issue in this scenario if file comes in between 10 pm to 12 am then i can make script easy with help of find command but i am facing issue in making that part how i can check if file comes after 12 am bceasue that file should be previous date and after 12 am date should change.


title: "read" a single key gives an error

text: This simple script should read one letter:               #!/bin/bash     read -n 1 key     echo $key      But it gives the following error               read: Illegal option -n      Executed by hand `read -n 1 key` works though.


title: Error installing gmrun via apt-get

text: $ sudo apt-get install gmrun     Reading package lists... Done     Building dependency tree            Reading state information... Done     gmrun is already the newest version.     0 upgraded, 0 newly installed, 0 to remove and 18 not upgraded.     2 not fully installed or removed.     After this operation, 0B of additional disk space will be used.     Setting up monodoc-base (2.4.4~svn151842-1ubuntu4) ...          Processing triggers for monodoc-base ...     /usr/bin/update-monodoc: line 3: [: argument expected     generating monodoc search index...     /usr/bin/update-monodoc: line 9: monodoc: command not found     dpkg: error processing monodoc-base (--configure):      subprocess installed post-installation script returned error exit status 127     dpkg: dependency problems prevent configuration of monodoc-http:      monodoc-http depends on monodoc-base; however:       Package monodoc-base is not configured yet.     dpkg: error processing monodoc-http (--configure):      dependency problems - leaving unconfigured     No apport report written because the error message indicates its a followup error from a previous failure.                                                                                Errors were encountered while processing:      monodoc-base      monodoc-http     E: Sub-process /usr/bin/dpkg returned an error code (1)


title: How to bring the ZTE K3806-Z 3G under RedHat Enterprise Linux 6 to life?

text: since my other thread was closed: ZTE K3806-Z 3G RHEL 6 I opened a new one: Did anyone managed to bring the ZTE K3806-Z modem to life (with vodafone) on RHEL 6? How to do it?


title: Why am I not getting correct output with sort command

text: This is what I have tried so far               sort /etc/passwd -t: -k1 > ~/passwd.bylogin      I keep getting an error that the output is wrong. The question is: > Sort the /etc/passwd file in alphabetically ascending order, using the > user's login shell as your primary key. Store the results in the file newly > created file passwd.bylogin I don't understand why I am not getting the correct output.


title: Can't use yast to install software online -- tries to mount a CD

text: I cannot use `yast -i` or `zypper install` in SLES 10; it wants me to insert a SLES 10 SP3 CD, but I don't have one. What should I do?               localhost:~ # zypper install curl-devel     Restoring system sources...     Parsing metadata for SUSE Linux Enterprise Server 10 SP3...     Parsing RPM database...     Summary:     <install>   [S1:1][package]curl-devel-7.15.1-19.16.13.i586     <install>   [S1:1][package]libidn-devel-0.6.0-14.2.i586     <install>   [S1:1][package]openssl-devel-0.9.8a-18.36.i586     Continue? [y/n]: y     Downloading: [S1:1][package]libidn-devel-0.6.0-14.2.i586, 1.1 M(4.3 M unpacked)     Please insert media [Failed to mount cd:///?devices=/dev/hdb on : Mounting media failed     ] # 1 and type 'y' to continue or 'n' to cancel the operation. [y/n]: y     Please insert media [Failed to mount cd:///?devices=/dev/hdb on : Mounting media failed     ] # 1 and type 'y' to continue or 'n' to cancel the operation. [y/n]:


title: rsync: how to relocate absolute symlinks?

text: I've pored over the rsync manpage as well as on several related questions here on serverfault. I've played with -R and -L and -l options, but no luck. Here is the question: when sending a dir from local to remote, is there an option (or option combo) that relocates symlinks relative to the local dir so that they become relative to the destination dir on the remote machine? Here is a minimal example of what I want to send: **local dir:** `/home/bob/foo`               /home/bob/foo/a --> /home/bob/foo/bar     /home/bob/foo/bar      and here is how I would like it to materialize in the **remote dir:** `/u/apps/foo`               /u/apps/foo/a --> /u/apps/foo/bar     /u/apps/foo/bar      For example, `rsync -az /home/bob/foo/ remote:/u/apps/foo/` doesn't quite do it; we end up with:               /u/apps/foo/a --> /home/bob/foo/bar     /u/apps/foo/bar      Whether `/home/bob/foo/bar` exists or not on the remote machine is irrelevant; in either case, the result is definitely not what I need.


title: How can I remaster a text-based linux distro?

text: So I have a Ubuntu minimal install, it is exactly the way I want it when I want to have a fresh install, with the included settings, packages, etc. It has no desktop, it is completely CLI. What is an easy way to take the current state that it is in, and make it into a live CD with an installer to an HD? I tried remastersys, but it isnt compatible with Ubuntu CLI, and I'm not fond of the settings remastersys leaves behind. Any suggestions?


title: What does Ritchie's 1979 PDP-11 `/usr/games/bcd` do?

text: I recently tried the simh emulator `pdp11`. The disk image I used can be found on the internet, and instructions for booting it are here. Presumably it belonged to Dennis Ritchie, as the username is "dmr". In the /usr/games folder are about 20 games and amusements for wasting expensive computing resources. One 'game' is called 'bcd'. If I run it by typing `./bcd`, nothing happens. But then the next command I execute gets printed out as ascii art:                ________________________________________________     /WC -L *                                         |     | ]                                              |     |   ]] ]                                         |     |]                                               |     |111111111111111111111111111111111111111111111111|     |222222222222222222222222222222222222222222222222|     |3]33]3333333333333333333333333333333333333333333|     |444444]44444444444444444444444444444444444444444|     |555555555555555555555555555555555555555555555555|     |]66666666666666666666666666666666666666666666666|     |777777777777777777777777777777777777777777777777|     |888888]88888888888888888888888888888888888888888|     |999999999999999999999999999999999999999999999999|     |________________________________________________|                     ________________________________________________     /LS                                              |     |                                                |     |]                                               |     | ]                                              |     |111111111111111111111111111111111111111111111111|     |2]2222222222222222222222222222222222222222222222|     |]33333333333333333333333333333333333333333333333|     |444444444444444444444444444444444444444444444444|     |555555555555555555555555555555555555555555555555|     |666666666666666666666666666666666666666666666666|     |777777777777777777777777777777777777777777777777|     |888888888888888888888888888888888888888888888888|     |999999999999999999999999999999999999999999999999|     |________________________________________________|      Does anyone know what these represent?


title: embedded linux and powering usb stick

text: I have a problem where I need to read a usb-stick or a usb keyboard: When I plug in the USB stick or keyboard I can't get power to the device. `dmesg` says nothing I tried:               for device in $(ls /sys/bus/usb/devices/*/product);        do echo $device       cat $device;     done      for getting information in console and I get this output:               /sys/bus/usb/devices/usb1/product     Freescale On-Chip EHCI Host Controller       I can't see any kingston usb stick or keyboard. Quesitons:   1. How can I power my usb device `mdev` or `/sys/bus/usb/devices/*/power`   2. How to read data from keyboard or usb stick.


title: How to Upgrade Fedora 17 to 18 Remotely via SSH

text: I followed this https://fedoraproject.org/wiki/Upgrading_Fedora_using_yum#Fedora_17_-.3E_Fedora_18 guide to upgrade my Fedora 17 to 18. All was fine until I issued `su -c 'yum --releasever=18 --disableplugin=presto distro-sync -y'`. My PuTTY disconnected. Obviously it is because `Cleanup: openssh-server-5.9p1-22.fc17.x86_64 306/574` How can I skip OpenSSH during the distro-sync so my upgrade works fine?


title: Manipulating a file with awk

text: I have a text file in the following format:               Surname, Forename: Day.Month.Year: Degree          Sellen, Jo: 03.07.1986: MSc CSE          Parfitt, Harry: 20.03.1984: MSc IT      How can I write a shell script that uses awk to read the file (`class.txt`) like this:               awk '{gsub(/ +/,"\t");print}' class.txt      and outputs the data in the following format, that exchanges the second and third column:               Surname Forename MSc stream Date of Birth          Sellen Jo MSc CSE 03.07.1986           Parfitt Harry MSc IT 20.03.1984      (Don't worry if tabbed columns don't line up)


title: Asterisk server problems with firewall settings

text: I replaced an IVR machine for incoming call after going down. It is running asterisk 1.4.23 on ubunutu 10.04 I decided to put the server behind iptables because my server was under brute force attack. Our customer are experiencing busy signal when dialing our numbers, I checked the logs and I saw various warnings. Here are some issues I noticed in the logs:               [Jan 24 05:02:00] WARNING[939] chan_sip.c: Maximum retries exceeded on transmission 245102dwdw45f4f51f5df5s3@xx.xx.xx.xxx for seqno 102 (Critical Response) -- See doc/sip-retransmit.txt.     [Jan 24 05:02:00] WARNING[939] chan_sip.c: Hanging up call 245102dwdw45f4f51f5df5s3@xx.xx.xx.xxx - no reply to our critical packet (see doc/sip-retransmit.txt).     [Jan 24 06:29:37] WARNING[939] chan_sip.c: Got 200 OK on REGISTER, but there isn't a registry entry for 'mpdhbf867' (we probably already got the OK)     [Jan 24 06:34:07] WARNING[939] chan_sip.c: Got 200 OK on REGISTER, but there isn't a registry entry for 'mpdhbf867' (we probably already got the OK)     [Jan 24 17:00:32] NOTICE[939] chan_sip.c:    -- Registration for 'mpdhbf867@provider-domain.com' timed out, trying again (Attempt #1)      When I turn off my iptables, everything goes back to normal , and the phone call never drops or ring busy. It's a hard trade off because I do not want to leave my server open to the public internet .


title: Resizing and croping images to an aspect ratio of 6x4 with width of 1024 pixels

text: I have a mixed set of images, each one has a slightly different resolution with a slightly different aspect ratio from other images. I have tried using commands like               convert -resize      and               convert -crop      but can't seem to figure out the correct command to make all images have a width of 1024 and an aspect ratio of 6x4, without causing the image to stretch or get squashed.


title: Reboot when there is a hardware failure without physical access to machine?

text: I'm getting this error message whathever I do:               $ sudo reboot     bash: /usr/bin/sudo: Input/output error     $ reboot     bash: /sbin/reboot: Input/output error      It's a hardware failure according to this question. Is there anyway that I can reboot the machine without physically pull the the plug. The machine is not close to me. I can SSH into the machine. `ls`, `pwd`, `echo`, `cat` and some other apps are working. Things like `ps`, `vim` and `killall` are not working.


title: How can I make "bind" command to work in sh shell

text: How can I make the next script to run when I'm using sh shell:               #!/bin/bash          bind '^[[3'=prefix-2     bind '^[[3~'=delete-char-forward     bind '^[[1'=prefix-2     bind '^[[1~'=beginning-of-line     bind '^[[4'=prefix-2     bind '^[[4~'=end-of-line      ![bind in sh](http://i.stack.imgur.com/vVYbW.png)


title: Is "sync" before drop_caches necessary?

text: I have read a lot of docs saying, it is good idea to do a `sync` before doing `echo [1,2,3] > /proc/sys/vm/drop_caches`. I am not able to understand why it is needed, since drop_cache is a non-destructive operation, and dirty data is not going to be deleted by drop_cache. I have also seen a behavior where `echo 1 > /proc/sys/vm/drop_caches` first commit dirty data back to disk and then frees the cache. This is seen through `/proc/meminfo` "Dirty" & "Writeback".


title: Clone ownership and permissions from another file?

text: Is there a command or flag to clone the user/group ownership and permissions on a file from another file? To make the perms and ownership exactly "like" that of another file?


title: Cannot execute binary file

text: I'm trying to install JasperReports Server 4.1 on Linux ubunto (release 11.04) and have following message: > `-bash: ./jasperreports-server-cp-4.1.0-linux-x64-installer.run: cannot > execute binary file` Is any idea what should I do in order to insall Jasper? Previously, I installed JasperReports Server 4.0 on Linux Red Hat without any problem. Is it related specifically to Linux ubuntu? * * * Here are the output for the commands `uname` and `ls -al`: ### `uname -a` > `Linux 64-cncrclinrpts 2.6.38-11-generic-pae #48-Ubuntu SMP Fri Jul 29 > 20:51:21 UTC 2011 i686 i686 i386 GNU/Linux` ### `ls -al jasperreports-server-cp-4.1.0-linux-x64-installer.run` > `-rwxr-xr-x 1 root root 329844862 2011-09-09 09:11 jasperreports-server- > cp-4.1.0-linux-x64-installer.run`


title: How to prepend a license header recursively for all .h and .cpp files in a directory

text: I'm trying to add a license header to all header files and source files in a project directory using a for loop. This is not working, is there any other approach using `sed`?


title: Can ping but can't do ssh

text: I am able to ping my friend but not able to do ssh. Why so? He is using a modem. I thought there might be some firewall enabled. I told him to type               #iptables -F      He did that, but still I am not able to do ssh on his system. How can I do this? I get the error: `ssh: connect to host 182.64.31.131 port 22: Connection refused` RESULT OF ifconfig on his system                inet addr:127.0.0.1  Mask:255.0.0.0     inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0      He told me his dynamic ip by using whatismyip.com I tried ssh on that ip. PS: sshd service is running on his system.   I tried nmap and came to know that port 22 is not opened.


title: Improve the font rendering in Fedora

text: I was using Ubuntu and recently moved to Fedora 15 with Gnome 3. I am not at all impressed with the subpixel smoothing and fonts in Fedora. How do I improve the readability and quality?


title: how to debug/fix screen crashes on startup

text: _(this is a question in reference to the OS X version of Gnu screen. I don't know if this makes any difference - and I guessed that Unix & Linux would have better screen-fu than Ask Different.)_ When I'm physically at my computer at a terminal, and I type a command like               screen -dRR my_session_name      I _can_ get access to a new screen session. While on SSH, I seem able to re-attach to sessions if they are already running:               screen -R my_session_name      but creating a new session (whether or not some other session exists, but most frustratingly when none do) will _hang_ , the only way to escape being a `^Z` to push it to the background, and then an `fg` to restart the job, at which point I am informed it has died (`Sorry, cannot contact session "processnumber.tty.hostname" again.`) I have tried running `sudo dtruss screen` (Mac OS X's version of `strace`), but I have no idea what to look for in the (extremely verbose) output. I am away from my machine for a while (in a different city for a few days) and I really need to start a new screen session! my `~/.screenrc`:               # Set the shell to use fish:     shell "/usr/local/bin/fish"          # Make xterm scrolling work properly with screen.     # Note, this works in Terminal.app and iTerm too.     #termcapinfo xterm-256color|xterm-color|xterm|xterms|xs|rxvt ti@:te@          # Custom escape character like this:     escape ^Xx          # always create these sessions for me:     screen -t "foo" 1          # test to see if I can create new screens from SSH in any way:     #nonblock on      I have tried, as you can see, adding and commenting out various options to try to solve this. (just now, I've tried with both `fish` and `bash`, from both `fish` and `bash` outer sessions, with and without `noblock`, and with and without a `screen -t`.) I also see the same behaviour on very fast and very slow connections. I would be very grateful for any of the following information:   * suggestions on finding the problem (important parts of strace/dtrace output, something else?)   * suggestions of new `.screenrc` options,   * something completely different? am happy to post more information, but wanted to avoid the whole `dtruss` output as it's hundreds of lines long.


title: Getting second GPU monitors outputted as Multi-Display

text: **OS** Kali Linux 1.0.6 **Hardware** HD7950 x 3 BenQ Monitors x4 - 1920x1080 Kogan Monitors x2 - 2560 x 1440 **Xorg.conf** http://pastebin.com/JqTPUw7s **Situation** Currently I'm trying to get all 6 monitors running as a multi-display desktop. GPU1 is outputting the picture for Kogan monitors x 2 and BenQ monitors x 2 perfectly. The OS can see all AMD cards. The problem lies in the fact that when I try and get the two final monitors outputting from GPU2 the only selectable option for outputting is "Single Display Desktop", not multi- display desktop with the previous 4 working monitors. Any help would be greatly appreciated with this configuration issue. Any questions please ask.


title: screen capturing fails when trying second time by using ffmpeg

text: I'm trying to capture screen by using ffmpeg.               ffmpeg -video_size 1024x768 -framerate 25 -f x11grab -i :0.0+100,200 output.flv      It worked at first, but after I end the first capture by `Ctrl + C`, second try fails with this error.               ffmpeg version git-2013-08-02-2b9590e Copyright (c) 2000-2013 the FFmpeg developers       built on Aug  3 2013 01:13:06 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)       configuration: --prefix=/home/ironsand/ffmpeg_build --extra-cflags=-I/home/ironsand/ffmpeg_build/include --extra-ldflags=-L/home/ironsand/ffmpeg_build/lib --bindir=/home/ironsand/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab       libavutil      52. 40.100 / 52. 40.100       libavcodec     55. 19.100 / 55. 19.100       libavformat    55. 12.102 / 55. 12.102       libavdevice    55.  3.100 / 55.  3.100       libavfilter     3. 82.100 /  3. 82.100       libswscale      2.  4.100 /  2.  4.100       libswresample   0. 17.103 /  0. 17.103       libpostproc    52.  3.100 / 52.  3.100     [x11grab @ 0xb068e60] device: :0.0+100,200 -> display: :0.0 x: 100 y: 200 width: 1024 height: 768     [x11grab @ 0xb068e60] shared memory extension found     X Error of failed request:  BadMatch (invalid parameter attributes)       Major opcode of failed request:  140 (MIT-SHM)       Minor opcode of failed request:  4 (X_ShmGetImage)       Serial number of failed request:  11       Current serial number in output stream:  11      I think the `stream 11` is still busy by first one, but I don't know how to free it. What should I do to fix this problem? Was that wrong to stop capturing by `Ctrl + C`?


title: What exactly does the --names-only option of apt-cache do?

text: According to the manual, it                  search regex...            search performs a full text search on all available package lists            for the POSIX regex pattern given, see regex(7). It searches the            package names and the descriptions for an occurrence of the regular            expression and prints out the package name and the short            description, including virtual package names. If --full is given            then output identical to show is produced for each matched package,            and if --names-only is given then the long description is not            searched, only the package name is.     [...]             --names-only, -n            Only search on the package names, not the long descriptions.            Configuration Item: APT::Cache::NamesOnly.      However, I came across a strange situation:               $ apt-cache search --names-only 'kde*' | grep tkcv     tkcvs - Graphical front-end to CVS and Subversion      Why in the world would the command above match `tk8.6-doc`? Braiam and I spent a few minutes chatting about this and he noticed that               $ apt-cache show tkcvs | grep -i kd     Replaces: tkdiff     Provides: tkdiff      So, Braiam suggested that it's matching the `Replaces` field as well which makes a certain amount of sense in the case of changing package names. OK then, but what about:               $ apt-cache search --names-only 'kde*' | grep tk8.6     tk8.6-doc - Tk toolkit for Tcl and X11, v8.6 - manual pages     $ apt-cache show tk8.6-doc | grep -i kd     Provides: tkdoc     Conflicts: tkdoc      Here it is either matching the `Conflicts` or the `Provides` fields and I can't twist the meaning of `\--names-only` to make it match those fields. So, what exactly does `\--names-only` search through? Is it the **names** of all **packages** that are mentioned in a package's description? It is clearly not matching the package name alone.


title: Some issues when install libvirt

text: I am trying to install libvirt from source codes, my workflow is shown below,               #!/bin/sh     apt-get install gnutls-bin libgnutls-dev -y     apt-get install libxml++2.6-2  libxml++2.6-dev -y     apt-get install libdevmapper-dev -y     apt-get install libpciaccess-dev -y     apt-get install python-dev -y     apt-get install libnl-dev -y          if [ ! -f ./libvirt-1.1.1 ]; then     wget http://libvirt.org/sources/libvirt-1.1.1.tar.gz     fi          tar -xzvf ./libvirt-1.1.1.tar.gz     cd ./libvirt-1.1.1     ./configure --prefix=/usr --localstatedir=/var  --sysconfdir=/etc     make     make install      I have no trouble in `configure`, `make`, and `make install`. However, after `make install` finishing, when I type `virsh --version`, I get the following error message:               virsh: /usr/lib/libvirt.so.0: version `LIBVIRT_PRIVATE_1.1.1' not found (required by virsh)      I wonder what's wrong with that? Please help, thanks!


title: What is the difference between .a and .so file?

text: As far as I understand they are libraries, but what is the difference between the two?


title: Non-Ebuild Programs on Gentoo

text: I like the "compile it yourself" philosophy that Gentoo runs on, but how is the support for non-ebuild programs? That might just mean binaries, but also programs in general that were not acquired through Emerge. Is it a big problem when the actual stuff installed on the system gets out of sync with Emerge's bookkeeping?


title: setpci - Making a script to manually change brightness

text: I can use something like               setpci -s 00:02.0 F4.B=XX      replacing 00:02.0 with your device address (obtained via lspci | grep VGA) and XX with a value between 00 and FF (FF = 100%, 7F = 50%, etc...) to manually change my brightness from the terminal (as root, or with proper chmods). I wish to make a script to manually change my brightness via keystrokes. To do so, I need to get the _current state (XX above)_ in order to relay to the script the current brightness of the screen. How can I obtain the current state?


title: dualhead nvidia twinview + one monitor rotated

text: So I have two monitors, I want to rotate one in portrait. AFAIK twinview doesn't allow single monitor rotation -- both monitors are rotated. The reason I want twinview is because it allows compositing. My question would be, is there anything I can do to have compositing, dual head, and one of the monitors in portrait mode. If not, when are these ridiculously simple problems going to be addressed ? -- edit -- Just bought another high-spec monitor to go with my main one, no portrait 4 me :/ Gonna get a neck injury with these 2 16:10 monitors lol.


title: OpenGL in Fedora as a VMWare guest under Windows 7

text: I installed Fedora 14 (64-bit) on a Windows 7 64 bits system, as a guest in VMWare. I can't use OpenGL support, Compiz and other openGL programs do not work. I searched on Google; I found solutions if both the guest and the host run Linux or if both the guest and the host run Windows. How can I use OpenGL with a Windows host and Linux guest in VMWare?


title: Losing static IP and and getting DHCP IP

text: I have a Debian 7.1 machine that is our internal intrusion detection system running snort. It has started flaking on me and will pull a DHCP address even though I have it set to static. This happens every few hours. Here is my `/etc/network/interfaces`                   # This file describes the network interfaces available on your system         # and how to activate them. For more information, see interfaces(5).              # The loopback network interface         auto lo eth0 eth1         iface lo inet loopback              # The primary network interface         allow-hotplug eth0         iface eth0 inet static                 address 10.10.10.107                 netmask 255.255.255.0                 gateway 10.10.10.1              iface eth1 inet manual                 up ifconfig $IFACE 0.0.0.0 up                 up ifconfig $IFACE promisc                 down ifconfig down


title: How to document my custom bash functions and aliases?

text: ### Problem: I have multiple bash functions and aliases. I can't remember all of them off the top of my head, so I usually end up opening my `.bash_functions` and `.bash_aliases` files to find what I need. ### Question(s): How can I list functions/aliases available from the bash prompt? Is it possible for me to document my bash functions/aliases using comments (kinda like PHPDoc)? I'd just like a simple/nice way to output what's available without having to open the files. It would be cool to run a command and have it spit out a dynamic list of my functions/aliases (usage examples would be a plus). :)


title: Error sending message, child exited 71 (Operating system error)

text: I'm trying to send mail through mutt command. I got the error message **Error sending message, child exited 71 (Operating system error.)**. I was able to send email through this command earlier, but can't now. I don't know why it happen. I tried searching on Google but not got any appropriate answer. Any help would be appreciated.


title: Change password through linux PAM without running application as root

text: An application I'm writing will have some password change functionality. However I'm wondering if it is possible to not run the account management part of it as root. Right now I'm running into the issue that if I'm running as the user that I'm trying to manage I can't change the password. I've verified that the password is correct by first authenticating with the given password. (separate call to another part of the auth module.) Only when I then make a call to `chauthtok` to change it for the user `pamtest` it results in this as my debug output for the conversation function:               START PAM CHANGE PASSWORD     PAM_CONV start [('Changing password for pamtest.', 4)]     PAM_CONV iter: Changing password for pamtest. 4     PAM_CONV end: [('', 0)]     PAM_CONV start [('(current) UNIX password: ', 1)]     PAM_CONV iter: (current) UNIX password:  1     PAM_CONV end: [(u'5ACN5pbmDFBVMHp', 0)]     PAM_CONV start [('Enter new UNIX password: ', 1)]     PAM_CONV iter: Enter new UNIX password:  1     PAM_CONV end: [(u'pdJb7ffsQTHWw4V', 0)]     PAM_CONV start [('Retype new UNIX password: ', 1)]     PAM_CONV iter: Retype new UNIX password:  1     PAM_CONV end: [(u'pdJb7ffsQTHWw4V', 0)]     Pass change failed for pamtest! '' (('Authentication token manipulation error', 20))     response:False      Where the debug flag for `pam_unix.so` gives this line twice in the rsyslog `auth.log` file:               <date> <time>   <system>    python  pam_unix(passwd:chauthtok): username [pamtest] obtained      This leads me to believe that there's an issue with writing the changed password to the shadow file. Which is probably due to root being the only one with write access. And the code does work when I run it as root. Is this a correct assumption and if so, is this normally done by running the module as root? Or are there other options available like creating a specific user with only rights to write to the shadow file?


title: problem with server bonding interface configuration

text: We are facing some problem with configuration of servers: There are 2 servers, each one contain 2 NICs which are in bond. Each server is connected to 2 Cisco switches (one connection from each NIC to separate switch). The port on the switch is configured to have VLAN 1111. There is also interconnection between switches (this VLAN is part of the interconnection). There is following error on the switch2 (Gi0/25 is where server is connected, Gi0/30 is the interconnection)               *Jun  1 16:18:23.182: %SW_MATM-4-MACFLAP_NOTIF: Host 1cc1.de7a.04b6 in vlan 1111 is flapping between port Gi0/25 and port Gi0/30      *Jun  1 16:18:45.093: %SW_MATM-4-MACFLAP_NOTIF: Host 1cc1.de7a.04b6 in vlan 1111 is flapping between port Gi0/30 and port Gi0/25      *Jun  1 16:18:56.031: %SW_MATM-4-MACFLAP_NOTIF: Host 1cc1.de7a.04b6 in vlan 1111 is flapping between port Gi0/25 and port Gi0/30      *Jun  1 16:19:15.141: %SW_MATM-4-MACFLAP_NOTIF: Host 1cc1.de7a.04b6 in vlan 1111 is flapping between port Gi0/25 and port Gi0/30      *Jun  1 16:19:23.479: %SW_MATM-4-MACFLAP_NOTIF: Host 1cc1.de7a.04b6 in vlan 1111 is flapping between port Gi0/30 and port Gi0/25      *Jun  1 16:19:45.616: %SW_MATM-4-MACFLAP_NOTIF: Host 1cc1.de7a.04b6 in vlan 1111 is flapping between port Gi0/30 and port Gi0/25       when checking configuration you can see that both switches has learned 1cc1.de7a.04b6 MAC address               NLS-PDC-SW2>show mac address-table vlan 1111                Mac Address Table     -------------------------------------------     Vlan    Mac Address       Type        Ports     ----    -----------       --------    -----     1111    1cc1.de7a.046a    DYNAMIC     Gi0/26     1111    1cc1.de7a.04b6    DYNAMIC     Gi0/25     Total Mac Addresses for this criterion: 23          NLS-PDC-SW1>show mac address-table vlan 1111                Mac Address Table     -------------------------------------------     Vlan    Mac Address       Type        Ports     ----    -----------       --------    -----     1111    1cc1.de7a.04b6    DYNAMIC     Gi0/25     Total Mac Addresses for this criterion: 24     NLS-PDC-SW1>      checking the modprobe file from both servers I've found that on server2 (which contain 1cc1.de7a.04b6)               alias bond0 bonding     options bond0 miimon=100      and on server1 (which contain 1cc1.de7a.046a)               alias bond0 bonding     options bond0 miimon=100 mode=1      I'm really confused with the needed configuration. Can you please suggest?


title: How to disable daily run output email?

text: How to disable daily run output email from "Charlie &"? Googled couple of pages, but there is no clear answer. I use `ssmtp` instead of `sendmail`


title: Difference between cat * and cat * >>

text: To merge multiple files in a dir I have tried:               cat * myfile.log      but this seems to just merge line and line and is thus very slow So using instead:               cat * >> bigfile      merges the files much faster (from combine multiple files into one file?). What is the difference between each version of merging multiple files?


title: Problem creating raw disk image and mounting it in rescue mode to QEMU

text: I am trying to create booting system from raw disk image. This is what I do:               $ dd if=/dev/zero of=system2.img bs=1M count=6000     6000+0 records in     6000+0 records out     6291456000 bytes (6.3 GB) copied, 69.3662 s, 90.7 MB/s     $ sudo fdisk system2.img     Command (m for help): o     Building a new DOS disklabel with disk identifier 0xdd22ed22.     Changes will remain in memory only, until you decide to write them.     After that, of course, the previous content won't be recoverable.          Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)          Command (m for help): w     The partition table has been altered!          Syncing disks.     $ sudo fdisk system2.img          Command (m for help): n     Partition type:        p   primary (0 primary, 0 extended, 4 free)        e   extended     Select (default p):     Using default response p     Partition number (1-4, default 1):     Using default value 1     First sector (2048-12287999, default 2048):     Using default value 2048     Last sector, +sectors or +size{K,M,G} (2048-12287999, default 12287999):     Using default value 12287999          Command (m for help): a     Partition number (1-4): 1          Command (m for help): w     The partition table has been altered!          Syncing disks.     $ sudo kpartx -avs system2.img     add map loop1p1 (252:0): 0 120832 linear /dev/loop1 2048     $ sudo mkfs.ext4 -U c0f21c98-ebf4-4f27-91b8-205da17c7893 /dev/mapper/loop1p1     mke2fs 1.42 (29-Nov-2011)     Discarding device blocks: done     Filesystem label=     OS type: Linux     Block size=1024 (log=0)     Fragment size=1024 (log=0)     Stride=0 blocks, Stripe width=0 blocks     15104 inodes, 60416 blocks     3020 blocks (5.00%) reserved for the super user     First data block=1     Maximum filesystem blocks=61865984     8 block groups     8192 blocks per group, 8192 fragments per group     1888 inodes per group     Superblock backups stored on blocks:             8193, 24577, 40961, 57345          Allocating group tables: done     Writing inode tables: done     Creating journal (4096 blocks): done     Writing superblocks and filesystem accounting information: done      Then I try to use this disk image QEMU and rescue mode (booting from debian netinst ISO). It offers me to mount `/dev/sda1`, but fails to do so. From `/var/log/syslog` it appears like it sees the `/dev/sda1` as FAT I have another disk image, which works with rescue mode. The only difference I could find between them is that, if I look at the working image with `cfdisk` I see first partition type as `ext4`. In failing image it says `Linux`


title: Join command gives incorrect output?

text: I'm trying to join two simple files in Solaris 5.8 Version as below:               ~/temp/s: cat 1     work1 a 8058 51     work2 b 15336 51          ~/temp/s: cat 2     8058 77-11:29:32 /apps/sas     15336 100-12:23:49 /local/hotfix          ~/temp/s: join -1 3 -2 1 1 2     8058 work1 a 51 77-11:29:32 /apps/sas (The other line is missing from the output)      The output only contains one record where it should be two. I'm really not sure where it went wrong. Is there any way we may get all the records in the output?


title: Configuring FTP server in redhat

text: I have installed vsftpd in redhat. Everything was file untill I fould that when I log into ftp server using: > ftp localhost `or fileZilla` I get following errors:               ERROR:     - 500 OOPS: cannot change directory:/foo      * * * Also, when I change the log directory from               - /var/log/xferlog      to               - /usr/local/data      Then I get:                 500 OOPS: failed to open xferlog log file:/usr/local/data/vsftpd.log      From this link the SOLUTION seems to be:               This happens because SELinux isn’t properly configured for your ftp service. Either disable SELinux or configure it for ftp.          To disable SELinux, edit /etc/selinux/config and set “SELINUX=disabled”, then reboot.      How do I enable ftp without disableing SElinux?


title: Is there a way to customize "Programmable Completion" in the current session?

text: If I start typing a command or filename, I can use the tab key to auto- complete my string. That is well known... Is there a way to change the behavior of the auto complete for the current bash session so that it will do certain things? ### For example On pressing `Tab` `Tab` in the current session, only files that contain `*.txt` will be displayed. Are there certain environment variables or something that could make this work?


title: How does the system shutdown of a linux kernel work internally?

text: I have somehow an rough idea of how the userspace and init-system (be it classic init sysV /upstart/ systemd) work at system shutdown. (Essentially there is an order succession of "Stop!", "Please stop now really", "Process I need to kill you to Stop" and waiting... things going on). I am anyhow very unaware of how the system shutdown works in the kernel (where surely there is also lots of stuff to do)? I tried to look into the kernel documentation https://www.kernel.org/doc/htmldocs/ and even used the NSA's pal search tool to give me a head start on finding out how it works. Also I searched on SE U+L and found nothing (did I overlook it?) Anyways the question, though potentially a bit challenging, would merit an answer in this Q&A network as I assume more people are interested to get a sketch for what happens in the linux kernel at shutdown. Potentially there is also change to link to some more detailed explanations. An answer might maybe include which system-calls and which kernal signals are used? https://github.com/torvalds/linux/blob/b3a3a9c441e2c8f6b6760de9331023a7906a4ac6/arch/x86/kernel/reboot.c seems to be the x86 used file related to reboot (already close to shutdown, eh?) maybe the snippet found here http://lxr.free- electrons.com/source/kernel/reboot.c#L176 can be used to give an explanation               176 void kernel_power_off(void)     177 {     178         kernel_shutdown_prepare(SYSTEM_POWER_OFF);     179         if (pm_power_off_prepare)     180                 pm_power_off_prepare();     181         migrate_to_reboot_cpu();     182         syscore_shutdown();     183         pr_emerg("Power down\n");     184         kmsg_dump(KMSG_DUMP_POWEROFF);     185         machine_power_off();     186 }     187 EXPORT_SYMBOL_GPL(kernel_power_off);


title: How we can avoid rebooting the system after partition change with fdisk?

text: When modifying the partition table, `fdisk` usually returns the following error message: > WARNING: Re-reading the partition table failed with error 16: Device or > resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Is there any method to avoid the reboot?


title: Why does RTC device have 254,0 instead of 10,135 as Major,Minor numbers?

text: Why isn't /dev/rtc the well known "c 10 135" device that it's on x86, but a magic undocumented "c 254 0" device? Devices.txt lists this major number as LOCAL/EXPERIMENTAL USE. I'm working on a buildroot custom board.


title: View stdout/stderr of systemd service

text: I have created a simple systemd service file for a custom application. The application works well when I run it manually, but my CPU gets maxed out when I run it with systemd. I'm trying do track down where my problem is, but I don't know where to find the output (or how to configure systemd to put the output somewhere). Here is my service file:               [Unit]     Description=Syncs files with a server when they change     Wants=network.target     After=network.target          [Service]     ExecStart=/usr/local/bin/filesync-client --port 2500     WorkingDirectory=/usr/local/lib/node_modules/filesync-client     Restart=always          [Install]     WantedBy=multi-user.target      Throughout the application, I output to stdout and stderr. How can I read the output of my daemon? Edit: I found `man systemd.exec`, which mentioned the `StandardOutput=` option, but I'm not sure how to use it. From the man page: > StandardOutput= > > Controls where file descriptor 1 (STDOUT) of the executed processes is > connected to. Takes one of **inherit, null, tty, syslog, kmsg, kmsg+console, > syslog+console or socket**. > > If set to inherit the file descriptor of standard input is duplicated for > standard output. If set to null standard output will be connected to > /dev/null, i.e. everything written to it will be lost. If set to tty > standard output will be connected to a tty (as configured via TTYPath=, see > below). If the TTY is used for output only the executed process will not > become the controlling process of the terminal, and will not fail or wait > for other processes to release the terminal. syslog connects standard output > to the syslog(3) system logger. kmsg connects it with the kernel log buffer > which is accessible via dmesg(1). syslog+console and kmsg+console work > similarly but copy the output to the system console as well. socket connects > standard output to a socket from socket activation, semantics are similar to > the respective option of StandardInput=. This setting defaults to inherit. Does this mean that these are my only options? I would like, for example, to put output in `/dev/shm` or something. I suppose I could use a unix domain socket and write a simple listener, but this seems a little unnecessary. I just need this for debugging, and I'll probably end up removing most of the logs and change the output to syslog.


title: Linux Mint 17, Wifi Slow and Drops Connection, No Ethernet Connection

text: On a fresh install and updated Linux Mint 17 XFCE, the system cannot maintain an internet connection through wifi, and is unable to connect at all through ethernet. Wifi will work somewhat slowly for a few minutes and then stop internet access. It usually maintains a connection to the router, but cannot load anything. I have gone through installing different types of drivers for my specific usb wifi adapter with no connection improvement. These were from the manufacturer (Netis) website, the Realtek website, and other modified drivers from the community that should circumvent what appears to be a driver problem. I know that this issue has been seen before from checking many forums and documents online. I've spent a few days trying to sort this out to no avail. Would anyone be able to help resolve my specific case? I have been able to connect to another computer through ethernet, so it appears that the drivers for that hardware is working to a degree. My system specifications are below, let me know if I should post up any terminal output that would be useful: Asus Z97-A motherboard; Intel Pentium G3258 CPU Netis WF2111 (rtl8192cu driver); Also tried older Netgear WG111v2, resulted in same connection problems. Arris NVG859 Router (ISP: AT&T) Intel I218-V Ethernet (e1000e driver, I think this is the correct one but cannot verify the version) iwconfig output:               wlan0     IEEE 802.11bgn  ESSID:"VVVVVVVVVV"             Mode:Managed  Frequency:2.437 GHz  Access Point: 94:62:69:25:B8:20              Bit Rate=72.2 Mb/s   Tx-Power=20 dBm              Retry  long limit:7   RTS thr=2347 B   Fragment thr:off           Power Management:off           Link Quality=70/70  Signal level=-38 dBm             Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0           Tx excessive retries:0  Invalid misc:0   Missed beacon:0


title: Recovering Ubuntu

text: My Ubuntu 11.04 guest on VBox 4.0.10 crashed when I was working. Is there a way to go back to previous working configuration? I have always used the saved state and power off option. I did not take snapshots though. Or is there a way to go back to previous configurations in Ubuntu?


title: cd and ls in the same call

text: I often have to `cd` to a directory and `ls` to see the directory listing. Can it be done with one shot, so that I can add to `.bashrc` as alias. I searched on Google, there were some answers, but incomplete.


title: Change Directory and List Files

text: > **Possible Duplicate:**   >  Make cd automatically ls I think that it would be very useful to have a unix utility that combines 'cd' and 'ls' so that when you change your directory, it automatically lists the files in that directory. I have tried to do this using shell scripts, and C programs and a combination of the two, but nothing seems to work, because any 'cd' or 'chdir()' call in a shell script/ c program only changes the directory for that instance (not for the shell). The psudocode would look like (if it was only this simple!):               cd $1     ls      If anyone has any ideas of how to implement this I would really appreciate it! Thanks, Kevin


title: How to stop the loop bash script in terminal?

text: For example,               #!/bin/bash     while :     do         sl     done      How to terminate this bash script?


title: Define length and scale picture

text: Is there any program under linux where I can do the following: Suppose I have for example a scan of a drawing on a squared paper and suppose that the squares of the original paper have any distance but not 0,5 cm. Now I want that the squares of the output picture have a distance of exactly 0.5 cm. I tried to include the picture to `inkscape` and use the ruler to rezize the picture appropriately but this was a pain. I think something like this would be great: Have a "distance tool" where you can select two points of a picture (for example two vertices of my squared paper squares) then you define that the distance between those points should be say 0.5 cm then the whole picture should scale appropriately while preserving aspect ratios. Note that I am mainly interested in a solution where I don't have to measure the distance on the original paper using a physical ruler or something like that. **Edit** Finally I want a DIN A4 `pdf` including my picture and print it. In my example the point is that the distance of the squares should be 0.5 cm in the **printed** version...


title: XBMC Live TV setting to get network iptv channels

text: Im currently running Linux Mint 17-qiana cinnamon, and i wanted to test something that later i want to configure in a home media server that i will build. The thing is, i have a contract with an internet/phone/tv provider,Vodafone 50MB fiber, and their setup currently is a DVR TV box that is only connected to my router, their box gets the channels, and i was wondering if I could somehow get the channels too and view them with xbmc, hence, building an home media server that would be in my network and i could after that do everything... Visit websites, share content with my laptop... well everythin that a linux computer can do, but it would be connected to my projector so i could watch tv and movies. The thing here is, i've been looking online and the closest i can get to this is downloading m3u playlists for viewing the channels as if i didnt pay for them, which isn't my plan, since i already pay for the channels, i would like to not have to use their box, and instead connect a computer. I have noticed there is a channel search feature but only certain add-ons support that, first of all, does anyone know which add-ons support that? Second, would this solve the problem? Could the search find these channels? If this does not solve it, what could do what i want? Would i need to talk to the provider about this? Could they possibly give me access to their m3u playlist? im technically not infringing anything, i'm paying for the service and i only want to integrate it with my system, so i dont see a problem, but on the other hand, i dont know much about this live TV stream, and i'm afraid they might think i want to share this m3u list so people get free TV (i don't know if it is even possible) Sorry for the long post but most is for context, if there is anything i can clarify, just ask me to and i will. Thanks,


title: Debian 6.0 and Xen PyGrub failure

text: On my VPS (running Debian 6.0 on Xen with PyGrub) I get the following error when trying to upgrade the system:               Searching for GRUB installation directory ... found: /boot/grub     warning: grub-probe can't find drive for /dev/xvda1.     grub-probe: error: cannot find a GRUB drive for /dev/xvda1.  Check your device.map.      I googled and found this solution:               echo '(hd0) /dev/xvda' > /boot/grub/device.map     mknod /dev/xvda b 202 0      Apparently that only works on older systems and not on my server. Any ideas?


title: What is Linux for $DECK and $EOD?

text: In VMS DCL one may embed data in a command file using $DECK and $EOD. What is Linux for this?


title: How to run commands in batch mode over ssh?

text: How can I run commands in batch mode over ssh? That is, what is the `ssh` command's equivalent of `sftp -b <filename> <hostname>`? I have a set of commands which I wish to run across a set of hosts connecting over `ssh`. Over `sftp`, i store the commands in a file `filename` and connect to the host and run the commands using the previously mentioned command. Is something like that possible over `ssh`?


title: OpenBSD patch system

text: If I install OpenBSD from CD-ROM: http://www.openbsd.org/ftp.html with `install48.iso` then is it patched?   1. All 10 patches from here are in the ISO file?   2. If those are not included, how can I apply these patches? Is there a one-liner command (like under Fedora: `yum upgrade` or Debian based, `apt-get upgrade`) or do I have to download and apply all 10 patches one by one?


title: Open Source firmware for e-ink book reader

text: Is there any open source version of firmware for ebook readers or maybe project like RockBox? AFAIK most of e-ink readers runs linux, so maybe exists at least one model of e-reader with an open specification and/or drivers for which you can build your own custom linux ?


title: Lightweight custom linux build

text: I am looking for a Linux build that takes up very little memory to boot up. I don't need any of the UI modules. I need help on choosing from the ones currently available or pointers on building my own. I looked at some Linux distros like Arch Linux and Damn Small Linux, but I haven't decided yet. And also it would be great if someone could help me on how to run a custom program immediately on bootup. Thanks for the help, in advance.


title: What does eno mean in network interface name 'eno16777736' for CentOS 7 or RHEL 7?

text: Under consistent network device naming scheme, what does 'eno' stand for in network interface name 'eno16777736' for CentOS 7 or RHEL 7?


title: How can we make the server overloaded?

text: In college systems, the server running the rhel, and the nodes which are used by the students are running the windows xp are connected to the server by LAN cables. But I want to slowdown the server, so the request to the server, which is serving the students command request through terminal will response very slow. How this can be done?


title: Linux-swap on reboot

text: I'm wondering what actually happens to a Linux-swap partition reboot. I've been taking a course in computer organization and while installing/partitioning a new drive I became rather curious about this.   1. As I understand it, Linux-swap partitions are more-or-less unallocated space within a partitioning scheme on a hard-drive that acts as a stack of memory in similar fasion to ram but had a larger databus waiting time (since it is a HDD/SSD managed in part by the drive itself rather than true ram managed directly by the CPU). Is this model correct?   2. Is information persistent until a Linux-swap tool cleans it, unlike RAM which is erased by a lapse in power?   3. Can you address it directly? Or in C/C++ by the assistance of the kernel (so as to not mess stuff up)?


title: Split the file and put it in corresponding data structure?

text: I have a file which contains the single line below:               {machineA=[0, 1024, 4, 1028], machineB=[1, 1025, 5, 1029]}      in which I have two datasets:               machineA=[0, 1024, 4, 1028]     machineB=[1, 1025, 5, 1029]      Now, I need to read the above file and split it in such a way that I can extract each machine's information as mentioned above and store it in some data structure. Currently, I am confused which data structure I should be using in a bash shell script. If I was doing this in Java, I would use `Map<String, Set<String>>` but I'm not sure what should I use in a shell script. And after storing it in some data structure, I need to iterate it and print out the result. I am able to read the above file using the shell script below:               #!/bin/bash          while read -r line; do            echo "$line"         done < data.txt      But I am not sure how to split the above line data in such a way so that I am able to extract each machine informaiton and then store it in some data structure? **UPDATE:-** Below is my shell script I have got after following the suggestion given by glenn -               #!/bin/bash          while read -r line; do            echo "$line"            declare -A "$(                 echo "x=("                 grep -oP '(\w+)(?==)|(?<==\[).*?(?=\])' <<< "$line" |                   tr -d , |                   paste - - |                   sed 's/^/[/; s/\t/]="/; s/$/"/'                 echo ")"             )"                  for key in "${!x[@]}"; do           # need quotes here                 for element in ${x[$key]}; do   # no quotes here                     printf "%s\t%s\n" "$key" "$element"                 done             done             done < primary.txt


title: Generating commands with variable expansion in a loop

text: I want to create local aliases while I work in certain directories. For example, I would like to have the following in a file named `local_alias`               alias foo='bar'      I wanted to write a cleanup script to remove these aliases after I finish working. Something like:               egrep "alias [[:alnum:]]+" local_alias -o|while read i; do       un$i     done      If I change the middle line to `echo un$i`, the output is what looks like a properly formatted `unalias` command: `unalias foo`. But as written, I get `unalias: foo: not found`. If I try quoting the middle line: `"un$i"`, I instead get `unalias foo: command not found`. What am I doing wrong?


title: What does the 'd' mean in ls -al results and what is that slot called?

text: In Linux, what does the `d` mean in the first position of `drwxr-xr-x`? And what are all of the possible letters that could be there, and what do they mean? I'm trying to learn more about the Linux file permissions system, and I'd like to see a list of the character meanings for the first slot.


title: Unable to install skype on LMDE,how to resolve these dependencies?

text: I have downloaded "multiarch" .deb file for latest skype and unable to install it on latest version of LMDE (linux mint debian edition Xfce x86_64). e.g   1. step one :              sudo dpkg -i skype-debian_4.1.0.20-1_i386.deb       output:              dpkg: dependency problems prevent configuration of skype:     skype depends on libqt4-dbus (>= 4:4.5.3).     skype depends on libqt4-network (>= 4:4.8.0).     skype depends on libqt4-xml (>= 4:4.5.3).     skype depends on libqtcore4 (>= 4:4.7.0~beta1).     skype depends on libqtgui4 (>= 4:4.8.0).     skype depends on libqtwebkit4 (>= 2.1.0~2011week13).        2. step two (trying fix broken) :              sudo apt-get install -f          Reading package lists... Done     Building dependency tree            Reading state information... Done     Correcting dependencies... Done     The following extra packages will be installed:       libapache2-mod-php5filter     Suggested packages:       php-pear     The following packages will be REMOVED:       libapache2-mod-php5 php5-cli skype:i386     The following NEW packages will be installed:       libapache2-mod-php5filter     0 upgraded, 1 newly installed, 3 to remove and 3 not upgraded.     1 not fully installed or removed.     Need to get 0 B/2,663 kB of archives.     After this operation, 44.9 MB disk space will be freed.      Here my main concern is the way its removing my LAMP related files e.g.:               The following packages will be REMOVED:     libapache2-mod-php5 php5-cli skype:i386      I need a way to install skype without upsetting other installed applications. The `sudo apt-get install -f` just removes and does not fixes the dependencies. I'll appreciate if someone write step-wise commands for the installation of skype and while keeping LAMP intact, and explain why the apache and skype are colliding .


title: Certain keys (arrows, page-up, page-down) not working in rdesktop-vrdp

text: I start and stop my VM headless style. Start               VBoxHeadless -s Windows -v on -e "TCP/Address=0.0.0.0" -e "TCP/Ports=3389"       Stop               VBoxManage  controlvm Windows poweroff      And I connect to it using the rdesktop protocol that VirtualBox natively supports.               rdesktop-vrdp localhost:3389      However after my kernel was forcefully upgraded for me today, I had to also upgrade my Virtualbox installation from `VirtualBox-4.1-4.1.8_75467_fedora16-1.i686.rpm` to `VirtualBox-4.2-4.2.6_82870_fedora16-1.i686.rpm` and after doing so, found myself unable to use arrow keys, control keys, page-up, page-down, etc, in my rdesktop-vrdp VM window. So the problem is: control/alt/arrow/etc keys not working in rdesktop-vrdp.


title: Redirect output from all commands to file, not just last

text: I want to add a header to a file with echo, then use a command to create the rest of the file. This means I'll be using two separate commands. How do I write the output from both commands to a file with redirection? I've tried               echo "header line" | cut -c 1-5 input_file > output_file          echo "header line"; cut -c 1-5 input_file > output_file      This only redirects the output from the cut command. The following command works, but feels clumsy:               echo "header line" > output_file; cut -c 1-5 input_file >> output_file      What is the clever way of solving my problem?


title: Fix LVM physical volume definition after removing /dev/sdb

text: Recently I set up LVM partition with an new disc /dev/sdc. I created the LVM with the following commands:               pvcreate /dev/sdc     vgcreate data /dev/sdc     mkfs.ext4 /dev/data/srv     tune2fs -m 0 /dev/mapper/data-srv      Now the problem is that the old disc /dev/sdb is gone and I get errors in /var/log/messages like:               sd 2:0:2:0: [sdc]  Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK     sd 2:0:2:0: [sdc] CDB: Read(10): 28 00 00 00 00 3f 00 00 04 00     blk_update_request: 8 callbacks suppressed     end_request: I/O error, dev sdc, sector 63     sd 2:0:2:0: [sdc] Unhandled error code     sd 2:0:2:0: [sdc]  Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK     sd 2:0:2:0: [sdc] CDB: Read(10): 28 00 00 00 00 3f 00 00 04 00     end_request: I/O error, dev sdc, sector 63     sd 2:0:2:0: [sdc] Unhandled error code      Because the old disc /dev/sdb was removed after crating the LVM, /dev/sdc (which is no longer present) took its place:               >pvs       /dev/sdc1: read failed after 0 of 2048 at 0: Input/output error       PV         VG   Fmt  Attr PSize   PFree       /dev/sdb   data lvm2 a--  330.00g    0          >lvscan       /dev/sdc1: read failed after 0 of 2048 at 0: Input/output error       ACTIVE            '/dev/data/srv' [330.00 GiB] inherit      The partition works fine though /sdc is no longer present. Nevertheless how can I fix the LVM to no longer search for /dev/sdc? I think LVM uses UUIDs internally. Otherwise this scenario wouldn't recognize sdb as the correct pv (disc) .


title: Are application layer protocols part of library routines?

text: Where do application layer protocols reside? Are they part of library routines of language e.g. C, C++, Java? As goldilocks says in his answer, this is about the implementation of application layer protocols.


title: Split the input file with line breaks

text: I am trying to insert line breaks on a file based on the same names which happens to be the second field in my file. So, my input file is like below.               17412193|name1|organization     43979400|name1|organization     1405541|name2|organization     53595498|name2|organization     50439202|name2|organization     54678379|name3|Not Found     21757330|name3|organization      So I am trying to get the output like,               17412193|name1|organization     43979400|name1|organization     ###linebreak inserted here     1405541|name2|organization     53595498|name2|organization     50439202|name2|organization     ###linebreak inserted here     54678379|name3|Not Found     21757330|name3|organization     ###linebreak inserted here      I am using this line break to split the input file to group the similar names together. I would later apply a similarity algorithm on these grouped names. So, for the above example, after the output I would apply the similarity algorithm on 3 pairs of names.


title: HTTP request failed after listening on multiple ports or after enabling SSL Module on my Linux Board

text: I have one custom Linux board on which I want to run apache web server to test HTML and other web based services. I have configured, cross compiled and installed default httpd (2.2.24, 2.4.1, 2.4.4 and 2.4.9) on my Linux PC (Ubuntu 12.04 LTS) as well as on my own custom Linux board. Then I have added support of SSL Module (mod_ssl) to test HTTP as well as HTTPS request. Both HTTP and HTTPS request works fine without any issue on my Linux PC (Ubuntu 12.04 LTS). But when I tried to execute same HTTP request on my Linux Board using httpd (2.4.4 and 2.4.9) at that time browser page goes into loading state and can not be came out from that situation after enabling SSL module. Also I have seen that HTTPS request works fine at that time. I have also did some debugging task through wire-shark tool and found that connection is established successfully after sending request through HTTP but can not get response of that request. I have also found that response of that HTTP request received on wire-shark after closing that HTTP requested page from browser. Also, I can run HTTP and HTTPS requests successfully using httpd (2.2.24 and 2.2.27) on my Linux Board but failed to execute same request using httpd (2.4.X) package. I have also changed some configurations by creating different virtual host for HTTP (Port 80) and HTTPS (Port 443) but still failed to execute that HTTP request. I have also tried to listen on different ports like (Listen 80 and Listen 8000) without SSL module (using httpd 2.4.4. and 2.4.9 ) at that time HTTP request goes into loading state. Can anyone has idea about this issue or help me to solve this type of issue?


title: Is there a secure (https) official site for CentOS iso hashes?

text: When I download a CentOS ISO the mirror has sha1sum.txt and other hash files, but I can't verify that these files haven't been tampered with as well. (One exmaple http://mirrors.sonic.net/centos/6.5/isos/x86_64/) I'd like an https (secure) download from centos.org of just the sha1sum.txt, but I can't find this anywhere.


title: What are considered utilities and applications?

text: Commands like `cp`, `ls`, `chmod`, `pwd` etc are called as utilities. I seem to not able to define what kind of things are called applications. Let's abandon GUI to make the definition more precise.


title: Printing short latex snippets

text: Is there a way to quickly (render and) print short latex snippets like single equations? Something similar to               echo "Some text" | lpr      like               make-latex-image "$\frac{some}{equation}$" | command-to-print-images


title: How do I remove a user from a group?

text: Which command should I use to remove a user from a group in Debian? When adding a user to a group, it can be done with:               usermod -a -G group user      However, I could not find a similar command (accepting a group and user as arguments) for removing the user from the group. The closest I could get is:               usermod -G all,existing,groups,except,for,group user      Is there a command like `usermod OPTION group user` with OPTION an option to make `usermod` (or a similar program) remove the user from group?


title: How can I set up logrotate to rotate logs hourly?

text: According the the Unix and Linux Administration Handbook and `man`, logrotate has options for `daily`, `weekly`, and `monthly`, but is there a way to add an `hourly` option? This blog post mentions you can set `size 1` and remove the time option (eg: `daily`) and then manually call `logrotate` with `cron` - I suppose something like               logrotate -f /etc/logrotate.d/my-hourly-file      but is there a more elegant solution for rotating logs hourly?


title: Difference between gawk vs. awk

text: Trying to understand the differences between the two functions gawk vs. awk? When would one use gawk vs awk? Or are they the same in terms of usage? Also, could one provide an example?


title: ulimit: difference between hard and soft limits

text: What is the difference between hard and soft limits in ulimit? For number of open files, I have a soft limit of 1024 and a hard limit of 10240. It is possible to run programs opening more than 1024 files. What is the soft limit for?


title: How to set parameter zero ($0) while executing a script?

text: I can manipulate positional parameters using `shift` or `set --` while a script is interpreted. How can I change `$0`?


title: How to find if hyperthreading is enabled on FreeBSD

text: Is it possible to find out if hyperthreading is enabled within the BSD kernel of a given machine without watching the boot up sequence?


title: Drudging through email logs

text: I am in charge of maintaining a linux e-mail server running `qmail` on Red Hat Linux. Fairly often, I have to trace the path of some email through syslog and to be frank, this is rather tedious. Particularly so for me as my Linux skills are somewhat at the level of a newbie. Are there any desktop apps (or even command tools) that inspect the incoming and outgoing mail logs with better usability instead of clobbering bash commands together? What I have in mind is some tool that I could import a log file and it would organize all the information for me, so that I could perform some searches on it, or view the path of email messages in and out of my system. Perhaps this is lofty wishes at the moment, but I'm trying to see what my options are.


title: Why first set a variable and then export it instead of setting and exporting in one command?

text: If `gpg-agent` is executed, it outputs data that can be processed by a shell directly, e.g.:               SSH_AUTH_SOCK=/tmp/ssh-apeOFqMF3292/agent.3292; export SSH_AUTH_SOCK;     SSH_AGENT_PID=3293; export SSH_AGENT_PID;     echo Agent pid 3293;      Why is `gpg-agent` doing this? I've seen more programs doing it. Did shells in the past not support `export var=val`? Which shells do not support this alternative shell built-in? I'm working with bash in Kubuntu.


title: How do I add a new user to an embedded Linux system by hand?

text: I have a system which was designed for use by root only and I want to run an FTP server on it. The software I use handles authentication by using same username and password as OS itself. To me it looks safer to have another user for FTP data transfer and another which would just run FTP server. So here's my problem: As I've said, system was designed to be used only by root and there's no useradd or anything similar, as far as I can see. Is it possible to add user by hand? I'm running OpenWRT Backfire 10.03.1-rc4, if it matters, but generic answers would be best.


title: Installing individual packages from Solaris .iso

text: I need to update the following packages:               SUNWjaf     SUNWjato     SUNWjmail      I read that the updated versions of these packages can be found on the latest version of Solaris, and that it's possible to just install the specific packages I want. I can only find them as directories in the .iso and they all have the following structure:               |-- archive     |   |-- none.7z     |-- install     |   |-- copyright     |   |-- depend     |   |-- i.none     |-- pkginfo     |-- pkgmap     |-- reloc      Is it possible to install these as some sort of package? Or turn them into a .pkg? Thanks for any help.