title: kvm usb modem passthrough

text: I'm trying to set up a USB modem passthrough in kvm virt-manager. The host is Fedora 20. The guest is Centos 6               $ ifconfig     wlp0s29u1u6: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500         ether 00:1a:3f:66:28:92  txqueuelen 1000  (Ethernet)         RX packets 0  bytes 0 (0.0 B)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 0  bytes 0 (0.0 B)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0      The modem works connecting from the host. As bridged networking does not work with wireless I installed this second USB modem. The primary one is PCI. I configured the passthrough in the virt-manager interface but when I try to start the guest I get this error message:               Error starting domain: Cannot set interface MAC on 'wlp0s29u1u6': Device or resource busy          Traceback (most recent call last):       File "/usr/share/virt-manager/virtManager/asyncjob.py", line 91, in cb_wrapper     callback(asyncjob, *args, **kwargs)       File "/usr/share/virt-manager/virtManager/asyncjob.py", line 127, in tmpcb     callback(*args, **kwargs)       File "/usr/share/virt-manager/virtManager/domain.py", line 1260, in startup     self._backend.create()       File "/usr/lib64/python2.7/site-packages/libvirt.py", line 708, in create     if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)     libvirtError: Cannot set interface MAC on 'wlp0s29u1u6': Device or resource busy      I guess I must first detach or unmount the device but how? EDIT               # virsh dumpxml rhel6     <domain type='kvm'>       <name>rhel6</name>       <uuid>23b78cf9-f0a0-4929-adc1-10e285f938fb</uuid>       <title>Centos6</title>       <memory unit='KiB'>4194304</memory>       <currentMemory unit='KiB'>4194304</currentMemory>       <vcpu placement='static'>1</vcpu>       <os>     <type arch='x86_64' machine='pc-i440fx-1.6'>hvm</type>     <boot dev='hd'/>       </os>       <features>     <acpi/>     <apic/>     <pae/>       </features>       <cpu mode='custom' match='exact'>     <model fallback='allow'>SandyBridge</model>     <vendor>Intel</vendor>     <feature policy='require' name='vme'/>     <feature policy='require' name='dtes64'/>     <feature policy='require' name='vmx'/>     <feature policy='require' name='erms'/>     <feature policy='require' name='xtpr'/>     <feature policy='require' name='smep'/>     <feature policy='require' name='pcid'/>     <feature policy='require' name='est'/>     <feature policy='require' name='monitor'/>     <feature policy='require' name='smx'/>     <feature policy='require' name='tm'/>     <feature policy='require' name='acpi'/>     <feature policy='require' name='osxsave'/>     <feature policy='require' name='ht'/>     <feature policy='require' name='pdcm'/>     <feature policy='require' name='fsgsbase'/>     <feature policy='require' name='f16c'/>     <feature policy='require' name='ds'/>     <feature policy='require' name='tm2'/>     <feature policy='require' name='ss'/>     <feature policy='require' name='pbe'/>     <feature policy='require' name='ds_cpl'/>     <feature policy='require' name='rdrand'/>       </cpu>       <clock offset='utc'>     <timer name='rtc' tickpolicy='catchup'/>     <timer name='pit' tickpolicy='delay'/>     <timer name='hpet' present='no'/>       </clock>       <on_poweroff>destroy</on_poweroff>       <on_reboot>restart</on_reboot>       <on_crash>restart</on_crash>       <devices>     <emulator>/usr/bin/qemu-kvm</emulator>     <disk type='file' device='disk'>       <driver name='qemu' type='raw'/>       <source file='/home/cpn/VirtualBox VMs/Centos6/Centos6.raw'/>       <target dev='vda' bus='virtio'/>       <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>     </disk>     <controller type='usb' index='0' model='ich9-ehci1'>       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>     </controller>     <controller type='usb' index='0' model='ich9-uhci1'>       <master startport='0'/>       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>     </controller>     <controller type='usb' index='0' model='ich9-uhci2'>       <master startport='2'/>       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>     </controller>     <controller type='usb' index='0' model='ich9-uhci3'>       <master startport='4'/>       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>     </controller>     <controller type='pci' index='0' model='pci-root'/>     <controller type='virtio-serial' index='0'>       <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>     </controller>     <interface type='network'>       <mac address='52:54:00:a7:f0:d7'/>       <source network='default'/>       <model type='virtio'/>       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>     </interface>     <interface type='direct'>       <mac address='52:54:00:c1:c5:1d'/>       <source dev='wlp0s29u1u6' mode='passthrough'/>       <model type='virtio'/>       <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>     </interface>     <serial type='pty'>       <target port='0'/>     </serial>     <console type='pty'>       <target type='serial' port='0'/>     </console>     <channel type='spicevmc'>       <target type='virtio' name='com.redhat.spice.0'/>       <address type='virtio-serial' controller='0' bus='0' port='1'/>     </channel>     <input type='tablet' bus='usb'/>     <input type='mouse' bus='ps2'/>     <graphics type='spice' autoport='yes'/>     <sound model='ich6'>       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>     </sound>     <video>       <model type='qxl' ram='65536' vram='65536' heads='1'/>       <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>     </video>     <memballoon model='virtio'>       <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>     </memballoon>       </devices>     </domain>


title: obsoleted package breaks yum install of older JBoss

text: I need to install an older version of JBoss. 6.1.0 EAP is what has been approved and supported for my application. So when I try to force install the correct version of the jbossas packages the install fails. A number of times in the dependancy resolution stage I get the following error:               Package shrinkwrap is obsoleted by shrinkwrap-impl-base, but obsoleting package does not provide for requirements      Then at the end I get the following error:               Error: Package: jbossas-modules-eap-7.2.0-8.Final_redhat_8.ep6.el6.noarch (jb-eap-6-for-rhel-6-server-rpms)            Requires: shrinkwrap >= 1.0.0            Available: shrinkwrap-1.0.0-14.redhat_1.ep6.el6.noarch (jb-eap-6-for-rhel-6-server-rpms)                shrinkwrap = 1.0.0-14.redhat_1.ep6.el6            Available: shrinkwrap-1.0.0-16.redhat_2.ep6.el6.noarch (jb-eap-6-for-rhel-6-server-rpms)                shrinkwrap = 1.0.0-16.redhat_2.ep6.el6      If I try:               yum install shrinkwrap-1.0.0-16.redhat_2.ep6.el6.noarch      It changes it to `shrinkwrap-impl-base-1.1.2`. So I'm not sure the best way to proceed. Is it possible to force yum to install the 1.0.0 package? If not, is it possible to install `shrinkwrap-impl-base` then install JBoss and ignore only that dependency? (there are several hundred other dependancies so I don't want to ignore all dependancies.) Or is there some other solution? System if RHEL 6.4 with base entitlement and `jb-eap-6-for-rhel-6-server-rpms` channel installed.


title: Strange behaviour from special keyboard keys

text: > **OS: Linux Mint 13 Maya - MATE** So, I had a new keyboard through today and there is something strange going on. The following keys are identified as the Shift key. > LEFT SHIFT > > RIGHT SHIFT > > LEFT CONTROL > > RIGHT CONTROL > > WINDOWS KEY ( SUPER ) > > LEFT ALT > > RIGHT ALT That's a lot of keys... So these keys not only do the same as the shift key but they are also identified as the shift key, I mean in Javascript the `event.keyCodes` are all 16 and they are also have identical info and key codes in `xev`. I thought at one point it could be the keyboard, so I tried it in a separate machine running windows 7 and it worked fine. I then thought it was the computer, so I pressed `E` on the GRUB menu screen and the control keys were working fine there so it's got to be something to do with mint, the problem only occurs when mint boots to the login screen everything before that is fine. I'm not sure what the problem is, at first I thought I would be able to do something to manually set the keys, but it turns out they are all identified as the same key so if I change one, then surely they'll all change. In the keyboard settings it's default English (UK) Generic 105-key. (Intl) PC


title: Using grep to search a file

text: Re : grep command. I have to search a file for the names of all the students in the school's Linux system. I am able to do this and return about 665 names. (First string of `/etc/passwd` file). From there, I need to sort on the students who's name ends in 'o' and also those who have two or more 'o' in their name. This isn't actually for me -- it is indeed homework but for a friend. I am way past the age of homework :) He has to use grep to get the results. I haven't used grep for years, I played a round a little but can't stay away from using other commands to achieve this. I was just curious to see if someone in the community knew how to do this using grep. For the names in the `/etc/passwd` file ending in letter 'o' :               grep -Eo '^[a-zA-Z0-9._-]+' /etc/passwd | grep -Eo 'o$'      This works but doesn't display the whole name , just the letter 'o' for the one single match to the request in the file. Not sure : 1) how to display the output , ie.. whole name ? 2) how to search for those names with more than one 'o' in their name ? From the `/etc/passwd` file for example.... I want to display the output of all users ending in the letter 'o' in a file I want to display all users that contain more than one letter 'o' in another file


title: How to add each output of awk

text: How would you perform addition on the output of every line from awk? For example               cat foo | awk '{print $1}     42     42     42      I'm looking for the answer to 42+42+42 (126). I'm trying to write a for loop to do this, but there must be a simpler way               #Not Working, and way too complex     cat foo |awk  '{ print $1 }'|for i in $1 do; foo=$(( foo+$(i) )) done| echo $foo      I could pipe to `wc -l` but that only prints the number of lines, it does not evaluate them. How can I evaluate each line from awk?


title: Alsa & JACK - card and device names (different naming conventions)

text: I am a bit confused about audio device names. If I use command `aplay -l` i get the list of all audio devices on my system:               **** List of PLAYBACK Hardware Devices ****     card 0: NVidia [HDA NVidia], device 0: VT1708S Analog [VT1708S Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: NVidia [HDA NVidia], device 2: VT1708S Alt Analog [VT1708S Alt Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: NVidia [HDA NVidia], device 3: VT1708S Digital [VT1708S Digital]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 3: USB [Scarlett 2i4 USB], device 0: USB Audio [USB Audio]       Subdevices: 1/1       Subdevice #0: subdevice #0      Notice that the order is `card 0`, `card 1`, `card 3` where `card 2` is not listed. This confuses me. I know that every entry here is a single device (not card) so if I am correct (and please confirm or correct me if I am wrong) I would name my soundcard "Scarlet 2i4" like `hd:3,0`? Or is it `hd:2,0` because `card 2` is missing? Now when I open a JACK and want to tweak audio settings, I have different names than ones above. The names are:   * `hw:USB,0`   * `hw:USB`   * `hw:0`   * `plughw:0`   * `/dev/audio`   * `/dev/dsp` Where does a JACK get this device table? What kind of naming convention is this and how can i figure out which device is which (I want JACK to primarly use my "Scarlet 2i4")? Is there any terminal comand which will let me know this? At the moment my `~/.jackrc` settings are like this:               /usr/bin/jackd -nziga-scarlet-2i4 -t2000 -dalsa -dhw:0 -r48000 -p128 -n2


title: Is the Unix Programmers Manual relevant for Linux?

text: I've been looking for an all around Linux Programmers manual but there isn't one... So that leads me to ask if the Unix Programmers Manual is relevant for Linux? The manual is here: http://cm.bell-labs.com/7thEdMan/v7vol1.pdf


title: How can I use sed to only print what appears between these two strings?

text: How can I use sed to only post what appears between iterations of:                   "<title><![DATA["      and                    ]]></title>      I tried doing                    sed 's/<title><![DATA[/(.*)/]]//g'      but it just prints the whole file


