title: wget recursive for only files that pass a regexp

text: I would like to use wget recursively on an ftp directory like this: ftp://ftp.ensembl.org/pub/current_fasta/ Which contains another 2 directory levels inside, the first with the species name, and one inside with the name `dna`, like this: ftp://ftp.ensembl.org/pub/current_fasta/species_name/dna/ For example, one of them has the species_name `homo_sapiens`: ftp://ftp.ensembl.org/pub/current_fasta/homo_sapiens/dna/ Inside each `./dna/` directory, I would like to download only the file with the name containing the word `toplevel` but not the one containing the word `_rm.toplevel`. Finally, I would like a wget recursive command that would download all those from these directories, each as an output file with the name `species_name.fa.gz`, where the `species_name` is the name of the parent directory, just before `dna`. Any ideas?


title: Installing KDE on Ubuntu Natty from cdrom

text: Currently I have Ubuntu 11.04 - Natty, with Unity as the default environment; but I just want to install KDE along-side it, and I don't have perfect bandwidth. So I took Kubuntu 11.04 cdrom from my friend and inserted it to my cdrom. After running `apt-cdrom add` it prints out this:               Using CD-ROM mount point /media/apt/     Identifying.. [ce3c168e46b345c6adc05b209f603d08-2]     Scanning disc for index files..          E: Unable to stat the mount point /media/Kubuntu\04011.04\040amd64/ - stat (2: No such file or directory)     E: Unable to stat the mount point /media/Kubuntu\04011.04\040amd64/ - stat (2: No such file or directory)      I have tested the cdrom for the infections but it was just ok. What's the problem? UPDATE: my friend just asked me to put print my `fstab` entry here. as expected, my cdrom device is not listed in it but here it is:               # /etc/fstab: static file system information.     #     # Use 'blkid -o value -s UUID' to print the universally unique identifier     # for a device; this may be used with UUID= as a more robust way to name     # devices that works even if disks are added and removed. See fstab(5).     #     # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc            /proc           proc    nodev,noexec,nosuid 0       0     # / was on /dev/sda5 during installation     UUID=d8caef34-1670-4525-a5b5-df889f62aa1e /               ext4    errors=remount-ro 0       1     # /home was on /dev/sda7 during installation     UUID=7b71d3a8-bbea-477e-8b04-0c9651d0e12e /home           ext4    defaults        0       2     # /windows was on /dev/sda3 during installation     UUID=CC523DE8523DD7C2 /windows        ntfs    defaults,umask=007,gid=46 0       0     # swap was on /dev/sda6 during installation     UUID=3a281560-f3aa-4795-b396-0810e1eb15e2 none            swap    sw              0       0


title: Why does a new directory have a hard link count of 2 before anything is added to it?

text: Say I just create directory newDirectory and then I do ls -ld command. I see that the number of hard links is 2. What exactly makes the hard link 2 from the start? Also is the number of subdirectories in the current directory equal to the number of hard links - 2?


title: .bashrc execute command after "/bin/bash --login"

text: I have this alias in my .bashrc:               alias s='cd ~/Documents/projects/s && /bin/bash --login && rvm use ruby-1.9'      How can I execute the right part after it enters login shell (/bin/bash --login)?


title: Does git contain information about used id / group id changes?

text: I have googling awhile, but can not find such information. Looks like git doesn't contain users and groups, only permissions. Am I right?


title: Why $JAVA_HOME does not persist on a mac?

text: On my mac os 10.6.6 I'm trying to persist env variable $JAVA_HOME but it doesn't stick!               $ export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home      Once I restart it won't be set anymore. The GUI way to do that is to use the Property List Editor as documented by Apple and on SO. However, after a restart:               $ echo $JAVA_HOME          $


title: Bonds vs. Aggregators

text: I'm almost to the point where I can post the solution I wound up with for my complex port bonding question. However, in reading the bonding.txt file, I see this option text:               ad_select          Specifies the 802.3ad aggregation selection logic to use.  The possible values and their effects are:            stable or 0              The active aggregator is chosen by largest aggregate bandwidth.              Reselection of the active aggregator occurs only when all slaves of the active aggregator are down or the active aggregator has no slaves.              This is the default value.            bandwidth or 1              The active aggregator is chosen by largest aggregate bandwidth. Reselection occurs if:                 - A slave is added to or removed from the bond                - Any slave's link state changes                - Any slave's 802.3ad association state changes                - The bond's administrative state changes to up            count or 2              The active aggregator is chosen by the largest number of ports (slaves). Reselection occurs as described under the "bandwidth" setting, above.      The way this is written, I can't tell if a single bond can contain more than one aggregator, or not! If the bonding module is smart enough to sort out more than one aggregation within a bond, I'm golden! Let me simplify my drawing from over there:               ____________ eth1   ________   eth2 ____________     | switch 1 |========| host |--------| switch 2 |     ------------ eth3   --------        ------------      These switches do not do 802.3ad across switches. So, if I put all three interfaces into a single 802.3ad bond, do I get two aggregators? One containing eth1 & eth3, the other just holding eth2? Conceivably, the LACP signals between the host and the switches would be enough to do that. I just don't know if that capability is actually built in. Anyone? Anyone? Can I get two aggregators out of a single interface bond?


title: How can i get the process with the biggest pid?

text: How can I get the process with the biggest pid using `ps`?


title: 777'd some files. How do I repair SSH?

text: So I'm messing around on a test server and accidentally ran the following (which resulting in SSH breaking):               # chmod -R 777 /var      Because it's a test server, I'd rather not re-install right now, I have things I would like to test. I understand that `777` is very bad set of mode bits on a live server, and so I already understand that it would be a very bad thing to do on a server with anything valuable on it. Is there anyway to get SSH functioning again?


title: nc -l in background closes immediately (nc -l 1234 &)

text: When I put this               nc -l 12345 >nc_out      in a shell script, run it and then connect from other shell using telnet, it allows me to type some text and have it end up in _nc_out_. But if I start nc in the background (I want to start telnet from the same script later on):               nc -l 12345 >nc_out &      connection is closed immediately:               # telnet localhost 12345     Trying ::1...     telnet: connect to address ::1: Connection refused     Trying 127.0.0.1...     Connected to localhost.     Escape character is '^]'.     Connection closed by foreign host     #      leaving the nc_out file empty. Why is that? How can I make nc accept connection normally? * * * Notes:   * On RHEL and Fedora, both _nc_ and _nmap-ncat_ behave this way, but Debian's _nc-traditional_ does accept the connection and let me save the data to nc_out.   * It does not matter if I call telnet from the same script or different (SSH) session, the behavior is the same


title: Red Hat with rpc.statd is not running and can't start nfslock

text: I try to mount from Linux machine to some folder on a Windows machine. From the output I see that mount complains about `rpc.statd`. So I tried to start the `nfslock` but I got `FAILED`. Then I look on the `nfslock` script and I see that its failed on the command:                pidof -c -o 1949 -o 1626 -o %PPID -x rpc.statd      This command should return some process ID, but this command does not print any process ID. So how to start `nfslock`?                /etc/init.d]#  mount 10.15.22.21:/work11/AAPL /mnt           mount.nfs: rpc.statd is not running but is required for remote locking.      mount.nfs: Either use '-o nolock' to keep locks local, or start statd.      mount.nfs: an incorrect mount option was specified           /etc/init.d]# ./nfslock start      Starting NFS statd:                                        [FAILED]           /etc/init.d]#  pidof -c -o 1949 -o 1626 -o %PPID -x rpc.statd      /etc/init.d]# echo $?      1


title: Why does `exit &` not work?

text: I don't understand why `exit &` does not work. Why does it not?


title: VMware Player update filled up half of 27.5 GB disk. I need to find files and delete them

text: I installed VMware-Player-3.1.6-744570.i386 on Ubuntu 11.4. The 27.5 GB disk was about 45% full. I then used VMware-Player to form a virtual machine for Centos, using ISO files for CentOS-6.5-i386. I had done this on an old laptop, that also had Ubuntu 11.4 installed, and centos ran fine in the VM. However, in both cases, when I installed centos VMware-Player asked me if I wanted to install an update. It was taking too long on the old laptop, which tends to overheat so I declined to do so on the laptop. However, I decided to let the update run overnight on the desktop. When I came down in the morning, the update was still running and there was only 1.5 GB left on the HD. I used the disk usage analyzer and found that most of the disk space being used was in mu home directory. However, when I went to my home directory and ran               sudo du | sort -n      the only recently update directory with heavy disk usage was the directory with centos ISOs and it was only taking up 4.8 GB.


title: How to deduce the right target for a GCC cross-build?

text: I have a 32 bit x86 machine where Debian is up and running with this properties   * `uname -r` is `3.2.0-4-486` and    * `uname -m` is `i586` in this situation i have to pick the right `HOST` and `TARGET` prefix so I will be able to cross compile gcc on another machine for this Debian installation. I should pick `i486` or `i586` ? I already tried `i686` but apparently it doesn't work at all ( gcc compiles and runs, it's the gcc/g++ compiler that doesn't find the headers on the machine using the `i686` prefix ).


title: chkrootkit throws Signal 13 when searching through /var/tmp

text: On my debian squeeze server in the chkrootkit log I get loads of these errors:               /usr/bin/find: Prozeß "head" wurde durch das Signal 13 abgebrochen.     /usr/bin/find: Prozeß "head" wurde durch das Signal 13 abgebrochen.      which means               head terminated by signal 13      A google search gives a lot of same problems, but no solution. It comes from these lines in `/usr/sbin/chkrootkit`:               if [ `echo abc | head -n 1` = "abc" ]; then           fileshead="`${find} ${ROOTDIR}tmp ${ROOTDIR}var/tmp ${findargs} -type f -exec head -n 1 {} \; | $egrep '#!.*php' 2> /dev/null`"     else           fileshead="`${find} ${ROOTDIR}tmp ${ROOTDIR}var/tmp ${findargs} -type f -exec head -1 {} \; | grep '#!.*php' 2> /dev/null`"     fi      when I enter directly as root:               /usr/bin/find /var/tmp -type f -exec head -1 {} \; | grep php 2> /dev/null;date      I get the same errors. `egrep` instead makes no difference.


title: Local disc copy at 10MB/s! What could be the problem?

