title: Oh no! Something went wrong! Installing kali linux

text: I am trying to install a virtual machine running Kali (Formerly backtrack) 1.0.7 in 64 bit. My host machine is a 64 bit MacBook pro running 10.7.5. I am using Oracle VirtualBox version 4.3.12. The install goes perfectly, but after installing it, I get an error when I try to boot. Here is a screen shot. ![](http://s7.postimg.org/4ly0vkahn/Screen_Shot_2014_06_26_at_9_02_27_PM.png) # Installation process I hit New virtual machine, selected 64 bit debian and created an 8gig dynamically allocated VDI. In settings, I have selected the correct ISO, and checked PAE/NX under processor. After doing all of this, the live mode works perfectly. Installing, I do everything the default way, and everything goes perfectly. After I finish the installation, it asks me if I want to boot. When I do, I get the above error. I have done lots of research trying to figure it out, but none of the advice I can find online has helped. Here is everything that someone has said will fix that didn't work for me. ## 1 > "Enable PAE/NX in settings" Made absolutely no difference. ## 2 > "When you get that error, press Ctl+Alt+F1, this will take you to the > terminal tty1, now login as root: > > `login: root password: "your password"..` > > Once as root, start the X's: `startx` > > You will get your desktop...This might be a xauthority issue or dbus issue > when loadind, perhaps a daemon. > > Try this first and if it works, try doing this: dpkg-reconfigure gnome- > shell, then reboot."               command: startx not found.      Needless to say it didn't bring me to the desktop. I tried fixing the problem of the startx command not being found by reading through this forum. I will refer to what they said I should try. > try typing /usr/X11R6/bin/startx               -bash: /usr/X11R6/bin/startx no such file or directory      I tried all of the following commands:               apt-get update     apt-get install x-windows-system     apt-get install x-window-system      All 3 resulted in this               Bus errorackage lists... 1%      Any help would be appreciated. Kali isn't very useful when you can only use live mode...


title: Vim - loop through files in cope

text: how can I lop through buffers in quickfix list `:copen` and make some actions with it. Or any alternative way to put those files to args list and I can use argsdo.


title: Sort comma-separated fields on each line by numeric value

text: I tried this:               $ echo "2,3435,1" | sort -n     2,3435,1          $ sort -t',' -n test_sort.txt     kill,gill,burger     110,20,30,13          $ cat test_sort.txt     110,20,30,13     kill,gill,burger      Why doesn't my `sort` command work? My desired `sort` command should work like this:               $sort -t',' -n test_sort.txt       110,13,20,30,burger,gill,kill


title: How to install multiple glibc on fedora

text: I have Fedora 4 installed on my computer and it has glibc version 2.5.3, but I want to install a software that needs a glibc 2.7+. On the other hand, I have some programs that need this 2.5.3 version. I have three questions regarding this problem:   1. How can I install another glibc on my system and still keep the 2.5.3 as default   2. How can I pass the address of new glibc to the program that I am going to install (is it an option in `./configure`?). The software that I am going to install is nodejs.   3. In future, how can I tell my software which glibc to use?


title: Where to check battery state and set CPU governor/performance level during boot?

text: My laptop supports setting a "performance level" (normal, overclock or silent) that influences the CPU clock rate and fan speed beyond the usual CPU governor setting. The level is set to "normal" by default, but I would like to automatically set it to "silent" when my laptop boots without the charger connected. (Reacting to ACPI events after the system has booted would be nice, but isn't a priority right now.) Writing a script to check the power state and set the performance level won't be too difficult, but where and when during the boot process should I run it? I'm using Ubuntu 14.04.


title: Number of files containing a given string

text: How can I count the number of files (in a directory) containing a given string as input in bash/sh?


title: using brace expansion to change filenames, not extensions?

text: I have a directory containing a bunch of files with different extensions, but the filename before the extension is all the same. E.g., file1.txt, file1.jpg, file1.pdf, file1.odt... I want to change the 'file1' part, but not the extension, so the result would be, e.g., newfilename.txt, newfilename.jpg, newfilename.pdf, newfilename.odt I can't figure out how to do this without tediously running `mv file1.txt newfilename.txt` on every one. I can find lots of tuturials online to change file names with brace expansion if you know all the parts to expand, but nothing to just replace file1 with newfilename no matter what the extension. Is this possible, or am I barking up the wrong tree? Thanks EDIT: I'm sorry, not moments after posting this I found a different page in my Google results that answered the question for me: `for f in file1.*; do mv "$f" "${f/file1/newfilename}"; done` works perfectly.


title: Copy a file from a nautilus-script to clipboard

text: I have a nautilus script that generates an archive file based on the files selected in the nautilus window. This archive file is created in the `/tmp` directory. I want a way to _copy_ this file to the clipboard from the script, so that the user can just go to desktop or home directory and paste it. I have tried doing this with `xclip` and `xsel`, but they don't seem to replicate a file copying operation, rather they copy the contents of a file.               xclip -in -selection c generated-archive     echo -n generated-archive | xsel --clipboard --input      Neither of them do what I need. So, I want to know if this is possible, and if it is, how should I go about it? Thanks.


title: Emacs command to cut OR copy to system clipboard?

text: As a very new Emacs user, I've been using Ctrl+w and Ctrl+y to cut/copy and paste between buffers in Emacs. Is there a way to do the same thing so that not just Emacs, but the entire system, can have access to what I am copying and pasting? Thanks. P.S. I would like to do this in Linux (in a terminal emulator running under X) and Mac OS X (e.g. with Terminal).


title: Create a duplicate record based on a condition

text: I need to write a shell script where I have to create a duplicate record based on a condition and then change the value in a column of the new row which will be created. I am trying to create a duplicate record based on a condition and then replace on column in the duplicate row. **Example:** Input will be **Col1,Col2,Col3,Col4,COl5**               1234,abcd,abcd,wxyz,USD     2345,abcd,abcd,wxyz,USD     3456,abcd,abcd,wxyz,EUR      If the last column ie; col5 is EUR, then one more row should be created with change in column value. **Output should be** **Col1,Col2,Col3,Col4,Col5**               1234,abcd,abcd,wxyz,USD     2345,abcd,abcd,wxyz,USD     3456,abcd,abcd,wxyz,EUR     3456,abcd,abcd,wxyz,AUD


title: monitoring file changes + process access to files

text: I would like to see what's happening in my app server folders, which files are changed by process x or which *.war files has been changed (replaced/created) in last x minutes. I am software developer and that would helped me a lot as we have many customized web servers and sometimes we are not sure what's happening exactly as we deploy our project or what's happening as is our project running. Is there such tool in linux ?. Thank you


title: ACL defaults not being obeyed on copy over NFS

text: I have an Arch Linux box that has a folder from an Ubuntu server mounted via NFS. I've set up an Access Control List on the folder on the server such that any new files should have their permissions set `-rwx-r-x---`.               user1@ubuntu:~$ getfacl home/user2/shared/     # file: home/user2/shared/     # owner: user2     # group: remoteusers     user::rwx     group::r-x     other::---     default:user::rwx     default:user:user2:rwx     default:group::r-x     default:group:remoteusers:r-x     default:mask::rwx     default:other::---      If I create a file the permissions are set fine:               userA@arch:~$ touch ubuntuNFS/test.txt          userA@arch:~$ ls -la ubuntuNFS     -rw-r----- 1 ########## ##########    0 Nov 13  2013 test.txt      But if I copy a file, the group is not given any permissions:               userA@arch:~$ cp Videos/video.mp4 ubuntuNFS/          userA@arch:~$ ls -la ubuntuNFS     -rw------- 1 ########## ##########    0 Nov 13  2013 video.mp4     -rw-r----- 1 ########## ##########    0 Nov 13  2013 test.txt      Why isn't `cp` obeying the ACL defaults?


title: Extend validity time of APACHE certificate

text: I have in /etc/httpd/ssl subdir two files: apache.crt and apache.key. How can I extend time of validity of APACHE http server, without creating new certificate and without necessity of interaction from client site? It is important for me because current cert is valid only 30 days and I want to extend to 1 year.


title: a string representation using regex (modified)

text: I would like to use regular expression to represent a pattern with the following type of characteristics 1) It includes a continuous sequence of digit values. The length of this sequence it at least 1 2) There has at least one non-digit characters either before the first digit value of the above sequence, or after the last digit value of the above sequence, or both before and end. Therefore, the regular expression should be match the following examples:               A123     A123B     #A123BNNN     .123     -123+      On the other side,`AB123B123` is beyond the scope of the above pattern, since it has two sequences of digit values there. This question does not need to consider this scenario. Hopefully, I have made this question clear.


title: How can I specify an executable path that will work from any working directory?

text: I have a java process that runs in this directory:               /home/zookeeper/zookeeper-3.4.5/org/zookeeper/Process.class      That Java process will in turn launch another Java process that lives here               /home/zookeeper/zookeeper-3.4.5/org/zookeeper/Worker.class      I am looking for a command to deliver to Unix that will launch the 2nd process (Worker.class) from any directory in the system (so that I can pass this command as a parameter to Runtime.exec) If I try this               /home/zookeeper/zookeeper-3.4.5/org/zookeeper/Worker.class      Then it throws this error, because the class is defined in org.zookeeper (and not that whole build path).               zookeeper@zookeeper-virtual-machine:~/zookeeper-3.4.5/org$ java /home/zookeeper/zookeeper-3.4.5/org/zookeeper/Worker     Exception in thread "main" java.lang.NoClassDefFoundError: /home/zookeeper/zookeeper-3/4/5/org/zookeeper/Worker     Caused by: java.lang.ClassNotFoundException: .home.zookeeper.zookeeper-3.4.5.org.zookeeper.Worker      What command can I use?


title: Nginx 502 Bad Gateway