title: Bluetooth profile info in linux

text: As Bluetooth device has a number of Bluetooth profiles. when want to do communication is Bluetooth device, first pair Bluetooth device and then starts sending data using Bluetooth. In Linux, `hcitool` is used to scan nearby Bluetooth devices. Questions:   1) How can I know which Bluetooth profile is supported by selected nearby Bluetooth device?Is there any particular command to know Bluetooth profile supported by selected nearby Bluetooth device in Linux? 2) suppose, I come to know selected nearby Bluetooth device support abcd and xyz Bluetooth profiles. How can i select particular Bluetooth profile in Linux?, example abcd out of supported profiles. 2) How can I connect to that selected Bluetooth device as SPP profile for transferring data as serial port in linux? May be its is related to How do I connect and send data to a bluetooth serial port on Linux?. That is using `sdptool`, but how can I `sdptool` is supported by the device.


title: Can I install a sync completion hook with rsync daemon?

text: Like hooks in svn or git, can I install a server-side hook script for rsync daemon? For sync completion event. I am using FreeBSD9/rsyncd.


title: How to add words to an existing column

text: I have a tab delimited file with 10 columns and in one of the columns (with about 40 million rows), I would like to add a word before the existing entry in each row (same word in each row!) and a `;` after the entry. e.g. two rows before               1 2 3 4 5 6 7 8 text still more text in this column 10     1 2 3 4 5 6 7 8 text2 still more text in this column 10      to               1 2 3 4 5 6 7 8 test=text; still more text in this column 10     1 2 3 4 5 6 7 8 test=text2; still more text in this column 10      At the end of the day it's the basic "concatenate" function in excel, but I can't use excel for such large files and also need to move to linux anyways. I looked into concatenate questions here on the forum but I only found topics dealing with merging two strings, eg.               foo="Hello"     foo="$foo World"     echo $foo        but not using variables.


title: What information is stored on the gap before the first partition?

text: Partitioning tools(for example `fdisk`) tend to leave a 2047 sector(LBA 1-2047, 1048064 bytes) between the MBR and first partition. On LBA 0 there is a MBR and from LBA 2048 starts the first partition. GRUB should keep it's stage 1.5 data in this gap and Linux software-RAID should keep it's superblock in this area at least in case of some superblock versions(e.g. version 1.2), but what else may be stored on this gap? Is this area used for anything else?


title: Changing default permissions for wget?

text: I'm using a PHP script to call `shell_exec` and execute wget to download some files to `/var/www/dir/`. (Internal tool, so security isn't much of an issue) The directory has 777 permissions. But when I run wget, all of the files are 644 by default. Ideally I would like 665 for group write access, for group `www-data`. How do I set the permissions for wget downloaded files? I don't want to run `chmod -R` after every call.


title: Download copy of file which updates on change

text: Sorry about the title, I didn't know how to write it - It's kind of confusing. Ok, I am using my Raspberry Pi (Debian) and I store code on this server in which people have access to. My problem at the moment is, I can open the file using SSH and then compile and run the code on the Pi but this is very slow. What I want to do: I want it so I can make changes of the file(s) on my computer and this updates with the files on the server and I can then compile the code on my machine AND I do not have to keep pushing the files back onto the file server. I hope this makes sense. Any ideas?


title: Add ipv4 support to CentOS 6.3

text: I've installed two identical versions of CentOS using VirtualBox. The first instance works fine and has ipv4 configuration automatically working, but the second instance doesn't; it only comes with ipv6 and no ipv4. How can I manually add ipv4 support?


title: How do I use wget with a list of URLs and their corresponding output files?

text: Suppose `list_of_urls` looks like this:               http://www.url1.com/some.txt     http://www.url2.com/video.mp4      I know how to use that with:               wget -i list_of_urls      But, what if my `list_of_urls` has this, and they all return proper files like PDF's or videos:               http://www.url1.com/app?q=123&gibb=erish&gar=ble     http://www.url2.com/app?q=111&wha=tcha&mac=allit      For a single file I could do this:               wget -O some.txt "http://www.url1.com/app?q=123&gibb=erish&gar=ble"      How do I use `wget` to download that list of URLs and save the returned data to the proper local file?


title: What features are in zsh and missing from bash, or vice versa?

text: As a Linux user, I've always just used bash because it was the default on every distro I used. People using other Unix systems such as BSD seem to use other shells far more frequently. In the interests of learning a bit more, I've decided to try out zsh. As a bash user:   * What features will I miss?   * And what ones should I look out for?


title: Extract code excerts from markdown file

