title: Help with OS choice for High Performance Computing

text: I have been using Ubuntu 10.04 for 2 years now and honestly, I am somewhat bored of Linux and wish to explore Unix (or Unix Like) now. I don't want a dumbed down version (like Ubuntu) anymore and want to experience Unix (or Linux if need be) in its true form. I basically want more to do with terminal and exploiting the open source nature of the OS. My requirements are plainly   1. No dumbing down. I'll take a few shots in my knee if necessary.   2. Awesome interface from parallel/high performance programming. I use Intel MKL on a daily basis. I use the computer ONLY for programming. So, all else (Flash support, Firefox blah blah) is useless.   3. It should be extremely extremely stable. (Debian like)   4. It should have good community support and long term support. I don't like changing OSes every 6 months. What would you suggest? (I have tried to make this question as objective as possible. Please don't give me a "depends" answer. Just throw a name if need be) NetBSD vs FreeBSD vs OpenBSD vs Other Unix/UnixLike vs Linux (I would really want to try a BSD/Unix now but then, if my requirements aren't met, I don't mind a Linux) P.S: I am **not** a N00B. I have tried Ubuntu, Debian, Fedora & RHEL but not long enough to make an informed choice.


title: How to make svn look for if there is an update once a minute and if there is call some script?

text: I am developing a server app. I have a remote machine with Debian that I use for testing. Currently I update the server manually when each new svn version comes out. It is just a testing server and traffic on it is free for me. I created a simple script that downloads the latest svn (`HEAD`) revision and recompiles my server. I wonder if it is possible to create a .sh script (Debian compatible) that a normal user (not SU) would be able to start with something like `nohup ./superScript.sh >& /dev/null &` and which would once a minute look into some SVN, find out current version and, if there was an update, run commands like:               kill `ps aux | grep -F 'ServerAPP' | grep -v -F 'grep' | awk '{ print $2 }'`      ./server_automated_net_setup.sh     cd server/install-dir/     export LD_LIBRARY_PATH=./:~/server/install-dir/lib_boost:~/server/install-dir/lib_openSSL     nohup ./ServerAPP >& /dev/null &      that would kill the currently running app, run some auto-update script we already have in the user's home (`~`) and run it again. Is it possible to create such a script and how do I do it?


title: What is the simplest method to redirect traffic using either a proxy or iptables?

text: I need to redirect all incoming traffic on port 7777 to a specific destination_ip:port. I have about 40 Litecoin (scrypt) mining rigs that I have to manually reconfigure each time I'd like to switch coins or pools. Instead I would like to be able to just modify the destination address on my proxy box to direct the farm. I am currently using Dante proxy which has a redirect module available that looks perfect. I don't have $400 to spend on that module however. Also, Dante seems to take up huge amounts of memory for every connection. Also, instead of using a proxy, I tried using iptables as a solution but received an error:               root@xx:~# iptables -t nat -A PREROUTING -p tcp -d x.x.x.x --dport 7777 -j DNAT --to x.x.x.x:7777     root@xx:~# iptables -t nat -A POSTROUTING -d x.x.x.x -j MASQUERADE     iptables: No chain/target/match by that name.      I could not get that to work nor am I sure if that would even be a solution to what I'm after. Any ideas on how to best achieve my desired result would be great!


title: Why do 'ssh host echo $PATH' and printing the $PATH after ssh'ing into the machine give different results?

text: On a particular host, when I ssh into the machine and enter `echo $PATH` I get               /home/wxy/bin64:/home/wxy/bin:/usr/kerberos/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin      and if I execute `ssh host 'echo $PATH'` I see this:               /usr/local/bin:/bin:/usr/bin      Why is this discrepancy? Also what can I do if I wanted to see the former result using the latter command?


title: Networking between two Virtual machines on different hosts

text: I have openSuse installed as a virtual machine(Oracle Virtual Box) on DeskTop(win 7), and another openSuse installed on as a virtual machine(Oracle Virtual Box) on my Laptop(win 8.1). Please see the attached image, in which I have captured the various network adapter information. I want to network these two VMs, please guide me in the right direction as how to achieve this. The following is the additional information that may enable you to guide me. Desktop Host machine(win 7)               C:\Users\Adofo>ipconfig     Windows IP Configuration     Ethernet adapter Local Area Connection:      Connection-specific DNS Suffix  . : domain.invalid      Link-local IPv6 Address . . . . . : fe80::bd2b:ef06:53ea:740b%11      IPv4 Address. . . . . . . . . . . : 192.168.0.108      Subnet Mask . . . . . . . . . . . : 255.255.255.0      Default Gateway . . . . . . . . . : 192.168.0.1          Ethernet adapter VirtualBox Host-Only Network:      Connection-specific DNS Suffix  . :      Link-local IPv6 Address . . . . . : fe80::35d5:acd3:5f50:fc20%18      Autoconfiguration IPv4 Address. . : 169.254.252.32      Subnet Mask . . . . . . . . . . . : 255.255.0.0      Default Gateway . . . . . . . . . :          Tunnel adapter Teredo Tunneling Pseudo-Interface:      Media State . . . . . . . . . . . : Media disconnected      Connection-specific DNS Suffix  . :          Tunnel adapter isatap.{DB8941A3-825F-4824-B421-6E1625173A6E}:      Media State . . . . . . . . . . . : Media disconnected      Connection-specific DNS Suffix  . :          Tunnel adapter isatap.domain.invalid:       Media State . . . . . . . . . . . : Media disconnected       Connection-specific DNS Suffix  . :      OpenSuse 12.3 on Virtual Machine: (VirtualBox installed on Desktop, Windows 7)               linux-gn77:~ # ifconfig     eth0      Link encap:Ethernet  HWaddr 08:00:27:08:FF:6C             inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0           inet6 addr: fe80::a00:27ff:fe08:ff6c/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:2 errors:0 dropped:0 overruns:0 frame:0           TX packets:43 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:1180 (1.1 Kb)  TX bytes:9748 (9.5 Kb)          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:52 errors:0 dropped:0 overruns:0 frame:0           TX packets:52 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:4891 (4.7 Kb)  TX bytes:4891 (4.7 Kb)      Laptop: Windows8.1 Host C:\Users\Harbir PC>ipconfig Windows IP Configuration               Ethernet adapter Bluetooth Network Connection:      Media State . . . . . . . . . . . : Media disconnected      Connection-specific DNS Suffix  . :     Wireless LAN adapter Local Area Connection* 2:      Media State . . . . . . . . . . . : Media disconnected      Connection-specific DNS Suffix  . :     Wireless LAN adapter Wi-Fi:     Connection-specific DNS Suffix  . : domain.invalid     Link-local IPv6 Address . . . . . : fe80::555b:6b6a:18c5:9326%3     IPv4 Address. . . . . . . . . . . : 192.168.0.106     Subnet Mask . . . . . . . . . . . : 255.255.255.0     Default Gateway . . . . . . . . . : 192.168.0.1     Ethernet adapter VirtualBox Host-Only Network:     Connection-specific DNS Suffix  . :     Link-local IPv6 Address . . . . . : fe80::a0d1:2b1d:ba1c:9158%26     IPv4 Address. . . . . . . . . . . : 192.168.56.1     Subnet Mask . . . . . . . . . . . : 255.255.255.0     Default Gateway . . . . . . . . . :     Tunnel adapter isatap.{AB29F882-C104-4E87-BB48-3C1DDD3136B9}:      Media State . . . . . . . . . . . : Media disconnected      Connection-specific DNS Suffix  . :     Tunnel adapter isatap.domain.invalid:      Media State . . . . . . . . . . . : Media disconnected      Connection-specific DNS Suffix  . :      OpenSuse 12.3 on Virtual Machine: (VirtualBox installed on Laptop, Windows 8.1)               linux-gn77:~/line/client1 # ifconfig     eth0      Link encap:Ethernet  HWaddr 08:00:27:41:7A:77            inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0           inet6 addr: fe80::a00:27ff:fe41:7a77/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:57266 errors:0 dropped:0 overruns:0 frame:0           TX packets:31879 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:77472539 (73.8 Mb)  TX bytes:2640470 (2.5 Mb)        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:113 errors:0 dropped:0 overruns:0 frame:0           TX packets:113 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0           RX bytes:5861 (5.7 Kb)  TX bytes:5861 (5.7 Kb)      ![enter image description here](http://i.stack.imgur.com/JHTvS.png)


title: What is the space overhead of different filesystems?