text: When I open my site, I get a 502 bad gateway error. After looking at the error log file in `/var/log/nginx/error.log`, it mentions that "upstream prematurely closed connection while reading response header from upstream". `nginx.conf` file content:               #user  nginx;     worker_processes  1;          #error_log  /var/log/nginx/error.log;     #error_log  /var/log/nginx/error.log  notice;     #error_log  /var/log/nginx/error.log  info;          #pid        /var/run/nginx.pid;               events {         worker_connections  10240;     }               http {         include       mime.types;         default_type  application/octet-stream;              #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '         #                  '$status $body_bytes_sent "$http_referer" '         #                  '"$http_user_agent" "$http_x_forwarded_for"';             #access_log  /var/log/nginx/access.log  main;              sendfile        on;         #tcp_nopush     on;              #keepalive_timeout  0;         client_header_timeout 600;         client_body_timeout 600;         send_timeout 6000;         proxy_buffer_size 128k;         proxy_buffers 4 256k;         proxy_busy_buffers_size 256k;         keepalive_timeout  36500;         proxy_read_timeout 1250000;         proxy_connect_timeout 1250000;         fastcgi_read_timeout 1250000;         #tcp_nodelay        on;              #gzip  on;         #gzip_disable "MSIE [1-6]\.(?!.*SV1)";                 server_tokens off;              include /etc/nginx/conf.d/*.conf;      How to solve this?


title: Bash script and stdin

text: I am having a C program which requires to read from stdin. This is one of the requirements, and it cannot change. I have written a simple bash script that creates all the directories I want, handles the output etc. and also compiles and runs my program. When I run my program it waits for the user to give an input from the stdin : I want to be able to give that input from the bash - so do not let the user give the input (there is a reason for that). So ideally, I want somehow the input to be visible to the user but given from the script. If I write something like this :               ./task2     cat <<< "my input here"      It runs the task, and the cat command runs when the task has finished. I want somehow to enforce that cat whenever the program requires input from the user. Is it possible?


title: gnome-session error on rhel (canberra-gtk-module error)

text: When starting cppeclipse in gnome-session via vnc it appears following error on rh6 canberra-gtk-module not found, module is present in `/usr/lib/x64/` also fails when `LD_LIBRARY_PATH=/usr/lib/x64/` is exported, is solution purging/installing of the current libcanberra-gtk3-module ?


title: Why does *BSD uses driver specific names for network interfaces? Does it imply limitations?

text: I notice that depending on the brand of the network card, interface names differ (driver dependent I suppose).   * Why does *BSD uses driver specific names for network interfaces?   * Does it mean there is no abstraction layer describing "a generic network interface" in the kernel, so each driver would be internally addressed via its own API?   * (how) does it affect subsystems like link aggregation, traffic shaping, QoS (ALTQ), filtering and others? Precisely, it looks like under pfSense, I cannot use ALTQ with a link aggregation (LAG) virtual interface. Is this a BSD internal limitation due to the lack of an appropriate abstraction layer?


title: How to backup a running system?

text: I have a running Linux system, and I'd like to have a full backup of it using `dd`, which, in my limited knowledge is the only tool every system has. The distro doesn't matter mainly because I should apply this approach to several different servers with different flavours installed, and I cannot install new software on these servers. What is the most generic and efficient way to complete such task?


title: Shell-independent way to cp dotfiles from a folder to another

text: I have two existing directories :   * foo: directory with dotfiles in it   * foo2: empty directory I would like to have a solution to copy all dotfiles in `foo` to foo2. I would like a solution that is not shell-dependent (bash, zsh, etc.). I would prefer not having to install `rsync` to do it (`tar` is ok). Weeks ago, I asked this similar question, but I feel both questions should be separated as they answer different needs. All answers were shell-dependent or using `rsync`.


title: referring to files inside a jar or zip files in Linux

text: I am wondering if I can refer to files inside JAR or ZIP files using URLs. I mean, without using a tool (such as the Java Jar utility) but just at the operative system level. For example, if I have a file `myfile` in a Jar file `myjar`, I would like to be able to write something like:               ls -name 'jar:file:/myjar!/myfile'      and see listed the file `myfile` The context of this question is that I need to load Prolog files that are zipped in JARs files, but currently I have not discovered how to do this with the console based Prolog interpreter I am using (YAP). In the hope that at the end the command for loading Prolog files will just submit the request to the operative system, I thought that I just need to find out the right way to refer to files inside JAR or ZIP files in such a way that the operative system understands what I am talking about (I am using OSX).


title: What is the meaning of '.' in the cpio file

text: This is my the content of my rootfs.cpio file:               [root@xilinx output]#  cpio -idv  < rootfs.cpio     .     init     dev     dev/console     1149 blocks       What is `.` here ?


title: Get only file name from find command and mail

text: The following find command will results multiple files and send mail all those               find /home/cde -ctime -1 -name "Sum*pdf*" -exec uuencode {} {} \; |mailx -s "subject" abc@gmail.com      But I am getting attachments like `homecdeSum123.pdf` and `homecdeSum324.pdf`. How to get exact file names in my attachment.


title: Unable to link with shared object file

text: I am trying to generate traces of GPGPU benchmarks on X86 cpu using GPUocelot. For this reason, I am compiling the benchmarks with -locelot and -locelotTrace linker flags. My benchmarks compile and execute fine. However, traces are not getting generated. compile command: `nvcc -arch=sm_20 bfs.cu -o bfs -locelot -locelotTrace`, both libocelot.so and libocelotTrace.so are located in /usr/local/lib/ and LD_LIBRARY_PATH = /usr/local/lib. I verified the shared libraries that are linked to this binary using ldd. I can see that libocelot.so is linked but I don't see libocelottrace.so. I think this is the issue that's resulting in traces not getting generated. How can I make sure the binary is linked to libocelottrace.so?


title: Convert rgba color value to a Terminal supported color