text: I am running a Debian 6.0.6 (before you ask). I have a regular desktop computer, nothing fancy... but when I copy a file using nautilus I am getting 10MB/s copy speed and the system is completely stuck! I did some reading and executed `hdparm -tT /dev/sda` with the following output:               /dev/sda:      Timing cached reads:   2428 MB in  2.00 seconds = 1214.07 MB/sec      Timing buffered disk reads: 274 MB in  3.01 seconds =  91.05 MB/sec      So in theory my dist is a lot faster, but in reality it is working very slow. Any ideas what could be the problem? or at least how to search for clues? More information:   * I've got 4GB of RAM, and I'm not running much except Chrome which seems to take half of my ram.    * I'm copying a file from the filesystem to the same filesystem in the same drive   * my filesystem is `ext3` **Update** I added results from running `iostat -kxdN 5` while copying to an external disk. In this case I get speeds of up to 20MB/sec, much better than local dist copy:               Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util     sda               4.20     6.80  265.40    2.40 26632.00    36.80   199.17     1.15    4.35   1.75  46.80     sdb               0.00  6532.00    0.00  226.20     0.00 27009.60   238.81    89.52  395.26   3.67  83.04          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util     sda               1.60     3.60  230.80    1.60 26431.20    20.80   227.64     0.64    2.76   1.74  40.40     sdb              12.20  6160.00    0.60  216.80    51.20 25878.40   238.54    87.67  403.41   3.79  82.40      Anything I can learn from these numbers?


title: Send stdin to console and compressed file

text: I'm running a propietary program which generates text output. Kind of like a logger.               logger      I'd like to both view this output on the terminal to watch the server breathe, and send it to a text file. So normally I'd do:               logger | tee /tmp/log.txt      But these log files can become large enough to overwhelm my VMs disk space. Instead of sending the text to an uncompressed text file, I'd like it to be compressed immediately. So I might do:               logger      in one terminal and               logger | gzip > /tmp/log.gz      in another terminal. But this doesn't feel very *nixy. Is there a way I can accomplish this in one command, similar to using `tee`? Here is what I'm going for, which obviously won't work, but maybe you'll get the idea:               logger | tee gzip > /tmp/log.txt


title: Substitute text with sed and keep part of the original text

text: I am trying to convert               <id>1</id>     <Name>ENTERPRISE RESOURCE PLANNING</Name>      to:               <column name="id">1</column>     <column name="Name">ENTERPRISE RESOURCE PLANNING</column>      I am assuming the best tool for the job would be `sed`, however I can't figure out how to keep parts of the original text in the replace part. If I do:               $ sed -i 's/<.*>.*<.*>/<column name="\\1">\\2<\/column>/g' filename.xml      The output is:               <column name="\1">\2</column>     <column name="\1">\2</column>      Or doing similar from within `vi`, it outputs:               <column name=""></column>     <column name=""></column>      How can I make it so that `\1` and `\2` are substituted back to their original values?


title: Can I use 2 WANs on DD-WRT?

