title: ASCII binary tools?

text: Which is a good tool to convert ASCII to binary, and binary to ASCII? I was hoping for something like:               $ echo --binary "This is a binary message"     01010100 01101000 01101001 01110011 00100000 01101001 01110011 00100000 01100001 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01101101 01100101 01110011 01110011 01100001 01100111 01100101      Or, more realistic:               $ echo "This is a binary message" | ascii2bin     01010100 01101000 01101001 01110011 00100000 01101001 01110011 00100000 01100001 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01101101 01100101 01110011 01110011 01100001 01100111 01100101      And also the reverse:               $ echo "01010100 01101000 01101001 01110011 00100000 01101001 01110011 00100000 01100001 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01101101 01100101 01110011 01110011 01100001 01100111 01100101" | bin2ascii     This is a binary message      PS: I'm using bash PS2: I hope I didn't get the wrong binary


title: Removing text between two specific strings

text: I have a file as below:               mime PI Name: ISHO SUCCESS RATE RT, Value: 95.663826     scr  PI Name: RRC Access Failures due to UU, Value: 0.13394141     prog PI Name: RRC Access Failures due to UU, Value: 0.16077702     sch PI Name: RRC Access Failures due to UU, Value: 0.11781933      I want to remove text `PI` till `Value:`. I tried               sed '/<PI>/,/<\/Value:>/d'       Any help?


title: How to extract single value from single line tuples?

text: I have a dump file of a database in the following form               ('value1','value2',value3','value4'),('value1','value2',value3','value4'),...      I want first to have each tuple in a single line and next i would like to export only a single value (i.e:value3 from each tuple)


title: Why does curl command take urls with parameters as input

text: I know both `wget` and `curl`. Being curious I read a little about their differences. I recently tried to use `curl` with an url who has parameters and it turns out curl strips down the parameters from the url. The consequence is : I don't get the page I requested. So my question was, why does the curl command do that ? Edit : I tried following               # bare     $ curl -s http://tag.mobitrans.fr/horaires/index.asp?rub_code=23&lign_id=4&sens=2          # double quotes     $ curl -s "http://tag.mobitrans.fr/horaires/index.asp?rub_code=23&lign_id=4&sens=2"          # single quotes     $ curl -s 'http://tag.mobitrans.fr/horaires/index.asp?rub_code=23&lign_id=4&sens=2'          # escaping special chars     $ curl -s http://tag.mobitrans.fr/horaires/index.asp?rub_code=23\&lign_id=4\&sens=2      FWIW : `curl 7.34.0 (x86_64-apple-darwin13.0.0) libcurl/7.34.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.26`


title: Emerge on Gentoo fails with "Multiple package instances within a single package slot have been pulled … in". How can I resolve this?