text: I backed up/restored a filesystem from a Ubuntu system to a Fedora 17 one. I noticed that according to `df` output the used space increased by 30 %. What could be the reasons for this? At the Fedora system `df` displays: 78 GB used At the Ubuntu system `df` displays: 60 GB used Differences between the systems: Ubuntu: ext3 (created years ago) Fedora 17: ext4 (created with a vanilla `mkfs.ext4` call) Restoring to an XFS filesystem (on Fedora 17) yields 78 GB used space. Backup and restore was done with GNU tar. The filesystem contains a wide range of different sorts of files (i.e. from source trees, maildirs to ISO's etc.).


title: How do I find a bunch of files with a string in its filename (or body text) and then move all those files to a specific folder?

text: Say - what if I wanted to move every HTML file in several independent directories with the word "heavengames" in its filename (and as a second question, every HTML files with the word "heavengames" in its body text) to a new directory named "heavengames-threads"?


title: Fedora 17 boot hangs after changing to CDM

text: I am running the stock Xfce spin of Fedora 17 in a VirtualBox virtual machine, and just installed the CDM display manager via yum. I modified the /etc/cdmrc file to start xfce, and added the following to /etc/sysconfig/desktop: > DISPLAYMANAGER=/usr/bin/cdm However, upon reboot the process hangs right after the Fedora logo appears with this: > Cannot open font file True Can anyone help me diagnose and troubleshoot this problem? Thank you very much!


title: How to set up two-factor authentication with OTP on FreeBSD?

text: I have a FreeBSD hosted server that I like to be able to get to from anywhere. Normally I use SSH publickey to log in, or if I don't have my SSH private key available then I might use regular password over SSH. However, when logging in from an untrusted machine there's always the risk of a keylogger capturing my password as I type it. FreeBSD already has support for OPIE which is a one-time password scheme. This works great, but the one-time password is the _only_ authentication needed. If I print out a list of one-time passwords to use later, then if I lose that list then that's all somebody needs. I'd like to set up the authentication so that I need a one-time password _plus_ something I know (a password, except not my usual login password). I have a feeling the answer has something to do with PAM (and `/etc/pam.d/sshd`) but I'm not certain on the details. How can I set up authentication where two methods are required?


title: Caching bugzilla webpages for offline use

text: I have a long wifi free journey ahead of me and I would like to continue to productively review bugs even without the ability to change them. Is there an easy way to cache all the pages generated from the query below? https://bugzilla.gnome.org/buglist.cgi?product=banshee&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_severity=blocker&bug_severity=critical&bug_severity=major&bug_severity=normal&bug_severity=minor&bug_severity=trivial&gnome_version=


title: What is the significance of the "wheel" group?

text: I've commonly seen references to a `wheel` user group online as well as when setting up my `sudoers` file. Does naming a group `wheel` imply something special about the group or is it just a name for a generic group used in the same manner that `foo` and `bar` are thrown about?


title: Is nohup indefinite?

text: If I run a program with an infinite loop with `nohup`, will the program run indefinitely (until the machine is reset or until I manually terminate it)?


title: Installed Fedora in dual boot Windows desktop. Now I can't get full monitor resolution with my AMD Radeon HD 6450

text: I have a 1900x1080 resolution monitor, and after installing Fedora to create a dual boot machine, the maximum resolution Fedora 14 (previously only Windows 7 was installed) can achieve is 1280x1024. Why is this the case? How do I figure out what to do to get full native resolution on my monitor in Fedora?


title: How do I install mplayer from a terminal?

text: I need a command to run on Linux to install mplayer. I'm not finding the command anywhere, and when I try to use the `zypper` command to install mplayer it tells me I am not a sudoer. What should I do?


title: Google Hangouts with dual monitor and GNOME Shell

text: I have a laptop with a built-in screen and an attached monitor. When I start a Google's video Hangout and share my desktop, I would like to be able to share only the attached screen, but I don't know how. Right now I have two monitors: `LVDS1` corresponds to my laptop's screen, which is configured as the secondary screen and `DP1` which is my primary screen. But the problem still remains if I change my laptop's screen to be the primary screen.               $ xrandr     Screen 0: minimum 320 x 200, current 3286 x 1468, maximum 8192 x 8192     LVDS1 connected 1366x768+1920+700 (normal left inverted right x axis y axis) 344mm x 194mm        1366x768      60.06*+        1024x768      60.00          800x600       60.32    56.25          640x480       59.94       VGA1 disconnected (normal left inverted right x axis y axis)     HDMI1 disconnected (normal left inverted right x axis y axis)     DP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 475mm x 267mm        1920x1080     60.00*+        1280x1024     75.02    60.02          1152x864      75.00          1024x768      75.08    60.00          800x600       75.00    60.32          640x480       75.00    60.00          720x400       70.08        Whenever I start sharing my desktop in the Hangout, only the built-in (smaller) screen is shared. Best thing would be to be able to chose which one to share, but if not, how could I share only the attached (bigger) screen? I bet Google's Hangout is looking for a configuration file to choose which screen to share, but don't know which file it is. ## NOTE Using Fedora 20, x86_64, Linux 3.15.10-200, GNOME Shell 3.10.4-8 ## NOTE 2 Using Firefox 31. Using Chrome makes Google Hangouts share both screens at the same time instead of only the laptop's screen, which I think is even worse. Still trying to find out how could I choose which screen to share.


title: Changing TTY font to a non-default font

text: I found two ways to change the TTY font:   1. dpkg-reconfigure console-setup   2. editing /etc/default/console-setup Either way I'm limited to the fonts in /usr/share/consolefonts (I'm using Debian).   * How do I install new console fonts?   * What are the requirements for this kind of font?   * ... in particular: would it be possible to use Anonymous Pro as console font?


title: CLI network management

text: I've set up a console typewriter: a laptop with a minimal Debian install and no X server. I use it as a typewriter and I use wifi to sync my documents. I connect to wifi using wpa-supplicant. That involves editing /etc/network/interfaces each time I connect to a new network - and that a little tiresome. What would be a good CLI network manager that could make connecting to new networks easier. It should be able to:   * Shows a list of available networks   * Let me select one and connect by time the WPA password   * Remembers passwords and automatically connect to the connections that I've used before


title: re-initialize the framebuffer when program crashes

text: I'm using SDL to display images on a monitor, without X installed. When my program ends successfully, the monitor goes back to the login prompt (as expected). But when my program crashes, the last image stays frozen on the monitor (even if I launch the program again, the last image of the previous execution stays stuck on the monitor). How could I kill the display in order to "use" it again ? The only solution that I found is to reboot the computer but I need to avoid that because other processes run on the computer and cannot be interrupted.


title: How can I force a script to use more resources?

text: I'm running a very time-consuming script which takes many hours to end. Watching `top` I see that it's only taking 5% of the CPU at best, usually around 3%. Is there any way to force the script to use more CPU in order to end faster? Edit: Basically the script is bruteforcing 5 chars length passwords given a the salt and the hash. Not at home right now, but something like:               charset = ['a','b',.........'z'];     for i in $charset do        for j in $charset do            for k in $charset do                for l in $charset do                   for m in $charset do                       pass = `openssl passwd -salt $1 $i$j$k$l$m`                       if [ pass == $2 ]]; then                          echo "Password: $i$j$k$l$m";                          exit;                       fi                    done                 done             done         done      done


title: How to get the port number a program is listening on in a shell script?

text: I have a program (beam) running, and I need to figure out which TCP / IPv6 port it is listening on. I know `netstat` will tell me, but I haven't fully been able to parse its output:               RABBIT_PORT=$(netstat -tupln | grep beam)     echo $RABBIT_PORT      Gives:               tcp  0 0 0.0.0.0:47858 0.0.0.0:* LISTEN 4533/beam      tcp6 0 0 :::5672       :::*      LISTEN 4533/beam      But I need to extract just the port number (5672), how can I do so? Alternatively, is there a better command than `netstat` to do this (that'll be as widely available as `netstat`, at least on Linux?)


title: Does the shebang determine the shell which runs the script?

text: This may be a silly question, but I ask it still. If I have declared a shebang               #!/bin/bash       in the beginning of `my_shell_script.sh`, so do I always have to invoke this script using bash               [my@comp]$bash my_shell_script.sh      or can I use e.g.               [my@comp]$sh my_shell_script.sh      and my script determines the running shell using the shebang? Is it the same happening with `ksh` shell? I'm using AIX.


title: Starting up and keeping up a process

text: I am having an Ubuntu box on which I am having a Haskell process (think of it as a random server process) that I built. I want to start it on boot and restart it in case it fails for whatever reason (ideally with some kind of logging that it failed, what exec code it failed with, etc.). How to do that? Right now I wrote a shell script which is located in /etc/init.d/ which will fire up the haskell process and pipes it output to /var/log/.log . How to do the monitoring/restarting though?


title: Which is more efficient, ls or ls -l?

text: As I understand, the `ls` command calls `getdents`, which returns up to x number of directory entries. Are there any other system calls involved? If I run `ls -l`, are there any more system calls? I am trying to determine if `ls -l` is more expensive and hence slower than `ls`.


title: how can I recursively delete empty directories in my home directory?

text: > **Possible Duplicate:**   >  How to remove all empty directories in a subtree? I create directories very often, scattered over my home directory, and I find it very hard to locate and delete them. I want any alias/function/script to find/locate and delete all empty directories in my home directory.


title: Installing fonts via terminal

text: I have downloaded font files in .ttf format, I want to install these fonts via the terminal, What is the command for that?


title: VirtualBox: Same IP address for both network interfaces on same machine (scientific linux)?

text: When booting up the VM (Scientific Linux 6.4) in VirtualBox (4.3), I'm getting the same ip address for both network interfaces. VirtualBox has NAT for the first network adapter, and Host-Only for the second network adapter. VM is configued as follows: ifcfg-eth0               DEVICE=eth0     BOOTPROTO=dhcp     ONBOOT=yes     NM_CONTROLLED=no     Type="Ethernet"      ifcfg-eth1               DEVICE=eth1     BOOTPROTO=static     IPADDR=192.168.56.107     NETMASK=255.255.255.0     NM_CONTROLLED=no     ONBOOT=yes     Type="Ethernet"      Results of ifconfig               eth0      Link encap:Ethernet  HWaddr 08:00:27:E8:14:8B                 inet addr:192.168.56.107  Bcast:192.168.56.255  Mask:255.255.255.0               inet6 addr: fe80::a00:27ff:fee8:148b/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1          eth1      Link encap:Ethernet  HWaddr 08:00:27:92:0A:6D                 inet addr:192.168.56.107  Bcast:192.168.56.255  Mask:255.255.255.0               inet6 addr: fe80::a00:27ff:fe92:a6d/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1      If I execute the following:               # ifdown eth0     # ifup eth0      Then eth0 gets the correct ip address.               eth0      Link encap:Ethernet  HWaddr 08:00:27:E8:14:8B                 inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0               inet6 addr: fe80::a00:27ff:fee8:148b/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1      Why is it not picking up the correct ip address on boot? How do I configure it to have the correct ip for eth0?


title: How to automatically mount Truecrypt volume at login without a prompt?

text: How do I automatically mount a Truecrypt volume at user login without any prompt? The Truecrypt volume is based on a file, not a partition. I'm running Kubuntu 12.04 and Truecrypt 7.1a (latest).


title: mdadm large memory consumption

text: I am building a RAID 6 with `mdadm` (8 WD Red 3 Tb) on Ubuntu 13.10x64 server with ext4 filesystem. When I download torrent on the array, server RAM is filled for maximum cap (8 Gb) memory is free when I manually enter               sync;echo 3 > /proc/sys/vm/drop_caches      The `mdadm -D` output:               /dev/md127:             Version : 1.2       Creation Time : Sun Feb 16 18:47:05 2014          Raid Level : raid6          Array Size : 17580801024 (16766.36 GiB 18002.74 GB)       Used Dev Size : 2930133504 (2794.39 GiB 3000.46 GB)        Raid Devices : 8       Total Devices : 8         Persistence : Superblock is persistent              Update Time : Wed Feb 19 14:30:40 2014               State : clean       Active Devices : 8     Working Devices : 8      Failed Devices : 0       Spare Devices : 0                   Layout : left-symmetric          Chunk Size : 512K                     Name : corvsrv:2  (local to host corvsrv)                UUID : d6ca33d3:925c7c82:891c9f07:1f2cb07a              Events : 121              Number   Major   Minor   RaidDevice State            0       8       33        0      active sync   /dev/sdc1            1       8       49        1      active sync   /dev/sdd1            2       8       65        2      active sync   /dev/sde1            3       8       81        3      active sync   /dev/sdf1            4       8       97        4      active sync   /dev/sdg1            5       8      113        5      active sync   /dev/sdh1            6       8      129        6      active sync   /dev/sdi1            7       8      145        7      active sync   /dev/sdj1      How to fix the memory consumption?


title: GNU Screen makes Vim ESC key slow