text: I bought TL-WR1043ND and flashed it with DD-WRT. Now Im wondering if it's possible to use physical WAN port and wireless client WAN for internet usage and at the same time broadcast SSID for wired and wireless clients to share files? Here's a quick mockup in Paint: ![Network map made in paint](http://hostogo.com/image-1EF8_4E70E961.jpg)


title: make fatal error: openssl/sha.h: No such file or directory

text: I'm trying to compile a program that, according to the documentation, requires the "OpenSSL library". I have OpenSSL installed, and it's still giving me the error `openssl/sha.h: No such file or directory`. Is there some other library that has to be installed?


title: Asking rsync to transfer files without connecting to the remote rsync server?

text: If I understand correctly, `rsync` tries to connect to a remote `rsync` server when transferring files via `-e ssh`. This worked well for me most of the time, but I am having problems rsyncing with a particular server. If I verbose the transfer:               rsync -ar --verbose --progress source_file -e ssh server:dest_file      I see the following:               opening connection using: ssh server rsync --server -vvlogDtpre.iLsf .       and it stands there, forever. I should note that I can manually ssh into that machine with no problem. In case it matters, I have a `ControlMaster` set up for this connection in my ssh config file, i.e.:               ControlMaster auto     ControlPath ~/.ssh/%r@%h:%p      This made me think about two questions:   1. Why can't rsync connect to this particular server?   2. Is there a way to force rsync to act like scp (and skip connecting to the remote rsync server)?


title: How Can I Change the Default arguments to gcc When I run Make "filename"

text: Forgive me if I posted this in the wrong Stack. Every time I run make for a file without any Makefiles in the directory, make still works and compiles the source code but only with the arguments: `gcc filename.c -o filename` For example, if I enter `make test` with test.c in the directory, it does : `gcc test.c -o test` I wish to change this, so that ever time I run make without a Makefile, it will instead do : `gcc -ggdb -std=c99 -Wall -Werror -o filename filename.c -lcs50 -lm` I also which that this change becomes permanent and does not change regardless if I restart or change directories. I'm currently running Crunchbang Weezy on an AMD 64bit processor.


title: What's the difference between 32 and 64 bit linux?

text: What exactly are the implications? Can a 32 bit linux run applications that are compiled as 64 bit? Or vice versa? I just got a new machine with an i5 processor, I installed a copy of Ubuntu 10.10 which seems to be i686 which I new realize is 32 bit, but I think I have some 64 bit apps installed. Can this be right?


title: How to change boot logo in linux mint

text: I want to change my linux mint cinnamon 17 boot image manually, so I replaced the image: /lib/plymouth/themes/mint-logo/logo.png with mine.   The logo changes at shutdown but not at boot... Any help?


title: Sharing bandwidth between IPs

text: There are 200 users in my network, and these users are in two AD groups and cannot set specific IP ranges for each group. I want to set, for each group, the amount of bandwidth that can be shared between users of groups. I can manage bandwidth for a IP with squid, and also with iptables+tc, but I want to set bandwidth for groups of IPs that share between users of that. How can I do that?


title: Connection refused - connect(2)

text: I have set SMTP settings in both `config/environments/production.rb` and `development.rb` also i have added the settings in `config/initializers/setup_mail.rb`:               config.action_mailer.default_url_options = { :host => 'ipaddress' }     config.action_mailer.delivery_method = :smtp     config.action_mailer.smtp_settings = {       :address              => 'smtp.gmail.com',       :port                 => 587,       :domain               => 'gmail.com',       :user_name            => 'EMAIL_ADDRESS@gmail.com',       :password             => 'pass',       :authentication       => :plain,       :enable_starttls_auto => true,       :openssl_verify_mode  => 'none'     }      `config/initializers/setup_mail.rb`:               ActionMailer::Base.smtp_settings = {        :address              => 'smtp.gmail.com',       :port                 => 587,       :domain               => 'gmail.com',       :user_name            => 'EMAIL_ADDRESS@gmail.com',       :password             => 'pass',       :authentication       => :plain,       :enable_starttls_auto => true,       :openssl_verify_mode  => 'none'     }           ActionMailer::Base.default_url_options[:host] = "ipaddress"       I am getting the error `Connection refused - connect(2)` while I have working in localhost with below configuration I haven’t get any error and also mail has been sent. config/initializers/setup_mail.rb (localhost)               ActionMailer::Base.smtp_settings = {        :address              => 'smtp.gmail.com',       :port                 => 587,       :domain               => 'localhost',       :user_name            => 'EMAIL_ADDRESS@gmail.com',       :password             => 'pass',       :authentication       => 'plain',       :enable_starttls_auto => true     }           ActionMailer::Base.default_url_options[:host] = "localhost:3000"       controller               def sendResume     @name =params[:name]     @email_id = params[:email_id]     @mob_no = params[:ph_no]     @country = params[:country]     @qualification = params[:qualification]     @if_back_papers = params[:if_back_papers]     @back_papers_count = params[:back_papers_count]     @highest_education_percent = params[:highest_education_percent]     @twelve_percent = params[:twelve_percent]     @ten_percent = params[:ten_percent]     @yr_exp = params[:yr_exp]     attachments = params[:resume]     if simple_captcha_valid?      if params[:resume]         filename=attachments.original_filename          extname = File.extname(filename)[1..-1]         mime_type = Mime::Type.lookup_by_extension(extname)         content_type = mime_type.to_s unless mime_type.nil?             if content_type !="application/pdf"                flash[:error]= "Only pdf files are allowed"                redirect_to :action=>"careers"             else              File.open(Rails.root.join('tmp', 'uploads', attachments.original_filename), 'w') do |file|               re = attachments.read               file.write(re.force_encoding("utf-8"))               @attached_path = file.path             end             begin               ResumeMailer.sendResume(@name, @email_id, @mob_no, @country, @qualification, @if_back_papers, @back_papers_count, @highest_education_percent, @twelve_percent, @ten_percent, @yr_exp, @attached_path, attachments.original_filename ).deliver               flash[:notice] = "Your resume has been submitted successfully"               redirect_to :action=>"careers"             rescue Exception => e               puts e.message               logger.warn "error sending mail"               flash[:error]= "Error in submitting resume"               redirect_to :action=>"careers"             end          end         else           flash[:error]= "Please upload your resume"           redirect_to :action=>"careers"         end     else       flash[:error]= "Incorrect captcha"       redirect_to :action=>"careers"     end     end      In console mode the mails are sendind without error in graphical mode (in browser) I am getting the error `Connection refused - connect(2)`. What is wrong in my live code?


title: alternative for digest -a sha256 command from solaris in linux

text: I have file from solaris which have digest -a sha256. But this command is not working in linux. I want the alternative for this command.


title: XML modify and writing to file beautiful soup

text: I am using python beautiful soup to parse an XML file and write it to a different file after deletion of certain tags. But, using soup.prettify changes other XML namespaces and attribute names. f = open('new.xml',"w"); f.write(soup.prettify(formatter="xml")); f.close(); The changes are as given in sample below. Original XML file.               <draw:control text:anchor-type="paragraph" draw:z-index="1" draw:style-name="gr1" draw:text-style-name="P2" svg:width="2.805cm" svg:height="1.853cm" svg:x="3.602cm" svg:y="0.824cm" draw:control="control2"/>      New XML file written from soup.prettify.                 <draw:control draw:control="control2" draw:style-name="gr1" draw:text-style-name="P2" draw:z-index="1" svg:height="1.853cm" svg:width="2.805cm" svg:x="3.602cm" svg:y="0.824cm" text:anchor-type="paragraph"/>      I tried adding utf-8 to prettify(). But, its the same problem. Is there any other method to delete a particular tag based on searching and keep all the other XML contents in the file in tact? Please suggest.


title: ifconfig shows only lo

text: I'm a beginner using Debian. I've just installed Debian 7.5.0 amd netinst. Actually I am trying to install the firmware through aptitude install firmware-linux-nonfree When I executed ifconfig and ifconfig -a, the output indicates only the loopback no eth0 interface. However the Ethernet card and WLAN card are pretty detected, I checked it through lspci and both cards appear. I edited /etc/network/interfacesl by adding DHCP but it was in vain. Please, could anybody help me?


title: "Ungrep" - which patterns aren't matched

text: I'm looking for a command or script to do the following - given: file1.txt:               abcd     efgh      ijkl     mnop      file2.txt:               123abcd123     123efgh123     123mnop123      I want a command that does something like this:               ungrep file1.txt file2.txt      and returns the following:               ijkl      In other words it is giving me the lines in file1.txt that will not return any results on a grep of file2.txt. I know that I can do this by iterating through file1.txt, grepping file2.txt for each line and storing the result, and outputting any lines where the result is empty, but I was hoping for a more efficient way to do this.


title: Error mounting shared folder for KVM Solaris guest

text: Followed this guide on how to set up a shared folder between a KVM Host(Ubuntu 12.04) and Guest (Solaris 10 Sparc). On the last part of the it requires you to mount the shared folder and typed in this command.               mkdir /mnt/shared     mount -t 9p -o trans=virtio /hostshare /mnt/shared      But i got an error:               mount: wrong fs type, bad option, bad superblock on /hostshare,            missing codepage or helper program, or other error            (for several filesystems (e.g. nfs, cifs) you might            need a /sbin/mount.<type> helper program)            In some cases useful info is found in syslog - try            dmesg | tail  or so      Any ideas on how to fixed this?


title: crontab exclude specific date only

text: How can I write a cron that will exclude a specific date. let say : I need to run a crontab 6pm to 9pm in every 30 min on weekends and want to exclude 10th may 2014 only. Is It possible? How can I write this? or is any alternative for this? please suggest.


title: Displays and their relative position in a shell script

text: I want to get information about the displays, something like `xrandr`, but with more info. I want to know their position. So if I have two or more displays connected I want to know how they are related to each other. If we are using the displays as an extending and not as a duplicate. With a shell command I want to know If I have any display to the left, right, up or down. Is there something similar? Or at least a command where I give the id of the display and it tells me if I have another display in any direction?


title: Why does LD keep outputting "no version information available"

text: On every loading of a lib, I get the error: > no version information available This lib has been compiled on another PC (ubuntu 10.04) than the one running it (mandriva 2010.2).               $ ldd /usr/local/gnu-eabi-4.5.2/i686-pc-linux-gnu/arm-eabi/lib/libbfd-2.21.so     /usr/local/gnu-eabi-4.5.2/i686-pc-linux-gnu/arm-eabi/lib/libbfd-2.21.so: /lib/libz.so.1: no version information available (required by /usr/local/gnu-eabi-4.5.2/i686-pc-linux-gnu/arm-eabi/lib/libbfd-2.21.so)      linux-gate.so.1 =>  (0xffffe000)      libz.so.1 => /lib/libz.so.1 (0xb77a7000)      libc.so.6 => /lib/i686/libc.so.6 (0xb7655000)      /lib/ld-linux.so.2 (0xb787a000)      Edit: the workaround didn't work.


title: store command before pressing ctrl+c, revive afterwards

text: Sometimes I type a lengthy command in my command prompt and then notice that I need to check something before actually pressing return and executing the command. I press `ctrl+c`, execute the new command and then type the cancelled command again and execute it. Is there a way to "save" the command I am to cancel with `ctrl+c` and restore it later when I finished the "check something" command? Note that I do not want to open another terminal, because I am on a remote server via ssh. Shellshot:               $ git commit -am 'FOO-123: fix issue with dorks around bars'^C     $ git status     # On branch foo     modified: foo.php     $ git commit -am 'FOO-123: fix issue with dorks around bars'     1 file changed, 46 deletions(-)     $


title: How to save current command on zsh?

text: I am typing a command, I remember I have to check something, if I press `Ctrl`+`U` the command disappears and I can type something else, but then the command I was typing is not in the history. Is there a way to recover that command, or a different shortcut that I can press to save somewhere the command?


title: How to save a command you entered without executing it?

text: Every Linux user has experienced this annoying thing: you begin typing a long and boring command, then realise you should have executed another one before. How to save the first one to execute it later? ### Example You begin typing               mycommand -a -F --conf /very/long/path --and /another/one /input/file.txt      But before pressing "Enter", you realise you should've done `cp f.txt /input/file.txt` at first. So, you're stuck with your command, and if you don't press `Enter` you won't be able to have it back using your bash history. What's the best way to handle this?


title: Any options to replace GNU coreutils on Linux?

text: I've been thinking about discontinuing the use of GNU Coreutils on my Linux systems, but to be honest, unlike many other GNU components, I can't think of any alternatives _(on Linux)_. What alternatives are there to GNU coreutils? will I need more than one package? Links to the project are a must, bonus points for naming distro packages. Also please don't suggest things unless you _know_ they work on Linux, and can reference instructions. I doubt I'll be switching kernels soon, and I'm much too lazy for anything much beyond a straightforward `./configure; make; make install`. I'm certainly not going to hack C for it. _**warning:** if you're distro uses coreutils removing them could break the way your distro functions. However not having them be first in your `$PATH` shouldn't break things, as most scripts should use absolute paths._


title: GTK::Socket and Gtk::Plug unexpected behaviour under Gnome and FVWM2

text: The following code works fine if run within FVWM2. But if you change desktop to Gnome, then the embedded window is destroyed instead of being embedded. **Why is that?** What am I missing?... The code follows but basically all it does is fork. In the child, we create a VPython window an let it idle forever. In the parent, we create a GTK window, find out what the window ID of the child window is, and try to embed it vis a GTK::Socket. Note that the VPython part maybe irrelevant to this.               #!/usr/bin/env python     # -*- coding: utf-8 -*-     import subprocess     import sys     import os     import re     import time     from visual import *               def find_window_id (title):         """Gets the OpenGL window ID."""         pattern = re.compile('0x[0-9abcdef]{7}')         proc = subprocess.Popen(['xwininfo', '-name', title],                 stdout=subprocess.PIPE, stderr=subprocess.PIPE)         errors = proc.stderr.readlines()         if errors:             return None         for line in proc.stdout.readlines():             match = pattern.findall(line)             if len(match):                 return long(match[0], 16)         return None                    class Setting ():         """VPython/OpenGL class."""              def __init__ (self, w=256, h=256, title='OpenGL via VPython'):             """Initiator."""             self.width = w             self.height = h             self.title = title             self.scene = display.get_selected()              self.scene.title = self.title             self.scene.width = self.width             self.scene.height = self.height             self.sphere = sphere()                    class GTKDisplay ():              def __init__ (self, winID):             """Initiator: Draws the GTK GUI."""             import gtk             import pygtk             self.OpenGLWindowID = winID             window = gtk.Window()             window.show()             socket = gtk.Socket()             socket.show()             window.add(socket)             window.connect("destroy", lambda w: gtk.main_quit())             socket.add_id(long(self.OpenGLWindowID))             gtk.main()                    def main ():         """Main entry point."""         name = 'sphere OpenGL window'         child_pid = os.fork()         if 0 == child_pid:             sut = Setting(title=name)         else:             winID = None             while not winID:                 time.sleep(.1)                 winID = find_window_id(name)             try:                 gui = GTKDisplay(winID)             except KeyboardInterrupt, err:                 print '\nAdieu monde cruel!'               if __name__ == "__main__":         main()      _PS: Yes, this is a follow up fromthis question and this one._


title: system volume is changed when vlc volume is increased over 100%

text: When I increase my vlc sound more than 100% and after stoping or pausing vlc if I use clementine to play music the volume is same as vlc, i.e, more than 100% but in the indicator it shows whatever the previous set state, is this a bug? if so bug of vlc/clementine/gnome-shelll? using fedora 17, gnome-shell, latest vlc and clementine


title: Running assembly program as ring 0

text: I'm writing an application which reports back readings from CPU temperature sensors, and the fan speed monitor. However, according to the Intel documentation on PECI, the instructions required must be run in ring 0 mode, i.e. kernel mode, or an exception is thrown. I encountered code online to transition from protected mode to kernel mode, but none from user to kernel mode, and I read it was forbidden by the kernel. Is there a work around, hopefully that does not require patching the kernel, to allow a program initially in user mode to run as kernel mode?


title: Umount device after bind mounting directories: is it safe?

text: I have a home partition which is shared by mulitple distros on the same box. I'm using `bind` mounts from `fstab`. Each Linux install has something like this:               UUID=[...]       /mnt/data  ext4  nodev,nosuid   0 2     /mnt/data/arch   /home      none  defaults,bind  0 0     /mnt/data/files  /files     none  defaults,bind  0 0      The disadvantage is, of course, that `/mnt/data/arch` and `/mnt/data/files` are now mounted twice. On a hunch, I tried `umount /mnt/data`, which seems to work as I had hoped: according to `mount`, the device is now only mounted to `/home` and `/files`. My questions are:   1. Is this **safe** , or am I overlooking something?   2. Is it possible to get the same effect as `umount /mnt/data` using only `fstab`? Or could I do it in `rc.local`?


title: How to change the default filemanager of the Cinnamon desktop?

text: I'm running an Arch Linux machine with the cinnamon-git desktop from the Arch User Repository. The default filemanager is Nautilus, is there any way to change the default filemanager to thunar?


title: Use `ln` to create a missing directory

text: So I'm writing a small package manager, and a problem I've run into is making the symbolic links to files. It installs the package to `/usr/pkg/name-version`, and then reads a file to determine what symbolic links to make. I'm using `ln` to make the links, and I've run into a problem when trying to install the Linux API headers. I need to link the header files themselves, not the folders that contain them (so if 2 packages need to put files in the same subdirectory of include they can without screwing one package up). That problem I solved, but `ln` simply errors out if the path is incomplete, which is annoying because those directories shouldn't exist until the package is installed. Is there a flag for `ln` that will create any directories that are missing, or am I going to have to go with some convoluted bash script?


title: PNG viewer that can display text chunks metadata

text: Is there a PNG viewer that can display text chunk metadata? Ideally, I'd like a way to view arbitrary chunks.


title: stuck at "make install"

text: I'm building the kernel (3.5) from `/media/src_prog/linux-3.5/` to `/media/sda5_k/`. I've gone through the following steps:               make O=/media/sda5_k/ menuconfig     make -j2 O=/media/sda5_k/     make O=/media/sda5_k/ modules_install      And when it comes to `make O=/media/sda5_k/ install` all I get is:               [root@localhost linux-3.5]# make O=/media/sda5_k/ install     sh /media/src_prog/linux-3.5/arch/x86/boot/install.sh 3.5.0 arch/x86/boot/bzImage \         System.map "/boot"     Cannot find LILO.     [root@localhost linux-3.5]#      I also tried this manually:               cp /media/sda5_k/arch/x86/bzImage /media/sda5_k/boot/     cp /media/sda5_k/arch/x86/System.map /media/sda5_k/boot/      and repeated the `make O=/media/sda5_k/ install` but it doesn't work. I'm using Arch for compilation and boot process is done with Ubuntu's GRUB2. What do I do at this step? * * * **Edit:** fdisk:                  Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048    65538047    32768000   83  Linux     /dev/sda2        65538048    98306047    16384000   83  Linux     /dev/sda3        98306048   122882047    12288000   83  Linux     /dev/sda4       122882048  1953523711   915320832    5  Extended     /dev/sda5       122884096   139268095     8192000   83  Linux     /dev/sda6       139270144   204806143    32768000   83  Linux     /dev/sda7       204808192   229384191    12288000   83  Linux     /dev/sda8       229386240   245770239     8192000   83  Linux     /dev/sda9       245772288   270348287    12288000   83  Linux     /dev/sda10      270350336   319502335    24576000   83  Linux     /dev/sda11      450578432   929523711   239472640   83  Linux     /dev/sda12      929525760  1953523711   511998976   83  Linux     /dev/sda13      319504384   450576383    65536000   83  Linux      df:               Filesystem     1K-blocks     Used Available Use% Mounted on     rootfs          12245648  9913616   1717632  86% /     dev              1024756        0   1024756   0% /dev     run              1027708      328   1027380   1% /run     /dev/sda3       12245648  9913616   1717632  86% /     shm              1027708      112   1027596   1% /dev/shm     tmpfs            1027708       68   1027640   1% /tmp     /dev/sda7       12245648  1100504  10530744  10% /media/src_prog     /dev/sda5        8165804   436548   7319656   6% /media/sda5_k      **/media/src_prog/** -> Where I keep the source files **/media/sda5_k/** -> Where I want Linux Kernel to be put **/dev/sda1** -> Ubuntu **/dev/sda2** -> Old unused Ubuntu **/dev/sda3** -> Arch (here :-D) **/dev/sda1/boot** -> Boot (Ubuntu's) the one bound to MBR.


title: stderr over ssh -t

text: This sends output to STDERR, but does not propagate `Ctrl`+`C` (i.e. `Ctrl`+`C` will kill `ssh` but not the remote `sleep`):               $ ssh localhost 'sleep 100;echo foo ">&2"'      This propagates `Ctrl`+`C` (i.e. `Ctrl`+`C` will kill `ssh` and the remote `sleep`), but sends STDERR to STDOUT:               $ ssh -tt localhost 'sleep 100;echo foo ">&2"'      How can I force the second to send STDERR output to STDERR, while still propagating `Ctrl`+`C`? **Background** GNU Parallel uses 'ssh -tt' to propagate `Ctrl`+`C`. This makes it possible to kill remotely running jobs. But data sent to STDERR should continue to go to STDERR at the receiving end.


title: How can we make Squid do a reverse nslookup?

text: We all know that `access.log` file logs the access Info of Squid:               1286536351.746  41762 192.168.1.17 TCP_MISS/200 5340945 GET http://v15.lscache3.c.youtube.com/videoplayback? - DIRECT/122.160.120.150 video/x-flv     1286536351.746  41762 192.168.1.18 TCP_MISS/200 5340945 GET http://v15.lscache3.c.youtube.com/videoplayback? - DIRECT/122.160.120.150 video/x-flv      We all also know that Squid use the file `/etc/resolv.conf` to determine the DNS server it is dealing with, so if we want Squid to deal with a local DNS server we enter the local DNS server in the file `/etc/resolv.conf`. What if the local DNS server has a record like this (in its reverse zone (1.168.192.in-addr.arpa)):               $TTL 60 ; 1 minute     17          PTR Mark.     18          PTR Mike.      Can I configure Squid to do a reverse lookup (asking about the name of the IP address in the log file) and add the names to the `access.log` record, for example: I want to make this record:               1286536351.746  41762 192.168.1.17 ......      to be something like this:               1286536351.746  41762 192.168.1.17 Mark ......      How can I reach this? Can I use Squid logformats like `%>a` and `%>A` to get what I want?


title: How to replace a leading zero with white space in SED?

text: Trying to find how to replace a leading zero with white space in SED. Attempting to get day of month and replace with space to filter some data that I am screen scraping. The code I have is as follows:               DoM=$(date --date="-1 day" +"%d")     DoMSp=$(echo $DoM | sed "s/^0*/\ /g"); echo $DoMSp      But the problem is when I have a day from 1-9 instead of printing " 1" it prints "1", no matter how many "\ " I try to put in the expression.               $ DoMSp=$(echo $DoM | sed "s/^0*/\ /g"); echo $DoMSp     1          $ DoMSp=$(echo $DoM | sed "s/^0*/\ \ \ \ \ \ /g"); echo $DoMSp     1


title: How do I set my login avatar in MATE? (Fedora 17)

text: Plain old GNOME 2 had a panel applet which displayed your user long name. It had a menu option under which you could set an image to be a login avatar, and it appeared in the gdm display manager (aka login screen). Now I'm using F17 with MATE and I don't see such an option anywhere. I believe there's some package from the MATE repository I need to have to have this functionality, but which one?


title: What actually happens when the checksum fails for a file using btrfs?

text: I'm testing using btrfs on my embedded Linux system. It uses a uSD card for the rfs. This system is remotely deployed so there's no human sysadmin to take care of it. My question is what happens when the checkum fails for reading a file? Is there any way of automatically detecting this and sending a message back to my central server?


title: How to access and manage a large mailbox (11 GB)

text: I've inherited a server which on the whole has been very well maintained. There are a few oddities which are no doubt the result of some executive decision taken by "someone who is not here now". One of them is the way email is used most of the system notices are fired off as emails. This has for reasons that I'd rather not get into left the server with a large mail box which contains probably a lot of junk but also some important information as it was used as a catch all to allow for impromptu email address creation. This mailbox is just shy of 11 GB and clearly needs to be sifted through. However the scripts that are supposed to help me do that crash because of the size of the box. This is not my area of expertise and I'm really not sure what I could be doing to deal with this but all the while I wait the file gets bigger. The file is according to Webmin at `/var/spool/mail/[username]`. Trying to read it or even the list of all inboxes returns errors like this one: > HTTP/1.0 500 Perl execution failed Server: MiniServ/1.670 Date: Mon, 2 Jun > 2014 15:22:11 GMT Content-type: text/html; Charset=iso-8859-1 Connection: > close Error - Perl execution failed sdbm store returned -1, errno 22, key > "332567" at /usr/libexec/webmin/mailboxes/boxes-lib.pl line 328, line > 1213158. The server is `sendmail` and the POP3/IMAP is `dovecot`. I'm running CentOS 5.10. I have root access and the freedom to do whatever needs doing provided I do not take any of the live services down when I do it but that does not help when I'm unsure how to get into said file and deal with the mass of mail. I do not have physical access to the box but am not afraid to use PuTTY and control it that way. I thought I'd use POP3 and empty the box to a desktop PC but the connection times out because it is too big. I should have seen that coming I guess. Is there something I can use to help me get to grips with this issue?


title: Get URL's redirect target with curl

text: I would like to check where a single URL redirects. An example of that could be a link from Google's search result page (where a click always goes through Google server). Can I do that with `curl`?


title: Launch X11vnc server on Ubuntu remote desktop through SSH

text: I have a Windows computer and I am currently connected to a Ubuntu 12.04 system through SSH using CRT on my Windows computer. I would like to know the commands that I need to run from my SSH session (already connected) in order to launch X11vnc and then being able to see and fully manage from the GUI as well.


title: Swap root at runtime

text: I am developing an embedded Linux system. The system is usually installed by creating a ISO file which is written to a USB stick the board can boot from. To make the installation possible to do automatically (say, over night) I would like to be able to do the installation on the board while the old system is running. My installation has two parts: An initrd file which contains busybox and install scripts, and a .tar.gz archive that has the rest of the root file system to install.   1. The bootloader loads the kernel and points it to the initrd, and boots the kernel.   2. The initrd install scripts mounts the target drive /dev/sda, formats it, installs the bootloader, and finally copies the root file system from .tar.gz and initrd. Now I instead want to   1. Copy install.iso from host computer to target device. (No problem)   2. Do the installation steps as above. My problem is that I don't know how I should go about replacing the currently running system with my new one. I assume that the currently mounted root (/) would have to be unmounted and replaced by the initrd. But I can't seem to figure out how!


title: Unable to git clone over ssh

text: I created a bare git repository and pushed to as root. Then I ran `su myuser` and ran the following commands:               $ whoami     myuser     $ mkdir t     $ cd t     $ git clone ssh://myuser@mybox.net:1234/git3          Cloning into git3...     myuser@mybox.net's password:     fatal: '/git3' does not appear to be a git repository     fatal: The remote end hung up unexpectedly          $ git clone /home/myuser/git3     Cloning into git3...     done.      Why is ssh failing? I can clone it by using the local path, and `whoami` shows myuser -- I am not root. Just to make sure I have the addr right I wrote `ssh myuser@mybox.net -p 1234` by copy/pasting the info rather then typing it. I don't understand why ssh isn't working. I know i had it working on this remote box, but I upgraded from debian lenny to squeeze and recently I made various config changes. I don't understand why I can't use git with ssh here.


title: Getting text from last marker to EOF in POSIX.2

text: I have a text with marker lines like:               aaa     ---     bbb     ---     ccc      I need to get a text from the last marker (not inclusive) to EOF. In this case it will be               ccc      Is there an elegant way within POSIX.2? Right now i use two runs - first with nl and grep for the last occurrence with respective line number. Then i extract the line number and use `sed` to extract the chunk in question. The text segments may be quite large so i'm afraid to use some text-adding method like we add the text to a buffer, if we encounter the marker we empty the buffer, so that at EOF we have our last chunk in the buffer. Upd: 5 views for 24 hours, so i'll update the tags so incorrect ones:(


title: How to make dpkg faster?

text: Package (un)installation on a Debian system is horribly slow, partly because it works with a whole bunch of (small) files. Short of getting faster storage, how do I speed it up? I'm thinking maybe loading some highly-accessed directory onto RAM as one solution, but how do I do that? Is there a 'better' solution?


title: Can driver installation procedures be made into a single package?

text: Here is an example of the instructions for installing a Brother printer: http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/instruction_prn3.html and this just a part of the procedure... there are separate "pre-install" procedures and separate procedures for scanning and fax drivers. Couldn't the vendor produce a single package for each model of hardware that would "do everything"? If so, why don't they? And could the "community" do it for them?


title: Issue with graphical card on Debian 7 Wheezy

text: I have an issue after trying to install an Nvidia driver on my GeForce GT 630M with Debian 7 Wheezy 7.5 that seems 100% compatible with the driver. I did everything that this page told me to do. The page that I am referring is: `https://wiki.debian.org/NvidiaGraphicsDrivers` I cannot post more than two links, so... The only issue that I got when i try to run xinit is:   **_Fatal server error: No Screens Found_** I did create the file on /etc/X11/xorg.conf.d/ **20-nvidia.conf** with the entire content that was described to do put in, on the Debian webpage. I think that the problem is which display to select, on the Xorg.log.0 i have two VGA drivers which one is Intel(8086:0116) and the other is the Nvidia(10de:0de9) and the selected one is with the: **_*_**. They both are located on the line 51 and 52 of my pastebin link above. In the final of the log it says: _(EE) No devices detected._ So my question is, how can i change the preferred PCI there(on the Debian)? And my second question is if the driver of Nvidia is loading correctly? Thanks in advance!


title: Linux, disable /dev/fd0 (floppy)

text: Is it possible to make Linux kernel completely ignore the floppy disk controller? I do not have the drive but obviously my motherboard does contain the controller. I would like to disable the `/dev/fd0` device node somehow to avoid Thunar and other tools detecting it and probing it.


title: How Do I check Permissions of Root Folder (/ Folder, not /root)?

text: Is there a way to check the permissions of the root folder, /? I mean the folder's permissions, not its content's (/var, /usr, etc.) permissions? Running `ls /..` shows the content's permissions.


title: Are logs kept for past at jobs?

text: I ran a few jobs with `at` command and, if possible, I want to see which commands I ran in what directories. I work with Linux Mint 16 if this is relevant.


title: What are files in `/var/crash/`?

text: I know when a program crashes, some files creating in `/var/crash/`. But I don't know what these files are! Is that error logs?


title: list files and store it in variables

text: im new with shell programming. my goal is to give the user a selection which file should be run. i catch all available scripts in one var with:               var=$(find script*)      so far so good.. this is the output                   echo $var         script1 script2 script3 scr...      now i want to store each file in a singel variable to run it in later selection               select SEL in script1 script2 script3 ..........     case $SEL in             $Script1) echo ($Script1 will start) && ./$script1 ;;             $Script2) echo ($Script2 will start) && ./$script2 ;;             $Script3) echo ($Script3 will start) && ./$script3 ;;             $Sc..) echo ($Scr.... will start) && ./$scrip.... ;;             $Sc...) echo ($Sc...... will start) && ./$scrip..... ;;             *) echo "choose on of the availabel files";;         esac     done      i dont have a clue how should i should separate all files if i dont know how many and the exactly lenght of each file... i tried to split with echo ${var[1]} and echo $var[1] but this dosn't work. i recive either a empty output or the whole string