text: Randomly I will take the following example: > `rgba(122, 143, 186, 0.54)` > > ![](http://i.stack.imgur.com/Isq8R.png) How can I convert this color to the closest Terminal supported color?


title: Telnet to port 80 is not showing results

text: I'm trying to a test request/response to `www.google.com` on port `80` as below :               $ telnet www.google.com 80      After that I typed in :               GET / HTTP/1.1     Host: www.google.com      But nothing happens! ![enter image description here](http://i.stack.imgur.com/xiPN2.png) Any ideas would be appreciated.


title: Fedora 8 - out of date?

text: We use Fedora 8 (an Amazon EC2 Public Image) for some of our servers. I see that Fedora is at version 20 now, and Fedora 8 is from around 2006/7. What confuses me is that these servers were installed in 2009, so even then this was quite an old version. Does Fedora 8 have longer support? I thought Centos is used for servers as it's more stable, while Fedora is experimental, but maybe that wasn't the case back then. I wonder if this isn't completely outdated? What are the risks? * * * **Update** Back in 2009 Amazon EC2 used Fedora 8 as default AMI, and it was not possible to install a newer Fedora release. Apparantly Amazon released updates themselves, so they kept it up to date. See http://webcache.googleusercontent.com/search?q=cache:H8Gev23IDqkJ:velohacker.com/2009/10/16/ec2-and- fedora-still-stuck-at-fedora-8/+&cd=1&hl=nl&ct=clnk


title: How to get exit code of a parallel process launched by xargs?

text: I'd made a script for launching parallel rsync process:               #! /bin/bash     LIST=$1     DEST_DIR=$2     RSYNC_OPTS=$3     #echo "rsyncing From=$SRC_DIR To=$DEST_DIR RSYNC_OPTS=$RSYNC_OPTS"     echo $LIST|xargs -n1 -d, echo|xargs -n1 -P 0 -I% rsync --rsync-path='sudo rsync' ${RSYNC_OPTS} % ${DEST_DIR}      Then, I have problems to get the exit status of the rsync process. I know that is possible to get an array of pipestatus, but I need to catch the exit code to know if the rsync was made successfully or not. Anoyone knows?


title: Transparent Proxy

text: I am setting up attempting to set up a transparent proxy on CentOS using Squid. So far I have managed to filter the content and get it working perfectly. The only issue I am having is getting a form of portforwarding to work. The way I'd like it to work is let my router handle portforwarding and the proxy just let all data go from the internet to the lan(dependent on the source IP). My set up is like so: > eth0 - Internet (My main router)   >  eth1 - LAN (10.0.0.0/24)   >  eth1:0 - LAN (81.150.192.224/28) How would I make it so that any requests to the `81.150.192.224/28` network are sent to the correct machine on the interface: `eth1:0` and any requests to the `10.0.0.0/24` network are sent to the correct machine on the interface: `eth1` ? I am using `iptables` and CentOS 6.5.


title: Do files with equal name conflict in unionfs (aufs)?

text: I just tried to mount two folders in one using `aufs` on Debian 7 wheezy. The command I issued is the following:               mkdir /test1     mkdir /test2     mkdir /test     mount -t aufs -o dirs=/test1:/test2 none /test      Then I wanted to see if files with the same name would conflict in the same folder, so I issued this:               touch /test1/file1.txt     touch /test2/file1.txt          echo "A" >/test1/file1.txt     echo "B" >/test2/file1.txt      The result is that `/test` contains only `file1.txt` containing the letter "B" (which means it is the `file1.txt` contained in `/test2`). How can the files not conflict? And which criteria does `aufs` use to choose which file to show if they have the same name?


title: man command: is there a way to know the meaning of the output of a command >

text: Is there a way to know the meaning of the output of a command? Example given: If I type `ls -l`, I get this ouput:               [root@localhost junk]# ls -l     total 8     -rw-r--r-- 1 root root 1862 2012-08-25 16:20 a     -rw-r--r-- 1 root root    0 2012-08-25 15:41 a.c     -rw-r--r-- 1 root root 1907 2012-08-25 16:18 b      Now I want to know here what all these fields (e.g. `-rw-r--r--`, 1862) stand for. Is there a way to do that using `man`?


title: sed - replace string with file contents

text: I have two files: `file1` and `file2`. `file1` has the following contents:               ---       host: "localhost"       port: 3000       reporter_type: "zookeeper"       zk_hosts:          - "localhost:2181"      `file2` contains an IP address (`1.1.1.1`) What I want to do is replace `localhost` with `1.1.1.1`, so that the end result is:               ---       host: "1.1.1.1"       port: 3000       reporter_type: "zookeeper"       zk_hosts:          - "1.1.1.1:2181"      I have tried:               sed -i -e "/localhost/r file2" -e "/localhost/d" file1     sed '/localhost/r file2' file1 |sed '/localhost/d'     sed -e '/localhost/r file2' -e "s///" file1      But I either get the whole line replaced, or the IP going to the line after the one I need to modify.


title: git 1.9 and yum groupinstall "Development Tools"

text: I was reading that installing unofficial repositories in RedHat was not a good idea. So I was trying to install NodeJS on the RH Server and I saw that the git version was 1.7.1. Our team is using 1.9 on their local ubuntus. So I was wondering if I install git 1.9 first (would this break/make the system unstable in any way?- also need this because I need to setup the git server afterwards) and the do the `yum groupinstall "Development Tools"` would this result in conflict issues of some sort? I'm trying to be very cautious here because it's the server the entire team will be using, and don't have the option to create a snapshot to roll back in case something happens...               ==========================================================================================================      Package                   Arch           Version                      Repository                    Size     ==========================================================================================================     Installing:      byacc                     x86_64         1.9.20070509-7.el6           rhel-x86_64-server-6          48 k      cscope                    x86_64         15.6-6.el6                   rhel-x86_64-server-6         136 k      ctags                     x86_64         5.8-2.el6                    rhel-x86_64-server-6         147 k      diffstat                  x86_64         1.51-2.el6                   rhel-x86_64-server-6          29 k      doxygen                   x86_64         1:1.6.1-6.el6                rhel-x86_64-server-6         2.4 M      flex                      x86_64         2.5.35-8.el6                 rhel-x86_64-server-6         286 k      gcc-c++                   x86_64         4.4.7-4.el6                  rhel-x86_64-server-6         4.7 M      gcc-gfortran              x86_64         4.4.7-4.el6                  rhel-x86_64-server-6         4.7 M      git                       x86_64         1.7.1-3.el6_4.1              rhel-x86_64-server-6         4.6 M      indent                    x86_64         2.2.10-7.el6                 rhel-x86_64-server-6         115 k      intltool                  noarch         0.41.0-1.1.el6               rhel-x86_64-server-6          58 k      libtool                   x86_64         2.2.6-15.5.el6               rhel-x86_64-server-6         564 k      patchutils                x86_64         0.3.1-3.1.el6                rhel-x86_64-server-6          95 k      rcs                       x86_64         5.7-37.el6                   rhel-x86_64-server-6         173 k      redhat-rpm-config         noarch         9.0.3-42.el6                 rhel-x86_64-server-6          59 k      swig                      x86_64         1.3.40-6.el6                 rhel-x86_64-server-6         1.1 M      systemtap                 x86_64         2.3-4.el6_5                  rhel-x86_64-server-6          26 k     Installing for dependencies:      libgfortran               x86_64         4.4.7-4.el6                  rhel-x86_64-server-6         265 k      libstdc++-devel           x86_64         4.4.7-4.el6                  rhel-x86_64-server-6         1.6 M      perl-Error                noarch         1:0.17015-4.el6              rhel-x86_64-server-6          29 k      perl-Git                  noarch         1.7.1-3.el6_4.1              rhel-x86_64-server-6          28 k      perl-XML-Parser           x86_64         2.36-7.el6                   rhel-x86_64-server-6         224 k      systemtap-client          x86_64         2.3-4.el6_5                  rhel-x86_64-server-6         3.4 M      systemtap-devel           x86_64         2.3-4.el6_5                  rhel-x86_64-server-6         1.4 M          Transaction Summary     ==========================================================================================================     Install      24 Package(s)


title: How to Pass High Resolution from GRUB2 to FreeBSD?

text: I boot FreeBSD-10-RELEASE from GRUB2. I have set up the GRUB2 boot menu to display very nicely at my laptop's max resolution of 1024x768x32. I know it's possible to pass this resolution to the boot loader with the `gfxpayload` command but it's not working. Within FreeBSD itself I've configured the console to display at this resolution but this doesn't kick in until about midway through the boot device scan. What happens is that after I select my FreeBSD menu entry in GRUB2, the FreeBSD boot loader takes over with the usual FreeBSD boot menu displayed in ugly 640x480 resolution. I've followed every direction I could find that would claim to pass the GRUB2 resolution on but nothing works. Is it possible this function does not work with FreeBSD (because installing and configuring GRUB2 in FreeBSD has been problematic for me from the start) or is there some other configuration specific to FreeBSD? Even though this is not necessary in terms of functionality, it would be nice to have this last little thing after I finally managed to get everything else on my system working great. This would be a nice cherry on top!


title: Amplify quiet passages in an mp3 file

text: I have an mp3 file where is a dialog with two voices and one of the voices is very quiet. Is there a command or application that is able the detect the quiet passages and amplify them? The two voices are alternating. I already tried to do it manually with `Audacity` but this is very time- consuming job.


title: Give every IP address a different hostname?

text: I have a Debian server with 4 IP addresses. All IP addresses use the same hostname. Is it possible to give every single IP address its own unique hostname?


title: how can I change what the command "apt-get update" looks for when executing the update?

text: Forgive my incompetence I am still new to GNU/Linux. I use Debian wheezy. When I type `apt-get update` I get this at the end               W: Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/wheezy/main/source/Sources  404  Not Found          W: Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/wheezy/main/binary-amd64/Packages  404  Not Found          E: Some index files failed to download. They have been ignored, or old ones used instead.      My question is, how would I edit (I'm guessing what apt looks at) to ignore the things that failed to update.. or to remove them completely so I don't get that message anymore. EDIT: The only thing I see in sources.list is               deb ftp.sun.ac.za/debian wheezy main contrib non-free     deb-src ftp.sun.ac.za/debian wheezy main contrib non-free     deb security.debian.org wheezy/updates contrib non-free main     deb-src security.debian.org wheezy/updates contrib non-free maim      and that's it. Should I delete one of these? I looked inside `sources.list.d` as well and that came up empty 2nd EDIT: The output of `apt-cache policy` is               Package files:      100 /var/lib/dpkg/status          release a=now      500 http://ppa.launchpad.net/webupd8team/java/ubuntu/ trusty/main amd64 Packages          release v=14.04,o=LP-PPA-webupd8team-java,a=trusty,n=trusty,l=Oracle Java (JDK) 6 / 7 / 8 Installer PPA,c=main          origin ppa.launchpad.net      500 http://security.debian.org/ wheezy/updates/non-free Translation-en      500 http://security.debian.org/ wheezy/updates/main Translation-en      500 http://security.debian.org/ wheezy/updates/contrib Translation-en      500 http://security.debian.org/ wheezy/updates/main amd64 Packages          release v=7.0,o=Debian,a=stable,n=wheezy,l=Debian-Security,c=main          origin security.debian.org      500 http://security.debian.org/ wheezy/updates/non-free amd64 Packages          release v=7.0,o=Debian,a=stable,n=wheezy,l=Debian-Security,c=non-free          origin security.debian.org      500 http://security.debian.org/ wheezy/updates/contrib amd64 Packages          release v=7.0,o=Debian,a=stable,n=wheezy,l=Debian-Security,c=contrib          origin security.debian.org      500 ftp://ftp.sun.ac.za/debian/ wheezy/non-free Translation-en      500 ftp://ftp.sun.ac.za/debian/ wheezy/main Translation-en      500 ftp://ftp.sun.ac.za/debian/ wheezy/contrib Translation-en      500 ftp://ftp.sun.ac.za/debian/ wheezy/non-free amd64 Packages          release v=7.4,o=Debian,a=stable,n=wheezy,l=Debian,c=non-free          origin ftp.sun.ac.za      500 ftp://ftp.sun.ac.za/debian/ wheezy/contrib amd64 Packages          release v=7.4,o=Debian,a=stable,n=wheezy,l=Debian,c=contrib          origin ftp.sun.ac.za      500 ftp://ftp.sun.ac.za/debian/ wheezy/main amd64 Packages          release v=7.4,o=Debian,a=stable,n=wheezy,l=Debian,c=main          origin ftp.sun.ac.za     Pinned packages:      **3rd and final EDIT:** after entering `grep -Ri launchpad *` I was able to look at what the results I got back were and proceeded to enter `nano sources.list.d/webupd8team-java.list` and delete everything that was there. I then proceeded to also enter `nano sources.list.d/webupd8team-java- wheezy.list` and deleted everything that was there as well. Then I did `apt- get update` and everything is back to normal . Hope this helps anyone that might be facing the same problem.


title: Can p7zip create smaller zip files than winzip?

text: 7-Zip for Windows creates smaller zip archives than WinZip, so presumably P7zip can create smaller zip archives than Zip in Linux. So how do I create zip files using P7zip in Linux?


title: Using WiFi port as redundant link

text: I want to use WiFi port of my server as redundant link for copper connection to my home DSL router. My router if SAGEM 2704 with very limited functionality. So practically the only possibility is to configure something on the server. Is it possible to use WiFi for redundancy. If so, what I have to implement on my server?


title: How do I source another process's environment variables?

text: If I examine `/proc/1/environ` I can see a null-byte-delimited string of process `1`'s environment variables. I'd like to bring these variables into my current environment. Is there an easy way to do this? The `proc` man page gives me a snippet which helps be print out each environment variable on a line-by-line basis `(cat /proc/1/environ; echo) | tr '\000' '\n'`. This helps me verify the contents are correct, but what I really need to do is source these variables into my current bash session. How do I do that?


title: Debian "Graphical expert install" mode

text: I made a partitions on a new SSD drive (empty), now I want to install Debian, use netinst ISO CD. I chosed "Graphical expert install" type, which show a series of questions. When installation process come to a **Partition disks** step, there is a lot of options, and what's unclear:   * `"Bootable flag : off/on"` - should I set it " **On** " for **Boot** partition? Should I **skip** it for the other partitions, or should set it **Off** for the rest partitions?   * `"Format the partition: no keep existing data"` - should I format partitions, even they are empty?   * `Reserved blocks: 5%` - should I use this option? (SSD disk 60GB but really show 55.80GB available, so I assume that ~7% space already reserved?)   * Should I set/change any flag for Swap partition? Currently it marked "F". What steps should I make starting with "Partition disks" page? Overall, the Debian installer is unclear at this point and does not make installation easier.


title: compare two files based on a column and print it

text: I have two big files of 400,000 lines. I want to compare the column 1 of the second file with column 1 of first file recursively. If they match I would like to print the whole line. It is a sorted file.                     file 1:                name   values               aaa    10               aab    acc               aac    30               aac    abc                 file2:               aaa               aac                aac               aad       since the file contains 400,000 lines it takes time to process. My current solution is like this                   #!/bin/ksh        while read line        do        var=`echo $line `        grep "$var" file1 >> /dev/null        if [ $? -eq 0 ]        then        grep "$var" file1 >> present        else        echo " $line missing " > missing         fi        done < "file2"      Since I am using `grep` here, the value may be present some where in the file1 other than the intended column1, I don't want that to happen. My expected solution:   1. compare the second file only with the column 1 of first file (even if we do this way it takes long time).    2. Using a `perl` script with file pointer compare two columns of the files. If the string matches print it. Else if the column 1 of first file is greater than that of second file increment the file 2 AND COMPARE. If it is VICE VERSA increment the column 1 of file 1 and compare.


title: Make Compose not compose after certain key presses

text: On my laptop, I use the `Win` as a modifier. With the `Fn` key pressed, the key sends a different keysym and I use that as a Compose key.               keycode 133 = Hyper_L     keycode 134 = Multi_key     add mod4 = Hyper_L      I have some window manager key bindings of the form `Hyper`+`KP_ _N_`. On a laptop, this requires pressing and holding `Win`, then pressing and holding `Fn`, then pressing `KP_ _N_` and finally releasing everything. If I press `Fn` before `Hyper`, this sends the `Multi_key` keysym instead of `Hyper_L`, so I'm pressing Compose. I find the finger coordination required to press `Fn` before `Hyper` to be a lot less, so I'd like to be able to do that. If I then press a keypad key (which requires `Fn`), I want the key press to be interpreted as the `mod4` modifier instead of `Multi_key`. I can add the `mod4` modifier to the `Multi_key` keysym, and this makes my window manager bindings work when I press `Fn` and `Hyper` in either order. However, if I press `Fn` first (which is how it happens naturally), this records a `Multi_key` keysym, so a key sequence like `Fn`+`Hyper`+`KP_1`, `a`, `'` ends up switching to workspace 1 and inserting `á` instead of `'a`, because the application that is focused after the keyboard shortcut activates receives a key release event for `Multi_key`. How can I have my cake and eat it?   * If I press `Hyper` and `Fn` in either order, then press a keypad key, this should only trigger my window manager binding and not leave a pending `Compose`. Either the application should not receive a key release event for `Multi_key`, or it should receive another event (injected by the window manager) that will effectively cancel the first one.   * If I press and hold `Fn` and press `Hyper`, then release them both, this should send a press and release event for `Multi_key`. I don't mind whether this is done through a change of my keyboard configuration, or of my window manager bindings, or both. The window manager is sawfish, so it's pretty flexible. If the solution involves XKB, I don't want to define my whole keyboard configuration through XKB. The XKB part should focus on defining a group for the affected keys (or whatever it takes).


title: forward outgoing traffic port using iptables

text: I am trying to forward all outgoing traffic from port 80 to port 8080 using `iptables` and I tried the following rule, though it did not work:               iptables -t nat -A OUTPUT -p tcp --dport 80 -j  REDIRECT --to-port 8080      Also, for incoming traffic I need a rule that forward port on the same host not to be as proxy.


title: Extract file name from path in awk program

text: I have an awk script and I have passed a CSV file to it.               awk -f script.awk /home/abc/imp/asgd.csv      What am I doing is to get FILENAME within `script.awk`. FILENAME gives me the whole path. As I am in awk I cannot use `basename FILENAME`.               print FILENAME;     /home/abc/imp/asgd.csv      I have tried with this within `script.awk`               echo $FILENAME | awk -F"/" '{print $NF}'      but I cannot execute this within `script.awk`. How can I get `asgd.csv` within an awk program?


title: Kioptrix Level 1: Determining IP information for eth0 failed

text: I'm trying to set up a Kioptrix VM in VMware Player, in order to analyze it from a separate VM using Kali Linux. The VM can be found on this page: http://www.kioptrix.com/blog/test-page/ When booting Kioptrix Level 1, it fails to set up its `eth0` interface with the following error message: > Determining IP information for eth0… failed I've checked the VM's MAC address and it hasn't been changed from the one in the original downloaded archive (I have noticed that this was a potential issue when searching for answers to my problem). The network adapter from this VM is set to bridged by default. I have also tried setting it to use NAT but to no avail. Moreover, by booting a third Ubuntu 12 VM (and configuring its connection to use NAT), I can ping it from Kali and vice-verse just fine. The host OS is an x64 Windows 8 machine. What could be causing Kioptrix to fail to start up its network interface?


title: GCC (toolchain) for Ralink SoC - ELF not found and syntax error

text: I bought a Chinese P2P camera and there was no MJPEG stream, so I wanted to compile `mjpg-streamer` for it. Here's my CPU's info:               # cat /proc/cpuinfo      system type             : Ralink SoC     processor               : 0     cpu model               : MIPS 24K V4.12     BogoMIPS                : 239.61     wait instruction        : yes     microsecond timers      : yes     tlb_entries             : 32     extra interrupt vector  : yes     hardware watchpoint     : yes     ASEs implemented        : mips16 dsp     VCED exceptions         : not available     VCEI exceptions         : not available          # uname -a     Linux (none) 2.6.21 #878 Tue Oct 29 09:53:25 CST 2013 mips unknown      I tried to use Sourcery CodeBench for MIPS GNU/Linux (latest version) and attempted to compile a simple 'Hello world' example with this command:               $ mips-linux-gnu-gcc -Wall hello.c -o hello      After execution I received the following message:               # ./hello      ./hello: line 1: ELF@04: not found     ./hello: line 2: syntax error: "(" unexpected      Next I tried to recompile with this command:               $ mips-linux-gnu-gcc -mips16 -Wall hello.c -o hello      But the result was:               # ./hello      ./hello: line 1: syntax error: "(" unexpected        * Am I using the wrong compiler, if so which is the correct one?   * Am I missing or using the wrong arguments? **EDIT:**               $readelf -h HKIPC #Extracted file from the device     ELF Header:       Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00        Class:                             ELF32       Data:                              2's complement, little endian       Version:                           1 (current)       OS/ABI:                            UNIX - System V       ABI Version:                       0       Type:                              EXEC (Executable file)       Machine:                           MIPS R3000       Version:                           0x1       Entry point address:               0x406420       Start of program headers:          52 (bytes into file)       Start of section headers:          643764 (bytes into file)       Flags:                             0x10001007, noreorder, pic, cpic, o32, mips2       Size of this header:               52 (bytes)       Size of program headers:           32 (bytes)       Number of program headers:         6       Size of section headers:           40 (bytes)       Number of section headers:         25       Section header string table index: 24          $file HKIPC      HKIPC: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked (uses shared libs), stripped      -               $readelf -h hello #Compiled with mips-linux-gnu-gcc -mips2 -EL -mabi=32 hello.c  -o hello     ELF Header:       Magic:   7f 45 4c 46 01 01 01 00 01 00 00 00 00 00 00 00        Class:                             ELF32       Data:                              2's complement, little endian       Version:                           1 (current)       OS/ABI:                            UNIX - System V       ABI Version:                       1       Type:                              EXEC (Executable file)       Machine:                           MIPS R3000       Version:                           0x1       Entry point address:               0x400430       Start of program headers:          52 (bytes into file)       Start of section headers:          2732 (bytes into file)       Flags:                             0x70001005, noreorder, cpic, o32, mips32r2       Size of this header:               52 (bytes)       Size of program headers:           32 (bytes)       Number of program headers:         8       Size of section headers:           40 (bytes)       Number of section headers:         34       Section header string table index: 31          $file hello     hello: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked (uses shared libs), with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x1040000, not stripped


title: Changing permission from read only in linux?

text: I am trying to get the automatic brightness bug fixed in Linux Mint 17 based on the new Ubuntu release. In order to do this i had to create a file named                   20-intel.conf      in location                   /usr/share/X11/xorg.conf.d      but this file and every other file in this directory has read only permissions on it. How do I change this permission to at least this file so that I can edit it?


title: Anyway to use HTTP Authentication with Axel Downloader?

text: Is there anyway to use http authentication with axel downloader? I don't want to use another solution such as aria2c because they don't support more than 16 concurrent connections.


title: Daylight saving option on Linux servers

text: My CentOS server is not updating showing correct time. I have set               $ ln -sf /usr/share/zoneinfo/Europe/London  /etc/localtime      Still I am on GMT. I do see the following entries in `/etc/sysconfig/clock`:               $cat /etc/sysconfig/clock     ZONE="Europe/London"     UTC=true     ARC=false Still it is not showing correct time. NTP is running on this server:               $ ntpq -p     remote           refid      st t when poll reach   delay   offset  jitter     +         IP Address      3 u   42 1024  377    0.476   63.077   0.001     *         IP Address      3 u   53 1024  377    1.183   30.425   0.001 The ntp servers have the correct time. These are Windows Domain Controllers. I have checked out the answer from here http://serverfault.com/questions/267629/configure-centos-with-ntp but that hasn't helped on this case. Any ideas?


title: Launch 2 celery processes via cron

text: I'm trying to chain some commands to periodically check/launch two processes via `cron` (I'm on a shared host, can't change things around). After a lot of googling around, all the things I've done don't work properly: Trying to launch them separately in two cron jobs cascades and crushes the server (maybe because the `grep` command doesn't manage to catch the search words because they are parameters, I don't understand):               ps -fu $USER | grep celeryd >/dev/null || $HOME/python27/bin/python $HOME/utilities/manage.py celeryd -E -B --concurrency=1     ps -fu $USER | grep celerycam >/dev/null || $HOME/python27/bin/python $HOME/utilities/manage.py celerycam      And these other variants where I try to launch the processes together on the same `cron`, launch only the first process:               ps -u $USER | grep python >/dev/null || $HOME/python27/bin/python $HOME/utilities/manage.py celeryd -E -B --concurrency=1 & $HOME/python27/bin/python $HOME/utilities/manage.py celerycam &          ps -u $USER | grep python >/dev/null || ( $HOME/python27/bin/python $HOME/utilities/manage.py celeryd -E -B --concurrency=1 & $HOME/python27/bin/python $HOME/utilities/manage.py celerycam; )          ps -u $USER | grep python >/dev/null || ( $HOME/python27/bin/python $HOME/utilities/manage.py celeryd -E -B --concurrency=1; ) sleep 30s; ( $HOME/python27/bin/python $HOME/utilities/manage.py celerycam; )      I gave up trying to use grep and took advantage of the `\--pidfile` option of the `celery worker`; `celerycam` doesn't allow multiple instances so I don't need any `grep` there to check for it:               $HOME/python27/bin/python $HOME/utilities/manage.py celery worker -E -B --concurrency=1 --pidfile=worker.pid     $HOME/python27/bin/python $HOME/utilities/manage.py celerycam


title: Recover Windows partition in a GPT disk (previously MBR)

text: I have tried installing Arch Linux and what I ended up with was a partition scheme like this:               /dev/sda:      /dev/sda1  NTFS partition (Windows 7)      /dev/sda2  ext4 (Arch)      /dev/sda3  swap      I don't know why, but for some reason I have been unable to mount the NTFS partition under Linux. It's worth mentioning that the first partition is, for some reason, detected as an EFI partition and as on a GPT-formatted disk (my computer doesn't have an EFI bootloader and the drive has always had an MBR partition table). I deleted the `sda2` and `sda3` using the Windows repair disk and was about to install a second Windows 7 installation alongside the first partition, but an error reported that the entire disk is a GPT drive! The "Used" and "Free space available" sections indicate that the data on the first partition is still there, it's just that I cannot access the actual partition by any means. **It seems that the first partition is with an MBR partition table on a GPT style disk.** How do I access the data on the partition?


title: How can I mount vxfs FS to two or more Solaris servers?

text: I want to have two Solaris servers share the same SAN vxfs Filesystem. Though at a time just one would be accessing the share. This is to allow for a quick failover in case the primary server undergoes an unplanned outage for some reason. From the Oracle Solaris Cluster Software Installation Guide, it seems a cluster needs to be setup and VxVM Software needs to be running on both servers to manage the cluster - which seems quite complicated in comparison to simply mounting a NAS share on two or more servers, for creating a shared filesystem. Could someone kindly point me in the right direction?


title: How can I access the log via a php script?

text: I have a statistics-file on my apache server on               /var/www/vhosts/test/statistics/logs/access_log      I tried using               echo system('cat /var/www/vhosts/test/statistics/logs/access_log');      in a php script to access it but I get no output.               echo system('dir');      gives the expected dir output.               cat /var/www/vhosts/test/statistics/logs/access_log      using a putty connection and as root works though. How can I access the log via the php script?


title: How to see that what disks are on a QLogic FC adapter on linux?

text: So that example I can check:               lrwxrwxrwx 1 root root   9 Jul 23 11:20 scsi-3600508e000000000XXXe71e04ffYYY0f -> ../../sda     lrwxrwxrwx 1 root root  10 Jul 23 11:20 scsi-3600508e000000000XXXe71e04YYY1f0f-part1 -> ../../sda1     lrwxrwxrwx 1 root root  10 Jul 23 11:20 scsi-3600508e000000000XXXe71e04fYYYf0f-part2 -> ../../sda2     lrwxrwxrwx 1 root root   9 Jul 23 14:15 scsi-360080e5000230fc0000001ca4XXX8e06 -> ../../sdd     lrwxrwxrwx 1 root root   9 Jul 23 14:15 scsi-360080e500023139c000001cf4dXXXe68 -> ../../sde      that sda is a physical RAID disk and the other two is FC.


title: Can I reload variable in a watch command?

text: Part of my job involves some data handling. One of the tasks is to 'flatten' a set of directories (which we'll call _Dir_ for now), and copy them to a new location called DirFlat. This can take a long time (30 minutes ->2-3 hours)! I'd like to be able to watch the progress, so I use `find Dir -type f|wc -l` to get the number of files (lets call this `$Filenum`, and then I run a very short command that I wrote (retyping from my notebook, may have copied it wrong, I hope you get the gist): `echo $(echo "($ls DirFlat |wc -l)*100/$FileNum"|bc) "%" $(date)` However, if I run `watch -n 100 "!!"` it takes the output of the echo, and keeps printing that (even the date doesn't change). Can I get this to refresh the variable/re-run the assignment of the internal variables in BASH? Hopefully this will help me in automating some of my tasks.


title: What does the Virtual kernel Memory Layout in dmesg imply?

text: While going through the **"Output of dmesg"** I could see a list of values which i am not able to understand properly.               Memory: 2047804k/2086248k available (3179k kernel code, 37232k reserved, 1935k data, 436k init, 1176944k highmem)     virtual kernel memory layout:         fixmap  : 0xffc57000 - 0xfffff000   (3744 kB)         pkmap   : 0xff800000 - 0xffa00000   (2048 kB)         vmalloc : 0xf7ffe000 - 0xff7fe000   ( 120 MB)         lowmem  : 0xc0000000 - 0xf77fe000   ( 887 MB)           .init : 0xc0906000 - 0xc0973000   ( 436 kB)           .data : 0xc071ae6a - 0xc08feb78   (1935 kB)           .text : 0xc0400000 - 0xc071ae6a   (3179 kB)      From the values i understand that i have 2GB RAM(Physical memory). But rest of the things seems to be Magic Numbers for me. I would like to know about each one (fixmap, pkmap,.. etc.) in brief(if more doubts, I will post each one as a separate Question)? Could someone explain that to me?


title: How do you make samba follow symlink outside the shared path

text: This is ubuntu server 10.04 64 and samba 3.4.7 I have a shared directory /home/mit/share and another one /home/temp that I link into the shared one:               ln -s /home/temp /home/mit/share/temp      But on windows, after net use'ing I cannot open S:/temp, on linux it is possible to access /home/mit/share/temp like expected. This works if I link directories inside /home/mit/share/temp, so I guess samba is restricting to jump with a link outside/above the shared directory. EDIT: See also this question: http://superuser.com/questions/128716/ubuntu-latest- samba-version-symlinks-no-longer-work-on-share-mounted-in-windo It seems best to put `unix estensions = no` into the global section and `follow symlinks = yes` and `wide links = yes` only into the shares section, where you really need it. The `unix extension` flag has to live in the global section and not in the individual shares sections. But for security reasons it is better to use the other options only where you need it, and not globally.


title: How to backup all installed software/packages on AIX?

text: Are there any ways to backup all the packages on an AIX 6.1 machine?


title: Linux webcam software

text: What are some good full-featured (whatever that means) webcam applications in linux. I know about cheese, but found some of its features lacking. Are there any others?


title: What's the name of the technology that instantly boots to Linux from within Windows?

text: I once had some package that you could run to instantly replace a running Windows instance with a running Linux instance. I'm not talking about virtualization or coLinux. I'm talking about the moral equivalent of hot- swapping out the Windows kernel and replacing it with a Linux kernel. It may have only worked on Win9x for all I can remember. But I haven't been able to think of the name or find it since I happened upon it many years ago.


title: Is it possible to define where the .bash_profile is located on the bash command line?

text: I'm running bash programmatically from objective c to create a terminal-like application. Once launched I would like to execute some commands prior to turning control over to the user. Normally these would be in the `.bash_profile`. This file is not accessible to me and not something I would want to mess we anyway as I don't want to effect the standard bash environment for the user. I tried the `-c script.sh` switch but after script.sh is done running, bash exits. Are there any other options I have other than programmatically typing out the command I need run? I would rather not have the user see everything.


title: Cut on both characters and field

text: I have a record like :               2011-05-29 17:51:34 => 'HS|CMGC|RN431|CI13950|CH7-4a37-afe2-acabfc9d262d|DA110529|TI175133|'      I want my final output to be something like:               2011-05-29 17:51:34  CI13950      I can get each part using cut like this:               $ cut -c 1-19     2011-05-29 17:51:34     $ cut -d  '|' -f 4     CI13950      I am unable combine the two as:               $ cut -c 1-19 -d  '|' -f 4     cut: only one type of list may be specified      Any suggestions?


title: ls outputs multiple columns even if piped to grep with grml's zsh config

text: I just decided to give zsh a go against Bash and came across some unhandy behaviour about which I couldn't find anything on the net: If you do a `ls | grep foo` in Bash, the `ls` only contains one file per line so that `grep` only outputs the matching files. It seems like somewhere (and since I couldn' find anything in the config I think it must be the Bash code itself), the `-1` option is passed to `ls`.   zsh however doesn't do that magic: If you pass `ls` without further options to `grep`, it does just that and you also get result's which coincidentally appeared on the same line as a match. My idea to achieve the Bash behaviour in zsh would have been to detect whether a `ls` output will be piped into `grep` and define something like an alias for such cases. But I'm not sure how and if that's possible at all. **Update:** As larsks points out below, Bash doesn't do anything special here and it's really `ls` which is supposed to work that way if the output doesn't go to a terminal. Nevertheless, here's what happens to me:               > ls     a  b  c  d  e  f  g  h          bash$ ls | grep b     b          zsh> ls | grep b     a  b  c  d  e  f  g  h      I've been able to reproduce that on Ubuntu 11.10 with zsh 4.3.11 and GNU coreutils 8.5 as well as on a Debian Squeeze machine with zsh 4.3.10. **Update 2:** While investigating a bit more, I found out that this error only appears when the grml .zshrc is active. There must be something in there which which opens a terminal for the output if it is piped. Does anybody know what to look for?


title: Do I need root (admin) permissions to run userspace 'perf' tool? (perf events are enabled in Linux kernel)

text: Do I need to have to run `perf` userspace tool as system administrator (root), or can I run it (or at least some subcommands) as an ordinary user?


title: CutyCapt seems to ignore the Xvfb screen size parameters

text: I have a problem using CutyCapt to create images rendered for a particular screen size. For example, if I do these:               xvfb-run --server-args="-screen 0, 800x600x24" \       ~/bin/CutyCapt/CutyCapt --url='http://stackoverflow.com/search?page=2&tab=relevance&q=cutycapt%20xvfb' \         --out=STACKOVERFLOW_1.png     xvfb-run --server-args="-screen 0, 800x600x24" \       ~/bin/CutyCapt/CutyCapt --url='http://stackoverflow.com/questions/65078/what-is-the-best-way-to-create-a-web-page-thumbnail' \         --out=STACKOVERFLOW_2.png      I get images of sizes:               STACKOVERFLOW_1.png : 975x2611     STACKOVERFLOW_2.png : 975x2226      I believe any stackoverflow page will be of a width of 975 pixels. This is not what I asked (w=600). Is it possible to create images using CutyCapt with Xvfb that are rendered for a particular screen width? PS: `uname -a` yields `Linux yalabs-linux0.yandex.net 2.6.27-17-server #1 SMP Fri Mar 12 02:48:52 UTC 2010 x86_64 GNU/Linux`


title: How can I find out what keys gpg-agent has cached? (like how ssh-add -l shows you cached ssh keys)

text: `ssh-add -l` shows you all ssh-keys that have been added with `ssh-add ~/.ssh/id_yourkey`. How do I do the analogous thing with gpg and gpg-agent, in other words, ask it to show a list of cached keys?


title: Modifying resolv.conf when when bringing network interface up on system startup

text: My Linux box currently has a network interface that allows me to connect to a network on a different subnet. I've achieved this by modifying the routing table when the network interface is brought up. The 'remote' network also has a DNS server so I want to add that to my /etc/resolv.conf file when the interface enabled. My `/etc/network/interfaces` file currently has the following:               # Secondary network interface (using NAT)     allow-hotplug eth1     iface eth1 inet dhcp             post-up route add -net 172.16.0.0 netmask 255.255.255.0 gw 10.0.3.2             post-up echo 'Up and running...' >> /home/sysadmin/net-result.txt; date >> /home/sysadmin/net-result.txt             post-up sed -i '1inameserver 172.16.0.1' /etc/resolv.conf             post-down sed -i '/^nameserver 172.16.0.1/d' /etc/resolv.conf      (The line `post-up echo...` is just there to prove that the commands are being run and that they have access to the file system.) This works fine when I use `ifup eth1` and `ifdown eth1` from the command line to control the interface. The line `nameserver 172.16.0.1` appears (and disappears) in `/etc/resolv.conf` as expected. However, it's not working on system startup for some reason. The `route` command _is_ being executed (because I can see the modifications in the routing table) and the `/home/sysadmin/net-status.txt` file is also being modified as expected, but `/etc/resolv.conf` does not change. I can't work out what the problem is. Does anyone have any suggestions? (The Linux box is actually a virtual machine, and the remote network is accessed via a VPN, but I don't think either of these details really have a bearing on the problem in this context.)


title: Trying to install gearman on CentOS, and ./configure cannot find event.h even though libevent is installed

text: I'm trying to compile and install gearman onto a CentOS 6 box, and am getting an error when I compile from its source code. It requires the boost libraries, and was failing on that at first, but I installed those and it gets past that. Now, however, when I run ./configure it is failing with the message:               . . .     checking for ld that supports -Wl,-z,relro... yes     checking event.h usability... no     checking event.h presence... no     checking for event.h... no     configure: error: Unable to find libevent      So I installed libevent like so:               yum install libevent.i686      And that didn't help. So I downloaded the source to my home directory, extracted it to a sub directory within my home directory, ran `./configure` and then `make install` and then tried `./configure` on the gearman source, but it still gives me the `configure: error: Unable to find libevent` message. You can imagine how annoying that is! Especially after I tried installing libevent via yum and then installed it from source. Any tips to get gearman ./configure to get past this message? Thanks!


title: How can I see which package manager is running?

text: I'm on Debian 6.0.5 (squeeze) and every now and then I see the following icon in the notifications area of the GNOME2 pannel: ![enter image description here](http://i.stack.imgur.com/hFHrj.png) but black instead of red. It reads **_A package manager is working._** Usually it just displays the red one after a few seconds, which is _Available updates_ , so I assume it was just looking for updates. But sometimes that's not the case. I don't have the option to auto-install updates so that's probably not it, so I was wondering if there's a way to see which package manager is running. Clicking on it just opens Synaptic Package Manager, but it does not says what's running.


title: 2.6.35 armel header files?

text: Debian does not seem to include a package linux headers 2.6.35-9 for the armel chipset - compiling drivers work, but insmod, and insmod -f is failing with a version mismatch and invalid moduel format. Could anyone point me to the debian linux headers for 2.6.35-9 please?


title: How come zipping a created disk image, makes smaller files than piping?

text: Case 1. I use `dd` to create an image:               dd if=/dev/rdiskx of=/path/to/image bs=1m.       It's 16 GB in size. I zip it, and it's suddenly around 100 MB. Case 2. I use `dd` to create an image, piping it through gzip:                dd bs=1m if=/dev/rdiskx | gzip > image.gz.       It's 11 GB in size. How come, and is there anything I can do about it?


title: Which Linux distro has a first-class KDE desktop experience and is stable and simple?

text: I am using Ubuntu 12.04 currently and I love it for: It just works for all hardware Wide selection of packaged applications that are configured by `dpkg` scripts Painless configuration for what matters (Wifi and wired connections, extra screens, power saving) Very easy to install proprietary software I want to switch to a KDE-based distros. But most choices seem to fall among:   1. second-rate KDE experience(not tweaked for anything, no native configuration tools)   2. Against proprietary software, very difficult to configure, brittle to many use cases, unstable (Mageia 2 was one) I considered: Debian: Its stable, but a bit untweaked and not satisfy my need of cutting edge Kubuntu: Unstable, consumes too much CPU * * * I shortlisted Mint which is based on Ubuntu. And Maybe Aptosid. Are there better choices?


title: PS1 variable no longer shows coloured bash prompt

text: I'm running a VPS with Centos 6.5 I've setup `~/.bash_profile` as in the following screenshot: ![enter image description here](http://i.stack.imgur.com/o76m6.png) It used to give me an output like this: ![enter image description here](http://i.stack.imgur.com/wvUAC.png) Now that I've installed WHM/Cpanel I no longer see coloured prompt. `echo $PATH` shows:               /usr/local/jdk/bin:/home/jay/perl5/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin:/home/jay/bin      How can I fix this? Can anyone help me? Everything else works according to the configuration. Grep and ls shows coloured outputs. I need this to work as I find it convenient to quickly spot previous commands and outputs.


title: Make a symbolic link to a relative pathname

text: I can do this:               $ pwd     /home/beau     $ ln -s /home/beau/foo/bar.txt /home/beau/bar.txt     $ readlink -f bar.txt     /home/beau/foo/bar.txt      But I'd like to be able to do this:               $ pwd     /home/beau     $ cd foo     $ ln -s bar.txt /home/beau/bar.txt     $ readlink -f /home/beau/bar.txt     /home/beau/foo/bar.txt      Is this possible? Can I somehow resolve the relative pathname and pass it to `ln`?


title: Transition to linux

text: How does someone with major experience in other OS's make a transition to Linux if one's been using it for a while, on and off for two years. By transition I mean everyday use without booting to something else. How does someone learn some advanced operation skills with shell for everyday use? Note that I'm not asking about the basic skills, I get stuck with other things that are deeply involved with the system itself and can only come with everyday use. I know there are books and sites around that can help, but I guess I'm asking what the easiest way is to do it instantly.


title: How to reorder a large number of columns?

text: I'm looking for a pipeable one-liner to reorder a large number of columns (where manually entering the column numbers in e.g. an `awk` command such as `awk '{print $3,$2,$1}'` is not feasible). The order could be given by a sorting scheme (alphabetical, numerical - so like 'sort' but acting on columns rather than rows.) or be arbitrarily given in a text file.


title: systemd start unit after another unit goes inactive

text: Is there any way to delay a unit from starting up once another unit goes inactive? I have a startup process (oneshot.service) that runs as a one-shot and sets up the environment for all other processes to utilize and then exits (which makes the service report inactive). However, I want to wait till that process is done before kicking off all the other processes. I was hoping there would be some type of signal or something that other service files could queue off of. Using the "After=oneshot.service" doesn't yield what I want as it will start up other processes before the oneshot.service finishes. A more practical example is having a SNMPD SubAgent delay it's startup until after the SNMPD Agent is up and running... otherwise there is no communication between the Agent and Subagent unless you startup the Subagent an unknown amount of time after the SNMPD Agent is started.


title: Error "ssh_exchange_identification" with Corkscrew

text: I'm trying to reach my ssh server (i'm behind a corporate proxy) so I tried to use Corkscrew. My ssh server is listening on port 443, I put `sshd: ALL` in my /etc/hosts.allow and there's nothing into my /etc/hosts.deny. I'm using the following command to launch a ssh session over Corkscrew :               ssh -D991 -p443 user@ssh_server_ip -o"ProxyCommand corkscrew proxy_ip proxy_port %h %p proxy_username proxy_password"      But I get the following error : `ssh_exchange_identification: Connection closed by remote host` I had the same issue when I was trying to use httptunnel (hts) and I wasn't behind a proxy (it was at home for tests). How can I fix that?


title: How to telnet via proxy authentication?

text: I am behind a proxy server in my college. It uses a simple username and password authentication. And i connect to the proxy server to port 3128. now i want to telnet simply to say any website on the internet like               $ telnet www.google.com 80      this gives me               error telnet: could not resolve www.udacity.com/80: Name or service not known      How can I define the proxy settings for telnet? I have already set environment variables `http_proxy` and `HTTP_PROXY`. Also have applied system wide proxy.


title: What provides LSB virtual boot facilities for Debian?

text: Debian's version of Sysv init uses scripts which reference various LSB "virtual" boot facilities such as `$local_fs` and `$network` as requirements for use by insserv in setting up the boot sequence, but they are not necessarily provided by any `/etc/init.d` script. `/etc/insserv.conf` refers to them to, but only to define what services must "declare the required dependencies of the facility". To me, this would mean that the list of services "must declare the dependencies _of_ the facility", but perhaps it is just a poor choice of words, since looking at an actual `insserv.conf` implies that it actually means this list "must declare the facility _as_ a dependency", which is very different (any clarification of that would be appreciated). It is obvious that things such as `$network` (which seems to refer simply to the possibility of a physical link, i.e., not an actual dhcp lease, etc.) and `$local_fs` would be provided by the kernel during boot, but I cannot find any documentation which explains how they would be considered pre-defined as available or not available by the init system.


title: Shell script how to read input from a file

text: I need to read input from a file given in following format.               $ ./process_data.sh arg1 < input_data.txt      How do I read `input_data` in my shell script `process_data.sh`?


title: Is it possible to redirect X of an ssh session to the display of a connected vncviewer

text: I have a setup of three machines. Machine `A` runs a vncserver and an ssh server, Machine `B` runs a vncviewer, Machine `C` runs an ssh client. The vncviewer on `B` connects to the vnc server on `A`. The ssh client on `C` connects to the ssh server on `A`. Is it possible that from the ssh session in `C` I spawn a process ( say xclock) on `A` so that the process shows up in the vncviewer on `B`'s screen. Basically I am looking for the value to set DISPLAY variable to so that this can be achieved. PS : Please reword the title of my question if you find that it doesn't appropriately describe my question


title: find -exec mv stops after first exec

text: While researching for this question: Find and move directories based on file type and date, I stumbled upon a problem of my own. First I created a bunch of directories with files in them:               seq 10 | while read dir; do       mkdir dir$dir       touch dir$dir/file.txt       seq 5 | while read file; do         touch dir$dir/file${dir}_$file       done     done      Then I tried following find command:               $ find -type f -name "*.txt"     ./dir6/file.txt     ./dir8/file.txt     ./dir10/file.txt     ...      Works as expected. Now with an `-exec`:               $ find -type f -name "*.txt" -exec sh -c 'echo mv -v "${0%/*}" ../bar' {} \;     mv -v ./dir6 ../bar     mv -v ./dir8 ../bar     mv -v ./dir10 ../bar     ...      Works as expected. Now the actual command:               $ find -type f -name "*.txt" -exec sh -c 'mv -v "${0%/*}" ../bar' {} \;     `./dir6' -> `../bar/dir6'      It stops after the first `mv`. No error message. Exit status is 0. The directory `bar` exists and `dir6` is moved correctly. When I execute again this happens:               $ find -type f -name "*.txt" -exec sh -c 'mv -v "${0%/*}" ../bar' {} \;     `./dir8' -> `../bar/dir8'      Again stop after the first `mv`. Exit status is 0. `dir8` is moved correctly. Why does `find` stop after the first `mv`? Because the directory is moved and `find` is confused? Why does it not print an error or return an error exit status? When I create more directories and more files it has the same behaviour. In the question linked above the problem is that `find` executes once without problem but print errors for all matches after that. Is this related? Using `find (GNU findutils) 4.4.2`.


title: perform remote sqlite command

text: If this should be moved to the DBA exchange, I apologize. Feels more like linux than DB to me, so here goes: I've got some machines that run scheduled cron jobs every night and email me the output. I do not want emails for things like this. In general I think the way we use email is broken, but that's another story. So I started thinking that I could keep a central SQLite database that stored information about when the jobs started, and finished, and maybe even the output. Then I could just build a webpage that queries that and let's me know was going on last night. So I came up with a simple schema and can run this command at the beginning of a script.               sqlite3 dbname.db "UPDATE data SET LastStart = DATETIME('NOW') WHERE TaskName = 'taskname'"      So now I have a record that states that my job started and at what time. Hooray. Then I can run a similar command to put the time that the job ends. So. That works great if the database and the tasks are on the same machine. I go to another machine and need to update the sqlite database.... How can I do that efficiently? I tried this               ssh aaron@10.1.150.53 'sqlite3 /home/aaron/dbname.db "UPDATE data SET LastStart = DATETIME('NOW') WHERE TaskName = 'taskname'"'      But that returns:               Error: no such column: NOW      I tried some variations but didn't get anywhere. Am I close? Should I be doing something totally different? Am I reinventing the wheel?


title: How to test the quality of my network connection for VoIP services

text: Sometimes when using VoIP I experience disruptions. I would like to check if the problems could be caused by my internet provider. How could I best test the quality of my bandwidth (throughput and latency)? Until now, I have used a script which sends 3600 pings per hour and saves min/max/avg., but I am not sure how representative ICMP packets are.


title: How to combine bash arithmetic with command output?

text: Suppose you had two commands: First command               let foo=2+2     echo $foo     4      Second command               date "%s"     1377107324      **How would you combine them?** * * * Attempt 1.               echo The epoch time is: `date +%s` in 100 seconds the time \          will be: `let future={date +%s}+100` $future      Attempt 2.               echo The epoch time is: `date +%s` in 100 seconds the time \          will be: `let future=(date +%s)+100` $future      Plus about 30 other similar attempts


title: Cubian: NAND and Partitions

text: I have installed Cubian on Cubieboard using SD. After that I moved it to NAND. NAND have 4 Gb memory and I want to leave there only boot, another partitions move to the SD. Maybe leave on NAND something else? But I fear overflow memory when will install more programs. Can I moved partitions and if true how can I do that?


title: bash equivalent of this use of tcsh "sched" command?

text: In tcsh, the built-in `sched` command causes a command to be executed by the current shell at a specified time. I have the following `$HOME/.sched` file (this is a simplified version of it):               setenv today `date +%F`     sched +00:01 sched 00:00 source $HOME/.sched      I then `source $HOME/.sched` in my `$HOME/.cshrc`. This sets the environment variable `$today` to, for example, `"2012-06-25"`, and automatically updates it to the current date every night at midnight. The job automatically reschedules itself every time it runs. Note that the `date` command is invoked only once each day, and only when it's needed. Is there a way to do this in bash? Note that the `at` command won't work; it invokes a command externally and cannot affect the current shell's environment. (I know that I can type `$(date +%F)` rather than `$today`, but since I use this interactively, the extra typing is a significant burden.) tcsh also has a number of special aliases that are executed automatically in certain circumstances: > The _beepcmd_ , _cwdcmd_ , _periodic_ , _precmd_ , _postcmd_ , and _jobcmd_ > **Special aliases** can be set, respectively, to execute commands when the > shell wants to ring the bell, when the working directory changes, every > **tperiod** minutes, before each prompt, before each command gets executed, > after each command gets executed, and when a job is started or is brought > into the foreground. Does bash have anything like these?


title: Why do most distributions chain UEFI and grub?

text: Most distributions install a additional boot loader on an UEFI system. UEFI itself is a boot loader, it offers a menu to select different operating systems or individual kernels. Furthermore, the UEFI settings can easily be altered with userspace tools like `efibootmgr`. Kernels since 3.3 support EFI_STUB, which means the kernel can be loaded directly from the UEFI. What's the reason distributions decide to use an additional boot loader? Most tutorials on Linux/UEFI focus mainly on how to set up the additional boot loader (rEFInd, grub2, ELILO, etc.) instead of booting Linux with EFI_STUB. The only thing missing in the distributions is support. Since most distributions chain a second boot loader, the kernel is not added to the UEFI boot menu, nor is it copied to the EFI system partition. Three scripts are sufficient to do all the magic. One which copies the initramfs to the ESP. A second one copies kernel to the ESP and creates a new entry in the UEFI boot menu. The third script removes the old kernel and initramfs from the ESP and deletes the UEFI boot menu entry. This allows fully automatised kernel/initramfs updates/purges without user interaction. I am using this approach since more than a year and it has worked flawlessly. Why do most distributions use grub instead of EFI_STUB? Links:   * How to recreate EFI boot partition? EDIT: I'm not talking about removing grub support entirely but to offer a choice for those who want to use it for various reasons. Distributions could provide a package `grub-efi` for those who want to chain UEFI and grub and a package `efistub-boot` which contain the scripts I mentioned above.


title: What is the difference between .profile and .bash_profile and why don't I have a .profile file on my system?

text: So I'm pretty new to Linux and recently installed Fedora 19 on my netbook. I want to have a deeper understanding of Linux and the CLI so I'm now reading Learn Linux: The Hard Way. In exercise 3 the author gives the following commands:   * ls -al   * cat .profile I try to follow these instructions but to no avail. There is no .profile file in my user name directory as I can see from ls -al. From what I've learned the .bash_profile and .profile file are practically the same. The only difference I concluded from my research is that .bash_profile gets checked first. What I don't understand is why are there multiple files for the same function in Linux, why is the Author using .profile and not .bash_profile (if I understand correctly .profile won't be read when the system finds .bash_profile first) and how comes that I don't have the .profile file on my system?


title: How do I iterate the list and copy the files from machineB and machineC efficiently?

text: I need to scp the files from `machineB` and `machineC` to `machineA`. I am running my below shell script from `machineA`. I have setup the ssh keys properly. If the files are not there in `machineB`, then it should be there in `machineC`.               #!/bin/bash          readonly PRIMARY=/data01/primary/.     readonly FILERS_LOCATION=(machineB machineC)     readonly MAPPED_LOCATION=/bat/data/snapshot     PARTITION=(0 3 5 7 9)          dir1=20131222     dir2=20131222          scp david@${FILERS_LOCATION[0]}:$dir1/weekly_1980_[$el]_200003_5.data $PRIMARY || scp david@${FILERS_LOCATION[1]}:$dir2/weekly_1980_[$el]_200003_5.data $PRIMARY      Now my question is if you take a look into my above scp command, I have `[$el]`, I need to replace this with `PARTITION`, which means I need to iterate `PARTITION` and replace `[$el]` with each number in PARTITION. So my scp command should look like this if I iterate `PARTITION` -               scp david@machineB:/bat/data/snapshot/20131222/weekly_1980_0_200003_5.data /data01/primary/. || scp david@machineC:/bat/data/snapshot/20131222/weekly_1980_0_200003_5.data /data01/primary/.          scp david@machineB:/bat/data/snapshot/20131222/weekly_1980_3_200003_5.data /data01/primary/. || scp david@machineC:/bat/data/snapshot/20131222/weekly_1980_3_200003_5.data /data01/primary/.          scp david@machineB:/bat/data/snapshot/20131222/weekly_1980_5_200003_5.data /data01/primary/. || scp david@machineC:/bat/data/snapshot/20131222/weekly_1980_5_200003_5.data /data01/primary/.          scp david@machineB:/bat/data/snapshot/20131222/weekly_1980_7_200003_5.data /data01/primary/. || scp david@machineC:/bat/data/snapshot/20131222/weekly_1980_7_200003_5.data /data01/primary/.          scp david@machineB:/bat/data/snapshot/20131222/weekly_1980_9_200003_5.data /data01/primary/. || scp david@machineC:/bat/data/snapshot/20131222/weekly_1980_9_200003_5.data /data01/primary/.        1. How do I iterate PARTITION in such a way, so that I can make the above SCP command?   2. And as you can see, I am copying the files one by one into `machineA` `/data01/primary/` folder. Is there any better way of doing this? Meaning, can I copy all the files together in one shot instead of doing it one by one?


title: The rc0.d,rc1.d,... directories in /etc

text: I'm running Ubuntu 10.04 LTS where I have the directories `/etc/rc0.d`, `/etc/rc1.d`, `/etc/rc2.d`, ..., `/etc/rc6.d`. Example files from my machine:               directory      example symlinks in the dir     ------------------------------------------     /etc/rc1.d:    K76dovecot, K77ntp     /etc/rc2.d:    S23ntp, S24dovecot     /etc/rc3.d:    S23ntp, S24dovecot     /etc/rc4.d:    S23ntp, S24dovecot     /etc/rc5.d:    S23ntp, S24dovecot      Questions:   1. What's the purpose of the multiple "rc" directories?   2. Why did Ubuntu install duplicates of `dovecot` and `ntp` into all the directories except `rc0.d` and `rc6.d`?   3. If they are specified multiple times like above, are they actually executed multiple times?   4. Can you tell from the above in what order `dovecot` and `ntp` will execute at startup?   5. What is the proper way to tell Ubuntu to always execute `ntp` before `dovecot` at startup?


title: Download all source files for a webpage

text: I want to download the source files for a webpage which is a database search engine. Using curl I'm only able to download the main html page. I would also like to download all the javascript files, css files, and php files that are linked to the webpage and mentioned in the main html page. Is this possible to do using curl/wget or some other utility?


title: Ubuntu eth0 not detected

text: After installing a new version of this distro, eth0 is not detected automatically. command `inxi -SNxz` result:               Network:   Card-1: Broadcom NetXtreme BCM57786 Gigabit Ethernet PCIe bus-ID: 01:00.0                Card-2: Qualcomm Atheros QCA9565 / AR9565 Wireless Network Adapter driver: ath9k bus-ID: 02:00.0      command `ifconfig -a` result:               lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0                                                  inet6 addr: ::1/128 Scope:Host                                                       UP LOOPBACK RUNNING  MTU:65536  Metric:1                                             RX packets:1439 errors:0 dropped:0 overruns:0 frame:0                                TX packets:1439 errors:0 dropped:0 overruns:0 carrier:0                              collisions:0 txqueuelen:0                                                                                RX bytes:129263 (129.2 KB)  TX bytes:129263 (129.2 KB)                                                                                wlan0     Link encap:Ethernet  HWaddr 40:f0:2f:30:ba:59                                                                                inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0                                                                                inet6 addr: fe80::42f0:2fff:fe30:ba59/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:502798 errors:0 dropped:0 overruns:0 frame:0               TX packets:287851 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:682169370 (682.1 MB)  TX bytes:26305982 (26.3 MB)      System information detailes:               tux-world@alachiq:~ > sudo uname -a -r     Linux alachiq 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:31:42 UTC 2014 i686 i686 i686 GNU/Linux


title: Load Linux bzImage in QEMU?

text: I compiled a Linux by doing `make menuconfig` then `make` and now I have compiled the most recent version of Linux. How can I load the kernel into QEMU?


title: Library mismatch OpenSUSE 12.3 - totally borked, update gone bad

text: My workstation at work is OpenSUSE 12.3 KDE. I added the pacman repository to update SVN from 1.7.11 to 1.8.?. Later, I ran zypper update which updates all libraries to the latest "stable" build. Well I think it pulled a lot of packages from the pacman repository because it updated around 1800 libraries. Plus, now when I boot it up it says, "Welcome to OpenSUSE 13.1 (Beta 1)" and it doesn't recognize my network card, the video display a wonky, and eclipse won't start. I get a "pointer xyz not found". Is there a way to reset the libraries without reinstalling? I'm not running brtfs so I have no snapshots.


title: What is the recommended way to synchronize time using NTP?

text: This question has come up a number of times in a localized way, this question is meant to provide the preferred/best method for synchronizing a system's clock using NTP. The solution should handle multiple issues correctly, such as:   1. Correct for time at boot-up quickly where the clock has a large skew.   2. Provide a configuration that guards and/or corrects for situations where the clock can sometimes develop a large skew over time.   3. A robust solution that can handle and sync the time quickly when certain problems arise such as: "the time server wasn't accessible during boot" or "the internet is inaccessible during boot". The ideal solution would be a **single** NTP configuration file that is able to handle all this. ### References Many of the pieces that will provide the "ultimate" solution are spread across the U&L site in questions such as these:   * How to force the time and date settings to refresh from the internet?   * Time synchronization of machines on LAN to GPS NTP server on the LAN   * How can I make a Puppet module that fixes time?   * NTP not syncing in a VM There are bound to be others but these are the ones that I've seen that come to mind as being relevant.


title: System freezes. Can't find anything in the logs

text: My linux desktop system freezes (aptosid/debian sid) sometimes and after a reboot I can't find any infos about the reason for the freeze in messages/dmesg/syslog/Xorg.*.log. When it "freezes" I can still move the mouse in X and sometimes even move the windows for a short time before the system stops responding. Last time I could even switch to the text-terminal and enter my login name, but every text- console stopped after that and displayed no password prompt. SSH login also does not work after the freeze. I think the problem started some weeks (maybe 1-1.5 months) ago. I have a windows partition (win7 64bit) on the same machine which I use mainly for gaming (in the last time mostly StarCraft2). I can't rember any crashes there in hours of playing. I haven't found a way to force the freeze yet which makes debugging not easier.


title: Emacs simple arithmetics in query replace

text: Is it possible to do the following in `emacs`: Query replace all numbers in a region by the number +n, for example if you have:               12 and 7 are nice numbers      let n be 3, then it should transform to               15 and 10 are nice numbers


title: Saving bash history from multiple Konsole not working correctly

text: I use multiple Konsole terminals. And I want all the commands I type in every terminal to be saved in command history, so that next konsole i open will have all of them. To prevent each terminal from over writing the other terminal's command history, I gave the following settings in my `.bashrc`               # avoid duplicates and commands starting with space     export HISTCONTROL=ignoredups:erasedups:ignorespace     # append history entries..     shopt -s histappend     #My machine reboots without warning sometimes.Hence to save commands instantaneously.     export PROMPT_COMMAND="history -a"       export HISTSIZE=1000     PS1="\[\e[1;34m\]\! \[\e[0m\]"$PS1      I gave the last line to see the command number in my prompt. The command no. has never gone above 600, but still some of my old commands are disappearing from the history. There are many commands which are given repeatedly, but as expected from `ignoredups`, it never increases the command no in prompt. Yet old commands are still disappearing.And the number of commands in history is always remaining slightly more than 500. The `.bash_history` file still contains a lot of duplicates in spite of ignoredups. PS: The output of echo `$HISTSIZE` and `$HISTFILESIZE` are both `=1000` * * * Update: I found the problem in the above entry to `.bashrc`. Just calling `history -a` in `PROMPT_COMMAND` simply appends the last new command to the .bash_history. So the `ignoredups` and `erasedups` have no effect. Is there any way, I can still write to the .bash_history without duplicates from every terminal? I don't want to load the entire history at each command prompt by `history -r` and write it again back with `history -w`, because the commands I issued in one terminal will appear in another parallel running terminal also. I want the combined commands to appear only in a new terminal. The puzzle, why my history was getting trimmed to 500 is solved. I noticed it happened each time I ssh into this machine. Creating a `.bash_profile` with the following entry solved this problem.               if [ -f ~/.bashrc ]; then     . ~/.bashrc     fi      Now my .bashrc is executed each time I ssh too. And the history file size is now monotonically increasing.


title: How to Optimize an IPTABLES script?

text: If I could list that which iptables rule has how many matched packets, then I could create a better/faster iptables script that's faster. That rule would be at top/first that has the more packets matched.


title: Can I find out which ssh key was used to access an account?

text: Is it possible to find out which ssh key was used to access an account? I have an account on a server that I let several (trusted!) people have access to via ssh. I'd find it useful to be able to know who logged in and when. I have root access so I can look at the logs, but there doesn't seem to be anything there. Is there some configuration switch that will put some way of identifying the key in the logs?


title: How do I configure OpenCV and Cygwin to work together?

text: I'm trying to configure `OpenCV-2.2.0-win32-vs2010` with `Cygwin` to work together. Any ideas on how I can do that?


title: Which System Call provides an interface for sending messages to devices?

text: Question is above. I've looked through the man pages, but they are somewhat unclear on the topic. I'm not sure if I'm looking for sendmsg() or msgsend() or if I'm looking for something totally different


title: What happens when I open and read from /proc?

text: Does the hard drive need to be accessed or is everything done in memory? Basically I would like to constantly get updated values from meminfo and cpuinfo. Do I need to reopen the file and then reread in order to get an updated value or can I just reread? I don't have access to a Linux install at the moment.


title: Fast way to build a test file with every second listed in YYYY-mm-dd HH:MM:SS format

text: I want to create a large test file with lines containg dates listed by the second, but my method is taking inordinately long... (or at least, that's how it feels :) ... 43 minutes to create only 1051201 lines. 20.1 MB file.... I want to crate a much bigger file, with each line's date being unique..   Is there a faster way than how I've approached it?:               # # BEGIN CREATE TEST DATA  ============      # # Create some dummy data.       file=/tmp/$USER/junk       ((secY2 =s3600*24*365*2))       cnt=0       secBeg=$(date --date="2010-01-01 00:00:00" +%s)       secEnd=$((secBeg+secY2))       ((sec=secBeg))       while ((sec<=secEnd)) ; do           date -d '1970-01-01 UTC '$sec' seconds' '+%Y-%m-%d %H:%M:%S' >>"$file"            ((sec+=1))           ((cnt+=1))       done       ls -l "$file"       echo Lines written: $cnt     # END CREATE TEST DATA  ============


title: What I can I do to make the transition to some new computer hardware safe and smooth?

text: I normally use machine A, and I make backups of A onto a fileserver B. Sooner or later, I will lose machine A for one reason or another. Its hard drive wears out, or it gets hit by lightening, or some salesperson convinces me that it's an embarrassing piece of obsolete junk, or an overclocking experiment goes horribly wrong, or it suffers a "glitter-related event", etc. Let's assume that computer C is totally different from computer A -- different mass storage interface, processor from a different company, different screen resolution, etc. Is there an easy way to make a list of all the software currently installed on A before disaster strikes, in a way that makes it easy to install the same software on the blank hard drives of computer C? Or better yet, makes it easy to install the latest versions of each piece of software, and the specific sub-version optimized for this particular machine C? If I have plenty of space on B, it seems easiest copy _everything_ from A to B. If I do that, what is a good way of dividing the files I want to copy from B to C from the files I don't? I don't want to copy binary files I can easily re-download (and possibly re-compile) as needed, and probably wouldn't work on machine C anyway. Or is it better in the long run to try to avoid backing up such easily-obtained machine-specific binary files onto B in the first place? Is there a better way to reduce the chances that viruses and trojans get passed on to C and re-activated? When I customize software or write fresh new software, what is a good way to make sure the tweaks I have made get backed up and transferred to the new machine and installed? Such as cron and anacron tasks? What I can I do to make my transition to some new computer C safe and smooth? (This question expands on a sub-question of "Incremental system backup and restore w/ rsync or rdiff-backup issues" that I thought was particularly important).