text: Screen makes my `ESC` key wait for more commands I beleive, and if it does not get those commands, it sends it to my terminal Session (which I am running VIM in). `ESC` is used alot in VIM and currently I do not make any use of the `ESC` key in Screen. How would I go about changing the timeout? I have read that these commands below inside of .screenrc should fix it, but it doesn't seem to be working for me:               maptimeout 0     defc1 off


title: svn command to see a tally of my changes

text: Is there an SVN command that I can run to see a tally of all of my contributions? Something like:               added 1800     deleted 15


title: How to compress and transfer folders from one server to another over network

text: Do we have any option to transfer folder from one server to another, that is faster and compressible and bandwidth limit settable method? The servers run on Linux. I tried tar + ssh but I couldn't set bandwidth limit to 3 or 4 MBPS likewise. Any other service does it?


title: Unable to install erlang

text: I am trying to install `Erlang` for `RabbitMQ` on `CentOS release 6.4 (Final)` > yum install -y erlang It gives me the following error :               Error: Package: erlang-R12B-5.12.el5.rf.x86_64 (rpmforge)     Requires: libodbc.so.1()(64bit)      I can't find solution for `libodbc.so.1` I also installed `unixODBC` and `unixODBC-devel`


title: How can I safely give a shell to somebody?

text: I have a question about giving a shell account to somebody. How safe is it? He could read /etc. How can I give a secured shell account that will only restrict the user to some bins and his own home? Is the only way a chroot jail?


title: Using wget to target files within a date range

text: I'm using `wget` to download some log files from a remote server. Is it possible to use `wget` to target files using date ranges (based on the last modified file header) ? For example:               wget --after-date=03112014 http://foo/bar


title: stripping out the last two [end] with sed?

text: I'm working on a script that improves the `fluxbox` 'menu', and my script has this line:               sed -i 's/\[end]//g' ~/.fluxbox/menu;sed -i '/^\s*$/d' ~/.fluxbox/menu      but this has the unfortunate effect of stripping out _all_ of the `[end]` which is bad, I only want it to strip out the last two occurrences of `[end]` in that file. So how do I do it please?


title: Is it possible to install a CentOS and some packages then put whole result into a installable iso?

text: I need to fresh install a CentOS Then install some packages with some configs Then save all into a installable ISO. Is it possible to build it?


title: Understanding output of lvdisplay in LVM/Linux

text: I am new to Linux admin field I just want to know the meaning of following fields in lvdisplay output               root@sandbox: lvdisplay rootvg/swaplv | grep -i '# open'      # open                 2     root@sandbox: lvdisplay rootvg/swaplv | grep -i 'Segments'       Segments              1      Thanks in Advance Note - I asked same question on ask ubuntu but got no reply.


title: How to rename all files and add image size to file name