title: Two vsftpd instances - check passive port on FTPS

text: I have configured VSFTPD in a CentOS machine to run on two instances, with vsftpd.conf and vsftpd2.conf. Here the content of the second conf file:               anonymous_enable=NO     chroot_list_enable=YES     chroot_list_file=/etc/vsftpd/chroot_list     chroot_local_user=YES     connect_from_port_20=YES     dirmessage_enable=YES     force_local_data_ssl=YES     force_local_logins_ssl=YES     ftpd_banner=Hello.     listen=YES     listen_port=30     local_enable=YES     local_umask=022     pam_service_name=vsftpd     pasv_enable=YES     pasv_address=192.168.100.162     pasv_max_port=389     pasv_min_port=389     rsa_cert_file=/etc/vsftpd/vsftpd.pem     ssl_enable=YES     ssl_sslv2=NO     ssl_sslv3=NO     ssl_tlsv1=YES     ssl_ciphers=HIGH     user_config_dir=/etc/vsftpd/user_conf     userlist_enable=NO     write_enable=YES     xferlog_enable=YES     xferlog_file=/var/log/xferlog2     xferlog_std_format=NO     dual_log_enable=YES     log_ftp_protocol=YES      The fist conf file is identical excepting the xferlog file, and the listen_port that is missing, and the pasv_max_port/pasv_min_port that are 65000/60000 So I have one FTPS working on port 21 and the other on port 30. Both are working fine, but I want to make sure that 389 is really being used. So, I started a session with Wireshark, where I could see all my TCP packets to port 30, but no one to 389. Instead, I see packets to my remote server on port 49276. How can I make sure that this is working fine?