text: I have a pandoc markdown file which has a lot of code. I want to extract all the code bits from file preferably using `sed`. The syntax of code in pandoc is three or more ``` signs to start and finish the code segment. ````` `Code is here` ````` I can extract one line but I have no way of extracting _between markers_.


title: Linux doesn't boot after update-grub

text: I had a problem with my HDMI without sound and I found this fix.               Edit /etc/default/grub and change this line:          GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"          to this line          GRUB_CMDLINE_LINUX_DEFAULT="quiet splash radeon.audio=1"          Now run "sudo update-grub", then reboot your computer.      Now, the boot stuck in a file systems check. Each time it's stucked in a different message. Sometimes, about bluetooth, others for network monitor etc. I cannot open Linux from recovery and from older versions, each one stuck in a black screen. I cannot access my pc and if I will not find a sollution soon, I will turn to a clean install with losing all my data :(


title: How can I pass argument stored on a variable to WGET

text: I'm writing a bash script that extensively uses wget. To define all common parameters in one place I store them on variables. Here's a piece of code:               useragent='--user-agent="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0"'     cookies_file="/tmp/wget-cookies.txt"     save_cookies_cmd="--save-cookies $cookies_file --keep-session-cookies"     load_cookies_cmd="--load-cookies $cookies_file --keep-session-cookies"          function mywget {         log "#!!!!!!!!!# WGET #!!!!!!!!!# wget $quiet $useragent $load_cookies_cmd $@"           wget $useragent $load_cookies_cmd "$@"     }      Saddly isn't working. Somehow I'm missing the right way to store parameters on variables $useragent, $save_cookies_cmd, $load_cookies_cmd and caling wget passing these vars as parameters. I want the result commandline as this:               wget --user-agent="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0" --load-cookies /tmp/wget-cookies.txt --keep-session-cookies http://mysite.local/myfile.php      * * * **EDIT:** My final solution: In the end my script is correctly working with this:               useragent="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0"     useragent_cmd="--user-agent=$useragent"     cookies_file="/tmp/wget-cookies.txt"     save_cookies_cmd="--save-cookies $cookies_file --keep-session-cookies"     load_cookies_cmd="--load-cookies $cookies_file --keep-session-cookies"          function mywget {         log "#!!!!!!!!!# WGET #!!!!!!!!!# wget $load_cookies_cmd $useragent_cmd $@"           wget $load_cookies_cmd "$useragent_cmd" "$@"     }      Thanks for all your responses.


title: How can I set up environmental variables for www-data?

text: I asked a question on dba.se about how I can give my Perl CGI script the password it needs to access the MySQL database it needs to query. I have received only one answer but that one suggests I save the password as an environmental variable. OK, `apache2` runs as `www-data` and according to `/etc/passwd`, the user's `$HOME` is `/var/www`:               $ grep www /etc/passwd     www-data:x:33:33:www-data:/var/www:/bin/sh      I tried creating `/var/www/.profile` with this line               export db_pass="password"      And then had my Perl script print `$ENV{"db_pass"}` but that failed, the variable is empty. I checked with `$ENV{PATH}` and that was printed as expected. So, how can I set an arbitrary environmental variable for this user? The server is an Ubuntu Server running on a VM (which runs on Windows, not my choice, don't ask).               $ apache2 -version     Server version: Apache/2.2.14 (Ubuntu)     Server built:   Feb 14 2012 16:42:25


title: Ubuntu 13.10 installing libcurl gives conflict - but 7.32.0-1ubuntu1.2 is to be installed

text: I'm not sure what the problem is here. I've googled around for this issue but couldn't find anything. Only thing I did was install a new postgres and I made following change:               sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"     wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -     sudo apt-get update     sudo apt-get install postgresql-common -t saucy     sudo apt-get install postgresql-9.2 libpq-dev      After I wanted to install libcurl openssl and gnutls dev and got:               me@kippeke:~$ sudo apt-get install libcurl4-openssl-dev libcurl4-gnutls-dev     Reading package lists... Done     Building dependency tree     Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:     libcurl4-gnutls-dev : Conflicts: libcurl4-openssl-dev but 7.32.0-1ubuntu1.2 is to be     installed     libcurl4-openssl-dev : Conflicts: libcurl4-gnutls-dev but 7.32.0-1ubuntu1.2 is to be  installed     E: Unable to correct problems, you have held broken packages.     me@kippeke:~$ uname -a     Linux kippeke 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux     me@kippeke:~$      Can't answer my own question until after 8 hours I posted it because my reputation is to low. But I know the answer: Don't mind the idiot who can't understand the error message :) I can install libcurl4-openssl-dev or libcurl4-gnutls-dev and not both. That's the conflict...


title: I disabled Compiz and the title bar on every windows is missing now

text: I am on Linux Mint 15 (Mate). I installed Compiz following the steps in this tutorial. Then due to some problems I faced, I decided to disable it. So I executed the following command:               metacity --replace      Then removed `compiz --replace` from the Startup Applications and reverted `org > mate > desktop > session > required-components > windowmanager` back to `marco`. After logging out and logging in again, I realized that none of my windows have any title bar. What should I do? ![enter image description here](http://i.stack.imgur.com/VNjQ6.png) p.s. When I click the `show desktop` icon, the following error appears: ![enter image description here](http://i.stack.imgur.com/lTdAM.png)


title: Delete files specified by the output of find: rm thinks argument list is too long.

text: When I run the following command, it gives me an error:               $ rm -f `find /home/domain/imap/domain.com/*/Maildir -mtime +190 | grep -E '/cur/|/new/'`     -bash: /bin/rm: Argument list too long      How can I run it without the error? (Or how can I put it in `.sh`?)


title: proftpd via mysql & web management of FTP users

text: I have installed prftpd and proftpd-mysql rpm on a linux machine. Intention is to have usermanagement of ftpusers via web. So I have installed proftpadmin from Here Now when I am adding the below lines in /etc/proftpd.conf file               SQLConnectInfo                  proftpd@localhost root root      SQLAuthenticate                 users   groups      SQLAuthTypes                    Crypt   Backend      SQLUserInfo                     users userid passwd uid gid homedir shell      SQLGroupInfo                    groups groupid gid members           SQLLog                          PASS logincount      SQLNamedQuery                   logincount UPDATE "login_count=login_count+1 WHERE userid='%u'" users      SQLLog                          PASS lastlogin      SQLNamedQuery                   lastlogin UPDATE "last_login=now() WHERE userid='%u'" users      SQLLog RETR                     dlbytescount      SQLNamedQuery                   dlbytescount UPDATE "dl_bytes=dl_bytes+%b WHERE userid='%u'" users      SQLLog RETR                     dlcount      SQLNamedQuery                   dlcount UPDATE "dl_count=dl_count+1 WHERE userid='%u'" users      SQLLog STOR                     ulbytescount      SQLNamedQuery                   ulbytescount UPDATE "ul_bytes=ul_bytes+%b WHERE userid='%u'" users      SQLLog STOR                     ulcount      SQLNamedQuery                   ulcount UPDATE "ul_count=ul_count+1 WHERE userid='%u'" users      SQLUserWhereClause              "disabled!=1"      service proftpd start fails . If I remove those lines service starts, I cannot manage users via mysql, as above lines are mendatory. Can anyone please suggest where I am going wrong Please find my below /etc/proftpd.conf file               # This is the ProFTPD configuration file     # $Id: proftpd.conf,v 1.1 2004/02/26 17:54:30 thias Exp $          ServerName                      "ProFTPD server"     ServerIdent                     on "FTP Server ready."     ServerAdmin                     root@localhost     ServerType                      standalone     #ServerType                     inetd     DefaultServer                   on     AccessGrantMsg                  "User %u logged in."     #DisplayConnect                 /etc/ftpissue     #DisplayLogin                   /etc/ftpmotd     #DisplayGoAway                  /etc/ftpgoaway     DeferWelcome                    off          # Use this to excude users from the chroot     DefaultRoot                     ~ !adm          # Use pam to authenticate (default) and be authoritative     #AuthPAMConfig                  proftpd     AuthOrder                       mod_auth_pam.c* mod_auth_unix.c          # Do not perform ident nor DNS lookups (hangs when the port is filtered)     IdentLookups                    off     UseReverseDNS                   off          # Port 21 is the standard FTP port.     Port                            21          # Umask 022 is a good standard umask to prevent new dirs and files     # from being group and world writable.     Umask                           022          # Default to show dot files in directory listings     ListOptions                     "-a"          # See Configuration.html for these (here are the default values)     #MultilineRFC2228               off     #RootLogin                      off     #LoginPasswordPrompt            on     #MaxLoginAttempts               3     #MaxClientsPerHost              none     #AllowForeignAddress            off     # For FXP          # Allow to resume not only the downloads but the uploads too     AllowRetrieveRestart            on     AllowStoreRestart               on          # To prevent DoS attacks, set the maximum number of child processes     # to 30.  If you need to allow more than 30 concurrent connections     # at once, simply increase this value.  Note that this ONLY works     # in standalone mode, in inetd mode you should use an inetd server     # that allows you to limit maximum number of processes per service     # (such as xinetd)     MaxInstances                    20          # Set the user and group that the server normally runs at.     User                            nobody     Group                           nobody          # Disable sendfile by default since it breaks displaying the download speeds in     # ftptop and ftpwho     UseSendfile                     no          # This is where we want to put the pid file     ScoreboardFile                  /var/run/proftpd.score          # Normally, we want users to do a few things.     <Global>       AllowOverwrite                yes       <Limit ALL SITE_CHMOD>         AllowAll       </Limit>     </Global>          # Define the log formats     LogFormat                       default "%h %l %u %t \"%r\" %s %b"     LogFormat                       auth    "%v [%P] %h %t \"%r\" %s"          # TLS     # Explained at http://www.castaglia.org/proftpd/modules/mod_tls.html     #TLSEngine                      on     #TLSRequired                    on     #TLSRSACertificateFile          /etc/pki/tls/certs/proftpd.pem     #TLSRSACertificateKeyFile       /etc/pki/tls/certs/proftpd.pem     #TLSCipherSuite                 ALL:!ADH:!DES     #TLSOptions                     NoCertRequest     #TLSVerifyClient                off     ##TLSRenegotiate                ctrl 3600 data 512000 required off timeout 300     #TLSLog                         /var/log/proftpd/tls.log          # SQL authentication Dynamic Shared Object (DSO) loading     # See README.DSO and howto/DSO.html for more details.     #<IfModule mod_dso.c>     #   LoadModule mod_sql.c     #   LoadModule mod_sql_mysql.c     #   LoadModule mod_sql_postgres.c     #</IfModule>          # A basic anonymous configuration, with an upload directory.     #<Anonymous ~ftp>     #  User                         ftp     #  Group                                ftp     #  AccessGrantMsg               "Anonymous login ok, restrictions apply."     #     #  # We want clients to be able to login with "anonymous" as well as "ftp"     #  UserAlias                    anonymous ftp     #     #  # Limit the maximum number of anonymous logins     #  MaxClients                   10 "Sorry, max %m users -- try again later"     #     #  # Put the user into /pub right after login     #  #DefaultChdir                        /pub     #     #  # We want 'welcome.msg' displayed at login, '.message' displayed in     #  # each newly chdired directory and tell users to read README* files.     #  DisplayLogin                 /welcome.msg     #  DisplayFirstChdir            .message     #  DisplayReadme                        README*     #     #  # Some more cosmetic and not vital stuff     #  DirFakeUser                  on ftp     #  DirFakeGroup                 on ftp     #     #  # Limit WRITE everywhere in the anonymous chroot     #  <Limit WRITE SITE_CHMOD>     #    DenyAll     #  </Limit>     #     #  # An upload directory that allows storing files but not retrieving     #  # or creating directories.     #  <Directory uploads/*>     #    AllowOverwrite             no     #    <Limit READ>     #      DenyAll     #    </Limit>     #     #    <Limit STOR>     #      AllowAll     #    </Limit>     #  </Directory>     #     #  # Don't write anonymous accesses to the system wtmp file (good idea!)     #  WtmpLog                      off     #     #  # Logging for the anonymous transfers     #  ExtendedLog          /var/log/proftpd/access.log WRITE,READ default     #  ExtendedLog          /var/log/proftpd/auth.log AUTH auth     #     #</Anonymous>          SQLConnectInfo                  proftpd@localhost root root      SQLAuthenticate                 users   groups      SQLAuthTypes                    Crypt   Backend      SQLUserInfo                     users userid passwd uid gid homedir shell      SQLGroupInfo                    groups groupid gid members           SQLLog                          PASS logincount      SQLNamedQuery                   logincount UPDATE "login_count=login_count+1 WHERE           userid='%u'" users      SQLLog                          PASS lastlogin      SQLNamedQuery                   lastlogin UPDATE "last_login=now() WHERE userid='%u'"           users      SQLLog RETR                     dlbytescount      SQLNamedQuery                   dlbytescount UPDATE "dl_bytes=dl_bytes+%b WHERE           userid='%u'" users      SQLLog RETR                     dlcount      SQLNamedQuery                   dlcount UPDATE "dl_count=dl_count+1 WHERE userid='%u'"           users      SQLLog STOR                     ulbytescount      SQLNamedQuery                   ulbytescount UPDATE "ul_bytes=ul_bytes+%b WHERE           userid='%u'" users      SQLLog STOR                     ulcount      SQLNamedQuery                   ulcount UPDATE "ul_count=ul_count+1 WHERE userid='%u'"           users      SQLUserWhereClause              "disabled!=1"      SQL Script looks as below which is updated on respective Database               #     # Table structure for table `groups`     #          CREATE TABLE `groups` (       `groupid` varchar(10) NOT NULL default '',       `gid` int(10) unsigned NOT NULL auto_increment,       `members` varchar(255) NOT NULL default '',       PRIMARY KEY  (`gid`)     ) TYPE=InnoDB ;          #     # Table structure for table `users`     #          CREATE TABLE `users` (       `id` smallint(2) NOT NULL auto_increment,       `userid` varchar(10) NOT NULL default '',       `uid` int(10) unsigned NOT NULL default '',       `gid` int(10) unsigned NOT NULL default '',       `passwd` varchar(255) NOT NULL default '',       `homedir` varchar(255) NOT NULL default '',       `comment` varchar(255) NOT NULL default '',       `disabled` int(10) unsigned NOT NULL default '0',       `shell` varchar(20) NOT NULL default '/sbin/nologin',       `email` varchar(255) NOT NULL default '',       `name` varchar(255) NOT NULL default '',       `ul_bytes` bigint(20) NOT NULL default '0',       `dl_bytes` bigint(20) NOT NULL default '0',       `login_count` bigint(20) NOT NULL default '0',       `dl_count` bigint(20) NOT NULL default '0',       `ul_count` bigint(20) NOT NULL default '0',       `last_login` datetime default NULL,       PRIMARY KEY  (`id`)     ) TYPE=InnoDB ;


title: My local DNS don't resolv specific hostnames IP's

text: I've been trying to accomplish a DNS set up on my local machine using Linux and CentOS. I've been following couple of tutorials and eventually everything seemed to work but when surfing to my example website I realized it didn't... This is what I've done after installing bind. **named.conf:**                  zone "ims.be" IN {                 type master;                 file "example.com.zone";                 allow-update { none; };         };      **example.com.zone:**               $TTL 86400     @    IN    SOA    localhost.    root.localhost. (                 42 ; serial                 3600      ; refresh after 6 hours                 900       ; retry after 1 hour                 1W     ; expire after 1 week                 1D )    ; minimum TTL of 1 day          @       NS      localhost.             A       192.168.0.***     www     A       192.168.0.***     ftp     CNAME   www      **example.conf**               <VirtualHost *:80>         ServerAdmin webmaster@example.com         DocumentRoot /home/ims.be/         ServerName ims.be         ServerAlias www.ims.be         ErrorLog logs/ims.be-error_log         CustomLog logs/ims.be-access_log common     </VirtualHost>      I am able to ping, dig and nslookup to my example website called ims.be. **PING** ![PING](http://i.stack.imgur.com/o3qg0.jpg) **DIG** ![DIG](http://i.stack.imgur.com/nONzD.jpg) **NSLOOKUP** ![NSLOOKUP](http://i.stack.imgur.com/Na5IT.jpg) **NAMESERVERS** ![enter image description here](http://i.stack.imgur.com/PsuJl.jpg) But when surfing to ims.be or www.ims.be using Chrome/Firefox/IE/Safari I get an error that the webpage is not available... However when I surf to my IP address this displays the page ims.be like it should. I'm working on a Windows 7 using CentOS to access Linux. I discovered that I'm able to ping etc to ims.be from my Linux but when I'm in command line in Windows I'm unable to ping/nslookup/... ims.be: > Ping request could not find host ims.be I thought I had to change settings in Windows to get this done but nothing changed just yet... What I've done: ![enter image description here](http://i.stack.imgur.com/BjpmR.jpg) ![enter image description here](http://i.stack.imgur.com/as1td.jpg)


title: Why does octave give different results for 9 ^ 1/2 and 9 ^ 0.5?

text: Lately I've been trying to brush up on the math I should have learned in high school. (I didn't pay much attention.) Regarding this, college entrance exams and `octave` make a great pair. This morning I got to fractional powers. And `octave` had something surprising in store:               octave:41> (9 ^ 1/2)     ans =  4.5000     octave:42> (9 ^ .5)     ans =  3     octave:43> (9 ^ 0.5)     ans =  3      Maybe I dozed off when we covered this in high school, but no... According to this website, > By the way, some decimal powers can be written as fractional exponents, too. > If you are given something like "35.5", recall that 5.5 = 11/2, so: > > 3 ^ 5.5 = 3 ^ 11/2 So evidently there's some reason why `octave` evaluates these two expressions differently... Why does `octave` evaluate fractional powers differently? Is this a non- feature, or is there a good reason why it should?


title: OpenVswitch in Linux kernel configuration

text: There's a kernel configuration variable _Open vSwitch (CONFIG_OPENVSWITCH)_. This enables openVswitch support inside the kernel, but still to use it, we need a userspace daemon. My question is, what libraries and/or structures are to be used from Linux to make use of this feature if I want to write a process of my own? ( _Like we use route.h for normal routing daemons in_ **_C_** ) Any link to a tutorial and/or example code will be appreciated.


title: Why is this binary file being changed?

text: I am trying to copy files over SSH, but cannot use `scp` due to not knowing the exact filename that I need. Although small binary files and text files transfer fine, large binary files get altered. Here is the file on the server:               remote$ ls -la     -rw-rw-r--  1 user user 244970907 Aug 24 11:11 foo.gz     remote$ md5sum foo.gz      9b5a44dad9d129bab52cbc6d806e7fda foo.gz      Here is the file after I've moved it over:               local$ time ssh me@server.com -t 'cat /path/to/foo.gz' > latest.gz          real    1m52.098s     user    0m2.608s     sys     0m4.370s     local$ md5sum latest.gz     76fae9d6a4711bad1560092b539d034b  latest.gz          local$ ls -la     -rw-rw-r--  1 dotancohen dotancohen 245849912 Aug 24 18:26 latest.gz      Note that the downloaded file is **bigger** than the one on the server! However, if I do the same with a very small file, then everything works as expected:               remote$ echo "Hello" | gzip -c > hello.txt.gz     remote$ md5sum hello.txt.gz     08bf5080733d46a47d339520176b9211  hello.txt.gz          local$ time ssh me@server.com -t 'cat /path/to/hello.txt.gz' > hi.txt.gz      real 0m3.041s user 0m0.013s sys 0m0.005s               local$ md5sum hi.txt.gz     08bf5080733d46a47d339520176b9211  hi.txt.gz      Both file sizes are 26 bytes in this case. **Why might small files transfer fine, but large files get some bytes added to them?**


title: Syntax error near unexpected token `('

text: When I use below code in SSH terminal for CentOS it works fine:               paste <(printf "%s\n" "TOP")      But if I place the same line code in a shell script (test.sh) and run shell script from terminal, it throws error as this               ./test.sh: line 30: syntax error near unexpected token ('        ./test.sh: line 30:     paste <(printf "%s\n" "TOP")      How can I fix this problem?


title: Using sed to replace only the first two regex catches with different strings

text: So I'm trying to change two instances of a regex pattern to two different strings with sed like:               sed -E "s/\\t([A-Za-z]|[-])+$/\\t`get_addr.py -1`/" /path/to/file.ext     sed -E "s/\\t([A-Za-z]|[-])+$/\\t`get_addr.py -2`/" /path/to/file.ext      I've tried a lot of things, and done a solid amount of manpage scouring, but I just can't quite figure out how make it happen. Is there a way I can tell sed to replace each match with a different string with something like               sed -E "s/\\t([A-Za-z]|[-])+$/[1st replacement],[2nd replacement]/" /path/to/file.ext      and/or is there a way I can specify in the regex that I'm looking for the nth match, so that I can just call sed twice?


title: Salvage files from ext3 filesystem with physical errors

text: I have a disk from a crashed Linux laptop with files on it that the unhappy owner would like to have back if at all possible (no backup solutions please). I have not had anything to do with it before. The disk is recognized by both OS X and Ubuntu 11.10:               root@ubuntu1110:~# fdisk -l /dev/sdc          Disk /dev/sdc: 500.1 GB, 500107862016 bytes     255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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: 0x80d549b4             Device Boot      Start         End      Blocks   Id  System     /dev/sdc1   *          63   953602334   476801136   83  Linux     /dev/sdc2       953602335   976768064    11582865    5  Extended     /dev/sdc5       953602398   976768064    11582833+  82  Linux swap / Solaris      This looks consistent with a stock installation of a Linux distribution with a swap partition. Unfortunately some rather nasty messages show up in dmesg, after Ubuntu says it cannot mount the sdc1 partition:               [  181.228092] sd 6:0:0:0: [sdc] 976773168 512-byte logical blocks: (500 GB/465 GiB)     [  181.232176] sd 6:0:0:0: [sdc] Write Protect is off     [  181.232181] sd 6:0:0:0: [sdc] Mode Sense: 21 00 00 00     [  181.236359] sd 6:0:0:0: [sdc] No Caching mode page present     [  181.236364] sd 6:0:0:0: [sdc] Assuming drive cache: write through     [  181.246696] sd 6:0:0:0: [sdc] No Caching mode page present     [  181.246707] sd 6:0:0:0: [sdc] Assuming drive cache: write through     [  182.835915]  sdc: sdc1 sdc2 < sdc5 >     [  182.854199] sd 6:0:0:0: [sdc] No Caching mode page present     [  182.854204] sd 6:0:0:0: [sdc] Assuming drive cache: write through     [  182.854208] sd 6:0:0:0: [sdc] Attached SCSI disk     [  218.250174] sd 6:0:0:0: [sdc] Unhandled sense code     [  218.250179] sd 6:0:0:0: [sdc]  Result: hostbyte=DID_ERROR driverbyte=DRIVER_SENSE     [  218.250182] sd 6:0:0:0: [sdc]  Sense Key : Hardware Error [current]      [  218.250187] Info fld=0x0     [  218.250188] sd 6:0:0:0: [sdc]  Add. Sense: No additional sense information     [  218.250193] sd 6:0:0:0: [sdc] CDB: Read(10): 28 00 00 00 01 08 00 00 08 00     [  218.250200] end_request: I/O error, dev sdc, sector 264     [  218.250206] Buffer I/O error on device sdc, logical block 33     [  255.398994] sd 6:0:0:0: [sdc] Unhandled sense code     [  255.399029] sd 6:0:0:0: [sdc]  Result: hostbyte=DID_ERROR driverbyte=DRIVER_SENSE     [  255.399032] sd 6:0:0:0: [sdc]  Sense Key : Hardware Error [current]      [  255.399037] Info fld=0x0     [  255.399038] sd 6:0:0:0: [sdc]  Add. Sense: No additional sense information     [  255.399053] sd 6:0:0:0: [sdc] CDB: Read(10): 28 00 00 00 01 08 00 00 08 00     [  255.399061] end_request: I/O error, dev sdc, sector 264     [  255.399066] Buffer I/O error on device sdc, logical block 33     [  281.340599] sd 6:0:0:0: [sdc] Unhandled sense code     [  281.340609] sd 6:0:0:0: [sdc]  Result: hostbyte=DID_ERROR driverbyte=DRIVER_SENSE     [  281.340618] sd 6:0:0:0: [sdc]  Sense Key : Hardware Error [current]      [  281.340653] Info fld=0x0     [  281.340655] sd 6:0:0:0: [sdc]  Add. Sense: No additional sense information     [  281.340659] sd 6:0:0:0: [sdc] CDB: Read(10): 28 00 00 00 00 67 00 00 08 00     [  281.340667] end_request: I/O error, dev sdc, sector 103     [  281.340739] EXT3-fs (sdc1): error: can't read group descriptor 4      My current theory is that the harddisk has run out of spare blocks so now a real bad block has been introduced and it is in the area used when mounting the partition. This is confirmed by dd:               root@ubuntu1110:~# dd if=/dev/sdc1 of=/dev/null bs=10240 conv=noerror     dd: reading `/dev/sdc1': Input/output error     2+0 records in     2+0 records out     20480 bytes (20 kB) copied, 44.7084 s, 0.5 kB/s     dd: reading `/dev/sdc1': Input/output error     9+1 records in     9+1 records out     96256 bytes (96 kB) copied, 162.933 s, 0.6 kB/s     dd: reading `/dev/sdc1': Input/output error     9+1 records in     9+1 records out     96256 bytes (96 kB) copied, 180.083 s, 0.5 kB/s      Bad blocks early and very slow transmission rate even later in the process (not shown) My problem now is how to approach from here. I need something that can read from a broken ext2/ext3-filesystem so we can copy those files still there off the disk, and I have not done much Linux system administration in the last 15 years so I do not know the right terms for searching. I could probably copy a disk image over night, but then the "this block is bad" information is lost. What kind of program would be useful in this situation?


title: Wireless rtl8187 freezes intermittently

text: I am using a wireless USB ALFA 036H. Linux Mint (32-bit) recognizes it without any drivers but it stops downloading/uploading and I have to reconnect to get it to work again. I tried to find a solution so I installed a different driver (the one I was supposed to use) and the problem changed: it stops downloading/uploading for few seconds (3-10) then just move on and start downloading/uploading again. Any ideas? More info:   * Linux Mint 32-bit    * device: ALFA AWUS036H USB wireless Adapter, 802.11g High power   * driver: rtl8187  Note: feel free to ask for more information. lsmod output:               Module                  Size  Used by     rtl8187                56206  0      mac80211              257001  1 rtl8187     cfg80211              156212  2 rtl8187,mac80211     eeprom_93cx6           12653  1 rtl8187     snd_seq_dummy          12686  0      cryptd                 19801  0      aes_i586               16956  1      aes_generic            38023  1 aes_i586     arc4                   12473  2      binfmt_misc            13213  1      dm_crypt               22463  0      vesafb                 13449  1      nvidia               9766978  50      snd_hda_codec_realtek   255882  1      ipt_REJECT             12512  1      ipt_LOG                12784  4      snd_hda_intel          24113  5      snd_hda_codec          90901  2 snd_hda_codec_realtek,snd_hda_intel     snd_hwdep              13274  1 snd_hda_codec     snd_pcm                80042  3 snd_hda_intel,snd_hda_codec     snd_seq_midi           13132  0      snd_rawmidi            25269  1 snd_seq_midi     snd_seq_midi_event     14475  1 snd_seq_midi     snd_seq                51291  3 snd_seq_dummy,snd_seq_midi,snd_seq_midi_event     snd_timer              28659  2 snd_pcm,snd_seq     snd_seq_device         14110  4 snd_seq_dummy,snd_seq_midi,snd_rawmidi,snd_seq     ppdev                  12849  0      xt_limit               12541  6      xt_tcpudp              12531  8      ipt_addrtype           12535  4      snd                    55295  18 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device     parport_pc             32111  1      xt_state               12514  9      joydev                 17322  0      ip6table_filter        12711  1      psmouse                73312  0      ip6_tables             22545  1 ip6table_filter     nf_nat_irc             12542  0      nf_conntrack_irc       13138  1 nf_nat_irc     nf_nat_ftp             12548  0      nf_nat                 24827  2 nf_nat_irc,nf_nat_ftp     nf_conntrack_ipv4      19024  11 nf_nat     nf_defrag_ipv4         12649  1 nf_conntrack_ipv4     nf_conntrack_ftp       13106  1 nf_nat_ftp     nf_conntrack           69744  7 xt_state,nf_nat_irc,nf_conntrack_irc,nf_nat_ftp,nf_nat,nf_conntrack_ipv4,nf_conntrack_ftp     iptable_filter         12706  1      ip_tables              18125  1 iptable_filter     soundcore              12600  1 snd     x_tables               21907  10 ipt_REJECT,ipt_LOG,xt_limit,xt_tcpudp,ipt_addrtype,xt_state,ip6table_filter,ip6_tables,iptable_filter,ip_tables     snd_page_alloc         14073  2 snd_hda_intel,snd_pcm     serio_raw              12990  0      lp                     13349  0      parport                36746  3 ppdev,parport_pc,lp     usbhid                 41704  0      hid                    77084  1 usbhid     dm_raid45              88410  0      xor                    21860  1 dm_raid45     btrfs                 527388  0      zlib_deflate           26594  1 btrfs     libcrc32c              12543  1 btrfs     8139too                23208  0      8139cp                 22497  0      floppy                 60032  0      r8169                  42534  0


title: Why do backgrounded processes sometimes stop spontaneously?

text: Sometimes, some time after I've backgrounded a process with `bg` in bash, when I press Enter in the same shell to redisplay the prompt (just to check that I'm still in bash when some output from the background process has been displayed), the background process seems to stop spontaneously. If I do `bg` again the same problem recurs. The only way to fix it seems to be `fg`. Why does this happen?


title: Login automatically as root

text: I am working with a board and when it finishes the boot, appears the login. What I want to do is login as root but automatically. I mean I want to do that when boot is finish, I can see the prompt, without login.


title: Change the number of generated /dev/tty devices

text: I'm building an embedded Linux system, based on Gentoo. Using udev, all tty devices are probed with a `PROGRAM` stanza to determine if they are a modem. Right now the system boots up with 64 `/dev/tty*`. When udev probes the tty devices, the system runs out of memory. How can I reduce the number of produced tty devices to 4? Is this an OS setting or a kernel setting?


title: Failed to load session Ubuntu and to fetch .archive.ubuntu.com

text: was downloading some updates like almost every day and a message about some files to remove or replace I think (I'm not sure) that I've accepted to replace without knowing I confess what is it about, I had to restart PC to Windows 7 for something and forgetting that downloads and installations on Ubuntu were not finished.. The result after comeback to Ubuntu (12.04) is the message: failed to load session Ubuntu and lower graphics both two sessions and after accepting my password, can't us my mouse I was searching in Ubuntu by Windows some answers and I've tried in terminal after starting PC:               sudo apt-get update     sudo apt-get install ubuntu-desktop     sudo apt-get install -f install     sudo dpkg-reconfigure ubuntu-desktop     sudo reboot      and:               sudo apt-get update     sudo apt-get install unity-2d     sudo apt-get install ubuntu-desktop     sudo apt-get install compizconfig-settings-manager     sudo apt-get install compiz-plugins-extra     sudo apt-get update      and:               sudo apt-get install gnome-session     sudo apt-get install lightdm     sudo apt-get install unity-greeter     sudo dpkg-reconfigure lightdm      and:               sudo apt-get install ubuntu-session      and:               purge/install gnome-session      and:               gnome-accessibility-themes      and:               apt-get upgrade      and many others I forget but always fail in the end by:enable to fetch dz.archive.ubuntu.com I couldn't find something satisfying in launchpad about replacing my archive source and it was a little hard for me to understand.. I'm in 12.04 lt's since 2 years and months, that the first prob like that. Hope you help me.


title: sudo: no tty present and no askpass program specified

text: I have a perl script that I fork from another script that I launch from a web browser via mod_perl. The forked script (which ends up running as apache) needs to `sudo service X stop` as part of a backup restore process: the X service depends on the restore. I had this running OK on Windows, but now porting to CentOS I'm running into the error in the title. Setup:   1. sudoers file has commented out `# Defaults requiretty`   2. sudoers file has `apache_usr localhost=(root) NOPASSWD: /sbin/service X stop` (which passes a `visudo -c` check) and has no other `apache_usr` lines Things I've tried:   1. `sudo /sbin/service` instead of just `sudo service` in the forked process   2. sudoers file with or without commenting out `Defaults !visiblepw`   3. sudoers file with `(ALL)` instead of `(root)` in the NOPASSWD line above What else is there to try?


title: Editing Truecrypt Hidden Volume's Outer Volume?

text: I just created a tor hidden (plausible deniability) volume. I used a 32GB USB flash drive, for the outer volume, and made the inner volume 20GB. Does this mean that I can safely add another ~12GB of data to the outer volume without corrupting the hidden inner volume? I'd like to store my bank statements on the outer one, so I should never need more than 1GB. When creating the inner volume, it said that it would be better to make it smaller to allow for more storage space in the outer volume, but when I finished making the inner volume, it said not to modify the outer volume under any circumstances.


title: How do I `umount` /proc?

text: I am following this tutorial on how to do a firmware update to my NAND flash. I followed it only changing the directory where I am placing my new root. I am copying all of the `/bin` `/dev` `/sbin` `/usr` folders into a `tmpfs` that I have located in `RAM`. The following commands are where I start running into problems:               umount /sys     umount /proc      If I `killall5` `sys` unmounts without a problem but then when I try to unmount proc it gives me:               umount: can't umount /proc: Device or resource busy      I have tried using `chroot` similar to this link on a similar issue. But it doesn't seem to help much. I tried to chroot to my newroot, using the following command but it then gives me more grief:               chroot /tmp/newroot /bin/ash      Error:               umount: can't umount /proc: Invalid argument      Could someone point me in the right direction? I'm getting the feeling I'm missing something trivial, as is ussually the case.


title: How can I get Bash to display the auto-completion definitions for a given command?

text: I use `module` command to load and unload stuff to my environment, some of the machines I use have proper auto-completion others do not. I'm wondering if I it possible to know where the completion comes from and install elsewhere.


title: how to count number of differences in large streams quickly?

text: I want to count the number of differences (different bytes) in two large streams (devices/files). E.g. two hard disks, or one hard disk and `/dev/zero`. The program(s) involved must be fast, as fast as the streams come in (say 1GB/s, although 0.2GB/s is probably OK), and they may use at most a few GB of RAM and of tmp files. In particular, there is no filesystem available that is big enough to store the differences to be counted. The streams are several TB in size. The count need not (and in fact must not) treat whitespace or line feeds any different than other characters. The streams are binary-only and not interpret-able as text. I said streams, although the devices are actually seek-able. But for speed reasons, all should preferably be done with one single streaming pass without seeks, if possible. What I tried so far:               cmp -l /dev/sda /dev/sdb | wc      But this is way to slow; `wc` alone uses one CPU core >50% and the output is only about 2MB/s, which is too slow by a factor of 100.


title: Emacs change font of a single word (or sentence), not of the whole buffer

text: Somehow I don't find a way of changing the font size of a specific string of text. I know how to do it globally or temporarily for the whole buffer.Changing the default font is not the issue here. Sometimes I use math symbols like ω, Ω or ב and want to change these to a bigger font. I'd need a simple way of doing this. Alternatives to make these symbols more visible are welcome too.


title: What environment do I get with sudo?

text: When I run sudo, what exactly happens to my environment? When I run `sudo command`, it doesn't seem to see my or root's environment. For example, my path for both includes `/usr/local/bin`, but if I try to run one of the program's without the full path, it fails. I thought sudo ran as root, and hence got root`s environment. Is there a different way that bash executes under sudo than under root or my normal user? EDIT: I have been using `sudo -i` lately, but recently it has been causing problems because my current working directory gets set to `/root`. This is as expected (sorta), but I still don't understand why sudo isn't recognizing my executables in `/usr/local/bin`. EDIT: I am running Fedora 15.


title: SSH tunnel through middleman server - how to connect in one step (using key pair)?

text: My question is basically how to turn my existing two steps into one step. I have a working SSH tunnel set up between two computers using a middleman server like this:               Kubuntu_laptop--->nat_fw--->Debian_Server<--nat_fw<--Kubuntu_desktop      What I do presently is SSH from Kubuntu_laptop to Debian_Server and then from Debian_Server to Kubuntu_desktop. I would like to make that one SSH command, issued on my Kubuntu_laptop in bash that results in my being connected to the Kubuntu_desktop (shell/bash). The commands I am using now are as follows. Step 1:               me@kubuntu_laptop:~$ ssh -i ~/.ssh/id_rsa admin@debian_server        Step 2:               admin@debian_server:$ ssh -p 1234 -i /home/admin/.ssh/id_rsa admin@localhost       Then I am connected to the kubuntu_desktop via SSH (from kubuntu_laptop). RSA keys are required for all SSH connections. Password login is disabled all the way around. And notice that the computer user accounts are different at two of the computers. Regarding the connection for this leg:               Debian_Server<--nat_fw<--Kubuntu_desktop      Here is how it is established:               autossh -M 5234 -N -f -R 1234:localhost:22 user@mydebian.com -p 22      Notice Kubuntu_desktop connects to middleman as user@mydebian.com (not admin@debian_server). But when I connect to Kubuntu_desktop, I connect as admin user. I cannot change the existing monitoring port (5234) or the remote (- R) port number (1234 in this example). I cannot change the SSH security to allow password logins. I cannot open up any new firewall ports. I can't change user accounts (except on laptop).


title: Slow wifi on Intel N 6235

text: I have extremely slow wifi connection on my linux mint. The network controller is `Intel Corporation Centrino Advanced-N 6235 (rev 24)`. I found on the ubuntu wiki a fix: `sudo rmmod iwlwifi && sudo modprobe iwlwifi 11n_disable=1` I got: `Error: Module iwlwifi is in use by: iwldvm` So I did: `sudo rmmod iwldvm`, `sudo rmmod iwldvm` (went fine then) and `sudo modprobe iwlwifi 11n_disable=1` My wlan0 was not up, so I started the iwldvm too. `sudo modprobe iwldvm` Unfortunately the internet is still too slow. I tried different approaches but nothing worked. Mainly I am confused that the wifi worked fine for a week, now I am experiencing such troubles. I've read that the kernel upgrade to 3.10 should fix this, but I can't boot that one and 3.9 didn't fix this. Is it possible that my machine (asus zenbook prime) is using different thing then the `iwlwifi`? I am just asking because I found a file in /etc/modprobe.d/ called iwlwifi.conf which contains:               # /etc/modprobe.d/iwlwifi.conf     # iwlwifi will dyamically load either iwldvm or iwlmvm depending on the     # microcode file installed on the system.  When removing iwlwifi, first     # remove the iwl?vm module and then iwlwifi.     remove iwlwifi \     (/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \     && /sbin/modprobe -r mac80211      The `lsmod | grep iwlwifi` command gives me:               iwlwifi               173477  1 iwldvm     cfg80211              510937  3 iwlwifi,mac80211,iwldvm


title: Unwanted messages every time I attempt to login?

text: I am using Linux Mint Olivia and it worked fine for past couple of months but from yesterday it keep showing these message whenever I want to login to my PC: > Keys: Press S to skip mounting or M for manual recovery If I press `s`, then it shows another message: > Keys: Continue to wait , or press S to skip mounting or M for manual > recovery If I press `s`, then it allows me to login. Can any one tell me how can I login normally? Contents of my `/etc/fstab`:               UUID=e1867541-6f11-4fd8-8121-2318248cb9c4 / ext4 errors=remount-ro 0 1      # swap was on /dev/sda9 during installation      UUID=8f655fe6-92c5-43c8-9655-2c2b3485a836 none swap sw 0 0     UUID=[C59C-D751] /media/[bappu] vfat user,uid=1000,gid=100,dmask=027,fmask=137 0 0


title: Cross Compile GMP and Openswan for ARM

text:
I have to cross compile `opensawn` for a OMAP4 Board and GMP is prerequisite. First I tried it on 64 bit OS but it gave me this error: > configure: error: Oops, mp_limb_t is 64 bits, but the assembler code in this > configuration expects 32 bits. Then I shifted to Ubuntu 12.04 32 Bit and the GMP V6.0.0 got compiled after few trials. Even after having the ARCH, TOOLCHAIN and CROSS_COMPILER variables in `.bashrc` I had to `export` the following:               export ARCH=arm
     export PATH=/home/harsh32bit/Work/Projects/BSQ_VVDN/BISQUARE/gcc-SourceryCodeBenchLite-arm/bin/:$PATH
     export CROSS_COMPILE=arm-none-linux-gnueabi-
      Then following commands were observed:                 ./configure --build=i686-pc-linux-gnu --host=arm-none-linux-gnueabi --prefix=/home/harsh32bit/Work/Projects/BSQ_VVDN/BISQUARE/gcc-SourceryCodeBenchLite-arm/          make clean     make     make install      Then Soft-linking GMP Library to Toolchain               ~/Work/Projects/BSQ_VVDN/BISQUARE/gcc-SourceryCodeBenchLite-arm/lib/gcc/arm-none-linux-gnueabi/4.7.3       # ln -s ~/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/.libs/libgmp.so libgmp.so      I had the GMP compiled successfully although the `make check` reported all test failed.               9 of 9 tests failed.      Now when I try to cross compile Openswan-2.6.41 after making changes in CROSSCOMPILE.sh and do this `make programs` I get this error: > In file included from > /home/harsh32bit/Work/Projects/BSQ_VVDN/packages/openswan-2.6.41/include/certs.h:24:0,from > /home/harsh32bit/Work/Projects/BSQ_VVDN/packages/openswan-2.6.41/lib/libopenswan/id.c:42: > /home/harsh32bit/Work/Projects/BSQ_VVDN/packages/openswan-2.6.41/include/secrets.h:20:41: > fatal error: gmp.h: No such file or directory compilation terminated I have gone to TI E2E site for this, sniffed internet for pointers in last 4 weeks but I couldn't figure out. If anyone has any clue about cross compiling `openswan` and `GMP` please advise me.


title: "IPv6 support is disabled" warnings

text: I get the error while running a script which tries to send emails.               send-mail: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol     send-mail: warning: inet_protocols: configuring for IPv4 support only     postdrop: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol     postdrop: warning: inet_protocols: configuring for IPv4 support only      Could anyone say what is the issue, do I require some permission?


title: Overwriting disk before encryption

text: I'm going to create encrypted lvm on my disk. As a encryption mechanism I choose dmcrypt with LUKS. Here's my question - should I overwrite (for security reasons) whole disk before creating encrypted container, or overwrite already encrypted container (there is some information at cryptsetup FAQ - step 6) or both? Does it matter?


title: Execute a file if a command is not found

text: When I try to execute files in Linux, I'm always annoyed by the need to write `./executablefile` instead of just `executablefile`. I get why it's done, so it won't have an ambigous input, one that is a command and also a file. But I want it to execute the file if a command is not found (commands have priority). I made a tweak through a guide that if you write a command and it's not found, it searches it in the `pacman` database and tells me in which package the command is at, so I know it's possible to do something when it says `command not found`. Is there a good way to do this?


title: Send email if specified files do not exist

text: I am new to unix scripting. I have to do something like : In a folder /x everyday 10Pm and next day 3 AM, 2 files are placed. I have to write a script which will check the folder /x and confirm if the files are there or not and send mails accordingly everyday. file formats:   * `ValuationIR**02092013**_0326` (FileName pattern: `ValuationIR<date>_<time>.csv` )   * `SnapshotIR**02082013**_2238` (FileName pattern: `SnapshotIR<date>_<time>.csv` ) Could someone help on how can I achieve the same, and which all commands would be required.


title: Logrotate not picking up or acting on new configuration file

text: I had a `logrotate` configuration file set up for a log (let's call it _Log1_ ). It is working fine and the log is rotating everyday as expected. Yesterday I cloned this set up and modified it for three more log files _Log2, Log3 and Log4_. These log files already exist on disk, and are being actively written to. However, when checked today, the three log files did not rotate at all. I was expecting them to rotate along with the first log file _Log1_. But only _Log1_ was rotated, and the rest ( _Log2_ to _Log4_ ) weren't touched at all. If I place new configuration files for `logrotate`, **do I have to run a command to "activate" them so`logrotate` will start rotating the log files?** I thought since it's a `cron` job running at 4 am everyday, it will automatically pick up the new files and rotate files. Is there some sort of manual activation needed? What's strange is that the `/var/lib/logrotate.status` file seems to show (with today's date) that **all four** log files were looked at by `logrotate`. So, why did `logrotate` skip the three new log files that obviously need rotating? * * * **Configuration file:**               /path/to/Log1.log {         compress         compresscmd /usr/bin/bzip2         compressext .bz2         compressoptions -9         copytruncate         daily         dateext         delaycompress         extension .log         notifempty         missingok         nomail         olddir Log1         rotate 100         maxage 60     }      There shouldn't be anything wrong with the configuration file, since it works fine for _Log1_. The `olddir` directory is already created for all the logs. When running `logrotate -d` (debug mode), it says `log does not need rotating` for all four logs. I understand this is correct for `Log1` since it's already rotated, but what about the others? Does it have anything to do with `after 1 days`? Does `logrotate` first mark the new file's date in `logrotate.status` file, then only rotate when one day has elapsed since the last mark? **How is the status file used by`logrotate`?**


title: How does SuSE Linux's support for btrfs differ from Ubuntu and Fedora's?

text: The SuSE Linux Enterprise Server 11 Service Pack 2 release notes state that SuSE offers "commercial support" for btrfs, while Ubuntu and Fedora appear to be holding back until a working fsck utility is available. Does SuSE have some special tools/people to support btrfs that other distros don't? (N.B. I'm aware that Oracle Linux also offers commercial support for btrfs, but they employ the main developer, so I can see how they have a special support capability).


title: Load application with module load and specify a different name from the default

text: I am using my local workstation to run applications stored on our local cluster. To load and run an application, I normally use:               module load xxx      However, there is a an application on my computer that already has the same name as a module I am trying to load. I am afraid there might be a conflict when I load such a module. Is there a way similar to Python (`import xxx as yyy`) to load a module and specify a different name to it. Something like:               module load xxx as yyy


title: Methods to diagnose why an application works for local user account but fails on a network user account?

text: I have setup a CentOS 6.5 machine that is attached to my company's domain. The OS is configured to allow Active Directory authentication so we do not have to have separate usernames and passwords to login into it. The application ANSYS Mechanical works fine when I launch it while logged in with a local (non AD) account. However, when its launched while logged in with my AD account, it reports:               Script Error     Line: 25959     Char: 2     Error: Object required     Code: 800a01a8     Source: Microsoft JScript runtime error     Script: var pg=pm.PreferencesCategories.Item("CATNAME_DesignModeler").PreferencesGroups;      My question is, what tools and methods should I be using to help me diagnose this odd issue? The aim would be to either fix a possible bad setting at my end or to communicate to the software vendor my problem. The software vendor would not help since the application does work with regular local user account, however, if I have more specific info I could approach the developers. I feel that there is some configuration setting that is causing this.


title: Execute a program at login

text: I'm running Arch-Linux ARM on a Raspberry Pi. My project goal is to have a barcode scanner attached to the Pi that forwards the scanned messages to a server in a LAN. To harden the system against power outages etc. and minimize required user interaction, I wish to set it up, so that a certain user is logged in automatically at startup(done and works) and a specific program is to be run at startup(done and works but not as intended). I've done this so far by adding               exec mono scannerSoftware.exe 127.0.0.1 1234 randomString      to `/home/certainUser/.bash_profile` so it gets executed only once even when I'm switching back and forth to root (in contrast to bashrc). The particular problem I am having: When I launch the system it works as intended (login as certainUser, starting scannerSoftware.exe), BUT if I want to switch users and hit `Ctrl`+`C` it restarts the login process, logging certainUser in again and running the program again => back to where I came from.   My guess as to why this happens is that the sys detects "login not complete, better start it again" I could circumvent this by spamming `Ctrl`+`C` right around the login, so that I practically interrupted it. Of course this is not good practice, suffice to say it is not practical at all. My question:   How can I set it up, so the program gets executed AFTER login is complete, so that `Ctrl`+`C`'ing out brings me to a normal bash promt as certainUser instead of beginning the endless login-cycle? EDIT:   I'm not using any graphical interface or such, only commandline (bash on tty), because when done the system won't even have a display.


title: Apache CGI proxy returning 502 Bad Gateway on Fedora

text: I need to configure Apache as a proxy on Fedora and am using a CGI script to define allowable domains. This approach has worked in the past on Windows but now on a Fedora Server I am getting the following error: NetworkError: 502 Bad Gateway - `http://localhost/cgi- bin/proxy.cgi?url=http%3A%2F%2F000.0.0.000%2Fgeoserver%2Fwfs"` (I have anonymised the IP address as it's my test server). This URL is successful: `http://localhost/cgi-bin/proxy.cgi` demonstrating that my proxy.cgi script is in the right place. I have added the following domains to my allowable list:               localhost, 000.0.0.000, localhost/geoserver/wfs, 000.0.0.000/geoserver/wfs      (obviously I'm substituting the real IP address in the actual CGI script) I notice that the url causing the error is coming through as `http%3A%2F%2F000.0.0.000%2Fgeoserver%2Fwfs` instead of `http://000.0.0.000/geoserver/wfs` and I wonder if this is the problem but don't know how to resolve it.


title: Meaning of Crossing filesystem boundaries, --one-file-system, etc

text: I'm planning to use rsnapshot to backup my whole Linux system, though I'm confused by `-x` option (same of `one_fs` in `rsnapshot.conf`). The man page says: > -x one filesystem, don't cross partitions within each backup point I understand it's not a specific rsnapshot option since rsync, cp, tar and other commands provide this feature as well. Does file system boundaries refers to different partitions? Different mount points? And what does it mean to don't "cross" them? Back to my case, I read many people suggesting to use `-x` with rsnapshot, but I'm wondering if doing so is not going to compromise the completeness of my backup. I want to backup everything under `/`, including `/boot` and `/home`, which reside on dedicated partitions of the same disk, while at the same time I don't want to backup files and directories not strictly belonging to my system, like `/mnt`, `/media`, etc. Executing `mount` command on my system gives the following output. Pratically, using `rsnapshot -x`, what will be included and what will be left out?               /dev/sda7 on / type ext4 (rw,errors=remount-ro)     proc on /proc type proc (rw,noexec,nosuid,nodev)     sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)     none on /sys/fs/fuse/connections type fusectl (rw)     none on /sys/kernel/debug type debugfs (rw)     none on /sys/kernel/security type securityfs (rw)     udev on /dev type devtmpfs (rw,mode=0755)     devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)     tmpfs on /tmp type tmpfs (rw,noexec,nosuid)     tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)     none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)     none on /run/shm type tmpfs (rw,nosuid,nodev)     /dev/sda6 on /boot type ext3 (rw)     /dev/sda8 on /home type ext4 (rw)     binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)     gvfs-fuse-daemon on /home/myuser/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=myuser)


title: SED : Case Match Pattern Replacement

text: I have a source code spread across several files.   * It has a pattern `abcdef` which I need to replace with `pqrstuvxyz`.   * The pattern could be `Abcdef` (Sentence Case) then it needs to be replaced with `Pqrstuvxyz`.   * The pattern could be `AbCdEf` (Toggle case) then it needs to be replaced with `PqRsTuVxYz`. In short, I need to match the case of the source pattern and apply the appropriate destination pattern. How can I achieve this using `sed` or any other tool?


title: copy a single file from local repository GIT

text: I need to copy a SINGLE FILE from LOCAL REPOSITORY to my machine, not `git- pull` or `git-fetch`, how can i do it? Is it possible to get it via hash ? such as `a3ea2118bf1c5e2c6aa0974d0b6ff7415bd044ef` ?


title: How can I ssh to a remote server with an automated password and no key?

text: I have a remote server. I planned to use public keys to connect over ssh without typing the password but the remote system rejects public key authentication. So what is the best way to do it? What about using `sshpass`?


title: Graphic glitches with Llano APU in gnome 3 (Arch)

text: I recently installed Arch Linux on my Mini-ITX machine using the recommended `xf86-video-ati` driver for the AMD Llano-APU. XFCE works -- with compositing -- ~~perfectly fine~~ , but Gnome 3 shows a lot of glitches, like you can see in the pictures below. Any ideas how to fix this, without using the proprietary Catalyst driver? * * * **Update** XFCE also has some (subtle) glitches. * * * output of `lspci`:               00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Root Complex     00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) I/O Memory Management Unit     00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Trinity [Radeon HD 7540D]     00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Trinity HDMI Audio Controller     00:10.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller (rev 03)     00:10.1 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller (rev 03)     00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 40)     00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11)     00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 11)     00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11)     00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 11)     00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 14)     00:14.1 IDE interface: Advanced Micro Devices, Inc. [AMD] FCH IDE Controller     00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 01)     00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 11)     00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] FCH PCI Bridge (rev 40)     00:14.5 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11)     00:15.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Hudson PCI to PCI bridge (PCIE port 0)     00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 0     00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 1     00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 2     00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 3     00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 4     00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) Processor Function 5     02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168 PCI Express Gigabit Ethernet controller (rev 06)      ![glitch_1](http://i.stack.imgur.com/NKifo.jpg) ![glitch_2](http://i.stack.imgur.com/x6qcr.jpg)


title: No sound since I first pressed "mute" on my keyboard

text: I have a problem with sound. I once pressed the mute button on my keyboard and since then I couldn't do anything to get the sound back on my headphones (obviously, including pressing mute again). I tried to go into alsamixer and everything seems okay, except the headphone, which seems like it has no volume at all (and it says: `Item: Headphone [Off, Off]`) and I also can't increase it. As for the rest (master, pcm, surround, center etc) are all okay. My sound card is a HDA Intel, Realtek ALC1200.               uname -a:     Linux ... 3.2.0-53-generic-pae #81-Ubuntu SMP Thu Aug 22 21:23:47 UTC 2013 i686 i686 i386 GNU/Linux      Any clue? * * *


title: script works fine on client machine but doesnt work in nagios

text: purpose: nagios check for kannel stuck     Date : dec 8, 2013          /etc/init.d/kannel status | grep -i -E "SMS: received" | awk '{ print $3 }' > kannel_temp_1.txt       /etc/init.d/kannel status | grep -i -E "SMS: received" | awk '{ print $7 }' > kannel_temp_2.txt         /etc/init.d/kannel status | grep -i -E "SMS: received" | awk '{ print $3 }' > kannel_temp_3.txt         /etc/init.d/kannel status | grep -i -E "SMS: received" | awk '{ print $7 }' > kannel_temp_4.txt          recvsms1=$(cat kannel_temp_2.txt) sentsms2=$(cat kannel_temp_3.txt) recvsms2=$(cat kannel_temp_4.txt)          if [ $sentsms1 == $sentsms2 ] && [ $recvsms1 == $recvsms2 ];     then        exitcode=0        statustxt=ok         else        exitcode=2        statustxt=critical        fi          echo "$exitcode - $statustxt"      My script works fine on client machine but returns the wrong information (always critical) in nagios.


title: How to move the first x files

text: I have this huge folder with thousands of unordered files. Is it feasible to move the first 5000s to a subfolder via the `mv` command? For now I move files with                mv *some_pattern* ./subfolder1/      As for now, I move images quite randomly, it's not really important if there aren't exactly 5000 files in each subfolder. Is there a better way to do it?


title: Sending HTML with Mutt (or another terminal mail client)

text: While I can find some scattered info on the topic, I can't seem to find a straight walkthrough (or even a definite answer)... Basically I'm too low on the totem pole to start sending plain-text e-mails. My company requires an HTML signature that includes the logo image. The problem is I'm fed up with GUI mail clients. Is it possible to configure Mutt in a way that would allow me to have all messages I write injected to an HTML template (with an embedded image)? Or will I just have to deal with Thunderbird's chaos? Thanks for any help!


title: VIM -Change waiting time for combined key maps

text: In VIM, When I map for example `<F9><F10>` to a command and `<F9>` to another command , it waits for 1-2 seconds when I press F9 to allow me press `<F10>` to access the command mapped to `<F9><F10>` and if I don't press `<F10>` it executes the command mapped to `<F9>`. Is there a way to change this waiting time?


title: Is it bad practice to set root's shell to something other than the default?

text: Once a friend of mine (who is an experienced Unix/Linux user) told me that setting root's shell to something other than sh (i.e bash or zsh) might create problems, because some script might assume that the shell is sh and do something weird. However, I think Ubuntu have default root shell set to bash, and Gentoo uses bash too. Can somebody bust the myth?


title: pressing @ in the keyboard gives " (and # gives £ ) in mint16

text: Hello I am using mint16(cinnamon). When I try to write @ it shows ". That is, key functioning of these two keys has got swapped somehow. Can someone please suggest a way to get rid of this problem.


title: Difference between references of Linux "utilities", "commands" and "programs"

text: I read uses of the word "utilities" for commands/programs such as 'ls', 'chmod', 'mv', etc. Is "commands" is Linux referring to the same things as `top`, `ps`, etc., or are those something different? What about "programs"? Are those the ones that don't come with the standard distribution which need to be installed like `irssi`, `emacs`, `kismet`, etc.?


title: Howto install gcc on NetBSD 6.1.2?

text: I did a minimal install of NetBSD 6.1.2 and thought it would be easy to install a working gcc package. But even after `pkg_add -r gcc48 gcc48-libs` and adding gcc to the path, gcc is still not able to compile simple programs. Which packages do I need and which additional config steps are necessary ?


title: How much can the space allocated for an LVM snapshot be reduced?

text: I created an LVM snapshot, then I modified the original logical volume, and now I see that I probably allocated too much space to hold the snapshot. And I want to reclaim some free space by reducing the space allocated for the snapshot. How can I check how much the space allocated for a snapshot can be reduced without breaking the snapshot? In other words: How to find out the space actually needed at the current moment for a snapshot to continue to exist? (If I know this minimal necessary size, then I probably can simply use `lvreduce` to reclaim more free space for the VG from the snapshot.)


title: API with no system calls

text: The book 'Understanding Linux Kernel' says that **'for something abstract such as math functions, there may be no reason to make system calls'**. Can any one please explain how is a system call not required in math functions? Isn't the CPU involved in mathematical operations? Can anyone give an example of such a program?


title: Issues with libGL on Fedora 20 - unable to load driver swrast?

text: Firstly, before I explain my problem, I have referred to the question previously asked on Ask.Fedora about the libGL error, which can be seen here. I have been trying to play the game "FTL - Faster Than Light", and I have been running into problems where the graphics perform extraordinarily poorly, and the sound keeps turning into a strange buzzing sound. Upon looking further, I noticed that my Terminal outputted the following message during the game's launch.               libGL error: failed to load driver: swrast     libGL error: Try again with LIBGL_DEBUG=verbose for more details.      After doing some further research, it would appear that this issue has affected multiple people on numerous distributions of Linux, all with different solutions. Below, I have provided as much information as I can to help diagnose my specific issue. This also seems to be similar to Bug 971437 on the Red Hat bug tracker When getting libGL debug info on glxinfo:               $ LIBGL_DEBUG=verbose glxinfo | grep direct     libGL: screen 0 does not appear to be DRI2 capable     libGL: OpenDriver: trying /usr/lib64/dri/tls/swrast_dri.so     libGL: OpenDriver: trying /usr/lib64/dri/swrast_dri.so     libGL: Can't open configuration file /home/jflory/.drirc: No such file or directory.     libGL: Can't open configuration file /home/jflory/.drirc: No such file or directory.     direct rendering: Yes      I have a feeling there is some sort of issue with my graphics card, because I am VERY new to Linux and I'm unsure about what I may need to properly be able to run games. Below, I have some of the numerous packages I have tried to install during this process.               $ cat /etc/ld.so.conf.d/nvidia-lib64.conf     cat: /etc/ld.so.conf.d/nvidia-lib64.conf: No such file or directory          $ cat /etc/ld.so.conf.d/nvidia-lib.conf     cat: /etc/ld.so.conf.d/nvidia-lib.conf: No such file or directory          $ sudo yum install mesa-libglapi     Loaded plugins: langpacks, refresh-packagekit     Package mesa-libglapi-9.2.5-1.20131220.fc20.x86_64 already installed and latest version     Nothing to do          $ sudo yum install xorg-x11-drv-nvidia-libs.i686     Loaded plugins: langpacks, refresh-packagekit     No package xorg-x11-drv-nvidia-libs.i686 available.     Error: Nothing to do      I have installed a few more things across the course of the night, but none of them seemed to have done any good, so I don't _think_ they are relevant. If any more information is needed, please let me know and I will provide. As a reminder, I am very new to Linux in general and I am still learning, so I am not the most familiar with all the different UNIX operations I am able to do. Here's a quick rundown of my system specs:               $ uname -a     Linux localhost.localdomain 3.12.5-302.fc20.x86_64 #1 SMP Tue Dec 17 20:42:32 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux          $ grep "model name" /proc/cpuinfo     model name      : Intel(R) Core(TM) i3-3120M CPU @ 2.50GHz      ## Edit #1 I ran `sudo yum install mesa-dri-drivers` and it appeared it is already installed on my system.               $ sudo yum install mesa-dri-drivers     Loaded plugins: langpacks, refresh-packagekit     Dropbox                                            |  951 B     00:00          google-chrome                                      |  951 B     00:00          updates/20/x86_64/metalink                         |  18 kB     00:00          updates                                            | 4.6 kB     00:00          updates/20/x86_64/primary_db                         | 3.0 MB   00:06          updates/20/x86_64/updateinfo   FAILED                                               ftp://mirror.nexicom.net/pub/fedora/linux/updates/20/x86_64/repodata/updateinfo.xml.gz: [Errno 14] curl#56 - "response reading failed"     Trying other mirror.     (1/2): updates/20/x86_64/updateinfo                  | 309 kB   00:01          (2/2): updates/20/x86_64/pkgtags                     | 755 kB   00:23          Package mesa-dri-drivers-9.2.5-1.20131220.fc20.x86_64 already installed and latest version     Nothing to do      ## Edit #2 After executing `lspci -vvv -s 00:02.0`, my output was the following:               # lspci -vvv -s 00:02.0     00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) (prog-if 00 [VGA controller])         Subsystem: Toshiba America Info Systems Device fa20         Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-         Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-         Interrupt: pin A routed to IRQ 16         Region 0: Memory at c8000000 (64-bit, non-prefetchable) [size=4M]         Region 2: Memory at c0000000 (64-bit, prefetchable) [size=128M]         Region 4: I/O ports at 4000 [size=64]         Expansion ROM at <unassigned> [disabled]         Capabilities: [90] MSI: Enable- Count=1/1 Maskable- 64bit-             Address: 00000000  Data: 0000         Capabilities: [d0] Power Management version 2             Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)             Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-         Capabilities: [a4] PCI Advanced Features             AFCap: TP+ FLR+             AFCtrl: FLR-             AFStatus: TP-


title: Enabling apt repository priority in LMDE

text: I want to set up apt repository priority ordering in Linux Mint Debian Edition 2012.04. In `/etc/apt/preferences` the order should be: LMDE -> Debian testing -> Debian unstable. In other words, I almost always want to use packages from LMDE semi-rolling repository, and only sometimes get them from testing and unstable only when absolutely necessary. I looked at http://forums.linuxmint.com/viewtopic.php?f=201&t=78882 and http://forums.linuxmint.com/viewtopic.php?f=141&p=379226, but still have not been able to get repository priority ordering to work correctly. What is the best way to do this?


title: Torrent with GUI for Gnome on CentOS 6?

text: I'm running Gnome Desktop on CentOS, I was wondering if anyone knows of a good Torrent program like uTorrent that will run on Gnome CentOS? If so does anyone have a tutorial on how to install it.


title: Grub doesn't recognize windows 8

text: Recently, I installed Windows 8.1 and Linux Mint Debian Edition on a new laptop. Neither installs seemed to have any issues, and both operating systems run well. However, the only way I can switch between the two is by going to the boot menu and changing their boot priorities. Grub won't recognize windows 8, and windows boot manager throws an error if I add linux mint as an entry (using easybcd) and try to run it from there. I've disabled both secure boot and fast boot. My grub.cfg does seem to have an entry for windows 8, it just doesn't show up when I boot my computer. Here's what it looks like: http://pastebin.com/W98CdEA9 I've looked for solutions online already, but most people who have the same problem either didn't receive an answer at all, or received an answer specific to their case that doesn't seem to work for mine. This is my first time dual booting, so I'm not sure what other relevant information I should include, so feel free to ask for anything needed.


title: SVN: How to move the project from one repository to another repository

text: I am working on SVN. Actually I created 3 projects under the same repository. Now I created 2 new repositories. Actually I want to move the existing two projects into these repositories. I installed Subversion on Ubuntu 12.04.


title: Centos VFS cannot open root device

text: Yesterday I did a kernel update on a virtual machine. When I restarted the machine unfortunately I got the error `Kernel panic - not syncing VFS` After some searching I found out I should go to GRUB and just select the old kernel and everything would be fine. Wel I selected the old kernel but came to the following error; `VFS: Cannot open root device "mapper/vg_cpanel-lv_root` ![Error trace](http://i.stack.imgur.com/bzb3a.png) So after some digging I found, this question somewhere else. I went to rescue mode and do `vim /boot/grub/device.map` and 1 line appears `(fd0) /dev/fd0` (nothing more). I did a fdisk -l; ![enter image description here](http://i.stack.imgur.com/9iD2l.png) But there ends the train for me, unfortunately. Following are 2 screen shots of my grub command; ![All commands](http://i.stack.imgur.com/K1qRY.png) ![kernel command](http://i.stack.imgur.com/DXuhU.png) I hope someone can point me in the right direction.


title: Internet routing between wlan0 and ppp0?

text: On my Debian Linux device, I have a USB-modem that is connected to the Internet. Its interface name is ppp0. I also have a USB-wireless adapter, where I am hosting a Access Point. Its interface name is wlan0. How to I route traffic between these interfaces, so that if my phone is connected to this AP, that I can access the Internet via ppp0? EDIT 1: I tried setting up some routing, but does not seem to work. Here are the details:               # iptables --list-rules     -P INPUT ACCEPT     -P FORWARD ACCEPT     -P OUTPUT ACCEPT     -A FORWARD -i ppp0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT     -A FORWARD -i wlan0 -o ppp0 -j ACCEPT          # iptables --list-rules -t nat     -P PREROUTING ACCEPT     -P INPUT ACCEPT     -P OUTPUT ACCEPT     -P POSTROUTING ACCEPT     -A POSTROUTING -o ppp0 -j MASQUERADE      EDIT 2 SOLVED: I was able to solve my problem. I was using the same subnet for wlan0 and ppp0. When using different subnets for wlan0 and ppp0, everything worked fine. I also found this article useful: http://elinux.org/RPI-Wireless- Hotspot


title: Cloud Server: Which MTA (exim/postfix/etc.) on What OS (Linux/FreeBSD)

text: My company wants to migrate the current mail server into a Cloud Server Provider. The Provider is the IaaS (Infrastructure as a Service) kind, not SaaS (Software as a Service). That means I have to install the OS + MTA myself. I'd really appreciate it if you can give me a guidance, pro/con analysis, experience, etc. on the following combinations:   * Exim on Linux   * Postfix on Linux   * Exim on FreeBSD   * Postfix on FreeBSD   * (other MTA)* on Linux/FreeBSD *Please do not suggest **sendmail** and/or **qmail**. Thank you all for your kind assistance. PS: When I've made my choice, I'll change the question title to '[Solved]' and post my choice.


title: How to determine if two devices are connected in network?

text: Is there a free linux softwear to determine if two network devices are connected? Or a php class can be also good... I'd like to draw the network topology. I can determine the devices in the network with zenmap (it saves the results to file), but I don't know which device connected to which device... (zenmap can also draw topology, but it doesn't save it to file)


title: What tools allow me to present man pages as formatted HTML on a web server?

text: What tools exist to make man pages available on a system available via HTTP and link topics together such that references in the `SEE ALSO` sections and elsewhere will become hyperlinks in the HTML representation of the man pages? I'm using Debian (6) and Ubuntu (10.04, 10.10) currently, so existing packages would be preferred, but I'll also go for any other solutions if they are clearly superior.