text: I can`t make this work. I have a lot of images and i want to rename his name and append image size to name using exiv2 `eviv2 pr *` prints all info about file               # exiv2 pr 9b523e5a002268fe5067a928     File name       : 9b523e5a002268fe5067a928     File size       : 356433 Bytes     MIME type       : image/jpeg     Image size      : 1920 x 1200      Now i want rename my file to look like               9b523e5a002268fe5067a928_1920x1200.jpeg      I already make something like this               exiv2 pr * | grep "Image " | awk -F':' '{ print $2 }' | sed 's/ //g'      It gives me the image size, but how do i extend this to get the image MIME type to get the .jpeg correct ?


title: TTY not work after X starts

text: I have a HP Envy4 5306tx laptop with Intel+Nvidia dual cards, and I install fedora 19 X64 on it without NVidia proprietory driver. However, there are some problems about the X and TTY。   * The TTYs are normal and switchable through `Ctrl`+`Alt`+`Fn`, when booting with runlevel 3.   * When X starts, I cannot switch to any TTY. If I press `Ctrl`+`Alt`+`Fn`, I get a blank screen(black/grey/blue), and cannot go back to X.   * When I exit Windows manager, I also get a blank screen. And I have to press power key to poweroff. There are some errors in `Xorg.0.conf`:               [26.217] (EE) Failed to load module "glamoregl" (module does not exist, 0)     [26.448] (EE) open /dev/dri/card0: No such file or directory     [26.461] (EE) open /dev/fb0: No such file or directory      There are also some errors in `/var/log/messages`:   * Failed to activate service 'org.freedesktop.Consolekit': time out   * [system] Activation via systemd failed for unit 'dbus-org.freedesktop.nm-dispatcher.service' How that happens? Is it related to the dual cards?


title: How to detect dos format files in git bash

text: Git Bash is a nice bash shell you get in Windows as part of the installation of Git. It comes with other typical unix tools bundled inside, such as grep, sed, awk, perl. It doesn't have the file command. In this shell, I want to detect files that have DOS-style line endings. I thought this command would work but it doesn't:               grep -l ^M$ *      It doesn't work, even files that don't have CR line endings match. For example if I create 2 sample files `hello.unix` and `hello.dos`, I can confirm with `wc` that `hello.unix` has 6 characters and `hello.dos` has 7 characters because of the extra CR, but both files match with `grep`. That is:               $ cat hello.*     hello     hello          $ wc hello.*           1       1       7 hello.dos           1       1       6 hello.unix           2       2      13 total          $ grep -l ^M hello.*     hello.dos     hello.unix      Is this a bug in the `grep` implementation or what? Is there another way to find all files with DOS-style line endings?


title: How can I detect that no options were passed with getopts?

text: I have this code -               #getoptDemo.sh     usage()     {         echo "usage: <command> options:<w|l|h>"     }     while getopts wlh: option     do         case $option in                 (w)                         name='1';;                 (l)                         name='2';;                 (h)                         name='3';;                 (*)                         usage                         exit;;         esac     done     print 'hi'$name      When I run `bash getoptDemos.sh` (without the option) it prints `hi` instead of calling the function `usage`. It calls usage when options other than w, h and l are given. Then can't it work when no options are specified. I have tried using `?`, `\?`, `:` in place of `*` but I can't achieve what I wanted to. I mean all the `docs` on `getopt` says it to use `?`. What am I doing wrong?


title: what happens when a window manager is put to background

text: I am trying to understand the situation why .xsession file expects the last process to be in foreground otherwise it is supposed to stop X11 session. I have a small stand-alone script. when I run this, it immediately quits as 'less' is but in background.               $ ls -l total 4     -rwxr-xr-x 1 user user 17 Feb 28 21:17 a     -rw-r--r-- 1 user user  0 Feb 28 20:22 b      $ cat a      less b &      echo $!        1. I understand 'less' tool primarily interacts in foreground. I do not know how it is implemented, but I guess it realizes that it no more runs in foreground and it can't get input or show some output to user so it is no more useful to run so it quits. Or what is really happening?   2. when you put a 'window manager' in background, why does it quit? Does it quit because it does not run in foreground and cannot get any keyboard/mouse input through X server and it cant be anymore useful so it quits?


title: What is the difference between gksu and sudo?

text: I presume this applies to any Gnome desktop. What is the difference between these two commands? According to the Ubuntu documentation and questions that reference it, the former also sets the `$HOME` environment variable and copy the .Xauthority variable to temporary location, but are those the only differences for all systems running Gnome, or do they only apply to Ubuntu?


title: How does chroot's use of qemu for cross compile environments work?

text: To be able to do cross compiling there's a trick where you copy a static qemu binary into your `<different-arch-root-to-be>/usr/bin` and when you chroot into that filesystem, which has non-native binaries, magically the binaries are executable by the host cpu, and `uname -a` and similar claim that you are on the target architecture. The net result is that you can get dead simple cross compiling. I can imagine a way this might work, but it would require `chroot` to be `qemu` aware. Is this the case? I can't seem to find any documentation as to how this works.


title: Software like Iceweasel and LibreOffice wont run without root/sudo

text: I recently decrypted my home directory by making a backup of my home directory, deleting the directory, and then replacing it again with the backup (followed a guide). Ever since, I can no longer run standard built in software like Iceweasel and LibreOffice without root access. Whenever I try to open the programs, they give me some sort of error like "Iceweasel is already running" (which it isn't). But when I run them from the command line with sudo, they work fine. I think it has something to do with the permissions of my home directory, not entirely sure. I'm wondering how I can give my user permissions to run all the software in my home directory without having to use sudo in the command line. I'm pretty sure when I was moving my home directory around, it messed with the permissions. (This is just a guess, not sure why I need root permissions to run these types of software). Thanks, all help is appreciated.


title: How to compile the C compiler from scratch, then compile Unix/Linux from scratch

text: Let's say I work for a large services organisation outside the US/UK. We use UNIX and Linux servers extensively. Reading through this article it mentions that it would be easy to insert a backdoor into a C compiler, then any code compiled with that compiler would also contain a backdoor. Now given recent leaks regarding the NSA/GCHQ's mandate to put backdoors/weaknesses in all encryption methods, hardware and software, the compiler is now a critical point of failure. Potentially all standard UNIX/Linix distributions could be compromised. We cannot afford to have our systems, data and our customers data compromised by rogue governments. Given this information, I would like to build a trusted compiler from scratch, then I have a secure base to build on so I can build the Operating System and applications from source code using that compiler. ## Question **What is the correct (and secure way) to go about compiling a compiler from source code (a seemingly chicken-egg scenario) then compiling a trusted Unix/Linux distribution from scratch?** You can assume I or others have the ability to read and understand source code for security flaws, so source code will be vetted first before compiling. What I am really after is a working guide to produce this compiler from scratch securely and can be used to compile the kernel, other parts of the OS and applications. The security stack must start at the base level if we are to have any confidence in the operating system or applications running on that stack. Yes I understand there may be hardware backdoors which may insert some microcode into the compiler as it's being built. Not much we can do about that for the moment except maybe use chips not designed in the US. Let's get this layer sorted for a start and assume I could build it on an old computer potentially before any backdoors were inserted. As Bruce Schneier says: **_"To the engineers, I say this: we built the internet, and some of us have helped to subvert it. Now, those of us who love liberty have to fix it."_** Extra links:   * http://nytimes.com/2013/09/06/us/nsa-foils-much-internet-encryption.html?pagewanted=all&_r=0   * http://theguardian.com/commentisfree/2013/sep/05/government-betrayed-internet-nsa-spying


title: Unable to ping CentOS virtualbox

text: I have created a virtual machine for CentOS in VirtualBox using an NAT connection (It wont work under Bridged). Now the problem is I can ping from CentOS to my IP on Ubuntu with no problem but I cannot ping from Ubuntu or from my work terminal to `CentOS`. I have disabled `ufw` on Ubuntu and still cannot get ping. I have disabled `iptables`,`ip6tables`, and `selinux` on CentOS and still cannot get a response. Is there something else that may be preventing me from pinging that I overlooked? FYI I have been successfully able to ping www.google.com and surf the web so I know it is not a network problem from Ubuntu's end or even my work putty terminal but something is getting lost somewhere.


title: Wait for background processes to finish with inverse match process ID

text: I'm looking to run a number of background processes in a loop, but only want to wait for all of those processes to finish, still allowing another background process to continue. After doing some research, I only see solutions that would require me to list every process ID I wish to `wait` for instead of matching them inversely against a single process ID. It seems that something like `wait != $pid` would be very useful. example script:               #!/bin/bash          command1 &     pid=$!     for i in ${array[@]}; do         for n in $(seq 3); do             if [ $n -eq 1 ];                 command2 > file &             else                 command2 >> file &             fi         done     done      In this example I'm looking to wait for every process to finish except `$pid` without having to list them all using the `wait` command. Is this possible?


title: Check argument before program run

text: I have noticed that, when I type `unzip` in bash and press **tab** , auto- complete works only on files with .zip extension. How is that done? What if I would like to make program that would accept only image files, how to restrict auto-complete to certain extensions (eg .jpg and .png only). Is this some kind of system setting or an programming setting that vary for languages (bash, C++, python) ?


title: Parsing the log file test into tabular format

text: How to display below test file in tabular format as below: Output should be like:               ma1-test1.cor.dns.com                                                                     cmd                         -                   stdout            -             stderr          splunk status | grep -i splunkd  -   splunkd is not running.  -                 -     ps -ef | grep -i httpd | wc -l        -           0                             -          ma1-test2.cor.dns.com                                                                 cmd                         -                   stdout            -             stderr          splunk status | grep -i splunkd  -   splunkd is running  (PID: 31286). -        -     ps -ef | grep -i httpd | wc -l       -            0         -      Log contents:   =================               ma1-test1.cor.dns.com-cmd:-splunk status | grep -i splunkd     ma1-test1.cor.dns.com-stdout:-splunkd is not running.     ma1-test1.cor.dns.com-stderr:-     ma1-test2.cor.dns.com-cmd:-splunk status | grep -i splunkd     ma1-test2.cor.dns.com-stdout:-splunkd is running (PID: 31286).     ma1-test2.cor.dns.com-stderr:-     ma1-test1.cor.dns.com-cmd:-ps -ef | grep -i httpd | wc -l      ma1-test1.cor.dns.com-stdout:-0     ma1-test1.cor.dns.com-stderr:-     ma1-test2.cor.dns.com-cmd:-ps -ef | grep -i httpd | wc -l      ma1-test2.cor.dns.com-stdout:-0     ma1-test2.cor.dns.com-stderr:-


title: Disk Scheduler in Linux

text: I am studying about Disk Scheduling in my OS class. Thought about the disk scheduler in Linux. When I run               cat /sys/block/sda/queue/scheduler      noop anticipatory deadline [cfq]       Someone explain about this noop anticipatory deadline [cfq]. Text books says scan, cscan, look, fifo, sstf...


title: List all RPM packages installed from repo "X"

text: How can I get a list of all of the RPM packages that have been installed on my system from a particular repo (e.g., "epel")?


title: Override the window title for an arbitrary window in KDE and set a custom window title

text: Using KDE here, but there might be a solution that works with other desktops environments too. I often am dealing with many many windows. Most windows contain many tabs (e.g. a Dolphin window with many tabs, or Firefox, Konsole, etc). The window title will change based on my current tab (which for the most part is helpful most of the time), but when working with so many windows I'd like to organize them a bit and **be able to manually re-name the window, overriding the the window title that the application gives**. I might name one Firefox window "Research" and other Firefox window "Documentation" to be able to easily distinguish between the windows that I've used to organize and group different tabs accordingly. Ideally I'd be able to click on a window title bar and easily give it a custom name, but I'd settle for a solution that's slightly more cumbersome as long as it works. I've tried `wmctrl -r :SELECT: -T "Research"` but that only works temporarily (the title is reverted when the application changes it, for example when switching tabs).


I am trying to compile Linux kernel 3.2.36 with its source code on the x86_64 architecture. I followed the following set of commands under my Linux source distribution directory:               make defconfig       make -j8     make install     make modules_install     update-initramfs -c -k 3.2.36      update-grub      I have updated my `grub.cfg` file to load another Linux pointing to the new `initrd3.2.36.img` file. Now when I restart my machine, I went to boot options and loaded the compiled kernel 3.2.36. It boots successfully and stops and a prompt with,               <initramfs>      Few lines above that I am getting following messages,               mount: mounting udev on /dev failed: No such device     w: devtmpfs not available falling back to tmpfs for /dev     BusyBox v 1.185      I just entered `ls`, I am able to find very limited set of commands. I am not able to find useful help from Google. My grub.cfg content               export linux_gfx_mode     if [ "${linux_gfx_mode}" != "text" ]; then load_video; fi     menuentry 'Ubuntu, with Linux 3.2.36' --class ubuntu --class gnu-linux --class gnu --class os {             recordfail             gfxmode $linux_gfx_mode             insmod gzio             insmod part_msdos             insmod ext2             set root='(hd0,msdos1)'             search --no-floppy --fs-uuid --set=root 40ac3762-2ffb-4aec-9e5d-f782f2b50b7e             linux   /boot/vmlinuz-3.2.36 root=UUID=40ac3762-2ffb-4aec-9e5d-f782f2b50b7e ro   quiet splash $vt_handoff             initrd  /boot/initrd.img-3.2.36     }     menuentry 'Ubuntu, with Linux 3.2.36 (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {             recordfail             insmod gzio             insmod part_msdos             insmod ext2             set root='(hd0,msdos1)'             search --no-floppy --fs-uuid --set=root 40ac3762-2ffb-4aec-9e5d-f782f2b50b7e             echo    'Loading Linux 3.2.36 ...'             linux   /boot/vmlinuz-3.2.36 root=UUID=40ac3762-2ffb-4aec-9e5d-f782f2b50b7e ro recovery nomodeset              echo    'Loading initial ramdisk ...'             initrd  /boot/initrd.img-3.2.36     }     submenu "Previous Linux versions" {     menuentry 'Ubuntu, with Linux 3.2.0-35-generic' --class ubuntu --class gnu-linux --class gnu --class os {             recordfail             gfxmode $linux_gfx_mode             insmod gzio             insmod part_msdos             insmod ext2             set root='(hd0,msdos1)'             search --no-floppy --fs-uuid --set=root 40ac3762-2ffb-4aec-9e5d-f782f2b50b7e             linux   /boot/vmlinuz-3.2.0-35-generic root=UUID=40ac3762-2ffb-4aec-9e5d-f782f2b50b7e ro   quiet splash $vt_handoff             initrd  /boot/initrd.img-3.2.0-35-generic     }     menuentry 'Ubuntu, with Linux 3.2.0-35-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {             recordfail             insmod gzio             insmod part_msdos             insmod ext2             set root='(hd0,msdos1)'             search --no-floppy --fs-uuid --set=root 40ac3762-2ffb-4aec-9e5d-f782f2b50b7e             echo    'Loading Linux 3.2.0-35-generic ...'             linux   /boot/vmlinuz-3.2.0-35-generic root=UUID=40ac3762-2ffb-4aec-9e5d-f782f2b50b7e ro recovery nomodeset              echo    'Loading initial ramdisk ...'             initrd  /boot/initrd.img-3.2.0-35-generic     }     }      Can someone help me on how to obtain a Linux shell and add user authentication to my compiled Kernel? I am ready to read any materials or books even, please suggest me.


title: Debugging Linux Kernel with QEMU

text: I was trying to study the debugging of kernel using QEMU. I tried initially and failed due to the fact that there was no virtual file system. The answers to this post suggests that there should be a virtual file system. But it doesn't talk about how to create virtual FS for kernel debugging and how to pass it over to the qemu. Can you help me out?


title: Custom Kickstart ISO process - packages to RPM mapping

text: I want to start by saying that I am new to kickstart so if I use the wrong terms I apologize in advance. **What I am trying to accomplish:** I am trying to create a customer ISO for installation of CentOS and a web-based application that I wrote. I want to create an "appliance" type install to make it easy to deploy a VM or bare- metal server running the application and nothing else. I have an example ISO that is made by another company, based on RHEL, and I am trying to follow what they have done and customize it to my needs. **Question:** I am looking at the ks.cfg file in the example iso I have it defines the packages to be installed, which I believe is ultimately the list of RPMs from directories in the root of the ISO. Below is an excerpt from the ks.cfg file:               #Package install information     %packages     @ base     @ core     @ acme-base     @ acme-platform     @ acme-application      Looking at the directories on the iso i believe @acme-platform is going to cause the installation of /acme/acmeplatform/RPMS/*.rpm My question is how this mapping is defined from @acme-platform to the directory on the ISO where the actual RPMs are stored. EDIT: After reading the first answer I wanted to clarify the question: i am really looking for what file maps the location of the RPMs to the groups that are referenced in the `ks.cfg` file. I see that the actual packages that make up the groups are defined in `/repodata/comps.xml`


title: Determining if a host is online

text: I'm testing stability of a machine and I need way to simply write a Bash script to determine if a host is online or not. How could I script this?               if [ ! $(hostisonline) ]; then         # profit     fi


title: Linux Fedora: can I preserve what I am doing so that everything will be restored when I power up again

text: I have Linux Fedora 20, with Gnome classic desktop. When I power down, via the "Power Down" icon on the top bar, everything shuts down, and everything is gone when I power up again, although I can recover web pages using History in my browser. I would like, if I choose, to have the session restored totally and exactly to the situation when I powered off. Please is this possible, e.g by suspending or sleeping the machine? I cannot find anything already there to do this. I think that `acpi` maybe the answer, but I have read that this may clash with Gnome actions, and I have no `/etc/acpi/handler.sh` file on my system, so I presume that `acpi` is not installed.. I am reluctant to try `acpi` until I know how to do so safely. I would be grateful for any help on this.


title: Linux + Kernel panic

text: when I reboot my Linux machine Linux version 5.5 red hat I get the following warning on the console screen , Linux cant startup and I can't login please advice , how to login as single user mode and how to bypass the following problem ?               umounting old /dev     umounting old /proc     umounting old /sys     switchroot: mount failed: No such file or directory     Kernel panic - not syncing: attempted to kill init!


title: Adding rules to my mail server

text: I need to add rules to my mail server. I need to bcc an email address on outgoing and incoming emails for certain email accounts. The first thing I need to do is to find out what mail server software I'm using! I have ssh access to our dedicated server, but everything was set up by the hosting company. Is there a way I can easily find out what mail server software I have running? Then I need to configure it to add the rules. I guess that this will be different for all mail servers? Or is there a simple way to do it using ssh that is the de facto standard way of doing it? Thank you. In answer to sachin divecar:               tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      5145/tcpserver        In answer to steve (commenter):               Connected to mail.mysite.com.     Escape character is '^]'.     220 myhost.com ESMTP      Steve, I don't know what you've let yourself in for! :p                   1 ?        00:00:01 init         2 ?        00:00:00 kthreadd         3 ?        00:00:00 migration/0         4 ?        00:00:03 ksoftirqd/0         5 ?        00:00:00 watchdog/0         6 ?        00:00:00 migration/1         7 ?        00:00:06 ksoftirqd/1         8 ?        00:00:00 watchdog/1         9 ?        00:00:00 migration/2        10 ?        00:00:03 ksoftirqd/2        11 ?        00:00:00 watchdog/2        12 ?        00:00:00 migration/3        13 ?        00:00:04 ksoftirqd/3        14 ?        00:00:00 watchdog/3        15 ?        00:00:09 events/0        16 ?        00:00:05 events/1        17 ?        00:00:05 events/2        18 ?        00:00:05 events/3        19 ?        00:00:00 khelper        54 ?        00:00:00 kblockd/0        55 ?        00:00:00 kblockd/1        56 ?        00:00:00 kblockd/2        57 ?        00:00:00 kblockd/3        60 ?        00:00:00 kacpid        61 ?        00:00:00 kacpi_notify       136 ?        00:00:00 kseriod       193 ?        00:00:00 pdflush       194 ?        00:00:27 pdflush       195 ?        00:00:08 kswapd0       238 ?        00:00:00 aio/0       239 ?        00:00:00 aio/1       240 ?        00:00:00 aio/2       241 ?        00:00:00 aio/3       884 ?        00:00:00 couriertls      1441 ?        00:00:00 ksuspend_usbd      1443 ?        00:00:00 khubd      1458 ?        00:00:00 ata/0      1459 ?        00:00:00 ata/1      1460 ?        00:00:00 ata/2      1461 ?        00:00:00 ata/3      1462 ?        00:00:00 ata_aux      1762 ?        00:00:00 scsi_eh_0      1763 ?        00:00:00 scsi_eh_1      2860 ?        00:00:00 scsi_eh_2      3103 ?        00:00:39 kjournald      3275 ?        00:00:00 udevd      3685 ?        00:00:00 kpsmoused      4775 ?        00:00:00 ntpd      4776 ?        00:00:00 ntpd      4990 tty4     00:00:00 getty      4991 tty5     00:00:00 getty      4993 tty2     00:00:00 getty      4995 tty3     00:00:00 getty      4997 ?        00:00:00 svscanboot      4998 tty6     00:00:00 getty      5110 ?        00:00:03 svscan      5111 ?        00:00:00 readproctitle      5112 ?        00:00:00 supervise      5113 ?        00:00:00 supervise      5114 ?        00:00:00 supervise      5115 ?        00:00:00 supervise      5116 ?        00:00:00 supervise      5117 ?        00:00:00 supervise      5118 ?        00:00:00 tcpserver      5119 ?        00:00:02 tinydns      5120 ?        00:00:00 multilog      5121 ?        00:00:00 multilog      5122 ?        00:00:00 supervise      5123 ?        00:00:00 tcpserver      5124 ?        00:00:00 multilog      5125 ?        00:00:00 tcpserver      5127 ?        00:00:00 supervise      5128 ?        00:00:00 supervise      5129 ?        00:00:00 supervise      5131 ?        00:00:00 multilog      5132 ?        00:00:08 qmail-send      5133 ?        00:00:00 supervise      5134 ?        00:00:00 run      5135 ?        00:00:02 multilog      5136 ?        00:00:00 supervise      5137 ?        00:00:00 run      5143 ?        00:00:00 supervise      5145 ?        00:00:00 tcpserver      5146 ?        00:00:00 supervise      5148 ?        00:00:00 multilog      5176 ?        00:00:02 qmail-lspawn      5177 ?        00:00:00 qmail-rspawn      5178 ?        00:00:02 qmail-clean      5233 ?        00:00:00 acpid      5240 ?        00:00:00 fghack      5241 ?        00:00:00 fghack      5242 ?        00:00:00 ald <defunct>      5243 ?        00:00:00 ald <defunct>      5244 ?        00:00:13 ald      5262 ?        00:00:00 ald      5309 ?        00:00:00 dd      5311 ?        00:00:00 klogd      5331 ?        00:00:00 sshd      5388 ?        00:00:00 mysqld_safe      5416 ?        00:07:06 mysqld      5417 ?        00:00:00 logger      5710 ?        00:01:47 clamd      5811 ?        00:00:40 freshclam      5826 ?        00:00:00 courierlogger      5827 ?        00:00:00 authdaemond      5842 ?        00:00:00 courierlogger      5843 ?        00:00:00 couriertcpd      5846 ?        00:00:03 authdaemond      5847 ?        00:00:03 authdaemond      5864 ?        00:00:00 courierlogger      5865 ?        00:00:00 couriertcpd      5878 ?        00:00:00 courierlogger      5879 ?        00:00:00 couriertcpd      5898 ?        00:00:00 courierlogger      5899 ?        00:00:00 couriertcpd      5977 ?        00:00:00 xinetd      5999 ?        00:00:00 atd      6010 ?        00:00:01 cron      6093 ?        00:00:22 apache2      6268 tty1     00:00:00 getty      6356 ?        00:00:00 dd      6361 ?        00:00:00 cron      6395 ?        00:00:02 syslogd      6398 ?        00:00:01 sshd      6426 ?        00:00:00 mysqld_safe      6468 ?        00:30:46 mysqld      6469 ?        00:00:00 logger      6471 ?        00:00:45 apache2      8092 ?        00:00:00 apache2      8435 ?        00:00:00 apache2      8438 ?        00:00:00 apache2      8492 ?        00:00:00 pure-ftpd-mysql      9017 ?        00:00:00 imapd      9019 ?        00:00:00 gam_server      9234 ?        00:00:00 apache2      9741 ?        00:00:00 pure-ftpd-mysql      9742 ?        00:00:00 pure-ftpd-mysql      9792 ?        00:00:00 sshd      9794 pts/0    00:00:00 bash      9805 pts/0    00:00:00 ps     16916 ?        00:00:00 apache2     16917 ?        00:00:00 mapssl     16987 ?        00:00:00 syslogd     17527 ?        00:01:52 python


title: How to create a SSH tunnel over 2 servers?

text: I have 2 servers, A and B. I want to create a tunnel from my system to server B but I have some limits to do this. So I have to first tunnel to server A and from server A to server B. My goal is to have a SOCKS Proxy to browse the web. How can I do this?


title: Email signature is distorted in Yahoo's new webmail client

text: I'm using vim+mutt to write e-mails which I send via IMAP through Google. When I include a signature file to be used, and that file contains an ASCII signature (figlet font), it is badly displayed by the (new) Yahoo web-based e-mail client (the lines look miswrapped, which makes the signature unintelligible). However, if I copy the same signature to be included in Gmail's web-based client (in settings > use signature) and send an e-mail to Yahoo mail (in the new web-based client) using that signature, it is correctly displayed. Another weird note is that I have set up the web-based e-mail client (that is the new Yahoo mail) to display the plain text in Courier font, but the signature still looks distorted; yet on a different Yahoo account (this time using the classic Yahoo web-based client) the figlet font signature is displayed properly, which is also the case with my web-based Gmail client if I add the Google Chrome add-on for plain text (if I don't use the add-on, the signature is, again, distorted). I'm still not sure if that has to do with the web client.


title: Why does Debian include "cdrom" in sources.list?

text: Here's my `sources.list`               # deb cdrom:[Debian GNU/Linux 7.0.0 _Wheezy_ - Official amd64 CD Binary-1 20130$          # deb cdrom:[Debian GNU/Linux 7.0.0 _Wheezy_ - Official amd64 CD Binary-1 20130$          deb http://ftp.us.debian.org/debian/ wheezy main     deb-src http://ftp.us.debian.org/debian/ wheezy main          deb http://security.debian.org/ wheezy/updates main     deb-src http://security.debian.org/ wheezy/updates main          # wheezy-updates, previously known as 'volatile'     deb http://ftp.us.debian.org/debian/ wheezy-updates main     deb-src http://ftp.us.debian.org/debian/ wheezy-updates main      If I didn't comment out `cdrom`, I'd be seeing something like               Media change: please insert the disc labeled      'Debian GNU/Linux 7.3.0 _Wheezy_ - Official i386 DVD Binary-1 20131215-03:40'     in the drive '/media/cdrom/' and press enter      Out of curiosity, I did that. I went to VNC and mounted the CD to my VPS but it didn't solve the problem. So the only way to solve it is to comment `cdrom`. So why isn't `cdrom` commented out by default right after the installation? What you need it for? If `cdrom` was important, then you couldn't just comment it out, right?


title: What's the default server root path (CentOS7)

text: In `/etc/httpd/conf/httpd.conf` line 36 the ServerRoot is set. Mine is :               ServerRoot /etc/httpd      But this returns a syntax error when I try to start `httpd` service.   Can anyone give me the default ServerRoot path?


title: set tab color in a tabbed terminal emulator

text: I would like to set in my terminal emulator (i.e. gnome-terminal) the color of the tabs like in the osx's terminal emulator. Is there this feature in any of the linux terminal emulator plethora? EDIT: below a picture to better explain the desired result. ![enter image description here](http://i.stack.imgur.com/6QUaD.png)


title: /proc/self/maps - 3rd mapped piece of file?

text: I'm running Arch linux on my laptop, which is kernel 3.12.9 right now. Something has changed about the way the kernel maps in a dynamically-linked executable and I can't figure it out. Here's the example:               % /usr/bin/cat /proc/self/maps     ...     00400000-0040b000 r-xp 00000000 08:02 1186756             /usr/bin/cat     0060a000-0060b000 r--p 0000a000 08:02 1186756             /usr/bin/cat     0060b000-0060c000 rw-p 0000b000 08:02 1186756             /usr/bin/cat     00d6c000-00d8d000 rw-p 00000000 00:00 0                   [heap]     7f29b3485000-7f29b3623000 r-xp 00000000 08:02 1182988     /usr/lib/libc-2.19.so     ...      My question is: what is the third mapping from `/usr/bin/cat`? Based on `readelf -l /usr/bin/cat`, there's a loadable segment of 0x1f8 bytes that should map at 0x400000. There's a loadable segment of 0xae10 bytes at 0x60ae10. Those two pieces of file correspond to the 00400000-0040b000 mapping, and the 0060a000-0060b000 mapping. But the third mapping, which claims to be at a file offset of 0xb000 bytes, doesn't seem to correspond to any Elf64_Phdr. In fact, the elf header only has 2 PT_LOAD segments. I read through `fs/binfm_elf.c` in the kernel 3.13.2 source code, and I don't see that the kernel maps in anything other than PT_LOAD segments. If I run `strace -o trace.out /usr/bin/cat /proc/self/maps`, I don't see any `mmap()` calls that would map in a piece of `/usr/bin/cat`, so that 3rd piece is mapped in by the kernel. I ran the same command (`cat /proc/self/maps`) on a RHEL server that was running kernel 2.6.18 + RH patches. That only shows 2 pieces of /usr/bin/cat mapped into memory, so this might be new with kernel 3.x.


title: Online remount btrfs of root filesystem with different subvolume (snapshot)

text: Let's say you have a btrfs root filesystem on an online system. You want to revert the filesystem to an earlier state, of which you have a snapshot: `remount /dev/sdaX / -o remount,subvol=snapshots/Y` For the record, I've done this in a test system, and it does **not** work. The command returns with no errors, but the subvolume mounted is the same. If this **did** work, what would be the consequences? My guess is that open file descriptors would still point to the old subvolume, thus possibly leading to "data loss" on the new subvolume, if one was not careful. Assuming one goes to the trouble of closing and reopening all open file descriptors, does this sound feasible? Or are there other types of problems?


title: Grade book program that works on gentoo

text: I am looking for a program that I can use to keep track of and calculate my grade in all my classes without going through and making a spreadsheet for each class.


title: Plotting in gnuplot

text: I have a set of data in a text file (X,Y coordinates which are not sorted). I want to plot it using `gnuplot` and connect plotted points using lines. I tried:               plot "a.txt" with lines      but it is connecting the first point to the second point and so on. I want it to just connect plotted points, not first to second, and so on.


title: Is "Disk failure is imminent" causing the errors I am experiencing?

text: I am getting SMART Status 184 end to end error, and "Disk failure is imminent", suggesting I need to get a new hard drive, and I will do. But now I am also getting error messages such as when running vim:               vim: error while loading shared libraries: libgnomeui-2.so.0: cannot open shared object file: No such file or directory      or apt-get update:               apt-get: error while loading shared libraries: /usr/lib/libapt-pkg.so.4.11: invalid ELF header      Just wondering if the imminent disk failure is causing these problems? System is Ubuntu 10.10 dual boot xp 64bit


title: Aptitude doesn't remove automatically installed packages

text: It seems aptitude doesn't remove automatically installed packages that are not depended on if these packages are suggested by any other (manually installed) ones.               root@host:/# aptitude install unattended-upgrades      The following NEW packages will be installed:       iso-codes{a} lsb-release{a} python-apt{a} python-apt-common{a} python2.6{a} python2.6-minimal{a} unattended-upgrades      ...          root@host:/# aptitude remove unattended-upgrades      The following packages will be REMOVED:         unattended-upgrades           ...          root@host:/# aptitude why python-apt     i   apt Suggests python-apt      I can (somehow) understand why this is desirable, but is there any way to override it


title: How do I move all files output from a command?

text: I have this grep command to find files without the word Attachments in them.               grep -L -- Attachments *      I want to move all the files that are output from that command. How do I do that in bash? Do I use a pipe? Do I use a more wordy if/then statement in a full-on script?


title: How do I get my phone to ring using linphone and MagicJack?

text: I have a VOIP number setup with linphone and IPKall. I am using my old magicJack to connect my handset. The handset works for voice input and output, but when I receive a call, it only rings in the handset speaker, so I have to set the output device to external speakers in order to hear an incoming call. Does anyone know how I can make my handset ring like a normal phone?


title: Command for yum to install all packages without dependency

text: Is there any way for `yum` to install only that packages, that doesn't have any dependencies? I'm trying to install all `python2` libraries. The code:               su -c 'yum install python-\*'      And I've get (ignore that one broken package):               Install                        730 Packages (+257 Dependent packages)     Skipped (dependency problems)    1 Package      But I want install only `python2`-libraries that didn't have dependencies.


title: Emacs function on set of files

text: Is there a way implemented in Emacs to apply a function on a set of files? (Or, if not, do you know of such an extension?) For example, if you have a project in a directory (say, scripts to compile and run, the source, and an XML database). You want to run this function on all those files, one by one:               (defun indent-buffer ()       "Indent the whole buffer according to indent-region-function."       (interactive)       (indent-region (point-min) (point-max)) )      What complicates the picture at least to some degree, although certainly not impossible, is that Emacs must be in the correct mode to execute such a function sensibly. The coolest interface would be to use Emacs as a server, and then send the command, and the file list, as arguments. Second best if it could be done in Dired.


title: Debian Unstable: How do I install this i386 package under AMD64 using multiarch?

text: I am currently running Debian unstable (sid) on a AMD64 platform. I have previously enabled multiarch by:               dpkg --add-architecture i386      ...and successfully installed some i386 packages, including Wine. However, when I try:               apt-get install libwine-print      ...I get the following error message:               The following packages have unmet dependencies:      libwine-print:i386 : Depends: libcups2:i386 (>= 1.4.0) but it is not going to be installed     E: Unable to correct problems, you have held broken packages.      I think I've managed to track it down to a problem with the package `libgssapi-krb5-2`. It looks like there is a mismatch between the package versions (the AMD64 architecture includes `1.10.1+dfsg-6` while i386 includes `1.10.1+dfsg-5`). Is it possible to resolve this so that I can install the i386 version of `libgssapi-krb5-2`? If not, is this a bug that should be reported?


title: Queue a task in a running shell

text: I often start a long running command that is bound to either CPU, Disk, RAM or Internet connection. While that is running, I find that I want to run a similar command. Let's say downloading something big. Then I start a shell with `wget ...1` and let it run. I could open another shell and run the other `wget ...2`, but now they would fight for the bandwidth. When I just type the second command into the running shell, it will execute that later on, since `wget` is not interactive. Is there a reasonable way to do this with either Bash or Fish Shell?


title: How do you set a program as a service in Linux (Debian) but have it switched off by default?

text: When you install Alfresco, it gives you an option of having it installed as a service or not. If you install it as a service, the service starts up on booting but since it's using Tomcat it's too heavy to leave as a background program. In addition, it takes a lot longer to stop than Apache. Therefore, I would like to keep it as a service but have it set to off by default so all I need to do is type `sudo service alfresco start`. While I can leave it set-up not as a service and write a bash script or two, I'd like to learn more about how "services" work in Linux. Apache's not a problem but it would be nice to know where its service parameters are stored and how you can change these.


title: renaming diverse files

text: I store files named like this: word-word2-word3-word4.txt . The number of "words" varies from file to file. I want to replace certain of the dashes with pluses e.g word+word2-word3+word4.txt I want to specify the dashes or minus-signs to change by typing in numbers. I have an awkward script that doesn't work - it does this:   * dashes are supplemented with a semi-colon for later awk splitting purposes   * user types in numbers specifying dashes to replace   * numbers are appended to end of filename e.g aaa-;bbb-;ccc.txt 1 3   * and piped into awk for processing   * in awk, make an array of the appended numbers,   * and an array of the words with a split on the first field   * then gsub ';' for '+' on the split array using the number array to specify the index Here is my grisly script which hardcodes the filename for the purposes of quick fiddling and trialing. I can't think how to exit the awk script usefully. The plan is to exit awk and do a final substitution in sed. I am quite aware this is a dogs dinner of a script displaying plenty of poor- learning. Nevertheless, please offer any help if you are disposed to.               file='wot-;wit-;wet-;wat.txt';      echo -n "type digits";      read nos; varr=$(echo $nos);      newfile=$(echo $file $varr);      echo "$newfile" | awk '{ for (i=2; i<=NF ;i++) arr[i]=$i}                              END{ split($1,spl,"-");                                   for( var in arr ) gsub(";","+", spl[var]);                                    print THIS IS NOT WORKING - CAN'T GET ANYTHING USEFUL OUT }'


title: How to ls using the long format (-l) while still following directory symlinks?

text: I've noticed that `ls -l` doesn't only change the formatting of the output, but also how directory symlinks are handled:               > ls /rmn     biweekly.sh  daily.sh  logs ...          > ls -l /rmn     lrwxrwxrwx 1 root root 18 Feb 11  2011 /rmn -> /root/maintenance/      I'd like to get a detailed listing of what's in `/rmn`, not information about the `/rmn` symlink. One work-around I can think of is to create a shell function that does something like this:               cd /rmn     ls -l     cd -      But that seems too hacky, especially since it messes up the next use of `cd -`. Is there a better way? (I'm on CentOS 2.6.9)


title: How to run linux process and come back to it later?

text: I'm trying to run a minecraft server on linux. Running the server starts an important interactive session. I can run the server in the background by appending `&` at the end of the command and log off the server. But then I don't know how to get back to that interactive session when I log back in. I know about `screen`, but it seems like there should be a better way of running processes in the background and being able to go into them later.


title: Debian console size in VirtualBox

text: I installed Debian 7.2.0 as a guest operating system on VirtualBox 4.2.18 (host OS is Windows 7). I installed Debian without any graphical user interface. When I start up Debian, the console size is awfully small (about 80x40). How could I change that?


title: irc: message notification when away (xchat)

text: We are using IRC in my office for internal communication. It is very impractical to disconnect/reconnect every time I leave/return to my office. Therefore I leave my irc client (`xchat`) running all the time. But lets say, I got stuck in a meeting, and I have my laptop with me. Is there a way to check whether somebody has sent me any message ? I know, that I cannot connect from second machine under the same account. Or perhaps would it be possible to forward a copy of every `irc` message on my `jabber` (which I can then check on my laptop) ? I would not mind, if I got all messages on my `jabber`, regardless whether I am away from my office or not. I hope my question is not too vague. I don't know where to start looking. I would appreciate any comment/suggestion.


title: does the gateway have to be on the subnet?

text: I was looking at bringing up an interface like this in /etc/network/interfaces (this is on debian), with the gateway _outside_ the subnet:               iface eth0 inet static     address 10.100.10.99     netmask 255.255.255.0     gateway 10.100.0.1      but "ifup --verbose eth0" only gives me this error message:               ifconfig eth0 10.100.10.99 netmask 255.255.255.0      route add default gw 10.100.0.1  eth0     SIOCADDRT: No such process     Failed to bring up eth0      Of course, changing the netmask to 255.255.0.0 works just fine. Is that even possible, or is there something else that's the problem? Is there a way to get more information out of ifup? I see one post on the internet that suggests it should work.


title: extract only the substring after double quotes - grep

text: I have a file which is as below.                                    I am trying to extract only the URLs from the above file. I am using the below command.               grep -o '\".*\"' new.txt      However, the above command gives me the output as,               "http://firstlink.com" title="title1">     "http://secondlink.com" title="title2">     "http://thirdlink.com" title="title3">     "http://foruthlink.com" title="title4">      I am trying to extract only the URLs without the `""`. So, my expected output is,               http://firstlink.com     http://secondlink.com     http://thirdlink.com     http://fourthlink.com      How should I change the grep command? Or is it possible to do it in perl, awk or sed command?


title: PHPStorm changes group when saving file

text: When editing a file with PHPStorm, the group is changed from `www-data` to my local user. I've added my local user to the `www-data` group, and if I edit the file with `gedit`/`vim`/etc. the group stays as `www-data`. I suspect PHPStorm must be running as a different user, but when I check `ps`, it shows as my local user. What would cause this program to alter the group of a file it's editing?


title: Why is the service unavailable the second time?

text: How can this happen?               /volume1/homes/me $ tdtool --list     /volume1/homes/me $ tdtool -e 44     Learning device: 44 - Could not connect to the Telldus Service     /volume1/homes/me $ tdtool --list     Error fetching devices: Could not connect to the Telldus Service     /volume1/homes/me $      `tdtool` is using a daemon `telldusd`. The first time `tdtool --list` works but a few seconds later the same command fails, the service is not available any more. Using command `ps`, I can see that the process is still alive. How do I troubleshoot what is going on?


title: rPath clone or similar

text: I just joined a new company, and this company is using rPath in its system deployment process. If you did not know, rPath as a company and solution, has been closed and discontinued when they were acquired by SAS. Is there any similar solution like rPath, or a straight clone for that solution? RPath use the model of "package version snapshot", which for a given day, you can get a snapshot of operating system package that should be working correctly. With that base snapshot, you can create other set of group (eg. web server, mail server, VNC, etc) that sit on top of that, to create a fully working environment. With that version defined, you can go to any machine that subscribe to the snapshot and the group, and do "migration" that will automatically resolve and install the dependencies. If it have errors, you can roll back the installation, and get the last working version.


title: Apache Authorization for the Allowed Users?

text: I have read the answer to this question: http://stackoverflow.com/questions/4102763/apache-basic-authentication-except- for-those-allowed It helped me understand how to not authenticate some users (according to the IP):               <Directory /var/www/files/>         Require valid-user         Allow from 192.168.1.2         Satisfy Any         AuthUserFile /etc/apache2/basic.pwd          AuthName "Please enter username and password"          AuthType Basic       </Directory>      Imagine I have this DB (Different from the DB used for authentication):               User        IP      Mark        192.168.1.2     Mike        192.168.1.3     Karl        192.168.1.4      1- can I allow all the IP addresses stored in the DB using a configuration in Apache? I don't want a static solution (the DB is changing dynamically)? 2- another problem is the authorization of the allowed IP is lost, can Apache use this DB for authorization, if the user is allowed to get the pages without authentication?in details: We know when Apache authenticate users, it knows the user name from authentication credentials, but with the Allowing, the user name will be lost, I want Apache to extract the user name of the IP its allowing from the same table it extract the IP address? UPDATE: Note: I think Tony answer might be helpful but I want other answers too (which don't obligate me to build a module). My Goal of this question is "single sign on":   * I use freeradius to authenticate the internal (inside Network) users so I don't want Apache to re-authenticate them.   * I want Apache to Authenticate external users using LDAP.   * my solution is to use `Allow` Directive to let the internal users without Authentication but I need to Allow them using DB ( first Problem)? and trying to configure Apache to Authorize internal users ( which I didn't authenticate) (second problem)? Note: Authorize the external users is very easy using LDAP (because Apache Knows the name of the user it's dealing with from authentication credentials). Is my suggested solution eligible to do what I want to do, If not what do you suggest as a solution?


title: Sorting records by field backwards (not top to bottom)

text: I have a little script which does a bunch of mounting in preparation for backing up, or which just shows you all currently mounted partitions. I've made it so that it will sort the output on several criteria, the partial output below sorts by partition label:               Label              Filesystem       Size            [a2--0-boot]       /dev/sda2        179M       [a8--2-home]       /dev/sda8        2.0G       [a9--1-var]        /dev/sda9        996M       [b2--1-boot]       /dev/sdb2       1008M       [b11-2-home]       /dev/sdb11       2.0G       [b14-2-var]        /dev/sdb14       2.0G        ... However, it would be useful to be able to sort the partition labels backwards, note I don't mean 'upside down', I mean like this:               [a8--2-home]       /dev/sda8        2.0G       [b11-2-home]       /dev/sdb11       2.0G       [a9--1-var]        /dev/sda9        996M       [b14-2-var]        /dev/sdb14       2.0G       [a2--0-boot]       /dev/sda2        179M       [b2--1-boot]       /dev/sdb2       1008M        ... The reason being, simply that the labels of source partitions and target partitions have the same 'endings', but they start differently due to being on different disks and having different partition numbers, so a backwards sort would list sources and targets together, which would be convinient. (FWIW, 'a8--2-home' means partition '/dev/sda8', about 2GB in size, and mounted as '/home'.) I've tried everything I can think of, and spent hours looking for answers but no luck so far. Can this be done? 'Sort' seems unable to pull it off. In particular the '-r' switch gives an 'upside down' listing, but not the 'backwards' sort I'm looking for.


title: Configuration file for Virtual Console

text: Does any configuration file exist for virtual console, when a user logins in it which is read and executed ? My requirement: To execute some shell commands when a user logins using the virtual console.


title: Error out shell script if plsql program fails

text: In the shell script, I am calling a PLSQL stored procedure               sqlplus -s <<EOF     $v_fcp_login     set head off feed off serverout on size 1000000     exec XXIRIS_TEST_K.XXIRIS_TEST('$v_1',$v_2,$v_3,'$v_4',$v_5);     exit     EOF      But when there is an error in the plsql block, I need to error out shell script which is running as a host concurrent program in oracle but it is not doing so. I am new to the shell script and any help is really appreciated.


title: Can GPL software be bought by a company and still released as GPL?

text: Recently, I downloaded two fairly popular pieces of FOSS software. Both are licensed under the GPL and I downloaded them direct from the project Web site links via SourceForge. I was dismayed to find that one contained embedded advertisements for a competing product while another installed lots of adware- like software on my computer and about 6 Firefox plugins of unknown purpose, each having nothing to do with the function of the software I intended to install. I thought GPL software was non-commercial, but found that this software was "bought" by a company, apparently wanting users to migrate to their paid products. Is this permitted under the GPL?


title: Can rm recursively remove empty directories?

text: In an old version of Unix, the `rm` command would delete directories if they were empty. From the Research Unix Eighth Edition man page for rm: "If an entry is a directory it is removed only if empty." I like this behaviour, so I've got this alias in my `/etc/profile`: `alias rm='rm -d'` I'm using the GNU coreutils version of `rm`, in which `-d` tells `rm` to go ahead and remove directories if they're empty.      So far so good. This alias allows me to use `rm` like the old days. However, I'd like to take it a step further. I'd like `rm` to delete a directory even if the directory contains other directories, so long as directories are the only thing there. It doesn't matter how deep the directory structure goes, as long as there aren't any files in there, just empty (once you get to the bottom) directories, I'd like `rm` to remove them all. Could this be written as an alias which would still function as the regular `rm` and delete any files passed to it?


title: Linux EMC scan Lun not working

text: We have `CX4-120 EMC SAN storage`, I expend existing `LUN` size to 20GB but now i am not able to see any cylinder changes on host `fdisk -l` output. Following command i am running to `re-scan` my hda or LUN               echo "1" > /sys/class/fc_host/host1/issue_lip     echo "1" > /sys/class/fc_host/host2/issue_lip      And then               echo "- - -" > /sys/class/scsi_host/host1/scan     echo "- - -" > /sys/class/scsi_host/host2/scan     echo "- - -" > /sys/class/scsi_host/host3/scan     echo "- - -" > /sys/class/scsi_host/host4/scan     echo "- - -" > /sys/class/scsi_host/host5/scan     echo "- - -" > /sys/class/scsi_host/host6/scan     echo "- - -" > /sys/class/scsi_host/host7/scan      But still `fdisk -l /dev/emcpowere` showing old cylinder size, Am i missing something? I have qlogic hda


title: System freezes upon executing any boot option in a live USB installation of Mint

text: ## Problem I'm trying to install **Linux Mint 16, 64-bit, MATE** using a live USB. The boot option menu itself is responsive and work as expected. However, when I execute any of said boot options, the system freezes. The same thing occurs when installing Ubuntu. **Fedora 20 and Debian 7.4.0 both install successfully** If I mount the image onto the USB using, specifically, **YUMI - Multiboot USB Creator** the system manages to print a few lines of text. The text is visible in one of the images found in the link below. Imgur album of my screen after the problem has occured. ## Already tried   1. Mounting the image onto the USB drive (FAT32) using **unetbootin** , **LinuxLive USB Creator** and **YUMI - Multiboot USB Creator**.   2. Attempting to install the OS both before and after writing zeros to the entire SSD using the built-in "Erase Disk" feature of PartedMagic.   3. Trying to install the OS while the Live USB is plugged into each of the available USB 2.0 and 3.0 ports.   4. Testing the process, but with only one RAM stick installed.   5. Allowing it to be frozen for up to approximately 5 hours. It didn't seem to change anything.   6. Tested the same USB, image and mounting configurations on two other, Intel-based, computers. It worked correctly both times.   7. Pressing TAB ( **unetbootin** and **YUMI - Multiboot USB Creator** ) and appending the following to the editable field: > noapic nolapic acpi=off > > > ## Ideas From the information I've gathered various boards found via Google, my motherboard's integrated NIC is infamous for not being natively supported by any of the major Linux distributions. Perhaps the installation process is halted upon not being able to detect any working NIC(s). Debian, for instance, doesn't natively support my integrated NIC, Atheros AR8171, thus I experienced issues during its installation. My APU, the integrated one of the 7850K CPU, seems to cause many Linux users issues due to incompatible drivers. The screen resolution appears to change right before the system freezes. The last few lines printed by the YUMI - Multiboot USB Creator before the system freezes include the word "radeon". I believe these two facts reinforces the idea that there's some form of issue related to the APU. ## Internal Hardware   * **CPU:** AMD A10-7850K **(Kaveri)** @ 3.7 GHz **(Factory settings)**   * **Motherboard:** ASRock FM2A88X-ITX+ FM2 **(Factory settings)**   * **NIC:** Qualcomm Atheros AR8171 **(Integrated)**   * **GPU:** AMD Radeon R7 Series **(Integrated)**   * **RAM:** Corsair Vengeance 2x4GB DDR3 1600MHz CL9 **(CMZ8GX3M2A1600C9)**   * **SSD:** Corsair Force LS SSD 60 GB   * **HDD:** 1TB Seagate Barracuda® SV35, SATA 6Gb/s, 7200rpm, 64MB   * **DVD/CD Reader:** None


title: Is it possible for a program to have its dedicated X display?

text: Can a program have its own dedicated X display, as though it can start the X display, set the screen size to match its own size and ensure that no other program can use that X display? Some VNC clients specify the ability to run a chosen program in the display, rather than the whole desktop, and I wonder whether it something that is set on the command to bring up the X display. My web mojo isn't that good and I want to be run programs remotely in their own web tabs using noVNC and guacamole.


title: Sum the values in a column except the header

text: I have a file as given below               --------------------------------------------------------------     Name_Customer   Item_Purchased  Item_Amount Credit     --------------------------------------------------------------     Tom              H1_P            7657        N/A         Pras             Track_1         23          N/A     Cha              Brace           9           N/A     Moh              kite37          269         N/A     Prab             Bols            87699       N/A      I need to add the values under the column `Item_Amount` by ignoring the header in the file and print the sum as               Total Amount collected = 95657


title: devilspie detect if application was started with a flag

text: How can I set devilspie to detect if an application was started with the flag `\--hello-world` from terminal? For example `window_name` detects the window title. How can transform in devilspie the following sentence: _if one of flags is`\--hello-world`_?               (if (is (window_name) 'My-title')         (begin            ...         )        )


title: Shifting command output to the right

text: Say I'm writing a `.bashrc` file to give me some useful information in my login terminals and I'm telling it to run the cal command (a nice one). How would I go about shifting the calendar produced to the right to match the formatting of the rest of my `.bashrc` "welcome message"?


title: List Mails by subject

text: I'm writing a script to send mails from a mailbox on a remote server and a script to check if the mails are received at another remote server. For this I have configured mutt. What I now need is to list all mails from the mailbox with a specified subject from the command line. I couldn't find a command option to list mails from cli so I think I have to configure mutt to use Maildir and `grep` files but I'm not sure if that's the best way to achieve my goal.


title: Notifying program that X session is shutting down

text: Ok. I understand X session is a bit vague here so let me clarify what I mean by the phrase. I mean the situation where a person has been presented with a display manger screen ( eg xdm, kdm, gdm, mdm, lightDM ,,, ), "logs in", has finished using the computer, "logs out", the display manager screen is restored. In the last step, processes that are not direct descendents of something like SSH or agetty should all go away. I wish to place cleanup scripts between the "logs out" and the restoring of the display manager. I need to know how X notifies other programs that the window manager is going down, and possibly how to pause the exit, if a program requires it.


title: Processes in Linux

text: As I understand it, process descriptors are stored in a doubly linked list data structure. But a fork can create multiple children for the same process, so that makes me think that there is a tree structure, because multiple processes will point to one parent process. Which is correct? Are process descriptors different from processes?


title: Destroying KVM first try virtual machine

text: I'm trying to understand how KVM works, working on ubuntu 10.04 server. I created one with `sudo ubuntu-vm-builder kvm lucid --arch 'amd64' --mem '512' --rootsize '10248' --swapsize '1024' --kernel-flavour 'server' --hostname 'testuser' --mirror 'http://archive.ubuntu.com/ubuntu' --components 'main' --name 'Test U' --user 'testuser' --pass 'passIused'` First, it created it in `root/ubuntu-kvm` , next time I will choose wiser path Second, I forgot to add `\--libvirt qemu:///system`, so it is not showing up on virsh **I want to delete it!** But how? Documentation lists some options under virsh, but I it is not showing up there. anyone?