title: Mount a second ssd drive on centos - How can I figure out which is the unused drive?

text: I need to mount my secound ssd drive to /home2. I already created the folder /home2 - Now, how can i figure out which is the unused drive ? Is this /dev/sda or sdb ? What is the exactly thing i`ve to look for to know which is the unmounted drive ?               [/]# cat /proc/mdstat     Personalities : [raid1]     md1 : active raid1 sdb2[1] sda2[0]           524224 blocks super 1.0 [2/2] [UU]          md0 : active raid1 sdb1[1] sda1[0]           16777088 blocks super 1.0 [2/2] [UU]          md2 : active raid1 sdb3[1] sda3[0]           217125312 blocks super 1.0 [2/2] [UU]          unused devices: <none>          df -h     Filesystem      Size  Used Avail Use% Mounted on     /dev/md2        204G   84G  111G  44% /     tmpfs            16G     0   16G   0% /dev/shm     /dev/md1        496M   53M  419M  12% /boot     /usr/tmpDSK     1.9G   94M  1.7G   6% /tmp          root@kas [~]# fdisk -l | grep '^Disk'     Disk /dev/sdb: 240.1 GB, 240057409536 bytes     Disk identifier: 0x0007b22f     Disk /dev/sda: 240.1 GB, 240057409536 bytes     Disk identifier: 0x000c0cf1     Disk /dev/md2: 222.3 GB, 222336319488 bytes     Disk identifier: 0x00000000     Disk /dev/md0: 17.2 GB, 17179738112 bytes     Disk identifier: 0x00000000     Disk /dev/md1: 536 MB, 536805376 bytes     Disk identifier: 0x00000000     root@kas [~]# fdisk -l          Disk /dev/sdb: 240.1 GB, 240057409536 bytes     255 heads, 63 sectors/track, 29185 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x0007b22f          Device Boot Start End Blocks Id System     /dev/sdb1 1 2089 16777216+ fd Linux raid autodetect     /dev/sdb2 2089 2155 524288+ fd Linux raid autodetect     /dev/sdb3 2155 29186 217125464+ fd Linux raid autodetect          Disk /dev/sda: 240.1 GB, 240057409536 bytes     255 heads, 63 sectors/track, 29185 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x000c0cf1          Device Boot Start End Blocks Id System     /dev/sda1 1 2089 16777216+ fd Linux raid autodetect     /dev/sda2 2089 2155 524288+ fd Linux raid autodetect     /dev/sda3 2155 29186 217125464+ fd Linux raid autodetect          Disk /dev/md2: 222.3 GB, 222336319488 bytes     2 heads, 4 sectors/track, 54281328 cylinders     Units = cylinders of 8 * 512 = 4096 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000               Disk /dev/md0: 17.2 GB, 17179738112 bytes     2 heads, 4 sectors/track, 4194272 cylinders     Units = cylinders of 8 * 512 = 4096 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000               Disk /dev/md1: 536 MB, 536805376 bytes     2 heads, 4 sectors/track, 131056 cylinders     Units = cylinders of 8 * 512 = 4096 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000


title: linux distro that's lightweight & works in seamless mode for commandline use on VirtualBox

text: Currently, I'm doing web development on my windows machine. Some projects are just easier to run on Linux (like Node.js.) I only need the commandline, so I run Ubuntu in seamless mode. I don't need all the overhead of Ubuntu. Is there lighter distro I could use that still supports seamless mode in VirtualBox?


title: Colors wrong in wine with new x server with 8 bit color

text: I have an old pc game (win95) that I'm trying to play through wine on my ubuntu box. I got it running and all that pretty jazz using this code;               $ xinit /usr/bin/xterm -- :1 -ac -depth 8      Then in the new window               $ ck-launch-session     $ sudo wine "mygame.exe"      But for some reason, certain shades of white are black, and visa versa. Is there a way to fix this, or am I stuck with it?


title: DNS queries not using nscd for caching

text: I'm trying to use nscd (Nameservices Cache Daemon) to cache DNS locally so I can stop using Bind to do it. I've gotten it started and ntpd seems to attempt to use it. But everything else for hosts seems to ignore it. e.g if I do dig apache.org 3 times none of them will hit the cache. I'm viewing the cache stats using `nscd -g` to determine whether it's been used. I've also turned the debug log level up to see if I can see it hitting and the queries don't even hit nscd. nsswitch.conf               # Begin /etc/nsswitch.conf     passwd: files     group: files     shadow: files          publickey: files          hosts: cache files dns     networks: files          protocols: files     services: files     ethers: files     rpc: files          netgroup: files     # End /etc/nsswitch.confenter code here      nscd.conf               #     # /etc/nscd.conf     #     # An example Name Service Cache config file.  This file is needed by nscd.     #     # Legal entries are:     #     #       logfile                 <file>     #       debug-level             <level>     #       threads                 <initial #threads to use>     #       max-threads             <maximum #threads to use>     #       server-user             <user to run server as instead of root>     #               server-user is ignored if nscd is started with -S parameters     #       stat-user               <user who is allowed to request statistics>     #       reload-count            unlimited|<number>     #       paranoia                <yes|no>     #       restart-interval        <time in seconds>     #     #       enable-cache            <service> <yes|no>     #       positive-time-to-live   <service> <time in seconds>     #       negative-time-to-live   <service> <time in seconds>     #       suggested-size          <service> <prime number>     #       check-files             <service> <yes|no>     #       persistent              <service> <yes|no>     #       shared                  <service> <yes|no>     #       max-db-size             <service> <number bytes>     #       auto-propagate          <service> <yes|no>     #     # Currently supported cache names (services): passwd, group, hosts, services     #              logfile                 /var/log/nscd.log         threads                 4         max-threads             32         server-user             nobody     #   stat-user               somebody         debug-level             9     #   reload-count            5         paranoia                no     #   restart-interval        3600              enable-cache            passwd          yes         positive-time-to-live   passwd          600         negative-time-to-live   passwd          20         suggested-size          passwd          211         check-files             passwd          yes         persistent              passwd          yes         shared                  passwd          yes         max-db-size             passwd          33554432         auto-propagate          passwd          yes              enable-cache            group           yes         positive-time-to-live   group           3600         negative-time-to-live   group           60         suggested-size          group           211         check-files             group           yes         persistent              group           yes         shared                  group           yes         max-db-size             group           33554432         auto-propagate          group           yes              enable-cache            hosts           yes         positive-time-to-live   hosts           3600         negative-time-to-live   hosts           20         suggested-size          hosts           211         check-files             hosts           yes         persistent              hosts           yes         shared                  hosts           yes         max-db-size             hosts           33554432              enable-cache            services        yes         positive-time-to-live   services        28800         negative-time-to-live   services        20         suggested-size          services        211         check-files             services        yes         persistent              services        yes         shared                  services        yes         max-db-size             services        33554432      resolv.conf               # Generated by dhcpcd from eth0     nameserver 127.0.0.1     domain westell.com     nameserver 192.168.1.1     nameserver 208.67.222.222     nameserver 208.67.220.220      as kind of a side note I'm using Arch Linux. _note: this has been moved twice, I've never figured out why apps, excluding dig, are not hitting the nscd cache, browsers, IM, IRC, all should have been, but they didn't_


title: LibreOffice 4.2 PPA archive size?

text: Can anyone give me an idea of the total download size for LibreOffice 4.2 PPA? Am using Mint 14 Nadia (Ubuntu 12.10) Current LO version 3.6.2.2 from the repo, and I have a problem with this bug, where conditional formatting seems to be causing a crash, so I want to upgrade. But I am on a restricted traffic connection, hence would like to know the archive size in advance (unavailable on LO PPA site, AFAICS).


title: Why DNS server changes when enabling another interface on machine

text: My system has 6 interfaces, a loopback, a Xen Bridge, and then 4 ethernet interfaces eth0-3. In this system, my DNS server assigned by DHCP on xenbr0 is 192.168.1.1. Initially eth1 is disabled and DNS assigned (checked via `/etc/resolv.conf`) is 192.168.1.1. When I enable eth1, internet on this system stops working, I checked with `/etc/resolv.conf` and now DNS is 127.0.0.1 ( _why?_ ). Anyway DNS resolution doesn't work now. Question is How can I make internet work while keeping all interfaces active? Why DNS server changes, and how to stop that? **About Environment** : This is a Ubuntu 12.04 VM running in Xen in VirtualBox. eth1 is connected to a VBox host-only network 192.168.56.0/24. eth2 and eth3 are connected to VBox internal networks, there is no config on these two interfaces. xenbr0 is xen bridge and eth0 is added as its one port. In Vbox eth0 is sharing IP with host machine via NAT (currently getting 10.0.2.15). IP of host machine is 192.168.1.x and router IP is 192.168.1.1 which is default gateway for host and DNS too. This is hown DNS is propagated upto guest machine via xenbr0.


title: Need help with routing

text: I have set up a Ubuntu server, that I want to use as a router for my local office.   1. The problem is, that I want to make 2 VPN connections, to remote branches, and then I want to route all traffic to the subnet of these two branches through the VPN connections, ppp0 and ppp1, and route the rest of the traffic to eth0. How can I do this?   1. I also want to route a part of my internet traffic through ppp0, because we have some service subscription, that is based on our IP at one of the branches, and therefor, I need to route this part of the internet traffic through ppp0. Is this possible to set up in the same way as issue 1? I have tried to read about iptables, iproute2 and ipchains, and have tried setting it up, but with no success so far. Thanks a lot for your help. \--- EDITED --- Ok. I found an answer on this page: http://pptpclient.sourceforge.net/routing.phtml#lan-to-lan-via-adsl This seems to be working:               route add -net 192.168.0.0 netmask 255.255.0.0 dev ppp0     iptables --insert OUTPUT 1 --source 0.0.0.0/0.0.0.0 --destination 192.168.0.0/16 --jump ACCEPT --out-interface ppp0     iptables --insert INPUT 1 --source 192.168.0.0/16 --destination 0.0.0.0/0.0.0.0 --jump ACCEPT --in-interface ppp0     iptables --insert FORWARD 1 --source 0.0.0.0/0.0.0.0 --destination 192.168.0.0/16 --jump ACCEPT --out-interface ppp0     iptables --insert FORWARD 1 --source 192.168.0.0/16 --destination 0.0.0.0/0.0.0.0 --jump ACCEPT     iptables --table nat --append POSTROUTING --out-interface ppp0 --jump MASQUERADE     iptables --append FORWARD --protocol tcp --tcp-flags SYN,RST SYN --jump TCPMSS --clamp-mss-to-pmtu


title: User installation emacs 23 on a centos 5 with system-wide installed emacs-21.4-20.el5?

text: I would like to install my own copy of emacs 23 on a Centos 5 Linux where I don't have admin rights. I would like to have my own modern copy of emacs on this Centos 5 system since I've got a problem with the fonts when running emacs-21 through an ssh connection to a Centos 5 Linux, while my local system is a more modern Ubuntu 12.04.2. I am not used to rpm systems and less so on systems with no admin rights. Any good tutotials on how to install my own copy of emacs 23 on this system?               uname -a     Linux xxx-xxxx-xxx 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux          rpm -qa | grep emacs\-2      emacs-21.4-20.el5


title: What does a question mark in a filename matching pattern mean?

text: What does the question mark in this command mean?               find . –type d –name "?d*" –print      I tried to to run it without it but didn't notice any change.


title: Why does my server not shutdown properly?

text: When I run `$ reboot` on my embedded FreeNAS 0.7 (FreeBSD 7.2) it does start the shut down procedure but seemingly hangs. I have registered a command to start a service script which is executed on PostInit:               /myscripts/startService1.sh      It has works flawlessly so far. Now I registered a second service                /myscripts/startService2.sh      and had to realize that the PostInit script seems to be blocked by the first service (because it runs infinitely) and seemingly does not allow the PostInit to resume to it's next task. Consequently service 2 is never started. To allow the script to continue I appended the `&` to the commands to be executed.               /myscripts/startService1.sh &      and               /myscripts/startService2.sh &      This works as intended, both services are started up and run as expected. **But** when I `$ reboot` the system will not shutdown within seconds like before (it eventually seems to complete the reboot after hours [I let it sit over night]). When the reboot is initialized the ssh session (I am dropped) and all services are gone within seconds - however I can still ping the machine. Reconnecting with `ssh` does not work (connection refused). Cleanly exiting (or even killing) the services before `$ reboot` has no effect. The whole issue also is reproducible with only one service as long as I appended the `&` at it's call. Apparently a simple self ending process like `ps -Auw > /myLogs/postInit.log &` will cause the issue too. I am stumped and could really need a hint. **Update:** I don't know how to say this but... it's fixed. And I have no idea how. All I did was let some time pass (writing this question) then tried with `$ shutdown -r now` which worked. Then tried `$ reboot` which now worked too. Since then everything now runs as intended but I do not know what I did to fix it! There was nothing after writing this, that I haven't done before - except for running `shutdown -r` that one time after which everything _magically_ worked. I have tried to forcefully reproduce the problem but haven't been able to do so, before I could easily test by adding or removing that little `&`. I still have to explicitly run the scripts as background processes, else the PostInit script is blocked.


title: grep the only first word from output with grep -P

text: I'm trying to grep username `users |grep "^\b\w*\b" -P` how to do it with grep?


title: What is the relationship of inodes, LBA, Logical Volumes, blocks, and sectors?

text: I'm a bit embarrassed to ask this question but I'd like to see a diagram that shows how the following things are related. It would be nice if the diagram also included any transforms required to map between the various layers as well. As I understand it, I believe they're related in the following way, but I'm not sure that my understanding is 100% accurate.                                          .-----------------.                                |      inode      |                                '-----------------'                                         |                                .-----------------.                                |      EXT4       |                                '-----------------'                                         |                              .---------------------.                              | logical volume (LV) | --- part of LVM                              '---------------------'                                         |                               .-------------------.                               | volume group (VG) |  --- part of LVM                               '-------------------'                                         |                                 .---------------.                                 | /dev/<device> |                                 '---------------'                                         |                        .--------------------------------.                        | Logical Block Addressing (LBA) |                        '--------------------------------'                                         |                                .-----------------.                                | blocks/sectors  |                                '-----------------'                                         |                                        HDD                                          _.-----._                                     .-         -.                                   |-_       _-|                                   |  ~-----~  |                                   |           |                                   `._       _.'                                      "-----"         ### References   * Finding what hard drive sectors occupy a file   * Identifying file associated with unreadable disk sector   * Bad block HOWTO for smartmontools   * C5170 Lecture notes -- Internal Representation of Files - The Unix File System   * Logical block addressing   * Ext4 Disk Layout