text: I'm trying to install Google Chrome on my recent Gentoo box. But `emerge` is throwing some errors that are way over my head. I genuinely don't know what the problem even is.               !!! Multiple package instances within a single package slot have been pulled     !!! into the dependency graph, resulting in a slot conflict:          dev-libs/glib:2            (dev-libs/glib-2.32.4-r1::gentoo, installed) pulled in by         <dev-libs/glib-2.33:2 required by (dev-libs/gobject-introspection-1.32.1::gentoo, installed)            (dev-libs/glib-2.36.4-r1::gentoo, ebuild scheduled for merge) pulled in by         >=dev-libs/glib-2.34.0:2 required by (x11-libs/gdk-pixbuf-2.28.2::gentoo, ebuild scheduled for merge)         (and 2 more with the same problem)          media-libs/fontconfig:1.0            (media-libs/fontconfig-2.8.0-r1::gentoo, installed) pulled in by         (no parents that aren't satisfied by other packages in this slot)            (media-libs/fontconfig-2.10.92::gentoo, ebuild scheduled for merge) pulled in by         >=media-libs/fontconfig-2.10.91:1.0= required by (x11-libs/pango-1.34.1::gentoo, ebuild scheduled for merge)      I've already tried the `\--backtrack=30` and `\--autounmask-write` options as suggested in the output, but there is no difference in the output. I just need to know what the problem is in order to go about finding a solution to it. Any help is greatly appreciated.


title: Can't open syntax.vim error when using vimrc

text: When I try to open my `.bashrc` file. then it shows these lines:               Errordetected while processing /etc/vimrc:     line 45:     E848: Can't open file /usr/share/vim/vim70/syntax/syntax.vim     Press ENTER or type command to continue      When I go to the `/etc/vimrc` file , it shows `syntax on` line 45. I've installed the OS three times and it always shows the same error.


title: Relation between the kernel version and OS version

text: I am running a Ubuntu of version 12.04. Can I use a kernel of version of version 2.4 on it?


title: ${!FOO} and zsh

text: `${!FOO}` performs a double substitution in `bash`, meaning it takes the (string) value of FOO and uses it as a variable name.   `zsh` doesn’t support this feature. Is there a way to make this work the same in `bash` and `zsh`? ### Background: I’ve got a list of environment variables, like               PATH MAIL EDITOR      and want to first print the variable names and afterwards their values. This works in `bash` but not `zsh`:               for VAR in LIST     do             echo $VAR             echo ${!VAR}     done      It should be somehow possible “the old way” with `eval`, but I can’t get it to work:               for VAR in LIST     do             echo $VAR             echo `eval \$$VAR`     done      I’m never going to understand why I can’t simply do arbitrary deep substitutions like `${${VAR}}` or even `${${${VAR}}}` if need be, so an explanation for that would be nice, too.


title: Org-mode: Inserting (advanced) LaTeX equations for HTML expot

text: I'm using `org-mode` as working environment, and so far has been extremely useful. One of the wonders of it is the versatility of exporting... I can export to LaTeX or HTML or ODT files from the same code. :-) However, I would like to be able of writing an `aling` LaTeX environment and get it exported properly to HTML. I've tried different form, but nothing! For example: the code returns nothing               #+BEGIN_LaTeX          \begin{align}         \begin{pmatrix}           x' \\ y' \\ z'         \end{pmatrix}          =          \begin{pmatrix}           R11 & R12 & R13\\           R21 & R22 & R23\\           R31 & R32 & R33         \end{pmatrix}         \begin{pmatrix}           X \\ Y \\ Z         \end{pmatrix}          \end{align}     #+END_LaTeX      Any ideas?... Thanks!


title: Why useradd shows Permission denied error

text: I am working on CentOS 5.5. When I run the `useradd` command as root, then its working. But when I run the same command from one of the user, then it shows               -bash: /usr/sbin/useradd: Permission denied      Why all this happening? I also added `/usr/sbin` in `PATH`. I added user from root by following commands:               groupadd service     useradd -g service service     passwd service      I installed Operating System two three times, all the time it shows same error. Help me please, I didn't understand why all this happening.


title: What's with Totem 3.1.0 in Launchpad? And is it installable on Ubuntu 12.04?

text: I've been wondering, why on the totem launchpad page (https://launchpad.net/totem) they have 3.1.0 instead of 3.10 or 3.11 or what ever version the Gnome 3 team is working on. Is the page abandoned? And also is it installable on Ubuntu 12.04 (Instructions would be nice :)?


title: Returning a value from a bash function

text: I have a function which returns 1 if the number is a valid ten digit number:               valNum()     {         flag=1         if [[ $1 != [1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] ]]; then             echo "Invalid Number"             flag=0         fi         return $flag     }      It is getting called by:               if [[ $(valNum $num) -eq 1 ]]; then           #do something     fi      The function is working fine if the number is valid but is showing syntax error if input a invalid number.


title: Why do some drivers still require firmware?

text: There are a ton of reverse-engineered drivers in the Linux kernel tree. Yet some drivers, especially wireless drivers, require firmware binary blobs to run properly. What prevents someone from reverse-engineering these, too, and making the driver 100% free? Or is it different for different drivers?


title: Startup with USB Puppy without BIOS control

text: I'll preface by saying I'm a complete linux newbie. I have Puppy Linux all ready to roll on a USB drive. I know that I can set the boot order in BIOS to do USB first. But what I want is to be able to startup Linux on public computers where I can't get into the BIOS. Is there a way, other than using BIOS, to force the computer to startup with the Linux on the USB?


title: Is there any reason to move away from fstab on a systemd system?

text: I'm on an Arch Linux system, which means systemd. In systemd there are native unit files for mountpoints, with the extension .mount. I've always just used `/etc/fstab`, which never gave me problems because systemd just picks up information from that. But now that I've actually read the documentation, I'm wondering if I should change to native systemd unit files. The Arch Wiki suggests that there's no benefit, because it says to populate your `fstab` in the beginner's guide. But I'm not sure.


title: View all disabled or hidden linux kernel options

text: I am trying to build a 3.12 Linux Kernel and I see some of the options (sub menus) are hidden and their branch (menu entry) is disabled in `make menuconfig`. [`\----` instead of being `\--->`] I know it is because of my system profile or their dependencies but I want to view all of them. What helped in the previous kernels was a key-shortcut, (like `Ctrl`+`H` in file manager) that shows every option and menu. What is that shortcut?


title: Access remote server after running ifdown eth0

text: I had a problem:               Could not retrieve mirrorlist http://mirrorlist.centos.org/release=6&arch=x86_64&repo=os error was     14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"     Error: Cannot find a valid baseurl for repo: base      I've read and tried this suggestion. Our server is remote, we connect to it with `ssh`. After issuing `ifdown eth0`, the server stopped responding. My OS is CentOS. How can I fix my problem?


title: How X (X Window) looks?

text: I am confused as when X is started, how it is visible on screen. Does a new Window appear or not? I am very confused! I booted, opened a shell terminal. > _**Below I write regarding my local machine:_** Entered `xterm` The terminal emulation window (xterm) appeared. Now, I conclude that X is already running and so is X server. Then I entered in terminal `startx` It resulted in a different screen. Looked like normal screen when the system is booted. But that screen has no menus. If 2 windows are opened one above the other, I can't bring the bottom one on top simply by clicking it. One thing I w'd like to add. Once I run 'startx' and a new screen/desktop appears, it's not a direct easy way to come out from there. Right now I experimented. I wasn't able to come out from that desktop. Button function 'alt-tab' doesn't work there. To escape from there back to my original desktop, i pressed ctrl-ALT-F1 and entered shell prompt. there I pressed ctrl- alt-F7 to return back to my original desktop. Now one doubt: Earlier before running command `startx`,was X running, if so when I again ran X by the above command , why it opened a new screen? That means, X is running again with a different look (i.e. different desktop) > _**Below I write regarding my remote machine._** > > One thing I w'd like to tell w.r.t. my **remote server**. One thing I w'd > like to tell w.r.t. my **remote server**. When I connect remote server of > mine (VPS) I see the desktop or the screen on the remote box which is same > screen/wkndow as what I saw on my local machine when I ran on my local > machine `startx`. From this I feel that something like startx is running on > my remote server as a result of which I am not able to see the normal > desktop as seen on local (having menus on left, etc). There was no menu > visible as is visible on my local machine. You can see the screen shot for > clarity of how my **_remote destop_** looks like when I connect to remote > machine. The menu visible on the screen shot is of my local machine. The top > most window is my remote machine. There also I can't change size of any > window. It works the same way as when here locally I ran `startx`. Now > please tell me what can I do so that I get menu on my remote machine. If > there everytime something (as told above) is running, how to stop and get > back to my normal desktop that we all (ubuntu 13.04 users)see after the > system is booted. What to do so that the remote also looks the same as my > local box. Both local and remote has ubuntu13.04 It's too unclear as how X looks. _**Below is screen shot of my remote machine as visible when I connect to it. (the top most window/screen heading: NX-ravbholua@ravi:1002-bholua)_** ![enter image description here](http://i.stack.imgur.com/gew1X.png)


title: LDAP: ldapadduser - can I add to two different groups?

text: Usually - `ldapadduser` assumes only one attribute for group-name:                # ldapadduser sysuser2 sysusers      Can I add add this users in to two groups while creating user? If I try run like:               # ldapadduser sysuser2 sysusers,wheel     Warning : using command-line passwords, ldapscripts may not be safe     Cannot resolve group sysusers,wheel to gid : not found      I got error... If no - can I modify users after adding to make him member of two groups? Using **FreeBSD** 9.1 and **OpenLDAP** 2.4.


title: How to test UPSTART feature of ubuntu to see my script gets restarted automatically if it gets killed?

text: I am running my Python script using upstart feature of Ubuntu so that if for whatever reason my Python script dies or gets killed, it can be restarted automatically. So I decided to use UPSTART feature of Ubuntu to restart the Python script automatically. After creating the testing.conf file like this in `/etc/init/testing.conf` -               chdir /tekooz     exec python testing.py     respawn      I ran below sudo command to start it and I can see that process running using `ps ax` and my python script is also running fine.               root@bx13:/tekooz# sudo start testing     testing start/running, process 27794      This is my below python script -               #!/usr/bin/python     import time          while True:         print "Hello World"         time.sleep(5)      But how do I test it to see if my Python script gets killed, then it is getting restarted automatically? I cannot kill the `PID` as the PID keeps on changing if I do `ps ax` on my `testing.py`. Can anyone tell me how to test this scenario? I am just trying to make sure my script can be restarted automatically if it gets killed or dies.


title: Common flag designations and standards for shell scripts and functions

text: I have been adjusting to using GETOPT and GETOPTS in my shell scripts and custom functions to enable me to use the functions that I create more flexibly. After using a number of UNIX functions I have realized that a lot of them use a somewhat similar syntax. Examples being `-v` for verbose output and `-R/-r` for recursive functionality. I looked at the POSIX standard guide for utility conventions and the GNU's option tables for C based utilities. In an attempt to understand whether this was by design and if there are any rules that I should be following. **My questions are:**   1. Are there are any specific option flags that have designated meaning?   2. How much freedom do I have with my options and which rules shouldn't I break?   3. Should I stay way from giving options like `-t` and `-T` different meanings, or should I group them together for simplicity?   4. What situations should I use uppercase or lowercase letters?


title: NTFS Junctions and Unix Hard Links

text: I'm building an IO abstraction library for CIL code, and I have a very hard time understanding the differences between a junction between two folders in NTFS and hard links. Are they equivalent? Are there differences I should know about?


title: Remove unknown unicode character from textfiles - sed, other bash/shell methods

text: I need to search and replace all occurences of an unknown character in some files having the same name. Opening such files with vi, I read <91> code for that character. Opening them with nano, I read a "question mark" in a diamond (black rhumble). I would like to replace such unknown character with a quote ('). I'm trying many ways with no luck. I tried:               find ./ -name filename.txt -exec perl -i~ -pe "s/\x91/'/" {} \;                    find ./ -name filename.txt -exec sed -i "s/\x91/'/g" {} \;      **EDIT** More info on the character:               Hexadecimal: 91 68 74 74     Decimal: 145 104 116 116     Octal: 221 150 164 164     Binary: 10010001 01101000 01110100 01110100          LC_ALL=C sed -n l < file          \221      If you need more, ask!


title: How to get a persistent "history"-file even after a non-clean shutdown?

text: I am trying Ubuntu Server 10.10 in VirtualBox. I like that the commands I run is saved in a "history"-file that can be shown with the `history` command. But if I just turn off VirtualBox without the `shutdown` command, then next time when I boot, the commands from the last session is not saved in the history file. The commands are only saved if I shutdown the machine with the `shutdown` command. E.g. `shutdown -P 0`. Is there any way I can save the history file after every command so they are persistent even after a "non-clean" shutdown?


title: What is the key difference between grml zsh config and oh-my-zsh config

text: Now I'm on the oh-my-zsh, but I'm not sure that it is perfect choice. What is the key difference between grml zsh config (github repo) and oh-my-zsh config? In which case should I prefer grml or oh-my-zsh?


title: How do you use badblocks?

text: I need to do a destructive (rw) test on a new drive, and a read-only on a drive that fell out of my RAID array. I want to see if it finds problems and how far along it is.


title: How do I quit from Vi?

text: I started Vi on my Ubuntu machine. However I don't know Vi, and now I can not quit. I see the editor and I can write text, at the bottom line there is a label "recording". How do I quit from Vi?


title: jboss with s3ping in ec2

text: I'm trying to get `s3ping` discovery method working in JBoss AS 7. I have deployed a sample web app which is clustered. As of now I have a single node. But in the near future I'll be adding more nodes in the cluster.. I have modified the file `standalone-ha.xml` with the required s3 credentials and bucket details.                <stack name="s3ping">                     <transport type="TCP" socket-binding="jgroups-tcp" diagnostics-socket-binding="jgroups-diagnostics"/>                     <protocol type="S3_PING">                         <property name="access_key">                             XXXXXXXXXXXXXXX                         </property>                         <property name="secret_access_key">                             XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                         </property>                         <property name="prefix">                             MyjbossBucket                         </property>                         <property name="timeout">                             6000                         </property>                     </protocol>                     <protocol type="MERGE2"/>                     <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>                     <protocol type="FD"/>                     <protocol type="VERIFY_SUSPECT"/>                     <protocol type="BARRIER"/>                     <protocol type="pbcast.NAKACK"/>                     <protocol type="UNICAST2"/>                     <protocol type="pbcast.STABLE"/>                     <protocol type="pbcast.GMS"/>                     <protocol type="UFC"/>                     <protocol type="MFC"/>                     <protocol type="FRAG2"/>                 </stack>      And I start this JBoss instance by using the below command.               ./standalone.sh -b 10.1.137.250 -bmanagement=10.1.137.250 -c standalone-ha.xml -Djboss.default.jgroups.stack=s3ping -Djgroups.bind.address=10.1.137.250 -Djboss.node.name=node1      It's getting started successfully, but I'm unable to see any node information file created inside the s3 bucket. Kindly please guide me through the correct method to get this done...Or am I doing some mistake in the configs...


title: How to restore empathy windows on Gnome 3?

text: Somehow the main application window of my empathy application is gone and only shows me the contact list but not the account settings window so that I can no longer add instant messanger accounts or persons to an account. How can I restore that? I use GNOME Shell 3.6.2.


title: Extra % in output of awk script

text: I have the following script in awk that sums all columns in a file that I pipe to it:               #sum_all.awk     {   for (i=1; i<=NF; i++) { sum[i]+= $i }   }          END { for (i=1; i<=NF; i++ ) { printf "%d ", sum[i] } }      e.g.: `cat my_file.txt | awk -f sum_all.awk` with `my_file.txt`:               5 7 8     1 0 2      outputs:               6 7 10 %      How can I get rid of that last character `%`?


title: Difference between printf and echo in bash

text: What is the difference between the `printf` function in bash and the `echo` function? Specifically, running:               echo "blah" >/dev/udp/localhost/8125      did not send the "blah" command to the server listening on 8125, whereas               printf "blah" >/dev/udp/localhost/8125      sent the data. Does printf send an extra EOF at the end of its output?


title: Permissions to print directly to USB printer

text: I've a netbook with Linux. I've a usb/serial printer and I added the line `chmod 666 /dev/tty*` to `rc.local` and it prints straight after a reboot. When I close the lid of a netbook for a while and then try to print again, it doesn't want to, until I run a command `chmod 666 /dev/ttyUSB0`. How do I get this to recognize the command after hibernate without typing the command again?


title: Why restrict the number of inodes a user can access?

text: It appears that it is possible on a network mount to set a quota on how much space a user can consume.               # edquota ramesh          Disk quotas for user ramesh (uid 500):       Filesystem           blocks       soft       hard     inodes     soft     hard       /dev/sda3           1419352          0          0       1686        0        0      You also can set a soft and a hard limit on how many inodes a user has. Why would you ever need to limit how many inodes a user has access to? Wouldn't the user still be able to fill up the disk with 1 really large file?


title: Can I rely on binary packages (pkg) in FreeBSD

text: Since last October binary packages have been available for FreeBSD (http://lists.freebsd.org/pipermail/freebsd-pkg/2013-October/000107.html). Before that, they had some trouble, preventing binary packages from being published. At this moment, is there any reason not to rely on the binary packages mirrors? Is there any chance that a security breach would be found and the binary package disappearing again? For a new installation, does it still make sense to build things from the ports tree yourself, or is it stable enough to use only binary packages (provided you need everything with default compile flags)?


title: Why is it needed to erase the first MByte of an OpenBSD CRYPTO device?

text: from: http://www.openbsd.org/cgi-bin/man.cgi?query=bioctl               The following command, executed from the command line, would configure          the device softraid0 with one special device (/dev/sd2e) and an          encrypting volume:              # bioctl -c C -l /dev/sd2e softraid0               bioctl will ask for a passphrase, which will be needed to unlock the          encrypted disk.  After creating a newly encrypted disk, the first          megabyte of it should be zeroed, so tools like fdisk(8) or disklabel(8)          don't get confused by the random data that appears on the new disk.  This          can be done with the following command (assuming the new disk is sd3):              # dd if=/dev/zero of=/dev/rsd3c bs=1m count=1      **My question** : but exactly why is it needed to erase the first MByte of the CRYPTO device? Are there any disadvantages if I miss doing this?


title: What are the equivalent architecture of alphanumeric numbers in Debian?

text: On the Debian website, I found a list of the releases of Debian associate with alphanumerical architectures. Do you know to what those architectures numbers and letters stand for?   ![ss #1](http://i.stack.imgur.com/hQz8J.png)


title: What are the generic-pae directories in /lib/modules?

text: When listing the content of the dirctory `/lib/modules` I see a list of `generic-pae` directories (Ubuntu 12.04):               drwxr-xr-x 4 root root 4096 Apr 23  2012 3.2.0-23-generic-pae     drwxr-xr-x 5 root root 4096 Nov 20  2012 3.2.0-27-generic-pae     drwxr-xr-x 5 root root 4096 Nov 20  2012 3.2.0-29-generic-pae     drwxr-xr-x 5 root root 4096 Nov 20  2012 3.2.0-30-generic-pae     drwxr-xr-x 5 root root 4096 Nov 20  2012 3.2.0-31-generic-pae     drwxr-xr-x 5 root root 4096 May 16  2013 3.2.0-32-generic-pae     drwxr-xr-x 5 root root 4096 May 16  2013 3.2.0-33-generic-pae     drwxr-xr-x 5 root root 4096 May 16  2013 3.2.0-34-generic-pae     drwxr-xr-x 5 root root 4096 May 16  2013 3.2.0-35-generic-pae     drwxr-xr-x 5 root root 4096 May 16  2013 3.2.0-36-generic-pae     drwxr-xr-x 5 root root 4096 May 16  2013 3.2.0-37-generic-pae     drwxr-xr-x 5 root root 4096 May 16  2013 3.2.0-38-generic-pae     drwxr-xr-x 5 root root 4096 May 16  2013 3.2.0-39-generic-pae     drwxr-xr-x 5 root root 4096 May 16  2013 3.2.0-41-generic-pae     drwxr-xr-x 5 root root 4096 Jun 18 08:26 3.2.0-48-generic-pae     drwxr-xr-x 5 root root 4096 Oct  3 07:47 3.2.0-54-generic-pae      What are all of these directories? What is their content? Can I remove the ones with a lower number, because they take up quite a lot of space?


title: How is `vi` Aware of the Format of Configuration Files?

text: When I edit configuration files in `vi`, it seems like `vi` is aware of the syntax of the file. For example, `vi` will color tokens one way or another depending on whether its a key or a value. Furthermore, `vi` also seems to be aware of which values are valid keys. How does it do this? _Edit: Let me add that I'm running Ubuntu Server 12.04 LTS (Precise Pangolin)_


title: Segmentation fault (core dumped) when try to run iptables rhel6

text: Im currently trying to set up a mySQL replication and i dont have a /etc/sysconfig/iptables. So I tried to install it with yum install. It showed the following output.                 Installed Packages     Name        : iptables     Arch        : x86_64     Version     : 1.4.7     Release     : 11.el6     Size        : 836 k     Repo        : installed     From repo   : anaconda-RedHatEnterpriseLinux-201311111358.x86_64     Summary     : Tools for managing Linux kernel packet filtering capabilities     URL         : http://www.netfilter.org/     License     : GPLv2     Description : The iptables utility controls the network packet filtering code in                 : the Linux kernel. If you need to set up firewalls and/or IP                 : masquerading, you should install this package.          Available Packages     Name        : iptables     Arch        : i686     Version     : 1.4.7     Release     : 11.el6     Size        : 247 k     Repo        : rhel-x86_64-server-6     Summary     : Tools for managing Linux kernel packet filtering capabilities     License     : GPLv2     Description : The iptables utility controls the network packet filtering code in                 : the Linux kernel. If you need to set up firewalls and/or IP                 : masquerading, you should install this package.      So far so good but when I try to run iptables I get a _Segmentation fault_ Do I need a better hardware?               [root@wltwd1 sysconfig]# iptables     Segmentation fault (core dumped)      **This is my lscpu output:**               [root@wltwd1 sysconfig]# lscpu     Architecture:          x86_64     CPU op-mode(s):        32-bit, 64-bit     Byte Order:            Little Endian     CPU(s):                1     On-line CPU(s) list:   0     Thread(s) per core:    1     Core(s) per socket:    1     Socket(s):             1     NUMA node(s):          1     Vendor ID:             GenuineIntel     CPU family:            6     Model:                 47     Stepping:              2     CPU MHz:               1995.034     BogoMIPS:              3990.06     Hypervisor vendor:     VMware     Virtualization type:   full     L1d cache:             32K     L1i cache:             32K     L2 cache:              256K     L3 cache:              18432K     NUMA node0 CPU(s):     0


title: mpd to remote dlna

text: I currently use an `mpd` with 4 configured outputs, wired to speakers in the ceilings as home-made "multiroom" audio system. I would like to add wireless speakers, e.g. one like this. The question is: How can I tell `mpd` that there is an output which is in fact remote a dlna/upnp (even aiyplay would be fine) ip-device ? Is it possible at all ? **Edit 1:** I found a way, though through `pulseaudio` and not `dlna` (which could be a use for one of my `Raspberry Pi`s).


title: mdadm inconsistencies when run programmatically

text: ### Update #1: I just gave an extra layer of testing, writing a shell script (.sh, #!/bin/bash) and a php script to be executed by php's cli. Bash works. It seems that it's not the Apache's HTTP context, but PHP itself that is causing the problems. Because a simple `php raider.php` run from root's shell has the same 2 problems mentioned originally. * * * I am building an appliance that has an WebOS on top of. WebOS is being hosted with Apache running as `http:http`. Since WebOS needs access to OS (root), sudoers are set up - to allow `http` ALL with NOPASSWD. Please don't educate about processes being run as root - the environment is controlled, and has been working for 2 years now with over 40 units shipped and no problems reported. Commands are run by `php` (mod_php5 for Apache) with `proc_open` from a HTTP request context. Every command seems to be working fine, except for `mdadm --create`. When I attempt to create an array there are random outcomes depending on the RAID level I have chosen to make. Previously I've had a namespacing problem, but that's not the case anymore. The problem started to appear after some OS updates (don't know when exactly, this is the old version of the WebOS that isn't working and had to be brought up as of recent and, apparently, needs to be fixed - there is also a new version which works ok (it has a different command execution cycle)). I am using `mdadm_udev` initramfs hook to assemble RAID's upon start. I have left `/etc/mdadm.conf` empty, because `mdadm_udev` seems to assemble the RAID's properly based on their metadata. The only catch, though, is that when it assembles them, it names the raid based on `<hostname>:<raidname>`. Due to the catch above, I am using `mdadm --create /dev/md/<hostname>:stoneshare ...`, which seems to be running fine from CLI no matter what's the user (non-root users run as sudo and succeed), the problems come when ran through HTTP context. ### Scenario #1, RAID0:               <?php          $command = sprintf('sudo mdadm --create /dev/md/%s:stoneshare --level 0 --raid-devices 2 /dev/sdb1 /dev/sdc1');     proc_open($command, /* ... */, /* ... */);      RAID gets created, but, where CLI makes the RAID on `/dev/md127` and symlinks to `/dev/md/<hostname>:<sharename>`, by running the above script, I end up with `/dev/md127` with no link:               [root@stone ~]# mdadm --detail --scan     ARRAY /dev/md127 metadata=1.2 name=stone:stoneshare UUID=7329e458:96be442a:84f616d8:fd4ba42e          [root@stone ~]# ls -la /dev/md*     brw-rw---- 1 root disk 9, 127 Jul 30 11:48 /dev/md127      ### Scenario #2, RAID1:               <?php          $command = sprintf('sudo mdadm --create /dev/md/%s:stoneshare --level 1 --assume-clean --raid-devices 2 /dev/sdb1 /dev/sdc1');     proc_open($command, /* ... */, /* ... */);      Check:               [root@stone ~]# mdadm --detail --scan     ARRAY /dev/md/stone:stoneshare metadata=1.2 name=stone:stoneshare UUID=7329e458:96be442a:84f616d8:fd4ba42e          [root@stone ~]# ls -la /dev/md*     brw-rw---- 1 root disk 9, 127 Jul 30 11:48 /dev/md127          /dev/md:     total 0     drwxr-xr-x  2 root root   60 Jul 30 12:17 .     drwxr-xr-x 19 root root 3080 Jul 30 12:17 ..     lrwxrwxrwx  1 root root   10 Jul 30 12:17 stone:stoneshare -> /dev/md127      Weirdly, but the symlink is created, there is a different problem though - upon RAID's creation, randomly either `/dev/sdb1` or `/dev/sdc1` is automatically marked as faulty. The RAID gets created and started, but is running with 1 drive. Sometimes neither of the drives is marked faulty and RAID is created with no problems at all. I have handpicked, what I found as relevant information for the device failure:               [root@stone ~]# journalctl -xb     Jul 30 11:39:43 stone kernel: md: bind<sdb1>     Jul 30 11:39:43 stone kernel: md: bind<sdc1>     Jul 30 11:39:43 stone kernel: md/raid1:md127: active with 2 out of 2 mirrors     Jul 30 11:39:43 stone kernel: created bitmap (8 pages) for device md127     Jul 30 11:39:43 stone kernel: md127: bitmap initialized from disk: read 1 pages, set 14903 of 14903 bits     Jul 30 11:39:43 stone kernel: md127: detected capacity change from 0 to 1000068874240     Jul 30 11:39:43 stone kernel:  md127: unknown partition table     Jul 30 11:39:43 stone systemd[1]: Starting MD array monitor...     Jul 30 11:39:43 stone systemd[1]: About to execute: /usr/lib/systemd/scripts/mdadm_env.sh     Jul 30 11:39:43 stone systemd[1]: Forked /usr/lib/systemd/scripts/mdadm_env.sh as 457     Jul 30 11:39:43 stone systemd[1]: mdmonitor.service changed failed -> start-pre     Jul 30 11:39:43 stone systemd[457]: Executing: /usr/lib/systemd/scripts/mdadm_env.sh     Jul 30 11:39:43 stone systemd[457]: Failed at step EXEC spawning /usr/lib/systemd/scripts/mdadm_env.sh: No such file or directory     Jul 30 11:39:43 stone systemd[1]: Received SIGCHLD from PID 457 ((m_env.sh)).     Jul 30 11:39:43 stone systemd[1]: Child 457 ((m_env.sh)) died (code=exited, status=203/EXEC)     Jul 30 11:39:43 stone systemd[1]: Child 457 belongs to mdmonitor.service     Jul 30 11:39:43 stone systemd[1]: mdmonitor.service: control process exited, code=exited status=203     Jul 30 11:39:43 stone systemd[1]: mdmonitor.service got final SIGCHLD for state start-pre     Jul 30 11:39:43 stone systemd[1]: About to execute: /sbin/mdadm --monitor $MDADM_MONITOR_ARGS     Jul 30 11:39:43 stone systemd[1]: Forked /sbin/mdadm as 460     Jul 30 11:39:43 stone systemd[1]: mdmonitor.service changed start-pre -> running     Jul 30 11:39:43 stone systemd[1]: Job mdmonitor.service/start finished, result=done     Jul 30 11:39:43 stone systemd[1]: Started MD array monitor.     Jul 30 11:39:43 stone kernel: md: md127 still in use.     Jul 30 11:39:43 stone kernel: md/raid1:md127: Disk failure on sdb1, disabling device.                                   md/raid1:md127: Operation continuing on 1 devices.     Jul 30 11:39:43 stone mdadm[460]: mdadm: No mail address or alert command - not monitoring.     Jul 30 11:39:43 stone systemd[460]: Executing: /sbin/mdadm --monitor --scan     Jul 30 11:39:43 stone systemd[1]: Received SIGCHLD from PID 460 (mdadm).     Jul 30 11:39:43 stone systemd[1]: Child 460 (mdadm) died (code=exited, status=1/FAILURE)     Jul 30 11:39:43 stone systemd[1]: Child 460 belongs to mdmonitor.service     Jul 30 11:39:43 stone systemd[1]: mdmonitor.service: main process exited, code=exited, status=1/FAILURE     Jul 30 11:39:43 stone systemd[1]: mdmonitor.service changed running -> failed     Jul 30 11:39:43 stone systemd[1]: Unit mdmonitor.service entered failed state.     Jul 30 11:39:43 stone systemd[1]: mdmonitor.service: cgroup is empty     Jul 30 11:39:43 stone kernel: RAID1 conf printout:     Jul 30 11:39:43 stone kernel:  --- wd:1 rd:2     Jul 30 11:39:43 stone kernel:  disk 0, wo:1, o:0, dev:sdb1     Jul 30 11:39:43 stone kernel:  disk 1, wo:0, o:1, dev:sdc1     Jul 30 11:39:43 stone systemd[1]: Got disconnect on private connection.     Jul 30 11:39:43 stone kernel: RAID1 conf printout:     Jul 30 11:39:43 stone kernel:  --- wd:1 rd:2     Jul 30 11:39:43 stone kernel:  disk 1, wo:0, o:1, dev:sdc1     Jul 30 11:39:43 stone kernel: md: unbind<sdb1>     Jul 30 11:39:43 stone kernel: md: export_rdev(sdb1)      Thought, I doubt that `mdmonitor` is essential for creating the RAID. * * * Both RAID's are perfectly assembled when ran from CLI, no problems encountered. Drives, per S.M.A.R.T. are healthy. The UUID's in reality are not equal, I just made the examples up out of a single RAID. * * * What am I doing wrong here, that is causing such inconsistencies?


title: Gtk theme won't apply in Fluxbox

text: I installed my Arch Linux with Gnome 3 and Fluxbox on top of it, and I use Fluxbox as the default, but I have this weird problem that I can't manage to fix. I set my theme for Fluxbox and that is working perfectly. I set the gtk2 theme and it is not working (well partially I right click in Chromium and I see the styling). However, when I open nautilus or gnome-terminal, or any other window that uses gtk for styling doesn't apply. Here is the screenshot (notice in the third picture, the menu looks like an X WM menu): ![styling doesn't apply : nautilus; terminal](http://i.stack.imgur.com/DSm7i.png) ![see the menu line where file, edit... can be found and also notice the button near the home button](http://i.stack.imgur.com/q0ERF.png) ![Screenshot of the unstyled menu](http://i.stack.imgur.com/2tsOq.png) I tried that in my gnome session and it works without a problem (in fallback mode). I tried one of those gtk-theme changer and it says that the theme, that i want, is set but it is only seen in chromium. It is all grey and old (Like win98 :D) **Note : I tried to run gnome-settings-daemon in my terminal and it says "command not found" but when i check this package with pacman : it says [installed]** ![enter image description here](http://i.stack.imgur.com/8l8Du.png)


title: How do I execute in background / return early?

text: For reference, I'm using `phpseclib` to control a remote SSH server using the 'root' account. I have to start/stop a java process which is ran in the background. Stopping works fine with `killall java` and this is all I need for now, although when I run the server, I'm using:               (cd ./serv/; nohup java -classpath bin:deps/poi.jar:deps/netty.jar:deps/mysql.jar:deps/slf4j.jar:deps/slf4j-nop.jar:deps/jython.jar:log4j-1.2.15.jar: server.Server &)      As you can see, I am using the & operator for the second command inside the brackets. The command would execute correctly though the page would keep loading waiting for a return value/exit code? And it would eventually use up all the memory on my webhost. The answer was that you need to manually direct the output of nohup: Edit: Answer!!               (cd ./serv/; java -classpath bin:deps/poi.jar:deps/netty.jar:deps/mysql.jar:deps/slf4j.jar:deps/slf4j-nop.jar:deps/jython.jar:log4j-1.2.15.jar: server.Server >/tmp/test.out 2>&1 &)      Thanks to Mikeserv for the help.


title: Fixing Lilo with uefi system and no optical drive

text: Recently I have been trying to boot into Slackware on a new laptop that came pre-installed with Windows 8. I have successfully installed Slackware and Lilo, but I have had great difficulty trying to boot into it as the laptop contains no optical drive. I have been attempting to boot into various systems I have on other USB drives. The only fully successful boot came from tinycore, and that is a pain to install grub (or any bootloader) from. My current situation is trying to get it to boot using EasyBCD, and I can get to the (Windows) boot menu and select the created Slackware option, but after that it shows a windows MBR error. Where would you recommend I go from here? Any help is appreciated.


By the error I can't install any packages. And also I can't update to the latest version. I don't know what to do now. Any help much appreciated. > Error: requested datatype primary not available ### OS Info   * Operating System: Fedora 18   * Architecture: X86_64 From the internet I've tried the following commands to rebuild the repository. But I'm still getting the same error. ### Commands run               # yum clean all     # rpm rebuilddb     # yum grouplist or yum list      ### More Info The following are my Repo files:               adobe-linux-x86_64.repo     epel.repo     fedora.repo     fedora-updates.repo     fedora-updates-testing.repo     livna.repo     mysql-community.repo     mysql-community-source.repo     pgdg-92-fedora.repo     rpmfusion-free-rawhide.repo     rpmfusion-free.repo     rpmfusion-free-updates.repo     rpmfusion-free-updates-testing.repo     rpmfusion-nonfree-rawhide.repo     rpmfusion-nonfree.repo     rpmfusion-nonfree-updates.repo     rpmfusion-nonfree-updates-testing.repo


title: openssl-1.0.1e compiling on Debian

text: I am compiling OpenSSL-1.0.1e on Debian Lenny (armv4 architecture). I have been following the instruction on http://www.linuxfromscratch.org/blfs/view/svn/postlfs/openssl.html to compile the source code. `make` and `make test` are successfully completed. I wonder how I should continue the compiling the file. Should I do `make install` or stick to the instruction and do               make MANDIR=/usr/share/man MANSUFFIX=ssl install &&     install -dv -m755 /usr/share/doc/openssl-1.0.1e  &&     cp -vfr doc/*     /usr/share/doc/openssl-1.0.1e      EDIT: I did both of the methods but I still have the old version of the openssl. do I need to copy the `openssl` binary and paste it to a specific directory (e.g., `/usr/bin`) to replace the new binary with the old one? How do I suppose to update the program? EDIT2: `make test` output: ALL TESTS SUCCESSFUL.               make[1]: Leaving directory `/home/openssl-1.0.1e/test'     OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a     OpenSSL 1.0.1e 11 Feb 2013     built on: Mon Jun 10 05:08:05 UTC 2013     platform: dist     options:  bn(32,32) rc4(ptr,int) des(idx,cisc,2,long) idea(int) blowfish(idx)      compiler: cc -O     OPENSSLDIR: "/usr/local/ssl"      `make install` output:               make[1]: Leaving directory `/home/openssl-1.0.1e/engines'     making install in apps...     make[1]: Entering directory `/home/openssl-1.0.1e/apps'     installing openssl     installing CA.sh     installing CA.pl     installing tsget     make[1]: Leaving directory `/home/openssl-1.0.1e/apps'     making install in test...     make[1]: Entering directory `/home/openssl-1.0.1e/test'     make[1]: Nothing to be done for `install'.     make[1]: Leaving directory `/home/openssl-1.0.1e/test'     making install in tools...     make[1]: Entering directory `/home/openssl-1.0.1e/tools'     make[1]: Leaving directory `/home/openssl-1.0.1e/tools'     installing libcrypto.a     installing libssl.a     cp libcrypto.pc /usr/local/ssl/lib/pkgconfig     chmod 644 /usr/local/ssl/lib/pkgconfig/libcrypto.pc     cp libssl.pc /usr/local/ssl/lib/pkgconfig     chmod 644 /usr/local/ssl/lib/pkgconfig/libssl.pc     cp openssl.pc /usr/local/ssl/lib/pkgconfig     chmod 644 /usr/local/ssl/lib/pkgconfig/openssl.pc


title: How to create a bootable Linux installation USB from an ISO in OS X?

text: I downloaded the ISO for Debian's net installation to a computer running OS X. I want to put the data from the ISO onto a USB, so that I can install Debian on another laptop (not an Apple laptop). That laptop currently has no system installed, so I must prepare the USB drive on the OS X computer. First, I tried installing UNetbootin on the OS X computer. When this bootable USB didn't boot, I found a bug report here suggesting that, although UNetbootin lists a version for OS X, it is actually not able to create bootable USBs. Next, I tried the instructions at DebianEeePC How-to:               dd if=debian-7.*-netinst.iso of=/dev/disk1s1      This took about 10 minutes, reported no errors, but the USB still is unbootable.   * In the past, USBs created with UNetbootin on Windows, and using the `dd` method in Linux worked successfully, but at this present time, only have OS X available to me. How can I create a bootable Linux installation USB from an ISO in OS X?


title: Command "I'm" on linux ubuntu

text: I'm new at linux, ubuntu, and I did type `I'm running` and then like if it was a program or something else, I was allowed to write more... nothing else... I just want to know more about this command or program. thank ya all.


title: Network file-sharing between Linux and Android

text: I want to share the contents of my external HDD with my Android phone. For the last two hours, I've been trying to correctly set up Samba - it was absolutely horrible. There must be another, simpler way to set up file sharing over a (W)LAN, because learning 200 new shell commands in a hostile and unknown environment definitely isn't something I want to waste my time on. Is something as FTP my solution?


title: Access Windows Share from local linux machine through remote ssh server

text: as you can read from the title, this question might sound tricky, but I believe it is feasible. I work from my Ubuntu laptop. I need to access a Windows share that is accessible only from within my university's LAN. But, I can ssh to a remote server which is right there in univ's LAN. I believe there must be a way to hop from my laptop to the remote server to the Windows share, but apparently I can't make it work. I tried to ssh the remote machine, and access the windows share with `smbclient`               smbclient //the.windows.share/my_group_share -U username      with NO success (got a `NT_STATUS_BAD_NETWORK_NAME` error ). I've searched and read on the web and found some solutions using VPN over SSH tunneling, but I'm not sure it fits for my needs. besides, a first attempt did not work, couldn't even connect. can somebody point me to a solution?


title: Ubuntu cannot start from terminal

text: Ubuntu 12.04 By a mistake, I stopped lightdm. Then switched to tty1, and rebooted. Now, After startup, It just came a black screen with a cursor, can type nothing. I tried `Ctrl`+`F1` to `F12` (and `Ctrl`+`Alt`+`F1` to `F12`), nothing works. There might be something wrong with X server (Because I cannot type in, there is no way to try `startx`)


title: capture output from command without interference

text: How can I test whether a command's output is an empty string without interfering with said output? Example:               command | ???     if [ $? = 0 ] && [ -n "$output_from_command"]; then        ...      I'd like that the output from the code above be the same as when running `command`.


title: dd primary partition slow transfer rate

text: Can someone explain me why if backup ,using `dd`, a primary partition to a primary partition on other disk the transfer rate (MB/s) is significantly slower compared to the the rate I have if the destination is a logical partition. Let's say that I have two disk `sda` and `sdb` and I want to backup `sda1` a primary partion of `sda`, on `sdb`. I create a new partition on `sdb` that has the same size of `sda1`. If the partion on sdb is primary When I run               dd  if=/dev/sda1 of=/dev/sdb1       the speed is 20 MB/s but if I launch using a logical partition as destination               dd if=/dev/sda1 of=/dev/sdb5      the speed is 3 MB/s. To copy at the same speed I need to set the `BS=4MB` . I run the test more the one time also after rebooting the machine.


title: Ubuntu 12.04 resolver setup

text: When investigating how the DNS setup of my os (Ubuntu 12.04) works, I came to some questions I could not really find on the web. So what I observed was, that ubuntu uses Dnsmasq as a DNS resolver. When loooking into /etc/resolv.con, 127.0.1.1 is listed as nameserver. So the question here is, if Dnsmasq is just used as a resolver and the resolver normally looks into /etc/resolv.conf to get the IP of the nameserver, how does this make sense? It would only make sense if Dnsmasq was used as a local DNS server, meaning that the actual OS's resolver would send all DNS queries to the local Dnsmasq listening on port 53.


title: LXC with both GUI apps and snapshots on unmodified Fedora kernel

text: I am looking for a tool or library to run LXC that supports:   * running X applications   * conveniently snapshotting root filesystems (using a Fedora system with an unmodified kernel), so that I don't have to use lots of disk/SSD space for each root filesystem. I don't care about security. The upstream `lxc` tools support snapshots using btrfs, but I don't think they support running X applications. I'm not sure if libvirt supports Btrfs snapshots yet for LXC - there has been some discussion of it. `virtenv` supports snapshots, but requires overlayfs, which is not in Fedora. I don't think Docker supports X applications. Correct me if I'm wrong on any of these...


title: Enabling 1366x768 resolution in Debian Wheezy on Atom D525 Board

text: For some reason, when I try to update to a modern version of Linux from Debian 6.0.7 or Ubuntu 10.0.4, I lose most of the resolutions that were available, including the native resolution of the panel I'm trying to run (1366x768). This is on an embedded Atom D525-based board that uses the GMA3150 intel integrated graphics (I think this CPU/Chipset is also used in some netbooks). Basically, everything works fine in either Debian 6.0.7 or Ubuntu 10.04. For reference, here is the relevant section of my Xorg.0.log file indicating that all the modes were detected on the LVDS1 output:               (II) intel(0): Printing probed modes for output LVDS1     (II) intel(0): Modeline "1366x768"x59.9   80.00  1366 1436 1577 1648  768 778 783 810 (48.5 kHz)     (II) intel(0): Modeline "1360x768"x59.8   84.75  1360 1432 1568 1776  768 771 781 798 -hsync +vsync (47.7 kHz)     (II) intel(0): Modeline "1360x768"x60.0   72.00  1360 1408 1440 1520  768 771 781 790 +hsync -vsync (47.4 kHz)     (II) intel(0): Modeline "1024x768"x85.0   94.50  1024 1072 1168 1376  768 769 772 808 +hsync +vsync (68.7 kHz)     (II) intel(0): Modeline "1024x768"x75.0   78.75  1024 1040 1136 1312  768 769 772 800 +hsync +vsync (60.0 kHz)     (II) intel(0): Modeline "1024x768"x70.1   75.00  1024 1048 1184 1328  768 771 777 806 -hsync -vsync (56.5 kHz)     (II) intel(0): Modeline "1024x768"x60.0   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync (48.4 kHz)     (II) intel(0): Modeline "1024x768"x87.0   44.90  1024 1032 1208 1264  768 768 776 817 interlace +hsync +vsync (35.5 kHz)     (II) intel(0): Modeline "832x624"x74.6   57.28  832 864 928 1152  624 625 628 667 -hsync -vsync (49.7 kHz)     (II) intel(0): Modeline "800x600"x85.1   56.30  800 832 896 1048  600 601 604 631 +hsync +vsync (53.7 kHz)     (II) intel(0): Modeline "800x600"x72.2   50.00  800 856 976 1040  600 637 643 666 +hsync +vsync (48.1 kHz)     (II) intel(0): Modeline "800x600"x75.0   49.50  800 816 896 1056  600 601 604 625 +hsync +vsync (46.9 kHz)     (II) intel(0): Modeline "800x600"x60.3   40.00  800 840 968 1056  600 601 605 628 +hsync +vsync (37.9 kHz)     (II) intel(0): Modeline "800x600"x56.2   36.00  800 824 896 1024  600 601 603 625 +hsync +vsync (35.2 kHz)     (II) intel(0): Modeline "640x480"x85.0   36.00  640 696 752 832  480 481 484 509 -hsync -vsync (43.3 kHz)     (II) intel(0): Modeline "640x480"x72.8   31.50  640 664 704 832  480 489 492 520 -hsync -vsync (37.9 kHz)     (II) intel(0): Modeline "640x480"x75.0   31.50  640 656 720 840  480 481 484 500 -hsync -vsync (37.5 kHz)     (II) intel(0): Modeline "640x480"x59.9   25.18  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz)     (II) intel(0): Modeline "720x400"x85.0   35.50  720 756 828 936  400 401 404 446 -hsync +vsync (37.9 kHz)     (II) intel(0): Modeline "640x400"x85.1   31.50  640 672 736 832  400 401 404 445 -hsync +vsync (37.9 kHz)     (II) intel(0): Modeline "640x350"x85.1   31.50  640 672 736 832  350 382 385 445 +hsync -vsync (37.9 kHz)      After upgrading to Debian 7.0.0 (wheezy), I no longer have most of these resolutions available. At startup, probing for modes looks like this in Xorg.0.log:               [    32.415] (II) intel(0): Printing probed modes for output LVDS1     [    32.415] (II) intel(0): Modeline "1024x768"x60.0   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync (48.4 kHz P)     [    32.415] (II) intel(0): Modeline "800x600"x60.3   40.00  800 840 968 1056  600 601 605 628 +hsync +vsync (37.9 kHz d)     [    32.415] (II) intel(0): Modeline "800x600"x56.2   36.00  800 824 896 1024  600 601 603 625 +hsync +vsync (35.2 kHz d)     [    32.415] (II) intel(0): Modeline "640x480"x59.9   25.18  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz d)      This isn't just a Debian issue either, since the exact same thing happens going from Ubuntu 10.04 to 12.04. Debian 6.0.7 includes version 2.13.0 of the intel graphics driver, while 7.0.0 includes version 2.19.0. Is it possible that there's a bug in the driver that causes these modes to not be detected, and if so, is it feasible to just run the old driver or would that break everything? Or has anyone else experienced a similar issue and found a work- around? Trying to manually set the modeline for 1366x768 in Debian 7 results in an error message as follows:               xrandr --newmode "1366x768_60" 80.0 1366 1436 1577 1648  768 778 783 810     xrandr --addmode LVDS1 1366x768_60     X Error of failed request:  BadMatch (invalid parameter attributes)        Major opcode of failed request:  140 (RANDR)        Minor opcode of failed request:  18 (RRAddOutputMode)        Serial number of failed request: 27        Current serial number in output stream:  28


title: mysqld dead but pid file exists

text: Webserver was running fine for weeks then suddenly:   1. I can access, but I am unable to log into Webmin   2. I can access Magento, a php-based storefront application, but I am no longer able to log in and it is throwing an exception error on the front end.   3. Proftpd service was stopped, but I was able to restart   4. Mysqld service was stopped and I have NOT been able to restart. When attempting to restart mysqlp I receive the following error: "mysqld dead but pid file exists". Any ideas on how I may resolve this matter? Please let me know if there is a specific log file you would need to see.


title: Git hanging while cloning source

text: I am cloning firmware source using `git clone` but during the operation my Internet connection went down. I immediately restored the connection, but now the git clone process is hanging. Can I kill this clone process and start it again? Since a lot of data has already been fetched, will the new `git clone` resume with the unfetched data? I don't want to lose my previously fetched data in the process of a new git clone.


title: How to show progress when loading initrd?

text: I have a complete root fs built into initrd, so it's almost 500MB. It takes a while to load to memory and during this time, the screen has no indication of the progress. I would like to know if there is a way show progress as initrd loaded to memory? (Such as PXE boot loading kernel will have '.' per 1MB.) I'm using GRUB Legacy, and I can patch the source if needed.


title: Acer Travelmate: what distro to choose?

text: No distro will work properly with my Acer TravelMate 5735. I have tried Ubuntu, Lubuntu, Backtrack, Mint, Fedora, Mageia. All of them at least had blank screen error, witch some of them I could temporary fix with nomodeset, some of them not. Mint wouldn't even load the GUI, and in Ubuntu, Wi-Fi was very slow. I understand similar graphics problems appeared only until something was changed. Has anyone had similar problems, what distro would you recommend?


title: how to add number of days to date's output?

text: I'd like something like:               $ date --date="05/02/2012" "+2 days"      would give me "4 may" as output.. how ?


title: CentOS how to update Ant Version to 1.8.x and higher?

text: I'm using CentOS v6.5 and installed `Ant` by using:               yum install ant      But it came with `Ant version 1.7.1`. And i need the latest `Ant version 1.8.0`.   * How to properly get the latest `Ant version 1.8.x` (or higher) from `YUM` or anyway please?


title: Change FreeBSD's fetch with aria2 or axel

text: FreeBSD uses `FETCH` command in order to download source codes or binary packages it needs to compile or install.   If you are on slow connection like café or shared band this process become painful. `FETCH` can't resume in most cases and fails so as the process trying to install or compile something. I want to know if it is possible to use `aria2` or `axel` instead of `fetch`.


title: How would you use the cpio command?

text: While studying for the lpic exam, I've run into the command `cpio`. The description of cpio states: > Cpio was originally designed to store backup file archives on a tape device > in a sequential, contiguous manner. Cpio does not compress any content, but > resulting archives are often compressed using gzip or other external > compressors. In looking at examples of how to use cpio, I can't find a single scenario where cpio would better than more common tools like `tar`. What is an example where using `cpio` would be used, (besides tape backups), or is it no longer relevant on todays systems?


title: How to modify source code of collection of programs of a GNU/Linux OS?

text: Basically the title says everything, Ubuntu/Fedora (to mention a few ones) is composed for several applications or programs dedicated each one to a specific task, but I've got a few questions:   1. How do I get the source code?   2. If I want to make my own GNU/Linux distro based on Ubuntu (such as Linux Mint), how should I start, which code can I modify at first?   3. Can you give an example of one of these programs (that composed Ubuntu) and its source code? How do I compile it?


title: SNMPV3 traps are not being captured correctly

text: I have configured master agent (`snmpd.conf`/`snmptrapd.conf`) of SNMPv5.5 on RHEL6.3 server to support SNMPV3 traps, but when I try to generate a snmptrap and capture the trace through `tcpdump`, I still see the traps are getting generated as V2C trap itself instead of showing up as V3 trap. What could cause this behaviour?


title: Weird "No such file" error with "xargs" and "file"

text: I'd like to get the MIME type of all files under the current directory. Why doesn't this work? I've tested bash on OSX or Linux. "file" complains that it can't find the file, but if I run it with the exact same path it works.               $ find . -type f | xargs -n 1 -I FILE echo $(file --mime-type -b FILE)     ERROR: cannot open './foo.txt' (No such file or directory)     ...     $ file --mime-type -b ./foo.txt     text/plain      Of course in the real world I don't just "echo" the response, I need to use the MIME type string in another command. This is the simplest I could make the problem. I guess I'm not understanding something about `xargs` filename substitution?


title: How do I know if a serial port is actually transmitting data, without opening the device?

text: I have a high-availability cluster (Heartbeat) connected via serial line and two ethernet NICs. I'd like to set up a monitoring script capable of recognizing disconnected serial line (basically the same question was answered at SO, however I am not satisfied with such a general answer). I cannot simply open the serial device and read the data myself, since the serial line is opened by Heartbeat. So I started to look for some indirect clues. The only difference I have found so far is in the contents of `/proc/tty/driver/serial`. This is how it looks like when it's connected:               # cat /proc/tty/driver/serial     serinfo:1.0 driver revision:     0: uart:16550A port:000003F8 irq:4 tx:2722759 rx:2718165 brk:1 RTS|CTS|DTR|DSR|CD      And when disconnected:               # cat /proc/tty/driver/serial     serinfo:1.0 driver revision:     0: uart:16550A port:000003F8 irq:4 tx:2725233 rx:2720703 brk:1 RTS|DTR      I'm not confident enough to decide that the signals listed at the end of the line have the very meaning of connected/disconnected cable as I have not found any documentation on the contents of the /proc/tty/driver/serial. I can only assume that the presence of the signal means the given signal is on "right now" (or was in recent past? or?). The Serial HOWTO says that additional signals present when the cable is connected (CTS flow control signal, DSR "I'm ready to communicate", CD "Modem connected to another") are all in the "input" direction. So there has to be somebody alive at the other end. Assuming that meaning of signals is as described in the Serial HOWTO, I can base my decision on the presence of, say CD signal. However I am not really sure. So the question is: _is my method "right", or do I have any better options I am not aware of?_ **EDIT:** I did some additional observations and had a talk with my colleague. Turns out the presence or absence of signals at the end of the line is quite good indicator of the serial port activity, on both ends. _However, it's not an indicator of physical presence of a cable._ Whenever there was a program writing to serial port outgoing signals were present (RTS|DTR). When the other side was writing incoming signals were present (CTS|DSR|CD). When none of the sides communicates there are no signals at all (that does not necessarily mean there is no cable present). Don't forget that the exact signals depend on the wiring of the cable (I have "null modem with partial handshaking").


title: IO utilization for /dev/null redirection?

text: I always use `nohup` to start my system. However, the output to `nohup` is so big that I'm thinking to redirect it to `/dev/null`. My concern is, will redirecting to `/dev/null` also incur some I/O operations like writing to a normal file? Or, should I go down to the code level and remove all those logging info? (But I might need them). My only concern is the I/O utilization & file size.


title: `expect`-like behaviour in bash script

text: I have a script (let's name it `parent.sh`) that calls some other scripts based on input parameters. Finally, it calls the script `child.sh`.   `child.sh` requests user's input in case it find that some files already exists:               "Would you like to replace the configuration file with a new one? (Yes/No/Abort): "      Now, what I want to do it to simulate the keystroke of **"Y"/"y"** inside the `parent.sh` script in order to always overwrite the files. I **cannot** use `expect`. How can I do that?


title: How do I upgrade OpenSSL?

text: According to these instructions: http://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI I need to use OpenSSL 0.9.8k or later (right now it's on 1.0.0c) to use name based virtual hosts in apache. Right now I have version 0.9.8e. I'm running CentOS with a 64 bit version of a Linux 2.6 build. I thought an upgrade like this would be simple but apparently it's not some package that rpm can install. Where should I start?


title: Best way of updating Openssl on Linux machine

text: I have a confusion to choose the best way for upgrading the OpenSSL on my Linux machine. **1* _Through the yum Update._ ***               # yum update      I know this will update the entire packages. But If I want to specifically update OpenSSL               Can I use # yum update OpenSSL      **2. Through the commands**               $ openssl version          $ wget http://www.openssl.org/source/openssl-1.0.0i.tar.gz          $ tar xzvf openssl-1.0.0i.tar.gz          $ cd openssl-1.0.0i          $ make clean          $ ./config --prefix=/usr/local --openssldir=/usr/local/openssl          $ make          $ make test          $ make install      Please suggest me the best approach. Thanks.


title: grep: invalid content of \{\}

text: Here's the command :               grep '\(2\)[[:digit:]]\{\1\}' numbers      What I want is to match exactly 2 digits after the digit '2', 3 digits if I change the digit '2' to '3' in my expression, 4 digits if ... I'm using back-referencing here but when I execute this command I have the following output :               grep: invalid content of \{\}      How could one change my expression ? **first solution :** _As serge answered :_               2[[:digit:]]\{1\}\|3[[:digit:]]\{2\}\|4[[:digit:]]\{3\}\|5[[:digit:]]\{4\}      That could actually work, but let's suppose I have `\\(34\\)` as the first sub-expression, I wish I could back-referencing that number so I don't have to implement the 34 cases (or more).


title: Huge page and performance improvemnt

text: How can using huge page improve performance? I have read that huge pages improve performance by reducing TLB lookups and reducing the size of the page table. Can someone tell me how this helps with performance? Is this like if I have an application that uses 4 pages of virtual memory (4*4kb=16kb) then each page is mapped directly to some physical memory location, but if we use huge pages of 16kb size then instead of mapping 4 pages it just needs to map one, thus reducing page table size, and chances of swapping this out to disk is less and hence longer TLB cache?


title: Command line printing with a Samba printer requiring authentication

text: Is there a way to print to a Samba printer requiring authentication by providing the credentials on the command line (e.g., with `lpr`)? I managed to store the credentials in GNOME Keyring and when I am logged with a desktop session I can print with `lpr`. Is there a way to either:   * supply the credentials to `lpr`   * authenticate the jobs in the queue when logging in remotely (SSH)? **Edit** I know that it is possible to store a set of credentials for all the users (directly in CUPS in the printer URI), but we need each user to authenticate with his/her own credentials.


title: Can anyone help me diagnose this crash output?

text: I've been using Linux Mint MATE edition for a while and suffering the odd freeze. Today, it switched to a terminal-style output and gave me some actual info before it died. I took a photo, see below (open it in a new tab to zoom in and read the text). ![enter image description here](http://i.stack.imgur.com/A1laZ.jpg) The only "lead" i can see is a line that says               BUG: scheduling while atomic: swapper/0/0/0x10010000      but, for all i know i'm only seeing the bottom of the stack trace here and the actual problem is much further up. Questions: a) can anyone see if there's anything in the photo that gives a clue as to what's going wrong? b) is the stuff in this trace liable to be in a log file somewhere so i can have a proper look at it?


title: Is there any disadvantage in using SSHFS instead of SSH alone?

text: I find it easier to use SSHFS to mount a remote file system on my local computer instead of plainly SSH'ing into the remote computer. This saves me from using all the complicated `scp` commmands for copy/paste. But on the internet, I find very few people talking about SSHFS. If SSHFS is more easier, then why isn't it more popular? Are there any disadvantages to it?


title: Configuring OpenSuSE's xinetd

text: I need to run approx, a package proxy for Debian / Ubuntu packages, on an OpenSuSE box. Until now, I converted the installation package from `.deb` to `.rpm` using `alien`. Installing the resulting `.rpm` gave me the `approx` binary in `/usr/sbin/approx`. Under Debian, `approx` is started using `inetd`. OpenSuSE seems to prefer `xinetd`. So, in YaST2's xinetd setup, I created a new entry using   * service name: "approx" (I also tried "9999", since I assume this is where the mapping from service names to port numbers takes place -- this name should match the port description in /etc/services, right?)   * type: `stream`   * protocol: `tcp`   * `nowait` option   * user: `root` and    * service: `/usr/sbin/approx`.  However, no matter what status I assign the entry, the xinetd configuration jumps to "deactivated" as soon as I click "OK", and I can't get any reaction from the system when contacting it on port 9999. So, at first, is my use of the xinetd configuration correct or do I understand something wrong there? Second, is the automatic deactivation of the xinetd config panel in YaST2 a software or user error?


title: Image viewer for multiple images

text: Is there any image viewer (like eog) for linux which can do the following: Show 2 (3 or 4) images of a directory with maximal possible sizes on one page at the same time. When I click "next", it should show me the next 2 (3 or 4) images of that directory and so on.


title: Why doesn't uname -a return a useful identifier

text: I typed the command `uname -a` into my college's server and got this:               2.6.18-274.3.1.el5 #1 SMP Tue Sep 6 20:14:03 EDT 2011 i686 i686 i386 GNU/Linux      Are they trying to hide the version of Linux that the server is running on? Or is the kernel that its showing mean that they aren't? Because when I type `uname -a` on my Linux box it shows I'm running Ubuntu. I'm just trying to figure if that's something they would want to keep secret for security reasons.


title: Port Mirroring using iptables - copy all traffic among nginx on :80 and apache on :8080

text: I have nginx running on port 80 and apache running on port 8080 I want to transfer all the traffic to both nginx and apache asynchronously i.e the performance of one server wont be dependent on the others. The reason being nginx will serve my website and apache will be used to run analytics on the traffic. I tried the solution mentioned in the question below iptables port-mirroring               sudo iptables -A PREROUTING -t mangle -p tcp ! -s 127.0.0.1/32 --dport 80 -j TEE --gateway 127.0.0.1      and               sudo iptables -A POSTROUTING -t nat -p tcp -s 127.0.0.1/32 --dport 8080 -j SNAT --to 127.0.0.1:8080      The solution mentions using DNAT with POSTROUTING on NAT table but it is not allowed to do that. DNAT is only allowed on PREROUTING/OUTPUT. I am using iptables v1.4.10 on ubuntu 11.04


title: Grep huge number of patterns from huge file

text: I have a file that's growing about 200,000 lines a day, and it is all formed with blocks of three lines as such:               1358726575123       # key         Joseph Brunner  # name         carpenter       # job     9973834728345         Andres Smith         student     7836472098652         Mariah Anthony         dentist      Now, I have another file from which I extract about 10,000 key patterns, such as `1358726575123`. Then I run a `for` loop with these patterns and have to check them against the first file. If the file doesn't contain such pattern, I save the pattern in a third file for further processing:               for number in $(grep -o '[0-9]\{12\}' file2); do  # finds about 10.000 keys          if ! grep -q ^$number$ file1; then           # file1 is a huge file              printf "$number\n" >>file3               # we'll process file3 later          fi     done      The example code greps a huge file 10,000 times, and I run this loop about **once a minute, during the whole day**. Since the huge file keeps growing, what can I do to make all this faster and save some CPU? I wonder whether sorting the file somehow by its key (if so, how?) or using a db instead of plain text would help...


title: How do I find installed packages that have no install candidate?

text: I'd like to retrieve a list of installed packages that have no install candidate (e.g., because I removed an apt source file entry). How would I do that on Debian-based systems?


title: filesystem for archiving

text: I have some complex read-only data in my file system. It contains thousands of snapshots of certain revisions of a svn repository, and the output of regression tests. Identical files between snapshots are already de-duplicated using hard links. This way, the storage capacity doesn't need to be large, but it still consumes a lot of inodes, and this makes fsck painfully long for my main file system. I'd like to move these data to another file system, so that it doesn't affect the main file system too much. Do you have suggestions? Squashfs seems to be a possible choice, but I'll have to check if it can handle hard links efficiently.


title: Fatal: Module ndiswrapper not found

text: Getting the following error message: > Fatal: Module ndiswrapper not found Problem is I did install the `ndiswrapper` module. I even uninstalled and re- installed it. Still nothing. Any reason? On Linux Mint 14 My network controller is a Realtek Semiconductor Co., Ltd. RTL8188CE and something about (rev 01) It is using module rtl8192ce. Not sure if it should be using _common or not.


title: add directory to shell profile

text: > **Possible Duplicate:**   >  How can I make a program executable from everywhere So, I'm new to Linux/Unix and am working in a corporate version of Red Hat at my company. Obviously I don't have full control over my computer (not sure if that matters). I have a bunch of executables located in some folder. I want to be able to run these programs from any other directory. How can I make this happen? Some sort of bash profile file maybe? If so, where would that be located?


title: Non-blocking buffered named pipe?

text: I'm looking for something I suspect doesn't exist: A non-blocking buffered named pipe (fifo) for use from the command line. Is there such a thing? Here's the use case: Suppose I have a process that's going to run a long time in the background and spew a lot of output to `stdout`. I don't really care about the output and don't want to store it (perhaps I don't have enough room to), but I'd like to "drop in" periodically and follow what it's doing, then drop out again and leave it to do its work. So I'd like to redirect its output to this theoretical buffered, non-blocking named pipe and then periodically tap into it. So basically I want to start like this (`10M` being the size of the buffer):               mkmagicfifo magicfifo 10M     spewingprocess > magicfifo &      ...and periodically drop in to see what's going on...               tail -f magicfifo      ... _without_ `magicfifo` storing all the output (so, not a normal file), and _without_ it blocking the spewing process when it fills up and isn't tapped (so, not quite a normal named pipe). I don't think solutions involving `tail` or `prune` will do it (well, I can think of a workaround involving `tail`), because `tail` would still require that I store all the data somewhere (if I want to drop in and drop out of looking at it), and `prune` has to rewrite the file, presumably (I'll admit I haven't tried/proven this) breaking the redirection of the process generating all the output. I expect I could write some utility to do this, but *nix has _so many_ cool aspects of files and pipes and such, I just can't help but think this exists and I just don't know about it. So: Is there such a thing, and if so what is it?


title: VIM: Create a function to generate several lines of buffer

text: I have about ninety configuration files that I need to add an almost identical block of additional code to, with only two instances of a single word differing each time. I would very much like to repeat as little effort as possible. Is it possible, in VIM, to write a function that generates a block of text depending on an argument and either feeds it into the buffer or pastes it after the current cursor position? And if so, what documentation should I be looking into?


title: Is there a way to redirect a file that is written

text: I have an application which I can not change, that writes to a big 250 GB plain text file. After compressing with GZ it is only 30 GB. This application has no option of compressing it's output, and it can only write to a file name (not to stdout). Is there a way that I can set up for the output to be compressed immediately, without first storing the 250 GB file on my disk? I also need the other way around, to fool the application so that it reads a plaintext file which in reality is compressed.


title: All but MPlayer and VLC unable to play MP4 video?

text: I have a specific MP4 video file that plays fine in MPlayer and VLC, but other programs on my Arch Linux box (Banshee, Gnome's Movie Player) are unable to play it. Most seem to treat it as having zero length. It also causes Gnome's Properties dialog to just display a dialog saying "Creating Properties Window" and never load. What is it about this file that causes it to do this?


title: messed up bottom panel - Fedora 14 KDE

text: I just started using Fedora 14 KDE (installed it yesterday). I'm coming from Windows, and the bottom "panel" was very convenient in its similarity to the Windows taskbar. Unfortunately, I clicked an option, and now I removed the portion of the bar which has my currently open programs. I managed to get it back on the top of the screen, but I want it back at the bottom. Basically, all the small icons in the right are now over by the application launcher icon on the left. I have played around with adding widgets, but I couldn't figure anything out. I just want the way it was by default after installation. How do I get it back? Thank you!


title: vi - how to join differents specific lines

text: I'm looking for a solution about a "paste" problem on vi/vim . How to join specific lines in a text file? I have a file like this:               15/10/2011 Revolution day     16/10/2011 About Rome      - differents newspapers       blogs an feeds      :) hp     17/10/2011 Yep, another day      and I want to paste everyline that does not start with a number. I've tried something like this... but does not work :-/               :[!^[0-9]]!paste -d ' ' -s      Can somebody help me? thanks gb


title: Concatenate specific files into one single file

text: In a folder containing X files, I need to concatenate Y files (where X > Y) together into a single text file. I have the filenames (of Y files) that I need to concatenate. Can anyone please help me out on how to concatenate these files?


title: Fresh install of Fedora 20 on a VM, seamless mode seems to be broken

text: Previously when I installed Fedora, maybe 16 or so, in my VM and did seamless mode on my windows 7 box, I got the gnome 3 bar to show up at the top of my windows machine (so I could use it from windows). After a fresh reinstall I can't seem to replicate this behavior. I have installed the Virtualbox Guest Additions in my VM and enabled 3D acceleration, as well as giving it more video memory (64mb). Also, bonus points if someone can tell me why I now have a blue border (aka, the default fedora desktop background - I haven't changed it) around my seamless windows: ![enter image description here](http://i.stack.imgur.com/ddLON.jpg)


title: resolv.conf + PXE server + kickstart files

text: I use PXE server in order to download kickstart and to install Linux. After installation I saw that `/etc/resolv.conf` was created with the IP of the PXE server. Why there is PXE server IP address in `resolv.conf`?


title: sort every field numerically, varying field counts

text: I'm trying to sort some data using `sort`. I noticed it was sorting by digit rather than number, so I added the `-n` flag. It then seemingly only numerically sorts on the first field though. Breaking it down by field is a problem as the lines have varying numbers of fields (and, frankly, I cannot understand its behaviour). Here's some close-enough sample data I was playing with: `echo -e "b b 1\n23 44\nb 3\na 7\nb b 2\na 1\nb a 10\nb b 10\nb 1\nb a 1\n18 2\nb 10\n18 15\nb a 2\n23 9\nb 2" | sort -n`               Input     Want      Expect?   sort      -n        -n -k1,1 -k2,2 -k3,3 -k4,4…          b b 1     8 2       a 1       23 44     a 1       b a 1     23 44     8 15      a 7       23 9      a 7       b a 10     b 3       23 9      b a 1     8 15      b 1       b a 2     a 7       23 44     b a 2     8 2       b 10      b b 1     b b 2     a 1       b a 10    a 1       b 2       b b 10     a 1       a 7       b b 1     a 7       b 3       b b 2     b a 10    b 1       b b 2     b 1       b a 1     a 1     b b 10    b 2       b b 10    b 10      b a 10    b 1     b 1       b 3       b 1       b 2       b a 2     b 2     b a 1     b 10      b 2       b 3       b b 1     b 3     8 2       b a 1     b 3       b a 1     b b 10    a 7     b 10      b a 2     b 10      b a 10    b b 2     b 10     8 15      b a 10    8 2       b a 2     8 15      8 2     b a 2     b b 1     8 15      b b 1     8 2       8 15     23 9      b b 2     23 9      b b 10    23 44     23 9     b 2       b b 10    23 44     b b 2     23 9      23 44      Ideally, I'd like to get it working on that very machine, which has GNU coreutils sort 5.93. I'd like to handle it with simple unix tools; I don't want to just hand the problem to perl, etc. I'm hoping for an equivalent of the [imaginary] `sort --numeric-sort --all-fields --actually-work`


title: Can the nouveau Xorg driver be used for a multihead workstation?

text: I'm trying a manual setup of Xorg 1.9.5, for two identical monitors connected to the VGA and DVI ports of an nVidia GeForce 6600. I get the X Server to run using a single screen, and it appears identical on both monitors. Started with `Xorg -configure`, and have tried to use two screens with the same device, but only one is recognized. It automatically recognized the "modesetting" driver, through the nouveau module in the kernel. I had this working OK with Xorg 1.7.7 and similar hardware, using the nv driver and the "DualHead" and "DynamicTwinView" Device options. I don't find these options documented for nouveau and wonder if it is still possible to use it, as it loads by default into the kernel on my newer system (Slackware 13.37.0). If the kernel driver needs to be removed, I have the nv and nouveau X drivers available. Any recomendations on which to use for DualHead would be appreciated.


title: Full DD copy from hdd to hdd

text: **UPDATE: 2** This seems a lot better than before (Thanks to Groxxda for the suggestions): sudo dd if=/dev/sdb bs=128K | pv -s 3000G | sudo dd of=/dev/sdc bs=128K ETA is about 9 hours for 3TB, whereas before it reached 430GB after 6 hours, so I am guessing it would have taken about 36 hours using the command below... * * * **UPDATE: 1** I can now see the progress, and it's been 6+ hours for copy 430GB. The HDD is 3TB... Is there no faster way of doing this? * * * **ORIGINAL QUESTION:** If I have 2 identical hard drives with the following characteristics:   * SATA 6.0 Gb/s   * 5400 rpm   * 3TB How long should a full dd copy take to complete? So far it's been running for 5 hours and still going... I am using Linux Ubuntu 12.04 64bit and the command I am using is:               dd if=/dev/sdb of=/dev/sdc


What is the difference in "yum search" and "yum search all"?


title: Why 32 bit OS has less requirement when compared to 64 bit

text: In my Organization for routing we are using 32 bit os rather than using 64 bit os on a host with 3GB RAM. Since 64 bit faster than 32 bit why do sometimes people use 32 bit OS rather than 64 bit. Does 32 bit OS require less resource than 64 bit. Also on 64 bit OS,is the size of page table entry 64 bit?


title: Installing openssh-server after Rescue Disk boot

text: I tried to help a friend with hard drive boot problems. I first asked her to make a rescue disk (Ubuntu 12.04.3), and boot from it. Then I asked her to open a console (`Alt`+`F1`) and use `sudo` to become root. All OK. Then I told her to install `openssh-server` - so I can remotely login and look at the system - but that does not work: openssh-client (and some other applications) are reported as "not going to be installed". But openssh-client is already installed: checking with `dpkg -l openssh- client` shows this to be the case. Why doesn't this work?


title: OpenSSL Package Rebuild CentOS 6.4

text: **Rebuilding openssl with Elliptic Curves on CentOS 6.4** The strategy is:               1) Download the "official" CentOS source package (.src.rpm)     2) Modify the .spec file to enable elliptic curves. (change no-EC to enable-EC)     3) Rebuild the package using mock.       The build is performed on a fresh Amazon Cloud server which allows anyone to precisely duplicate every step that is taken below.               # 1. Log into AWS (Amazon Web Services) and create a public key.      # 2. Download your public key and install into your local client e.g. putty or ssh.     # 3. Instantiate a CentOS 6.4 machine using AWS marketplace for machine images. (free)     # 4. Log into your new Centos 6.4 using ssh or putty, update and install a few packages:      Update the newly installed Centos and install development tools               yum -y update  # Update all packages on a new machine     yum -y groupinstall 'Development tools'      Install mock, a super package builder, from the Fedora EPEL repository. Mock is the secret weapon of CentOS (and many other distros) package builders.               yum -y localinstall --nogpgcheck http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm # Install EPEL (EL6 extra packages) repository      yum -y install fedora-packager  # Install mock from EPEL repository      Make a new user "abcd" added to group "mock". User abcd will be used for package rebuilding. Note: group "mock" was automatically created by yum when we installed fedora-packager.               userdel -rf abcd ; useradd -G mock abcd ; su abcd      Fetch the latest CentOS openssl source package and "unpack" it with mock               cd ~ ; curl -O http://vault.centos.org/6.4/os/Source/SPackages/openssl-1.0.0-27.el6.src.rpm     /usr/bin/mock --rebuild ~/openssl-1.0.0-27.el6.src.rpm      We see output lines like this               # INFO: mock.py version 1.1.32 starting...     # Start: build setup for openssl-1.0.0-27.el6.src.rpm     # Start: rpmbuild -bb openssl-1.0.0-27.el6.src.rpm     # Start: Outputting list of installed packages      Finally, after a long time, we see               # INFO: Results and/or logs in: /var/lib/mock/epel-6-x86_64/result      Move the mock build results to a safe place               rm -rf /home/abcd/build ; mv /var/lib/mock/epel-6-x86_64/root/builddir/build/ /home/abcd ; # Move to a safe place      Download a replacement source file (.tar.gz) and a patch file from openssl.org               cd /home/abcd/build/SOURCES     curl -O http://www.openssl.org/source/openssl-1.0.0.tar.gz # Download corresponding source tarball from openssl     curl -o patch300.patch http://cvs.openssl.org/patchset?cn=19998 # Download this patch to fix a test error      Edit the openssl.spec file to               # 1. Enable elliptic curves (enable-EC)     # 2. Disable the hobble-openssl script (which erases EC files)     # 3. Update the release mumber to .EC.1     # 4. Include the newly downloaded .tar.bz as source     # 5. Include the newly downloaded patch file          cd ../SPECS     sed -i -e "s/no-ec/enable-ec/; s/no-ecdh/enable-ecdh/; s/no-ecdsa/enable-ecdsa/" openssl.spec # Enable EC     sed -i -e "s/^Source1: hobble-openssl/#&/; s/^%.SOURCE1. /#&/" openssl.spec # Disable the "hobble" script     sed -i -e "s/^Release.*dist\}/&.EC.1/" openssl.spec # Also change release number by adding .EC.1     sed -i -e "s/-usa.tar.bz2/.tar.gz/" openssl.spec # Change the source tarball     sed -i -e "s/^Patch78.*/&\nPatch300: patch300.patch\n/" openssl.spec # Add the new patch     sed -i -e "s/^%patch78.*/&\n%patch300 -p1 \n/" openssl.spec # Add the new patch again      Ceate a new source package using the edited ("enable-EC") openssl.spec               /usr/bin/mock --buildsrpm --spec  ~/build/SPECS/openssl.spec --sources  ~/build/SOURCES # Do a source rebuild      Use the new source package to create a new openssl package               cp /var/lib/mock/epel-6-x86_64/root/builddir/build/SRPMS/openssl-1.0.0-27.el6.EC.1.src.rpm /home/abcd     cd ~ ; /usr/bin/mock --rebuild openssl-1.0.0-27.el6.EC.1.src.rpm      Summarized here http://pastebin.centos.org/3070 Thanks to **pj** on Freenode for all the help.


title: How to back up VPS

text: "It is highly recommended in the event a system is compromised that a backup of the VPS be taken and an operating system be performed." I have no idea what they meant by second part either. How is this done on linux Centos 6.5 i686 i686 i386 GNU/Linux in terminal please?


title: Why ssh -nq -t can't see my environment variable?

text: I am executing a command on remote machine with -t flag ( to prevent the command from 'blocking' ) the prompt (somehow it works that way). So I am using `ssh -nq -t root@ip` but with this, the script cannot find my environment variable that I use. Why is this happening and how can I avoid this ?


title: Scrot command - how to save only thumbnail

text: I'm using `scrot` to take screenshots from terminal. However when I want to generate thumbnailed version using parameter `-t`, I got two files: `screenshot.png` and `screenshot-thumbnail.png`. How can I get only thumbnailed version - `screenshot-thumbnail.png` because I have no need for `screenshot.png`.


title: Process owned by root can't write files

text: I'm running a program (syslog-ng) that must read and write several files in a given path. It was failing at start, claiming that it is unable to open a file in that path. Please, assume this directory structure:               /var/platform/program      The `platform` directory has the permission set to 0655 (not execute permission to the owner user). If I change that permissions to 0755, syslog-ng works fine. On the other hand, I have written a small program in C that try to open and write into a file in the same directory, and it works without problem when running as root, but syslog-ng is failing... What can be the problem in this case?


title: Have ssh resolve hostnames from config when using ProxyCommand and netcat mode

text: I'm attempting to set up some universal options for bouncing ssh connections. Here is my `~/.ssh/config` file, abbreviated:               Host *%via       ProxyCommand ssh gateway -W $(echo %h | cut -d%% -f1) %p          Host gateway       HostName gateway.example.com       User username       ForwardAgent yes       IdentityFile keypathg          Host target       User username       HostName target.example.com       IdentityFile keypatht      When I utilise `*%via` utilising the `Host` aliases, I get:               % ssh -vvv target%via     OpenSSH_5.9p1, OpenSSL 0.9.8y 5 Feb 2013     debug1: Reading configuration data /Users/myuser/.ssh/config     debug1: /Users/myuser/.ssh/config line 5: Applying options for *     debug1: /Users/myuser/.ssh/config line 12: Applying options for *%via     debug1: Reading configuration data /etc/ssh_config     debug1: /etc/ssh_config line 20: Applying options for *     debug1: auto-mux: Trying existing master     debug1: Control socket "/Users/myuser/.ssh/tmp/target%via_22_myuser" does not exist     debug2: ssh_connect: needpriv 0     debug1: Executing proxy command: exec ssh -A gateway -W $(echo target%via | cut -d% -f1):22     debug1: permanently_drop_suid: 501     debug1: identity file /Users/myuser/.ssh/id_rsa type -1     debug1: identity file /Users/myuser/.ssh/id_rsa-cert type -1     debug1: identity file /Users/myuser/.ssh/id_dsa type -1     debug1: identity file /Users/myuser/.ssh/id_dsa-cert type -1     ssh_exchange_identification: Connection closed by remote host      However, if I utilise               % ssh target.example.com%via      I hit the target server, but as the wrong user and with no pubkey authentication. I _think_ my question, at this point, is does this method of bouncing, when utilising `ForwardAgent`, pass through my ssh config/environment whole, or just keys. If just keys, can the former be utilised in some way? My ssh version is 5.9v1, gateway is 5.9v1, and target is 5.3p1. I believe `-W` was introduced in 5.4, but that should not matter for the final box in line? utilising the older school `nc` seems no different. I have verified that I can manually ssh to each box in the line. Doing so indicates that hostname alias information is not passed, as when on gateway, I cannot `ssh target` but I can `ssh target.example.com`. This works with pubkey auth. gateway and target incidentally have the same username, which is why this works if no config is pushed. If `ForwardAgent` or similar config can't push this information, whats the sanest way to get around it, keeping a .ssh/config on gateway with this information?


title: wlan number assignment

text: How or where does Linux determine the assignment of a network device? Specifically, `wlan0` or `wlan1` for wireless USB devices. I plugged in a TP USB wireless a while ago, and it was assigned `wlan0`. I removed it. This week I plugged in an Edimax USB wireless device and it comes up as `wlan1`. I removed it today to try a second Edimax USB wireless device (I bought two) and now it comes up `wlan2`. I know enough of Unix/Linux to know this is being configured somewhere, and if I delete the unused config file I can make the latest Edimax become `wlan0`. But how/where?


title: Will I have to dist-upgrade from wheezy to Jessie?

text: I am running Debian testing (my sources.list is `deb http://ftp.us.debian.org/debian testing main` ). When Wheezy comes out (testing becomes stable), will `testing` automatically point to the new Jessie distro (so to update all I need to do is aptitude update && aptitude upgrade) or will I still need to dist-upgrade?


title: Making a recovery partition in embedded Linux

text: I have an Atmel SAM9X system running Angstrom. I am trying to make a recovery partition so when a user holds a button during boot up the recovery partition boots up. I have modified the bootstrap so when a button is held on boot up, an alternate linux kernel is loaded. What I want is the alternate kernel to load linux from the recovery boot partition not the normal main partition. Is this even possible? Or can I load the recovery partition without using two kernels? The reason I want this is so if the main bootable partition gets corrupted the recovery partition will copy itself to the main partition (similar to those Dell or HP windows machines with the recovery partition) and the main bootable partition will be restored. **Edit** :   Giles suggestion did it. The bootstrap was setting the kernel command line argument, I just added `root=/dev/mmcblk0p3` (boot from 3rd sd partition) to that and it booted from the desired partition!


title: Bad wifi with MacBook Air mid 2012

text: I have a MacBook Air mid 2012 with i7 CPU. The one with Ivy Bridge. I have connectivity problems with wifi running Arch Linux which I keep updated regularily. Throughput and response time performance decrease a lot when I move away from the AP (tried several networks with similar results). Strangely I don't experience the same issues with OS X. I have tried switching between Mountain Lion and Arch Linux while staying in the exact same position. OS X performs perfectly while Linux can't even ping the router. Are there any settings that I am missing? Should I use some particular driver? I have tried to read up on and fiddle with iwconfig. Any suggestions are welcome, I'm quite new at this level of Linux configuration. lspci gives me               02:00.0 Network controller: Broadcom Corporation BCM43224 802.11a/b/g/n (rev 01)      Trying to change power with iwconfig gives me:               -> % sudo iwconfig wlan0 power off     Error for wireless request "Set Power Management" (8B2C) :     SET failed on device wlan0 ; Operation not supported.      _**Addition:_** I installed the broadcom-wl driver. The connection seams to be a little bit more stable. But there is still a long way to go compared to OS X. lspci now reports               02:00.0 Network controller: Broadcom Corporation BCM43224 802.11a/b/g/n (rev 01)     Subsystem: Apple Inc. Device 00e9     Kernel driver in use: wl


title: GeeXbox ls shows no date?

text: Recently, I tried connecting to my GeeXbox via WinSCP but got an error indicating the output of `ls` could not be parsed. Apparently, my `ls` does not include a time stamp! What might be the cause and how can I correct that? See a sample output below:               $ ls -la     total 96     drwxrwxr-x   17 root     root          4096 .     drwxrwxr-x   17 root     root          4096 ..     lrwxrwxrwx    1 root     root             7 bin -> usr/bin     -rw-rw-r--    1 root     root         39779 config     drwxr-xr-x   13 root     root          3980 dev     drwxrwxr-x   29 root     root          4096 etc      My particular `ls --help` offers this:               $ ls --help     BusyBox v1.23.0.git (2014-05-19 13:33:13 IDT) multi-call binary.          Usage: ls [-1AaCxdlinshrSXv] [-w WIDTH] [FILE]...          List directory contents              -1      One column output         -a      Include entries which start with .         -A      Like -a, but exclude . and ..         -C      List by columns         -x      List by lines         -d      List directory entries instead of contents         -l      Long listing format         -i      List inode numbers         -n      List numeric UIDs and GIDs instead of names         -s      List allocated blocks         -h      List sizes in human readable format (1K 243M 2G)         -r      Sort in reverse order         -S      Sort by size         -X      Sort by extension         -v      Sort by version         -w N    Assume the terminal is N columns wide         --color[={always,never,auto}]   Control coloring