title: How do I create new entries for possible default calendar, mail and web browser programs?

text: At least there still is default application selector (though hidden in very inappropriate place, why "system info"?), but seems that xml definitions in /usr/share/gnome-control-center/default-apps/ that worked for Gnome2 are ignored now. What I am trying to do is make Outlook my default email and calendar program. UPDATE: I just mean that: Outlook (not some Outlook-alike program). It runs reasonably well under Crossover, so please don't ask me to use Evolution, I tried and it was real pain.


title: What is the fastest way to write all sectors on a drive?

text: The goal in my case is not to securely erase data, but simply to force sector reallocation by the drives firmware. I have a drive that has had a few file corruptions. It seems to be due to getting very hot at some point in the past, the max reported temperature is 99C ! I've recovered as much data from it as I can with ntfsclone --rescue and mounted the image. The reallocated sector count is zero but the current pending sector count is 233. If I write to the sectors then they will either be remapped or have their status restored , I'm wondering which is faster badblocks -w or dd or something else? I've observed with iotop that badblocks is writing at about 17Mb/s which I don't think is very fast for this drive. dd from /dev/zero gives about 24Mb/s but it pauses frequently and the average seems about 13.5Mb/s, again seems too slow for this drive. At this rate it would take a whole day and night to zero the drive. Perhaps I'm not using dd correctly and there are betters ways to make a large sequential write.