title: How to run 32-bit applications on 64-bit Slackware?

text: I used to use Slamd64 before, and it was easy. It came with all 32-bit libraries as well. Since official 64-bit Slackware is released, Slamd64 is no longer maintained. However, Slackware seems to be pure 64bit, so I cannot run 32bit apps. I searched the net and found some instructions, but they all require that I install some package manager (slapt-get, whatever). I'd like to do it without messing too much with the system. Where should I start?


title: I tried to mount a volume from windows via terminal, it showed that the mount point I specified was not a block device

text: Here is what I did. I gave the command in the terminal               mount /home/myfolder/mounting_folder /dev/sda3      It displayed a message that               mount: /home/myfolder/mounting_folder is not a block device      Why isn't this working?


title: Harddisk serial number from terminal?

text: I have multiple harddisks which get connected to my server and I'm not sure which one is what in the view of sdXY . If I can see the serial numbers of my harddisks from terminal, I can easily identify them. Is there any way I can see them from terminal?


title: How to install applications from KDE desktop on CentOS

text: I've just installed CentOS 6.5 in a virtual machine. I know how to install packages with command-line `yum` but I'm wondering how to do the same from the GUI (KDE). They apparently did not write documentation for CentOS 6. Docs for previous releases only explain how to choose packages during initial installation. And I cannot find nothing remotely similar to "install applications" or "package manager" in the KDE menu. Google only returns results on how to install CentOS itself. What's the name of the standard graphical package manager and how can I launch it?


title: Zero graphic card fan speed when no calculations are performed

text: I have fresh install of ubuntu 12.04.4 LTS and CUDA 5.5 with nvidia-331.20 driver. There are 4 GeForce GTX 780 on board. X runs on integrated card, while Nvidia cards are superposed to do some calculations. I have noticed that 3rd card fan spin is 0 when no calculations are performed on it in spite of the temperature: **When some calculations:**                   +------------------------------------------------------+                                | NVIDIA-SMI 331.20     Driver Version: 331.20         |                                |-------------------------------+----------------------+----------------------+         | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |         | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |         |===============================+======================+======================|         |   0  GeForce GTX 780     Off  | 0000:02:00.0     N/A |                  N/A |         | 46%   80C  N/A     N/A /  N/A |     93MiB /  3071MiB |     N/A      Default |         +-------------------------------+----------------------+----------------------+         |   1  GeForce GTX 780     Off  | 0000:03:00.0     N/A |                  N/A |         | 47%   80C  N/A     N/A /  N/A |     93MiB /  3071MiB |     N/A      Default |         +-------------------------------+----------------------+----------------------+         |   2  GeForce GTX 780     Off  | 0000:83:00.0     N/A |                  N/A |         | 43%   79C  N/A     N/A /  N/A |     93MiB /  3071MiB |     N/A      Default |         +-------------------------------+----------------------+----------------------+         |   3  GeForce GTX 780     Off  | 0000:84:00.0     N/A |                  N/A |         | 48%   80C  N/A     N/A /  N/A |     93MiB /  3071MiB |     N/A      Default |         +-------------------------------+----------------------+----------------------+      **Right after termination of calculations:**                   +------------------------------------------------------+                                | NVIDIA-SMI 331.20     Driver Version: 331.20         |                                |-------------------------------+----------------------+----------------------+         | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |         | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |         |===============================+======================+======================|         |   0  GeForce GTX 780     Off  | 0000:02:00.0     N/A |                  N/A |         | 38%   73C  N/A     N/A /  N/A |     10MiB /  3071MiB |     N/A      Default |         +-------------------------------+----------------------+----------------------+         |   1  GeForce GTX 780     Off  | 0000:03:00.0     N/A |                  N/A |         | 38%   73C  N/A     N/A /  N/A |     10MiB /  3071MiB |     N/A      Default |         +-------------------------------+----------------------+----------------------+         |   2  GeForce GTX 780     Off  | 0000:83:00.0     N/A |                  N/A |         | 38%   73C  N/A     N/A /  N/A |     10MiB /  3071MiB |     N/A      Default |         +-------------------------------+----------------------+----------------------+         |   3  GeForce GTX 780     Off  | 0000:84:00.0     N/A |                  N/A |         |  0%   75C  N/A     N/A /  N/A |     10MiB /  3071MiB |     N/A      Default |         +-------------------------------+----------------------+----------------------+      What could cause one of cards fan act this way?