title: Can I get the backup option of cp and mv to work with directories?

text: --backup[=CONTROL]         make a backup of each existing destination file      The man page does say that it works on file. It doesn't seem to have any effect on directories. Is there anyway to make this work with directories as well? I want the destination directory, if it exists, to be backed up in the same way that a file would be backed up.


title: Determine if a specific process is 32- or 64-Bit

text: Given a 2.6.x or newer Linux kernel and existing userland that is capable of running both ELF32 and ELF64 binaries (i.e. well past How do I know that my CPU supports 64bit operating systems under Linux?) how can I determine if a given process (by PID) is running in 32- or 64-bit mode? The naive solution would be to run:               file -L /proc/pid/exe | grep -o 'ELF ..-bit [LM]SB'      but is that information exposed directly in `/proc` without relying on `libmagic`?


title: awk print ' char

text: I want to print:               cat file.log | awk '{print nir's $1}'      output should be:               nir's aaa     nir's bbb     nir's abc     nir's dbc      The problem is with the `'` in `nir's`. I also tried:               cat file.log | awk '{print nir\'s $1}'     cat file.log | awk '{print nir''s $1}'     cat file.log | awk '{print nir'''s $1}'


title: Extending/resizing Fedora Guest-OS root-drive in VirtualBox

text: I hope you can help me with that:   My VirtualBox Guest-OS (Fedora 19) told me, that there is not enough free disk-space availabe, so I first increased the .vdi-file by using the Windows- Commandline:               VBoxManage.exe modifyhd "path" --resize 20480      After that VirtualBox correctly shows a bigger virtual hdd. Then I booted the VirtualMachine with a Fedora(and later Ubuntu to test)-LiveCD and first set the LVM-size to 20GB with               pvresize /dev/sda2 --setphysicalvolumesize 20G      That worked fine, but then I tried to resize the root-partition with:               lvresize -l+100%FREE -r /dev/fedora/root      And I get this error-message:               Extending logical volume root to 16,71 GiB       device-mapper: resume ioctl on  failed: invalid argument       Unable to resume fedora-root (253:1)       Problem reactivating root      After that it is impossible to use the root. I tried to do it with the swap- partition as well (to find out, if it is just the root) and it didn't work either. I tried lvextend and it didn't work. The drive is suspended after this and I can not reactivate it using               lvchange -a y      Same error there. Maybe somebody can help me with that? I do have a backup of that machine, so that I can always start at the beginning :-)


title: Find and change certain LaTeX coding in vim, using regular expressions?

text: How can I change the following LaTeX coding:               \cite{1,3-7,9}       to               \cite{1,3,4,5,6,7,9}        in vim? I would prefer to use regular expressions.


title: Run startx & automatically embedded syste,

text: I am working with a board in which I run my application which use th graphical mode. Everything works perfect. I start the graphical mode like this:               startx &      and then I run my application like this:               ./myApplication      And it works The Problem is that I want to run the graphical mode automatically, I mean I want to switch the board on and see the graphical mode, then I just need to run my application. Is it that possible? I tried to add to the init.d a script like this:               #!/bin/sh     #     #Start     #     echo "Start......"     ifconfig eth0 X.X.X.X     startx &     exit $?      I rename this like S80Example.sh and add to the init.d, and it seems that works, but the graphic mode is not load propertly, and not works fine. How can I solved this? Thank you so much


title: Copy newest file in directory over SSH

text: **How might one copy the newest text file from a particular directory on a remote server to his local machine?** On the server itself I can do the following:               $ cat `cd /home/user/dir ; readlink -f $(ls -t | head -1)` > ~/newest.txt      This puts the content of the newest file into `~/newest.txt`. However, I cannot run this over SSH because the local system tries to interpret the tick marks and `$(*)` commands. Id est, this does not work:               $ ssh me@server.com "cat `cd /home/user/dir ; readlink -f $(ls -t | head -1)`" > ~/newest.txt     bash: cd: /home/user/dir: No such file or directory     Connection to server.com closed.      Obviously, `/home/user/dir` does not exist on _my local machine_. I tried using SSH with the `-t` flag as well, this did not help. **How can I get the ticks and`$()` to be parsed on the remote machine, not on my local machine?** As an aside, somebody smarter than me once declared that the output of `ls` shall not be parsed. We can safely assume for purposes of this question that the filenames contain only printable ASCII characters. However, answers which address the general case would be great as well as I do want to _learn_ , not just get by this once.