title: Use some EFI loader to boot MBR

text: For compatibility reasons I had to install Debian via BIOS emulation rather than native EFI. As the EFI internal bootloader takes ages to look for bootable legacy disks I'd like to change the bootloader or chainload the existing GRUB2. Should I use an additional loader for chainloading? Is it possible to enable a BIOS emulation in some EFI-loaders like refind?


title: Create Reinstallable OS ISO of RHEL with custom software

text: Currently we install our custom Linux OS(Based on RHEL) on a VMWare ESXi partition along with all required software and export it as .ova file and share with other teams which they again install on VMWare ESXi parition. Now we have a requirement to use only bare metal without virtualization because of licensing requirements. How can create a ISO with our custom linux and all other required software to share with other teams?


title: “hard-linking” parts of a big file in which only a small part has changed

text: I use rsync to make backups:               rsync -a --link-dest=PATHTO/$PREVIOUSBACKUP $SOURCE $CURRENTBACKUP      This way I save space due to using hard links. The problem appears when I need to backup a huge file which is always changing (virtual machine image). Is it possible to hardlink not whole the image, but only it's changed parts? Is there any kind of tool that can take care of this?


title: How to configure the process open file limit of a user?

text: The default open file limit per process is 1024 on - say - Linux. For certain daemons this is not enough. Thus, the question: How to change the open file limit for a specific user?


title: The only way to turn off/on wifi is to put laptop into sleep mode

text: After start GNOME prints `Hardware disabled`. I've tried to use keyboard shortcut and it doesn't work. Only way to disable/enable hardware wifi is to put laptop into sleep mode and restore.


title: Why can't I run this script?

text: $ sh bashtrrrrrr           # whats my pub. ip?     bashtrrrrrr: line 19: unexpected EOF while looking for matching `''     bashtrrrrrr: line 20: szintaktikai hiba:  váratlan fájl vég               $  cat bashtrrrrrr      #!/bin/bash          echo '     # what's my pub. ip?     alias myip="curl -s "http://checkip.dyndns.org/" | grep -o "[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*" | head -1"          # shorten ssh connection with tsocks     function t() { read THEIP; tsocks ssh root@$THEIP; }          # red/green terminals regarding exit code     export PROMPT_COMMAND='PS1="`     if [[ \$? = "0" ]];     then echo "\\[\\033[0;32m\\]";     else echo "\\[\\033[0;31m\\]";     fi`[\u@\h \w]\[\e[m\] "'          export PS1          ' >> /home/USER/.bashrc      what am I missing?


title: CentOS: Alert all desktop users from comand-line

text: Can someone tell me if there is an way to notify all online (Desktop) users from command-line. I know that if I want that I get notifyed when something is done, I just do like this:               sudo apt-get update | notify-send "apt-get update" "update finished"      What shoul I use for notify all users (or some specific user)?


title: Stable H323 Clients?

text: Are there any H323 clients that are stable (don't crash all the time)? I only found Ekiga, but people in my work group are telling me that it is unusable, because it is crashing all the time. Is there a stable client? Can be commercial.


Looks like my MTD2,and MTD3 partitions are write protected. The OS is booting from SD card on a ARM Cortex A 9 processor.               root@Xilinx-ZC702-2013_3:~# mount /dev/mmcblk0p1 /mnt/     root@Xilinx-ZC702-2013_3:~#     root@Xilinx-ZC702-2013_3:~# cd /mnt/flash/     root@Xilinx-ZC702-2013_3:/mnt/flash#     root@Xilinx-ZC702-2013_3:/mnt/flash# ls     BOOT.BIN      image.ub      rootfs.jffs2     root@Xilinx-ZC702-2013_3:/mnt/flash# flashcp -v image.ub /dev/mtd2     While trying to open /dev/mtd2 for read/write access: Permission denied     root@Xilinx-ZC702-2013_3:/mnt/flash#      Even I tried this:               root@Xilinx-ZC702-2013_3:/mnt/flash# flash_eraseall -j /dev/mtd2     flash_eraseall has been replaced by `flash_erase <mtddev> 0 0`; please use it     flash_erase: error!: /dev/mtd2                  error 13 (Permission denied)      Here are additional info:               root@Xilinx-ZC702-2013_3:/mnt/flash# mtdinfo     Count of MTD devices:           4     Present MTD devices:            mtd0, mtd1, mtd2, mtd3     Sysfs interface supported:      yes          root@Xilinx-ZC702-2013_3:~# cat /proc/mtd         dev:    size   erasesize  name         mtd0: 00500000 00010000 "boot"         mtd1: 00020000 00010000 "bootenv"         mtd2: 001202c0 00010000 "image"         mtd3: 00500000 00010000 "jffs2"      Also:               root@Xilinx-ZC702-2013_3:/mnt/flash# mtd_debug info /dev/mtd3     mtd.type = MTD_NORFLASH     mtd.flags = MTD_BIT_WRITEABLE     mtd.size = 5242880 (5M)     mtd.erasesize = 65536 (64K)     mtd.writesize = 1     mtd.oobsize = 0     regions = 0          root@Xilinx-ZC702-2013_3:/mnt/flash# mtd_debug info /dev/mtd2     mtd.type = MTD_NORFLASH     mtd.flags = MTD_BIT_WRITEABLE     mtd.size = 1180352 (1M)     mtd.erasesize = 65536 (64K)     mtd.writesize = 1     mtd.oobsize = 0     regions = 0          root@Xilinx-ZC702-2013_3:/mnt/flash# mtd_debug info /dev/mtd1     mtd.type = MTD_NORFLASH     mtd.flags = MTD_CAP_NORFLASH     mtd.size = 131072 (128K)     mtd.erasesize = 65536 (64K)     mtd.writesize = 1     mtd.oobsize = 0     regions = 0          root@Xilinx-ZC702-2013_3:/mnt/flash# mtd_debug info /dev/mtd0     mtd.type = MTD_NORFLASH     mtd.flags = MTD_CAP_NORFLASH     mtd.size = 5242880 (5M)     mtd.erasesize = 65536 (64K)     mtd.writesize = 1     mtd.oobsize = 0     regions = 0          root@Xilinx-ZC702-2013_3:/mnt/flash#      How do I solve this issue? **dmesg output** I think something is wrong here:               4 ofpart partitions found on MTD device spi32766.0         Creating 4 MTD partitions on "spi32766.0":         0x000000000000-0x000000500000 : "boot"         0x000000500000-0x000000520000 : "bootenv"         0x000000520000-0x0000006402c0 : "image"         mtd: partition "image" doesn't end on an erase block -- force read-only         0x0000006402c0-0x000000b402c0 : "jffs2"         mtd: partition "jffs2" doesn't start on an erase block boundary -- force read-on                                                                             ly      full dmesg output is given here               Booting Linux on physical CPU 0x0     Linux version 3.8.11 (root@xilinx) (gcc version 4.7.3 (Sourcery CodeBench Lite 2                                                                             013.05-40) ) #3 SMP PREEMPT Mon Apr 7 19:02:27 IST 2014     CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d     CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache     Machine: Xilinx Zynq Platform, model: .     Memory policy: ECC disabled, Data cache writealloc     On node 0 totalpages: 262144     free_area_init_node: node 0, pgdat c0bed1c0, node_mem_map c0c0a000       Normal zone: 1520 pages used for memmap       Normal zone: 0 pages reserved       Normal zone: 193040 pages, LIFO batch:31       HighMem zone: 528 pages used for memmap       HighMem zone: 67056 pages, LIFO batch:15     PERCPU: Embedded 7 pages/cpu @c1415000 s6592 r8192 d13888 u32768     pcpu-alloc: s6592 r8192 d13888 u32768 alloc=8*4096     pcpu-alloc: [0] 0 [0] 1     Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096     Kernel command line: console=ttyPS0,115200     PID hash table entries: 4096 (order: 2, 16384 bytes)     Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)     Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)     __ex_table already sorted, skipping sort     Memory: 1024MB = 1024MB total     Memory: 1027124k/1027124k available, 21452k reserved, 270336K highmem     Virtual kernel memory layout:         vector  : 0xffff0000 - 0xffff1000   (   4 kB)         fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)         vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)         lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)         pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)         modules : 0xbf000000 - 0xbfe00000   (  14 MB)           .text : 0xc0008000 - 0xc04effd4   (5024 kB)           .init : 0xc04f0000 - 0xc0bbf9c0   (6975 kB)           .data : 0xc0bc0000 - 0xc0bedee0   ( 184 kB)            .bss : 0xc0bedee0 - 0xc0c09670   ( 110 kB)     Preemptible hierarchical RCU implementation.     NR_IRQS:16 nr_irqs:16 16     MIO pin 47 not assigned(00001220)     xslcr mapped to f0002000     Zynq clock init     sched_clock: 16 bits at 54kHz, resolution 18432ns, wraps every 1207ms     ps7-ttc #0 at f0004000, irq=43     Console: colour dummy device 80x30     Calibrating delay loop... 1332.01 BogoMIPS (lpj=6660096)     pid_max: default: 32768 minimum: 301     Mount-cache hash table entries: 512     CPU: Testing write buffer coherency: ok     Setting up static identity map for 0x35eec0 - 0x35eef4     L310 cache controller enabled     l2x0: 8 ways, CACHE_ID 0x000000c0, AUX_CTRL 0x72360000, Cache size: 524288 B     CPU1: Booted secondary processor     Brought up 2 CPUs     SMP: Total of 2 processors activated (2664.03 BogoMIPS).     devtmpfs: initialized     NET: Registered protocol family 16     DMA: preallocated 256 KiB pool for atomic coherent allocations     xgpiops e000a000.ps7-gpio: gpio at 0xe000a000 mapped to 0xf004e000     bio: create slab <bio-0> at 0     GPIO IRQ not connected     XGpio: /amba@0/gpio@41200000: registered, base is 252     SCSI subsystem initialized     usbcore: registered new interface driver usbfs     usbcore: registered new interface driver hub     usbcore: registered new device driver usb     Switching to clocksource xttcps_clocksource     NET: Registered protocol family 2     TCP established hash table entries: 8192 (order: 4, 65536 bytes)     TCP bind hash table entries: 8192 (order: 4, 65536 bytes)     TCP: Hash tables configured (established 8192 bind 8192)     TCP: reno registered     UDP hash table entries: 512 (order: 2, 16384 bytes)     UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)     NET: Registered protocol family 1     RPC: Registered named UNIX socket transport module.     RPC: Registered udp transport module.     RPC: Registered tcp transport module.     RPC: Registered tcp NFSv4.1 backchannel transport module.     bounce pool size: 64 pages     jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.     msgmni has been set to 1478     Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)     io scheduler noop registered     io scheduler deadline registered     io scheduler cfq registered (default)     e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 82) is a xuartps     console [ttyPS0] enabled     xdevcfg f8007000.ps7-dev-cfg: ioremap f8007000 to f00c8000 with size 100     st: Version 20101219, fixed bufsize 32768, s/g segs 256     osst :I: Tape driver with OnStream support version 0.99.4     osst :I: $Id: osst.c,v 1.73 2005/01/01 21:13:34 wriede Exp $     SCSI Media Changer driver v0.25     xqspips e000d000.ps7-qspi: master is unqueued, this is deprecated     m25p80 spi32766.0: found n25q128, expected n25q128     m25p80 spi32766.0: n25q128 (16384 Kbytes)     4 ofpart partitions found on MTD device spi32766.0     Creating 4 MTD partitions on "spi32766.0":     0x000000000000-0x000000500000 : "boot"     0x000000500000-0x000000520000 : "bootenv"     0x000000520000-0x0000006402c0 : "image"     mtd: partition "image" doesn't end on an erase block -- force read-only     0x0000006402c0-0x000000b402c0 : "jffs2"     mtd: partition "jffs2" doesn't start on an erase block boundary -- force read-on                                                                             ly     xqspips e000d000.ps7-qspi: at 0xE000D000 mapped to 0xF00CA000, irq=51     libphy: XEMACPS mii bus: probed     xemacps e000b000.ps7-ethernet: invalid address, use assigned     xemacps e000b000.ps7-ethernet: MAC updated 96:ec:fa:13:9f:95     xemacps e000b000.ps7-ethernet: pdev->id -1, baseaddr 0xe000b000, irq 54     ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver     ULPI transceiver vendor/product ID 0x0424/0x0007     Found SMSC USB3320 ULPI transceiver.     ULPI integrity check: passed.     xusbps-ehci xusbps-ehci.0: Xilinx PS USB EHCI Host Controller     xusbps-ehci xusbps-ehci.0: new USB bus registered, assigned bus number 1     xusbps-ehci xusbps-ehci.0: irq 53, io mem 0x00000000     xusbps-ehci xusbps-ehci.0: USB 2.0 started, EHCI 1.00     usb usb1: New USB device found, idVendor=1d6b, idProduct=0002     usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1     usb usb1: Product: Xilinx PS USB EHCI Host Controller     usb usb1: Manufacturer: Linux 3.8.11 ehci_hcd     usb usb1: SerialNumber: xusbps-ehci.0     hub 1-0:1.0: USB hub found     hub 1-0:1.0: 1 port detected     Initializing USB Mass Storage driver...     usbcore: registered new interface driver usb-storage     USB Mass Storage support registered.     i2c /dev entries driver     xi2cps e0004000.ps7-i2c: 400 kHz mmio e0004000 irq 57     i2c i2c-0: Added multiplexed i2c bus 1     i2c i2c-0: Added multiplexed i2c bus 2     i2c i2c-0: Added multiplexed i2c bus 3     at24 3-0054: 1024 byte 24c08 EEPROM, writable, 1 bytes/write     i2c i2c-0: Added multiplexed i2c bus 4     i2c i2c-0: Added multiplexed i2c bus 5     i2c i2c-0: Added multiplexed i2c bus 6     i2c i2c-0: Added multiplexed i2c bus 7     i2c i2c-0: Added multiplexed i2c bus 8     pca954x 0-0074: registered 8 multiplexed busses for I2C switch pca9548     xadcps f8007100.ps7-xadc: enabled:      yes     reference:      external     sdhci: Secure Digital Host Controller Interface driver     sdhci: Copyright(c) Pierre Ossman     sdhci-pltfm: SDHCI platform and OF driver helper     mmc0: Invalid maximum block size, assuming 512 bytes     mmc0: SDHCI controller on e0100000.ps7-sdio [e0100000.ps7-sdio] using ADMA     usbcore: registered new interface driver usbhid     usbhid: USB HID core driver     TCP: cubic registered     NET: Registered protocol family 10     sit: IPv6 over IPv4 tunneling driver     NET: Registered protocol family 17     NET: Registered protocol family 40     VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4     Registering SWP/SWPB emulation handler     Freeing init memory: 6972K     mmc0: new high speed SDHC card at address 1234     mmcblk0: mmc0:1234 SA04G 3.67 GiB      mmcblk0: p1


title: introduce line break at the same position based on another file

text: I have 3 input files all having the same number of lines. I have come up with a movie example to make the question look interesting. _file1.txt -- Essentially contains the actor names._               1234|jacknicholson|actor     5678|jacknicholson|director     4321|christianbale|actor      _file2.txt -- Contains the movies of the actors._               1234|oneflewovercuckoosnest^asgoodasitgets     5678|theshining     4321|batmanbegins^darkknight      _file3.txt -- Residence of the actors._               1234|california     5678|hollywoodstudios     4321|losangeles      I am splitting the first input file based on the condition that if names are equal, I need to apply some algorithm. The command is as below.               awk -F '|' 'NR>1 && $2 != prev {print ""} {prev=$2; print}' file1.txt      The above command will make my first file (`file1.txt`) as,               1234|jacknicholson|actor     5678|jacknicholson|director          4321|christianbale|actor      I need to introduce the space at the same position in the remaining 2 files too so that I can apply my algorithm. One approach that comes to my mind is, store the position of spaces in the `file1.txt` in an array and then when I encounter that position in the remaining 2 files, introduce the spaces.


title: Linux Centos 6: Restart Network Service after lost ping

text: My OS is `Linux Centos 6`. Restart Network Service after lost ping Basically, I need a watcher or a script that will detect no ping to/from another ip address and run `service network restart` after every minute or so. I need to restart the network for various reasons.


title: How can I call a .NET web service from PHP?

text: The web service could be a SOAP asmx or a WCF Service. Assumption here is that the IIS on Windows is serving the web-service and Apache on Linux with PHP 5.3 consuming it.


title: Are there any academic sources on why people should use Linux?

text: So, I have to write a persuasive speech for college. I've decided on persuading people to switch to Linux. The problem is, I should have five academic sources for my arguments. Are there academic papers on why normal people should use Linux? I know all the usual arguments, but I need to find sources to back me up. I do have access to most academic databases via my college. If there aren't really any good academic studies or other sources, I'll cite this question as a source and also use normal articles on the Internet. I'm not asking for reasons why Linux is better, I'm looking for academic sources on why Linux is better. I don't think that counts as opinion at all, it's pure facts and references.


title: AIX shell script compiler

text: I know it sounds strange, but is there a good tool that compiles a shell (.sh) script into a executable format? I want to protect the script in such a way it will not be modified by someone. Thanks


title: Prevent pane/window from closing when command completes - tmux

text: In my `tmux.conf` file I have it configured to open windows, name them, setup panes etc.. etc.. However one issue I have is that if one of the panes launches a command, let's say `ls`, then the pane closes itself after the command completes (instantly). Is there any way to prevent this behavior? Or have it drop to a normal shell after a command completes? I am assuming that I need to start a shell -> execute command when the pane launches, but I'll be damned if I can figure out how. I have googled a bit for this problem but have come up short.


title: Shorter timeout on I/O errors MacOS X

text: How do you set a shorter timeout value for read/write I/O errors on MacOSX? We tend to get a few semicrashed disks and want to rsync the contents to a secure location, but when the file subsystem hits a block with an error it tends to freeze up all the processes pertaining to that file system. We use MacSO X so that we can read HFS+. I recon this is something you have to change on kernel level or even firmware (so asking at Ask Different is wasted). The alternative is to have an rsync exclude file and each time I hit a bad block I add the filename of the failed file to the excludes, pull the plug (literally) on the broken disk to provoke a flush and reconnect, but that is more than likely to destroy the disk even further.


title: Bitmap Font data as array in C

text: I need to convert some X11 bitmap fonts to an array in C for a 128x64 OLED Display. I saw some fonts like `/usr/share/fonts/X11/misc/9x15-ISO8859-1.pcf.gz` The result should look like               /* Standard ASCII 6x8 font */     const char PROGMEM font6x8[] = {       0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// sp       0x00, 0x00, 0x00, 0x2f, 0x00, 0x00,// !       0x00, 0x00, 0x07, 0x00, 0x07, 0x00,// "      Are the tools for converting a pcf font to an array of chars in C? Where are good resources for bitmap fonts? Is there anything else I have missed?


title: How can I configure ZSH's vi mode to persist the state between commands?

text: I am aware how to set ZSH's default line editor to use vi-like keybindings...               bindkeys -v      ...and even to default each new prompt to be in command mode instead of insert mod by default...               zle-line-init() { zle -K vicmd; }     zle -N zle-line-init      ...and most of the time I prefer this behavior. However, it makes a few things very awkward. For example pasting multi-line commands into a terminal for immediate execution becomes nearly impossible. **How can I configure it so that the mode is persistent?** I would like whatever mode it was when I executed one line should be the default mode for the next line.


title: How to configure Nautilus 3 toolbar in Debian Wheezy?

text: I'm using Debian Wheeze and I would like to configure the default Nautilus 3.4.2 toolbar. Basically, I would like to add some buttons such as the _Open parent_ button which can be accomplished with the keys `Alt`+`Up`. In Nautilus 2.x it is present in the toolbar and also in the menu and it has an icon in the menu. The icon is present in 3.x too but for some reason not present in the toolbar and I can't find any way to customize it. This is the Nautilus 2.x I want to emulate (or at least add a few of those buttons): ![Nautilus 2](http://i.stack.imgur.com/NxOYf.png) This is the Nautilus 3.x I just can't edit: ![Nautilus 3](http://i.stack.imgur.com/e2Kqc.png) Any help will be appreciated.