title: wine crashes - out of GDI object handles?

text: Running a program under wine it crashes after a while with many of the following messages: > fixme:olepicture:OLEPictureImpl_FindConnectionPoint no connection point for > {33ad4f92-6699-11cf-b70c-00aa0060d393} and > err:gdi:alloc_gdi_handle out of GDI object handles, expect a crash Any ideas how to fix this?


title: Program does not terminate when called from udev

text: I've written a program in C#/Mono that probes a device to determine if it is a modem. The program works fine from the command line. However, when it is called from `PROGRAM=` in a udev rule, the program runs properly until the end, and then fails to terminate. As an additional piece of information, the program _does_ terminate when called from `RUN+=`. The program also terminates successfully, even when called from `PROGRAM=`, on a different system based on Ubuntu. The system in question here is running Gentoo. Additionally, a one line "Hello world" application written in C# has the same symptoms as my application. What could cause the program not to terminate?


title: Custom live distro - ways to detect it is running inside virtual machine (or prevent running in VM altogether)

text: I am creating a custom live distro that will be a specialist work environment for those of my employees that are on the road. I am looking for ways to detect or, ideally, prevent my live distro from being run inside a virtual machine (I am only worried about Windows desktop virtualization like VMWare, VirtualBox; I'm not bothered about KVM/Xen). Are there reasonably easy mechanisms to either cripple my live distro (e.g. by removing kernel drivers) so it does not run at all within a VM, or at least be able to detect it? If there are, what are the potential pitfalls? The users won't be overly technical so I just need to make it hard enough to circumvent detection/reporting/running inside VM. Any thoughts will be greatly appreciated.